massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-tsserver / node_modules / typescript / lib / typingsInstaller.js
index d0bfd8e3e826108ce3dfb86410da70cfcc45d2be..514f48a465492f3c4cecd41cb1cf064c7b4c2ee3 100644 (file)
@@ -15,10 +15,14 @@ and limitations under the License.
 
 
 "use strict";
-var __spreadArray = (this && this.__spreadArray) || function (to, from) {
-    for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
-        to[j] = from[i];
-    return to;
+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));
 };
 var __assign = (this && this.__assign) || function () {
     __assign = Object.assign || function(t) {
@@ -81,11 +85,11 @@ var ts;
 (function (ts) {
     // WARNING: The script `configurePrerelease.ts` uses a regexp to parse out these values.
     // If changing the text in this section, be sure to test `configurePrerelease` too.
-    ts.versionMajorMinor = "4.2";
+    ts.versionMajorMinor = "4.5";
     // The following is baselined as a literal template type without intervention
     /** The version of the TypeScript compiler release */
     // eslint-disable-next-line @typescript-eslint/no-inferrable-types
-    ts.version = "4.2.3";
+    ts.version = "4.5.2";
     /* @internal */
     var Comparison;
     (function (Comparison) {
@@ -114,21 +118,24 @@ var ts;
             return typeof Set !== "undefined" && "entries" in Set.prototype && new Set([0]).size === 1 ? Set : undefined;
         }
         NativeCollections.tryGetNativeSet = tryGetNativeSet;
-    })(NativeCollections = ts.NativeCollections || (ts.NativeCollections = {}));
-})(ts || (ts = {}));
-/* @internal */
-var ts;
-(function (ts) {
+    })(NativeCollections || (NativeCollections = {}));
+    /* @internal */
+    ts.Map = getCollectionImplementation("Map", "tryGetNativeMap", "createMapShim");
+    /* @internal */
+    ts.Set = getCollectionImplementation("Set", "tryGetNativeSet", "createSetShim");
+    /* @internal */
     function getCollectionImplementation(name, nativeFactory, shimFactory) {
         var _a;
         // NOTE: ts.ShimCollections will be defined for typescriptServices.js but not for tsc.js, so we must test for it.
-        var constructor = (_a = ts.NativeCollections[nativeFactory]()) !== null && _a !== void 0 ? _a : ts.ShimCollections === null || ts.ShimCollections === void 0 ? void 0 : ts.ShimCollections[shimFactory](getIterator);
+        var constructor = (_a = NativeCollections[nativeFactory]()) !== null && _a !== void 0 ? _a : ts.ShimCollections === null || ts.ShimCollections === void 0 ? void 0 : ts.ShimCollections[shimFactory](ts.getIterator);
         if (constructor)
             return constructor;
-        throw new Error("TypeScript requires an environment that provides a compatible native " + name + " implementation.");
+        throw new Error("TypeScript requires an environment that provides a compatible native ".concat(name, " implementation."));
     }
-    ts.Map = getCollectionImplementation("Map", "tryGetNativeMap", "createMapShim");
-    ts.Set = getCollectionImplementation("Set", "tryGetNativeSet", "createSetShim");
+})(ts || (ts = {}));
+/* @internal */
+var ts;
+(function (ts) {
     function getIterator(iterable) {
         if (iterable) {
             if (isArray(iterable))
@@ -770,7 +777,7 @@ var ts;
             return array1;
         if (!some(array1))
             return array2;
-        return __spreadArray(__spreadArray([], array1), array2);
+        return __spreadArray(__spreadArray([], array1, true), array2, true);
     }
     ts.concatenate = concatenate;
     function selectIndex(_, i) {
@@ -1486,26 +1493,36 @@ var ts;
     function cast(value, test) {
         if (value !== undefined && test(value))
             return value;
-        return ts.Debug.fail("Invalid cast. The supplied value " + value + " did not pass the test '" + ts.Debug.getFunctionName(test) + "'.");
+        return ts.Debug.fail("Invalid cast. The supplied value ".concat(value, " did not pass the test '").concat(ts.Debug.getFunctionName(test), "'."));
     }
     ts.cast = cast;
     /** Does nothing. */
     function noop(_) { }
     ts.noop = noop;
     /** Do nothing and return false */
-    function returnFalse() { return false; }
+    function returnFalse() {
+        return false;
+    }
     ts.returnFalse = returnFalse;
     /** Do nothing and return true */
-    function returnTrue() { return true; }
+    function returnTrue() {
+        return true;
+    }
     ts.returnTrue = returnTrue;
     /** Do nothing and return undefined */
-    function returnUndefined() { return undefined; }
+    function returnUndefined() {
+        return undefined;
+    }
     ts.returnUndefined = returnUndefined;
     /** Returns its argument. */
-    function identity(x) { return x; }
+    function identity(x) {
+        return x;
+    }
     ts.identity = identity;
     /** Returns lower case string */
-    function toLowerCase(x) { return x.toLowerCase(); }
+    function toLowerCase(x) {
+        return x.toLowerCase();
+    }
     ts.toLowerCase = toLowerCase;
     // We convert the file names to lower case as key for file name on case insensitive file system
     // While doing so we need to handle special characters (eg \u0130) to ensure that we dont convert
@@ -1567,7 +1584,7 @@ var ts;
     function memoizeOne(callback) {
         var map = new ts.Map();
         return function (arg) {
-            var key = typeof arg + ":" + arg;
+            var key = "".concat(typeof arg, ":").concat(arg);
             var value = map.get(key);
             if (value === undefined && !map.has(key)) {
                 value = callback(arg);
@@ -1928,10 +1945,46 @@ var ts;
      * Takes a string like "jquery-min.4.2.3" and returns "jquery"
      */
     function removeMinAndVersionNumbers(fileName) {
-        // Match a "." or "-" followed by a version number or 'min' at the end of the name
-        var trailingMinOrVersion = /[.-]((min)|(\d+(\.\d+)*))$/;
-        // The "min" or version may both be present, in either order, so try applying the above twice.
-        return fileName.replace(trailingMinOrVersion, "").replace(trailingMinOrVersion, "");
+        // We used to use the regex /[.-]((min)|(\d+(\.\d+)*))$/ and would just .replace it twice.
+        // Unfortunately, that regex has O(n^2) performance because v8 doesn't match from the end of the string.
+        // Instead, we now essentially scan the filename (backwards) ourselves.
+        var end = fileName.length;
+        for (var pos = end - 1; pos > 0; pos--) {
+            var ch = fileName.charCodeAt(pos);
+            if (ch >= 48 /* _0 */ && ch <= 57 /* _9 */) {
+                // Match a \d+ segment
+                do {
+                    --pos;
+                    ch = fileName.charCodeAt(pos);
+                } while (pos > 0 && ch >= 48 /* _0 */ && ch <= 57 /* _9 */);
+            }
+            else if (pos > 4 && (ch === 110 /* n */ || ch === 78 /* N */)) {
+                // Looking for "min" or "min"
+                // Already matched the 'n'
+                --pos;
+                ch = fileName.charCodeAt(pos);
+                if (ch !== 105 /* i */ && ch !== 73 /* I */) {
+                    break;
+                }
+                --pos;
+                ch = fileName.charCodeAt(pos);
+                if (ch !== 109 /* m */ && ch !== 77 /* M */) {
+                    break;
+                }
+                --pos;
+                ch = fileName.charCodeAt(pos);
+            }
+            else {
+                // This character is not part of either suffix pattern
+                break;
+            }
+            if (ch !== 45 /* minus */ && ch !== 46 /* dot */) {
+                break;
+            }
+            end = pos;
+        }
+        // end might be fileName.length, in which case this should internally no-op
+        return end === fileName.length ? fileName : fileName.slice(0, end);
     }
     ts.removeMinAndVersionNumbers = removeMinAndVersionNumbers;
     /** Remove an item from an array, moving everything to its right one space left. */
@@ -1981,7 +2034,7 @@ var ts;
     ts.createGetCanonicalFileName = createGetCanonicalFileName;
     function patternText(_a) {
         var prefix = _a.prefix, suffix = _a.suffix;
-        return prefix + "*" + suffix;
+        return "".concat(prefix, "*").concat(suffix);
     }
     ts.patternText = patternText;
     /**
@@ -2172,6 +2225,33 @@ var ts;
         return array.slice(0, index);
     }
     ts.takeWhile = takeWhile;
+    /**
+     * Removes the leading and trailing white space and line terminator characters from a string.
+     */
+    ts.trimString = !!String.prototype.trim ? (function (s) { return s.trim(); }) : function (s) { return ts.trimStringEnd(ts.trimStringStart(s)); };
+    /**
+     * Returns a copy with trailing whitespace removed.
+     */
+    ts.trimStringEnd = !!String.prototype.trimEnd ? (function (s) { return s.trimEnd(); }) : trimEndImpl;
+    /**
+     * Returns a copy with leading whitespace removed.
+     */
+    ts.trimStringStart = !!String.prototype.trimStart ? (function (s) { return s.trimStart(); }) : function (s) { return s.replace(/^\s+/g, ""); };
+    /**
+     * https://jsbench.me/gjkoxld4au/1
+     * The simple regex for this, /\s+$/g is O(n^2) in v8.
+     * The native .trimEnd method is by far best, but since that's technically ES2019,
+     * we provide a (still much faster than the simple regex) fallback.
+     */
+    function trimEndImpl(s) {
+        var end = s.length - 1;
+        while (end >= 0) {
+            if (!ts.isWhiteSpaceLike(s.charCodeAt(end)))
+                break;
+            end--;
+        }
+        return s.slice(0, end + 1);
+    }
 })(ts || (ts = {}));
 /* @internal */
 var ts;
@@ -2267,7 +2347,7 @@ var ts;
         }
         function fail(message, stackCrawlMark) {
             debugger;
-            var e = new Error(message ? "Debug Failure. " + message : "Debug Failure.");
+            var e = new Error(message ? "Debug Failure. ".concat(message) : "Debug Failure.");
             if (Error.captureStackTrace) {
                 Error.captureStackTrace(e, stackCrawlMark || fail);
             }
@@ -2275,12 +2355,12 @@ var ts;
         }
         Debug.fail = fail;
         function failBadSyntaxKind(node, message, stackCrawlMark) {
-            return fail((message || "Unexpected node.") + "\r\nNode " + formatSyntaxKind(node.kind) + " was unexpected.", stackCrawlMark || failBadSyntaxKind);
+            return fail("".concat(message || "Unexpected node.", "\r\nNode ").concat(formatSyntaxKind(node.kind), " was unexpected."), stackCrawlMark || failBadSyntaxKind);
         }
         Debug.failBadSyntaxKind = failBadSyntaxKind;
         function assert(expression, message, verboseDebugInfo, stackCrawlMark) {
             if (!expression) {
-                message = message ? "False expression: " + message : "False expression.";
+                message = message ? "False expression: ".concat(message) : "False expression.";
                 if (verboseDebugInfo) {
                     message += "\r\nVerbose Debug Information: " + (typeof verboseDebugInfo === "string" ? verboseDebugInfo : verboseDebugInfo());
                 }
@@ -2290,26 +2370,26 @@ var ts;
         Debug.assert = assert;
         function assertEqual(a, b, msg, msg2, stackCrawlMark) {
             if (a !== b) {
-                var message = msg ? msg2 ? msg + " " + msg2 : msg : "";
-                fail("Expected " + a + " === " + b + ". " + message, stackCrawlMark || assertEqual);
+                var message = msg ? msg2 ? "".concat(msg, " ").concat(msg2) : msg : "";
+                fail("Expected ".concat(a, " === ").concat(b, ". ").concat(message), stackCrawlMark || assertEqual);
             }
         }
         Debug.assertEqual = assertEqual;
         function assertLessThan(a, b, msg, stackCrawlMark) {
             if (a >= b) {
-                fail("Expected " + a + " < " + b + ". " + (msg || ""), stackCrawlMark || assertLessThan);
+                fail("Expected ".concat(a, " < ").concat(b, ". ").concat(msg || ""), stackCrawlMark || assertLessThan);
             }
         }
         Debug.assertLessThan = assertLessThan;
         function assertLessThanOrEqual(a, b, stackCrawlMark) {
             if (a > b) {
-                fail("Expected " + a + " <= " + b, stackCrawlMark || assertLessThanOrEqual);
+                fail("Expected ".concat(a, " <= ").concat(b), stackCrawlMark || assertLessThanOrEqual);
             }
         }
         Debug.assertLessThanOrEqual = assertLessThanOrEqual;
         function assertGreaterThanOrEqual(a, b, stackCrawlMark) {
             if (a < b) {
-                fail("Expected " + a + " >= " + b, stackCrawlMark || assertGreaterThanOrEqual);
+                fail("Expected ".concat(a, " >= ").concat(b), stackCrawlMark || assertGreaterThanOrEqual);
             }
         }
         Debug.assertGreaterThanOrEqual = assertGreaterThanOrEqual;
@@ -2350,45 +2430,47 @@ var ts;
         function assertNever(member, message, stackCrawlMark) {
             if (message === void 0) { message = "Illegal value:"; }
             var detail = typeof member === "object" && ts.hasProperty(member, "kind") && ts.hasProperty(member, "pos") && formatSyntaxKind ? "SyntaxKind: " + formatSyntaxKind(member.kind) : JSON.stringify(member);
-            return fail(message + " " + detail, stackCrawlMark || assertNever);
+            return fail("".concat(message, " ").concat(detail), stackCrawlMark || assertNever);
         }
         Debug.assertNever = assertNever;
         function assertEachNode(nodes, test, message, stackCrawlMark) {
             if (shouldAssertFunction(1 /* Normal */, "assertEachNode")) {
-                assert(test === undefined || ts.every(nodes, test), message || "Unexpected node.", function () { return "Node array did not pass test '" + getFunctionName(test) + "'."; }, stackCrawlMark || assertEachNode);
+                assert(test === undefined || ts.every(nodes, test), message || "Unexpected node.", function () { return "Node array did not pass test '".concat(getFunctionName(test), "'."); }, stackCrawlMark || assertEachNode);
             }
         }
         Debug.assertEachNode = assertEachNode;
         function assertNode(node, test, message, stackCrawlMark) {
             if (shouldAssertFunction(1 /* Normal */, "assertNode")) {
-                assert(node !== undefined && (test === undefined || test(node)), message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node.kind) + " did not pass test '" + getFunctionName(test) + "'."; }, stackCrawlMark || assertNode);
+                assert(node !== undefined && (test === undefined || test(node)), message || "Unexpected node.", function () { return "Node ".concat(formatSyntaxKind(node === null || node === void 0 ? void 0 : node.kind), " did not pass test '").concat(getFunctionName(test), "'."); }, stackCrawlMark || assertNode);
             }
         }
         Debug.assertNode = assertNode;
         function assertNotNode(node, test, message, stackCrawlMark) {
             if (shouldAssertFunction(1 /* Normal */, "assertNotNode")) {
-                assert(node === undefined || test === undefined || !test(node), message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node.kind) + " should not have passed test '" + getFunctionName(test) + "'."; }, stackCrawlMark || assertNotNode);
+                assert(node === undefined || test === undefined || !test(node), message || "Unexpected node.", function () { return "Node ".concat(formatSyntaxKind(node.kind), " should not have passed test '").concat(getFunctionName(test), "'."); }, stackCrawlMark || assertNotNode);
             }
         }
         Debug.assertNotNode = assertNotNode;
         function assertOptionalNode(node, test, message, stackCrawlMark) {
             if (shouldAssertFunction(1 /* Normal */, "assertOptionalNode")) {
-                assert(test === undefined || node === undefined || test(node), message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node.kind) + " did not pass test '" + getFunctionName(test) + "'."; }, stackCrawlMark || assertOptionalNode);
+                assert(test === undefined || node === undefined || test(node), message || "Unexpected node.", function () { return "Node ".concat(formatSyntaxKind(node === null || node === void 0 ? void 0 : node.kind), " did not pass test '").concat(getFunctionName(test), "'."); }, stackCrawlMark || assertOptionalNode);
             }
         }
         Debug.assertOptionalNode = assertOptionalNode;
         function assertOptionalToken(node, kind, message, stackCrawlMark) {
             if (shouldAssertFunction(1 /* Normal */, "assertOptionalToken")) {
-                assert(kind === undefined || node === undefined || node.kind === kind, message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node.kind) + " was not a '" + formatSyntaxKind(kind) + "' token."; }, stackCrawlMark || assertOptionalToken);
+                assert(kind === undefined || node === undefined || node.kind === kind, message || "Unexpected node.", function () { return "Node ".concat(formatSyntaxKind(node === null || node === void 0 ? void 0 : node.kind), " was not a '").concat(formatSyntaxKind(kind), "' token."); }, stackCrawlMark || assertOptionalToken);
             }
         }
         Debug.assertOptionalToken = assertOptionalToken;
         function assertMissingNode(node, message, stackCrawlMark) {
             if (shouldAssertFunction(1 /* Normal */, "assertMissingNode")) {
-                assert(node === undefined, message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node.kind) + " was unexpected'."; }, stackCrawlMark || assertMissingNode);
+                assert(node === undefined, message || "Unexpected node.", function () { return "Node ".concat(formatSyntaxKind(node.kind), " was unexpected'."); }, stackCrawlMark || assertMissingNode);
             }
         }
         Debug.assertMissingNode = assertMissingNode;
+        function type(_value) { }
+        Debug.type = type;
         function getFunctionName(func) {
             if (typeof func !== "function") {
                 return "";
@@ -2404,7 +2486,7 @@ var ts;
         }
         Debug.getFunctionName = getFunctionName;
         function formatSymbol(symbol) {
-            return "{ name: " + ts.unescapeLeadingUnderscores(symbol.escapedName) + "; flags: " + formatSymbolFlags(symbol.flags) + "; declarations: " + ts.map(symbol.declarations, function (node) { return formatSyntaxKind(node.kind); }) + " }";
+            return "{ name: ".concat(ts.unescapeLeadingUnderscores(symbol.escapedName), "; flags: ").concat(formatSymbolFlags(symbol.flags), "; declarations: ").concat(ts.map(symbol.declarations, function (node) { return formatSyntaxKind(node.kind); }), " }");
         }
         Debug.formatSymbol = formatSymbol;
         /**
@@ -2425,7 +2507,7 @@ var ts;
                         break;
                     }
                     if (enumValue !== 0 && enumValue & value) {
-                        result = "" + result + (result ? "|" : "") + enumName;
+                        result = "".concat(result).concat(result ? "|" : "").concat(enumName);
                         remainingFlags &= ~enumValue;
                     }
                 }
@@ -2458,6 +2540,10 @@ var ts;
             return formatEnum(kind, ts.SyntaxKind, /*isFlags*/ false);
         }
         Debug.formatSyntaxKind = formatSyntaxKind;
+        function formatSnippetKind(kind) {
+            return formatEnum(kind, ts.SnippetKind, /*isFlags*/ false);
+        }
+        Debug.formatSnippetKind = formatSnippetKind;
         function formatNodeFlags(flags) {
             return formatEnum(flags, ts.NodeFlags, /*isFlags*/ true);
         }
@@ -2531,7 +2617,7 @@ var ts;
                                                                     this.flags & 1 /* Unreachable */ ? "FlowUnreachable" :
                                                                         "UnknownFlow";
                             var remainingFlags = this.flags & ~(2048 /* Referenced */ - 1);
-                            return "" + flowHeader + (remainingFlags ? " (" + formatFlowFlags(remainingFlags) + ")" : "");
+                            return "".concat(flowHeader).concat(remainingFlags ? " (".concat(formatFlowFlags(remainingFlags), ")") : "");
                         }
                     },
                     __debugFlowFlags: { get: function () { return formatEnum(this.flags, ts.FlowFlags, /*isFlags*/ true); } },
@@ -2566,8 +2652,11 @@ var ts;
                             // An `Array` with extra properties is rendered as `[A, B, prop1: 1, prop2: 2]`. Most of
                             // these aren't immediately useful so we trim off the `prop1: ..., prop2: ...` part from the
                             // formatted string.
+                            // This regex can trigger slow backtracking because of overlapping potential captures.
+                            // We don't care, this is debug code that's only enabled with a debugger attached -
+                            // we're just taking note of it for anyone checking regex performance in the future.
                             defaultValue = String(defaultValue).replace(/(?:,[\s\w\d_]+:[^,]+)+\]$/, "]");
-                            return "NodeArray " + defaultValue;
+                            return "NodeArray ".concat(defaultValue);
                         }
                     }
                 });
@@ -2622,7 +2711,7 @@ var ts;
                         var symbolHeader = this.flags & 33554432 /* Transient */ ? "TransientSymbol" :
                             "Symbol";
                         var remainingSymbolFlags = this.flags & ~33554432 /* Transient */;
-                        return symbolHeader + " '" + ts.symbolName(this) + "'" + (remainingSymbolFlags ? " (" + formatSymbolFlags(remainingSymbolFlags) + ")" : "");
+                        return "".concat(symbolHeader, " '").concat(ts.symbolName(this), "'").concat(remainingSymbolFlags ? " (".concat(formatSymbolFlags(remainingSymbolFlags), ")") : "");
                     }
                 },
                 __debugFlags: { get: function () { return formatSymbolFlags(this.flags); } }
@@ -2632,11 +2721,11 @@ var ts;
                 __tsDebuggerDisplay: {
                     value: function () {
                         var typeHeader = this.flags & 98304 /* Nullable */ ? "NullableType" :
-                            this.flags & 384 /* StringOrNumberLiteral */ ? "LiteralType " + JSON.stringify(this.value) :
-                                this.flags & 2048 /* BigIntLiteral */ ? "LiteralType " + (this.value.negative ? "-" : "") + this.value.base10Value + "n" :
+                            this.flags & 384 /* StringOrNumberLiteral */ ? "LiteralType ".concat(JSON.stringify(this.value)) :
+                                this.flags & 2048 /* BigIntLiteral */ ? "LiteralType ".concat(this.value.negative ? "-" : "").concat(this.value.base10Value, "n") :
                                     this.flags & 8192 /* UniqueESSymbol */ ? "UniqueESSymbolType" :
                                         this.flags & 32 /* Enum */ ? "EnumType" :
-                                            this.flags & 67359327 /* Intrinsic */ ? "IntrinsicType " + this.intrinsicName :
+                                            this.flags & 67359327 /* Intrinsic */ ? "IntrinsicType ".concat(this.intrinsicName) :
                                                 this.flags & 1048576 /* Union */ ? "UnionType" :
                                                     this.flags & 2097152 /* Intersection */ ? "IntersectionType" :
                                                         this.flags & 4194304 /* Index */ ? "IndexType" :
@@ -2650,12 +2739,12 @@ var ts;
                                                                                         this.objectFlags & 8 /* Tuple */ ? "TupleType" :
                                                                                             this.objectFlags & 16 /* Anonymous */ ? "AnonymousType" :
                                                                                                 this.objectFlags & 32 /* Mapped */ ? "MappedType" :
-                                                                                                    this.objectFlags & 2048 /* ReverseMapped */ ? "ReverseMappedType" :
+                                                                                                    this.objectFlags & 1024 /* ReverseMapped */ ? "ReverseMappedType" :
                                                                                                         this.objectFlags & 256 /* EvolvingArray */ ? "EvolvingArrayType" :
                                                                                                             "ObjectType" :
                                                                                 "Type";
-                        var remainingObjectFlags = this.flags & 524288 /* Object */ ? this.objectFlags & ~2367 /* ObjectTypeKindMask */ : 0;
-                        return "" + typeHeader + (this.symbol ? " '" + ts.symbolName(this.symbol) + "'" : "") + (remainingObjectFlags ? " (" + formatObjectFlags(remainingObjectFlags) + ")" : "");
+                        var remainingObjectFlags = this.flags & 524288 /* Object */ ? this.objectFlags & ~1343 /* ObjectTypeKindMask */ : 0;
+                        return "".concat(typeHeader).concat(this.symbol ? " '".concat(ts.symbolName(this.symbol), "'") : "").concat(remainingObjectFlags ? " (".concat(formatObjectFlags(remainingObjectFlags), ")") : "");
                     }
                 },
                 __debugFlags: { get: function () { return formatTypeFlags(this.flags); } },
@@ -2691,11 +2780,11 @@ var ts;
                         __tsDebuggerDisplay: {
                             value: function () {
                                 var nodeHeader = ts.isGeneratedIdentifier(this) ? "GeneratedIdentifier" :
-                                    ts.isIdentifier(this) ? "Identifier '" + ts.idText(this) + "'" :
-                                        ts.isPrivateIdentifier(this) ? "PrivateIdentifier '" + ts.idText(this) + "'" :
-                                            ts.isStringLiteral(this) ? "StringLiteral " + JSON.stringify(this.text.length < 10 ? this.text : this.text.slice(10) + "...") :
-                                                ts.isNumericLiteral(this) ? "NumericLiteral " + this.text :
-                                                    ts.isBigIntLiteral(this) ? "BigIntLiteral " + this.text + "n" :
+                                    ts.isIdentifier(this) ? "Identifier '".concat(ts.idText(this), "'") :
+                                        ts.isPrivateIdentifier(this) ? "PrivateIdentifier '".concat(ts.idText(this), "'") :
+                                            ts.isStringLiteral(this) ? "StringLiteral ".concat(JSON.stringify(this.text.length < 10 ? this.text : this.text.slice(10) + "...")) :
+                                                ts.isNumericLiteral(this) ? "NumericLiteral ".concat(this.text) :
+                                                    ts.isBigIntLiteral(this) ? "BigIntLiteral ".concat(this.text, "n") :
                                                         ts.isTypeParameterDeclaration(this) ? "TypeParameterDeclaration" :
                                                             ts.isParameter(this) ? "ParameterDeclaration" :
                                                                 ts.isConstructorDeclaration(this) ? "ConstructorDeclaration" :
@@ -2727,7 +2816,7 @@ var ts;
                                                                                                                                                                         ts.isNamedTupleMember(this) ? "NamedTupleMember" :
                                                                                                                                                                             ts.isImportTypeNode(this) ? "ImportTypeNode" :
                                                                                                                                                                                 formatSyntaxKind(this.kind);
-                                return "" + nodeHeader + (this.flags ? " (" + formatNodeFlags(this.flags) + ")" : "");
+                                return "".concat(nodeHeader).concat(this.flags ? " (".concat(formatNodeFlags(this.flags), ")") : "");
                             }
                         },
                         __debugKind: { get: function () { return formatSyntaxKind(this.kind); } },
@@ -2774,10 +2863,10 @@ var ts;
         Debug.enableDebugInfo = enableDebugInfo;
         function formatDeprecationMessage(name, error, errorAfter, since, message) {
             var deprecationMessage = error ? "DeprecationError: " : "DeprecationWarning: ";
-            deprecationMessage += "'" + name + "' ";
-            deprecationMessage += since ? "has been deprecated since v" + since : "is deprecated";
-            deprecationMessage += error ? " and can no longer be used." : errorAfter ? " and will no longer be usable after v" + errorAfter + "." : ".";
-            deprecationMessage += message ? " " + ts.formatStringFromArgs(message, [name], 0) : "";
+            deprecationMessage += "'".concat(name, "' ");
+            deprecationMessage += since ? "has been deprecated since v".concat(since) : "is deprecated";
+            deprecationMessage += error ? " and can no longer be used." : errorAfter ? " and will no longer be usable after v".concat(errorAfter, ".") : ".";
+            deprecationMessage += message ? " ".concat(ts.formatStringFromArgs(message, [name], 0)) : "";
             return deprecationMessage;
         }
         function createErrorDeprecation(name, errorAfter, since, message) {
@@ -2908,11 +2997,11 @@ var ts;
             }
         };
         Version.prototype.toString = function () {
-            var result = this.major + "." + this.minor + "." + this.patch;
+            var result = "".concat(this.major, ".").concat(this.minor, ".").concat(this.patch);
             if (ts.some(this.prerelease))
-                result += "-" + this.prerelease.join(".");
+                result += "-".concat(this.prerelease.join("."));
             if (ts.some(this.build))
-                result += "+" + this.build.join(".");
+                result += "+".concat(this.build.join("."));
             return result;
         };
         Version.zero = new Version(0, 0, 0);
@@ -3014,7 +3103,7 @@ var ts;
     // range-set    ::= range ( logical-or range ) *
     // range        ::= hyphen | simple ( ' ' simple ) * | ''
     // logical-or   ::= ( ' ' ) * '||' ( ' ' ) *
-    var logicalOrRegExp = /\s*\|\|\s*/g;
+    var logicalOrRegExp = /\|\|/g;
     var whitespaceRegExp = /\s+/g;
     // https://github.com/npm/node-semver#range-grammar
     //
@@ -3037,14 +3126,15 @@ var ts;
     // primitive    ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
     // tilde        ::= '~' partial
     // caret        ::= '^' partial
-    var rangeRegExp = /^\s*(~|\^|<|<=|>|>=|=)?\s*([a-z0-9-+.*]+)$/i;
+    var rangeRegExp = /^(~|\^|<|<=|>|>=|=)?\s*([a-z0-9-+.*]+)$/i;
     function parseRange(text) {
         var alternatives = [];
-        for (var _i = 0, _a = text.trim().split(logicalOrRegExp); _i < _a.length; _i++) {
+        for (var _i = 0, _a = ts.trimString(text).split(logicalOrRegExp); _i < _a.length; _i++) {
             var range = _a[_i];
             if (!range)
                 continue;
             var comparators = [];
+            range = ts.trimString(range);
             var match = hyphenRegExp.exec(range);
             if (match) {
                 if (!parseHyphen(match[1], match[2], comparators))
@@ -3053,7 +3143,7 @@ var ts;
             else {
                 for (var _b = 0, _c = range.split(whitespaceRegExp); _b < _c.length; _b++) {
                     var simple = _c[_b];
-                    var match_1 = rangeRegExp.exec(simple);
+                    var match_1 = rangeRegExp.exec(ts.trimString(simple));
                     if (!match_1 || !parseComparator(match_1[1], match_1[2], comparators))
                         return undefined;
                 }
@@ -3178,7 +3268,7 @@ var ts;
         return ts.map(comparators, formatComparator).join(" ");
     }
     function formatComparator(comparator) {
-        return "" + comparator.operator + comparator.operand;
+        return "".concat(comparator.operator).concat(comparator.operand);
     }
 })(ts || (ts = {}));
 /*@internal*/
@@ -3457,22 +3547,14 @@ var ts;
 var ts;
 (function (ts) {
     // enable the above using startTracing()
-})(ts || (ts = {}));
-// `tracingEnabled` should never be used directly, only through the above
-/* @internal */
-(function (ts) {
+    // `tracingEnabled` should never be used directly, only through the above
     var tracingEnabled;
     (function (tracingEnabled) {
-        var Mode;
-        (function (Mode) {
-            Mode[Mode["Project"] = 0] = "Project";
-            Mode[Mode["Build"] = 1] = "Build";
-            Mode[Mode["Server"] = 2] = "Server";
-        })(Mode = tracingEnabled.Mode || (tracingEnabled.Mode = {}));
         var fs;
         var traceCount = 0;
         var traceFd = 0;
         var mode;
+        var typeCatalog = []; // NB: id is index + 1
         var legendPath;
         var legend = [];
         ;
@@ -3484,10 +3566,11 @@ var ts;
                     fs = require("fs");
                 }
                 catch (e) {
-                    throw new Error("tracing requires having fs\n(original error: " + (e.message || e) + ")");
+                    throw new Error("tracing requires having fs\n(original error: ".concat(e.message || e, ")"));
                 }
             }
             mode = tracingMode;
+            typeCatalog.length = 0;
             if (legendPath === undefined) {
                 legendPath = ts.combinePaths(traceDir, "legend.json");
             }
@@ -3495,11 +3578,11 @@ var ts;
             if (!fs.existsSync(traceDir)) {
                 fs.mkdirSync(traceDir, { recursive: true });
             }
-            var countPart = mode === 1 /* Build */ ? "." + process.pid + "-" + ++traceCount
-                : mode === 2 /* Server */ ? "." + process.pid
+            var countPart = mode === "build" ? ".".concat(process.pid, "-").concat(++traceCount)
+                : mode === "server" ? ".".concat(process.pid)
                     : "";
-            var tracePath = ts.combinePaths(traceDir, "trace" + countPart + ".json");
-            var typesPath = ts.combinePaths(traceDir, "types" + countPart + ".json");
+            var tracePath = ts.combinePaths(traceDir, "trace".concat(countPart, ".json"));
+            var typesPath = ts.combinePaths(traceDir, "types".concat(countPart, ".json"));
             legend.push({
                 configFilePath: configFilePath,
                 tracePath: tracePath,
@@ -3515,13 +3598,13 @@ var ts;
         }
         tracingEnabled.startTracing = startTracing;
         /** Stops tracing for the in-progress project and dumps the type catalog. */
-        function stopTracing(typeCatalog) {
+        function stopTracing() {
             ts.Debug.assert(ts.tracing, "Tracing is not in progress");
-            ts.Debug.assert(!!typeCatalog === (mode !== 2 /* Server */)); // Have a type catalog iff not in server mode
+            ts.Debug.assert(!!typeCatalog.length === (mode !== "server")); // Have a type catalog iff not in server mode
             fs.writeSync(traceFd, "\n]\n");
             fs.closeSync(traceFd);
             ts.tracing = undefined;
-            if (typeCatalog) {
+            if (typeCatalog.length) {
                 dumpTypes(typeCatalog);
             }
             else {
@@ -3531,6 +3614,12 @@ var ts;
             }
         }
         tracingEnabled.stopTracing = stopTracing;
+        function recordType(type) {
+            if (mode !== "server") {
+                typeCatalog.push(type);
+            }
+        }
+        tracingEnabled.recordType = recordType;
         var Phase;
         (function (Phase) {
             Phase["Parse"] = "parse";
@@ -3583,32 +3672,42 @@ var ts;
             }
             // test if [time,endTime) straddles a sampling point
             else if (sampleInterval - (time % sampleInterval) <= endTime - time) {
-                writeEvent("X", phase, name, args, "\"dur\":" + (endTime - time), time);
+                writeEvent("X", phase, name, args, "\"dur\":".concat(endTime - time), time);
             }
         }
         function writeEvent(eventType, phase, name, args, extras, time) {
             if (time === void 0) { time = 1000 * ts.timestamp(); }
             // In server mode, there's no easy way to dump type information, so we drop events that would require it.
-            if (mode === 2 /* Server */ && phase === "checkTypes" /* CheckTypes */)
+            if (mode === "server" && phase === "checkTypes" /* CheckTypes */)
                 return;
             ts.performance.mark("beginTracing");
-            fs.writeSync(traceFd, ",\n{\"pid\":1,\"tid\":1,\"ph\":\"" + eventType + "\",\"cat\":\"" + phase + "\",\"ts\":" + time + ",\"name\":\"" + name + "\"");
+            fs.writeSync(traceFd, ",\n{\"pid\":1,\"tid\":1,\"ph\":\"".concat(eventType, "\",\"cat\":\"").concat(phase, "\",\"ts\":").concat(time, ",\"name\":\"").concat(name, "\""));
             if (extras)
-                fs.writeSync(traceFd, "," + extras);
+                fs.writeSync(traceFd, ",".concat(extras));
             if (args)
-                fs.writeSync(traceFd, ",\"args\":" + JSON.stringify(args));
+                fs.writeSync(traceFd, ",\"args\":".concat(JSON.stringify(args)));
             fs.writeSync(traceFd, "}");
             ts.performance.mark("endTracing");
             ts.performance.measure("Tracing", "beginTracing", "endTracing");
         }
-        function indexFromOne(lc) {
-            return {
-                line: lc.line + 1,
-                character: lc.character + 1,
-            };
+        function getLocation(node) {
+            var file = ts.getSourceFileOfNode(node);
+            return !file
+                ? undefined
+                : {
+                    path: file.path,
+                    start: indexFromOne(ts.getLineAndCharacterOfPosition(file, node.pos)),
+                    end: indexFromOne(ts.getLineAndCharacterOfPosition(file, node.end)),
+                };
+            function indexFromOne(lc) {
+                return {
+                    line: lc.line + 1,
+                    character: lc.character + 1,
+                };
+            }
         }
         function dumpTypes(types) {
-            var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
+            var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
             ts.performance.mark("beginDumpTypes");
             var typesPath = legend[legend.length - 1].typesPath;
             var typesFd = fs.openSync(typesPath, "w");
@@ -3620,15 +3719,13 @@ var ts;
                 var type = types[i];
                 var objectFlags = type.objectFlags;
                 var symbol = (_a = type.aliasSymbol) !== null && _a !== void 0 ? _a : type.symbol;
-                var firstDeclaration = (_b = symbol === null || symbol === void 0 ? void 0 : symbol.declarations) === null || _b === void 0 ? void 0 : _b[0];
-                var firstFile = firstDeclaration && ts.getSourceFileOfNode(firstDeclaration);
                 // It's slow to compute the display text, so skip it unless it's really valuable (or cheap)
                 var display = void 0;
                 if ((objectFlags & 16 /* Anonymous */) | (type.flags & 2944 /* Literal */)) {
                     try {
-                        display = (_c = type.checker) === null || _c === void 0 ? void 0 : _c.typeToString(type);
+                        display = (_b = type.checker) === null || _b === void 0 ? void 0 : _b.typeToString(type);
                     }
-                    catch (_s) {
+                    catch (_y) {
                         display = undefined;
                     }
                 }
@@ -3636,26 +3733,52 @@ var ts;
                 if (type.flags & 8388608 /* IndexedAccess */) {
                     var indexedAccessType = type;
                     indexedAccessProperties = {
-                        indexedAccessObjectType: (_d = indexedAccessType.objectType) === null || _d === void 0 ? void 0 : _d.id,
-                        indexedAccessIndexType: (_e = indexedAccessType.indexType) === null || _e === void 0 ? void 0 : _e.id,
+                        indexedAccessObjectType: (_c = indexedAccessType.objectType) === null || _c === void 0 ? void 0 : _c.id,
+                        indexedAccessIndexType: (_d = indexedAccessType.indexType) === null || _d === void 0 ? void 0 : _d.id,
                     };
                 }
                 var referenceProperties = {};
                 if (objectFlags & 4 /* Reference */) {
                     var referenceType = type;
                     referenceProperties = {
-                        instantiatedType: (_f = referenceType.target) === null || _f === void 0 ? void 0 : _f.id,
-                        typeArguments: (_g = referenceType.resolvedTypeArguments) === null || _g === void 0 ? void 0 : _g.map(function (t) { return t.id; }),
+                        instantiatedType: (_e = referenceType.target) === null || _e === void 0 ? void 0 : _e.id,
+                        typeArguments: (_f = referenceType.resolvedTypeArguments) === null || _f === void 0 ? void 0 : _f.map(function (t) { return t.id; }),
+                        referenceLocation: getLocation(referenceType.node),
                     };
                 }
                 var conditionalProperties = {};
                 if (type.flags & 16777216 /* Conditional */) {
                     var conditionalType = type;
                     conditionalProperties = {
-                        conditionalCheckType: (_h = conditionalType.checkType) === null || _h === void 0 ? void 0 : _h.id,
-                        conditionalExtendsType: (_j = conditionalType.extendsType) === null || _j === void 0 ? void 0 : _j.id,
-                        conditionalTrueType: (_l = (_k = conditionalType.resolvedTrueType) === null || _k === void 0 ? void 0 : _k.id) !== null && _l !== void 0 ? _l : -1,
-                        conditionalFalseType: (_o = (_m = conditionalType.resolvedFalseType) === null || _m === void 0 ? void 0 : _m.id) !== null && _o !== void 0 ? _o : -1,
+                        conditionalCheckType: (_g = conditionalType.checkType) === null || _g === void 0 ? void 0 : _g.id,
+                        conditionalExtendsType: (_h = conditionalType.extendsType) === null || _h === void 0 ? void 0 : _h.id,
+                        conditionalTrueType: (_k = (_j = conditionalType.resolvedTrueType) === null || _j === void 0 ? void 0 : _j.id) !== null && _k !== void 0 ? _k : -1,
+                        conditionalFalseType: (_m = (_l = conditionalType.resolvedFalseType) === null || _l === void 0 ? void 0 : _l.id) !== null && _m !== void 0 ? _m : -1,
+                    };
+                }
+                var substitutionProperties = {};
+                if (type.flags & 33554432 /* Substitution */) {
+                    var substitutionType = type;
+                    substitutionProperties = {
+                        substitutionBaseType: (_o = substitutionType.baseType) === null || _o === void 0 ? void 0 : _o.id,
+                        substituteType: (_p = substitutionType.substitute) === null || _p === void 0 ? void 0 : _p.id,
+                    };
+                }
+                var reverseMappedProperties = {};
+                if (objectFlags & 1024 /* ReverseMapped */) {
+                    var reverseMappedType = type;
+                    reverseMappedProperties = {
+                        reverseMappedSourceType: (_q = reverseMappedType.source) === null || _q === void 0 ? void 0 : _q.id,
+                        reverseMappedMappedType: (_r = reverseMappedType.mappedType) === null || _r === void 0 ? void 0 : _r.id,
+                        reverseMappedConstraintType: (_s = reverseMappedType.constraintType) === null || _s === void 0 ? void 0 : _s.id,
+                    };
+                }
+                var evolvingArrayProperties = {};
+                if (objectFlags & 256 /* EvolvingArray */) {
+                    var evolvingArrayType = type;
+                    evolvingArrayProperties = {
+                        evolvingArrayElementType: evolvingArrayType.elementType.id,
+                        evolvingArrayFinalType: (_t = evolvingArrayType.finalArrayType) === null || _t === void 0 ? void 0 : _t.id,
                     };
                 }
                 // We can't print out an arbitrary object, so just assign each one a unique number.
@@ -3669,11 +3792,7 @@ var ts;
                         recursionIdentityMap.set(recursionIdentity, recursionToken);
                     }
                 }
-                var descriptor = __assign(__assign(__assign(__assign({ id: type.id, intrinsicName: type.intrinsicName, symbolName: (symbol === null || symbol === void 0 ? void 0 : symbol.escapedName) && ts.unescapeLeadingUnderscores(symbol.escapedName), recursionId: recursionToken, unionTypes: (type.flags & 1048576 /* Union */) ? (_p = type.types) === null || _p === void 0 ? void 0 : _p.map(function (t) { return t.id; }) : undefined, intersectionTypes: (type.flags & 2097152 /* Intersection */) ? type.types.map(function (t) { return t.id; }) : undefined, aliasTypeArguments: (_q = type.aliasTypeArguments) === null || _q === void 0 ? void 0 : _q.map(function (t) { return t.id; }), keyofType: (type.flags & 4194304 /* Index */) ? (_r = type.type) === null || _r === void 0 ? void 0 : _r.id : undefined }, indexedAccessProperties), referenceProperties), conditionalProperties), { firstDeclaration: firstDeclaration && {
-                        path: firstFile.path,
-                        start: indexFromOne(ts.getLineAndCharacterOfPosition(firstFile, firstDeclaration.pos)),
-                        end: indexFromOne(ts.getLineAndCharacterOfPosition(ts.getSourceFileOfNode(firstDeclaration), firstDeclaration.end)),
-                    }, flags: ts.Debug.formatTypeFlags(type.flags).split("|"), display: display });
+                var descriptor = __assign(__assign(__assign(__assign(__assign(__assign(__assign({ id: type.id, intrinsicName: type.intrinsicName, symbolName: (symbol === null || symbol === void 0 ? void 0 : symbol.escapedName) && ts.unescapeLeadingUnderscores(symbol.escapedName), recursionId: recursionToken, isTuple: objectFlags & 8 /* Tuple */ ? true : undefined, unionTypes: (type.flags & 1048576 /* Union */) ? (_u = type.types) === null || _u === void 0 ? void 0 : _u.map(function (t) { return t.id; }) : undefined, intersectionTypes: (type.flags & 2097152 /* Intersection */) ? type.types.map(function (t) { return t.id; }) : undefined, aliasTypeArguments: (_v = type.aliasTypeArguments) === null || _v === void 0 ? void 0 : _v.map(function (t) { return t.id; }), keyofType: (type.flags & 4194304 /* Index */) ? (_w = type.type) === null || _w === void 0 ? void 0 : _w.id : undefined }, indexedAccessProperties), referenceProperties), conditionalProperties), substitutionProperties), reverseMappedProperties), evolvingArrayProperties), { destructuringPattern: getLocation(type.pattern), firstDeclaration: getLocation((_x = symbol === null || symbol === void 0 ? void 0 : symbol.declarations) === null || _x === void 0 ? void 0 : _x[0]), flags: ts.Debug.formatTypeFlags(type.flags).split("|"), display: display });
                 fs.writeSync(typesFd, JSON.stringify(descriptor));
                 if (i < numTypes - 1) {
                     fs.writeSync(typesFd, ",\n");
@@ -3691,12 +3810,10 @@ var ts;
             fs.writeFileSync(legendPath, JSON.stringify(legend));
         }
         tracingEnabled.dumpLegend = dumpLegend;
-    })(tracingEnabled = ts.tracingEnabled || (ts.tracingEnabled = {}));
-})(ts || (ts = {}));
-/*@internal*/
-(function (ts) {
+    })(tracingEnabled || (tracingEnabled = {}));
     // define after tracingEnabled is initialized
-    ts.startTracing = ts.tracingEnabled.startTracing;
+    ts.startTracing = tracingEnabled.startTracing;
+    ts.dumpTracingLegend = tracingEnabled.dumpLegend;
 })(ts || (ts = {}));
 var ts;
 (function (ts) {
@@ -3773,331 +3890,341 @@ var ts;
         SyntaxKind[SyntaxKind["QuestionQuestionToken"] = 60] = "QuestionQuestionToken";
         /** Only the JSDoc scanner produces BacktickToken. The normal scanner produces NoSubstitutionTemplateLiteral and related kinds. */
         SyntaxKind[SyntaxKind["BacktickToken"] = 61] = "BacktickToken";
+        /** Only the JSDoc scanner produces HashToken. The normal scanner produces PrivateIdentifier. */
+        SyntaxKind[SyntaxKind["HashToken"] = 62] = "HashToken";
         // Assignments
-        SyntaxKind[SyntaxKind["EqualsToken"] = 62] = "EqualsToken";
-        SyntaxKind[SyntaxKind["PlusEqualsToken"] = 63] = "PlusEqualsToken";
-        SyntaxKind[SyntaxKind["MinusEqualsToken"] = 64] = "MinusEqualsToken";
-        SyntaxKind[SyntaxKind["AsteriskEqualsToken"] = 65] = "AsteriskEqualsToken";
-        SyntaxKind[SyntaxKind["AsteriskAsteriskEqualsToken"] = 66] = "AsteriskAsteriskEqualsToken";
-        SyntaxKind[SyntaxKind["SlashEqualsToken"] = 67] = "SlashEqualsToken";
-        SyntaxKind[SyntaxKind["PercentEqualsToken"] = 68] = "PercentEqualsToken";
-        SyntaxKind[SyntaxKind["LessThanLessThanEqualsToken"] = 69] = "LessThanLessThanEqualsToken";
-        SyntaxKind[SyntaxKind["GreaterThanGreaterThanEqualsToken"] = 70] = "GreaterThanGreaterThanEqualsToken";
-        SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanEqualsToken"] = 71] = "GreaterThanGreaterThanGreaterThanEqualsToken";
-        SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 72] = "AmpersandEqualsToken";
-        SyntaxKind[SyntaxKind["BarEqualsToken"] = 73] = "BarEqualsToken";
-        SyntaxKind[SyntaxKind["BarBarEqualsToken"] = 74] = "BarBarEqualsToken";
-        SyntaxKind[SyntaxKind["AmpersandAmpersandEqualsToken"] = 75] = "AmpersandAmpersandEqualsToken";
-        SyntaxKind[SyntaxKind["QuestionQuestionEqualsToken"] = 76] = "QuestionQuestionEqualsToken";
-        SyntaxKind[SyntaxKind["CaretEqualsToken"] = 77] = "CaretEqualsToken";
+        SyntaxKind[SyntaxKind["EqualsToken"] = 63] = "EqualsToken";
+        SyntaxKind[SyntaxKind["PlusEqualsToken"] = 64] = "PlusEqualsToken";
+        SyntaxKind[SyntaxKind["MinusEqualsToken"] = 65] = "MinusEqualsToken";
+        SyntaxKind[SyntaxKind["AsteriskEqualsToken"] = 66] = "AsteriskEqualsToken";
+        SyntaxKind[SyntaxKind["AsteriskAsteriskEqualsToken"] = 67] = "AsteriskAsteriskEqualsToken";
+        SyntaxKind[SyntaxKind["SlashEqualsToken"] = 68] = "SlashEqualsToken";
+        SyntaxKind[SyntaxKind["PercentEqualsToken"] = 69] = "PercentEqualsToken";
+        SyntaxKind[SyntaxKind["LessThanLessThanEqualsToken"] = 70] = "LessThanLessThanEqualsToken";
+        SyntaxKind[SyntaxKind["GreaterThanGreaterThanEqualsToken"] = 71] = "GreaterThanGreaterThanEqualsToken";
+        SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanEqualsToken"] = 72] = "GreaterThanGreaterThanGreaterThanEqualsToken";
+        SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 73] = "AmpersandEqualsToken";
+        SyntaxKind[SyntaxKind["BarEqualsToken"] = 74] = "BarEqualsToken";
+        SyntaxKind[SyntaxKind["BarBarEqualsToken"] = 75] = "BarBarEqualsToken";
+        SyntaxKind[SyntaxKind["AmpersandAmpersandEqualsToken"] = 76] = "AmpersandAmpersandEqualsToken";
+        SyntaxKind[SyntaxKind["QuestionQuestionEqualsToken"] = 77] = "QuestionQuestionEqualsToken";
+        SyntaxKind[SyntaxKind["CaretEqualsToken"] = 78] = "CaretEqualsToken";
         // Identifiers and PrivateIdentifiers
-        SyntaxKind[SyntaxKind["Identifier"] = 78] = "Identifier";
-        SyntaxKind[SyntaxKind["PrivateIdentifier"] = 79] = "PrivateIdentifier";
+        SyntaxKind[SyntaxKind["Identifier"] = 79] = "Identifier";
+        SyntaxKind[SyntaxKind["PrivateIdentifier"] = 80] = "PrivateIdentifier";
         // Reserved words
-        SyntaxKind[SyntaxKind["BreakKeyword"] = 80] = "BreakKeyword";
-        SyntaxKind[SyntaxKind["CaseKeyword"] = 81] = "CaseKeyword";
-        SyntaxKind[SyntaxKind["CatchKeyword"] = 82] = "CatchKeyword";
-        SyntaxKind[SyntaxKind["ClassKeyword"] = 83] = "ClassKeyword";
-        SyntaxKind[SyntaxKind["ConstKeyword"] = 84] = "ConstKeyword";
-        SyntaxKind[SyntaxKind["ContinueKeyword"] = 85] = "ContinueKeyword";
-        SyntaxKind[SyntaxKind["DebuggerKeyword"] = 86] = "DebuggerKeyword";
-        SyntaxKind[SyntaxKind["DefaultKeyword"] = 87] = "DefaultKeyword";
-        SyntaxKind[SyntaxKind["DeleteKeyword"] = 88] = "DeleteKeyword";
-        SyntaxKind[SyntaxKind["DoKeyword"] = 89] = "DoKeyword";
-        SyntaxKind[SyntaxKind["ElseKeyword"] = 90] = "ElseKeyword";
-        SyntaxKind[SyntaxKind["EnumKeyword"] = 91] = "EnumKeyword";
-        SyntaxKind[SyntaxKind["ExportKeyword"] = 92] = "ExportKeyword";
-        SyntaxKind[SyntaxKind["ExtendsKeyword"] = 93] = "ExtendsKeyword";
-        SyntaxKind[SyntaxKind["FalseKeyword"] = 94] = "FalseKeyword";
-        SyntaxKind[SyntaxKind["FinallyKeyword"] = 95] = "FinallyKeyword";
-        SyntaxKind[SyntaxKind["ForKeyword"] = 96] = "ForKeyword";
-        SyntaxKind[SyntaxKind["FunctionKeyword"] = 97] = "FunctionKeyword";
-        SyntaxKind[SyntaxKind["IfKeyword"] = 98] = "IfKeyword";
-        SyntaxKind[SyntaxKind["ImportKeyword"] = 99] = "ImportKeyword";
-        SyntaxKind[SyntaxKind["InKeyword"] = 100] = "InKeyword";
-        SyntaxKind[SyntaxKind["InstanceOfKeyword"] = 101] = "InstanceOfKeyword";
-        SyntaxKind[SyntaxKind["NewKeyword"] = 102] = "NewKeyword";
-        SyntaxKind[SyntaxKind["NullKeyword"] = 103] = "NullKeyword";
-        SyntaxKind[SyntaxKind["ReturnKeyword"] = 104] = "ReturnKeyword";
-        SyntaxKind[SyntaxKind["SuperKeyword"] = 105] = "SuperKeyword";
-        SyntaxKind[SyntaxKind["SwitchKeyword"] = 106] = "SwitchKeyword";
-        SyntaxKind[SyntaxKind["ThisKeyword"] = 107] = "ThisKeyword";
-        SyntaxKind[SyntaxKind["ThrowKeyword"] = 108] = "ThrowKeyword";
-        SyntaxKind[SyntaxKind["TrueKeyword"] = 109] = "TrueKeyword";
-        SyntaxKind[SyntaxKind["TryKeyword"] = 110] = "TryKeyword";
-        SyntaxKind[SyntaxKind["TypeOfKeyword"] = 111] = "TypeOfKeyword";
-        SyntaxKind[SyntaxKind["VarKeyword"] = 112] = "VarKeyword";
-        SyntaxKind[SyntaxKind["VoidKeyword"] = 113] = "VoidKeyword";
-        SyntaxKind[SyntaxKind["WhileKeyword"] = 114] = "WhileKeyword";
-        SyntaxKind[SyntaxKind["WithKeyword"] = 115] = "WithKeyword";
+        SyntaxKind[SyntaxKind["BreakKeyword"] = 81] = "BreakKeyword";
+        SyntaxKind[SyntaxKind["CaseKeyword"] = 82] = "CaseKeyword";
+        SyntaxKind[SyntaxKind["CatchKeyword"] = 83] = "CatchKeyword";
+        SyntaxKind[SyntaxKind["ClassKeyword"] = 84] = "ClassKeyword";
+        SyntaxKind[SyntaxKind["ConstKeyword"] = 85] = "ConstKeyword";
+        SyntaxKind[SyntaxKind["ContinueKeyword"] = 86] = "ContinueKeyword";
+        SyntaxKind[SyntaxKind["DebuggerKeyword"] = 87] = "DebuggerKeyword";
+        SyntaxKind[SyntaxKind["DefaultKeyword"] = 88] = "DefaultKeyword";
+        SyntaxKind[SyntaxKind["DeleteKeyword"] = 89] = "DeleteKeyword";
+        SyntaxKind[SyntaxKind["DoKeyword"] = 90] = "DoKeyword";
+        SyntaxKind[SyntaxKind["ElseKeyword"] = 91] = "ElseKeyword";
+        SyntaxKind[SyntaxKind["EnumKeyword"] = 92] = "EnumKeyword";
+        SyntaxKind[SyntaxKind["ExportKeyword"] = 93] = "ExportKeyword";
+        SyntaxKind[SyntaxKind["ExtendsKeyword"] = 94] = "ExtendsKeyword";
+        SyntaxKind[SyntaxKind["FalseKeyword"] = 95] = "FalseKeyword";
+        SyntaxKind[SyntaxKind["FinallyKeyword"] = 96] = "FinallyKeyword";
+        SyntaxKind[SyntaxKind["ForKeyword"] = 97] = "ForKeyword";
+        SyntaxKind[SyntaxKind["FunctionKeyword"] = 98] = "FunctionKeyword";
+        SyntaxKind[SyntaxKind["IfKeyword"] = 99] = "IfKeyword";
+        SyntaxKind[SyntaxKind["ImportKeyword"] = 100] = "ImportKeyword";
+        SyntaxKind[SyntaxKind["InKeyword"] = 101] = "InKeyword";
+        SyntaxKind[SyntaxKind["InstanceOfKeyword"] = 102] = "InstanceOfKeyword";
+        SyntaxKind[SyntaxKind["NewKeyword"] = 103] = "NewKeyword";
+        SyntaxKind[SyntaxKind["NullKeyword"] = 104] = "NullKeyword";
+        SyntaxKind[SyntaxKind["ReturnKeyword"] = 105] = "ReturnKeyword";
+        SyntaxKind[SyntaxKind["SuperKeyword"] = 106] = "SuperKeyword";
+        SyntaxKind[SyntaxKind["SwitchKeyword"] = 107] = "SwitchKeyword";
+        SyntaxKind[SyntaxKind["ThisKeyword"] = 108] = "ThisKeyword";
+        SyntaxKind[SyntaxKind["ThrowKeyword"] = 109] = "ThrowKeyword";
+        SyntaxKind[SyntaxKind["TrueKeyword"] = 110] = "TrueKeyword";
+        SyntaxKind[SyntaxKind["TryKeyword"] = 111] = "TryKeyword";
+        SyntaxKind[SyntaxKind["TypeOfKeyword"] = 112] = "TypeOfKeyword";
+        SyntaxKind[SyntaxKind["VarKeyword"] = 113] = "VarKeyword";
+        SyntaxKind[SyntaxKind["VoidKeyword"] = 114] = "VoidKeyword";
+        SyntaxKind[SyntaxKind["WhileKeyword"] = 115] = "WhileKeyword";
+        SyntaxKind[SyntaxKind["WithKeyword"] = 116] = "WithKeyword";
         // Strict mode reserved words
-        SyntaxKind[SyntaxKind["ImplementsKeyword"] = 116] = "ImplementsKeyword";
-        SyntaxKind[SyntaxKind["InterfaceKeyword"] = 117] = "InterfaceKeyword";
-        SyntaxKind[SyntaxKind["LetKeyword"] = 118] = "LetKeyword";
-        SyntaxKind[SyntaxKind["PackageKeyword"] = 119] = "PackageKeyword";
-        SyntaxKind[SyntaxKind["PrivateKeyword"] = 120] = "PrivateKeyword";
-        SyntaxKind[SyntaxKind["ProtectedKeyword"] = 121] = "ProtectedKeyword";
-        SyntaxKind[SyntaxKind["PublicKeyword"] = 122] = "PublicKeyword";
-        SyntaxKind[SyntaxKind["StaticKeyword"] = 123] = "StaticKeyword";
-        SyntaxKind[SyntaxKind["YieldKeyword"] = 124] = "YieldKeyword";
+        SyntaxKind[SyntaxKind["ImplementsKeyword"] = 117] = "ImplementsKeyword";
+        SyntaxKind[SyntaxKind["InterfaceKeyword"] = 118] = "InterfaceKeyword";
+        SyntaxKind[SyntaxKind["LetKeyword"] = 119] = "LetKeyword";
+        SyntaxKind[SyntaxKind["PackageKeyword"] = 120] = "PackageKeyword";
+        SyntaxKind[SyntaxKind["PrivateKeyword"] = 121] = "PrivateKeyword";
+        SyntaxKind[SyntaxKind["ProtectedKeyword"] = 122] = "ProtectedKeyword";
+        SyntaxKind[SyntaxKind["PublicKeyword"] = 123] = "PublicKeyword";
+        SyntaxKind[SyntaxKind["StaticKeyword"] = 124] = "StaticKeyword";
+        SyntaxKind[SyntaxKind["YieldKeyword"] = 125] = "YieldKeyword";
         // Contextual keywords
-        SyntaxKind[SyntaxKind["AbstractKeyword"] = 125] = "AbstractKeyword";
-        SyntaxKind[SyntaxKind["AsKeyword"] = 126] = "AsKeyword";
-        SyntaxKind[SyntaxKind["AssertsKeyword"] = 127] = "AssertsKeyword";
-        SyntaxKind[SyntaxKind["AnyKeyword"] = 128] = "AnyKeyword";
-        SyntaxKind[SyntaxKind["AsyncKeyword"] = 129] = "AsyncKeyword";
-        SyntaxKind[SyntaxKind["AwaitKeyword"] = 130] = "AwaitKeyword";
-        SyntaxKind[SyntaxKind["BooleanKeyword"] = 131] = "BooleanKeyword";
-        SyntaxKind[SyntaxKind["ConstructorKeyword"] = 132] = "ConstructorKeyword";
-        SyntaxKind[SyntaxKind["DeclareKeyword"] = 133] = "DeclareKeyword";
-        SyntaxKind[SyntaxKind["GetKeyword"] = 134] = "GetKeyword";
-        SyntaxKind[SyntaxKind["InferKeyword"] = 135] = "InferKeyword";
-        SyntaxKind[SyntaxKind["IntrinsicKeyword"] = 136] = "IntrinsicKeyword";
-        SyntaxKind[SyntaxKind["IsKeyword"] = 137] = "IsKeyword";
-        SyntaxKind[SyntaxKind["KeyOfKeyword"] = 138] = "KeyOfKeyword";
-        SyntaxKind[SyntaxKind["ModuleKeyword"] = 139] = "ModuleKeyword";
-        SyntaxKind[SyntaxKind["NamespaceKeyword"] = 140] = "NamespaceKeyword";
-        SyntaxKind[SyntaxKind["NeverKeyword"] = 141] = "NeverKeyword";
-        SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 142] = "ReadonlyKeyword";
-        SyntaxKind[SyntaxKind["RequireKeyword"] = 143] = "RequireKeyword";
-        SyntaxKind[SyntaxKind["NumberKeyword"] = 144] = "NumberKeyword";
-        SyntaxKind[SyntaxKind["ObjectKeyword"] = 145] = "ObjectKeyword";
-        SyntaxKind[SyntaxKind["SetKeyword"] = 146] = "SetKeyword";
-        SyntaxKind[SyntaxKind["StringKeyword"] = 147] = "StringKeyword";
-        SyntaxKind[SyntaxKind["SymbolKeyword"] = 148] = "SymbolKeyword";
-        SyntaxKind[SyntaxKind["TypeKeyword"] = 149] = "TypeKeyword";
-        SyntaxKind[SyntaxKind["UndefinedKeyword"] = 150] = "UndefinedKeyword";
-        SyntaxKind[SyntaxKind["UniqueKeyword"] = 151] = "UniqueKeyword";
-        SyntaxKind[SyntaxKind["UnknownKeyword"] = 152] = "UnknownKeyword";
-        SyntaxKind[SyntaxKind["FromKeyword"] = 153] = "FromKeyword";
-        SyntaxKind[SyntaxKind["GlobalKeyword"] = 154] = "GlobalKeyword";
-        SyntaxKind[SyntaxKind["BigIntKeyword"] = 155] = "BigIntKeyword";
-        SyntaxKind[SyntaxKind["OfKeyword"] = 156] = "OfKeyword";
+        SyntaxKind[SyntaxKind["AbstractKeyword"] = 126] = "AbstractKeyword";
+        SyntaxKind[SyntaxKind["AsKeyword"] = 127] = "AsKeyword";
+        SyntaxKind[SyntaxKind["AssertsKeyword"] = 128] = "AssertsKeyword";
+        SyntaxKind[SyntaxKind["AssertKeyword"] = 129] = "AssertKeyword";
+        SyntaxKind[SyntaxKind["AnyKeyword"] = 130] = "AnyKeyword";
+        SyntaxKind[SyntaxKind["AsyncKeyword"] = 131] = "AsyncKeyword";
+        SyntaxKind[SyntaxKind["AwaitKeyword"] = 132] = "AwaitKeyword";
+        SyntaxKind[SyntaxKind["BooleanKeyword"] = 133] = "BooleanKeyword";
+        SyntaxKind[SyntaxKind["ConstructorKeyword"] = 134] = "ConstructorKeyword";
+        SyntaxKind[SyntaxKind["DeclareKeyword"] = 135] = "DeclareKeyword";
+        SyntaxKind[SyntaxKind["GetKeyword"] = 136] = "GetKeyword";
+        SyntaxKind[SyntaxKind["InferKeyword"] = 137] = "InferKeyword";
+        SyntaxKind[SyntaxKind["IntrinsicKeyword"] = 138] = "IntrinsicKeyword";
+        SyntaxKind[SyntaxKind["IsKeyword"] = 139] = "IsKeyword";
+        SyntaxKind[SyntaxKind["KeyOfKeyword"] = 140] = "KeyOfKeyword";
+        SyntaxKind[SyntaxKind["ModuleKeyword"] = 141] = "ModuleKeyword";
+        SyntaxKind[SyntaxKind["NamespaceKeyword"] = 142] = "NamespaceKeyword";
+        SyntaxKind[SyntaxKind["NeverKeyword"] = 143] = "NeverKeyword";
+        SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 144] = "ReadonlyKeyword";
+        SyntaxKind[SyntaxKind["RequireKeyword"] = 145] = "RequireKeyword";
+        SyntaxKind[SyntaxKind["NumberKeyword"] = 146] = "NumberKeyword";
+        SyntaxKind[SyntaxKind["ObjectKeyword"] = 147] = "ObjectKeyword";
+        SyntaxKind[SyntaxKind["SetKeyword"] = 148] = "SetKeyword";
+        SyntaxKind[SyntaxKind["StringKeyword"] = 149] = "StringKeyword";
+        SyntaxKind[SyntaxKind["SymbolKeyword"] = 150] = "SymbolKeyword";
+        SyntaxKind[SyntaxKind["TypeKeyword"] = 151] = "TypeKeyword";
+        SyntaxKind[SyntaxKind["UndefinedKeyword"] = 152] = "UndefinedKeyword";
+        SyntaxKind[SyntaxKind["UniqueKeyword"] = 153] = "UniqueKeyword";
+        SyntaxKind[SyntaxKind["UnknownKeyword"] = 154] = "UnknownKeyword";
+        SyntaxKind[SyntaxKind["FromKeyword"] = 155] = "FromKeyword";
+        SyntaxKind[SyntaxKind["GlobalKeyword"] = 156] = "GlobalKeyword";
+        SyntaxKind[SyntaxKind["BigIntKeyword"] = 157] = "BigIntKeyword";
+        SyntaxKind[SyntaxKind["OverrideKeyword"] = 158] = "OverrideKeyword";
+        SyntaxKind[SyntaxKind["OfKeyword"] = 159] = "OfKeyword";
         // Parse tree nodes
         // Names
-        SyntaxKind[SyntaxKind["QualifiedName"] = 157] = "QualifiedName";
-        SyntaxKind[SyntaxKind["ComputedPropertyName"] = 158] = "ComputedPropertyName";
+        SyntaxKind[SyntaxKind["QualifiedName"] = 160] = "QualifiedName";
+        SyntaxKind[SyntaxKind["ComputedPropertyName"] = 161] = "ComputedPropertyName";
         // Signature elements
-        SyntaxKind[SyntaxKind["TypeParameter"] = 159] = "TypeParameter";
-        SyntaxKind[SyntaxKind["Parameter"] = 160] = "Parameter";
-        SyntaxKind[SyntaxKind["Decorator"] = 161] = "Decorator";
+        SyntaxKind[SyntaxKind["TypeParameter"] = 162] = "TypeParameter";
+        SyntaxKind[SyntaxKind["Parameter"] = 163] = "Parameter";
+        SyntaxKind[SyntaxKind["Decorator"] = 164] = "Decorator";
         // TypeMember
-        SyntaxKind[SyntaxKind["PropertySignature"] = 162] = "PropertySignature";
-        SyntaxKind[SyntaxKind["PropertyDeclaration"] = 163] = "PropertyDeclaration";
-        SyntaxKind[SyntaxKind["MethodSignature"] = 164] = "MethodSignature";
-        SyntaxKind[SyntaxKind["MethodDeclaration"] = 165] = "MethodDeclaration";
-        SyntaxKind[SyntaxKind["Constructor"] = 166] = "Constructor";
-        SyntaxKind[SyntaxKind["GetAccessor"] = 167] = "GetAccessor";
-        SyntaxKind[SyntaxKind["SetAccessor"] = 168] = "SetAccessor";
-        SyntaxKind[SyntaxKind["CallSignature"] = 169] = "CallSignature";
-        SyntaxKind[SyntaxKind["ConstructSignature"] = 170] = "ConstructSignature";
-        SyntaxKind[SyntaxKind["IndexSignature"] = 171] = "IndexSignature";
+        SyntaxKind[SyntaxKind["PropertySignature"] = 165] = "PropertySignature";
+        SyntaxKind[SyntaxKind["PropertyDeclaration"] = 166] = "PropertyDeclaration";
+        SyntaxKind[SyntaxKind["MethodSignature"] = 167] = "MethodSignature";
+        SyntaxKind[SyntaxKind["MethodDeclaration"] = 168] = "MethodDeclaration";
+        SyntaxKind[SyntaxKind["ClassStaticBlockDeclaration"] = 169] = "ClassStaticBlockDeclaration";
+        SyntaxKind[SyntaxKind["Constructor"] = 170] = "Constructor";
+        SyntaxKind[SyntaxKind["GetAccessor"] = 171] = "GetAccessor";
+        SyntaxKind[SyntaxKind["SetAccessor"] = 172] = "SetAccessor";
+        SyntaxKind[SyntaxKind["CallSignature"] = 173] = "CallSignature";
+        SyntaxKind[SyntaxKind["ConstructSignature"] = 174] = "ConstructSignature";
+        SyntaxKind[SyntaxKind["IndexSignature"] = 175] = "IndexSignature";
         // Type
-        SyntaxKind[SyntaxKind["TypePredicate"] = 172] = "TypePredicate";
-        SyntaxKind[SyntaxKind["TypeReference"] = 173] = "TypeReference";
-        SyntaxKind[SyntaxKind["FunctionType"] = 174] = "FunctionType";
-        SyntaxKind[SyntaxKind["ConstructorType"] = 175] = "ConstructorType";
-        SyntaxKind[SyntaxKind["TypeQuery"] = 176] = "TypeQuery";
-        SyntaxKind[SyntaxKind["TypeLiteral"] = 177] = "TypeLiteral";
-        SyntaxKind[SyntaxKind["ArrayType"] = 178] = "ArrayType";
-        SyntaxKind[SyntaxKind["TupleType"] = 179] = "TupleType";
-        SyntaxKind[SyntaxKind["OptionalType"] = 180] = "OptionalType";
-        SyntaxKind[SyntaxKind["RestType"] = 181] = "RestType";
-        SyntaxKind[SyntaxKind["UnionType"] = 182] = "UnionType";
-        SyntaxKind[SyntaxKind["IntersectionType"] = 183] = "IntersectionType";
-        SyntaxKind[SyntaxKind["ConditionalType"] = 184] = "ConditionalType";
-        SyntaxKind[SyntaxKind["InferType"] = 185] = "InferType";
-        SyntaxKind[SyntaxKind["ParenthesizedType"] = 186] = "ParenthesizedType";
-        SyntaxKind[SyntaxKind["ThisType"] = 187] = "ThisType";
-        SyntaxKind[SyntaxKind["TypeOperator"] = 188] = "TypeOperator";
-        SyntaxKind[SyntaxKind["IndexedAccessType"] = 189] = "IndexedAccessType";
-        SyntaxKind[SyntaxKind["MappedType"] = 190] = "MappedType";
-        SyntaxKind[SyntaxKind["LiteralType"] = 191] = "LiteralType";
-        SyntaxKind[SyntaxKind["NamedTupleMember"] = 192] = "NamedTupleMember";
-        SyntaxKind[SyntaxKind["TemplateLiteralType"] = 193] = "TemplateLiteralType";
-        SyntaxKind[SyntaxKind["TemplateLiteralTypeSpan"] = 194] = "TemplateLiteralTypeSpan";
-        SyntaxKind[SyntaxKind["ImportType"] = 195] = "ImportType";
+        SyntaxKind[SyntaxKind["TypePredicate"] = 176] = "TypePredicate";
+        SyntaxKind[SyntaxKind["TypeReference"] = 177] = "TypeReference";
+        SyntaxKind[SyntaxKind["FunctionType"] = 178] = "FunctionType";
+        SyntaxKind[SyntaxKind["ConstructorType"] = 179] = "ConstructorType";
+        SyntaxKind[SyntaxKind["TypeQuery"] = 180] = "TypeQuery";
+        SyntaxKind[SyntaxKind["TypeLiteral"] = 181] = "TypeLiteral";
+        SyntaxKind[SyntaxKind["ArrayType"] = 182] = "ArrayType";
+        SyntaxKind[SyntaxKind["TupleType"] = 183] = "TupleType";
+        SyntaxKind[SyntaxKind["OptionalType"] = 184] = "OptionalType";
+        SyntaxKind[SyntaxKind["RestType"] = 185] = "RestType";
+        SyntaxKind[SyntaxKind["UnionType"] = 186] = "UnionType";
+        SyntaxKind[SyntaxKind["IntersectionType"] = 187] = "IntersectionType";
+        SyntaxKind[SyntaxKind["ConditionalType"] = 188] = "ConditionalType";
+        SyntaxKind[SyntaxKind["InferType"] = 189] = "InferType";
+        SyntaxKind[SyntaxKind["ParenthesizedType"] = 190] = "ParenthesizedType";
+        SyntaxKind[SyntaxKind["ThisType"] = 191] = "ThisType";
+        SyntaxKind[SyntaxKind["TypeOperator"] = 192] = "TypeOperator";
+        SyntaxKind[SyntaxKind["IndexedAccessType"] = 193] = "IndexedAccessType";
+        SyntaxKind[SyntaxKind["MappedType"] = 194] = "MappedType";
+        SyntaxKind[SyntaxKind["LiteralType"] = 195] = "LiteralType";
+        SyntaxKind[SyntaxKind["NamedTupleMember"] = 196] = "NamedTupleMember";
+        SyntaxKind[SyntaxKind["TemplateLiteralType"] = 197] = "TemplateLiteralType";
+        SyntaxKind[SyntaxKind["TemplateLiteralTypeSpan"] = 198] = "TemplateLiteralTypeSpan";
+        SyntaxKind[SyntaxKind["ImportType"] = 199] = "ImportType";
         // Binding patterns
-        SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 196] = "ObjectBindingPattern";
-        SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 197] = "ArrayBindingPattern";
-        SyntaxKind[SyntaxKind["BindingElement"] = 198] = "BindingElement";
+        SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 200] = "ObjectBindingPattern";
+        SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 201] = "ArrayBindingPattern";
+        SyntaxKind[SyntaxKind["BindingElement"] = 202] = "BindingElement";
         // Expression
-        SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 199] = "ArrayLiteralExpression";
-        SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 200] = "ObjectLiteralExpression";
-        SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 201] = "PropertyAccessExpression";
-        SyntaxKind[SyntaxKind["ElementAccessExpression"] = 202] = "ElementAccessExpression";
-        SyntaxKind[SyntaxKind["CallExpression"] = 203] = "CallExpression";
-        SyntaxKind[SyntaxKind["NewExpression"] = 204] = "NewExpression";
-        SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 205] = "TaggedTemplateExpression";
-        SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 206] = "TypeAssertionExpression";
-        SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 207] = "ParenthesizedExpression";
-        SyntaxKind[SyntaxKind["FunctionExpression"] = 208] = "FunctionExpression";
-        SyntaxKind[SyntaxKind["ArrowFunction"] = 209] = "ArrowFunction";
-        SyntaxKind[SyntaxKind["DeleteExpression"] = 210] = "DeleteExpression";
-        SyntaxKind[SyntaxKind["TypeOfExpression"] = 211] = "TypeOfExpression";
-        SyntaxKind[SyntaxKind["VoidExpression"] = 212] = "VoidExpression";
-        SyntaxKind[SyntaxKind["AwaitExpression"] = 213] = "AwaitExpression";
-        SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 214] = "PrefixUnaryExpression";
-        SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 215] = "PostfixUnaryExpression";
-        SyntaxKind[SyntaxKind["BinaryExpression"] = 216] = "BinaryExpression";
-        SyntaxKind[SyntaxKind["ConditionalExpression"] = 217] = "ConditionalExpression";
-        SyntaxKind[SyntaxKind["TemplateExpression"] = 218] = "TemplateExpression";
-        SyntaxKind[SyntaxKind["YieldExpression"] = 219] = "YieldExpression";
-        SyntaxKind[SyntaxKind["SpreadElement"] = 220] = "SpreadElement";
-        SyntaxKind[SyntaxKind["ClassExpression"] = 221] = "ClassExpression";
-        SyntaxKind[SyntaxKind["OmittedExpression"] = 222] = "OmittedExpression";
-        SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 223] = "ExpressionWithTypeArguments";
-        SyntaxKind[SyntaxKind["AsExpression"] = 224] = "AsExpression";
-        SyntaxKind[SyntaxKind["NonNullExpression"] = 225] = "NonNullExpression";
-        SyntaxKind[SyntaxKind["MetaProperty"] = 226] = "MetaProperty";
-        SyntaxKind[SyntaxKind["SyntheticExpression"] = 227] = "SyntheticExpression";
+        SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 203] = "ArrayLiteralExpression";
+        SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 204] = "ObjectLiteralExpression";
+        SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 205] = "PropertyAccessExpression";
+        SyntaxKind[SyntaxKind["ElementAccessExpression"] = 206] = "ElementAccessExpression";
+        SyntaxKind[SyntaxKind["CallExpression"] = 207] = "CallExpression";
+        SyntaxKind[SyntaxKind["NewExpression"] = 208] = "NewExpression";
+        SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 209] = "TaggedTemplateExpression";
+        SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 210] = "TypeAssertionExpression";
+        SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 211] = "ParenthesizedExpression";
+        SyntaxKind[SyntaxKind["FunctionExpression"] = 212] = "FunctionExpression";
+        SyntaxKind[SyntaxKind["ArrowFunction"] = 213] = "ArrowFunction";
+        SyntaxKind[SyntaxKind["DeleteExpression"] = 214] = "DeleteExpression";
+        SyntaxKind[SyntaxKind["TypeOfExpression"] = 215] = "TypeOfExpression";
+        SyntaxKind[SyntaxKind["VoidExpression"] = 216] = "VoidExpression";
+        SyntaxKind[SyntaxKind["AwaitExpression"] = 217] = "AwaitExpression";
+        SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 218] = "PrefixUnaryExpression";
+        SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 219] = "PostfixUnaryExpression";
+        SyntaxKind[SyntaxKind["BinaryExpression"] = 220] = "BinaryExpression";
+        SyntaxKind[SyntaxKind["ConditionalExpression"] = 221] = "ConditionalExpression";
+        SyntaxKind[SyntaxKind["TemplateExpression"] = 222] = "TemplateExpression";
+        SyntaxKind[SyntaxKind["YieldExpression"] = 223] = "YieldExpression";
+        SyntaxKind[SyntaxKind["SpreadElement"] = 224] = "SpreadElement";
+        SyntaxKind[SyntaxKind["ClassExpression"] = 225] = "ClassExpression";
+        SyntaxKind[SyntaxKind["OmittedExpression"] = 226] = "OmittedExpression";
+        SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 227] = "ExpressionWithTypeArguments";
+        SyntaxKind[SyntaxKind["AsExpression"] = 228] = "AsExpression";
+        SyntaxKind[SyntaxKind["NonNullExpression"] = 229] = "NonNullExpression";
+        SyntaxKind[SyntaxKind["MetaProperty"] = 230] = "MetaProperty";
+        SyntaxKind[SyntaxKind["SyntheticExpression"] = 231] = "SyntheticExpression";
         // Misc
-        SyntaxKind[SyntaxKind["TemplateSpan"] = 228] = "TemplateSpan";
-        SyntaxKind[SyntaxKind["SemicolonClassElement"] = 229] = "SemicolonClassElement";
+        SyntaxKind[SyntaxKind["TemplateSpan"] = 232] = "TemplateSpan";
+        SyntaxKind[SyntaxKind["SemicolonClassElement"] = 233] = "SemicolonClassElement";
         // Element
-        SyntaxKind[SyntaxKind["Block"] = 230] = "Block";
-        SyntaxKind[SyntaxKind["EmptyStatement"] = 231] = "EmptyStatement";
-        SyntaxKind[SyntaxKind["VariableStatement"] = 232] = "VariableStatement";
-        SyntaxKind[SyntaxKind["ExpressionStatement"] = 233] = "ExpressionStatement";
-        SyntaxKind[SyntaxKind["IfStatement"] = 234] = "IfStatement";
-        SyntaxKind[SyntaxKind["DoStatement"] = 235] = "DoStatement";
-        SyntaxKind[SyntaxKind["WhileStatement"] = 236] = "WhileStatement";
-        SyntaxKind[SyntaxKind["ForStatement"] = 237] = "ForStatement";
-        SyntaxKind[SyntaxKind["ForInStatement"] = 238] = "ForInStatement";
-        SyntaxKind[SyntaxKind["ForOfStatement"] = 239] = "ForOfStatement";
-        SyntaxKind[SyntaxKind["ContinueStatement"] = 240] = "ContinueStatement";
-        SyntaxKind[SyntaxKind["BreakStatement"] = 241] = "BreakStatement";
-        SyntaxKind[SyntaxKind["ReturnStatement"] = 242] = "ReturnStatement";
-        SyntaxKind[SyntaxKind["WithStatement"] = 243] = "WithStatement";
-        SyntaxKind[SyntaxKind["SwitchStatement"] = 244] = "SwitchStatement";
-        SyntaxKind[SyntaxKind["LabeledStatement"] = 245] = "LabeledStatement";
-        SyntaxKind[SyntaxKind["ThrowStatement"] = 246] = "ThrowStatement";
-        SyntaxKind[SyntaxKind["TryStatement"] = 247] = "TryStatement";
-        SyntaxKind[SyntaxKind["DebuggerStatement"] = 248] = "DebuggerStatement";
-        SyntaxKind[SyntaxKind["VariableDeclaration"] = 249] = "VariableDeclaration";
-        SyntaxKind[SyntaxKind["VariableDeclarationList"] = 250] = "VariableDeclarationList";
-        SyntaxKind[SyntaxKind["FunctionDeclaration"] = 251] = "FunctionDeclaration";
-        SyntaxKind[SyntaxKind["ClassDeclaration"] = 252] = "ClassDeclaration";
-        SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 253] = "InterfaceDeclaration";
-        SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 254] = "TypeAliasDeclaration";
-        SyntaxKind[SyntaxKind["EnumDeclaration"] = 255] = "EnumDeclaration";
-        SyntaxKind[SyntaxKind["ModuleDeclaration"] = 256] = "ModuleDeclaration";
-        SyntaxKind[SyntaxKind["ModuleBlock"] = 257] = "ModuleBlock";
-        SyntaxKind[SyntaxKind["CaseBlock"] = 258] = "CaseBlock";
-        SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 259] = "NamespaceExportDeclaration";
-        SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 260] = "ImportEqualsDeclaration";
-        SyntaxKind[SyntaxKind["ImportDeclaration"] = 261] = "ImportDeclaration";
-        SyntaxKind[SyntaxKind["ImportClause"] = 262] = "ImportClause";
-        SyntaxKind[SyntaxKind["NamespaceImport"] = 263] = "NamespaceImport";
-        SyntaxKind[SyntaxKind["NamedImports"] = 264] = "NamedImports";
-        SyntaxKind[SyntaxKind["ImportSpecifier"] = 265] = "ImportSpecifier";
-        SyntaxKind[SyntaxKind["ExportAssignment"] = 266] = "ExportAssignment";
-        SyntaxKind[SyntaxKind["ExportDeclaration"] = 267] = "ExportDeclaration";
-        SyntaxKind[SyntaxKind["NamedExports"] = 268] = "NamedExports";
-        SyntaxKind[SyntaxKind["NamespaceExport"] = 269] = "NamespaceExport";
-        SyntaxKind[SyntaxKind["ExportSpecifier"] = 270] = "ExportSpecifier";
-        SyntaxKind[SyntaxKind["MissingDeclaration"] = 271] = "MissingDeclaration";
+        SyntaxKind[SyntaxKind["Block"] = 234] = "Block";
+        SyntaxKind[SyntaxKind["EmptyStatement"] = 235] = "EmptyStatement";
+        SyntaxKind[SyntaxKind["VariableStatement"] = 236] = "VariableStatement";
+        SyntaxKind[SyntaxKind["ExpressionStatement"] = 237] = "ExpressionStatement";
+        SyntaxKind[SyntaxKind["IfStatement"] = 238] = "IfStatement";
+        SyntaxKind[SyntaxKind["DoStatement"] = 239] = "DoStatement";
+        SyntaxKind[SyntaxKind["WhileStatement"] = 240] = "WhileStatement";
+        SyntaxKind[SyntaxKind["ForStatement"] = 241] = "ForStatement";
+        SyntaxKind[SyntaxKind["ForInStatement"] = 242] = "ForInStatement";
+        SyntaxKind[SyntaxKind["ForOfStatement"] = 243] = "ForOfStatement";
+        SyntaxKind[SyntaxKind["ContinueStatement"] = 244] = "ContinueStatement";
+        SyntaxKind[SyntaxKind["BreakStatement"] = 245] = "BreakStatement";
+        SyntaxKind[SyntaxKind["ReturnStatement"] = 246] = "ReturnStatement";
+        SyntaxKind[SyntaxKind["WithStatement"] = 247] = "WithStatement";
+        SyntaxKind[SyntaxKind["SwitchStatement"] = 248] = "SwitchStatement";
+        SyntaxKind[SyntaxKind["LabeledStatement"] = 249] = "LabeledStatement";
+        SyntaxKind[SyntaxKind["ThrowStatement"] = 250] = "ThrowStatement";
+        SyntaxKind[SyntaxKind["TryStatement"] = 251] = "TryStatement";
+        SyntaxKind[SyntaxKind["DebuggerStatement"] = 252] = "DebuggerStatement";
+        SyntaxKind[SyntaxKind["VariableDeclaration"] = 253] = "VariableDeclaration";
+        SyntaxKind[SyntaxKind["VariableDeclarationList"] = 254] = "VariableDeclarationList";
+        SyntaxKind[SyntaxKind["FunctionDeclaration"] = 255] = "FunctionDeclaration";
+        SyntaxKind[SyntaxKind["ClassDeclaration"] = 256] = "ClassDeclaration";
+        SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 257] = "InterfaceDeclaration";
+        SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 258] = "TypeAliasDeclaration";
+        SyntaxKind[SyntaxKind["EnumDeclaration"] = 259] = "EnumDeclaration";
+        SyntaxKind[SyntaxKind["ModuleDeclaration"] = 260] = "ModuleDeclaration";
+        SyntaxKind[SyntaxKind["ModuleBlock"] = 261] = "ModuleBlock";
+        SyntaxKind[SyntaxKind["CaseBlock"] = 262] = "CaseBlock";
+        SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 263] = "NamespaceExportDeclaration";
+        SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 264] = "ImportEqualsDeclaration";
+        SyntaxKind[SyntaxKind["ImportDeclaration"] = 265] = "ImportDeclaration";
+        SyntaxKind[SyntaxKind["ImportClause"] = 266] = "ImportClause";
+        SyntaxKind[SyntaxKind["NamespaceImport"] = 267] = "NamespaceImport";
+        SyntaxKind[SyntaxKind["NamedImports"] = 268] = "NamedImports";
+        SyntaxKind[SyntaxKind["ImportSpecifier"] = 269] = "ImportSpecifier";
+        SyntaxKind[SyntaxKind["ExportAssignment"] = 270] = "ExportAssignment";
+        SyntaxKind[SyntaxKind["ExportDeclaration"] = 271] = "ExportDeclaration";
+        SyntaxKind[SyntaxKind["NamedExports"] = 272] = "NamedExports";
+        SyntaxKind[SyntaxKind["NamespaceExport"] = 273] = "NamespaceExport";
+        SyntaxKind[SyntaxKind["ExportSpecifier"] = 274] = "ExportSpecifier";
+        SyntaxKind[SyntaxKind["MissingDeclaration"] = 275] = "MissingDeclaration";
         // Module references
-        SyntaxKind[SyntaxKind["ExternalModuleReference"] = 272] = "ExternalModuleReference";
+        SyntaxKind[SyntaxKind["ExternalModuleReference"] = 276] = "ExternalModuleReference";
         // JSX
-        SyntaxKind[SyntaxKind["JsxElement"] = 273] = "JsxElement";
-        SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 274] = "JsxSelfClosingElement";
-        SyntaxKind[SyntaxKind["JsxOpeningElement"] = 275] = "JsxOpeningElement";
-        SyntaxKind[SyntaxKind["JsxClosingElement"] = 276] = "JsxClosingElement";
-        SyntaxKind[SyntaxKind["JsxFragment"] = 277] = "JsxFragment";
-        SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 278] = "JsxOpeningFragment";
-        SyntaxKind[SyntaxKind["JsxClosingFragment"] = 279] = "JsxClosingFragment";
-        SyntaxKind[SyntaxKind["JsxAttribute"] = 280] = "JsxAttribute";
-        SyntaxKind[SyntaxKind["JsxAttributes"] = 281] = "JsxAttributes";
-        SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 282] = "JsxSpreadAttribute";
-        SyntaxKind[SyntaxKind["JsxExpression"] = 283] = "JsxExpression";
+        SyntaxKind[SyntaxKind["JsxElement"] = 277] = "JsxElement";
+        SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 278] = "JsxSelfClosingElement";
+        SyntaxKind[SyntaxKind["JsxOpeningElement"] = 279] = "JsxOpeningElement";
+        SyntaxKind[SyntaxKind["JsxClosingElement"] = 280] = "JsxClosingElement";
+        SyntaxKind[SyntaxKind["JsxFragment"] = 281] = "JsxFragment";
+        SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 282] = "JsxOpeningFragment";
+        SyntaxKind[SyntaxKind["JsxClosingFragment"] = 283] = "JsxClosingFragment";
+        SyntaxKind[SyntaxKind["JsxAttribute"] = 284] = "JsxAttribute";
+        SyntaxKind[SyntaxKind["JsxAttributes"] = 285] = "JsxAttributes";
+        SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 286] = "JsxSpreadAttribute";
+        SyntaxKind[SyntaxKind["JsxExpression"] = 287] = "JsxExpression";
         // Clauses
-        SyntaxKind[SyntaxKind["CaseClause"] = 284] = "CaseClause";
-        SyntaxKind[SyntaxKind["DefaultClause"] = 285] = "DefaultClause";
-        SyntaxKind[SyntaxKind["HeritageClause"] = 286] = "HeritageClause";
-        SyntaxKind[SyntaxKind["CatchClause"] = 287] = "CatchClause";
+        SyntaxKind[SyntaxKind["CaseClause"] = 288] = "CaseClause";
+        SyntaxKind[SyntaxKind["DefaultClause"] = 289] = "DefaultClause";
+        SyntaxKind[SyntaxKind["HeritageClause"] = 290] = "HeritageClause";
+        SyntaxKind[SyntaxKind["CatchClause"] = 291] = "CatchClause";
+        SyntaxKind[SyntaxKind["AssertClause"] = 292] = "AssertClause";
+        SyntaxKind[SyntaxKind["AssertEntry"] = 293] = "AssertEntry";
         // Property assignments
-        SyntaxKind[SyntaxKind["PropertyAssignment"] = 288] = "PropertyAssignment";
-        SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 289] = "ShorthandPropertyAssignment";
-        SyntaxKind[SyntaxKind["SpreadAssignment"] = 290] = "SpreadAssignment";
+        SyntaxKind[SyntaxKind["PropertyAssignment"] = 294] = "PropertyAssignment";
+        SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 295] = "ShorthandPropertyAssignment";
+        SyntaxKind[SyntaxKind["SpreadAssignment"] = 296] = "SpreadAssignment";
         // Enum
-        SyntaxKind[SyntaxKind["EnumMember"] = 291] = "EnumMember";
+        SyntaxKind[SyntaxKind["EnumMember"] = 297] = "EnumMember";
         // Unparsed
-        SyntaxKind[SyntaxKind["UnparsedPrologue"] = 292] = "UnparsedPrologue";
-        SyntaxKind[SyntaxKind["UnparsedPrepend"] = 293] = "UnparsedPrepend";
-        SyntaxKind[SyntaxKind["UnparsedText"] = 294] = "UnparsedText";
-        SyntaxKind[SyntaxKind["UnparsedInternalText"] = 295] = "UnparsedInternalText";
-        SyntaxKind[SyntaxKind["UnparsedSyntheticReference"] = 296] = "UnparsedSyntheticReference";
+        SyntaxKind[SyntaxKind["UnparsedPrologue"] = 298] = "UnparsedPrologue";
+        SyntaxKind[SyntaxKind["UnparsedPrepend"] = 299] = "UnparsedPrepend";
+        SyntaxKind[SyntaxKind["UnparsedText"] = 300] = "UnparsedText";
+        SyntaxKind[SyntaxKind["UnparsedInternalText"] = 301] = "UnparsedInternalText";
+        SyntaxKind[SyntaxKind["UnparsedSyntheticReference"] = 302] = "UnparsedSyntheticReference";
         // Top-level nodes
-        SyntaxKind[SyntaxKind["SourceFile"] = 297] = "SourceFile";
-        SyntaxKind[SyntaxKind["Bundle"] = 298] = "Bundle";
-        SyntaxKind[SyntaxKind["UnparsedSource"] = 299] = "UnparsedSource";
-        SyntaxKind[SyntaxKind["InputFiles"] = 300] = "InputFiles";
+        SyntaxKind[SyntaxKind["SourceFile"] = 303] = "SourceFile";
+        SyntaxKind[SyntaxKind["Bundle"] = 304] = "Bundle";
+        SyntaxKind[SyntaxKind["UnparsedSource"] = 305] = "UnparsedSource";
+        SyntaxKind[SyntaxKind["InputFiles"] = 306] = "InputFiles";
         // JSDoc nodes
-        SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 301] = "JSDocTypeExpression";
-        SyntaxKind[SyntaxKind["JSDocNameReference"] = 302] = "JSDocNameReference";
-        // The * type
-        SyntaxKind[SyntaxKind["JSDocAllType"] = 303] = "JSDocAllType";
-        // The ? type
-        SyntaxKind[SyntaxKind["JSDocUnknownType"] = 304] = "JSDocUnknownType";
-        SyntaxKind[SyntaxKind["JSDocNullableType"] = 305] = "JSDocNullableType";
-        SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 306] = "JSDocNonNullableType";
-        SyntaxKind[SyntaxKind["JSDocOptionalType"] = 307] = "JSDocOptionalType";
-        SyntaxKind[SyntaxKind["JSDocFunctionType"] = 308] = "JSDocFunctionType";
-        SyntaxKind[SyntaxKind["JSDocVariadicType"] = 309] = "JSDocVariadicType";
-        // https://jsdoc.app/about-namepaths.html
-        SyntaxKind[SyntaxKind["JSDocNamepathType"] = 310] = "JSDocNamepathType";
-        SyntaxKind[SyntaxKind["JSDocComment"] = 311] = "JSDocComment";
-        SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 312] = "JSDocTypeLiteral";
-        SyntaxKind[SyntaxKind["JSDocSignature"] = 313] = "JSDocSignature";
-        SyntaxKind[SyntaxKind["JSDocTag"] = 314] = "JSDocTag";
-        SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 315] = "JSDocAugmentsTag";
-        SyntaxKind[SyntaxKind["JSDocImplementsTag"] = 316] = "JSDocImplementsTag";
-        SyntaxKind[SyntaxKind["JSDocAuthorTag"] = 317] = "JSDocAuthorTag";
-        SyntaxKind[SyntaxKind["JSDocDeprecatedTag"] = 318] = "JSDocDeprecatedTag";
-        SyntaxKind[SyntaxKind["JSDocClassTag"] = 319] = "JSDocClassTag";
-        SyntaxKind[SyntaxKind["JSDocPublicTag"] = 320] = "JSDocPublicTag";
-        SyntaxKind[SyntaxKind["JSDocPrivateTag"] = 321] = "JSDocPrivateTag";
-        SyntaxKind[SyntaxKind["JSDocProtectedTag"] = 322] = "JSDocProtectedTag";
-        SyntaxKind[SyntaxKind["JSDocReadonlyTag"] = 323] = "JSDocReadonlyTag";
-        SyntaxKind[SyntaxKind["JSDocCallbackTag"] = 324] = "JSDocCallbackTag";
-        SyntaxKind[SyntaxKind["JSDocEnumTag"] = 325] = "JSDocEnumTag";
-        SyntaxKind[SyntaxKind["JSDocParameterTag"] = 326] = "JSDocParameterTag";
-        SyntaxKind[SyntaxKind["JSDocReturnTag"] = 327] = "JSDocReturnTag";
-        SyntaxKind[SyntaxKind["JSDocThisTag"] = 328] = "JSDocThisTag";
-        SyntaxKind[SyntaxKind["JSDocTypeTag"] = 329] = "JSDocTypeTag";
-        SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 330] = "JSDocTemplateTag";
-        SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 331] = "JSDocTypedefTag";
-        SyntaxKind[SyntaxKind["JSDocSeeTag"] = 332] = "JSDocSeeTag";
-        SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 333] = "JSDocPropertyTag";
+        SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 307] = "JSDocTypeExpression";
+        SyntaxKind[SyntaxKind["JSDocNameReference"] = 308] = "JSDocNameReference";
+        SyntaxKind[SyntaxKind["JSDocMemberName"] = 309] = "JSDocMemberName";
+        SyntaxKind[SyntaxKind["JSDocAllType"] = 310] = "JSDocAllType";
+        SyntaxKind[SyntaxKind["JSDocUnknownType"] = 311] = "JSDocUnknownType";
+        SyntaxKind[SyntaxKind["JSDocNullableType"] = 312] = "JSDocNullableType";
+        SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 313] = "JSDocNonNullableType";
+        SyntaxKind[SyntaxKind["JSDocOptionalType"] = 314] = "JSDocOptionalType";
+        SyntaxKind[SyntaxKind["JSDocFunctionType"] = 315] = "JSDocFunctionType";
+        SyntaxKind[SyntaxKind["JSDocVariadicType"] = 316] = "JSDocVariadicType";
+        SyntaxKind[SyntaxKind["JSDocNamepathType"] = 317] = "JSDocNamepathType";
+        SyntaxKind[SyntaxKind["JSDocComment"] = 318] = "JSDocComment";
+        SyntaxKind[SyntaxKind["JSDocText"] = 319] = "JSDocText";
+        SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 320] = "JSDocTypeLiteral";
+        SyntaxKind[SyntaxKind["JSDocSignature"] = 321] = "JSDocSignature";
+        SyntaxKind[SyntaxKind["JSDocLink"] = 322] = "JSDocLink";
+        SyntaxKind[SyntaxKind["JSDocLinkCode"] = 323] = "JSDocLinkCode";
+        SyntaxKind[SyntaxKind["JSDocLinkPlain"] = 324] = "JSDocLinkPlain";
+        SyntaxKind[SyntaxKind["JSDocTag"] = 325] = "JSDocTag";
+        SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 326] = "JSDocAugmentsTag";
+        SyntaxKind[SyntaxKind["JSDocImplementsTag"] = 327] = "JSDocImplementsTag";
+        SyntaxKind[SyntaxKind["JSDocAuthorTag"] = 328] = "JSDocAuthorTag";
+        SyntaxKind[SyntaxKind["JSDocDeprecatedTag"] = 329] = "JSDocDeprecatedTag";
+        SyntaxKind[SyntaxKind["JSDocClassTag"] = 330] = "JSDocClassTag";
+        SyntaxKind[SyntaxKind["JSDocPublicTag"] = 331] = "JSDocPublicTag";
+        SyntaxKind[SyntaxKind["JSDocPrivateTag"] = 332] = "JSDocPrivateTag";
+        SyntaxKind[SyntaxKind["JSDocProtectedTag"] = 333] = "JSDocProtectedTag";
+        SyntaxKind[SyntaxKind["JSDocReadonlyTag"] = 334] = "JSDocReadonlyTag";
+        SyntaxKind[SyntaxKind["JSDocOverrideTag"] = 335] = "JSDocOverrideTag";
+        SyntaxKind[SyntaxKind["JSDocCallbackTag"] = 336] = "JSDocCallbackTag";
+        SyntaxKind[SyntaxKind["JSDocEnumTag"] = 337] = "JSDocEnumTag";
+        SyntaxKind[SyntaxKind["JSDocParameterTag"] = 338] = "JSDocParameterTag";
+        SyntaxKind[SyntaxKind["JSDocReturnTag"] = 339] = "JSDocReturnTag";
+        SyntaxKind[SyntaxKind["JSDocThisTag"] = 340] = "JSDocThisTag";
+        SyntaxKind[SyntaxKind["JSDocTypeTag"] = 341] = "JSDocTypeTag";
+        SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 342] = "JSDocTemplateTag";
+        SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 343] = "JSDocTypedefTag";
+        SyntaxKind[SyntaxKind["JSDocSeeTag"] = 344] = "JSDocSeeTag";
+        SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 345] = "JSDocPropertyTag";
         // Synthesized list
-        SyntaxKind[SyntaxKind["SyntaxList"] = 334] = "SyntaxList";
+        SyntaxKind[SyntaxKind["SyntaxList"] = 346] = "SyntaxList";
         // Transformation nodes
-        SyntaxKind[SyntaxKind["NotEmittedStatement"] = 335] = "NotEmittedStatement";
-        SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 336] = "PartiallyEmittedExpression";
-        SyntaxKind[SyntaxKind["CommaListExpression"] = 337] = "CommaListExpression";
-        SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 338] = "MergeDeclarationMarker";
-        SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 339] = "EndOfDeclarationMarker";
-        SyntaxKind[SyntaxKind["SyntheticReferenceExpression"] = 340] = "SyntheticReferenceExpression";
+        SyntaxKind[SyntaxKind["NotEmittedStatement"] = 347] = "NotEmittedStatement";
+        SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 348] = "PartiallyEmittedExpression";
+        SyntaxKind[SyntaxKind["CommaListExpression"] = 349] = "CommaListExpression";
+        SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 350] = "MergeDeclarationMarker";
+        SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 351] = "EndOfDeclarationMarker";
+        SyntaxKind[SyntaxKind["SyntheticReferenceExpression"] = 352] = "SyntheticReferenceExpression";
         // Enum value count
-        SyntaxKind[SyntaxKind["Count"] = 341] = "Count";
+        SyntaxKind[SyntaxKind["Count"] = 353] = "Count";
         // Markers
-        SyntaxKind[SyntaxKind["FirstAssignment"] = 62] = "FirstAssignment";
-        SyntaxKind[SyntaxKind["LastAssignment"] = 77] = "LastAssignment";
-        SyntaxKind[SyntaxKind["FirstCompoundAssignment"] = 63] = "FirstCompoundAssignment";
-        SyntaxKind[SyntaxKind["LastCompoundAssignment"] = 77] = "LastCompoundAssignment";
-        SyntaxKind[SyntaxKind["FirstReservedWord"] = 80] = "FirstReservedWord";
-        SyntaxKind[SyntaxKind["LastReservedWord"] = 115] = "LastReservedWord";
-        SyntaxKind[SyntaxKind["FirstKeyword"] = 80] = "FirstKeyword";
-        SyntaxKind[SyntaxKind["LastKeyword"] = 156] = "LastKeyword";
-        SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 116] = "FirstFutureReservedWord";
-        SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 124] = "LastFutureReservedWord";
-        SyntaxKind[SyntaxKind["FirstTypeNode"] = 172] = "FirstTypeNode";
-        SyntaxKind[SyntaxKind["LastTypeNode"] = 195] = "LastTypeNode";
+        SyntaxKind[SyntaxKind["FirstAssignment"] = 63] = "FirstAssignment";
+        SyntaxKind[SyntaxKind["LastAssignment"] = 78] = "LastAssignment";
+        SyntaxKind[SyntaxKind["FirstCompoundAssignment"] = 64] = "FirstCompoundAssignment";
+        SyntaxKind[SyntaxKind["LastCompoundAssignment"] = 78] = "LastCompoundAssignment";
+        SyntaxKind[SyntaxKind["FirstReservedWord"] = 81] = "FirstReservedWord";
+        SyntaxKind[SyntaxKind["LastReservedWord"] = 116] = "LastReservedWord";
+        SyntaxKind[SyntaxKind["FirstKeyword"] = 81] = "FirstKeyword";
+        SyntaxKind[SyntaxKind["LastKeyword"] = 159] = "LastKeyword";
+        SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 117] = "FirstFutureReservedWord";
+        SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 125] = "LastFutureReservedWord";
+        SyntaxKind[SyntaxKind["FirstTypeNode"] = 176] = "FirstTypeNode";
+        SyntaxKind[SyntaxKind["LastTypeNode"] = 199] = "LastTypeNode";
         SyntaxKind[SyntaxKind["FirstPunctuation"] = 18] = "FirstPunctuation";
-        SyntaxKind[SyntaxKind["LastPunctuation"] = 77] = "LastPunctuation";
+        SyntaxKind[SyntaxKind["LastPunctuation"] = 78] = "LastPunctuation";
         SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken";
-        SyntaxKind[SyntaxKind["LastToken"] = 156] = "LastToken";
+        SyntaxKind[SyntaxKind["LastToken"] = 159] = "LastToken";
         SyntaxKind[SyntaxKind["FirstTriviaToken"] = 2] = "FirstTriviaToken";
         SyntaxKind[SyntaxKind["LastTriviaToken"] = 7] = "LastTriviaToken";
         SyntaxKind[SyntaxKind["FirstLiteralToken"] = 8] = "FirstLiteralToken";
@@ -4105,16 +4232,16 @@ var ts;
         SyntaxKind[SyntaxKind["FirstTemplateToken"] = 14] = "FirstTemplateToken";
         SyntaxKind[SyntaxKind["LastTemplateToken"] = 17] = "LastTemplateToken";
         SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 29] = "FirstBinaryOperator";
-        SyntaxKind[SyntaxKind["LastBinaryOperator"] = 77] = "LastBinaryOperator";
-        SyntaxKind[SyntaxKind["FirstStatement"] = 232] = "FirstStatement";
-        SyntaxKind[SyntaxKind["LastStatement"] = 248] = "LastStatement";
-        SyntaxKind[SyntaxKind["FirstNode"] = 157] = "FirstNode";
-        SyntaxKind[SyntaxKind["FirstJSDocNode"] = 301] = "FirstJSDocNode";
-        SyntaxKind[SyntaxKind["LastJSDocNode"] = 333] = "LastJSDocNode";
-        SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 314] = "FirstJSDocTagNode";
-        SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 333] = "LastJSDocTagNode";
-        /* @internal */ SyntaxKind[SyntaxKind["FirstContextualKeyword"] = 125] = "FirstContextualKeyword";
-        /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 156] = "LastContextualKeyword";
+        SyntaxKind[SyntaxKind["LastBinaryOperator"] = 78] = "LastBinaryOperator";
+        SyntaxKind[SyntaxKind["FirstStatement"] = 236] = "FirstStatement";
+        SyntaxKind[SyntaxKind["LastStatement"] = 252] = "LastStatement";
+        SyntaxKind[SyntaxKind["FirstNode"] = 160] = "FirstNode";
+        SyntaxKind[SyntaxKind["FirstJSDocNode"] = 307] = "FirstJSDocNode";
+        SyntaxKind[SyntaxKind["LastJSDocNode"] = 345] = "LastJSDocNode";
+        SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 325] = "FirstJSDocTagNode";
+        SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 345] = "LastJSDocTagNode";
+        /* @internal */ SyntaxKind[SyntaxKind["FirstContextualKeyword"] = 126] = "FirstContextualKeyword";
+        /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 159] = "LastContextualKeyword";
     })(SyntaxKind = ts.SyntaxKind || (ts.SyntaxKind = {}));
     var NodeFlags;
     (function (NodeFlags) {
@@ -4184,14 +4311,15 @@ var ts;
         ModifierFlags[ModifierFlags["Const"] = 2048] = "Const";
         ModifierFlags[ModifierFlags["HasComputedJSDocModifiers"] = 4096] = "HasComputedJSDocModifiers";
         ModifierFlags[ModifierFlags["Deprecated"] = 8192] = "Deprecated";
+        ModifierFlags[ModifierFlags["Override"] = 16384] = "Override";
         ModifierFlags[ModifierFlags["HasComputedFlags"] = 536870912] = "HasComputedFlags";
         ModifierFlags[ModifierFlags["AccessibilityModifier"] = 28] = "AccessibilityModifier";
         // Accessibility modifiers and 'readonly' can be attached to a parameter in a constructor to make it a property.
-        ModifierFlags[ModifierFlags["ParameterPropertyModifier"] = 92] = "ParameterPropertyModifier";
+        ModifierFlags[ModifierFlags["ParameterPropertyModifier"] = 16476] = "ParameterPropertyModifier";
         ModifierFlags[ModifierFlags["NonPublicAccessibilityModifier"] = 24] = "NonPublicAccessibilityModifier";
-        ModifierFlags[ModifierFlags["TypeScriptModifier"] = 2270] = "TypeScriptModifier";
+        ModifierFlags[ModifierFlags["TypeScriptModifier"] = 18654] = "TypeScriptModifier";
         ModifierFlags[ModifierFlags["ExportDefault"] = 513] = "ExportDefault";
-        ModifierFlags[ModifierFlags["All"] = 11263] = "All";
+        ModifierFlags[ModifierFlags["All"] = 27647] = "All";
     })(ModifierFlags = ts.ModifierFlags || (ts.ModifierFlags = {}));
     var JsxFlags;
     (function (JsxFlags) {
@@ -4332,6 +4460,13 @@ var ts;
         ExitStatus[ExitStatus["ProjectReferenceCycle_OutputsSkupped"] = 4] = "ProjectReferenceCycle_OutputsSkupped";
     })(ExitStatus = ts.ExitStatus || (ts.ExitStatus = {}));
     /* @internal */
+    var MemberOverrideStatus;
+    (function (MemberOverrideStatus) {
+        MemberOverrideStatus[MemberOverrideStatus["Ok"] = 0] = "Ok";
+        MemberOverrideStatus[MemberOverrideStatus["NeedsOverride"] = 1] = "NeedsOverride";
+        MemberOverrideStatus[MemberOverrideStatus["HasInvalidOverride"] = 2] = "HasInvalidOverride";
+    })(MemberOverrideStatus = ts.MemberOverrideStatus || (ts.MemberOverrideStatus = {}));
+    /* @internal */
     var UnionReduction;
     (function (UnionReduction) {
         UnionReduction[UnionReduction["None"] = 0] = "None";
@@ -4372,6 +4507,8 @@ var ts;
         NodeBuilderFlags[NodeBuilderFlags["NoUndefinedOptionalParameterType"] = 1073741824] = "NoUndefinedOptionalParameterType";
         // Error handling
         NodeBuilderFlags[NodeBuilderFlags["AllowThisInObjectLiteral"] = 32768] = "AllowThisInObjectLiteral";
+        NodeBuilderFlags[NodeBuilderFlags["AllowQualifiedNameInPlaceOfIdentifier"] = 65536] = "AllowQualifiedNameInPlaceOfIdentifier";
+        /** @deprecated AllowQualifedNameInPlaceOfIdentifier. Use AllowQualifiedNameInPlaceOfIdentifier instead. */
         NodeBuilderFlags[NodeBuilderFlags["AllowQualifedNameInPlaceOfIdentifier"] = 65536] = "AllowQualifedNameInPlaceOfIdentifier";
         NodeBuilderFlags[NodeBuilderFlags["AllowAnonymousIdentifier"] = 131072] = "AllowAnonymousIdentifier";
         NodeBuilderFlags[NodeBuilderFlags["AllowEmptyUnionOrIntersection"] = 262144] = "AllowEmptyUnionOrIntersection";
@@ -4386,7 +4523,6 @@ var ts;
         NodeBuilderFlags[NodeBuilderFlags["InObjectTypeLiteral"] = 4194304] = "InObjectTypeLiteral";
         NodeBuilderFlags[NodeBuilderFlags["InTypeAlias"] = 8388608] = "InTypeAlias";
         NodeBuilderFlags[NodeBuilderFlags["InInitialEntityName"] = 16777216] = "InInitialEntityName";
-        NodeBuilderFlags[NodeBuilderFlags["InReverseMappedType"] = 33554432] = "InReverseMappedType";
     })(NodeBuilderFlags = ts.NodeBuilderFlags || (ts.NodeBuilderFlags = {}));
     // Ensure the shared flags between this and `NodeBuilderFlags` stay in alignment
     var TypeFormatFlags;
@@ -4601,6 +4737,7 @@ var ts;
         CheckFlags[CheckFlags["HasNeverType"] = 131072] = "HasNeverType";
         CheckFlags[CheckFlags["Mapped"] = 262144] = "Mapped";
         CheckFlags[CheckFlags["StripOptional"] = 524288] = "StripOptional";
+        CheckFlags[CheckFlags["Unresolved"] = 1048576] = "Unresolved";
         CheckFlags[CheckFlags["Synthetic"] = 6] = "Synthetic";
         CheckFlags[CheckFlags["Discriminant"] = 192] = "Discriminant";
         CheckFlags[CheckFlags["Partial"] = 48] = "Partial";
@@ -4651,6 +4788,7 @@ var ts;
         NodeCheckFlags[NodeCheckFlags["ClassWithConstructorReference"] = 16777216] = "ClassWithConstructorReference";
         NodeCheckFlags[NodeCheckFlags["ConstructorReferenceInClass"] = 33554432] = "ConstructorReferenceInClass";
         NodeCheckFlags[NodeCheckFlags["ContainsClassWithPrivateIdentifiers"] = 67108864] = "ContainsClassWithPrivateIdentifiers";
+        NodeCheckFlags[NodeCheckFlags["ContainsSuperPropertyInStaticInitializer"] = 134217728] = "ContainsSuperPropertyInStaticInitializer";
     })(NodeCheckFlags = ts.NodeCheckFlags || (ts.NodeCheckFlags = {}));
     var TypeFlags;
     (function (TypeFlags) {
@@ -4720,25 +4858,30 @@ var ts;
         /* @internal */
         TypeFlags[TypeFlags["Simplifiable"] = 25165824] = "Simplifiable";
         /* @internal */
-        TypeFlags[TypeFlags["Substructure"] = 469237760] = "Substructure";
+        TypeFlags[TypeFlags["Singleton"] = 67358815] = "Singleton";
         // 'Narrowable' types are types where narrowing actually narrows.
         // This *should* be every type other than null, undefined, void, and never
         TypeFlags[TypeFlags["Narrowable"] = 536624127] = "Narrowable";
-        /* @internal */
-        TypeFlags[TypeFlags["NotPrimitiveUnion"] = 468598819] = "NotPrimitiveUnion";
         // The following flags are aggregated during union and intersection type construction
         /* @internal */
         TypeFlags[TypeFlags["IncludesMask"] = 205258751] = "IncludesMask";
         // The following flags are used for different purposes during union and intersection type construction
         /* @internal */
-        TypeFlags[TypeFlags["IncludesStructuredOrInstantiable"] = 262144] = "IncludesStructuredOrInstantiable";
+        TypeFlags[TypeFlags["IncludesMissingType"] = 262144] = "IncludesMissingType";
         /* @internal */
         TypeFlags[TypeFlags["IncludesNonWideningType"] = 4194304] = "IncludesNonWideningType";
         /* @internal */
         TypeFlags[TypeFlags["IncludesWildcard"] = 8388608] = "IncludesWildcard";
         /* @internal */
         TypeFlags[TypeFlags["IncludesEmptyObject"] = 16777216] = "IncludesEmptyObject";
+        /* @internal */
+        TypeFlags[TypeFlags["IncludesInstantiable"] = 33554432] = "IncludesInstantiable";
+        /* @internal */
+        TypeFlags[TypeFlags["NotPrimitiveUnion"] = 36323363] = "NotPrimitiveUnion";
     })(TypeFlags = ts.TypeFlags || (ts.TypeFlags = {}));
+    // Types included in TypeFlags.ObjectFlagsType have an objectFlags property. Some ObjectFlags
+    // are specific to certain types and reuse the same bit position. Those ObjectFlags require a check
+    // for a certain TypeFlags value to determine their meaning.
     var ObjectFlags;
     (function (ObjectFlags) {
         ObjectFlags[ObjectFlags["Class"] = 1] = "Class";
@@ -4751,50 +4894,59 @@ var ts;
         ObjectFlags[ObjectFlags["ObjectLiteral"] = 128] = "ObjectLiteral";
         ObjectFlags[ObjectFlags["EvolvingArray"] = 256] = "EvolvingArray";
         ObjectFlags[ObjectFlags["ObjectLiteralPatternWithComputedProperties"] = 512] = "ObjectLiteralPatternWithComputedProperties";
-        ObjectFlags[ObjectFlags["ContainsSpread"] = 1024] = "ContainsSpread";
-        ObjectFlags[ObjectFlags["ReverseMapped"] = 2048] = "ReverseMapped";
-        ObjectFlags[ObjectFlags["JsxAttributes"] = 4096] = "JsxAttributes";
-        ObjectFlags[ObjectFlags["MarkerType"] = 8192] = "MarkerType";
-        ObjectFlags[ObjectFlags["JSLiteral"] = 16384] = "JSLiteral";
-        ObjectFlags[ObjectFlags["FreshLiteral"] = 32768] = "FreshLiteral";
-        ObjectFlags[ObjectFlags["ArrayLiteral"] = 65536] = "ArrayLiteral";
-        ObjectFlags[ObjectFlags["ObjectRestType"] = 131072] = "ObjectRestType";
+        ObjectFlags[ObjectFlags["ReverseMapped"] = 1024] = "ReverseMapped";
+        ObjectFlags[ObjectFlags["JsxAttributes"] = 2048] = "JsxAttributes";
+        ObjectFlags[ObjectFlags["MarkerType"] = 4096] = "MarkerType";
+        ObjectFlags[ObjectFlags["JSLiteral"] = 8192] = "JSLiteral";
+        ObjectFlags[ObjectFlags["FreshLiteral"] = 16384] = "FreshLiteral";
+        ObjectFlags[ObjectFlags["ArrayLiteral"] = 32768] = "ArrayLiteral";
         /* @internal */
-        ObjectFlags[ObjectFlags["PrimitiveUnion"] = 262144] = "PrimitiveUnion";
+        ObjectFlags[ObjectFlags["PrimitiveUnion"] = 65536] = "PrimitiveUnion";
         /* @internal */
-        ObjectFlags[ObjectFlags["ContainsWideningType"] = 524288] = "ContainsWideningType";
+        ObjectFlags[ObjectFlags["ContainsWideningType"] = 131072] = "ContainsWideningType";
         /* @internal */
-        ObjectFlags[ObjectFlags["ContainsObjectOrArrayLiteral"] = 1048576] = "ContainsObjectOrArrayLiteral";
+        ObjectFlags[ObjectFlags["ContainsObjectOrArrayLiteral"] = 262144] = "ContainsObjectOrArrayLiteral";
         /* @internal */
-        ObjectFlags[ObjectFlags["NonInferrableType"] = 2097152] = "NonInferrableType";
+        ObjectFlags[ObjectFlags["NonInferrableType"] = 524288] = "NonInferrableType";
         /* @internal */
-        ObjectFlags[ObjectFlags["IsGenericObjectTypeComputed"] = 4194304] = "IsGenericObjectTypeComputed";
+        ObjectFlags[ObjectFlags["CouldContainTypeVariablesComputed"] = 1048576] = "CouldContainTypeVariablesComputed";
         /* @internal */
-        ObjectFlags[ObjectFlags["IsGenericObjectType"] = 8388608] = "IsGenericObjectType";
+        ObjectFlags[ObjectFlags["CouldContainTypeVariables"] = 2097152] = "CouldContainTypeVariables";
+        ObjectFlags[ObjectFlags["ClassOrInterface"] = 3] = "ClassOrInterface";
         /* @internal */
-        ObjectFlags[ObjectFlags["IsGenericIndexTypeComputed"] = 16777216] = "IsGenericIndexTypeComputed";
+        ObjectFlags[ObjectFlags["RequiresWidening"] = 393216] = "RequiresWidening";
         /* @internal */
-        ObjectFlags[ObjectFlags["IsGenericIndexType"] = 33554432] = "IsGenericIndexType";
+        ObjectFlags[ObjectFlags["PropagatingFlags"] = 917504] = "PropagatingFlags";
+        // Object flags that uniquely identify the kind of ObjectType
         /* @internal */
-        ObjectFlags[ObjectFlags["CouldContainTypeVariablesComputed"] = 67108864] = "CouldContainTypeVariablesComputed";
+        ObjectFlags[ObjectFlags["ObjectTypeKindMask"] = 1343] = "ObjectTypeKindMask";
+        // Flags that require TypeFlags.Object
+        ObjectFlags[ObjectFlags["ContainsSpread"] = 4194304] = "ContainsSpread";
+        ObjectFlags[ObjectFlags["ObjectRestType"] = 8388608] = "ObjectRestType";
         /* @internal */
-        ObjectFlags[ObjectFlags["CouldContainTypeVariables"] = 134217728] = "CouldContainTypeVariables";
+        ObjectFlags[ObjectFlags["IsClassInstanceClone"] = 16777216] = "IsClassInstanceClone";
+        // Flags that require TypeFlags.Object and ObjectFlags.Reference
         /* @internal */
-        ObjectFlags[ObjectFlags["ContainsIntersections"] = 268435456] = "ContainsIntersections";
+        ObjectFlags[ObjectFlags["IdenticalBaseTypeCalculated"] = 33554432] = "IdenticalBaseTypeCalculated";
         /* @internal */
-        ObjectFlags[ObjectFlags["IsNeverIntersectionComputed"] = 268435456] = "IsNeverIntersectionComputed";
+        ObjectFlags[ObjectFlags["IdenticalBaseTypeExists"] = 67108864] = "IdenticalBaseTypeExists";
+        // Flags that require TypeFlags.UnionOrIntersection or TypeFlags.Substitution
         /* @internal */
-        ObjectFlags[ObjectFlags["IsNeverIntersection"] = 536870912] = "IsNeverIntersection";
+        ObjectFlags[ObjectFlags["IsGenericTypeComputed"] = 4194304] = "IsGenericTypeComputed";
         /* @internal */
-        ObjectFlags[ObjectFlags["IsClassInstanceClone"] = 1073741824] = "IsClassInstanceClone";
-        ObjectFlags[ObjectFlags["ClassOrInterface"] = 3] = "ClassOrInterface";
+        ObjectFlags[ObjectFlags["IsGenericObjectType"] = 8388608] = "IsGenericObjectType";
         /* @internal */
-        ObjectFlags[ObjectFlags["RequiresWidening"] = 1572864] = "RequiresWidening";
+        ObjectFlags[ObjectFlags["IsGenericIndexType"] = 16777216] = "IsGenericIndexType";
         /* @internal */
-        ObjectFlags[ObjectFlags["PropagatingFlags"] = 3670016] = "PropagatingFlags";
-        // Object flags that uniquely identify the kind of ObjectType
+        ObjectFlags[ObjectFlags["IsGenericType"] = 25165824] = "IsGenericType";
+        // Flags that require TypeFlags.Union
+        /* @internal */
+        ObjectFlags[ObjectFlags["ContainsIntersections"] = 33554432] = "ContainsIntersections";
+        // Flags that require TypeFlags.Intersection
+        /* @internal */
+        ObjectFlags[ObjectFlags["IsNeverIntersectionComputed"] = 33554432] = "IsNeverIntersectionComputed";
         /* @internal */
-        ObjectFlags[ObjectFlags["ObjectTypeKindMask"] = 2367] = "ObjectTypeKindMask";
+        ObjectFlags[ObjectFlags["IsNeverIntersection"] = 67108864] = "IsNeverIntersection";
     })(ObjectFlags = ts.ObjectFlags || (ts.ObjectFlags = {}));
     /* @internal */
     var VarianceFlags;
@@ -4821,6 +4973,21 @@ var ts;
         ElementFlags[ElementFlags["NonRest"] = 11] = "NonRest";
     })(ElementFlags = ts.ElementFlags || (ts.ElementFlags = {}));
     /* @internal */
+    var AccessFlags;
+    (function (AccessFlags) {
+        AccessFlags[AccessFlags["None"] = 0] = "None";
+        AccessFlags[AccessFlags["IncludeUndefined"] = 1] = "IncludeUndefined";
+        AccessFlags[AccessFlags["NoIndexSignatures"] = 2] = "NoIndexSignatures";
+        AccessFlags[AccessFlags["Writing"] = 4] = "Writing";
+        AccessFlags[AccessFlags["CacheSymbol"] = 8] = "CacheSymbol";
+        AccessFlags[AccessFlags["NoTupleBoundsCheck"] = 16] = "NoTupleBoundsCheck";
+        AccessFlags[AccessFlags["ExpressionPosition"] = 32] = "ExpressionPosition";
+        AccessFlags[AccessFlags["ReportDeprecated"] = 64] = "ReportDeprecated";
+        AccessFlags[AccessFlags["SuppressNoImplicitAnyError"] = 128] = "SuppressNoImplicitAnyError";
+        AccessFlags[AccessFlags["Contextual"] = 256] = "Contextual";
+        AccessFlags[AccessFlags["Persistent"] = 1] = "Persistent";
+    })(AccessFlags = ts.AccessFlags || (ts.AccessFlags = {}));
+    /* @internal */
     var JsxReferenceKind;
     (function (JsxReferenceKind) {
         JsxReferenceKind[JsxReferenceKind["Component"] = 0] = "Component";
@@ -4868,16 +5035,17 @@ var ts;
     (function (InferencePriority) {
         InferencePriority[InferencePriority["NakedTypeVariable"] = 1] = "NakedTypeVariable";
         InferencePriority[InferencePriority["SpeculativeTuple"] = 2] = "SpeculativeTuple";
-        InferencePriority[InferencePriority["HomomorphicMappedType"] = 4] = "HomomorphicMappedType";
-        InferencePriority[InferencePriority["PartialHomomorphicMappedType"] = 8] = "PartialHomomorphicMappedType";
-        InferencePriority[InferencePriority["MappedTypeConstraint"] = 16] = "MappedTypeConstraint";
-        InferencePriority[InferencePriority["ContravariantConditional"] = 32] = "ContravariantConditional";
-        InferencePriority[InferencePriority["ReturnType"] = 64] = "ReturnType";
-        InferencePriority[InferencePriority["LiteralKeyof"] = 128] = "LiteralKeyof";
-        InferencePriority[InferencePriority["NoConstraints"] = 256] = "NoConstraints";
-        InferencePriority[InferencePriority["AlwaysStrict"] = 512] = "AlwaysStrict";
-        InferencePriority[InferencePriority["MaxValue"] = 1024] = "MaxValue";
-        InferencePriority[InferencePriority["PriorityImpliesCombination"] = 208] = "PriorityImpliesCombination";
+        InferencePriority[InferencePriority["SubstituteSource"] = 4] = "SubstituteSource";
+        InferencePriority[InferencePriority["HomomorphicMappedType"] = 8] = "HomomorphicMappedType";
+        InferencePriority[InferencePriority["PartialHomomorphicMappedType"] = 16] = "PartialHomomorphicMappedType";
+        InferencePriority[InferencePriority["MappedTypeConstraint"] = 32] = "MappedTypeConstraint";
+        InferencePriority[InferencePriority["ContravariantConditional"] = 64] = "ContravariantConditional";
+        InferencePriority[InferencePriority["ReturnType"] = 128] = "ReturnType";
+        InferencePriority[InferencePriority["LiteralKeyof"] = 256] = "LiteralKeyof";
+        InferencePriority[InferencePriority["NoConstraints"] = 512] = "NoConstraints";
+        InferencePriority[InferencePriority["AlwaysStrict"] = 1024] = "AlwaysStrict";
+        InferencePriority[InferencePriority["MaxValue"] = 2048] = "MaxValue";
+        InferencePriority[InferencePriority["PriorityImpliesCombination"] = 416] = "PriorityImpliesCombination";
         InferencePriority[InferencePriority["Circularity"] = -1] = "Circularity";
     })(InferencePriority = ts.InferencePriority || (ts.InferencePriority = {}));
     /* @internal */
@@ -4949,26 +5117,35 @@ var ts;
     (function (ModuleResolutionKind) {
         ModuleResolutionKind[ModuleResolutionKind["Classic"] = 1] = "Classic";
         ModuleResolutionKind[ModuleResolutionKind["NodeJs"] = 2] = "NodeJs";
+        // Starting with node12, node's module resolver has significant departures from traditional cjs resolution
+        // to better support ecmascript modules and their use within node - more features are still being added, so
+        // we can expect it to change over time, and as such, offer both a `NodeNext` moving resolution target, and a `Node12`
+        // version-anchored resolution target
+        ModuleResolutionKind[ModuleResolutionKind["Node12"] = 3] = "Node12";
+        ModuleResolutionKind[ModuleResolutionKind["NodeNext"] = 99] = "NodeNext";
     })(ModuleResolutionKind = ts.ModuleResolutionKind || (ts.ModuleResolutionKind = {}));
     var WatchFileKind;
     (function (WatchFileKind) {
         WatchFileKind[WatchFileKind["FixedPollingInterval"] = 0] = "FixedPollingInterval";
         WatchFileKind[WatchFileKind["PriorityPollingInterval"] = 1] = "PriorityPollingInterval";
         WatchFileKind[WatchFileKind["DynamicPriorityPolling"] = 2] = "DynamicPriorityPolling";
-        WatchFileKind[WatchFileKind["UseFsEvents"] = 3] = "UseFsEvents";
-        WatchFileKind[WatchFileKind["UseFsEventsOnParentDirectory"] = 4] = "UseFsEventsOnParentDirectory";
+        WatchFileKind[WatchFileKind["FixedChunkSizePolling"] = 3] = "FixedChunkSizePolling";
+        WatchFileKind[WatchFileKind["UseFsEvents"] = 4] = "UseFsEvents";
+        WatchFileKind[WatchFileKind["UseFsEventsOnParentDirectory"] = 5] = "UseFsEventsOnParentDirectory";
     })(WatchFileKind = ts.WatchFileKind || (ts.WatchFileKind = {}));
     var WatchDirectoryKind;
     (function (WatchDirectoryKind) {
         WatchDirectoryKind[WatchDirectoryKind["UseFsEvents"] = 0] = "UseFsEvents";
         WatchDirectoryKind[WatchDirectoryKind["FixedPollingInterval"] = 1] = "FixedPollingInterval";
         WatchDirectoryKind[WatchDirectoryKind["DynamicPriorityPolling"] = 2] = "DynamicPriorityPolling";
+        WatchDirectoryKind[WatchDirectoryKind["FixedChunkSizePolling"] = 3] = "FixedChunkSizePolling";
     })(WatchDirectoryKind = ts.WatchDirectoryKind || (ts.WatchDirectoryKind = {}));
     var PollingWatchKind;
     (function (PollingWatchKind) {
         PollingWatchKind[PollingWatchKind["FixedInterval"] = 0] = "FixedInterval";
         PollingWatchKind[PollingWatchKind["PriorityInterval"] = 1] = "PriorityInterval";
         PollingWatchKind[PollingWatchKind["DynamicPriority"] = 2] = "DynamicPriority";
+        PollingWatchKind[PollingWatchKind["FixedChunkSize"] = 3] = "FixedChunkSize";
     })(PollingWatchKind = ts.PollingWatchKind || (ts.PollingWatchKind = {}));
     var ModuleKind;
     (function (ModuleKind) {
@@ -4982,7 +5159,11 @@ var ts;
         //       module kind).
         ModuleKind[ModuleKind["ES2015"] = 5] = "ES2015";
         ModuleKind[ModuleKind["ES2020"] = 6] = "ES2020";
+        ModuleKind[ModuleKind["ES2022"] = 7] = "ES2022";
         ModuleKind[ModuleKind["ESNext"] = 99] = "ESNext";
+        // Node12+ is an amalgam of commonjs (albeit updated) and es2020+, and represents a distinct module system from es2020/esnext
+        ModuleKind[ModuleKind["Node12"] = 100] = "Node12";
+        ModuleKind[ModuleKind["NodeNext"] = 199] = "NodeNext";
     })(ModuleKind = ts.ModuleKind || (ts.ModuleKind = {}));
     var JsxEmit;
     (function (JsxEmit) {
@@ -5029,6 +5210,7 @@ var ts;
         ScriptTarget[ScriptTarget["ES2018"] = 5] = "ES2018";
         ScriptTarget[ScriptTarget["ES2019"] = 6] = "ES2019";
         ScriptTarget[ScriptTarget["ES2020"] = 7] = "ES2020";
+        ScriptTarget[ScriptTarget["ES2021"] = 8] = "ES2021";
         ScriptTarget[ScriptTarget["ESNext"] = 99] = "ESNext";
         ScriptTarget[ScriptTarget["JSON"] = 100] = "JSON";
         ScriptTarget[ScriptTarget["Latest"] = 99] = "Latest";
@@ -5181,6 +5363,12 @@ var ts;
         Extension["Jsx"] = ".jsx";
         Extension["Json"] = ".json";
         Extension["TsBuildInfo"] = ".tsbuildinfo";
+        Extension["Mjs"] = ".mjs";
+        Extension["Mts"] = ".mts";
+        Extension["Dmts"] = ".d.mts";
+        Extension["Cjs"] = ".cjs";
+        Extension["Cts"] = ".cts";
+        Extension["Dcts"] = ".d.cts";
     })(Extension = ts.Extension || (ts.Extension = {}));
     /* @internal */
     var TransformFlags;
@@ -5191,29 +5379,32 @@ var ts;
         TransformFlags[TransformFlags["ContainsTypeScript"] = 1] = "ContainsTypeScript";
         TransformFlags[TransformFlags["ContainsJsx"] = 2] = "ContainsJsx";
         TransformFlags[TransformFlags["ContainsESNext"] = 4] = "ContainsESNext";
-        TransformFlags[TransformFlags["ContainsES2020"] = 8] = "ContainsES2020";
-        TransformFlags[TransformFlags["ContainsES2019"] = 16] = "ContainsES2019";
-        TransformFlags[TransformFlags["ContainsES2018"] = 32] = "ContainsES2018";
-        TransformFlags[TransformFlags["ContainsES2017"] = 64] = "ContainsES2017";
-        TransformFlags[TransformFlags["ContainsES2016"] = 128] = "ContainsES2016";
-        TransformFlags[TransformFlags["ContainsES2015"] = 256] = "ContainsES2015";
-        TransformFlags[TransformFlags["ContainsGenerator"] = 512] = "ContainsGenerator";
-        TransformFlags[TransformFlags["ContainsDestructuringAssignment"] = 1024] = "ContainsDestructuringAssignment";
+        TransformFlags[TransformFlags["ContainsES2021"] = 8] = "ContainsES2021";
+        TransformFlags[TransformFlags["ContainsES2020"] = 16] = "ContainsES2020";
+        TransformFlags[TransformFlags["ContainsES2019"] = 32] = "ContainsES2019";
+        TransformFlags[TransformFlags["ContainsES2018"] = 64] = "ContainsES2018";
+        TransformFlags[TransformFlags["ContainsES2017"] = 128] = "ContainsES2017";
+        TransformFlags[TransformFlags["ContainsES2016"] = 256] = "ContainsES2016";
+        TransformFlags[TransformFlags["ContainsES2015"] = 512] = "ContainsES2015";
+        TransformFlags[TransformFlags["ContainsGenerator"] = 1024] = "ContainsGenerator";
+        TransformFlags[TransformFlags["ContainsDestructuringAssignment"] = 2048] = "ContainsDestructuringAssignment";
         // Markers
         // - Flags used to indicate that a subtree contains a specific transformation.
-        TransformFlags[TransformFlags["ContainsTypeScriptClassSyntax"] = 2048] = "ContainsTypeScriptClassSyntax";
-        TransformFlags[TransformFlags["ContainsLexicalThis"] = 4096] = "ContainsLexicalThis";
-        TransformFlags[TransformFlags["ContainsRestOrSpread"] = 8192] = "ContainsRestOrSpread";
-        TransformFlags[TransformFlags["ContainsObjectRestOrSpread"] = 16384] = "ContainsObjectRestOrSpread";
-        TransformFlags[TransformFlags["ContainsComputedPropertyName"] = 32768] = "ContainsComputedPropertyName";
-        TransformFlags[TransformFlags["ContainsBlockScopedBinding"] = 65536] = "ContainsBlockScopedBinding";
-        TransformFlags[TransformFlags["ContainsBindingPattern"] = 131072] = "ContainsBindingPattern";
-        TransformFlags[TransformFlags["ContainsYield"] = 262144] = "ContainsYield";
-        TransformFlags[TransformFlags["ContainsAwait"] = 524288] = "ContainsAwait";
-        TransformFlags[TransformFlags["ContainsHoistedDeclarationOrCompletion"] = 1048576] = "ContainsHoistedDeclarationOrCompletion";
-        TransformFlags[TransformFlags["ContainsDynamicImport"] = 2097152] = "ContainsDynamicImport";
-        TransformFlags[TransformFlags["ContainsClassFields"] = 4194304] = "ContainsClassFields";
-        TransformFlags[TransformFlags["ContainsPossibleTopLevelAwait"] = 8388608] = "ContainsPossibleTopLevelAwait";
+        TransformFlags[TransformFlags["ContainsTypeScriptClassSyntax"] = 4096] = "ContainsTypeScriptClassSyntax";
+        TransformFlags[TransformFlags["ContainsLexicalThis"] = 8192] = "ContainsLexicalThis";
+        TransformFlags[TransformFlags["ContainsRestOrSpread"] = 16384] = "ContainsRestOrSpread";
+        TransformFlags[TransformFlags["ContainsObjectRestOrSpread"] = 32768] = "ContainsObjectRestOrSpread";
+        TransformFlags[TransformFlags["ContainsComputedPropertyName"] = 65536] = "ContainsComputedPropertyName";
+        TransformFlags[TransformFlags["ContainsBlockScopedBinding"] = 131072] = "ContainsBlockScopedBinding";
+        TransformFlags[TransformFlags["ContainsBindingPattern"] = 262144] = "ContainsBindingPattern";
+        TransformFlags[TransformFlags["ContainsYield"] = 524288] = "ContainsYield";
+        TransformFlags[TransformFlags["ContainsAwait"] = 1048576] = "ContainsAwait";
+        TransformFlags[TransformFlags["ContainsHoistedDeclarationOrCompletion"] = 2097152] = "ContainsHoistedDeclarationOrCompletion";
+        TransformFlags[TransformFlags["ContainsDynamicImport"] = 4194304] = "ContainsDynamicImport";
+        TransformFlags[TransformFlags["ContainsClassFields"] = 8388608] = "ContainsClassFields";
+        TransformFlags[TransformFlags["ContainsPossibleTopLevelAwait"] = 16777216] = "ContainsPossibleTopLevelAwait";
+        TransformFlags[TransformFlags["ContainsLexicalSuper"] = 33554432] = "ContainsLexicalSuper";
+        TransformFlags[TransformFlags["ContainsUpdateExpressionForIdentifier"] = 67108864] = "ContainsUpdateExpressionForIdentifier";
         // Please leave this as 1 << 29.
         // It is the maximum bit we can set before we outgrow the size of a v8 small integer (SMI) on an x86 system.
         // It is a good reminder of how much room we have left
@@ -5223,40 +5414,51 @@ var ts;
         TransformFlags[TransformFlags["AssertTypeScript"] = 1] = "AssertTypeScript";
         TransformFlags[TransformFlags["AssertJsx"] = 2] = "AssertJsx";
         TransformFlags[TransformFlags["AssertESNext"] = 4] = "AssertESNext";
-        TransformFlags[TransformFlags["AssertES2020"] = 8] = "AssertES2020";
-        TransformFlags[TransformFlags["AssertES2019"] = 16] = "AssertES2019";
-        TransformFlags[TransformFlags["AssertES2018"] = 32] = "AssertES2018";
-        TransformFlags[TransformFlags["AssertES2017"] = 64] = "AssertES2017";
-        TransformFlags[TransformFlags["AssertES2016"] = 128] = "AssertES2016";
-        TransformFlags[TransformFlags["AssertES2015"] = 256] = "AssertES2015";
-        TransformFlags[TransformFlags["AssertGenerator"] = 512] = "AssertGenerator";
-        TransformFlags[TransformFlags["AssertDestructuringAssignment"] = 1024] = "AssertDestructuringAssignment";
+        TransformFlags[TransformFlags["AssertES2021"] = 8] = "AssertES2021";
+        TransformFlags[TransformFlags["AssertES2020"] = 16] = "AssertES2020";
+        TransformFlags[TransformFlags["AssertES2019"] = 32] = "AssertES2019";
+        TransformFlags[TransformFlags["AssertES2018"] = 64] = "AssertES2018";
+        TransformFlags[TransformFlags["AssertES2017"] = 128] = "AssertES2017";
+        TransformFlags[TransformFlags["AssertES2016"] = 256] = "AssertES2016";
+        TransformFlags[TransformFlags["AssertES2015"] = 512] = "AssertES2015";
+        TransformFlags[TransformFlags["AssertGenerator"] = 1024] = "AssertGenerator";
+        TransformFlags[TransformFlags["AssertDestructuringAssignment"] = 2048] = "AssertDestructuringAssignment";
         // Scope Exclusions
         // - Bitmasks that exclude flags from propagating out of a specific context
         //   into the subtree flags of their container.
         TransformFlags[TransformFlags["OuterExpressionExcludes"] = 536870912] = "OuterExpressionExcludes";
         TransformFlags[TransformFlags["PropertyAccessExcludes"] = 536870912] = "PropertyAccessExcludes";
         TransformFlags[TransformFlags["NodeExcludes"] = 536870912] = "NodeExcludes";
-        TransformFlags[TransformFlags["ArrowFunctionExcludes"] = 547309568] = "ArrowFunctionExcludes";
-        TransformFlags[TransformFlags["FunctionExcludes"] = 547313664] = "FunctionExcludes";
-        TransformFlags[TransformFlags["ConstructorExcludes"] = 547311616] = "ConstructorExcludes";
-        TransformFlags[TransformFlags["MethodOrAccessorExcludes"] = 538923008] = "MethodOrAccessorExcludes";
-        TransformFlags[TransformFlags["PropertyExcludes"] = 536875008] = "PropertyExcludes";
-        TransformFlags[TransformFlags["ClassExcludes"] = 536905728] = "ClassExcludes";
-        TransformFlags[TransformFlags["ModuleExcludes"] = 546379776] = "ModuleExcludes";
+        TransformFlags[TransformFlags["ArrowFunctionExcludes"] = 557748224] = "ArrowFunctionExcludes";
+        TransformFlags[TransformFlags["FunctionExcludes"] = 591310848] = "FunctionExcludes";
+        TransformFlags[TransformFlags["ConstructorExcludes"] = 591306752] = "ConstructorExcludes";
+        TransformFlags[TransformFlags["MethodOrAccessorExcludes"] = 574529536] = "MethodOrAccessorExcludes";
+        TransformFlags[TransformFlags["PropertyExcludes"] = 570433536] = "PropertyExcludes";
+        TransformFlags[TransformFlags["ClassExcludes"] = 536940544] = "ClassExcludes";
+        TransformFlags[TransformFlags["ModuleExcludes"] = 589443072] = "ModuleExcludes";
         TransformFlags[TransformFlags["TypeExcludes"] = -2] = "TypeExcludes";
-        TransformFlags[TransformFlags["ObjectLiteralExcludes"] = 536922112] = "ObjectLiteralExcludes";
-        TransformFlags[TransformFlags["ArrayLiteralOrCallOrNewExcludes"] = 536879104] = "ArrayLiteralOrCallOrNewExcludes";
-        TransformFlags[TransformFlags["VariableDeclarationListExcludes"] = 537018368] = "VariableDeclarationListExcludes";
+        TransformFlags[TransformFlags["ObjectLiteralExcludes"] = 536973312] = "ObjectLiteralExcludes";
+        TransformFlags[TransformFlags["ArrayLiteralOrCallOrNewExcludes"] = 536887296] = "ArrayLiteralOrCallOrNewExcludes";
+        TransformFlags[TransformFlags["VariableDeclarationListExcludes"] = 537165824] = "VariableDeclarationListExcludes";
         TransformFlags[TransformFlags["ParameterExcludes"] = 536870912] = "ParameterExcludes";
-        TransformFlags[TransformFlags["CatchClauseExcludes"] = 536887296] = "CatchClauseExcludes";
-        TransformFlags[TransformFlags["BindingPatternExcludes"] = 536879104] = "BindingPatternExcludes";
+        TransformFlags[TransformFlags["CatchClauseExcludes"] = 536903680] = "CatchClauseExcludes";
+        TransformFlags[TransformFlags["BindingPatternExcludes"] = 536887296] = "BindingPatternExcludes";
+        TransformFlags[TransformFlags["ContainsLexicalThisOrSuper"] = 33562624] = "ContainsLexicalThisOrSuper";
         // Propagating flags
         // - Bitmasks for flags that should propagate from a child
-        TransformFlags[TransformFlags["PropertyNamePropagatingFlags"] = 4096] = "PropertyNamePropagatingFlags";
+        TransformFlags[TransformFlags["PropertyNamePropagatingFlags"] = 33562624] = "PropertyNamePropagatingFlags";
         // Masks
         // - Additional bitmasks
     })(TransformFlags = ts.TransformFlags || (ts.TransformFlags = {}));
+    // Reference: https://code.visualstudio.com/docs/editor/userdefinedsnippets#_snippet-syntax
+    /* @internal */
+    var SnippetKind;
+    (function (SnippetKind) {
+        SnippetKind[SnippetKind["TabStop"] = 0] = "TabStop";
+        SnippetKind[SnippetKind["Placeholder"] = 1] = "Placeholder";
+        SnippetKind[SnippetKind["Choice"] = 2] = "Choice";
+        SnippetKind[SnippetKind["Variable"] = 3] = "Variable";
+    })(SnippetKind = ts.SnippetKind || (ts.SnippetKind = {}));
     var EmitFlags;
     (function (EmitFlags) {
         EmitFlags[EmitFlags["None"] = 0] = "None";
@@ -5291,6 +5493,8 @@ var ts;
         /*@internal*/ EmitFlags[EmitFlags["TypeScriptClassWrapper"] = 33554432] = "TypeScriptClassWrapper";
         /*@internal*/ EmitFlags[EmitFlags["NeverApplyImportHelper"] = 67108864] = "NeverApplyImportHelper";
         /*@internal*/ EmitFlags[EmitFlags["IgnoreSourceNewlines"] = 134217728] = "IgnoreSourceNewlines";
+        /*@internal*/ EmitFlags[EmitFlags["Immutable"] = 268435456] = "Immutable";
+        /*@internal*/ EmitFlags[EmitFlags["IndirectCall"] = 536870912] = "IndirectCall";
     })(EmitFlags = ts.EmitFlags || (ts.EmitFlags = {}));
     /**
      * Used by the checker, this enum keeps track of external emit helpers that should be type
@@ -5320,9 +5524,10 @@ var ts;
         ExternalEmitHelpers[ExternalEmitHelpers["MakeTemplateObject"] = 262144] = "MakeTemplateObject";
         ExternalEmitHelpers[ExternalEmitHelpers["ClassPrivateFieldGet"] = 524288] = "ClassPrivateFieldGet";
         ExternalEmitHelpers[ExternalEmitHelpers["ClassPrivateFieldSet"] = 1048576] = "ClassPrivateFieldSet";
-        ExternalEmitHelpers[ExternalEmitHelpers["CreateBinding"] = 2097152] = "CreateBinding";
+        ExternalEmitHelpers[ExternalEmitHelpers["ClassPrivateFieldIn"] = 2097152] = "ClassPrivateFieldIn";
+        ExternalEmitHelpers[ExternalEmitHelpers["CreateBinding"] = 4194304] = "CreateBinding";
         ExternalEmitHelpers[ExternalEmitHelpers["FirstEmitHelper"] = 1] = "FirstEmitHelper";
-        ExternalEmitHelpers[ExternalEmitHelpers["LastEmitHelper"] = 2097152] = "LastEmitHelper";
+        ExternalEmitHelpers[ExternalEmitHelpers["LastEmitHelper"] = 4194304] = "LastEmitHelper";
         // Helpers included by ES2015 for..of
         ExternalEmitHelpers[ExternalEmitHelpers["ForOfIncludes"] = 256] = "ForOfIncludes";
         // Helpers included by ES2017 for..await..of
@@ -5352,6 +5557,7 @@ var ts;
         OuterExpressionKinds[OuterExpressionKinds["PartiallyEmittedExpressions"] = 8] = "PartiallyEmittedExpressions";
         OuterExpressionKinds[OuterExpressionKinds["Assertions"] = 6] = "Assertions";
         OuterExpressionKinds[OuterExpressionKinds["All"] = 15] = "All";
+        OuterExpressionKinds[OuterExpressionKinds["ExcludeJSDocTypeAssertion"] = 16] = "ExcludeJSDocTypeAssertion";
     })(OuterExpressionKinds = ts.OuterExpressionKinds || (ts.OuterExpressionKinds = {}));
     /* @internal */
     var LexicalEnvironmentFlags;
@@ -5422,6 +5628,7 @@ var ts;
         ListFormat[ListFormat["ObjectBindingPatternElements"] = 525136] = "ObjectBindingPatternElements";
         ListFormat[ListFormat["ArrayBindingPatternElements"] = 524880] = "ArrayBindingPatternElements";
         ListFormat[ListFormat["ObjectLiteralExpressionProperties"] = 526226] = "ObjectLiteralExpressionProperties";
+        ListFormat[ListFormat["ImportClauseEntries"] = 526226] = "ImportClauseEntries";
         ListFormat[ListFormat["ArrayLiteralExpressionElements"] = 8914] = "ArrayLiteralExpressionElements";
         ListFormat[ListFormat["CommaListElements"] = 528] = "CommaListElements";
         ListFormat[ListFormat["CallExpressionArguments"] = 2576] = "CallExpressionArguments";
@@ -5792,7 +5999,7 @@ var ts;
         var rest = path.substring(rootLength).split(ts.directorySeparator);
         if (rest.length && !ts.lastOrUndefined(rest))
             rest.pop();
-        return __spreadArray([root], rest);
+        return __spreadArray([root], rest, true);
     }
     /**
      * Parse a path into an array containing a root component (at index 0) and zero or more path
@@ -5851,6 +6058,11 @@ var ts;
      * Normalize path separators, converting `\` into `/`.
      */
     function normalizeSlashes(path) {
+        var index = path.indexOf("\\");
+        if (index === -1) {
+            return path;
+        }
+        backslashRegExp.lastIndex = index; // prime regex with known position
         return path.replace(backslashRegExp, ts.directorySeparator);
     }
     ts.normalizeSlashes = normalizeSlashes;
@@ -5938,7 +6150,7 @@ var ts;
         for (var _i = 1; _i < arguments.length; _i++) {
             paths[_i - 1] = arguments[_i];
         }
-        return normalizePath(ts.some(paths) ? combinePaths.apply(void 0, __spreadArray([path], paths)) : normalizeSlashes(path));
+        return normalizePath(ts.some(paths) ? combinePaths.apply(void 0, __spreadArray([path], paths, false)) : normalizeSlashes(path));
     }
     ts.resolvePath = resolvePath;
     /**
@@ -5961,6 +6173,19 @@ var ts;
     ts.getNormalizedAbsolutePath = getNormalizedAbsolutePath;
     function normalizePath(path) {
         path = normalizeSlashes(path);
+        // Most paths don't require normalization
+        if (!relativePathSegmentRegExp.test(path)) {
+            return path;
+        }
+        // Some paths only require cleanup of `/./` or leading `./`
+        var simplified = path.replace(/\/\.\//g, "/").replace(/^\.\//, "");
+        if (simplified !== path) {
+            path = simplified;
+            if (!relativePathSegmentRegExp.test(path)) {
+                return path;
+            }
+        }
+        // Other paths require full normalization
         var normalized = getPathFromPathComponents(reducePathComponents(getPathComponents(path)));
         return normalized && hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(normalized) : normalized;
     }
@@ -6029,7 +6254,7 @@ var ts;
     ts.changeAnyExtension = changeAnyExtension;
     //// Path Comparisons
     // check path for these segments: '', '.'. '..'
-    var relativePathSegmentRegExp = /(^|\/)\.{0,2}($|\/)/;
+    var relativePathSegmentRegExp = /(?:\/\/)|(?:^|\/)\.\.?(?:$|\/)/;
     function comparePathsWorker(a, b, componentComparer) {
         if (a === b)
             return 0 /* EqualTo */;
@@ -6149,7 +6374,7 @@ var ts;
         for (; start < fromComponents.length; start++) {
             relative.push("..");
         }
-        return __spreadArray(__spreadArray([""], relative), components);
+        return __spreadArray(__spreadArray([""], relative, true), components, true);
     }
     ts.getPathComponentsRelativeTo = getPathComponentsRelativeTo;
     function getRelativePathFromDirectory(fromDirectory, to, getCanonicalFileNameOrIgnoreCase) {
@@ -6241,6 +6466,11 @@ var ts;
     })(PollingInterval = ts.PollingInterval || (ts.PollingInterval = {}));
     /* @internal */
     ts.missingFileModifiedTime = new Date(0); // Any subsequent modification will occur after this time
+    /* @internal */
+    function getModifiedTime(host, fileName) {
+        return host.getModifiedTime(fileName) || ts.missingFileModifiedTime;
+    }
+    ts.getModifiedTime = getModifiedTime;
     function createPollingIntervalBasedLevels(levels) {
         var _a;
         return _a = {},
@@ -6262,7 +6492,7 @@ var ts;
         pollingChunkSize = getCustomPollingBasedLevels("TSC_WATCH_POLLINGCHUNKSIZE", defaultChunkLevels) || pollingChunkSize;
         ts.unchangedPollThresholds = getCustomPollingBasedLevels("TSC_WATCH_UNCHANGEDPOLLTHRESHOLDS", defaultChunkLevels) || ts.unchangedPollThresholds;
         function getLevel(envVar, level) {
-            return system.getEnvironmentVariable(envVar + "_" + level.toUpperCase());
+            return system.getEnvironmentVariable("".concat(envVar, "_").concat(level.toUpperCase()));
         }
         function getCustomLevels(baseVariable) {
             var customLevels;
@@ -6297,6 +6527,51 @@ var ts;
         }
     }
     ts.setCustomPollingValues = setCustomPollingValues;
+    function pollWatchedFileQueue(host, queue, pollIndex, chunkSize, callbackOnWatchFileStat) {
+        var definedValueCopyToIndex = pollIndex;
+        // Max visit would be all elements of the queue
+        for (var canVisit = queue.length; chunkSize && canVisit; nextPollIndex(), canVisit--) {
+            var watchedFile = queue[pollIndex];
+            if (!watchedFile) {
+                continue;
+            }
+            else if (watchedFile.isClosed) {
+                queue[pollIndex] = undefined;
+                continue;
+            }
+            // Only files polled count towards chunkSize
+            chunkSize--;
+            var fileChanged = onWatchedFileStat(watchedFile, getModifiedTime(host, watchedFile.fileName));
+            if (watchedFile.isClosed) {
+                // Closed watcher as part of callback
+                queue[pollIndex] = undefined;
+                continue;
+            }
+            callbackOnWatchFileStat === null || callbackOnWatchFileStat === void 0 ? void 0 : callbackOnWatchFileStat(watchedFile, pollIndex, fileChanged);
+            // Defragment the queue while we are at it
+            if (queue[pollIndex]) {
+                // Copy this file to the non hole location
+                if (definedValueCopyToIndex < pollIndex) {
+                    queue[definedValueCopyToIndex] = watchedFile;
+                    queue[pollIndex] = undefined;
+                }
+                definedValueCopyToIndex++;
+            }
+        }
+        // Return next poll index
+        return pollIndex;
+        function nextPollIndex() {
+            pollIndex++;
+            if (pollIndex === queue.length) {
+                if (definedValueCopyToIndex < pollIndex) {
+                    // There are holes from definedValueCopyToIndex to end of queue, change queue size
+                    queue.length = definedValueCopyToIndex;
+                }
+                pollIndex = 0;
+                definedValueCopyToIndex = 0;
+            }
+        }
+    }
     /* @internal */
     function createDynamicPriorityPollingWatchFile(host) {
         var watchedFiles = [];
@@ -6310,7 +6585,7 @@ var ts;
                 fileName: fileName,
                 callback: callback,
                 unchangedPolls: 0,
-                mtime: getModifiedTime(fileName)
+                mtime: getModifiedTime(host, fileName)
             };
             watchedFiles.push(file);
             addToPollingIntervalQueue(file, defaultPollingInterval);
@@ -6353,25 +6628,9 @@ var ts;
             }
         }
         function pollQueue(queue, pollingInterval, pollIndex, chunkSize) {
-            // Max visit would be all elements of the queue
-            var needsVisit = queue.length;
-            var definedValueCopyToIndex = pollIndex;
-            for (var polled = 0; polled < chunkSize && needsVisit > 0; nextPollIndex(), needsVisit--) {
-                var watchedFile = queue[pollIndex];
-                if (!watchedFile) {
-                    continue;
-                }
-                else if (watchedFile.isClosed) {
-                    queue[pollIndex] = undefined;
-                    continue;
-                }
-                polled++;
-                var fileChanged = onWatchedFileStat(watchedFile, getModifiedTime(watchedFile.fileName));
-                if (watchedFile.isClosed) {
-                    // Closed watcher as part of callback
-                    queue[pollIndex] = undefined;
-                }
-                else if (fileChanged) {
+            return pollWatchedFileQueue(host, queue, pollIndex, chunkSize, onWatchFileStat);
+            function onWatchFileStat(watchedFile, pollIndex, fileChanged) {
+                if (fileChanged) {
                     watchedFile.unchangedPolls = 0;
                     // Changed files go to changedFilesInLastPoll queue
                     if (queue !== changedFilesInLastPoll) {
@@ -6393,27 +6652,6 @@ var ts;
                     queue[pollIndex] = undefined;
                     addToPollingIntervalQueue(watchedFile, pollingInterval === PollingInterval.Low ? PollingInterval.Medium : PollingInterval.High);
                 }
-                if (queue[pollIndex]) {
-                    // Copy this file to the non hole location
-                    if (definedValueCopyToIndex < pollIndex) {
-                        queue[definedValueCopyToIndex] = watchedFile;
-                        queue[pollIndex] = undefined;
-                    }
-                    definedValueCopyToIndex++;
-                }
-            }
-            // Return next poll index
-            return pollIndex;
-            function nextPollIndex() {
-                pollIndex++;
-                if (pollIndex === queue.length) {
-                    if (definedValueCopyToIndex < pollIndex) {
-                        // There are holes from nextDefinedValueIndex to end of queue, change queue size
-                        queue.length = definedValueCopyToIndex;
-                    }
-                    pollIndex = 0;
-                    definedValueCopyToIndex = 0;
-                }
             }
         }
         function pollingIntervalQueue(pollingInterval) {
@@ -6442,9 +6680,6 @@ var ts;
         function scheduleNextPoll(pollingInterval) {
             pollingIntervalQueue(pollingInterval).pollScheduled = host.setTimeout(pollingInterval === PollingInterval.Low ? pollLowPollingIntervalQueue : pollPollingIntervalQueue, pollingInterval, pollingIntervalQueue(pollingInterval));
         }
-        function getModifiedTime(fileName) {
-            return host.getModifiedTime(fileName) || ts.missingFileModifiedTime;
-        }
     }
     ts.createDynamicPriorityPollingWatchFile = createDynamicPriorityPollingWatchFile;
     function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames) {
@@ -6476,9 +6711,8 @@ var ts;
         function createDirectoryWatcher(dirName, dirPath, fallbackOptions) {
             var watcher = fsWatch(dirName, 1 /* Directory */, function (_eventName, relativeFileName) {
                 // When files are deleted from disk, the triggered "rename" event would have a relativefileName of "undefined"
-                if (!ts.isString(relativeFileName)) {
+                if (!ts.isString(relativeFileName))
                     return;
-                }
                 var fileName = ts.getNormalizedAbsolutePath(relativeFileName, dirName);
                 // Some applications save a working file via rename operations
                 var callbacks = fileName && fileWatcherCallbacks.get(toCanonicalName(fileName));
@@ -6495,6 +6729,37 @@ var ts;
             return watcher;
         }
     }
+    function createFixedChunkSizePollingWatchFile(host) {
+        var watchedFiles = [];
+        var pollIndex = 0;
+        var pollScheduled;
+        return watchFile;
+        function watchFile(fileName, callback) {
+            var file = {
+                fileName: fileName,
+                callback: callback,
+                mtime: getModifiedTime(host, fileName)
+            };
+            watchedFiles.push(file);
+            scheduleNextPoll();
+            return {
+                close: function () {
+                    file.isClosed = true;
+                    ts.unorderedRemoveItem(watchedFiles, file);
+                }
+            };
+        }
+        function pollQueue() {
+            pollScheduled = undefined;
+            pollIndex = pollWatchedFileQueue(host, watchedFiles, pollIndex, pollingChunkSize[PollingInterval.Low]);
+            scheduleNextPoll();
+        }
+        function scheduleNextPoll() {
+            if (!watchedFiles.length || pollScheduled)
+                return;
+            pollScheduled = host.setTimeout(pollQueue, PollingInterval.High);
+        }
+    }
     /* @internal */
     function createSingleFileWatcherPerName(watchFile, useCaseSensitiveFileNames) {
         var cache = new ts.Map();
@@ -6692,7 +6957,7 @@ var ts;
         }
         function onTimerToUpdateChildWatches() {
             timerToUpdateChildWatches = undefined;
-            ts.sysLog("sysLog:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size);
+            ts.sysLog("sysLog:: onTimerToUpdateChildWatches:: ".concat(cacheToUpdateChildWatches.size));
             var start = ts.timestamp();
             var invokeMap = new ts.Map();
             while (!timerToUpdateChildWatches && cacheToUpdateChildWatches.size) {
@@ -6705,7 +6970,7 @@ var ts;
                 var hasChanges = updateChildWatches(dirName, dirPath, options);
                 invokeCallbacks(dirPath, invokeMap, hasChanges ? undefined : fileNames);
             }
-            ts.sysLog("sysLog:: invokingWatchers:: Elapsed:: " + (ts.timestamp() - start) + "ms:: " + cacheToUpdateChildWatches.size);
+            ts.sysLog("sysLog:: invokingWatchers:: Elapsed:: ".concat(ts.timestamp() - start, "ms:: ").concat(cacheToUpdateChildWatches.size));
             callbackCache.forEach(function (callbacks, rootDirName) {
                 var existing = invokeMap.get(rootDirName);
                 if (existing) {
@@ -6721,7 +6986,7 @@ var ts;
                 }
             });
             var elapsed = ts.timestamp() - start;
-            ts.sysLog("sysLog:: Elapsed:: " + elapsed + "ms:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size + " " + timerToUpdateChildWatches);
+            ts.sysLog("sysLog:: Elapsed:: ".concat(elapsed, "ms:: onTimerToUpdateChildWatches:: ").concat(cacheToUpdateChildWatches.size, " ").concat(timerToUpdateChildWatches));
         }
         function removeChildWatches(parentWatcher) {
             if (!parentWatcher)
@@ -6817,8 +7082,9 @@ var ts;
     }
     /*@internal*/
     function createSystemWatchFunctions(_a) {
-        var pollingWatchFile = _a.pollingWatchFile, getModifiedTime = _a.getModifiedTime, setTimeout = _a.setTimeout, clearTimeout = _a.clearTimeout, fsWatch = _a.fsWatch, fileExists = _a.fileExists, useCaseSensitiveFileNames = _a.useCaseSensitiveFileNames, getCurrentDirectory = _a.getCurrentDirectory, fsSupportsRecursiveFsWatch = _a.fsSupportsRecursiveFsWatch, directoryExists = _a.directoryExists, getAccessibleSortedChildDirectories = _a.getAccessibleSortedChildDirectories, realpath = _a.realpath, tscWatchFile = _a.tscWatchFile, useNonPollingWatchers = _a.useNonPollingWatchers, tscWatchDirectory = _a.tscWatchDirectory;
+        var pollingWatchFile = _a.pollingWatchFile, getModifiedTime = _a.getModifiedTime, setTimeout = _a.setTimeout, clearTimeout = _a.clearTimeout, fsWatch = _a.fsWatch, fileExists = _a.fileExists, useCaseSensitiveFileNames = _a.useCaseSensitiveFileNames, getCurrentDirectory = _a.getCurrentDirectory, fsSupportsRecursiveFsWatch = _a.fsSupportsRecursiveFsWatch, directoryExists = _a.directoryExists, getAccessibleSortedChildDirectories = _a.getAccessibleSortedChildDirectories, realpath = _a.realpath, tscWatchFile = _a.tscWatchFile, useNonPollingWatchers = _a.useNonPollingWatchers, tscWatchDirectory = _a.tscWatchDirectory, defaultWatchFileKind = _a.defaultWatchFileKind;
         var dynamicPollingWatchFile;
+        var fixedChunkSizePollingWatchFile;
         var nonPollingWatchFile;
         var hostRecursiveDirectoryWatcher;
         return {
@@ -6835,6 +7101,8 @@ var ts;
                     return pollingWatchFile(fileName, callback, pollingInterval, /*options*/ undefined);
                 case ts.WatchFileKind.DynamicPriorityPolling:
                     return ensureDynamicPollingWatchFile()(fileName, callback, pollingInterval, /*options*/ undefined);
+                case ts.WatchFileKind.FixedChunkSizePolling:
+                    return ensureFixedChunkSizePollingWatchFile()(fileName, callback, /* pollingInterval */ undefined, /*options*/ undefined);
                 case ts.WatchFileKind.UseFsEvents:
                     return fsWatch(fileName, 0 /* File */, createFsWatchCallbackForFileWatcherCallback(fileName, callback, fileExists), 
                     /*recursive*/ false, pollingInterval, ts.getFallbackOptions(options));
@@ -6848,8 +7116,10 @@ var ts;
             }
         }
         function ensureDynamicPollingWatchFile() {
-            return dynamicPollingWatchFile ||
-                (dynamicPollingWatchFile = createDynamicPriorityPollingWatchFile({ getModifiedTime: getModifiedTime, setTimeout: setTimeout }));
+            return dynamicPollingWatchFile || (dynamicPollingWatchFile = createDynamicPriorityPollingWatchFile({ getModifiedTime: getModifiedTime, setTimeout: setTimeout }));
+        }
+        function ensureFixedChunkSizePollingWatchFile() {
+            return fixedChunkSizePollingWatchFile || (fixedChunkSizePollingWatchFile = createFixedChunkSizePollingWatchFile({ getModifiedTime: getModifiedTime, setTimeout: setTimeout }));
         }
         function updateOptionsForWatchFile(options, useNonPollingWatchers) {
             if (options && options.watchFile !== undefined)
@@ -6875,7 +7145,7 @@ var ts;
                         // Use notifications from FS to watch with falling back to fs.watchFile
                         generateWatchFileOptions(ts.WatchFileKind.UseFsEventsOnParentDirectory, ts.PollingWatchKind.PriorityInterval, options) :
                         // Default to do not use fixed polling interval
-                        { watchFile: ts.WatchFileKind.FixedPollingInterval };
+                        { watchFile: (defaultWatchFileKind === null || defaultWatchFileKind === void 0 ? void 0 : defaultWatchFileKind()) || ts.WatchFileKind.FixedPollingInterval };
             }
         }
         function generateWatchFileOptions(watchFile, fallbackPolling, options) {
@@ -6916,6 +7186,10 @@ var ts;
                 case ts.WatchDirectoryKind.DynamicPriorityPolling:
                     return ensureDynamicPollingWatchFile()(directoryName, function () { return callback(directoryName); }, PollingInterval.Medium, 
                     /*options*/ undefined);
+                case ts.WatchDirectoryKind.FixedChunkSizePolling:
+                    return ensureFixedChunkSizePollingWatchFile()(directoryName, function () { return callback(directoryName); }, 
+                    /* pollingInterval */ undefined, 
+                    /*options*/ undefined);
                 case ts.WatchDirectoryKind.UseFsEvents:
                     return fsWatch(directoryName, 1 /* Directory */, createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames, getCurrentDirectory), recursive, PollingInterval.Medium, ts.getFallbackOptions(watchDirectoryOptions));
                 default:
@@ -6994,13 +7268,14 @@ var ts;
             }
             var activeSession;
             var profilePath = "./profile.cpuprofile";
-            var realpathSync = (_a = _fs.realpathSync.native) !== null && _a !== void 0 ? _a : _fs.realpathSync;
+            var hitSystemWatcherLimit = false;
             var Buffer = require("buffer").Buffer;
             var nodeVersion = getNodeMajorVersion();
             var isNode4OrLater = nodeVersion >= 4;
             var isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin";
             var platform = _os.platform();
             var useCaseSensitiveFileNames = isFileSystemCaseSensitive();
+            var realpathSync = (_a = _fs.realpathSync.native) !== null && _a !== void 0 ? _a : _fs.realpathSync;
             var fsSupportsRecursiveFsWatch = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin");
             var getCurrentDirectory = ts.memoize(function () { return process.cwd(); });
             var _c = createSystemWatchFunctions({
@@ -7021,6 +7296,7 @@ var ts;
                 tscWatchFile: process.env.TSC_WATCHFILE,
                 useNonPollingWatchers: process.env.TSC_NONPOLLING_WATCHER,
                 tscWatchDirectory: process.env.TSC_WATCHDIRECTORY,
+                defaultWatchFileKind: function () { var _a, _b; return (_b = (_a = sys).defaultWatchFileKind) === null || _b === void 0 ? void 0 : _b.call(_a); },
             }), watchFile = _c.watchFile, watchDirectory = _c.watchDirectory;
             var nodeSystem = {
                 args: process.argv.slice(2),
@@ -7029,6 +7305,9 @@ var ts;
                 write: function (s) {
                     process.stdout.write(s);
                 },
+                getWidthOfTerminal: function () {
+                    return process.stdout.columns;
+                },
                 writeOutputIsTTY: function () {
                     return process.stdout.isTTY;
                 },
@@ -7167,7 +7446,7 @@ var ts;
                 var remappedPaths = new ts.Map();
                 var normalizedDir = ts.normalizeSlashes(__dirname);
                 // Windows rooted dir names need an extra `/` prepended to be valid file:/// urls
-                var fileUrlRoot = "file://" + (ts.getRootLength(normalizedDir) === 1 ? "" : "/") + normalizedDir;
+                var fileUrlRoot = "file://".concat(ts.getRootLength(normalizedDir) === 1 ? "" : "/").concat(normalizedDir);
                 for (var _i = 0, _a = profile.nodes; _i < _a.length; _i++) {
                     var node = _a[_i];
                     if (node.callFrame.url) {
@@ -7176,7 +7455,7 @@ var ts;
                             node.callFrame.url = ts.getRelativePathToDirectoryOrUrl(fileUrlRoot, url, fileUrlRoot, ts.createGetCanonicalFileName(useCaseSensitiveFileNames), /*isAbsolutePathAnUrl*/ true);
                         }
                         else if (!nativePattern.test(url)) {
-                            node.callFrame.url = (remappedPaths.has(url) ? remappedPaths : remappedPaths.set(url, "external" + externalFileCounter + ".js")).get(url);
+                            node.callFrame.url = (remappedPaths.has(url) ? remappedPaths : remappedPaths.set(url, "external".concat(externalFileCounter, ".js"))).get(url);
                             externalFileCounter++;
                         }
                     }
@@ -7192,7 +7471,7 @@ var ts;
                         if (!err) {
                             try {
                                 if ((_b = statSync(profilePath)) === null || _b === void 0 ? void 0 : _b.isDirectory()) {
-                                    profilePath = _path.join(profilePath, (new Date()).toISOString().replace(/:/g, "-") + "+P" + process.pid + ".cpuprofile");
+                                    profilePath = _path.join(profilePath, "".concat((new Date()).toISOString().replace(/:/g, "-"), "+P").concat(process.pid, ".cpuprofile"));
                                 }
                             }
                             catch (_c) {
@@ -7294,7 +7573,7 @@ var ts;
                  * @param createWatcher
                  */
                 function invokeCallbackAndUpdateWatcher(createWatcher) {
-                    ts.sysLog("sysLog:: " + fileOrDirectory + ":: Changing watcher to " + (createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing") + "FileSystemEntryWatcher");
+                    ts.sysLog("sysLog:: ".concat(fileOrDirectory, ":: Changing watcher to ").concat(createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing", "FileSystemEntryWatcher"));
                     // Call the callback for current directory
                     callback("rename", "");
                     // If watcher is not closed, update it
@@ -7318,6 +7597,10 @@ var ts;
                             options = { persistent: true };
                         }
                     }
+                    if (hitSystemWatcherLimit) {
+                        ts.sysLog("sysLog:: ".concat(fileOrDirectory, ":: Defaulting to fsWatchFile"));
+                        return watchPresentFileSystemEntryWithFsWatchFile();
+                    }
                     try {
                         var presentWatcher = _fs.watch(fileOrDirectory, options, isLinuxOrMacOs ?
                             callbackChangingToMissingFileSystemEntry :
@@ -7330,6 +7613,8 @@ var ts;
                         // Catch the exception and use polling instead
                         // Eg. on linux the number of watches are limited and one could easily exhaust watches and the exception ENOSPC is thrown when creating watcher at that point
                         // so instead of throwing error, use fs.watchFile
+                        hitSystemWatcherLimit || (hitSystemWatcherLimit = e.code === "ENOSPC");
+                        ts.sysLog("sysLog:: ".concat(fileOrDirectory, ":: Changing to fsWatchFile"));
                         return watchPresentFileSystemEntryWithFsWatchFile();
                     }
                 }
@@ -7349,7 +7634,6 @@ var ts;
                  * Eg. on linux the number of watches are limited and one could easily exhaust watches and the exception ENOSPC is thrown when creating watcher at that point
                  */
                 function watchPresentFileSystemEntryWithFsWatchFile() {
-                    ts.sysLog("sysLog:: " + fileOrDirectory + ":: Changing to fsWatchFile");
                     return watchFile(fileOrDirectory, createFileWatcherCallback(callback), fallbackPollingInterval, fallbackOptions);
                 }
                 /**
@@ -7553,6 +7837,11 @@ var ts;
         }
         return sys;
     })();
+    /*@internal*/
+    function setSys(s) {
+        ts.sys = s;
+    }
+    ts.setSys = setSys;
     if (ts.sys && ts.sys.getEnvironmentVariable) {
         setCustomPollingValues(ts.sys);
         ts.Debug.setAssertionLevel(/^development$/i.test(ts.sys.getEnvironmentVariable("NODE_ENV"))
@@ -7591,7 +7880,6 @@ var ts;
         An_index_signature_parameter_cannot_have_an_initializer: diag(1020, ts.DiagnosticCategory.Error, "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: diag(1021, ts.DiagnosticCategory.Error, "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: diag(1022, ts.DiagnosticCategory.Error, "An_index_signature_parameter_must_have_a_type_annotation_1022", "An index signature parameter must have a type annotation."),
-        An_index_signature_parameter_type_must_be_either_string_or_number: diag(1023, ts.DiagnosticCategory.Error, "An_index_signature_parameter_type_must_be_either_string_or_number_1023", "An index signature parameter type must be either 'string' or 'number'."),
         readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature: diag(1024, ts.DiagnosticCategory.Error, "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: diag(1025, ts.DiagnosticCategory.Error, "An_index_signature_cannot_have_a_trailing_comma_1025", "An index signature cannot have a trailing comma."),
         Accessibility_modifier_already_seen: diag(1028, ts.DiagnosticCategory.Error, "Accessibility_modifier_already_seen_1028", "Accessibility modifier already seen."),
@@ -7604,11 +7892,8 @@ var ts;
         A_declare_modifier_cannot_be_used_in_an_already_ambient_context: diag(1038, ts.DiagnosticCategory.Error, "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: diag(1039, ts.DiagnosticCategory.Error, "Initializers_are_not_allowed_in_ambient_contexts_1039", "Initializers are not allowed in ambient contexts."),
         _0_modifier_cannot_be_used_in_an_ambient_context: diag(1040, ts.DiagnosticCategory.Error, "_0_modifier_cannot_be_used_in_an_ambient_context_1040", "'{0}' modifier cannot be used in an ambient context."),
-        _0_modifier_cannot_be_used_with_a_class_declaration: diag(1041, ts.DiagnosticCategory.Error, "_0_modifier_cannot_be_used_with_a_class_declaration_1041", "'{0}' modifier cannot be used with a class declaration."),
         _0_modifier_cannot_be_used_here: diag(1042, ts.DiagnosticCategory.Error, "_0_modifier_cannot_be_used_here_1042", "'{0}' modifier cannot be used here."),
-        _0_modifier_cannot_appear_on_a_data_property: diag(1043, ts.DiagnosticCategory.Error, "_0_modifier_cannot_appear_on_a_data_property_1043", "'{0}' modifier cannot appear on a data property."),
         _0_modifier_cannot_appear_on_a_module_or_namespace_element: diag(1044, ts.DiagnosticCategory.Error, "_0_modifier_cannot_appear_on_a_module_or_namespace_element_1044", "'{0}' modifier cannot appear on a module or namespace element."),
-        A_0_modifier_cannot_be_used_with_an_interface_declaration: diag(1045, ts.DiagnosticCategory.Error, "A_0_modifier_cannot_be_used_with_an_interface_declaration_1045", "A '{0}' modifier cannot be used with an interface declaration."),
         Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier: diag(1046, ts.DiagnosticCategory.Error, "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: diag(1047, ts.DiagnosticCategory.Error, "A_rest_parameter_cannot_be_optional_1047", "A rest parameter cannot be optional."),
         A_rest_parameter_cannot_have_an_initializer: diag(1048, ts.DiagnosticCategory.Error, "A_rest_parameter_cannot_have_an_initializer_1048", "A rest parameter cannot have an initializer."),
@@ -7619,7 +7904,6 @@ var ts;
         A_get_accessor_cannot_have_parameters: diag(1054, ts.DiagnosticCategory.Error, "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_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value: diag(1055, ts.DiagnosticCategory.Error, "Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Prom_1055", "Type '{0}' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value."),
         Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: diag(1056, ts.DiagnosticCategory.Error, "Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056", "Accessors are only available when targeting ECMAScript 5 and higher."),
-        An_async_function_or_method_must_have_a_valid_awaitable_return_type: diag(1057, ts.DiagnosticCategory.Error, "An_async_function_or_method_must_have_a_valid_awaitable_return_type_1057", "An async function or method must have a valid awaitable return type."),
         The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1058, ts.DiagnosticCategory.Error, "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: diag(1059, ts.DiagnosticCategory.Error, "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: diag(1060, ts.DiagnosticCategory.Error, "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."),
@@ -7652,6 +7936,7 @@ var ts;
         for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1103, ts.DiagnosticCategory.Error, "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: diag(1104, ts.DiagnosticCategory.Error, "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: diag(1105, ts.DiagnosticCategory.Error, "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: diag(1106, ts.DiagnosticCategory.Error, "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: diag(1107, ts.DiagnosticCategory.Error, "Jump_target_cannot_cross_function_boundary_1107", "Jump target cannot cross function boundary."),
         A_return_statement_can_only_be_used_within_a_function_body: diag(1108, ts.DiagnosticCategory.Error, "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: diag(1109, ts.DiagnosticCategory.Error, "Expression_expected_1109", "Expression expected."),
@@ -7698,7 +7983,7 @@ var ts;
         A_yield_expression_is_only_allowed_in_a_generator_body: diag(1163, ts.DiagnosticCategory.Error, "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: diag(1164, ts.DiagnosticCategory.Error, "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: diag(1165, ts.DiagnosticCategory.Error, "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_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type: diag(1166, ts.DiagnosticCategory.Error, "A_computed_property_name_in_a_class_property_declaration_must_refer_to_an_expression_whose_type_is_a_1166", "A computed property name in a class property declaration 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: diag(1166, ts.DiagnosticCategory.Error, "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: diag(1168, ts.DiagnosticCategory.Error, "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: diag(1169, ts.DiagnosticCategory.Error, "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: diag(1170, ts.DiagnosticCategory.Error, "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."),
@@ -7738,7 +8023,7 @@ var ts;
         Decorators_are_not_valid_here: diag(1206, ts.DiagnosticCategory.Error, "Decorators_are_not_valid_here_1206", "Decorators are not valid here."),
         Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name: diag(1207, ts.DiagnosticCategory.Error, "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."),
         _0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_import_export_or_an_empty_export_statement_to_make_it_a_module: diag(1208, ts.DiagnosticCategory.Error, "_0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_imp_1208", "'{0}' cannot be compiled under '--isolatedModules' because it is considered a global script file. Add an import, export, or an empty 'export {}' statement to make it a module."),
-        Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode: diag(1210, ts.DiagnosticCategory.Error, "Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode_1210", "Invalid use of '{0}'. Class definitions are automatically in strict mode."),
+        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: diag(1210, ts.DiagnosticCategory.Error, "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: diag(1211, ts.DiagnosticCategory.Error, "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: diag(1212, ts.DiagnosticCategory.Error, "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: diag(1213, ts.DiagnosticCategory.Error, "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."),
@@ -7747,7 +8032,6 @@ var ts;
         Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules: diag(1216, ts.DiagnosticCategory.Error, "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: diag(1218, ts.DiagnosticCategory.Error, "Export_assignment_is_not_supported_when_module_flag_is_system_1218", "Export assignment is not supported when '--module' flag is 'system'."),
         Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning: diag(1219, ts.DiagnosticCategory.Error, "Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_t_1219", "Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning."),
-        Generators_are_only_available_when_targeting_ECMAScript_2015_or_higher: diag(1220, ts.DiagnosticCategory.Error, "Generators_are_only_available_when_targeting_ECMAScript_2015_or_higher_1220", "Generators are only available when targeting ECMAScript 2015 or higher."),
         Generators_are_not_allowed_in_an_ambient_context: diag(1221, ts.DiagnosticCategory.Error, "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: diag(1222, ts.DiagnosticCategory.Error, "An_overload_signature_cannot_be_declared_as_a_generator_1222", "An overload signature cannot be declared as a generator."),
         _0_tag_already_specified: diag(1223, ts.DiagnosticCategory.Error, "_0_tag_already_specified_1223", "'{0}' tag already specified."),
@@ -7758,7 +8042,7 @@ var ts;
         A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods: diag(1228, ts.DiagnosticCategory.Error, "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: diag(1229, ts.DiagnosticCategory.Error, "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: diag(1230, ts.DiagnosticCategory.Error, "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_can_only_be_used_in_a_module: diag(1231, ts.DiagnosticCategory.Error, "An_export_assignment_can_only_be_used_in_a_module_1231", "An export assignment can only be used in a module."),
+        An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration: diag(1231, ts.DiagnosticCategory.Error, "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_in_a_namespace_or_module: diag(1232, ts.DiagnosticCategory.Error, "An_import_declaration_can_only_be_used_in_a_namespace_or_module_1232", "An import declaration can only be used in a namespace or module."),
         An_export_declaration_can_only_be_used_in_a_module: diag(1233, ts.DiagnosticCategory.Error, "An_export_declaration_can_only_be_used_in_a_module_1233", "An export declaration can only be used in a module."),
         An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file: diag(1234, ts.DiagnosticCategory.Error, "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."),
@@ -7780,10 +8064,10 @@ var ts;
         Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5: diag(1250, ts.DiagnosticCategory.Error, "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_1250", "Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'."),
         Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_definitions_are_automatically_in_strict_mode: diag(1251, ts.DiagnosticCategory.Error, "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_d_1251", "Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'. Class definitions are automatically in strict mode."),
         Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_are_automatically_in_strict_mode: diag(1252, ts.DiagnosticCategory.Error, "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_1252", "Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'. Modules are automatically in strict mode."),
-        _0_tag_cannot_be_used_independently_as_a_top_level_JSDoc_tag: diag(1253, ts.DiagnosticCategory.Error, "_0_tag_cannot_be_used_independently_as_a_top_level_JSDoc_tag_1253", "'{0}' tag cannot be used independently as a top level JSDoc tag."),
         A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_reference: diag(1254, ts.DiagnosticCategory.Error, "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: diag(1255, ts.DiagnosticCategory.Error, "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: diag(1257, ts.DiagnosticCategory.Error, "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: diag(1258, ts.DiagnosticCategory.Error, "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: diag(1259, ts.DiagnosticCategory.Error, "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: diag(1260, ts.DiagnosticCategory.Error, "Keywords_cannot_contain_escape_characters_1260", "Keywords cannot contain escape characters."),
         Already_included_file_name_0_differs_from_file_name_1_only_in_casing: diag(1261, ts.DiagnosticCategory.Error, "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."),
@@ -7792,6 +8076,8 @@ var ts;
         Declarations_with_definite_assignment_assertions_must_also_have_type_annotations: diag(1264, ts.DiagnosticCategory.Error, "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: diag(1265, ts.DiagnosticCategory.Error, "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: diag(1266, ts.DiagnosticCategory.Error, "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: diag(1267, ts.DiagnosticCategory.Error, "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: diag(1268, ts.DiagnosticCategory.Error, "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."),
         with_statements_are_not_allowed_in_an_async_function_block: diag(1300, ts.DiagnosticCategory.Error, "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: diag(1308, ts.DiagnosticCategory.Error, "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."),
         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: diag(1312, ts.DiagnosticCategory.Error, "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."),
@@ -7805,9 +8091,9 @@ var ts;
         Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1320, ts.DiagnosticCategory.Error, "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: diag(1321, ts.DiagnosticCategory.Error, "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: diag(1322, ts.DiagnosticCategory.Error, "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_esnext_commonjs_amd_system_or_umd: diag(1323, ts.DiagnosticCategory.Error, "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_esnext_commonjs_amd_system__1323", "Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'esnext', 'commonjs', 'amd', 'system', or 'umd'."),
-        Dynamic_import_must_have_one_specifier_as_an_argument: diag(1324, ts.DiagnosticCategory.Error, "Dynamic_import_must_have_one_specifier_as_an_argument_1324", "Dynamic import must have one specifier as an argument."),
-        Specifier_of_dynamic_import_cannot_be_spread_element: diag(1325, ts.DiagnosticCategory.Error, "Specifier_of_dynamic_import_cannot_be_spread_element_1325", "Specifier of dynamic import cannot be spread element."),
+        Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node12_or_nodenext: diag(1323, ts.DiagnosticCategory.Error, "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', 'node12', or 'nodenext'."),
+        Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext: diag(1324, ts.DiagnosticCategory.Error, "Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_1324", "Dynamic imports only support a second argument when the '--module' option is set to 'esnext'."),
+        Argument_of_dynamic_import_cannot_be_spread_element: diag(1325, ts.DiagnosticCategory.Error, "Argument_of_dynamic_import_cannot_be_spread_element_1325", "Argument of dynamic import cannot be spread element."),
         Dynamic_import_cannot_have_type_arguments: diag(1326, ts.DiagnosticCategory.Error, "Dynamic_import_cannot_have_type_arguments_1326", "Dynamic import cannot have type arguments."),
         String_literal_with_double_quotes_expected: diag(1327, ts.DiagnosticCategory.Error, "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: diag(1328, ts.DiagnosticCategory.Error, "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."),
@@ -7818,13 +8104,12 @@ var ts;
         unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name: diag(1333, ts.DiagnosticCategory.Error, "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: diag(1334, ts.DiagnosticCategory.Error, "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: diag(1335, ts.DiagnosticCategory.Error, "unique_symbol_types_are_not_allowed_here_1335", "'unique symbol' types are not allowed here."),
-        An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead: diag(1336, ts.DiagnosticCategory.Error, "An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead_1336", "An index signature parameter type cannot be a type alias. Consider writing '[{0}: {1}]: {2}' instead."),
-        An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead: diag(1337, ts.DiagnosticCategory.Error, "An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead_1337", "An index signature parameter type cannot be a union type. Consider using a mapped object type instead."),
+        An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead: diag(1337, ts.DiagnosticCategory.Error, "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: diag(1338, ts.DiagnosticCategory.Error, "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: diag(1339, ts.DiagnosticCategory.Error, "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: diag(1340, ts.DiagnosticCategory.Error, "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}')'?"),
         Type_arguments_cannot_be_used_here: diag(1342, ts.DiagnosticCategory.Error, "Type_arguments_cannot_be_used_here_1342", "Type arguments cannot be used here."),
-        The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_esnext_or_system: diag(1343, ts.DiagnosticCategory.Error, "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_esnext_or_system_1343", "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'esnext', or 'system'."),
+        The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node12_or_nodenext: diag(1343, ts.DiagnosticCategory.Error, "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', 'node12', or 'nodenext'."),
         A_label_is_not_allowed_here: diag(1344, ts.DiagnosticCategory.Error, "A_label_is_not_allowed_here_1344", "'A label is not allowed here."),
         An_expression_of_type_void_cannot_be_tested_for_truthiness: diag(1345, ts.DiagnosticCategory.Error, "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: diag(1346, ts.DiagnosticCategory.Error, "This_parameter_is_not_allowed_with_use_strict_directive_1346", "This parameter is not allowed with 'use strict' directive."),
@@ -7841,7 +8126,6 @@ var ts;
         An_enum_member_name_must_be_followed_by_a_or: diag(1357, ts.DiagnosticCategory.Error, "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: diag(1358, ts.DiagnosticCategory.Error, "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: diag(1359, ts.DiagnosticCategory.Error, "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."),
-        Did_you_mean_to_parenthesize_this_function_type: diag(1360, ts.DiagnosticCategory.Error, "Did_you_mean_to_parenthesize_this_function_type_1360", "Did you mean to parenthesize this function type?"),
         _0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type: diag(1361, ts.DiagnosticCategory.Error, "_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: diag(1362, ts.DiagnosticCategory.Error, "_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: diag(1363, ts.DiagnosticCategory.Error, "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."),
@@ -7849,7 +8133,6 @@ var ts;
         Convert_all_re_exported_types_to_type_only_exports: diag(1365, ts.DiagnosticCategory.Message, "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: diag(1366, ts.DiagnosticCategory.Message, "Split_into_two_separate_import_declarations_1366", "Split into two separate import declarations"),
         Split_all_invalid_type_only_imports: diag(1367, ts.DiagnosticCategory.Message, "Split_all_invalid_type_only_imports_1367", "Split all invalid type-only imports"),
-        Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types: diag(1368, ts.DiagnosticCategory.Message, "Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types_1368", "Specify emit/checking behavior for imports that are only used for types"),
         Did_you_mean_0: diag(1369, ts.DiagnosticCategory.Message, "Did_you_mean_0_1369", "Did you mean '{0}'?"),
         This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set_to_error: diag(1371, ts.DiagnosticCategory.Error, "This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set__1371", "This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'."),
         Convert_to_type_only_import: diag(1373, ts.DiagnosticCategory.Message, "Convert_to_type_only_import_1373", "Convert to type-only import"),
@@ -7857,7 +8140,7 @@ var ts;
         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: diag(1375, ts.DiagnosticCategory.Error, "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: diag(1376, ts.DiagnosticCategory.Message, "_0_was_imported_here_1376", "'{0}' was imported here."),
         _0_was_exported_here: diag(1377, ts.DiagnosticCategory.Message, "_0_was_exported_here_1377", "'{0}' was exported here."),
-        Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_esnext_or_system_and_the_target_option_is_set_to_es2017_or_higher: diag(1378, ts.DiagnosticCategory.Error, "Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_esnext_or_system_and_t_1378", "Top-level 'await' expressions are only allowed when the 'module' option is set to 'esnext' or 'system', and the 'target' option is set to 'es2017' or higher."),
+        Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher: diag(1378, ts.DiagnosticCategory.Error, "Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_o_1378", "Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),
         An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type: diag(1379, ts.DiagnosticCategory.Error, "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: diag(1380, ts.DiagnosticCategory.Error, "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: diag(1381, ts.DiagnosticCategory.Error, "Unexpected_token_Did_you_mean_or_rbrace_1381", "Unexpected token. Did you mean `{'}'}` or `&rbrace;`?"),
@@ -7869,8 +8152,7 @@ var ts;
         Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type: diag(1387, ts.DiagnosticCategory.Error, "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: diag(1388, ts.DiagnosticCategory.Error, "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: diag(1389, ts.DiagnosticCategory.Error, "_0_is_not_allowed_as_a_variable_declaration_name_1389", "'{0}' is not allowed as a variable declaration name."),
-        Provides_a_root_package_name_when_using_outFile_with_declarations: diag(1390, ts.DiagnosticCategory.Message, "Provides_a_root_package_name_when_using_outFile_with_declarations_1390", "Provides a root package name when using outFile with declarations."),
-        The_bundledPackageName_option_must_be_provided_when_using_outFile_and_node_module_resolution_with_declaration_emit: diag(1391, ts.DiagnosticCategory.Error, "The_bundledPackageName_option_must_be_provided_when_using_outFile_and_node_module_resolution_with_de_1391", "The `bundledPackageName` option must be provided when using outFile and node module resolution with declaration emit."),
+        _0_is_not_allowed_as_a_parameter_name: diag(1390, ts.DiagnosticCategory.Error, "_0_is_not_allowed_as_a_parameter_name_1390", "'{0}' is not allowed as a parameter name."),
         An_import_alias_cannot_use_import_type: diag(1392, ts.DiagnosticCategory.Error, "An_import_alias_cannot_use_import_type_1392", "An import alias cannot use 'import type'"),
         Imported_via_0_from_file_1: diag(1393, ts.DiagnosticCategory.Message, "Imported_via_0_from_file_1_1393", "Imported via {0} from file '{1}'"),
         Imported_via_0_from_file_1_with_packageId_2: diag(1394, ts.DiagnosticCategory.Message, "Imported_via_0_from_file_1_with_packageId_2_1394", "Imported via {0} from file '{1}' with packageId '{2}'"),
@@ -7911,13 +8193,34 @@ var ts;
         File_redirects_to_file_0: diag(1429, ts.DiagnosticCategory.Message, "File_redirects_to_file_0_1429", "File redirects to file '{0}'"),
         The_file_is_in_the_program_because_Colon: diag(1430, ts.DiagnosticCategory.Message, "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: diag(1431, ts.DiagnosticCategory.Error, "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_esnext_or_system_and_the_target_option_is_set_to_es2017_or_higher: diag(1432, ts.DiagnosticCategory.Error, "Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_esnext_or_system_and_the_1432", "Top-level 'for await' loops are only allowed when the 'module' option is set to 'esnext' or 'system', and the 'target' option is set to 'es2017' or higher."),
+        Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher: diag(1432, ts.DiagnosticCategory.Error, "Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or__1432", "Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),
+        Decorators_may_not_be_applied_to_this_parameters: diag(1433, ts.DiagnosticCategory.Error, "Decorators_may_not_be_applied_to_this_parameters_1433", "Decorators may not be applied to 'this' parameters."),
+        Unexpected_keyword_or_identifier: diag(1434, ts.DiagnosticCategory.Error, "Unexpected_keyword_or_identifier_1434", "Unexpected keyword or identifier."),
+        Unknown_keyword_or_identifier_Did_you_mean_0: diag(1435, ts.DiagnosticCategory.Error, "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: diag(1436, ts.DiagnosticCategory.Error, "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: diag(1437, ts.DiagnosticCategory.Error, "Namespace_must_be_given_a_name_1437", "Namespace must be given a name."),
+        Interface_must_be_given_a_name: diag(1438, ts.DiagnosticCategory.Error, "Interface_must_be_given_a_name_1438", "Interface must be given a name."),
+        Type_alias_must_be_given_a_name: diag(1439, ts.DiagnosticCategory.Error, "Type_alias_must_be_given_a_name_1439", "Type alias must be given a name."),
+        Variable_declaration_not_allowed_at_this_location: diag(1440, ts.DiagnosticCategory.Error, "Variable_declaration_not_allowed_at_this_location_1440", "Variable declaration not allowed at this location."),
+        Cannot_start_a_function_call_in_a_type_annotation: diag(1441, ts.DiagnosticCategory.Error, "Cannot_start_a_function_call_in_a_type_annotation_1441", "Cannot start a function call in a type annotation."),
+        Expected_for_property_initializer: diag(1442, ts.DiagnosticCategory.Error, "Expected_for_property_initializer_1442", "Expected '=' for property initializer."),
+        Module_declaration_names_may_only_use_or_quoted_strings: diag(1443, ts.DiagnosticCategory.Error, "Module_declaration_names_may_only_use_or_quoted_strings_1443", "Module declaration names may only use ' or \" quoted strings."),
+        _0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled: diag(1444, ts.DiagnosticCategory.Error, "_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedMod_1444", "'{0}' is a type and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled."),
+        _0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled: diag(1446, ts.DiagnosticCategory.Error, "_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveVa_1446", "'{0}' resolves to a type-only declaration and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled."),
+        _0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isolatedModules_is_enabled: diag(1448, ts.DiagnosticCategory.Error, "_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isol_1448", "'{0}' resolves to a type-only declaration and must be re-exported using a type-only re-export when 'isolatedModules' is enabled."),
+        Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed: diag(1449, ts.DiagnosticCategory.Message, "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_assertion_as_arguments: diag(1450, ts.DiagnosticCategory.Message, "Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments_1450", "Dynamic imports can only accept a module specifier and an optional assertion 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: diag(1451, ts.DiagnosticCategory.Error, "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"),
+        The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output: diag(1470, ts.DiagnosticCategory.Error, "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_synchronously_Use_dynamic_import_instead: diag(1471, ts.DiagnosticCategory.Error, "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 synchronously. Use dynamic import instead."),
         The_types_of_0_are_incompatible_between_these_types: diag(2200, ts.DiagnosticCategory.Error, "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: diag(2201, ts.DiagnosticCategory.Error, "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: diag(2202, ts.DiagnosticCategory.Error, "Call_signature_return_types_0_and_1_are_incompatible_2202", "Call signature return types '{0}' and '{1}' are incompatible.", /*reportsUnnecessary*/ undefined, /*elidedInCompatabilityPyramid*/ true),
         Construct_signature_return_types_0_and_1_are_incompatible: diag(2203, ts.DiagnosticCategory.Error, "Construct_signature_return_types_0_and_1_are_incompatible_2203", "Construct signature return types '{0}' and '{1}' are incompatible.", /*reportsUnnecessary*/ undefined, /*elidedInCompatabilityPyramid*/ true),
         Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1: diag(2204, ts.DiagnosticCategory.Error, "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*/ undefined, /*elidedInCompatabilityPyramid*/ true),
         Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1: diag(2205, ts.DiagnosticCategory.Error, "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*/ undefined, /*elidedInCompatabilityPyramid*/ true),
+        The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement: diag(2206, ts.DiagnosticCategory.Error, "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: diag(2207, ts.DiagnosticCategory.Error, "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."),
         Duplicate_identifier_0: diag(2300, ts.DiagnosticCategory.Error, "Duplicate_identifier_0_2300", "Duplicate identifier '{0}'."),
         Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2301, ts.DiagnosticCategory.Error, "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: diag(2302, ts.DiagnosticCategory.Error, "Static_members_cannot_reference_class_type_parameters_2302", "Static members cannot reference class type parameters."),
@@ -7929,7 +8232,6 @@ var ts;
         Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity: diag(2308, ts.DiagnosticCategory.Error, "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: diag(2309, ts.DiagnosticCategory.Error, "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: diag(2310, ts.DiagnosticCategory.Error, "Type_0_recursively_references_itself_as_a_base_type_2310", "Type '{0}' recursively references itself as a base type."),
-        A_class_may_only_extend_another_class: diag(2311, ts.DiagnosticCategory.Error, "A_class_may_only_extend_another_class_2311", "A class may only extend another class."),
         An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members: diag(2312, ts.DiagnosticCategory.Error, "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: diag(2313, ts.DiagnosticCategory.Error, "Type_parameter_0_has_a_circular_constraint_2313", "Type parameter '{0}' has a circular constraint."),
         Generic_type_0_requires_1_type_argument_s: diag(2314, ts.DiagnosticCategory.Error, "Generic_type_0_requires_1_type_argument_s_2314", "Generic type '{0}' requires {1} type argument(s)."),
@@ -7947,8 +8249,8 @@ var ts;
         Types_of_property_0_are_incompatible: diag(2326, ts.DiagnosticCategory.Error, "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: diag(2327, ts.DiagnosticCategory.Error, "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: diag(2328, ts.DiagnosticCategory.Error, "Types_of_parameters_0_and_1_are_incompatible_2328", "Types of parameters '{0}' and '{1}' are incompatible."),
-        Index_signature_is_missing_in_type_0: diag(2329, ts.DiagnosticCategory.Error, "Index_signature_is_missing_in_type_0_2329", "Index signature is missing in type '{0}'."),
-        Index_signatures_are_incompatible: diag(2330, ts.DiagnosticCategory.Error, "Index_signatures_are_incompatible_2330", "Index signatures are incompatible."),
+        Index_signature_for_type_0_is_missing_in_type_1: diag(2329, ts.DiagnosticCategory.Error, "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: diag(2330, ts.DiagnosticCategory.Error, "_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: diag(2331, ts.DiagnosticCategory.Error, "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: diag(2332, ts.DiagnosticCategory.Error, "this_cannot_be_referenced_in_current_location_2332", "'this' cannot be referenced in current location."),
         this_cannot_be_referenced_in_constructor_arguments: diag(2333, ts.DiagnosticCategory.Error, "this_cannot_be_referenced_in_constructor_arguments_2333", "'this' cannot be referenced in constructor arguments."),
@@ -7960,7 +8262,6 @@ var ts;
         Property_0_does_not_exist_on_type_1: diag(2339, ts.DiagnosticCategory.Error, "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: diag(2340, ts.DiagnosticCategory.Error, "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: diag(2341, ts.DiagnosticCategory.Error, "Property_0_is_private_and_only_accessible_within_class_1_2341", "Property '{0}' is private and only accessible within class '{1}'."),
-        An_index_expression_argument_must_be_of_type_string_number_symbol_or_any: diag(2342, ts.DiagnosticCategory.Error, "An_index_expression_argument_must_be_of_type_string_number_symbol_or_any_2342", "An index expression argument must be of type 'string', 'number', 'symbol', or 'any'."),
         This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0: diag(2343, ts.DiagnosticCategory.Error, "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: diag(2344, ts.DiagnosticCategory.Error, "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: diag(2345, ts.DiagnosticCategory.Error, "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}'."),
@@ -7978,7 +8279,7 @@ var ts;
         The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access: diag(2357, ts.DiagnosticCategory.Error, "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: diag(2358, ts.DiagnosticCategory.Error, "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_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: diag(2359, ts.DiagnosticCategory.Error, "The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_F_2359", "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type."),
-        The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol: diag(2360, ts.DiagnosticCategory.Error, "The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol_2360", "The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'."),
+        The_left_hand_side_of_an_in_expression_must_be_a_private_identifier_or_of_type_any_string_number_or_symbol: diag(2360, ts.DiagnosticCategory.Error, "The_left_hand_side_of_an_in_expression_must_be_a_private_identifier_or_of_type_any_string_number_or__2360", "The left-hand side of an 'in' expression must be a private identifier or of type 'any', 'string', 'number', or 'symbol'."),
         The_right_hand_side_of_an_in_expression_must_not_be_a_primitive: diag(2361, ts.DiagnosticCategory.Error, "The_right_hand_side_of_an_in_expression_must_not_be_a_primitive_2361", "The right-hand side of an 'in' expression must not be a primitive."),
         The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type: diag(2362, ts.DiagnosticCategory.Error, "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: diag(2363, ts.DiagnosticCategory.Error, "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."),
@@ -7992,15 +8293,13 @@ var ts;
         A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: diag(2371, ts.DiagnosticCategory.Error, "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: diag(2372, ts.DiagnosticCategory.Error, "Parameter_0_cannot_reference_itself_2372", "Parameter '{0}' cannot reference itself."),
         Parameter_0_cannot_reference_identifier_1_declared_after_it: diag(2373, ts.DiagnosticCategory.Error, "Parameter_0_cannot_reference_identifier_1_declared_after_it_2373", "Parameter '{0}' cannot reference identifier '{1}' declared after it."),
-        Duplicate_string_index_signature: diag(2374, ts.DiagnosticCategory.Error, "Duplicate_string_index_signature_2374", "Duplicate string index signature."),
-        Duplicate_number_index_signature: diag(2375, ts.DiagnosticCategory.Error, "Duplicate_number_index_signature_2375", "Duplicate number index signature."),
+        Duplicate_index_signature_for_type_0: diag(2374, ts.DiagnosticCategory.Error, "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: diag(2375, ts.DiagnosticCategory.Error, "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_when_a_class_contains_initialized_properties_parameter_properties_or_private_identifiers: diag(2376, ts.DiagnosticCategory.Error, "A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_proper_2376", "A 'super' call must be the first statement in the constructor when a class contains initialized properties, parameter properties, or private identifiers."),
         Constructors_for_derived_classes_must_contain_a_super_call: diag(2377, ts.DiagnosticCategory.Error, "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: diag(2378, ts.DiagnosticCategory.Error, "A_get_accessor_must_return_a_value_2378", "A 'get' accessor must return a value."),
-        Getter_and_setter_accessors_do_not_agree_in_visibility: diag(2379, ts.DiagnosticCategory.Error, "Getter_and_setter_accessors_do_not_agree_in_visibility_2379", "Getter and setter accessors do not agree in visibility."),
-        get_and_set_accessor_must_have_the_same_type: diag(2380, ts.DiagnosticCategory.Error, "get_and_set_accessor_must_have_the_same_type_2380", "'get' and 'set' accessor must have the same type."),
-        A_signature_with_an_implementation_cannot_use_a_string_literal_type: diag(2381, ts.DiagnosticCategory.Error, "A_signature_with_an_implementation_cannot_use_a_string_literal_type_2381", "A signature with an implementation cannot use a string literal type."),
-        Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: diag(2382, ts.DiagnosticCategory.Error, "Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature_2382", "Specialized overload signature is not assignable to any non-specialized signature."),
+        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: diag(2379, ts.DiagnosticCategory.Error, "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."),
+        The_return_type_of_a_get_accessor_must_be_assignable_to_its_set_accessor_type: diag(2380, ts.DiagnosticCategory.Error, "The_return_type_of_a_get_accessor_must_be_assignable_to_its_set_accessor_type_2380", "The return type of a 'get' accessor must be assignable to its 'set' accessor type"),
         Overload_signatures_must_all_be_exported_or_non_exported: diag(2383, ts.DiagnosticCategory.Error, "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: diag(2384, ts.DiagnosticCategory.Error, "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: diag(2385, ts.DiagnosticCategory.Error, "Overload_signatures_must_all_be_public_private_or_protected_2385", "Overload signatures must all be public, private or protected."),
@@ -8019,7 +8318,6 @@ var ts;
         constructor_cannot_be_used_as_a_parameter_property_name: diag(2398, ts.DiagnosticCategory.Error, "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: diag(2399, ts.DiagnosticCategory.Error, "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: diag(2400, ts.DiagnosticCategory.Error, "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."),
-        Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: diag(2401, ts.DiagnosticCategory.Error, "Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference_2401", "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference."),
         Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: diag(2402, ts.DiagnosticCategory.Error, "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: diag(2403, ts.DiagnosticCategory.Error, "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: diag(2404, ts.DiagnosticCategory.Error, "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."),
@@ -8029,9 +8327,9 @@ var ts;
         Setters_cannot_return_a_value: diag(2408, ts.DiagnosticCategory.Error, "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: diag(2409, ts.DiagnosticCategory.Error, "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: diag(2410, ts.DiagnosticCategory.Error, "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'."),
-        Property_0_of_type_1_is_not_assignable_to_string_index_type_2: diag(2411, ts.DiagnosticCategory.Error, "Property_0_of_type_1_is_not_assignable_to_string_index_type_2_2411", "Property '{0}' of type '{1}' is not assignable to string index type '{2}'."),
-        Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: diag(2412, ts.DiagnosticCategory.Error, "Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2_2412", "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'."),
-        Numeric_index_type_0_is_not_assignable_to_string_index_type_1: diag(2413, ts.DiagnosticCategory.Error, "Numeric_index_type_0_is_not_assignable_to_string_index_type_1_2413", "Numeric index type '{0}' is not assignable to string index type '{1}'."),
+        Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target: diag(2412, ts.DiagnosticCategory.Error, "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: diag(2411, ts.DiagnosticCategory.Error, "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: diag(2413, ts.DiagnosticCategory.Error, "_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: diag(2414, ts.DiagnosticCategory.Error, "Class_name_cannot_be_0_2414", "Class name cannot be '{0}'."),
         Class_0_incorrectly_extends_base_class_1: diag(2415, ts.DiagnosticCategory.Error, "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: diag(2416, ts.DiagnosticCategory.Error, "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}'."),
@@ -8061,16 +8359,14 @@ var ts;
         Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2: diag(2443, ts.DiagnosticCategory.Error, "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: diag(2444, ts.DiagnosticCategory.Error, "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: diag(2445, ts.DiagnosticCategory.Error, "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: diag(2446, ts.DiagnosticCategory.Error, "Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_2446", "Property '{0}' is protected and only accessible through an instance of class '{1}'."),
+        Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_class_2: diag(2446, ts.DiagnosticCategory.Error, "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: diag(2447, ts.DiagnosticCategory.Error, "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: diag(2448, ts.DiagnosticCategory.Error, "Block_scoped_variable_0_used_before_its_declaration_2448", "Block-scoped variable '{0}' used before its declaration."),
         Class_0_used_before_its_declaration: diag(2449, ts.DiagnosticCategory.Error, "Class_0_used_before_its_declaration_2449", "Class '{0}' used before its declaration."),
         Enum_0_used_before_its_declaration: diag(2450, ts.DiagnosticCategory.Error, "Enum_0_used_before_its_declaration_2450", "Enum '{0}' used before its declaration."),
         Cannot_redeclare_block_scoped_variable_0: diag(2451, ts.DiagnosticCategory.Error, "Cannot_redeclare_block_scoped_variable_0_2451", "Cannot redeclare block-scoped variable '{0}'."),
         An_enum_member_cannot_have_a_numeric_name: diag(2452, ts.DiagnosticCategory.Error, "An_enum_member_cannot_have_a_numeric_name_2452", "An enum member cannot have a numeric name."),
-        The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly: diag(2453, ts.DiagnosticCategory.Error, "The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_typ_2453", "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly."),
         Variable_0_is_used_before_being_assigned: diag(2454, ts.DiagnosticCategory.Error, "Variable_0_is_used_before_being_assigned_2454", "Variable '{0}' is used before being assigned."),
-        Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0: diag(2455, ts.DiagnosticCategory.Error, "Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0_2455", "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'."),
         Type_alias_0_circularly_references_itself: diag(2456, ts.DiagnosticCategory.Error, "Type_alias_0_circularly_references_itself_2456", "Type alias '{0}' circularly references itself."),
         Type_alias_name_cannot_be_0: diag(2457, ts.DiagnosticCategory.Error, "Type_alias_name_cannot_be_0_2457", "Type alias name cannot be '{0}'."),
         An_AMD_module_cannot_have_multiple_name_assignments: diag(2458, ts.DiagnosticCategory.Error, "An_AMD_module_cannot_have_multiple_name_assignments_2458", "An AMD module cannot have multiple name assignments."),
@@ -8085,8 +8381,6 @@ var ts;
         A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type: diag(2467, ts.DiagnosticCategory.Error, "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: diag(2468, ts.DiagnosticCategory.Error, "Cannot_find_global_value_0_2468", "Cannot find global value '{0}'."),
         The_0_operator_cannot_be_applied_to_type_symbol: diag(2469, ts.DiagnosticCategory.Error, "The_0_operator_cannot_be_applied_to_type_symbol_2469", "The '{0}' operator cannot be applied to type 'symbol'."),
-        Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object: diag(2470, ts.DiagnosticCategory.Error, "Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object_2470", "'Symbol' reference does not refer to the global Symbol constructor object."),
-        A_computed_property_name_of_the_form_0_must_be_of_type_symbol: diag(2471, ts.DiagnosticCategory.Error, "A_computed_property_name_of_the_form_0_must_be_of_type_symbol_2471", "A computed property name of the form '{0}' must be of type 'symbol'."),
         Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher: diag(2472, ts.DiagnosticCategory.Error, "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: diag(2473, ts.DiagnosticCategory.Error, "Enum_declarations_must_all_be_const_or_non_const_2473", "Enum declarations must all be const or non-const."),
         const_enum_member_initializers_can_only_contain_literal_values_and_other_computed_enum_values: diag(2474, ts.DiagnosticCategory.Error, "const_enum_member_initializers_can_only_contain_literal_values_and_other_computed_enum_values_2474", "const enum member initializers can only contain literal values and other computed enum values."),
@@ -8094,7 +8388,6 @@ var ts;
         A_const_enum_member_can_only_be_accessed_using_a_string_literal: diag(2476, ts.DiagnosticCategory.Error, "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: diag(2477, ts.DiagnosticCategory.Error, "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: diag(2478, ts.DiagnosticCategory.Error, "const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478", "'const' enum member initializer was evaluated to disallowed value 'NaN'."),
-        Property_0_does_not_exist_on_const_enum_1: diag(2479, ts.DiagnosticCategory.Error, "Property_0_does_not_exist_on_const_enum_1_2479", "Property '{0}' does not exist on 'const' enum '{1}'."),
         let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations: diag(2480, ts.DiagnosticCategory.Error, "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: diag(2481, ts.DiagnosticCategory.Error, "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: diag(2483, ts.DiagnosticCategory.Error, "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."),
@@ -8126,14 +8419,12 @@ var ts;
         Cannot_create_an_instance_of_an_abstract_class: diag(2511, ts.DiagnosticCategory.Error, "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: diag(2512, ts.DiagnosticCategory.Error, "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: diag(2513, ts.DiagnosticCategory.Error, "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."),
-        Classes_containing_abstract_methods_must_be_marked_abstract: diag(2514, ts.DiagnosticCategory.Error, "Classes_containing_abstract_methods_must_be_marked_abstract_2514", "Classes containing abstract methods must be marked abstract."),
         Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2: diag(2515, ts.DiagnosticCategory.Error, "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: diag(2516, ts.DiagnosticCategory.Error, "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: diag(2517, ts.DiagnosticCategory.Error, "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: diag(2518, ts.DiagnosticCategory.Error, "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: diag(2519, ts.DiagnosticCategory.Error, "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: diag(2520, ts.DiagnosticCategory.Error, "Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions_2520", "Duplicate identifier '{0}'. Compiler uses declaration '{1}' to support async functions."),
-        Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions: diag(2521, ts.DiagnosticCategory.Error, "Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions_2521", "Expression resolves to variable declaration '{0}' that compiler uses to support async functions."),
         The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method: diag(2522, ts.DiagnosticCategory.Error, "The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_usi_2522", "The 'arguments' object cannot be referenced in an async function or method in ES3 and ES5. Consider using a standard function or method."),
         yield_expressions_cannot_be_used_in_a_parameter_initializer: diag(2523, ts.DiagnosticCategory.Error, "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: diag(2524, ts.DiagnosticCategory.Error, "await_expressions_cannot_be_used_in_a_parameter_initializer_2524", "'await' expressions cannot be used in a parameter initializer."),
@@ -8153,7 +8444,6 @@ var ts;
         Type_0_cannot_be_used_as_an_index_type: diag(2538, ts.DiagnosticCategory.Error, "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: diag(2539, ts.DiagnosticCategory.Error, "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: diag(2540, ts.DiagnosticCategory.Error, "Cannot_assign_to_0_because_it_is_a_read_only_property_2540", "Cannot assign to '{0}' because it is a read-only property."),
-        The_target_of_an_assignment_must_be_a_variable_or_a_property_access: diag(2541, ts.DiagnosticCategory.Error, "The_target_of_an_assignment_must_be_a_variable_or_a_property_access_2541", "The target of an assignment must be a variable or a property access."),
         Index_signature_in_type_0_only_permits_reading: diag(2542, ts.DiagnosticCategory.Error, "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: diag(2543, ts.DiagnosticCategory.Error, "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: diag(2544, ts.DiagnosticCategory.Error, "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."),
@@ -8161,14 +8451,13 @@ var ts;
         The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property: diag(2547, ts.DiagnosticCategory.Error, "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: diag(2548, ts.DiagnosticCategory.Error, "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: diag(2549, ts.DiagnosticCategory.Error, "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: diag(2550, ts.DiagnosticCategory.Error, "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_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2_or_later: diag(2550, ts.DiagnosticCategory.Error, "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: diag(2551, ts.DiagnosticCategory.Error, "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: diag(2552, ts.DiagnosticCategory.Error, "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: diag(2553, ts.DiagnosticCategory.Error, "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: diag(2554, ts.DiagnosticCategory.Error, "Expected_0_arguments_but_got_1_2554", "Expected {0} arguments, but got {1}."),
         Expected_at_least_0_arguments_but_got_1: diag(2555, ts.DiagnosticCategory.Error, "Expected_at_least_0_arguments_but_got_1_2555", "Expected at least {0} arguments, but got {1}."),
-        Expected_0_arguments_but_got_1_or_more: diag(2556, ts.DiagnosticCategory.Error, "Expected_0_arguments_but_got_1_or_more_2556", "Expected {0} arguments, but got {1} or more."),
-        Expected_at_least_0_arguments_but_got_1_or_more: diag(2557, ts.DiagnosticCategory.Error, "Expected_at_least_0_arguments_but_got_1_or_more_2557", "Expected at least {0} arguments, but got {1} or more."),
+        A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter: diag(2556, ts.DiagnosticCategory.Error, "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: diag(2558, ts.DiagnosticCategory.Error, "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: diag(2559, ts.DiagnosticCategory.Error, "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: diag(2560, ts.DiagnosticCategory.Error, "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?"),
@@ -8179,10 +8468,10 @@ var ts;
         Property_0_is_used_before_being_assigned: diag(2565, ts.DiagnosticCategory.Error, "Property_0_is_used_before_being_assigned_2565", "Property '{0}' is used before being assigned."),
         A_rest_element_cannot_have_a_property_name: diag(2566, ts.DiagnosticCategory.Error, "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: diag(2567, ts.DiagnosticCategory.Error, "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: diag(2568, ts.DiagnosticCategory.Error, "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}'?"),
         Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators: diag(2569, ts.DiagnosticCategory.Error, "Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterati_2569", "Type '{0}' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators."),
+        Could_not_find_name_0_Did_you_mean_1: diag(2570, ts.DiagnosticCategory.Error, "Could_not_find_name_0_Did_you_mean_1_2570", "Could not find name '{0}'. Did you mean '{1}'?"),
         Object_is_of_type_unknown: diag(2571, ts.DiagnosticCategory.Error, "Object_is_of_type_unknown_2571", "Object is of type 'unknown'."),
-        Rest_signatures_are_incompatible: diag(2572, ts.DiagnosticCategory.Error, "Rest_signatures_are_incompatible_2572", "Rest signatures are incompatible."),
-        Property_0_is_incompatible_with_rest_element_type: diag(2573, ts.DiagnosticCategory.Error, "Property_0_is_incompatible_with_rest_element_type_2573", "Property '{0}' is incompatible with rest element type."),
         A_rest_element_type_must_be_an_array_type: diag(2574, ts.DiagnosticCategory.Error, "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: diag(2575, ts.DiagnosticCategory.Error, "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: diag(2576, ts.DiagnosticCategory.Error, "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?"),
@@ -8191,28 +8480,23 @@ var ts;
         Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode: diag(2580, ts.DiagnosticCategory.Error, "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: diag(2581, ts.DiagnosticCategory.Error, "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: diag(2582, ts.DiagnosticCategory.Error, "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: diag(2583, ts.DiagnosticCategory.Error, "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: diag(2584, ts.DiagnosticCategory.Error, "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: diag(2585, ts.DiagnosticCategory.Error, "_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."),
-        Enum_type_0_circularly_references_itself: diag(2586, ts.DiagnosticCategory.Error, "Enum_type_0_circularly_references_itself_2586", "Enum type '{0}' circularly references itself."),
-        JSDoc_type_0_circularly_references_itself: diag(2587, ts.DiagnosticCategory.Error, "JSDoc_type_0_circularly_references_itself_2587", "JSDoc type '{0}' circularly references itself."),
+        Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later: diag(2583, ts.DiagnosticCategory.Error, "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: diag(2584, ts.DiagnosticCategory.Error, "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: diag(2585, ts.DiagnosticCategory.Error, "_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: diag(2588, ts.DiagnosticCategory.Error, "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: diag(2589, ts.DiagnosticCategory.Error, "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: diag(2590, ts.DiagnosticCategory.Error, "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: diag(2591, ts.DiagnosticCategory.Error, "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: diag(2592, ts.DiagnosticCategory.Error, "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: diag(2593, ts.DiagnosticCategory.Error, "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."),
+        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: diag(2591, ts.DiagnosticCategory.Error, "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: diag(2592, ts.DiagnosticCategory.Error, "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: diag(2593, ts.DiagnosticCategory.Error, "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_using_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag: diag(2594, ts.DiagnosticCategory.Error, "This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the__2594", "This module is declared with using '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: diag(2595, ts.DiagnosticCategory.Error, "_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: diag(2596, ts.DiagnosticCategory.Error, "_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: diag(2597, ts.DiagnosticCategory.Error, "_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: diag(2598, ts.DiagnosticCategory.Error, "_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_attributes_type_0_may_not_be_a_union_type: diag(2600, ts.DiagnosticCategory.Error, "JSX_element_attributes_type_0_may_not_be_a_union_type_2600", "JSX element attributes type '{0}' may not be a union type."),
-        The_return_type_of_a_JSX_element_constructor_must_return_an_object_type: diag(2601, ts.DiagnosticCategory.Error, "The_return_type_of_a_JSX_element_constructor_must_return_an_object_type_2601", "The return type of a JSX element constructor must return an object type."),
         JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: diag(2602, ts.DiagnosticCategory.Error, "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: diag(2603, ts.DiagnosticCategory.Error, "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: diag(2604, ts.DiagnosticCategory.Error, "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."),
-        JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements: diag(2605, ts.DiagnosticCategory.Error, "JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements_2605", "JSX element type '{0}' is not a constructor function for JSX elements."),
         Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property: diag(2606, ts.DiagnosticCategory.Error, "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: diag(2607, ts.DiagnosticCategory.Error, "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: diag(2608, ts.DiagnosticCategory.Error, "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."),
@@ -8234,12 +8518,17 @@ var ts;
         Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target: diag(2625, ts.DiagnosticCategory.Error, "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: diag(2626, ts.DiagnosticCategory.Error, "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: diag(2627, ts.DiagnosticCategory.Error, "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: diag(2628, ts.DiagnosticCategory.Error, "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: diag(2629, ts.DiagnosticCategory.Error, "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: diag(2630, ts.DiagnosticCategory.Error, "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: diag(2631, ts.DiagnosticCategory.Error, "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: diag(2632, ts.DiagnosticCategory.Error, "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: diag(2633, ts.DiagnosticCategory.Error, "JSX_property_access_expressions_cannot_include_JSX_namespace_names_2633", "JSX property access expressions cannot include JSX namespace names"),
+        _0_index_signatures_are_incompatible: diag(2634, ts.DiagnosticCategory.Error, "_0_index_signatures_are_incompatible_2634", "'{0}' index signatures are incompatible."),
         Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity: diag(2649, ts.DiagnosticCategory.Error, "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."),
         A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums: diag(2651, ts.DiagnosticCategory.Error, "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: diag(2652, ts.DiagnosticCategory.Error, "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: diag(2653, ts.DiagnosticCategory.Error, "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}'."),
-        Exported_external_package_typings_file_cannot_contain_tripleslash_references_Please_contact_the_package_author_to_update_the_package_definition: diag(2654, ts.DiagnosticCategory.Error, "Exported_external_package_typings_file_cannot_contain_tripleslash_references_Please_contact_the_pack_2654", "Exported external package typings file cannot contain tripleslash references. Please contact the package author to update the package definition."),
-        Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_the_package_definition: diag(2656, ts.DiagnosticCategory.Error, "Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_2656", "Exported external package typings file '{0}' is not a module. Please contact the package author to update the package definition."),
         JSX_expressions_must_have_one_parent_element: diag(2657, ts.DiagnosticCategory.Error, "JSX_expressions_must_have_one_parent_element_2657", "JSX expressions must have one parent element."),
         Type_0_provides_no_match_for_the_signature_1: diag(2658, ts.DiagnosticCategory.Error, "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: diag(2659, ts.DiagnosticCategory.Error, "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."),
@@ -8265,7 +8554,6 @@ var ts;
         A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void: diag(2679, ts.DiagnosticCategory.Error, "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: diag(2680, ts.DiagnosticCategory.Error, "A_0_parameter_must_be_the_first_parameter_2680", "A '{0}' parameter must be the first parameter."),
         A_constructor_cannot_have_a_this_parameter: diag(2681, ts.DiagnosticCategory.Error, "A_constructor_cannot_have_a_this_parameter_2681", "A constructor cannot have a 'this' parameter."),
-        get_and_set_accessor_must_have_the_same_this_type: diag(2682, ts.DiagnosticCategory.Error, "get_and_set_accessor_must_have_the_same_this_type_2682", "'get' and 'set' accessor must have the same 'this' type."),
         this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation: diag(2683, ts.DiagnosticCategory.Error, "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: diag(2684, ts.DiagnosticCategory.Error, "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: diag(2685, ts.DiagnosticCategory.Error, "The_this_types_of_each_signature_are_incompatible_2685", "The 'this' types of each signature are incompatible."),
@@ -8280,7 +8568,7 @@ var ts;
         Namespace_0_has_no_exported_member_1: diag(2694, ts.DiagnosticCategory.Error, "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: diag(2695, ts.DiagnosticCategory.Error, "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*/ true),
         The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead: diag(2696, ts.DiagnosticCategory.Error, "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: diag(2697, ts.DiagnosticCategory.Error, "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."),
+        An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option: diag(2697, ts.DiagnosticCategory.Error, "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: diag(2698, ts.DiagnosticCategory.Error, "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: diag(2699, ts.DiagnosticCategory.Error, "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: diag(2700, ts.DiagnosticCategory.Error, "Rest_types_may_only_be_created_from_object_types_2700", "Rest types may only be created from object types."),
@@ -8288,14 +8576,14 @@ var ts;
         _0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here: diag(2702, ts.DiagnosticCategory.Error, "_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: diag(2703, ts.DiagnosticCategory.Error, "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: diag(2704, ts.DiagnosticCategory.Error, "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_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option: diag(2705, ts.DiagnosticCategory.Error, "An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_de_2705", "An async function or method in ES5/ES3 requires the 'Promise' constructor.  Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option."),
+        An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option: diag(2705, ts.DiagnosticCategory.Error, "An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_de_2705", "An async function or method in ES5/ES3 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: diag(2706, ts.DiagnosticCategory.Error, "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: diag(2707, ts.DiagnosticCategory.Error, "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: diag(2708, ts.DiagnosticCategory.Error, "Cannot_use_namespace_0_as_a_value_2708", "Cannot use namespace '{0}' as a value."),
         Cannot_use_namespace_0_as_a_type: diag(2709, ts.DiagnosticCategory.Error, "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: diag(2710, ts.DiagnosticCategory.Error, "_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: diag(2711, ts.DiagnosticCategory.Error, "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_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option: diag(2712, ts.DiagnosticCategory.Error, "A_dynamic_import_call_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declarat_2712", "A dynamic import call in ES5/ES3 requires the 'Promise' constructor.  Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option."),
+        A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option: diag(2711, ts.DiagnosticCategory.Error, "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_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option: diag(2712, ts.DiagnosticCategory.Error, "A_dynamic_import_call_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declarat_2712", "A dynamic import call in ES5/ES3 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: diag(2713, ts.DiagnosticCategory.Error, "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: diag(2714, ts.DiagnosticCategory.Error, "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: diag(2715, ts.DiagnosticCategory.Error, "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."),
@@ -8357,7 +8645,7 @@ var ts;
         The_last_overload_is_declared_here: diag(2771, ts.DiagnosticCategory.Error, "The_last_overload_is_declared_here_2771", "The last overload is declared here."),
         Overload_0_of_1_2_gave_the_following_error: diag(2772, ts.DiagnosticCategory.Error, "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: diag(2773, ts.DiagnosticCategory.Error, "Did_you_forget_to_use_await_2773", "Did you forget to use 'await'?"),
-        This_condition_will_always_return_true_since_the_function_is_always_defined_Did_you_mean_to_call_it_instead: diag(2774, ts.DiagnosticCategory.Error, "This_condition_will_always_return_true_since_the_function_is_always_defined_Did_you_mean_to_call_it__2774", "This condition will always return true since the function is always defined. Did you mean to call it instead?"),
+        This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead: diag(2774, ts.DiagnosticCategory.Error, "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: diag(2775, ts.DiagnosticCategory.Error, "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: diag(2776, ts.DiagnosticCategory.Error, "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: diag(2777, ts.DiagnosticCategory.Error, "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."),
@@ -8384,6 +8672,31 @@ var ts;
         The_declaration_was_marked_as_deprecated_here: diag(2798, ts.DiagnosticCategory.Error, "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: diag(2799, ts.DiagnosticCategory.Error, "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: diag(2800, ts.DiagnosticCategory.Error, "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: diag(2801, ts.DiagnosticCategory.Error, "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: diag(2802, ts.DiagnosticCategory.Error, "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: diag(2803, ts.DiagnosticCategory.Error, "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: diag(2804, ts.DiagnosticCategory.Error, "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."),
+        Static_fields_with_private_names_can_t_have_initializers_when_the_useDefineForClassFields_flag_is_not_specified_with_a_target_of_esnext_Consider_adding_the_useDefineForClassFields_flag: diag(2805, ts.DiagnosticCategory.Error, "Static_fields_with_private_names_can_t_have_initializers_when_the_useDefineForClassFields_flag_is_no_2805", "Static fields with private names can't have initializers when the '--useDefineForClassFields' flag is not specified with a '--target' of 'esnext'. Consider adding the '--useDefineForClassFields' flag."),
+        Private_accessor_was_defined_without_a_getter: diag(2806, ts.DiagnosticCategory.Error, "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: diag(2807, ts.DiagnosticCategory.Error, "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: diag(2808, ts.DiagnosticCategory.Error, "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_the_whole_assignment_in_parentheses: diag(2809, ts.DiagnosticCategory.Error, "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 the whole assignment in parentheses."),
+        Property_0_may_not_be_used_in_a_static_property_s_initializer_in_the_same_class_when_target_is_esnext_and_useDefineForClassFields_is_false: diag(2810, ts.DiagnosticCategory.Error, "Property_0_may_not_be_used_in_a_static_property_s_initializer_in_the_same_class_when_target_is_esnex_2810", "Property '{0}' may not be used in a static property's initializer in the same class when 'target' is 'esnext' and 'useDefineForClassFields' is 'false'."),
+        Initializer_for_property_0: diag(2811, ts.DiagnosticCategory.Error, "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: diag(2812, ts.DiagnosticCategory.Error, "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: diag(2813, ts.DiagnosticCategory.Error, "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: diag(2814, ts.DiagnosticCategory.Error, "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: diag(2815, ts.DiagnosticCategory.Error, "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: diag(2816, ts.DiagnosticCategory.Error, "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: diag(2817, ts.DiagnosticCategory.Error, "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: diag(2818, ts.DiagnosticCategory.Error, "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: diag(2819, ts.DiagnosticCategory.Error, "Namespace_name_cannot_be_0_2819", "Namespace name cannot be '{0}'."),
+        Type_0_is_not_assignable_to_type_1_Did_you_mean_2: diag(2820, ts.DiagnosticCategory.Error, "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: diag(2821, ts.DiagnosticCategory.Error, "Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_2821", "Import assertions are only supported when the '--module' option is set to 'esnext'."),
+        Import_assertions_cannot_be_used_with_type_only_imports_or_exports: diag(2822, ts.DiagnosticCategory.Error, "Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822", "Import assertions cannot be used with type-only imports or exports."),
+        Cannot_find_namespace_0_Did_you_mean_1: diag(2833, ts.DiagnosticCategory.Error, "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_node12_or_nodenext_Consider_adding_an_extension_to_the_import_path: diag(2834, ts.DiagnosticCategory.Error, "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 'node12' or 'nodenext'. Consider adding an extension to the import path."),
+        Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node12_or_nodenext_Did_you_mean_0: diag(2835, ts.DiagnosticCategory.Error, "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 'node12' or 'nodenext'. Did you mean '{0}'?"),
         Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "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: diag(4002, ts.DiagnosticCategory.Error, "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: diag(4004, ts.DiagnosticCategory.Error, "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}'."),
@@ -8478,6 +8791,19 @@ var ts;
         Type_arguments_for_0_circularly_reference_themselves: diag(4109, ts.DiagnosticCategory.Error, "Type_arguments_for_0_circularly_reference_themselves_4109", "Type arguments for '{0}' circularly reference themselves."),
         Tuple_type_arguments_circularly_reference_themselves: diag(4110, ts.DiagnosticCategory.Error, "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: diag(4111, ts.DiagnosticCategory.Error, "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: diag(4112, ts.DiagnosticCategory.Error, "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: diag(4113, ts.DiagnosticCategory.Error, "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: diag(4114, ts.DiagnosticCategory.Error, "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: diag(4115, ts.DiagnosticCategory.Error, "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: diag(4116, ts.DiagnosticCategory.Error, "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: diag(4117, ts.DiagnosticCategory.Error, "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: diag(4118, ts.DiagnosticCategory.Error, "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: diag(4119, ts.DiagnosticCategory.Error, "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: diag(4120, ts.DiagnosticCategory.Error, "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: diag(4121, ts.DiagnosticCategory.Error, "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: diag(4122, ts.DiagnosticCategory.Error, "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: diag(4123, ts.DiagnosticCategory.Error, "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: diag(4124, ts.DiagnosticCategory.Error, "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'."),
         The_current_host_does_not_support_the_0_option: diag(5001, ts.DiagnosticCategory.Error, "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: diag(5009, ts.DiagnosticCategory.Error, "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: diag(5010, ts.DiagnosticCategory.Error, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),
@@ -8512,7 +8838,7 @@ var ts;
         Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_esNext: diag(5071, ts.DiagnosticCategory.Error, "Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_5071", "Option '--resolveJsonModule' can only be specified when module code generation is 'commonjs', 'amd', 'es2015' or 'esNext'."),
         Unknown_build_option_0: diag(5072, ts.DiagnosticCategory.Error, "Unknown_build_option_0_5072", "Unknown build option '{0}'."),
         Build_option_0_requires_a_value_of_type_1: diag(5073, ts.DiagnosticCategory.Error, "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: diag(5074, ts.DiagnosticCategory.Error, "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."),
+        Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified: diag(5074, ts.DiagnosticCategory.Error, "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: diag(5075, ts.DiagnosticCategory.Error, "_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: diag(5076, ts.DiagnosticCategory.Error, "_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: diag(5077, ts.DiagnosticCategory.Error, "Unknown_build_option_0_Did_you_mean_1_5077", "Unknown build option '{0}'. Did you mean '{1}'?"),
@@ -8525,15 +8851,18 @@ var ts;
         Tuple_members_must_all_have_names_or_all_not_have_names: diag(5084, ts.DiagnosticCategory.Error, "Tuple_members_must_all_have_names_or_all_not_have_names_5084", "Tuple members must all have names or all not have names."),
         A_tuple_member_cannot_be_both_optional_and_rest: diag(5085, ts.DiagnosticCategory.Error, "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: diag(5086, ts.DiagnosticCategory.Error, "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: diag(5087, ts.DiagnosticCategory.Error, "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."),
+        A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type: diag(5087, ts.DiagnosticCategory.Error, "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: diag(5088, ts.DiagnosticCategory.Error, "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: diag(5089, ts.DiagnosticCategory.Error, "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: diag(5090, ts.DiagnosticCategory.Error, "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_isolatedModules_is_enabled: diag(5091, ts.DiagnosticCategory.Error, "Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled_5091", "Option 'preserveConstEnums' cannot be disabled when 'isolatedModules' is enabled."),
+        The_root_value_of_a_0_file_must_be_an_object: diag(5092, ts.DiagnosticCategory.Error, "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: diag(5093, ts.DiagnosticCategory.Error, "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: diag(5094, ts.DiagnosticCategory.Error, "Compiler_option_0_may_not_be_used_with_build_5094", "Compiler option '--{0}' may not be used with '--build'."),
+        Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later: diag(5095, ts.DiagnosticCategory.Error, "Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later_5095", "Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later."),
         Generates_a_sourcemap_for_each_corresponding_d_ts_file: diag(6000, ts.DiagnosticCategory.Message, "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: diag(6001, ts.DiagnosticCategory.Message, "Concatenate_and_emit_output_to_single_file_6001", "Concatenate and emit output to single file."),
         Generates_corresponding_d_ts_file: diag(6002, ts.DiagnosticCategory.Message, "Generates_corresponding_d_ts_file_6002", "Generates corresponding '.d.ts' file."),
-        Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: diag(6003, ts.DiagnosticCategory.Message, "Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations_6003", "Specify the location where debugger should locate map files instead of generated locations."),
         Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: diag(6004, ts.DiagnosticCategory.Message, "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: diag(6005, ts.DiagnosticCategory.Message, "Watch_input_files_6005", "Watch input files."),
         Redirect_output_structure_to_the_directory: diag(6006, ts.DiagnosticCategory.Message, "Redirect_output_structure_to_the_directory_6006", "Redirect output structure to the directory."),
@@ -8545,8 +8874,8 @@ var ts;
         Skip_type_checking_of_declaration_files: diag(6012, ts.DiagnosticCategory.Message, "Skip_type_checking_of_declaration_files_6012", "Skip type checking of declaration files."),
         Do_not_resolve_the_real_path_of_symlinks: diag(6013, ts.DiagnosticCategory.Message, "Do_not_resolve_the_real_path_of_symlinks_6013", "Do not resolve the real path of symlinks."),
         Only_emit_d_ts_declaration_files: diag(6014, ts.DiagnosticCategory.Message, "Only_emit_d_ts_declaration_files_6014", "Only emit '.d.ts' declaration files."),
-        Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_ES2019_ES2020_or_ESNEXT: diag(6015, ts.DiagnosticCategory.Message, "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_ES2019_ES2020_or_6015", "Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'."),
-        Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_es2020_or_ESNext: diag(6016, ts.DiagnosticCategory.Message, "Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_es2020_or_ESNext_6016", "Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'."),
+        Specify_ECMAScript_target_version: diag(6015, ts.DiagnosticCategory.Message, "Specify_ECMAScript_target_version_6015", "Specify ECMAScript target version."),
+        Specify_module_code_generation: diag(6016, ts.DiagnosticCategory.Message, "Specify_module_code_generation_6016", "Specify module code generation."),
         Print_this_message: diag(6017, ts.DiagnosticCategory.Message, "Print_this_message_6017", "Print this message."),
         Print_the_compiler_s_version: diag(6019, ts.DiagnosticCategory.Message, "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: diag(6020, ts.DiagnosticCategory.Message, "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'."),
@@ -8571,7 +8900,6 @@ var ts;
         Unterminated_quoted_string_in_response_file_0: diag(6045, ts.DiagnosticCategory.Error, "Unterminated_quoted_string_in_response_file_0_6045", "Unterminated quoted string in response file '{0}'."),
         Argument_for_0_option_must_be_Colon_1: diag(6046, ts.DiagnosticCategory.Error, "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: diag(6048, ts.DiagnosticCategory.Error, "Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1_6048", "Locale must be of the form <language> or <language>-<territory>. For example '{0}' or '{1}'."),
-        Unsupported_locale_0: diag(6049, ts.DiagnosticCategory.Error, "Unsupported_locale_0_6049", "Unsupported locale '{0}'."),
         Unable_to_open_file_0: diag(6050, ts.DiagnosticCategory.Error, "Unable_to_open_file_0_6050", "Unable to open file '{0}'."),
         Corrupted_locale_file_0: diag(6051, ts.DiagnosticCategory.Error, "Corrupted_locale_file_0_6051", "Corrupted locale file {0}."),
         Raise_error_on_expressions_and_declarations_with_an_implied_any_type: diag(6052, ts.DiagnosticCategory.Message, "Raise_error_on_expressions_and_declarations_with_an_implied_any_type_6052", "Raise error on expressions and declarations with an implied 'any' type."),
@@ -8586,7 +8914,6 @@ var ts;
         Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line: diag(6064, ts.DiagnosticCategory.Error, "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: diag(6065, ts.DiagnosticCategory.Message, "Enables_experimental_support_for_ES7_decorators_6065", "Enables experimental support for ES7 decorators."),
         Enables_experimental_support_for_emitting_type_metadata_for_decorators: diag(6066, ts.DiagnosticCategory.Message, "Enables_experimental_support_for_emitting_type_metadata_for_decorators_6066", "Enables experimental support for emitting type metadata for decorators."),
-        Enables_experimental_support_for_ES7_async_functions: diag(6068, ts.DiagnosticCategory.Message, "Enables_experimental_support_for_ES7_async_functions_6068", "Enables experimental support for ES7 async functions."),
         Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6: diag(6069, ts.DiagnosticCategory.Message, "Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6_6069", "Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6)."),
         Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file: diag(6070, ts.DiagnosticCategory.Message, "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: diag(6071, ts.DiagnosticCategory.Message, "Successfully_created_a_tsconfig_json_file_6071", "Successfully created a tsconfig.json file."),
@@ -8598,7 +8925,7 @@ var ts;
         Do_not_report_errors_on_unreachable_code: diag(6077, ts.DiagnosticCategory.Message, "Do_not_report_errors_on_unreachable_code_6077", "Do not report errors on unreachable code."),
         Disallow_inconsistently_cased_references_to_the_same_file: diag(6078, ts.DiagnosticCategory.Message, "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: diag(6079, ts.DiagnosticCategory.Message, "Specify_library_files_to_be_included_in_the_compilation_6079", "Specify library files to be included in the compilation."),
-        Specify_JSX_code_generation_Colon_preserve_react_native_react_react_jsx_or_react_jsxdev: diag(6080, ts.DiagnosticCategory.Message, "Specify_JSX_code_generation_Colon_preserve_react_native_react_react_jsx_or_react_jsxdev_6080", "Specify JSX code generation: 'preserve', 'react-native', 'react', 'react-jsx' or 'react-jsxdev'."),
+        Specify_JSX_code_generation: diag(6080, ts.DiagnosticCategory.Message, "Specify_JSX_code_generation_6080", "Specify JSX code generation."),
         File_0_has_an_unsupported_extension_so_skipping_it: diag(6081, ts.DiagnosticCategory.Message, "File_0_has_an_unsupported_extension_so_skipping_it_6081", "File '{0}' has an unsupported extension, so skipping it."),
         Only_amd_and_system_modules_are_supported_alongside_0: diag(6082, ts.DiagnosticCategory.Error, "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: diag(6083, ts.DiagnosticCategory.Message, "Base_directory_to_resolve_non_absolute_module_names_6083", "Base directory to resolve non-absolute module names."),
@@ -8621,7 +8948,6 @@ var ts;
         package_json_does_not_have_a_0_field: diag(6100, ts.DiagnosticCategory.Message, "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: diag(6101, ts.DiagnosticCategory.Message, "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: diag(6102, ts.DiagnosticCategory.Message, "Allow_javascript_files_to_be_compiled_6102", "Allow javascript files to be compiled."),
-        Option_0_should_have_array_of_strings_as_a_value: diag(6103, ts.DiagnosticCategory.Error, "Option_0_should_have_array_of_strings_as_a_value_6103", "Option '{0}' should have array of strings as a value."),
         Checking_if_0_is_the_longest_matching_prefix_for_1_2: diag(6104, ts.DiagnosticCategory.Message, "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: diag(6105, ts.DiagnosticCategory.Message, "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: diag(6106, ts.DiagnosticCategory.Message, "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}'."),
@@ -8635,8 +8961,6 @@ var ts;
         Unknown_option_excludes_Did_you_mean_exclude: diag(6114, ts.DiagnosticCategory.Error, "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: diag(6115, ts.DiagnosticCategory.Message, "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: diag(6116, ts.DiagnosticCategory.Message, "Resolving_type_reference_directive_0_containing_file_1_root_directory_2_6116", "======== Resolving type reference directive '{0}', containing file '{1}', root directory '{2}'. ========"),
-        Resolving_using_primary_search_paths: diag(6117, ts.DiagnosticCategory.Message, "Resolving_using_primary_search_paths_6117", "Resolving using primary search paths..."),
-        Resolving_from_node_modules_folder: diag(6118, ts.DiagnosticCategory.Message, "Resolving_from_node_modules_folder_6118", "Resolving from node_modules folder..."),
         Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2: diag(6119, ts.DiagnosticCategory.Message, "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: diag(6120, ts.DiagnosticCategory.Message, "Type_reference_directive_0_was_not_resolved_6120", "======== Type reference directive '{0}' was not resolved. ========"),
         Resolving_with_primary_search_path_0: diag(6121, ts.DiagnosticCategory.Message, "Resolving_with_primary_search_path_0_6121", "Resolving with primary search path '{0}'."),
@@ -8680,7 +9004,6 @@ var ts;
         List_of_folders_to_include_type_definitions_from: diag(6161, ts.DiagnosticCategory.Message, "List_of_folders_to_include_type_definitions_from_6161", "List of folders to include type definitions from."),
         Disable_size_limitations_on_JavaScript_projects: diag(6162, ts.DiagnosticCategory.Message, "Disable_size_limitations_on_JavaScript_projects_6162", "Disable size limitations on JavaScript projects."),
         The_character_set_of_the_input_files: diag(6163, ts.DiagnosticCategory.Message, "The_character_set_of_the_input_files_6163", "The character set of the input files."),
-        Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files: diag(6164, ts.DiagnosticCategory.Message, "Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files_6164", "Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files."),
         Do_not_truncate_error_messages: diag(6165, ts.DiagnosticCategory.Message, "Do_not_truncate_error_messages_6165", "Do not truncate error messages."),
         Output_directory_for_generated_declaration_files: diag(6166, ts.DiagnosticCategory.Message, "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: diag(6167, ts.DiagnosticCategory.Message, "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'."),
@@ -8688,20 +9011,12 @@ var ts;
         Show_all_compiler_options: diag(6169, ts.DiagnosticCategory.Message, "Show_all_compiler_options_6169", "Show all compiler options."),
         Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file: diag(6170, ts.DiagnosticCategory.Message, "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: diag(6171, ts.DiagnosticCategory.Message, "Command_line_Options_6171", "Command-line Options"),
-        Basic_Options: diag(6172, ts.DiagnosticCategory.Message, "Basic_Options_6172", "Basic Options"),
-        Strict_Type_Checking_Options: diag(6173, ts.DiagnosticCategory.Message, "Strict_Type_Checking_Options_6173", "Strict Type-Checking Options"),
-        Module_Resolution_Options: diag(6174, ts.DiagnosticCategory.Message, "Module_Resolution_Options_6174", "Module Resolution Options"),
-        Source_Map_Options: diag(6175, ts.DiagnosticCategory.Message, "Source_Map_Options_6175", "Source Map Options"),
-        Additional_Checks: diag(6176, ts.DiagnosticCategory.Message, "Additional_Checks_6176", "Additional Checks"),
-        Experimental_Options: diag(6177, ts.DiagnosticCategory.Message, "Experimental_Options_6177", "Experimental Options"),
-        Advanced_Options: diag(6178, ts.DiagnosticCategory.Message, "Advanced_Options_6178", "Advanced Options"),
         Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3: diag(6179, ts.DiagnosticCategory.Message, "Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3_6179", "Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'."),
         Enable_all_strict_type_checking_options: diag(6180, ts.DiagnosticCategory.Message, "Enable_all_strict_type_checking_options_6180", "Enable all strict type-checking options."),
         List_of_language_service_plugins: diag(6181, ts.DiagnosticCategory.Message, "List_of_language_service_plugins_6181", "List of language service plugins."),
         Scoped_package_detected_looking_in_0: diag(6182, ts.DiagnosticCategory.Message, "Scoped_package_detected_looking_in_0_6182", "Scoped package detected, looking in '{0}'"),
-        Reusing_resolution_of_module_0_to_file_1_from_old_program: diag(6183, ts.DiagnosticCategory.Message, "Reusing_resolution_of_module_0_to_file_1_from_old_program_6183", "Reusing resolution of module '{0}' to file '{1}' from old program."),
-        Reusing_module_resolutions_originating_in_0_since_resolutions_are_unchanged_from_old_program: diag(6184, ts.DiagnosticCategory.Message, "Reusing_module_resolutions_originating_in_0_since_resolutions_are_unchanged_from_old_program_6184", "Reusing module resolutions originating in '{0}' since resolutions are unchanged from old program."),
-        Disable_strict_checking_of_generic_signatures_in_function_types: diag(6185, ts.DiagnosticCategory.Message, "Disable_strict_checking_of_generic_signatures_in_function_types_6185", "Disable strict checking of generic signatures in function types."),
+        Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2: diag(6183, ts.DiagnosticCategory.Message, "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: diag(6184, ts.DiagnosticCategory.Message, "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: diag(6186, ts.DiagnosticCategory.Message, "Enable_strict_checking_of_function_types_6186", "Enable strict checking of function types."),
         Enable_strict_checking_of_property_initialization_in_classes: diag(6187, ts.DiagnosticCategory.Message, "Enable_strict_checking_of_property_initialization_in_classes_6187", "Enable strict checking of property initialization in classes."),
         Numeric_separators_are_not_allowed_here: diag(6188, ts.DiagnosticCategory.Error, "Numeric_separators_are_not_allowed_here_6188", "Numeric separators are not allowed here."),
@@ -8740,10 +9055,9 @@ var ts;
         Emit_class_fields_with_Define_instead_of_Set: diag(6222, ts.DiagnosticCategory.Message, "Emit_class_fields_with_Define_instead_of_Set_6222", "Emit class fields with Define instead of Set."),
         Generates_a_CPU_profile: diag(6223, ts.DiagnosticCategory.Message, "Generates_a_CPU_profile_6223", "Generates a CPU profile."),
         Disable_solution_searching_for_this_project: diag(6224, ts.DiagnosticCategory.Message, "Disable_solution_searching_for_this_project_6224", "Disable solution searching for this project."),
-        Specify_strategy_for_watching_file_Colon_FixedPollingInterval_default_PriorityPollingInterval_DynamicPriorityPolling_UseFsEvents_UseFsEventsOnParentDirectory: diag(6225, ts.DiagnosticCategory.Message, "Specify_strategy_for_watching_file_Colon_FixedPollingInterval_default_PriorityPollingInterval_Dynami_6225", "Specify strategy for watching file: 'FixedPollingInterval' (default), 'PriorityPollingInterval', 'DynamicPriorityPolling', 'UseFsEvents', 'UseFsEventsOnParentDirectory'."),
-        Specify_strategy_for_watching_directory_on_platforms_that_don_t_support_recursive_watching_natively_Colon_UseFsEvents_default_FixedPollingInterval_DynamicPriorityPolling: diag(6226, ts.DiagnosticCategory.Message, "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'."),
-        Specify_strategy_for_creating_a_polling_watch_when_it_fails_to_create_using_file_system_events_Colon_FixedInterval_default_PriorityInterval_DynamicPriority: diag(6227, ts.DiagnosticCategory.Message, "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'."),
-        Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively: diag(6228, ts.DiagnosticCategory.Message, "Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_supp_6228", "Synchronously call callbacks and update the state of directory watchers on platforms that don't support recursive watching natively."),
+        Specify_strategy_for_watching_file_Colon_FixedPollingInterval_default_PriorityPollingInterval_DynamicPriorityPolling_FixedChunkSizePolling_UseFsEvents_UseFsEventsOnParentDirectory: diag(6225, ts.DiagnosticCategory.Message, "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: diag(6226, ts.DiagnosticCategory.Message, "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: diag(6227, ts.DiagnosticCategory.Message, "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: diag(6229, ts.DiagnosticCategory.Error, "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: diag(6230, ts.DiagnosticCategory.Error, "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: diag(6231, ts.DiagnosticCategory.Error, "Could_not_resolve_the_path_0_with_the_extensions_Colon_1_6231", "Could not resolve the path '{0}' with the extensions: {1}."),
@@ -8753,8 +9067,34 @@ var ts;
         Disable_loading_referenced_projects: diag(6235, ts.DiagnosticCategory.Message, "Disable_loading_referenced_projects_6235", "Disable loading referenced projects."),
         Arguments_for_the_rest_parameter_0_were_not_provided: diag(6236, ts.DiagnosticCategory.Error, "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: diag(6237, ts.DiagnosticCategory.Message, "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: diag(6238, ts.DiagnosticCategory.Error, "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"),
-        Projects_to_reference: diag(6300, ts.DiagnosticCategory.Message, "Projects_to_reference_6300", "Projects to reference"),
+        Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react: diag(6238, ts.DiagnosticCategory.Error, "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: diag(6239, ts.DiagnosticCategory.Message, "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: diag(6240, ts.DiagnosticCategory.Message, "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: diag(6241, ts.DiagnosticCategory.Message, "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: diag(6242, ts.DiagnosticCategory.Message, "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: diag(6243, ts.DiagnosticCategory.Message, "Interpret_optional_property_types_as_written_rather_than_adding_undefined_6243", "Interpret optional property types as written, rather than adding 'undefined'."),
+        Modules: diag(6244, ts.DiagnosticCategory.Message, "Modules_6244", "Modules"),
+        File_Management: diag(6245, ts.DiagnosticCategory.Message, "File_Management_6245", "File Management"),
+        Emit: diag(6246, ts.DiagnosticCategory.Message, "Emit_6246", "Emit"),
+        JavaScript_Support: diag(6247, ts.DiagnosticCategory.Message, "JavaScript_Support_6247", "JavaScript Support"),
+        Type_Checking: diag(6248, ts.DiagnosticCategory.Message, "Type_Checking_6248", "Type Checking"),
+        Editor_Support: diag(6249, ts.DiagnosticCategory.Message, "Editor_Support_6249", "Editor Support"),
+        Watch_and_Build_Modes: diag(6250, ts.DiagnosticCategory.Message, "Watch_and_Build_Modes_6250", "Watch and Build Modes"),
+        Compiler_Diagnostics: diag(6251, ts.DiagnosticCategory.Message, "Compiler_Diagnostics_6251", "Compiler Diagnostics"),
+        Interop_Constraints: diag(6252, ts.DiagnosticCategory.Message, "Interop_Constraints_6252", "Interop Constraints"),
+        Backwards_Compatibility: diag(6253, ts.DiagnosticCategory.Message, "Backwards_Compatibility_6253", "Backwards Compatibility"),
+        Language_and_Environment: diag(6254, ts.DiagnosticCategory.Message, "Language_and_Environment_6254", "Language and Environment"),
+        Projects: diag(6255, ts.DiagnosticCategory.Message, "Projects_6255", "Projects"),
+        Output_Formatting: diag(6256, ts.DiagnosticCategory.Message, "Output_Formatting_6256", "Output Formatting"),
+        Completeness: diag(6257, ts.DiagnosticCategory.Message, "Completeness_6257", "Completeness"),
+        _0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file: diag(6258, ts.DiagnosticCategory.Error, "_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"),
+        Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve: diag(6270, ts.DiagnosticCategory.Message, "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: diag(6271, ts.DiagnosticCategory.Message, "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: diag(6272, ts.DiagnosticCategory.Message, "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: diag(6273, ts.DiagnosticCategory.Message, "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: diag(6274, ts.DiagnosticCategory.Message, "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: diag(6275, ts.DiagnosticCategory.Message, "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: diag(6276, ts.DiagnosticCategory.Message, "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}'."),
         Enable_project_compilation: diag(6302, ts.DiagnosticCategory.Message, "Enable_project_compilation_6302", "Enable project compilation"),
         Composite_projects_may_not_disable_declaration_emit: diag(6304, ts.DiagnosticCategory.Error, "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: diag(6305, ts.DiagnosticCategory.Error, "Output_file_0_has_not_been_built_from_source_file_1_6305", "Output file '{0}' has not been built from source file '{1}'."),
@@ -8773,15 +9113,12 @@ var ts;
         A_non_dry_build_would_build_project_0: diag(6357, ts.DiagnosticCategory.Message, "A_non_dry_build_would_build_project_0_6357", "A non-dry build would build project '{0}'"),
         Building_project_0: diag(6358, ts.DiagnosticCategory.Message, "Building_project_0_6358", "Building project '{0}'..."),
         Updating_output_timestamps_of_project_0: diag(6359, ts.DiagnosticCategory.Message, "Updating_output_timestamps_of_project_0_6359", "Updating output timestamps of project '{0}'..."),
-        delete_this_Project_0_is_up_to_date_because_it_was_previously_built: diag(6360, ts.DiagnosticCategory.Message, "delete_this_Project_0_is_up_to_date_because_it_was_previously_built_6360", "delete this - Project '{0}' is up to date because it was previously built"),
         Project_0_is_up_to_date: diag(6361, ts.DiagnosticCategory.Message, "Project_0_is_up_to_date_6361", "Project '{0}' is up to date"),
         Skipping_build_of_project_0_because_its_dependency_1_has_errors: diag(6362, ts.DiagnosticCategory.Message, "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: diag(6363, ts.DiagnosticCategory.Message, "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: diag(6364, ts.DiagnosticCategory.Message, "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: diag(6365, ts.DiagnosticCategory.Message, "Delete_the_outputs_of_all_projects_6365", "Delete the outputs of all projects"),
-        Enable_verbose_logging: diag(6366, ts.DiagnosticCategory.Message, "Enable_verbose_logging_6366", "Enable verbose logging"),
         Show_what_would_be_built_or_deleted_if_specified_with_clean: diag(6367, ts.DiagnosticCategory.Message, "Show_what_would_be_built_or_deleted_if_specified_with_clean_6367", "Show what would be built (or deleted, if specified with '--clean')"),
-        Build_all_projects_including_those_that_appear_to_be_up_to_date: diag(6368, ts.DiagnosticCategory.Message, "Build_all_projects_including_those_that_appear_to_be_up_to_date_6368", "Build all projects, including those that appear to be up to date"),
         Option_build_must_be_the_first_command_line_argument: diag(6369, ts.DiagnosticCategory.Error, "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: diag(6370, ts.DiagnosticCategory.Error, "Options_0_and_1_cannot_be_combined_6370", "Options '{0}' and '{1}' cannot be combined."),
         Updating_unchanged_output_timestamps_of_project_0: diag(6371, ts.DiagnosticCategory.Message, "Updating_unchanged_output_timestamps_of_project_0_6371", "Updating unchanged output timestamps of project '{0}'..."),
@@ -8801,14 +9138,171 @@ var ts;
         _0_is_deprecated: diag(6385, ts.DiagnosticCategory.Suggestion, "_0_is_deprecated_6385", "'{0}' is deprecated.", /*reportsUnnecessary*/ undefined, /*elidedInCompatabilityPyramid*/ undefined, /*reportsDeprecated*/ true),
         Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_native_implementation_of_the_Web_Performance_API_could_not_be_found: diag(6386, ts.DiagnosticCategory.Message, "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: diag(6387, ts.DiagnosticCategory.Suggestion, "The_signature_0_of_1_is_deprecated_6387", "The signature '{0}' of '{1}' is deprecated.", /*reportsUnnecessary*/ undefined, /*elidedInCompatabilityPyramid*/ undefined, /*reportsDeprecated*/ true),
+        Project_0_is_being_forcibly_rebuilt: diag(6388, ts.DiagnosticCategory.Message, "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: diag(6389, ts.DiagnosticCategory.Message, "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: diag(6390, ts.DiagnosticCategory.Message, "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: diag(6391, ts.DiagnosticCategory.Message, "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: diag(6392, ts.DiagnosticCategory.Message, "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: diag(6393, ts.DiagnosticCategory.Message, "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: diag(6394, ts.DiagnosticCategory.Message, "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: diag(6395, ts.DiagnosticCategory.Message, "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: diag(6396, ts.DiagnosticCategory.Message, "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: diag(6397, ts.DiagnosticCategory.Message, "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: diag(6398, ts.DiagnosticCategory.Message, "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."),
         The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1: diag(6500, ts.DiagnosticCategory.Message, "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: diag(6501, ts.DiagnosticCategory.Message, "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: diag(6502, ts.DiagnosticCategory.Message, "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: diag(6503, ts.DiagnosticCategory.Message, "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: diag(6504, ts.DiagnosticCategory.Error, "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: diag(6505, ts.DiagnosticCategory.Message, "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."),
-        Require_undeclared_properties_from_index_signatures_to_use_element_accesses: diag(6803, ts.DiagnosticCategory.Error, "Require_undeclared_properties_from_index_signatures_to_use_element_accesses_6803", "Require undeclared properties from index signatures to use element accesses."),
-        Include_undefined_in_index_signature_results: diag(6800, ts.DiagnosticCategory.Message, "Include_undefined_in_index_signature_results_6800", "Include 'undefined' in index signature results"),
+        Consider_adding_a_declare_modifier_to_this_class: diag(6506, ts.DiagnosticCategory.Message, "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: diag(6600, ts.DiagnosticCategory.Message, "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: diag(6601, ts.DiagnosticCategory.Message, "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: diag(6602, ts.DiagnosticCategory.Message, "Allow_accessing_UMD_globals_from_modules_6602", "Allow accessing UMD globals from modules."),
+        Disable_error_reporting_for_unreachable_code: diag(6603, ts.DiagnosticCategory.Message, "Disable_error_reporting_for_unreachable_code_6603", "Disable error reporting for unreachable code."),
+        Disable_error_reporting_for_unused_labels: diag(6604, ts.DiagnosticCategory.Message, "Disable_error_reporting_for_unused_labels_6604", "Disable error reporting for unused labels."),
+        Ensure_use_strict_is_always_emitted: diag(6605, ts.DiagnosticCategory.Message, "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: diag(6606, ts.DiagnosticCategory.Message, "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: diag(6607, ts.DiagnosticCategory.Message, "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: diag(6608, ts.DiagnosticCategory.Message, "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: diag(6609, ts.DiagnosticCategory.Message, "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: diag(6611, ts.DiagnosticCategory.Message, "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: diag(6612, ts.DiagnosticCategory.Message, "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: diag(6613, ts.DiagnosticCategory.Message, "Specify_the_output_directory_for_generated_declaration_files_6613", "Specify the output directory for generated declaration files."),
+        Create_sourcemaps_for_d_ts_files: diag(6614, ts.DiagnosticCategory.Message, "Create_sourcemaps_for_d_ts_files_6614", "Create sourcemaps for d.ts files."),
+        Output_compiler_performance_information_after_building: diag(6615, ts.DiagnosticCategory.Message, "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: diag(6616, ts.DiagnosticCategory.Message, "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: diag(6617, ts.DiagnosticCategory.Message, "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: diag(6618, ts.DiagnosticCategory.Message, "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: diag(6619, ts.DiagnosticCategory.Message, "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: diag(6620, ts.DiagnosticCategory.Message, "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: diag(6621, ts.DiagnosticCategory.Message, "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: diag(6622, ts.DiagnosticCategory.Message, "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: diag(6623, ts.DiagnosticCategory.Message, "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: diag(6624, ts.DiagnosticCategory.Message, "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: diag(6625, ts.DiagnosticCategory.Message, "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: diag(6626, ts.DiagnosticCategory.Message, "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: diag(6627, ts.DiagnosticCategory.Message, "Filters_results_from_the_include_option_6627", "Filters results from the `include` option."),
+        Remove_a_list_of_directories_from_the_watch_process: diag(6628, ts.DiagnosticCategory.Message, "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: diag(6629, ts.DiagnosticCategory.Message, "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_TC39_stage_2_draft_decorators: diag(6630, ts.DiagnosticCategory.Message, "Enable_experimental_support_for_TC39_stage_2_draft_decorators_6630", "Enable experimental support for TC39 stage 2 draft decorators."),
+        Print_files_read_during_the_compilation_including_why_it_was_included: diag(6631, ts.DiagnosticCategory.Message, "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: diag(6632, ts.DiagnosticCategory.Message, "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: diag(6633, ts.DiagnosticCategory.Message, "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: diag(6634, ts.DiagnosticCategory.Message, "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: diag(6635, ts.DiagnosticCategory.Message, "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: diag(6636, ts.DiagnosticCategory.Message, "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: diag(6637, ts.DiagnosticCategory.Message, "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: diag(6638, ts.DiagnosticCategory.Message, "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: diag(6639, ts.DiagnosticCategory.Message, "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."),
+        Specify_a_list_of_glob_patterns_that_match_files_to_be_included_in_compilation: diag(6641, ts.DiagnosticCategory.Message, "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: diag(6642, ts.DiagnosticCategory.Message, "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: diag(6643, ts.DiagnosticCategory.Message, "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: diag(6644, ts.DiagnosticCategory.Message, "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: diag(6645, ts.DiagnosticCategory.Message, "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: diag(6646, ts.DiagnosticCategory.Message, "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: diag(6647, ts.DiagnosticCategory.Message, "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: diag(6648, ts.DiagnosticCategory.Message, "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: diag(6649, ts.DiagnosticCategory.Message, "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: diag(6650, ts.DiagnosticCategory.Message, "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: diag(6651, ts.DiagnosticCategory.Message, "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: diag(6652, ts.DiagnosticCategory.Message, "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: diag(6653, ts.DiagnosticCategory.Message, "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: diag(6654, ts.DiagnosticCategory.Message, "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: diag(6655, ts.DiagnosticCategory.Message, "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: diag(6656, ts.DiagnosticCategory.Message, "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: diag(6657, ts.DiagnosticCategory.Message, "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: diag(6658, ts.DiagnosticCategory.Message, "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: diag(6659, ts.DiagnosticCategory.Message, "Set_the_newline_character_for_emitting_files_6659", "Set the newline character for emitting files."),
+        Disable_emitting_files_from_a_compilation: diag(6660, ts.DiagnosticCategory.Message, "Disable_emitting_files_from_a_compilation_6660", "Disable emitting files from a compilation."),
+        Disable_generating_custom_helper_functions_like_extends_in_compiled_output: diag(6661, ts.DiagnosticCategory.Message, "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: diag(6662, ts.DiagnosticCategory.Message, "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: diag(6663, ts.DiagnosticCategory.Message, "Disable_truncating_types_in_error_messages_6663", "Disable truncating types in error messages."),
+        Enable_error_reporting_for_fallthrough_cases_in_switch_statements: diag(6664, ts.DiagnosticCategory.Message, "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: diag(6665, ts.DiagnosticCategory.Message, "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: diag(6666, ts.DiagnosticCategory.Message, "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: diag(6667, ts.DiagnosticCategory.Message, "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: diag(6668, ts.DiagnosticCategory.Message, "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: diag(6669, ts.DiagnosticCategory.Message, "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: diag(6670, ts.DiagnosticCategory.Message, "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: diag(6671, ts.DiagnosticCategory.Message, "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: diag(6672, ts.DiagnosticCategory.Message, "Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add__6672", "Disallow `import`s, `require`s or `<reference>`s from expanding the number of files TypeScript should add to a project."),
+        Disable_strict_checking_of_generic_signatures_in_function_types: diag(6673, ts.DiagnosticCategory.Message, "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: diag(6674, ts.DiagnosticCategory.Message, "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_a_local_variables_aren_t_read: diag(6675, ts.DiagnosticCategory.Message, "Enable_error_reporting_when_a_local_variables_aren_t_read_6675", "Enable error reporting when a local variables aren't read."),
+        Raise_an_error_when_a_function_parameter_isn_t_read: diag(6676, ts.DiagnosticCategory.Message, "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: diag(6677, ts.DiagnosticCategory.Message, "Deprecated_setting_Use_outFile_instead_6677", "Deprecated setting. Use `outFile` instead."),
+        Specify_an_output_folder_for_all_emitted_files: diag(6678, ts.DiagnosticCategory.Message, "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: diag(6679, ts.DiagnosticCategory.Message, "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: diag(6680, ts.DiagnosticCategory.Message, "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: diag(6681, ts.DiagnosticCategory.Message, "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: diag(6682, ts.DiagnosticCategory.Message, "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: diag(6683, ts.DiagnosticCategory.Message, "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: diag(6684, ts.DiagnosticCategory.Message, "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: diag(6685, ts.DiagnosticCategory.Message, "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: diag(6686, ts.DiagnosticCategory.Message, "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: diag(6687, ts.DiagnosticCategory.Message, "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: diag(6688, ts.DiagnosticCategory.Message, "Disable_emitting_comments_6688", "Disable emitting comments."),
+        Enable_importing_json_files: diag(6689, ts.DiagnosticCategory.Message, "Enable_importing_json_files_6689", "Enable importing .json files"),
+        Specify_the_root_folder_within_your_source_files: diag(6690, ts.DiagnosticCategory.Message, "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: diag(6691, ts.DiagnosticCategory.Message, "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: diag(6692, ts.DiagnosticCategory.Message, "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: diag(6693, ts.DiagnosticCategory.Message, "Skip_type_checking_all_d_ts_files_6693", "Skip type checking all .d.ts files."),
+        Create_source_map_files_for_emitted_JavaScript_files: diag(6694, ts.DiagnosticCategory.Message, "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: diag(6695, ts.DiagnosticCategory.Message, "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: diag(6697, ts.DiagnosticCategory.Message, "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: diag(6698, ts.DiagnosticCategory.Message, "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: diag(6699, ts.DiagnosticCategory.Message, "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: diag(6700, ts.DiagnosticCategory.Message, "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: diag(6701, ts.DiagnosticCategory.Message, "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: diag(6702, ts.DiagnosticCategory.Message, "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: diag(6703, ts.DiagnosticCategory.Message, "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: diag(6704, ts.DiagnosticCategory.Message, "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: diag(6705, ts.DiagnosticCategory.Message, "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: diag(6706, ts.DiagnosticCategory.Message, "Log_paths_used_during_the_moduleResolution_process_6706", "Log paths used during the `moduleResolution` process."),
+        Specify_the_folder_for_tsbuildinfo_incremental_compilation_files: diag(6707, ts.DiagnosticCategory.Message, "Specify_the_folder_for_tsbuildinfo_incremental_compilation_files_6707", "Specify the folder for .tsbuildinfo incremental compilation files."),
+        Specify_options_for_automatic_acquisition_of_declaration_files: diag(6709, ts.DiagnosticCategory.Message, "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: diag(6710, ts.DiagnosticCategory.Message, "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: diag(6711, ts.DiagnosticCategory.Message, "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: diag(6712, ts.DiagnosticCategory.Message, "Emit_ECMAScript_standard_compliant_class_fields_6712", "Emit ECMAScript-standard-compliant class fields."),
+        Enable_verbose_logging: diag(6713, ts.DiagnosticCategory.Message, "Enable_verbose_logging_6713", "Enable verbose logging"),
+        Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality: diag(6714, ts.DiagnosticCategory.Message, "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: diag(6715, ts.DiagnosticCategory.Message, "Specify_how_the_TypeScript_watch_mode_works_6715", "Specify how the TypeScript watch mode works."),
+        Include_undefined_in_index_signature_results: diag(6716, ts.DiagnosticCategory.Message, "Include_undefined_in_index_signature_results_6716", "Include 'undefined' in index signature results"),
+        Require_undeclared_properties_from_index_signatures_to_use_element_accesses: diag(6717, ts.DiagnosticCategory.Message, "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: diag(6718, ts.DiagnosticCategory.Message, "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"),
+        Type_catch_clause_variables_as_unknown_instead_of_any: diag(6803, ts.DiagnosticCategory.Message, "Type_catch_clause_variables_as_unknown_instead_of_any_6803", "Type catch clause variables as 'unknown' instead of 'any'."),
+        one_of_Colon: diag(6900, ts.DiagnosticCategory.Message, "one_of_Colon_6900", "one of:"),
+        one_or_more_Colon: diag(6901, ts.DiagnosticCategory.Message, "one_or_more_Colon_6901", "one or more:"),
+        type_Colon: diag(6902, ts.DiagnosticCategory.Message, "type_Colon_6902", "type:"),
+        default_Colon: diag(6903, ts.DiagnosticCategory.Message, "default_Colon_6903", "default:"),
+        module_system_or_esModuleInterop: diag(6904, ts.DiagnosticCategory.Message, "module_system_or_esModuleInterop_6904", "module === \"system\" or esModuleInterop"),
+        false_unless_strict_is_set: diag(6905, ts.DiagnosticCategory.Message, "false_unless_strict_is_set_6905", "`false`, unless `strict` is set"),
+        false_unless_composite_is_set: diag(6906, ts.DiagnosticCategory.Message, "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: diag(6907, ts.DiagnosticCategory.Message, "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: diag(6908, ts.DiagnosticCategory.Message, "if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk_6908", "`[]` if `files` is specified, otherwise `[\"**/*\"]`"),
+        true_if_composite_false_otherwise: diag(6909, ts.DiagnosticCategory.Message, "true_if_composite_false_otherwise_6909", "`true` if `composite`, `false` otherwise"),
+        module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node: diag(69010, ts.DiagnosticCategory.Message, "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: diag(6911, ts.DiagnosticCategory.Message, "Computed_from_the_list_of_input_files_6911", "Computed from the list of input files"),
+        Platform_specific: diag(6912, ts.DiagnosticCategory.Message, "Platform_specific_6912", "Platform specific"),
+        You_can_learn_about_all_of_the_compiler_options_at_0: diag(6913, ts.DiagnosticCategory.Message, "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: diag(6914, ts.DiagnosticCategory.Message, "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: diag(6915, ts.DiagnosticCategory.Message, "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: diag(6916, ts.DiagnosticCategory.Message, "COMMON_COMMANDS_6916", "COMMON COMMANDS"),
+        ALL_COMPILER_OPTIONS: diag(6917, ts.DiagnosticCategory.Message, "ALL_COMPILER_OPTIONS_6917", "ALL COMPILER OPTIONS"),
+        WATCH_OPTIONS: diag(6918, ts.DiagnosticCategory.Message, "WATCH_OPTIONS_6918", "WATCH OPTIONS"),
+        BUILD_OPTIONS: diag(6919, ts.DiagnosticCategory.Message, "BUILD_OPTIONS_6919", "BUILD OPTIONS"),
+        COMMON_COMPILER_OPTIONS: diag(6920, ts.DiagnosticCategory.Message, "COMMON_COMPILER_OPTIONS_6920", "COMMON COMPILER OPTIONS"),
+        COMMAND_LINE_FLAGS: diag(6921, ts.DiagnosticCategory.Message, "COMMAND_LINE_FLAGS_6921", "COMMAND LINE FLAGS"),
+        tsc_Colon_The_TypeScript_Compiler: diag(6922, ts.DiagnosticCategory.Message, "tsc_Colon_The_TypeScript_Compiler_6922", "tsc: The TypeScript Compiler"),
+        Compiles_the_current_project_tsconfig_json_in_the_working_directory: diag(6923, ts.DiagnosticCategory.Message, "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: diag(6924, ts.DiagnosticCategory.Message, "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: diag(6925, ts.DiagnosticCategory.Message, "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: diag(6926, ts.DiagnosticCategory.Message, "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: diag(6927, ts.DiagnosticCategory.Message, "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: diag(6928, ts.DiagnosticCategory.Message, "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: diag(6929, ts.DiagnosticCategory.Message, "Compiles_the_current_project_with_additional_settings_6929", "Compiles the current project, with additional settings."),
+        true_for_ES2022_and_above_including_ESNext: diag(6930, ts.DiagnosticCategory.Message, "true_for_ES2022_and_above_including_ESNext_6930", "`true` for ES2022 and above, including ESNext."),
         Variable_0_implicitly_has_an_1_type: diag(7005, ts.DiagnosticCategory.Error, "Variable_0_implicitly_has_an_1_type_7005", "Variable '{0}' implicitly has an '{1}' type."),
         Parameter_0_implicitly_has_an_1_type: diag(7006, ts.DiagnosticCategory.Error, "Parameter_0_implicitly_has_an_1_type_7006", "Parameter '{0}' implicitly has an '{1}' type."),
         Member_0_implicitly_has_an_1_type: diag(7008, ts.DiagnosticCategory.Error, "Member_0_implicitly_has_an_1_type_7008", "Member '{0}' implicitly has an '{1}' type."),
@@ -8841,7 +9335,7 @@ var ts;
         Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for_all_imports_Implies_allowSyntheticDefaultImports: diag(7037, ts.DiagnosticCategory.Message, "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: diag(7038, ts.DiagnosticCategory.Message, "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: diag(7039, ts.DiagnosticCategory.Error, "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: diag(7040, ts.DiagnosticCategory.Error, "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}`"),
+        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: diag(7040, ts.DiagnosticCategory.Error, "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: diag(7041, ts.DiagnosticCategory.Error, "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: diag(7042, ts.DiagnosticCategory.Error, "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: diag(7043, ts.DiagnosticCategory.Suggestion, "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."),
@@ -8859,6 +9353,11 @@ var ts;
         _0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type: diag(7055, ts.DiagnosticCategory.Error, "_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: diag(7056, ts.DiagnosticCategory.Error, "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: diag(7057, ts.DiagnosticCategory.Error, "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: diag(7058, ts.DiagnosticCategory.Error, "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: diag(7059, ts.DiagnosticCategory.Error, "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: diag(7060, ts.DiagnosticCategory.Error, "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: diag(7061, ts.DiagnosticCategory.Error, "A_mapped_type_may_not_declare_properties_or_methods_7061", "A mapped type may not declare properties or methods."),
+        JSON_imports_are_experimental_in_ES_module_mode_imports: diag(7062, ts.DiagnosticCategory.Error, "JSON_imports_are_experimental_in_ES_module_mode_imports_7062", "JSON imports are experimental in ES module mode imports."),
         You_cannot_rename_this_element: diag(8000, ts.DiagnosticCategory.Error, "You_cannot_rename_this_element_8000", "You cannot rename this element."),
         You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: diag(8001, ts.DiagnosticCategory.Error, "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: diag(8002, ts.DiagnosticCategory.Error, "import_can_only_be_used_in_TypeScript_files_8002", "'import ... =' can only be used in TypeScript files."),
@@ -8881,7 +9380,7 @@ var ts;
         JSDoc_0_is_not_attached_to_a_class: diag(8022, ts.DiagnosticCategory.Error, "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: diag(8023, ts.DiagnosticCategory.Error, "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: diag(8024, ts.DiagnosticCategory.Error, "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: diag(8025, ts.DiagnosticCategory.Error, "Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025", "Class declarations cannot have more than one `@augments` or `@extends` tag."),
+        Class_declarations_cannot_have_more_than_one_augments_or_extends_tag: diag(8025, ts.DiagnosticCategory.Error, "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: diag(8026, ts.DiagnosticCategory.Error, "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: diag(8027, ts.DiagnosticCategory.Error, "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: diag(8028, ts.DiagnosticCategory.Error, "JSDoc_may_only_appear_in_the_last_parameter_of_a_signature_8028", "JSDoc '...' may only appear in the last parameter of a signature."),
@@ -8891,15 +9390,11 @@ var ts;
         Qualified_name_0_is_not_allowed_without_a_leading_param_object_1: diag(8032, ts.DiagnosticCategory.Error, "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: diag(8033, ts.DiagnosticCategory.Error, "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: diag(8034, ts.DiagnosticCategory.Error, "The_tag_was_first_specified_here_8034", "The tag was first specified here."),
-        Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_class_extends_clause: diag(9002, ts.DiagnosticCategory.Error, "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002", "Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clause."),
-        class_expressions_are_not_currently_supported: diag(9003, ts.DiagnosticCategory.Error, "class_expressions_are_not_currently_supported_9003", "'class' expressions are not currently supported."),
-        Language_service_is_disabled: diag(9004, ts.DiagnosticCategory.Error, "Language_service_is_disabled_9004", "Language service is disabled."),
         Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9005, ts.DiagnosticCategory.Error, "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: diag(9006, ts.DiagnosticCategory.Error, "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."),
         JSX_attributes_must_only_be_assigned_a_non_empty_expression: diag(17000, ts.DiagnosticCategory.Error, "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: diag(17001, ts.DiagnosticCategory.Error, "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: diag(17002, ts.DiagnosticCategory.Error, "Expected_corresponding_JSX_closing_tag_for_0_17002", "Expected corresponding JSX closing tag for '{0}'."),
-        JSX_attribute_expected: diag(17003, ts.DiagnosticCategory.Error, "JSX_attribute_expected_17003", "JSX attribute expected."),
         Cannot_use_JSX_unless_the_jsx_flag_is_provided: diag(17004, ts.DiagnosticCategory.Error, "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: diag(17005, ts.DiagnosticCategory.Error, "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: diag(17006, ts.DiagnosticCategory.Error, "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."),
@@ -8916,10 +9411,9 @@ var ts;
         An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments: diag(17017, ts.DiagnosticCategory.Error, "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: diag(17018, ts.DiagnosticCategory.Error, "Unknown_type_acquisition_option_0_Did_you_mean_1_17018", "Unknown type acquisition option '{0}'. Did you mean '{1}'?"),
         Circularity_detected_while_resolving_configuration_Colon_0: diag(18000, ts.DiagnosticCategory.Error, "Circularity_detected_while_resolving_configuration_Colon_0_18000", "Circularity detected while resolving configuration: {0}"),
-        A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not: diag(18001, ts.DiagnosticCategory.Error, "A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not_18001", "A path in an 'extends' option must be relative or rooted, but '{0}' is not."),
         The_files_list_in_config_file_0_is_empty: diag(18002, ts.DiagnosticCategory.Error, "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: diag(18003, ts.DiagnosticCategory.Error, "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_ES6_module: diag(80001, ts.DiagnosticCategory.Suggestion, "File_is_a_CommonJS_module_it_may_be_converted_to_an_ES6_module_80001", "File is a CommonJS module; it may be converted to an ES6 module."),
+        File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module: diag(80001, ts.DiagnosticCategory.Suggestion, "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: diag(80002, ts.DiagnosticCategory.Suggestion, "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: diag(80003, ts.DiagnosticCategory.Suggestion, "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: diag(80004, ts.DiagnosticCategory.Suggestion, "JSDoc_types_may_be_moved_to_TypeScript_types_80004", "JSDoc types may be moved to TypeScript types."),
@@ -8967,8 +9461,8 @@ var ts;
         Remove_unused_destructuring_declaration: diag(90039, ts.DiagnosticCategory.Message, "Remove_unused_destructuring_declaration_90039", "Remove unused destructuring declaration"),
         Remove_unused_declarations_for_Colon_0: diag(90041, ts.DiagnosticCategory.Message, "Remove_unused_declarations_for_Colon_0_90041", "Remove unused declarations for: '{0}'"),
         Declare_a_private_field_named_0: diag(90053, ts.DiagnosticCategory.Message, "Declare_a_private_field_named_0_90053", "Declare a private field named '{0}'."),
+        Includes_imports_of_types_referenced_by_0: diag(90054, ts.DiagnosticCategory.Message, "Includes_imports_of_types_referenced_by_0_90054", "Includes imports of types referenced by '{0}'"),
         Convert_function_to_an_ES2015_class: diag(95001, ts.DiagnosticCategory.Message, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"),
-        Convert_function_0_to_class: diag(95002, ts.DiagnosticCategory.Message, "Convert_function_0_to_class_95002", "Convert function '{0}' to class"),
         Convert_0_to_1_in_0: diag(95003, ts.DiagnosticCategory.Message, "Convert_0_to_1_in_0_95003", "Convert '{0}' to '{1} in {0}'"),
         Extract_to_0_in_1: diag(95004, ts.DiagnosticCategory.Message, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"),
         Extract_function: diag(95005, ts.DiagnosticCategory.Message, "Extract_function_95005", "Extract function"),
@@ -8976,14 +9470,13 @@ var ts;
         Extract_to_0_in_enclosing_scope: diag(95007, ts.DiagnosticCategory.Message, "Extract_to_0_in_enclosing_scope_95007", "Extract to {0} in enclosing scope"),
         Extract_to_0_in_1_scope: diag(95008, ts.DiagnosticCategory.Message, "Extract_to_0_in_1_scope_95008", "Extract to {0} in {1} scope"),
         Annotate_with_type_from_JSDoc: diag(95009, ts.DiagnosticCategory.Message, "Annotate_with_type_from_JSDoc_95009", "Annotate with type from JSDoc"),
-        Annotate_with_types_from_JSDoc: diag(95010, ts.DiagnosticCategory.Message, "Annotate_with_types_from_JSDoc_95010", "Annotate with types from JSDoc"),
         Infer_type_of_0_from_usage: diag(95011, ts.DiagnosticCategory.Message, "Infer_type_of_0_from_usage_95011", "Infer type of '{0}' from usage"),
         Infer_parameter_types_from_usage: diag(95012, ts.DiagnosticCategory.Message, "Infer_parameter_types_from_usage_95012", "Infer parameter types from usage"),
         Convert_to_default_import: diag(95013, ts.DiagnosticCategory.Message, "Convert_to_default_import_95013", "Convert to default import"),
         Install_0: diag(95014, ts.DiagnosticCategory.Message, "Install_0_95014", "Install '{0}'"),
         Replace_import_with_0: diag(95015, ts.DiagnosticCategory.Message, "Replace_import_with_0_95015", "Replace import with '{0}'."),
         Use_synthetic_default_member: diag(95016, ts.DiagnosticCategory.Message, "Use_synthetic_default_member_95016", "Use synthetic 'default' member."),
-        Convert_to_ES6_module: diag(95017, ts.DiagnosticCategory.Message, "Convert_to_ES6_module_95017", "Convert to ES6 module"),
+        Convert_to_ES_module: diag(95017, ts.DiagnosticCategory.Message, "Convert_to_ES_module_95017", "Convert to ES module"),
         Add_undefined_type_to_property_0: diag(95018, ts.DiagnosticCategory.Message, "Add_undefined_type_to_property_0_95018", "Add 'undefined' type to property '{0}'"),
         Add_initializer_to_property_0: diag(95019, ts.DiagnosticCategory.Message, "Add_initializer_to_property_0_95019", "Add initializer to property '{0}'"),
         Add_definite_assignment_assertion_to_property_0: diag(95020, ts.DiagnosticCategory.Message, "Add_definite_assignment_assertion_to_property_0_95020", "Add definite assignment assertion to property '{0}'"),
@@ -9042,7 +9535,6 @@ var ts;
         Add_names_to_all_parameters_without_names: diag(95073, ts.DiagnosticCategory.Message, "Add_names_to_all_parameters_without_names_95073", "Add names to all parameters without names"),
         Enable_the_experimentalDecorators_option_in_your_configuration_file: diag(95074, ts.DiagnosticCategory.Message, "Enable_the_experimentalDecorators_option_in_your_configuration_file_95074", "Enable the 'experimentalDecorators' option in your configuration file"),
         Convert_parameters_to_destructured_object: diag(95075, ts.DiagnosticCategory.Message, "Convert_parameters_to_destructured_object_95075", "Convert parameters to destructured object"),
-        Allow_accessing_UMD_globals_from_modules: diag(95076, ts.DiagnosticCategory.Message, "Allow_accessing_UMD_globals_from_modules_95076", "Allow accessing UMD globals from modules."),
         Extract_type: diag(95077, ts.DiagnosticCategory.Message, "Extract_type_95077", "Extract type"),
         Extract_to_type_alias: diag(95078, ts.DiagnosticCategory.Message, "Extract_to_type_alias_95078", "Extract to type alias"),
         Extract_to_typedef: diag(95079, ts.DiagnosticCategory.Message, "Extract_to_typedef_95079", "Extract to typedef"),
@@ -9068,9 +9560,6 @@ var ts;
         Set_the_module_option_in_your_configuration_file_to_0: diag(95099, ts.DiagnosticCategory.Message, "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: diag(95100, ts.DiagnosticCategory.Message, "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: diag(95101, ts.DiagnosticCategory.Message, "Convert_all_invalid_characters_to_HTML_entity_code_95101", "Convert all invalid characters to HTML entity code"),
-        Add_class_tag: diag(95102, ts.DiagnosticCategory.Message, "Add_class_tag_95102", "Add '@class' tag"),
-        Add_this_tag: diag(95103, ts.DiagnosticCategory.Message, "Add_this_tag_95103", "Add '@this' tag"),
-        Add_this_parameter: diag(95104, ts.DiagnosticCategory.Message, "Add_this_parameter_95104", "Add 'this' parameter."),
         Convert_function_expression_0_to_arrow_function: diag(95105, ts.DiagnosticCategory.Message, "Convert_function_expression_0_to_arrow_function_95105", "Convert function expression '{0}' to arrow function"),
         Convert_function_declaration_0_to_arrow_function: diag(95106, ts.DiagnosticCategory.Message, "Convert_function_declaration_0_to_arrow_function_95106", "Convert function declaration '{0}' to arrow function"),
         Fix_all_implicit_this_errors: diag(95107, ts.DiagnosticCategory.Message, "Fix_all_implicit_this_errors_95107", "Fix all implicit-'this' errors"),
@@ -9126,6 +9615,16 @@ var ts;
         Add_all_missing_function_declarations: diag(95157, ts.DiagnosticCategory.Message, "Add_all_missing_function_declarations_95157", "Add all missing function declarations"),
         Method_not_implemented: diag(95158, ts.DiagnosticCategory.Message, "Method_not_implemented_95158", "Method not implemented."),
         Function_not_implemented: diag(95159, ts.DiagnosticCategory.Message, "Function_not_implemented_95159", "Function not implemented."),
+        Add_override_modifier: diag(95160, ts.DiagnosticCategory.Message, "Add_override_modifier_95160", "Add 'override' modifier"),
+        Remove_override_modifier: diag(95161, ts.DiagnosticCategory.Message, "Remove_override_modifier_95161", "Remove 'override' modifier"),
+        Add_all_missing_override_modifiers: diag(95162, ts.DiagnosticCategory.Message, "Add_all_missing_override_modifiers_95162", "Add all missing 'override' modifiers"),
+        Remove_all_unnecessary_override_modifiers: diag(95163, ts.DiagnosticCategory.Message, "Remove_all_unnecessary_override_modifiers_95163", "Remove all unnecessary 'override' modifiers"),
+        Can_only_convert_named_export: diag(95164, ts.DiagnosticCategory.Message, "Can_only_convert_named_export_95164", "Can only convert named export"),
+        Add_missing_properties: diag(95165, ts.DiagnosticCategory.Message, "Add_missing_properties_95165", "Add missing properties"),
+        Add_all_missing_properties: diag(95166, ts.DiagnosticCategory.Message, "Add_all_missing_properties_95166", "Add all missing properties"),
+        Add_missing_attributes: diag(95167, ts.DiagnosticCategory.Message, "Add_missing_attributes_95167", "Add missing attributes"),
+        Add_all_missing_attributes: diag(95168, ts.DiagnosticCategory.Message, "Add_all_missing_attributes_95168", "Add all missing attributes"),
+        Add_undefined_to_optional_property_type: diag(95169, ts.DiagnosticCategory.Message, "Add_undefined_to_optional_property_type_95169", "Add 'undefined' to optional property type"),
         No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer: diag(18004, ts.DiagnosticCategory.Error, "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: diag(18006, ts.DiagnosticCategory.Error, "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: diag(18007, ts.DiagnosticCategory.Error, "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?"),
@@ -9140,8 +9639,6 @@ var ts;
         The_shadowing_declaration_of_0_is_defined_here: diag(18017, ts.DiagnosticCategory.Error, "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: diag(18018, ts.DiagnosticCategory.Error, "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: diag(18019, ts.DiagnosticCategory.Error, "_0_modifier_cannot_be_used_with_a_private_identifier_18019", "'{0}' modifier cannot be used with a private identifier."),
-        A_method_cannot_be_named_with_a_private_identifier: diag(18022, ts.DiagnosticCategory.Error, "A_method_cannot_be_named_with_a_private_identifier_18022", "A method cannot be named with a private identifier."),
-        An_accessor_cannot_be_named_with_a_private_identifier: diag(18023, ts.DiagnosticCategory.Error, "An_accessor_cannot_be_named_with_a_private_identifier_18023", "An accessor cannot be named with a private identifier."),
         An_enum_member_cannot_be_named_with_a_private_identifier: diag(18024, ts.DiagnosticCategory.Error, "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: diag(18026, ts.DiagnosticCategory.Error, "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: diag(18027, ts.DiagnosticCategory.Error, "Compiler_reserves_name_0_when_emitting_private_identifier_downlevel_18027", "Compiler reserves name '{0}' when emitting private identifier downlevel."),
@@ -9153,6 +9650,11 @@ var ts;
         Only_numeric_enums_can_have_computed_members_but_this_expression_has_type_0_If_you_do_not_need_exhaustiveness_checks_consider_using_an_object_literal_instead: diag(18033, ts.DiagnosticCategory.Error, "Only_numeric_enums_can_have_computed_members_but_this_expression_has_type_0_If_you_do_not_need_exhau_18033", "Only numeric enums can have computed members, but this expression has type '{0}'. If you do not need exhaustiveness checks, consider using an object literal instead."),
         Specify_the_JSX_fragment_factory_function_to_use_when_targeting_react_JSX_emit_with_jsxFactory_compiler_option_is_specified_e_g_Fragment: diag(18034, ts.DiagnosticCategory.Message, "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: diag(18035, ts.DiagnosticCategory.Error, "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: diag(18036, ts.DiagnosticCategory.Error, "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: diag(18037, ts.DiagnosticCategory.Error, "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: diag(18038, ts.DiagnosticCategory.Error, "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: diag(18039, ts.DiagnosticCategory.Error, "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: diag(18041, ts.DiagnosticCategory.Error, "A_return_statement_cannot_be_used_inside_a_class_static_block_18041", "A 'return' statement cannot be used inside a class static block."),
     };
 })(ts || (ts = {}));
 var ts;
@@ -9160,7 +9662,7 @@ var ts;
     var _a;
     /* @internal */
     function tokenIsIdentifierOrKeyword(token) {
-        return token >= 78 /* Identifier */;
+        return token >= 79 /* Identifier */;
     }
     ts.tokenIsIdentifierOrKeyword = tokenIsIdentifierOrKeyword;
     /* @internal */
@@ -9168,88 +9670,91 @@ var ts;
         return token === 31 /* GreaterThanToken */ || tokenIsIdentifierOrKeyword(token);
     }
     ts.tokenIsIdentifierOrKeywordOrGreaterThan = tokenIsIdentifierOrKeywordOrGreaterThan;
-    var textToKeywordObj = (_a = {
-            abstract: 125 /* AbstractKeyword */,
-            any: 128 /* AnyKeyword */,
-            as: 126 /* AsKeyword */,
-            asserts: 127 /* AssertsKeyword */,
-            bigint: 155 /* BigIntKeyword */,
-            boolean: 131 /* BooleanKeyword */,
-            break: 80 /* BreakKeyword */,
-            case: 81 /* CaseKeyword */,
-            catch: 82 /* CatchKeyword */,
-            class: 83 /* ClassKeyword */,
-            continue: 85 /* ContinueKeyword */,
-            const: 84 /* ConstKeyword */
+    /** @internal */
+    ts.textToKeywordObj = (_a = {
+            abstract: 126 /* AbstractKeyword */,
+            any: 130 /* AnyKeyword */,
+            as: 127 /* AsKeyword */,
+            asserts: 128 /* AssertsKeyword */,
+            assert: 129 /* AssertKeyword */,
+            bigint: 157 /* BigIntKeyword */,
+            boolean: 133 /* BooleanKeyword */,
+            break: 81 /* BreakKeyword */,
+            case: 82 /* CaseKeyword */,
+            catch: 83 /* CatchKeyword */,
+            class: 84 /* ClassKeyword */,
+            continue: 86 /* ContinueKeyword */,
+            const: 85 /* ConstKeyword */
         },
-        _a["" + "constructor"] = 132 /* ConstructorKeyword */,
-        _a.debugger = 86 /* DebuggerKeyword */,
-        _a.declare = 133 /* DeclareKeyword */,
-        _a.default = 87 /* DefaultKeyword */,
-        _a.delete = 88 /* DeleteKeyword */,
-        _a.do = 89 /* DoKeyword */,
-        _a.else = 90 /* ElseKeyword */,
-        _a.enum = 91 /* EnumKeyword */,
-        _a.export = 92 /* ExportKeyword */,
-        _a.extends = 93 /* ExtendsKeyword */,
-        _a.false = 94 /* FalseKeyword */,
-        _a.finally = 95 /* FinallyKeyword */,
-        _a.for = 96 /* ForKeyword */,
-        _a.from = 153 /* FromKeyword */,
-        _a.function = 97 /* FunctionKeyword */,
-        _a.get = 134 /* GetKeyword */,
-        _a.if = 98 /* IfKeyword */,
-        _a.implements = 116 /* ImplementsKeyword */,
-        _a.import = 99 /* ImportKeyword */,
-        _a.in = 100 /* InKeyword */,
-        _a.infer = 135 /* InferKeyword */,
-        _a.instanceof = 101 /* InstanceOfKeyword */,
-        _a.interface = 117 /* InterfaceKeyword */,
-        _a.intrinsic = 136 /* IntrinsicKeyword */,
-        _a.is = 137 /* IsKeyword */,
-        _a.keyof = 138 /* KeyOfKeyword */,
-        _a.let = 118 /* LetKeyword */,
-        _a.module = 139 /* ModuleKeyword */,
-        _a.namespace = 140 /* NamespaceKeyword */,
-        _a.never = 141 /* NeverKeyword */,
-        _a.new = 102 /* NewKeyword */,
-        _a.null = 103 /* NullKeyword */,
-        _a.number = 144 /* NumberKeyword */,
-        _a.object = 145 /* ObjectKeyword */,
-        _a.package = 119 /* PackageKeyword */,
-        _a.private = 120 /* PrivateKeyword */,
-        _a.protected = 121 /* ProtectedKeyword */,
-        _a.public = 122 /* PublicKeyword */,
-        _a.readonly = 142 /* ReadonlyKeyword */,
-        _a.require = 143 /* RequireKeyword */,
-        _a.global = 154 /* GlobalKeyword */,
-        _a.return = 104 /* ReturnKeyword */,
-        _a.set = 146 /* SetKeyword */,
-        _a.static = 123 /* StaticKeyword */,
-        _a.string = 147 /* StringKeyword */,
-        _a.super = 105 /* SuperKeyword */,
-        _a.switch = 106 /* SwitchKeyword */,
-        _a.symbol = 148 /* SymbolKeyword */,
-        _a.this = 107 /* ThisKeyword */,
-        _a.throw = 108 /* ThrowKeyword */,
-        _a.true = 109 /* TrueKeyword */,
-        _a.try = 110 /* TryKeyword */,
-        _a.type = 149 /* TypeKeyword */,
-        _a.typeof = 111 /* TypeOfKeyword */,
-        _a.undefined = 150 /* UndefinedKeyword */,
-        _a.unique = 151 /* UniqueKeyword */,
-        _a.unknown = 152 /* UnknownKeyword */,
-        _a.var = 112 /* VarKeyword */,
-        _a.void = 113 /* VoidKeyword */,
-        _a.while = 114 /* WhileKeyword */,
-        _a.with = 115 /* WithKeyword */,
-        _a.yield = 124 /* YieldKeyword */,
-        _a.async = 129 /* AsyncKeyword */,
-        _a.await = 130 /* AwaitKeyword */,
-        _a.of = 156 /* OfKeyword */,
+        _a["" + "constructor"] = 134 /* ConstructorKeyword */,
+        _a.debugger = 87 /* DebuggerKeyword */,
+        _a.declare = 135 /* DeclareKeyword */,
+        _a.default = 88 /* DefaultKeyword */,
+        _a.delete = 89 /* DeleteKeyword */,
+        _a.do = 90 /* DoKeyword */,
+        _a.else = 91 /* ElseKeyword */,
+        _a.enum = 92 /* EnumKeyword */,
+        _a.export = 93 /* ExportKeyword */,
+        _a.extends = 94 /* ExtendsKeyword */,
+        _a.false = 95 /* FalseKeyword */,
+        _a.finally = 96 /* FinallyKeyword */,
+        _a.for = 97 /* ForKeyword */,
+        _a.from = 155 /* FromKeyword */,
+        _a.function = 98 /* FunctionKeyword */,
+        _a.get = 136 /* GetKeyword */,
+        _a.if = 99 /* IfKeyword */,
+        _a.implements = 117 /* ImplementsKeyword */,
+        _a.import = 100 /* ImportKeyword */,
+        _a.in = 101 /* InKeyword */,
+        _a.infer = 137 /* InferKeyword */,
+        _a.instanceof = 102 /* InstanceOfKeyword */,
+        _a.interface = 118 /* InterfaceKeyword */,
+        _a.intrinsic = 138 /* IntrinsicKeyword */,
+        _a.is = 139 /* IsKeyword */,
+        _a.keyof = 140 /* KeyOfKeyword */,
+        _a.let = 119 /* LetKeyword */,
+        _a.module = 141 /* ModuleKeyword */,
+        _a.namespace = 142 /* NamespaceKeyword */,
+        _a.never = 143 /* NeverKeyword */,
+        _a.new = 103 /* NewKeyword */,
+        _a.null = 104 /* NullKeyword */,
+        _a.number = 146 /* NumberKeyword */,
+        _a.object = 147 /* ObjectKeyword */,
+        _a.package = 120 /* PackageKeyword */,
+        _a.private = 121 /* PrivateKeyword */,
+        _a.protected = 122 /* ProtectedKeyword */,
+        _a.public = 123 /* PublicKeyword */,
+        _a.override = 158 /* OverrideKeyword */,
+        _a.readonly = 144 /* ReadonlyKeyword */,
+        _a.require = 145 /* RequireKeyword */,
+        _a.global = 156 /* GlobalKeyword */,
+        _a.return = 105 /* ReturnKeyword */,
+        _a.set = 148 /* SetKeyword */,
+        _a.static = 124 /* StaticKeyword */,
+        _a.string = 149 /* StringKeyword */,
+        _a.super = 106 /* SuperKeyword */,
+        _a.switch = 107 /* SwitchKeyword */,
+        _a.symbol = 150 /* SymbolKeyword */,
+        _a.this = 108 /* ThisKeyword */,
+        _a.throw = 109 /* ThrowKeyword */,
+        _a.true = 110 /* TrueKeyword */,
+        _a.try = 111 /* TryKeyword */,
+        _a.type = 151 /* TypeKeyword */,
+        _a.typeof = 112 /* TypeOfKeyword */,
+        _a.undefined = 152 /* UndefinedKeyword */,
+        _a.unique = 153 /* UniqueKeyword */,
+        _a.unknown = 154 /* UnknownKeyword */,
+        _a.var = 113 /* VarKeyword */,
+        _a.void = 114 /* VoidKeyword */,
+        _a.while = 115 /* WhileKeyword */,
+        _a.with = 116 /* WithKeyword */,
+        _a.yield = 125 /* YieldKeyword */,
+        _a.async = 131 /* AsyncKeyword */,
+        _a.await = 132 /* AwaitKeyword */,
+        _a.of = 159 /* OfKeyword */,
         _a);
-    var textToKeyword = new ts.Map(ts.getEntries(textToKeywordObj));
-    var textToToken = new ts.Map(ts.getEntries(__assign(__assign({}, textToKeywordObj), { "{": 18 /* OpenBraceToken */, "}": 19 /* CloseBraceToken */, "(": 20 /* OpenParenToken */, ")": 21 /* CloseParenToken */, "[": 22 /* OpenBracketToken */, "]": 23 /* CloseBracketToken */, ".": 24 /* DotToken */, "...": 25 /* DotDotDotToken */, ";": 26 /* SemicolonToken */, ",": 27 /* CommaToken */, "<": 29 /* LessThanToken */, ">": 31 /* GreaterThanToken */, "<=": 32 /* LessThanEqualsToken */, ">=": 33 /* GreaterThanEqualsToken */, "==": 34 /* EqualsEqualsToken */, "!=": 35 /* ExclamationEqualsToken */, "===": 36 /* EqualsEqualsEqualsToken */, "!==": 37 /* ExclamationEqualsEqualsToken */, "=>": 38 /* EqualsGreaterThanToken */, "+": 39 /* PlusToken */, "-": 40 /* MinusToken */, "**": 42 /* AsteriskAsteriskToken */, "*": 41 /* AsteriskToken */, "/": 43 /* SlashToken */, "%": 44 /* PercentToken */, "++": 45 /* PlusPlusToken */, "--": 46 /* MinusMinusToken */, "<<": 47 /* LessThanLessThanToken */, "</": 30 /* LessThanSlashToken */, ">>": 48 /* GreaterThanGreaterThanToken */, ">>>": 49 /* GreaterThanGreaterThanGreaterThanToken */, "&": 50 /* AmpersandToken */, "|": 51 /* BarToken */, "^": 52 /* CaretToken */, "!": 53 /* ExclamationToken */, "~": 54 /* TildeToken */, "&&": 55 /* AmpersandAmpersandToken */, "||": 56 /* BarBarToken */, "?": 57 /* QuestionToken */, "??": 60 /* QuestionQuestionToken */, "?.": 28 /* QuestionDotToken */, ":": 58 /* ColonToken */, "=": 62 /* EqualsToken */, "+=": 63 /* PlusEqualsToken */, "-=": 64 /* MinusEqualsToken */, "*=": 65 /* AsteriskEqualsToken */, "**=": 66 /* AsteriskAsteriskEqualsToken */, "/=": 67 /* SlashEqualsToken */, "%=": 68 /* PercentEqualsToken */, "<<=": 69 /* LessThanLessThanEqualsToken */, ">>=": 70 /* GreaterThanGreaterThanEqualsToken */, ">>>=": 71 /* GreaterThanGreaterThanGreaterThanEqualsToken */, "&=": 72 /* AmpersandEqualsToken */, "|=": 73 /* BarEqualsToken */, "^=": 77 /* CaretEqualsToken */, "||=": 74 /* BarBarEqualsToken */, "&&=": 75 /* AmpersandAmpersandEqualsToken */, "??=": 76 /* QuestionQuestionEqualsToken */, "@": 59 /* AtToken */, "`": 61 /* BacktickToken */ })));
+    var textToKeyword = new ts.Map(ts.getEntries(ts.textToKeywordObj));
+    var textToToken = new ts.Map(ts.getEntries(__assign(__assign({}, ts.textToKeywordObj), { "{": 18 /* OpenBraceToken */, "}": 19 /* CloseBraceToken */, "(": 20 /* OpenParenToken */, ")": 21 /* CloseParenToken */, "[": 22 /* OpenBracketToken */, "]": 23 /* CloseBracketToken */, ".": 24 /* DotToken */, "...": 25 /* DotDotDotToken */, ";": 26 /* SemicolonToken */, ",": 27 /* CommaToken */, "<": 29 /* LessThanToken */, ">": 31 /* GreaterThanToken */, "<=": 32 /* LessThanEqualsToken */, ">=": 33 /* GreaterThanEqualsToken */, "==": 34 /* EqualsEqualsToken */, "!=": 35 /* ExclamationEqualsToken */, "===": 36 /* EqualsEqualsEqualsToken */, "!==": 37 /* ExclamationEqualsEqualsToken */, "=>": 38 /* EqualsGreaterThanToken */, "+": 39 /* PlusToken */, "-": 40 /* MinusToken */, "**": 42 /* AsteriskAsteriskToken */, "*": 41 /* AsteriskToken */, "/": 43 /* SlashToken */, "%": 44 /* PercentToken */, "++": 45 /* PlusPlusToken */, "--": 46 /* MinusMinusToken */, "<<": 47 /* LessThanLessThanToken */, "</": 30 /* LessThanSlashToken */, ">>": 48 /* GreaterThanGreaterThanToken */, ">>>": 49 /* GreaterThanGreaterThanGreaterThanToken */, "&": 50 /* AmpersandToken */, "|": 51 /* BarToken */, "^": 52 /* CaretToken */, "!": 53 /* ExclamationToken */, "~": 54 /* TildeToken */, "&&": 55 /* AmpersandAmpersandToken */, "||": 56 /* BarBarToken */, "?": 57 /* QuestionToken */, "??": 60 /* QuestionQuestionToken */, "?.": 28 /* QuestionDotToken */, ":": 58 /* ColonToken */, "=": 63 /* EqualsToken */, "+=": 64 /* PlusEqualsToken */, "-=": 65 /* MinusEqualsToken */, "*=": 66 /* AsteriskEqualsToken */, "**=": 67 /* AsteriskAsteriskEqualsToken */, "/=": 68 /* SlashEqualsToken */, "%=": 69 /* PercentEqualsToken */, "<<=": 70 /* LessThanLessThanEqualsToken */, ">>=": 71 /* GreaterThanGreaterThanEqualsToken */, ">>>=": 72 /* GreaterThanGreaterThanGreaterThanEqualsToken */, "&=": 73 /* AmpersandEqualsToken */, "|=": 74 /* BarEqualsToken */, "^=": 78 /* CaretEqualsToken */, "||=": 75 /* BarBarEqualsToken */, "&&=": 76 /* AmpersandAmpersandEqualsToken */, "??=": 77 /* QuestionQuestionEqualsToken */, "@": 59 /* AtToken */, "#": 62 /* HashToken */, "`": 61 /* BacktickToken */ })));
     /*
         As per ECMAScript Language Specification 3th Edition, Section 7.6: Identifiers
         IdentifierStart ::
@@ -9305,13 +9810,13 @@ var ts;
     var unicodeESNextIdentifierStart = [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, 2208, 2228, 2230, 2237, 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, 3168, 3169, 3200, 3200, 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, 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, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, 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, 6987, 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, 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, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12443, 12447, 12449, 12538, 12540, 12543, 12549, 12591, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40943, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42653, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42943, 42946, 42950, 42999, 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, 43879, 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, 67072, 67382, 67392, 67413, 67424, 67431, 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, 69376, 69404, 69415, 69415, 69424, 69445, 69600, 69622, 69635, 69687, 69763, 69807, 69840, 69864, 69891, 69926, 69956, 69956, 69968, 70002, 70006, 70006, 70019, 70066, 70081, 70084, 70106, 70106, 70108, 70108, 70144, 70161, 70163, 70187, 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, 70751, 70784, 70831, 70852, 70853, 70855, 70855, 71040, 71086, 71128, 71131, 71168, 71215, 71236, 71236, 71296, 71338, 71352, 71352, 71424, 71450, 71680, 71723, 71840, 71903, 71935, 71935, 72096, 72103, 72106, 72144, 72161, 72161, 72163, 72163, 72192, 72192, 72203, 72242, 72250, 72250, 72272, 72272, 72284, 72329, 72349, 72349, 72384, 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, 73728, 74649, 74752, 74862, 74880, 75075, 77824, 78894, 82944, 83526, 92160, 92728, 92736, 92766, 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, 101106, 110592, 110878, 110928, 110930, 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, 123136, 123180, 123191, 123197, 123214, 123214, 123584, 123627, 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, 173782, 173824, 177972, 177984, 178205, 178208, 183969, 183984, 191456, 194560, 195101];
     var unicodeESNextIdentifierPart = [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, 2208, 2228, 2230, 2237, 2259, 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, 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, 3072, 3084, 3086, 3088, 3090, 3112, 3114, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3162, 3168, 3171, 3174, 3183, 3200, 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, 3328, 3331, 3333, 3340, 3342, 3344, 3346, 3396, 3398, 3400, 3402, 3406, 3412, 3415, 3423, 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, 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, 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, 4969, 4977, 4992, 5007, 5024, 5109, 5112, 5117, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5880, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 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, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7296, 7304, 7312, 7354, 7357, 7359, 7376, 7378, 7380, 7418, 7424, 7673, 7675, 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, 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, 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, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12447, 12449, 12538, 12540, 12543, 12549, 12591, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40943, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42737, 42775, 42783, 42786, 42888, 42891, 42943, 42946, 42950, 42999, 43047, 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, 43879, 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, 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, 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, 67072, 67382, 67392, 67413, 67424, 67431, 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, 69376, 69404, 69415, 69415, 69424, 69456, 69600, 69622, 69632, 69702, 69734, 69743, 69759, 69818, 69840, 69864, 69872, 69881, 69888, 69940, 69942, 69951, 69956, 69958, 69968, 70003, 70006, 70006, 70016, 70084, 70089, 70092, 70096, 70106, 70108, 70108, 70144, 70161, 70163, 70199, 70206, 70206, 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, 70751, 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, 71680, 71738, 71840, 71913, 71935, 71935, 72096, 72103, 72106, 72151, 72154, 72161, 72163, 72164, 72192, 72254, 72263, 72263, 72272, 72345, 72349, 72349, 72384, 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, 73728, 74649, 74752, 74862, 74880, 75075, 77824, 78894, 82944, 83526, 92160, 92728, 92736, 92766, 92768, 92777, 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, 94179, 94208, 100343, 100352, 101106, 110592, 110878, 110928, 110930, 110948, 110951, 110960, 111355, 113664, 113770, 113776, 113788, 113792, 113800, 113808, 113817, 113821, 113822, 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, 122880, 122886, 122888, 122904, 122907, 122913, 122915, 122916, 122918, 122922, 123136, 123180, 123184, 123197, 123200, 123209, 123214, 123214, 123584, 123641, 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, 131072, 173782, 173824, 177972, 177984, 178205, 178208, 183969, 183984, 191456, 194560, 195101, 917760, 917999];
     /**
-     * Test for whether a single line comment's text contains a directive.
+     * Test for whether a single line comment with leading whitespace trimmed's text contains a directive.
      */
-    var commentDirectiveRegExSingleLine = /^\s*\/\/\/?\s*@(ts-expect-error|ts-ignore)/;
+    var commentDirectiveRegExSingleLine = /^\/\/\/?\s*@(ts-expect-error|ts-ignore)/;
     /**
-     * Test for whether a multi-line comment's last line contains a directive.
+     * Test for whether a multi-line comment with leading whitespace trimmed's last line contains a directive.
      */
-    var commentDirectiveRegExMultiLine = /^\s*(?:\/|\*)*\s*@(ts-expect-error|ts-ignore)/;
+    var commentDirectiveRegExMultiLine = /^(?:\/|\*)*\s*@(ts-expect-error|ts-ignore)/;
     function lookupInUnicodeMap(code, map) {
         // Bail out quickly if it couldn't possibly be in the map.
         if (code < map[0]) {
@@ -9411,7 +9916,7 @@ var ts;
                 line = line < 0 ? 0 : line >= lineStarts.length ? lineStarts.length - 1 : line;
             }
             else {
-                ts.Debug.fail("Bad line number. Line: " + line + ", lineStarts.length: " + lineStarts.length + " , line map is correct? " + (debugText !== undefined ? ts.arraysEqual(lineStarts, computeLineStarts(debugText)) : "unknown"));
+                ts.Debug.fail("Bad line number. Line: ".concat(line, ", lineStarts.length: ").concat(lineStarts.length, " , line map is correct? ").concat(debugText !== undefined ? ts.arraysEqual(lineStarts, computeLineStarts(debugText)) : "unknown"));
             }
         }
         var res = lineStarts[line] + character;
@@ -9562,11 +10067,11 @@ var ts;
     }
     ts.couldStartTrivia = couldStartTrivia;
     /* @internal */
-    function skipTrivia(text, pos, stopAfterLineBreak, stopAtComments) {
-        if (stopAtComments === void 0) { stopAtComments = false; }
+    function skipTrivia(text, pos, stopAfterLineBreak, stopAtComments, inJSDoc) {
         if (ts.positionIsSynthesized(pos)) {
             return pos;
         }
+        var canConsumeStar = false;
         // Keep in sync with couldStartTrivia
         while (true) {
             var ch = text.charCodeAt(pos);
@@ -9581,6 +10086,7 @@ var ts;
                     if (stopAfterLineBreak) {
                         return pos;
                     }
+                    canConsumeStar = !!inJSDoc;
                     continue;
                 case 9 /* tab */:
                 case 11 /* verticalTab */:
@@ -9600,6 +10106,7 @@ var ts;
                             }
                             pos++;
                         }
+                        canConsumeStar = false;
                         continue;
                     }
                     if (text.charCodeAt(pos + 1) === 42 /* asterisk */) {
@@ -9611,6 +10118,7 @@ var ts;
                             }
                             pos++;
                         }
+                        canConsumeStar = false;
                         continue;
                     }
                     break;
@@ -9620,12 +10128,21 @@ var ts;
                 case 62 /* greaterThan */:
                     if (isConflictMarkerTrivia(text, pos)) {
                         pos = scanConflictMarkerTrivia(text, pos);
+                        canConsumeStar = false;
                         continue;
                     }
                     break;
                 case 35 /* hash */:
                     if (pos === 0 && isShebangTrivia(text, pos)) {
                         pos = scanShebangTrivia(text, pos);
+                        canConsumeStar = false;
+                        continue;
+                    }
+                    break;
+                case 42 /* asterisk */:
+                    if (canConsumeStar) {
+                        pos++;
+                        canConsumeStar = false;
                         continue;
                     }
                     break;
@@ -9913,8 +10430,8 @@ var ts;
             hasExtendedUnicodeEscape: function () { return (tokenFlags & 8 /* ExtendedUnicodeEscape */) !== 0; },
             hasPrecedingLineBreak: function () { return (tokenFlags & 1 /* PrecedingLineBreak */) !== 0; },
             hasPrecedingJSDocComment: function () { return (tokenFlags & 2 /* PrecedingJSDocComment */) !== 0; },
-            isIdentifier: function () { return token === 78 /* Identifier */ || token > 115 /* LastReservedWord */; },
-            isReservedWord: function () { return token >= 80 /* FirstReservedWord */ && token <= 115 /* LastReservedWord */; },
+            isIdentifier: function () { return token === 79 /* Identifier */ || token > 116 /* LastReservedWord */; },
+            isReservedWord: function () { return token >= 81 /* FirstReservedWord */ && token <= 116 /* LastReservedWord */; },
             isUnterminated: function () { return (tokenFlags & 4 /* Unterminated */) !== 0; },
             getCommentDirectives: function () { return commentDirectives; },
             getNumericLiteralFlags: function () { return tokenFlags & 1008 /* NumericLiteralFlags */; },
@@ -9929,6 +10446,7 @@ var ts;
             reScanJsxAttributeValue: reScanJsxAttributeValue,
             reScanJsxToken: reScanJsxToken,
             reScanLessThanToken: reScanLessThanToken,
+            reScanHashToken: reScanHashToken,
             reScanQuestionToken: reScanQuestionToken,
             reScanInvalidIdentifier: reScanInvalidIdentifier,
             scanJsxToken: scanJsxToken,
@@ -10439,7 +10957,7 @@ var ts;
                     }
                 }
             }
-            return token = 78 /* Identifier */;
+            return token = 79 /* Identifier */;
         }
         function scanBinaryOrOctalDigits(base) {
             var value = "";
@@ -10588,19 +11106,19 @@ var ts;
                         return token = scanTemplateAndSetTokenValue(/* isTaggedTemplate */ false);
                     case 37 /* percent */:
                         if (text.charCodeAt(pos + 1) === 61 /* equals */) {
-                            return pos += 2, token = 68 /* PercentEqualsToken */;
+                            return pos += 2, token = 69 /* PercentEqualsToken */;
                         }
                         pos++;
                         return token = 44 /* PercentToken */;
                     case 38 /* ampersand */:
                         if (text.charCodeAt(pos + 1) === 38 /* ampersand */) {
                             if (text.charCodeAt(pos + 2) === 61 /* equals */) {
-                                return pos += 3, token = 75 /* AmpersandAmpersandEqualsToken */;
+                                return pos += 3, token = 76 /* AmpersandAmpersandEqualsToken */;
                             }
                             return pos += 2, token = 55 /* AmpersandAmpersandToken */;
                         }
                         if (text.charCodeAt(pos + 1) === 61 /* equals */) {
-                            return pos += 2, token = 72 /* AmpersandEqualsToken */;
+                            return pos += 2, token = 73 /* AmpersandEqualsToken */;
                         }
                         pos++;
                         return token = 50 /* AmpersandToken */;
@@ -10612,11 +11130,11 @@ var ts;
                         return token = 21 /* CloseParenToken */;
                     case 42 /* asterisk */:
                         if (text.charCodeAt(pos + 1) === 61 /* equals */) {
-                            return pos += 2, token = 65 /* AsteriskEqualsToken */;
+                            return pos += 2, token = 66 /* AsteriskEqualsToken */;
                         }
                         if (text.charCodeAt(pos + 1) === 42 /* asterisk */) {
                             if (text.charCodeAt(pos + 2) === 61 /* equals */) {
-                                return pos += 3, token = 66 /* AsteriskAsteriskEqualsToken */;
+                                return pos += 3, token = 67 /* AsteriskAsteriskEqualsToken */;
                             }
                             return pos += 2, token = 42 /* AsteriskAsteriskToken */;
                         }
@@ -10632,7 +11150,7 @@ var ts;
                             return pos += 2, token = 45 /* PlusPlusToken */;
                         }
                         if (text.charCodeAt(pos + 1) === 61 /* equals */) {
-                            return pos += 2, token = 63 /* PlusEqualsToken */;
+                            return pos += 2, token = 64 /* PlusEqualsToken */;
                         }
                         pos++;
                         return token = 39 /* PlusToken */;
@@ -10644,7 +11162,7 @@ var ts;
                             return pos += 2, token = 46 /* MinusMinusToken */;
                         }
                         if (text.charCodeAt(pos + 1) === 61 /* equals */) {
-                            return pos += 2, token = 64 /* MinusEqualsToken */;
+                            return pos += 2, token = 65 /* MinusEqualsToken */;
                         }
                         pos++;
                         return token = 40 /* MinusToken */;
@@ -10712,7 +11230,7 @@ var ts;
                             }
                         }
                         if (text.charCodeAt(pos + 1) === 61 /* equals */) {
-                            return pos += 2, token = 67 /* SlashEqualsToken */;
+                            return pos += 2, token = 68 /* SlashEqualsToken */;
                         }
                         pos++;
                         return token = 43 /* SlashToken */;
@@ -10789,7 +11307,7 @@ var ts;
                         }
                         if (text.charCodeAt(pos + 1) === 60 /* lessThan */) {
                             if (text.charCodeAt(pos + 2) === 61 /* equals */) {
-                                return pos += 3, token = 69 /* LessThanLessThanEqualsToken */;
+                                return pos += 3, token = 70 /* LessThanLessThanEqualsToken */;
                             }
                             return pos += 2, token = 47 /* LessThanLessThanToken */;
                         }
@@ -10823,7 +11341,7 @@ var ts;
                             return pos += 2, token = 38 /* EqualsGreaterThanToken */;
                         }
                         pos++;
-                        return token = 62 /* EqualsToken */;
+                        return token = 63 /* EqualsToken */;
                     case 62 /* greaterThan */:
                         if (isConflictMarkerTrivia(text, pos)) {
                             pos = scanConflictMarkerTrivia(text, pos, error);
@@ -10842,7 +11360,7 @@ var ts;
                         }
                         if (text.charCodeAt(pos + 1) === 63 /* question */) {
                             if (text.charCodeAt(pos + 2) === 61 /* equals */) {
-                                return pos += 3, token = 76 /* QuestionQuestionEqualsToken */;
+                                return pos += 3, token = 77 /* QuestionQuestionEqualsToken */;
                             }
                             return pos += 2, token = 60 /* QuestionQuestionToken */;
                         }
@@ -10856,7 +11374,7 @@ var ts;
                         return token = 23 /* CloseBracketToken */;
                     case 94 /* caret */:
                         if (text.charCodeAt(pos + 1) === 61 /* equals */) {
-                            return pos += 2, token = 77 /* CaretEqualsToken */;
+                            return pos += 2, token = 78 /* CaretEqualsToken */;
                         }
                         pos++;
                         return token = 52 /* CaretToken */;
@@ -10875,12 +11393,12 @@ var ts;
                         }
                         if (text.charCodeAt(pos + 1) === 124 /* bar */) {
                             if (text.charCodeAt(pos + 2) === 61 /* equals */) {
-                                return pos += 3, token = 74 /* BarBarEqualsToken */;
+                                return pos += 3, token = 75 /* BarBarEqualsToken */;
                             }
                             return pos += 2, token = 56 /* BarBarToken */;
                         }
                         if (text.charCodeAt(pos + 1) === 61 /* equals */) {
-                            return pos += 2, token = 73 /* BarEqualsToken */;
+                            return pos += 2, token = 74 /* BarEqualsToken */;
                         }
                         pos++;
                         return token = 51 /* BarToken */;
@@ -10917,21 +11435,15 @@ var ts;
                             pos++;
                             return token = 0 /* Unknown */;
                         }
-                        pos++;
-                        if (isIdentifierStart(ch = text.charCodeAt(pos), languageVersion)) {
+                        if (isIdentifierStart(codePointAt(text, pos + 1), languageVersion)) {
                             pos++;
-                            while (pos < end && isIdentifierPart(ch = text.charCodeAt(pos), languageVersion))
-                                pos++;
-                            tokenValue = text.substring(tokenPos, pos);
-                            if (ch === 92 /* backslash */) {
-                                tokenValue += scanIdentifierParts();
-                            }
+                            scanIdentifier(codePointAt(text, pos), languageVersion);
                         }
                         else {
-                            tokenValue = "#";
-                            error(ts.Diagnostics.Invalid_character);
+                            tokenValue = String.fromCharCode(codePointAt(text, pos));
+                            error(ts.Diagnostics.Invalid_character, pos++, charSize(ch));
                         }
-                        return token = 79 /* PrivateIdentifier */;
+                        return token = 80 /* PrivateIdentifier */;
                     default:
                         var identifierKind = scanIdentifier(ch, languageVersion);
                         if (identifierKind) {
@@ -10946,8 +11458,9 @@ var ts;
                             pos += charSize(ch);
                             continue;
                         }
-                        error(ts.Diagnostics.Invalid_character);
-                        pos += charSize(ch);
+                        var size = charSize(ch);
+                        error(ts.Diagnostics.Invalid_character, pos, size);
+                        pos += size;
                         return token = 0 /* Unknown */;
                 }
             }
@@ -10982,12 +11495,12 @@ var ts;
                 if (text.charCodeAt(pos) === 62 /* greaterThan */) {
                     if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) {
                         if (text.charCodeAt(pos + 2) === 61 /* equals */) {
-                            return pos += 3, token = 71 /* GreaterThanGreaterThanGreaterThanEqualsToken */;
+                            return pos += 3, token = 72 /* GreaterThanGreaterThanGreaterThanEqualsToken */;
                         }
                         return pos += 2, token = 49 /* GreaterThanGreaterThanGreaterThanToken */;
                     }
                     if (text.charCodeAt(pos + 1) === 61 /* equals */) {
-                        return pos += 2, token = 70 /* GreaterThanGreaterThanEqualsToken */;
+                        return pos += 2, token = 71 /* GreaterThanGreaterThanEqualsToken */;
                     }
                     pos++;
                     return token = 48 /* GreaterThanGreaterThanToken */;
@@ -11000,12 +11513,12 @@ var ts;
             return token;
         }
         function reScanAsteriskEqualsToken() {
-            ts.Debug.assert(token === 65 /* AsteriskEqualsToken */, "'reScanAsteriskEqualsToken' should only be called on a '*='");
+            ts.Debug.assert(token === 66 /* AsteriskEqualsToken */, "'reScanAsteriskEqualsToken' should only be called on a '*='");
             pos = tokenPos + 1;
-            return token = 62 /* EqualsToken */;
+            return token = 63 /* EqualsToken */;
         }
         function reScanSlashToken() {
-            if (token === 43 /* SlashToken */ || token === 67 /* SlashEqualsToken */) {
+            if (token === 43 /* SlashToken */ || token === 68 /* SlashEqualsToken */) {
                 var p = tokenPos + 1;
                 var inEscape = false;
                 var inCharacterClass = false;
@@ -11055,7 +11568,7 @@ var ts;
             return token;
         }
         function appendIfCommentDirective(commentDirectives, text, commentDirectiveRegEx, lineStart) {
-            var type = getDirectiveFromComment(text, commentDirectiveRegEx);
+            var type = getDirectiveFromComment(ts.trimStringStart(text), commentDirectiveRegEx);
             if (type === undefined) {
                 return commentDirectives;
             }
@@ -11089,9 +11602,10 @@ var ts;
             pos = tokenPos;
             return token = scanTemplateAndSetTokenValue(/* isTaggedTemplate */ true);
         }
-        function reScanJsxToken() {
+        function reScanJsxToken(allowMultilineJsxText) {
+            if (allowMultilineJsxText === void 0) { allowMultilineJsxText = true; }
             pos = tokenPos = startPos;
-            return token = scanJsxToken();
+            return token = scanJsxToken(allowMultilineJsxText);
         }
         function reScanLessThanToken() {
             if (token === 47 /* LessThanLessThanToken */) {
@@ -11100,12 +11614,20 @@ var ts;
             }
             return token;
         }
+        function reScanHashToken() {
+            if (token === 80 /* PrivateIdentifier */) {
+                pos = tokenPos + 1;
+                return token = 62 /* HashToken */;
+            }
+            return token;
+        }
         function reScanQuestionToken() {
             ts.Debug.assert(token === 60 /* QuestionQuestionToken */, "'reScanQuestionToken' should only be called on a '??'");
             pos = tokenPos + 1;
             return token = 57 /* QuestionToken */;
         }
-        function scanJsxToken() {
+        function scanJsxToken(allowMultilineJsxText) {
+            if (allowMultilineJsxText === void 0) { allowMultilineJsxText = true; }
             startPos = tokenPos = pos;
             if (pos >= end) {
                 return token = 1 /* EndOfFileToken */;
@@ -11125,15 +11647,9 @@ var ts;
             }
             // First non-whitespace character on this line.
             var firstNonWhitespace = 0;
-            var lastNonWhitespace = -1;
             // These initial values are special because the first line is:
             // firstNonWhitespace = 0 to indicate that we want leading whitespace,
             while (pos < end) {
-                // We want to keep track of the last non-whitespace (but including
-                // newlines character for hitting the end of the JSX Text region)
-                if (!isWhiteSpaceSingleLine(char)) {
-                    lastNonWhitespace = pos;
-                }
                 char = text.charCodeAt(pos);
                 if (char === 123 /* openBrace */) {
                     break;
@@ -11151,8 +11667,6 @@ var ts;
                 if (char === 125 /* closeBrace */) {
                     error(ts.Diagnostics.Unexpected_token_Did_you_mean_or_rbrace, pos, 1);
                 }
-                if (lastNonWhitespace > 0)
-                    lastNonWhitespace++;
                 // FirstNonWhitespace is 0, then we only see whitespaces so far. If we see a linebreak, we want to ignore that whitespaces.
                 // i.e (- : whitespace)
                 //      <div>----
@@ -11162,13 +11676,17 @@ var ts;
                 if (isLineBreak(char) && firstNonWhitespace === 0) {
                     firstNonWhitespace = -1;
                 }
+                else if (!allowMultilineJsxText && isLineBreak(char) && firstNonWhitespace > 0) {
+                    // Stop JsxText on each line during formatting. This allows the formatter to
+                    // indent each line correctly.
+                    break;
+                }
                 else if (!isWhiteSpaceLike(char)) {
                     firstNonWhitespace = pos;
                 }
                 pos++;
             }
-            var endPosition = lastNonWhitespace === -1 ? pos : lastNonWhitespace;
-            tokenValue = text.substring(startPos, endPosition);
+            tokenValue = text.substring(startPos, pos);
             return firstNonWhitespace === -1 ? 12 /* JsxTextAllWhiteSpaces */ : 11 /* JsxText */;
         }
         // Scans a JSX identifier; these differ from normal identifiers in that
@@ -11191,6 +11709,7 @@ var ts;
                         tokenValue += ":";
                         pos++;
                         namespaceSeparator = true;
+                        token = 79 /* Identifier */; // swap from keyword kind to identifier kind
                         continue;
                     }
                     var oldPos = pos;
@@ -11265,13 +11784,15 @@ var ts;
                 case 62 /* greaterThan */:
                     return token = 31 /* GreaterThanToken */;
                 case 61 /* equals */:
-                    return token = 62 /* EqualsToken */;
+                    return token = 63 /* EqualsToken */;
                 case 44 /* comma */:
                     return token = 27 /* CommaToken */;
                 case 46 /* dot */:
                     return token = 24 /* DotToken */;
                 case 96 /* backtick */:
                     return token = 61 /* BacktickToken */;
+                case 35 /* hash */:
+                    return token = 62 /* HashToken */;
                 case 92 /* backslash */:
                     pos--;
                     var extendedCookedChar = peekExtendedUnicodeEscape();
@@ -11444,9 +11965,11 @@ var ts;
     }
     ts.sortAndDeduplicateDiagnostics = sortAndDeduplicateDiagnostics;
     function getDefaultLibFileName(options) {
-        switch (options.target) {
+        switch (ts.getEmitScriptTarget(options)) {
             case 99 /* ESNext */:
                 return "lib.esnext.full.d.ts";
+            case 8 /* ES2021 */:
+                return "lib.es2021.full.d.ts";
             case 7 /* ES2020 */:
                 return "lib.es2020.full.d.ts";
             case 6 /* ES2019 */:
@@ -11665,9 +12188,9 @@ var ts;
     }
     ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions;
     function getTypeParameterOwner(d) {
-        if (d && d.kind === 159 /* TypeParameter */) {
+        if (d && d.kind === 162 /* TypeParameter */) {
             for (var current = d; current; current = current.parent) {
-                if (isFunctionLike(current) || isClassLike(current) || current.kind === 253 /* InterfaceDeclaration */) {
+                if (isFunctionLike(current) || isClassLike(current) || current.kind === 257 /* InterfaceDeclaration */) {
                     return current;
                 }
             }
@@ -11675,7 +12198,7 @@ var ts;
     }
     ts.getTypeParameterOwner = getTypeParameterOwner;
     function isParameterPropertyDeclaration(node, parent) {
-        return ts.hasSyntacticModifier(node, 92 /* ParameterPropertyModifier */) && parent.kind === 166 /* Constructor */;
+        return ts.hasSyntacticModifier(node, 16476 /* ParameterPropertyModifier */) && parent.kind === 170 /* Constructor */;
     }
     ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration;
     function isEmptyBindingPattern(node) {
@@ -11705,14 +12228,14 @@ var ts;
             node = walkUpBindingElementsAndPatterns(node);
         }
         var flags = getFlags(node);
-        if (node.kind === 249 /* VariableDeclaration */) {
+        if (node.kind === 253 /* VariableDeclaration */) {
             node = node.parent;
         }
-        if (node && node.kind === 250 /* VariableDeclarationList */) {
+        if (node && node.kind === 254 /* VariableDeclarationList */) {
             flags |= getFlags(node);
             node = node.parent;
         }
-        if (node && node.kind === 232 /* VariableStatement */) {
+        if (node && node.kind === 236 /* VariableStatement */) {
             flags |= getFlags(node);
         }
         return flags;
@@ -11863,7 +12386,7 @@ var ts;
     }
     ts.idText = idText;
     function symbolName(symbol) {
-        if (symbol.valueDeclaration && isPrivateIdentifierPropertyDeclaration(symbol.valueDeclaration)) {
+        if (symbol.valueDeclaration && isPrivateIdentifierClassElementDeclaration(symbol.valueDeclaration)) {
             return idText(symbol.valueDeclaration.name);
         }
         return unescapeLeadingUnderscores(symbol.escapedName);
@@ -11885,30 +12408,30 @@ var ts;
         }
         // Covers remaining cases (returning undefined if none match).
         switch (hostNode.kind) {
-            case 232 /* VariableStatement */:
+            case 236 /* VariableStatement */:
                 if (hostNode.declarationList && hostNode.declarationList.declarations[0]) {
                     return getDeclarationIdentifier(hostNode.declarationList.declarations[0]);
                 }
                 break;
-            case 233 /* ExpressionStatement */:
+            case 237 /* ExpressionStatement */:
                 var expr = hostNode.expression;
-                if (expr.kind === 216 /* BinaryExpression */ && expr.operatorToken.kind === 62 /* EqualsToken */) {
+                if (expr.kind === 220 /* BinaryExpression */ && expr.operatorToken.kind === 63 /* EqualsToken */) {
                     expr = expr.left;
                 }
                 switch (expr.kind) {
-                    case 201 /* PropertyAccessExpression */:
+                    case 205 /* PropertyAccessExpression */:
                         return expr.name;
-                    case 202 /* ElementAccessExpression */:
+                    case 206 /* ElementAccessExpression */:
                         var arg = expr.argumentExpression;
                         if (ts.isIdentifier(arg)) {
                             return arg;
                         }
                 }
                 break;
-            case 207 /* ParenthesizedExpression */: {
+            case 211 /* ParenthesizedExpression */: {
                 return getDeclarationIdentifier(hostNode.expression);
             }
-            case 245 /* LabeledStatement */: {
+            case 249 /* LabeledStatement */: {
                 if (isDeclaration(hostNode.statement) || isExpression(hostNode.statement)) {
                     return getDeclarationIdentifier(hostNode.statement);
                 }
@@ -11943,18 +12466,18 @@ var ts;
     /** @internal */
     function getNonAssignedNameOfDeclaration(declaration) {
         switch (declaration.kind) {
-            case 78 /* Identifier */:
+            case 79 /* Identifier */:
                 return declaration;
-            case 333 /* JSDocPropertyTag */:
-            case 326 /* JSDocParameterTag */: {
+            case 345 /* JSDocPropertyTag */:
+            case 338 /* JSDocParameterTag */: {
                 var name = declaration.name;
-                if (name.kind === 157 /* QualifiedName */) {
+                if (name.kind === 160 /* QualifiedName */) {
                     return name.right;
                 }
                 break;
             }
-            case 203 /* CallExpression */:
-            case 216 /* BinaryExpression */: {
+            case 207 /* CallExpression */:
+            case 220 /* BinaryExpression */: {
                 var expr_1 = declaration;
                 switch (ts.getAssignmentDeclarationKind(expr_1)) {
                     case 1 /* ExportsProperty */:
@@ -11970,15 +12493,15 @@ var ts;
                         return undefined;
                 }
             }
-            case 331 /* JSDocTypedefTag */:
+            case 343 /* JSDocTypedefTag */:
                 return getNameOfJSDocTypedef(declaration);
-            case 325 /* JSDocEnumTag */:
+            case 337 /* JSDocEnumTag */:
                 return nameForNamelessJSDocTypedef(declaration);
-            case 266 /* ExportAssignment */: {
+            case 270 /* ExportAssignment */: {
                 var expression = declaration.expression;
                 return ts.isIdentifier(expression) ? expression : undefined;
             }
-            case 202 /* ElementAccessExpression */:
+            case 206 /* ElementAccessExpression */:
                 var expr = declaration;
                 if (ts.isBindableStaticElementAccessExpression(expr)) {
                     return expr.argumentExpression;
@@ -11991,7 +12514,7 @@ var ts;
         if (declaration === undefined)
             return undefined;
         return getNonAssignedNameOfDeclaration(declaration) ||
-            (ts.isFunctionExpression(declaration) || ts.isClassExpression(declaration) ? getAssignedName(declaration) : undefined);
+            (ts.isFunctionExpression(declaration) || ts.isArrowFunction(declaration) || ts.isClassExpression(declaration) ? getAssignedName(declaration) : undefined);
     }
     ts.getNameOfDeclaration = getNameOfDeclaration;
     /*@internal*/
@@ -12144,6 +12667,10 @@ var ts;
         return getFirstJSDocTag(node, ts.isJSDocReadonlyTag, /*noCache*/ true);
     }
     ts.getJSDocReadonlyTagNoCache = getJSDocReadonlyTagNoCache;
+    function getJSDocOverrideTagNoCache(node) {
+        return getFirstJSDocTag(node, ts.isJSDocOverrideTag, /*noCache*/ true);
+    }
+    ts.getJSDocOverrideTagNoCache = getJSDocOverrideTagNoCache;
     /** Gets the JSDoc deprecated tag for the node if present */
     function getJSDocDeprecatedTag(node) {
         return getFirstJSDocTag(node, ts.isJSDocDeprecatedTag);
@@ -12264,6 +12791,15 @@ var ts;
         return getJSDocTags(node).filter(function (doc) { return doc.kind === kind; });
     }
     ts.getAllJSDocTagsOfKind = getAllJSDocTagsOfKind;
+    /** Gets the text of a jsdoc comment, flattening links to their text. */
+    function getTextOfJSDocComment(comment) {
+        return typeof comment === "string" ? comment
+            : comment === null || comment === void 0 ? void 0 : comment.map(function (c) {
+                // TODO: Other kinds here
+                return c.kind === 319 /* JSDocText */ ? c.text : "{@link ".concat(c.name ? ts.entityNameToString(c.name) + " " : "").concat(c.text, "}");
+            }).join("");
+    }
+    ts.getTextOfJSDocComment = getTextOfJSDocComment;
     /**
      * Gets the effective type parameters. If the node was parsed in a
      * JavaScript file, gets the type parameters from the `@template` tag from JSDoc.
@@ -12273,7 +12809,7 @@ var ts;
             return ts.emptyArray;
         }
         if (ts.isJSDocTypeAlias(node)) {
-            ts.Debug.assert(node.parent.kind === 311 /* JSDocComment */);
+            ts.Debug.assert(node.parent.kind === 318 /* JSDocComment */);
             return ts.flatMap(node.parent.tags, function (tag) { return ts.isJSDocTemplateTag(tag) ? tag.typeParameters : undefined; });
         }
         if (node.typeParameters) {
@@ -12299,13 +12835,13 @@ var ts;
     }
     ts.getEffectiveConstraintOfTypeParameter = getEffectiveConstraintOfTypeParameter;
     // #region
-    function isIdentifierOrPrivateIdentifier(node) {
-        return node.kind === 78 /* Identifier */ || node.kind === 79 /* PrivateIdentifier */;
+    function isMemberName(node) {
+        return node.kind === 79 /* Identifier */ || node.kind === 80 /* PrivateIdentifier */;
     }
-    ts.isIdentifierOrPrivateIdentifier = isIdentifierOrPrivateIdentifier;
+    ts.isMemberName = isMemberName;
     /* @internal */
     function isGetOrSetAccessorDeclaration(node) {
-        return node.kind === 168 /* SetAccessor */ || node.kind === 167 /* GetAccessor */;
+        return node.kind === 172 /* SetAccessor */ || node.kind === 171 /* GetAccessor */;
     }
     ts.isGetOrSetAccessorDeclaration = isGetOrSetAccessorDeclaration;
     function isPropertyAccessChain(node) {
@@ -12323,10 +12859,10 @@ var ts;
     function isOptionalChain(node) {
         var kind = node.kind;
         return !!(node.flags & 32 /* OptionalChain */) &&
-            (kind === 201 /* PropertyAccessExpression */
-                || kind === 202 /* ElementAccessExpression */
-                || kind === 203 /* CallExpression */
-                || kind === 225 /* NonNullExpression */);
+            (kind === 205 /* PropertyAccessExpression */
+                || kind === 206 /* ElementAccessExpression */
+                || kind === 207 /* CallExpression */
+                || kind === 229 /* NonNullExpression */);
     }
     ts.isOptionalChain = isOptionalChain;
     /* @internal */
@@ -12361,7 +12897,7 @@ var ts;
     }
     ts.isOutermostOptionalChain = isOutermostOptionalChain;
     function isNullishCoalesce(node) {
-        return node.kind === 216 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */;
+        return node.kind === 220 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */;
     }
     ts.isNullishCoalesce = isNullishCoalesce;
     function isConstTypeReference(node) {
@@ -12378,17 +12914,17 @@ var ts;
     }
     ts.isNonNullChain = isNonNullChain;
     function isBreakOrContinueStatement(node) {
-        return node.kind === 241 /* BreakStatement */ || node.kind === 240 /* ContinueStatement */;
+        return node.kind === 245 /* BreakStatement */ || node.kind === 244 /* ContinueStatement */;
     }
     ts.isBreakOrContinueStatement = isBreakOrContinueStatement;
     function isNamedExportBindings(node) {
-        return node.kind === 269 /* NamespaceExport */ || node.kind === 268 /* NamedExports */;
+        return node.kind === 273 /* NamespaceExport */ || node.kind === 272 /* NamedExports */;
     }
     ts.isNamedExportBindings = isNamedExportBindings;
     function isUnparsedTextLike(node) {
         switch (node.kind) {
-            case 294 /* UnparsedText */:
-            case 295 /* UnparsedInternalText */:
+            case 300 /* UnparsedText */:
+            case 301 /* UnparsedInternalText */:
                 return true;
             default:
                 return false;
@@ -12397,12 +12933,12 @@ var ts;
     ts.isUnparsedTextLike = isUnparsedTextLike;
     function isUnparsedNode(node) {
         return isUnparsedTextLike(node) ||
-            node.kind === 292 /* UnparsedPrologue */ ||
-            node.kind === 296 /* UnparsedSyntheticReference */;
+            node.kind === 298 /* UnparsedPrologue */ ||
+            node.kind === 302 /* UnparsedSyntheticReference */;
     }
     ts.isUnparsedNode = isUnparsedNode;
     function isJSDocPropertyLikeTag(node) {
-        return node.kind === 333 /* JSDocPropertyTag */ || node.kind === 326 /* JSDocParameterTag */;
+        return node.kind === 345 /* JSDocPropertyTag */ || node.kind === 338 /* JSDocParameterTag */;
     }
     ts.isJSDocPropertyLikeTag = isJSDocPropertyLikeTag;
     // #endregion
@@ -12418,16 +12954,25 @@ var ts;
     ts.isNode = isNode;
     /* @internal */
     function isNodeKind(kind) {
-        return kind >= 157 /* FirstNode */;
+        return kind >= 160 /* FirstNode */;
     }
     ts.isNodeKind = isNodeKind;
+    /**
+     * True if kind is of some token syntax kind.
+     * For example, this is true for an IfKeyword but not for an IfStatement.
+     * Literals are considered tokens, except TemplateLiteral, but does include TemplateHead/Middle/Tail.
+     */
+    function isTokenKind(kind) {
+        return kind >= 0 /* FirstToken */ && kind <= 159 /* LastToken */;
+    }
+    ts.isTokenKind = isTokenKind;
     /**
      * True if node is of some token syntax kind.
      * For example, this is true for an IfKeyword but not for an IfStatement.
      * Literals are considered tokens, except TemplateLiteral, but does include TemplateHead/Middle/Tail.
      */
     function isToken(n) {
-        return n.kind >= 0 /* FirstToken */ && n.kind <= 156 /* LastToken */;
+        return isTokenKind(n.kind);
     }
     ts.isToken = isToken;
     // Node Arrays
@@ -12468,19 +13013,23 @@ var ts;
     ts.isImportOrExportSpecifier = isImportOrExportSpecifier;
     function isTypeOnlyImportOrExportDeclaration(node) {
         switch (node.kind) {
-            case 265 /* ImportSpecifier */:
-            case 270 /* ExportSpecifier */:
-                return node.parent.parent.isTypeOnly;
-            case 263 /* NamespaceImport */:
+            case 269 /* ImportSpecifier */:
+            case 274 /* ExportSpecifier */:
+                return node.isTypeOnly || node.parent.parent.isTypeOnly;
+            case 267 /* NamespaceImport */:
                 return node.parent.isTypeOnly;
-            case 262 /* ImportClause */:
-            case 260 /* ImportEqualsDeclaration */:
+            case 266 /* ImportClause */:
+            case 264 /* ImportEqualsDeclaration */:
                 return node.isTypeOnly;
             default:
                 return false;
         }
     }
     ts.isTypeOnlyImportOrExportDeclaration = isTypeOnlyImportOrExportDeclaration;
+    function isAssertionKey(node) {
+        return ts.isStringLiteral(node) || ts.isIdentifier(node);
+    }
+    ts.isAssertionKey = isAssertionKey;
     function isStringTextContainingNode(node) {
         return node.kind === 10 /* StringLiteral */ || isTemplateLiteralKind(node.kind);
     }
@@ -12493,10 +13042,10 @@ var ts;
     ts.isGeneratedIdentifier = isGeneratedIdentifier;
     // Private Identifiers
     /*@internal*/
-    function isPrivateIdentifierPropertyDeclaration(node) {
-        return ts.isPropertyDeclaration(node) && ts.isPrivateIdentifier(node.name);
+    function isPrivateIdentifierClassElementDeclaration(node) {
+        return (ts.isPropertyDeclaration(node) || isMethodOrAccessor(node)) && ts.isPrivateIdentifier(node.name);
     }
-    ts.isPrivateIdentifierPropertyDeclaration = isPrivateIdentifierPropertyDeclaration;
+    ts.isPrivateIdentifierClassElementDeclaration = isPrivateIdentifierClassElementDeclaration;
     /*@internal*/
     function isPrivateIdentifierPropertyAccessExpression(node) {
         return ts.isPropertyAccessExpression(node) && ts.isPrivateIdentifier(node.name);
@@ -12506,17 +13055,18 @@ var ts;
     /* @internal */
     function isModifierKind(token) {
         switch (token) {
-            case 125 /* AbstractKeyword */:
-            case 129 /* AsyncKeyword */:
-            case 84 /* ConstKeyword */:
-            case 133 /* DeclareKeyword */:
-            case 87 /* DefaultKeyword */:
-            case 92 /* ExportKeyword */:
-            case 122 /* PublicKeyword */:
-            case 120 /* PrivateKeyword */:
-            case 121 /* ProtectedKeyword */:
-            case 142 /* ReadonlyKeyword */:
-            case 123 /* StaticKeyword */:
+            case 126 /* AbstractKeyword */:
+            case 131 /* AsyncKeyword */:
+            case 85 /* ConstKeyword */:
+            case 135 /* DeclareKeyword */:
+            case 88 /* DefaultKeyword */:
+            case 93 /* ExportKeyword */:
+            case 123 /* PublicKeyword */:
+            case 121 /* PrivateKeyword */:
+            case 122 /* ProtectedKeyword */:
+            case 144 /* ReadonlyKeyword */:
+            case 124 /* StaticKeyword */:
+            case 158 /* OverrideKeyword */:
                 return true;
         }
         return false;
@@ -12524,12 +13074,12 @@ var ts;
     ts.isModifierKind = isModifierKind;
     /* @internal */
     function isParameterPropertyModifier(kind) {
-        return !!(ts.modifierToFlag(kind) & 92 /* ParameterPropertyModifier */);
+        return !!(ts.modifierToFlag(kind) & 16476 /* ParameterPropertyModifier */);
     }
     ts.isParameterPropertyModifier = isParameterPropertyModifier;
     /* @internal */
     function isClassMemberModifier(idToken) {
-        return isParameterPropertyModifier(idToken) || idToken === 123 /* StaticKeyword */;
+        return isParameterPropertyModifier(idToken) || idToken === 124 /* StaticKeyword */ || idToken === 158 /* OverrideKeyword */;
     }
     ts.isClassMemberModifier = isClassMemberModifier;
     function isModifier(node) {
@@ -12538,45 +13088,55 @@ var ts;
     ts.isModifier = isModifier;
     function isEntityName(node) {
         var kind = node.kind;
-        return kind === 157 /* QualifiedName */
-            || kind === 78 /* Identifier */;
+        return kind === 160 /* QualifiedName */
+            || kind === 79 /* Identifier */;
     }
     ts.isEntityName = isEntityName;
     function isPropertyName(node) {
         var kind = node.kind;
-        return kind === 78 /* Identifier */
-            || kind === 79 /* PrivateIdentifier */
+        return kind === 79 /* Identifier */
+            || kind === 80 /* PrivateIdentifier */
             || kind === 10 /* StringLiteral */
             || kind === 8 /* NumericLiteral */
-            || kind === 158 /* ComputedPropertyName */;
+            || kind === 161 /* ComputedPropertyName */;
     }
     ts.isPropertyName = isPropertyName;
     function isBindingName(node) {
         var kind = node.kind;
-        return kind === 78 /* Identifier */
-            || kind === 196 /* ObjectBindingPattern */
-            || kind === 197 /* ArrayBindingPattern */;
+        return kind === 79 /* Identifier */
+            || kind === 200 /* ObjectBindingPattern */
+            || kind === 201 /* ArrayBindingPattern */;
     }
     ts.isBindingName = isBindingName;
     // Functions
     function isFunctionLike(node) {
-        return node && isFunctionLikeKind(node.kind);
+        return !!node && isFunctionLikeKind(node.kind);
     }
     ts.isFunctionLike = isFunctionLike;
     /* @internal */
+    function isFunctionLikeOrClassStaticBlockDeclaration(node) {
+        return !!node && (isFunctionLikeKind(node.kind) || ts.isClassStaticBlockDeclaration(node));
+    }
+    ts.isFunctionLikeOrClassStaticBlockDeclaration = isFunctionLikeOrClassStaticBlockDeclaration;
+    /* @internal */
     function isFunctionLikeDeclaration(node) {
         return node && isFunctionLikeDeclarationKind(node.kind);
     }
     ts.isFunctionLikeDeclaration = isFunctionLikeDeclaration;
+    /* @internal */
+    function isBooleanLiteral(node) {
+        return node.kind === 110 /* TrueKeyword */ || node.kind === 95 /* FalseKeyword */;
+    }
+    ts.isBooleanLiteral = isBooleanLiteral;
     function isFunctionLikeDeclarationKind(kind) {
         switch (kind) {
-            case 251 /* FunctionDeclaration */:
-            case 165 /* MethodDeclaration */:
-            case 166 /* Constructor */:
-            case 167 /* GetAccessor */:
-            case 168 /* SetAccessor */:
-            case 208 /* FunctionExpression */:
-            case 209 /* ArrowFunction */:
+            case 255 /* FunctionDeclaration */:
+            case 168 /* MethodDeclaration */:
+            case 170 /* Constructor */:
+            case 171 /* GetAccessor */:
+            case 172 /* SetAccessor */:
+            case 212 /* FunctionExpression */:
+            case 213 /* ArrowFunction */:
                 return true;
             default:
                 return false;
@@ -12585,14 +13145,14 @@ var ts;
     /* @internal */
     function isFunctionLikeKind(kind) {
         switch (kind) {
-            case 164 /* MethodSignature */:
-            case 169 /* CallSignature */:
-            case 313 /* JSDocSignature */:
-            case 170 /* ConstructSignature */:
-            case 171 /* IndexSignature */:
-            case 174 /* FunctionType */:
-            case 308 /* JSDocFunctionType */:
-            case 175 /* ConstructorType */:
+            case 167 /* MethodSignature */:
+            case 173 /* CallSignature */:
+            case 321 /* JSDocSignature */:
+            case 174 /* ConstructSignature */:
+            case 175 /* IndexSignature */:
+            case 178 /* FunctionType */:
+            case 315 /* JSDocFunctionType */:
+            case 179 /* ConstructorType */:
                 return true;
             default:
                 return isFunctionLikeDeclarationKind(kind);
@@ -12607,29 +13167,30 @@ var ts;
     // Classes
     function isClassElement(node) {
         var kind = node.kind;
-        return kind === 166 /* Constructor */
-            || kind === 163 /* PropertyDeclaration */
-            || kind === 165 /* MethodDeclaration */
-            || kind === 167 /* GetAccessor */
-            || kind === 168 /* SetAccessor */
-            || kind === 171 /* IndexSignature */
-            || kind === 229 /* SemicolonClassElement */;
+        return kind === 170 /* Constructor */
+            || kind === 166 /* PropertyDeclaration */
+            || kind === 168 /* MethodDeclaration */
+            || kind === 171 /* GetAccessor */
+            || kind === 172 /* SetAccessor */
+            || kind === 175 /* IndexSignature */
+            || kind === 169 /* ClassStaticBlockDeclaration */
+            || kind === 233 /* SemicolonClassElement */;
     }
     ts.isClassElement = isClassElement;
     function isClassLike(node) {
-        return node && (node.kind === 252 /* ClassDeclaration */ || node.kind === 221 /* ClassExpression */);
+        return node && (node.kind === 256 /* ClassDeclaration */ || node.kind === 225 /* ClassExpression */);
     }
     ts.isClassLike = isClassLike;
     function isAccessor(node) {
-        return node && (node.kind === 167 /* GetAccessor */ || node.kind === 168 /* SetAccessor */);
+        return node && (node.kind === 171 /* GetAccessor */ || node.kind === 172 /* SetAccessor */);
     }
     ts.isAccessor = isAccessor;
     /* @internal */
     function isMethodOrAccessor(node) {
         switch (node.kind) {
-            case 165 /* MethodDeclaration */:
-            case 167 /* GetAccessor */:
-            case 168 /* SetAccessor */:
+            case 168 /* MethodDeclaration */:
+            case 171 /* GetAccessor */:
+            case 172 /* SetAccessor */:
                 return true;
             default:
                 return false;
@@ -12639,11 +13200,11 @@ var ts;
     // Type members
     function isTypeElement(node) {
         var kind = node.kind;
-        return kind === 170 /* ConstructSignature */
-            || kind === 169 /* CallSignature */
-            || kind === 162 /* PropertySignature */
-            || kind === 164 /* MethodSignature */
-            || kind === 171 /* IndexSignature */;
+        return kind === 174 /* ConstructSignature */
+            || kind === 173 /* CallSignature */
+            || kind === 165 /* PropertySignature */
+            || kind === 167 /* MethodSignature */
+            || kind === 175 /* IndexSignature */;
     }
     ts.isTypeElement = isTypeElement;
     function isClassOrTypeElement(node) {
@@ -12652,12 +13213,12 @@ var ts;
     ts.isClassOrTypeElement = isClassOrTypeElement;
     function isObjectLiteralElementLike(node) {
         var kind = node.kind;
-        return kind === 288 /* PropertyAssignment */
-            || kind === 289 /* ShorthandPropertyAssignment */
-            || kind === 290 /* SpreadAssignment */
-            || kind === 165 /* MethodDeclaration */
-            || kind === 167 /* GetAccessor */
-            || kind === 168 /* SetAccessor */;
+        return kind === 294 /* PropertyAssignment */
+            || kind === 295 /* ShorthandPropertyAssignment */
+            || kind === 296 /* SpreadAssignment */
+            || kind === 168 /* MethodDeclaration */
+            || kind === 171 /* GetAccessor */
+            || kind === 172 /* SetAccessor */;
     }
     ts.isObjectLiteralElementLike = isObjectLiteralElementLike;
     // Type
@@ -12672,8 +13233,8 @@ var ts;
     ts.isTypeNode = isTypeNode;
     function isFunctionOrConstructorTypeNode(node) {
         switch (node.kind) {
-            case 174 /* FunctionType */:
-            case 175 /* ConstructorType */:
+            case 178 /* FunctionType */:
+            case 179 /* ConstructorType */:
                 return true;
         }
         return false;
@@ -12684,8 +13245,8 @@ var ts;
     function isBindingPattern(node) {
         if (node) {
             var kind = node.kind;
-            return kind === 197 /* ArrayBindingPattern */
-                || kind === 196 /* ObjectBindingPattern */;
+            return kind === 201 /* ArrayBindingPattern */
+                || kind === 200 /* ObjectBindingPattern */;
         }
         return false;
     }
@@ -12693,15 +13254,15 @@ var ts;
     /* @internal */
     function isAssignmentPattern(node) {
         var kind = node.kind;
-        return kind === 199 /* ArrayLiteralExpression */
-            || kind === 200 /* ObjectLiteralExpression */;
+        return kind === 203 /* ArrayLiteralExpression */
+            || kind === 204 /* ObjectLiteralExpression */;
     }
     ts.isAssignmentPattern = isAssignmentPattern;
     /* @internal */
     function isArrayBindingElement(node) {
         var kind = node.kind;
-        return kind === 198 /* BindingElement */
-            || kind === 222 /* OmittedExpression */;
+        return kind === 202 /* BindingElement */
+            || kind === 226 /* OmittedExpression */;
     }
     ts.isArrayBindingElement = isArrayBindingElement;
     /**
@@ -12710,9 +13271,9 @@ var ts;
     /* @internal */
     function isDeclarationBindingElement(bindingElement) {
         switch (bindingElement.kind) {
-            case 249 /* VariableDeclaration */:
-            case 160 /* Parameter */:
-            case 198 /* BindingElement */:
+            case 253 /* VariableDeclaration */:
+            case 163 /* Parameter */:
+            case 202 /* BindingElement */:
                 return true;
         }
         return false;
@@ -12733,21 +13294,33 @@ var ts;
     /* @internal */
     function isObjectBindingOrAssignmentPattern(node) {
         switch (node.kind) {
-            case 196 /* ObjectBindingPattern */:
-            case 200 /* ObjectLiteralExpression */:
+            case 200 /* ObjectBindingPattern */:
+            case 204 /* ObjectLiteralExpression */:
                 return true;
         }
         return false;
     }
     ts.isObjectBindingOrAssignmentPattern = isObjectBindingOrAssignmentPattern;
+    /* @internal */
+    function isObjectBindingOrAssignmentElement(node) {
+        switch (node.kind) {
+            case 202 /* BindingElement */:
+            case 294 /* PropertyAssignment */: // AssignmentProperty
+            case 295 /* ShorthandPropertyAssignment */: // AssignmentProperty
+            case 296 /* SpreadAssignment */: // AssignmentRestProperty
+                return true;
+        }
+        return false;
+    }
+    ts.isObjectBindingOrAssignmentElement = isObjectBindingOrAssignmentElement;
     /**
      * Determines whether a node is an ArrayBindingOrAssignmentPattern
      */
     /* @internal */
     function isArrayBindingOrAssignmentPattern(node) {
         switch (node.kind) {
-            case 197 /* ArrayBindingPattern */:
-            case 199 /* ArrayLiteralExpression */:
+            case 201 /* ArrayBindingPattern */:
+            case 203 /* ArrayLiteralExpression */:
                 return true;
         }
         return false;
@@ -12756,26 +13329,26 @@ var ts;
     /* @internal */
     function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) {
         var kind = node.kind;
-        return kind === 201 /* PropertyAccessExpression */
-            || kind === 157 /* QualifiedName */
-            || kind === 195 /* ImportType */;
+        return kind === 205 /* PropertyAccessExpression */
+            || kind === 160 /* QualifiedName */
+            || kind === 199 /* ImportType */;
     }
     ts.isPropertyAccessOrQualifiedNameOrImportTypeNode = isPropertyAccessOrQualifiedNameOrImportTypeNode;
     // Expression
     function isPropertyAccessOrQualifiedName(node) {
         var kind = node.kind;
-        return kind === 201 /* PropertyAccessExpression */
-            || kind === 157 /* QualifiedName */;
+        return kind === 205 /* PropertyAccessExpression */
+            || kind === 160 /* QualifiedName */;
     }
     ts.isPropertyAccessOrQualifiedName = isPropertyAccessOrQualifiedName;
     function isCallLikeExpression(node) {
         switch (node.kind) {
-            case 275 /* JsxOpeningElement */:
-            case 274 /* JsxSelfClosingElement */:
-            case 203 /* CallExpression */:
-            case 204 /* NewExpression */:
-            case 205 /* TaggedTemplateExpression */:
-            case 161 /* Decorator */:
+            case 279 /* JsxOpeningElement */:
+            case 278 /* JsxSelfClosingElement */:
+            case 207 /* CallExpression */:
+            case 208 /* NewExpression */:
+            case 209 /* TaggedTemplateExpression */:
+            case 164 /* Decorator */:
                 return true;
             default:
                 return false;
@@ -12783,12 +13356,12 @@ var ts;
     }
     ts.isCallLikeExpression = isCallLikeExpression;
     function isCallOrNewExpression(node) {
-        return node.kind === 203 /* CallExpression */ || node.kind === 204 /* NewExpression */;
+        return node.kind === 207 /* CallExpression */ || node.kind === 208 /* NewExpression */;
     }
     ts.isCallOrNewExpression = isCallOrNewExpression;
     function isTemplateLiteral(node) {
         var kind = node.kind;
-        return kind === 218 /* TemplateExpression */
+        return kind === 222 /* TemplateExpression */
             || kind === 14 /* NoSubstitutionTemplateLiteral */;
     }
     ts.isTemplateLiteral = isTemplateLiteral;
@@ -12799,34 +13372,35 @@ var ts;
     ts.isLeftHandSideExpression = isLeftHandSideExpression;
     function isLeftHandSideExpressionKind(kind) {
         switch (kind) {
-            case 201 /* PropertyAccessExpression */:
-            case 202 /* ElementAccessExpression */:
-            case 204 /* NewExpression */:
-            case 203 /* CallExpression */:
-            case 273 /* JsxElement */:
-            case 274 /* JsxSelfClosingElement */:
-            case 277 /* JsxFragment */:
-            case 205 /* TaggedTemplateExpression */:
-            case 199 /* ArrayLiteralExpression */:
-            case 207 /* ParenthesizedExpression */:
-            case 200 /* ObjectLiteralExpression */:
-            case 221 /* ClassExpression */:
-            case 208 /* FunctionExpression */:
-            case 78 /* Identifier */:
+            case 205 /* PropertyAccessExpression */:
+            case 206 /* ElementAccessExpression */:
+            case 208 /* NewExpression */:
+            case 207 /* CallExpression */:
+            case 277 /* JsxElement */:
+            case 278 /* JsxSelfClosingElement */:
+            case 281 /* JsxFragment */:
+            case 209 /* TaggedTemplateExpression */:
+            case 203 /* ArrayLiteralExpression */:
+            case 211 /* ParenthesizedExpression */:
+            case 204 /* ObjectLiteralExpression */:
+            case 225 /* ClassExpression */:
+            case 212 /* FunctionExpression */:
+            case 79 /* Identifier */:
+            case 80 /* PrivateIdentifier */: // technically this is only an Expression if it's in a `#field in expr` BinaryExpression
             case 13 /* RegularExpressionLiteral */:
             case 8 /* NumericLiteral */:
             case 9 /* BigIntLiteral */:
             case 10 /* StringLiteral */:
             case 14 /* NoSubstitutionTemplateLiteral */:
-            case 218 /* TemplateExpression */:
-            case 94 /* FalseKeyword */:
-            case 103 /* NullKeyword */:
-            case 107 /* ThisKeyword */:
-            case 109 /* TrueKeyword */:
-            case 105 /* SuperKeyword */:
-            case 225 /* NonNullExpression */:
-            case 226 /* MetaProperty */:
-            case 99 /* ImportKeyword */: // technically this is only an Expression if it's in a CallExpression
+            case 222 /* TemplateExpression */:
+            case 95 /* FalseKeyword */:
+            case 104 /* NullKeyword */:
+            case 108 /* ThisKeyword */:
+            case 110 /* TrueKeyword */:
+            case 106 /* SuperKeyword */:
+            case 229 /* NonNullExpression */:
+            case 230 /* MetaProperty */:
+            case 100 /* ImportKeyword */: // technically this is only an Expression if it's in a CallExpression
                 return true;
             default:
                 return false;
@@ -12839,13 +13413,13 @@ var ts;
     ts.isUnaryExpression = isUnaryExpression;
     function isUnaryExpressionKind(kind) {
         switch (kind) {
-            case 214 /* PrefixUnaryExpression */:
-            case 215 /* PostfixUnaryExpression */:
-            case 210 /* DeleteExpression */:
-            case 211 /* TypeOfExpression */:
-            case 212 /* VoidExpression */:
-            case 213 /* AwaitExpression */:
-            case 206 /* TypeAssertionExpression */:
+            case 218 /* PrefixUnaryExpression */:
+            case 219 /* PostfixUnaryExpression */:
+            case 214 /* DeleteExpression */:
+            case 215 /* TypeOfExpression */:
+            case 216 /* VoidExpression */:
+            case 217 /* AwaitExpression */:
+            case 210 /* TypeAssertionExpression */:
                 return true;
             default:
                 return isLeftHandSideExpressionKind(kind);
@@ -12854,9 +13428,9 @@ var ts;
     /* @internal */
     function isUnaryExpressionWithWrite(expr) {
         switch (expr.kind) {
-            case 215 /* PostfixUnaryExpression */:
+            case 219 /* PostfixUnaryExpression */:
                 return true;
-            case 214 /* PrefixUnaryExpression */:
+            case 218 /* PrefixUnaryExpression */:
                 return expr.operator === 45 /* PlusPlusToken */ ||
                     expr.operator === 46 /* MinusMinusToken */;
             default:
@@ -12875,15 +13449,15 @@ var ts;
     ts.isExpression = isExpression;
     function isExpressionKind(kind) {
         switch (kind) {
-            case 217 /* ConditionalExpression */:
-            case 219 /* YieldExpression */:
-            case 209 /* ArrowFunction */:
-            case 216 /* BinaryExpression */:
-            case 220 /* SpreadElement */:
-            case 224 /* AsExpression */:
-            case 222 /* OmittedExpression */:
-            case 337 /* CommaListExpression */:
-            case 336 /* PartiallyEmittedExpression */:
+            case 221 /* ConditionalExpression */:
+            case 223 /* YieldExpression */:
+            case 213 /* ArrowFunction */:
+            case 220 /* BinaryExpression */:
+            case 224 /* SpreadElement */:
+            case 228 /* AsExpression */:
+            case 226 /* OmittedExpression */:
+            case 349 /* CommaListExpression */:
+            case 348 /* PartiallyEmittedExpression */:
                 return true;
             default:
                 return isUnaryExpressionKind(kind);
@@ -12891,8 +13465,8 @@ var ts;
     }
     function isAssertionExpression(node) {
         var kind = node.kind;
-        return kind === 206 /* TypeAssertionExpression */
-            || kind === 224 /* AsExpression */;
+        return kind === 210 /* TypeAssertionExpression */
+            || kind === 228 /* AsExpression */;
     }
     ts.isAssertionExpression = isAssertionExpression;
     /* @internal */
@@ -12903,13 +13477,13 @@ var ts;
     ts.isNotEmittedOrPartiallyEmittedNode = isNotEmittedOrPartiallyEmittedNode;
     function isIterationStatement(node, lookInLabeledStatements) {
         switch (node.kind) {
-            case 237 /* ForStatement */:
-            case 238 /* ForInStatement */:
-            case 239 /* ForOfStatement */:
-            case 235 /* DoStatement */:
-            case 236 /* WhileStatement */:
+            case 241 /* ForStatement */:
+            case 242 /* ForInStatement */:
+            case 243 /* ForOfStatement */:
+            case 239 /* DoStatement */:
+            case 240 /* WhileStatement */:
                 return true;
-            case 245 /* LabeledStatement */:
+            case 249 /* LabeledStatement */:
                 return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements);
         }
         return false;
@@ -12938,7 +13512,7 @@ var ts;
     ts.isExternalModuleIndicator = isExternalModuleIndicator;
     /* @internal */
     function isForInOrOfStatement(node) {
-        return node.kind === 238 /* ForInStatement */ || node.kind === 239 /* ForOfStatement */;
+        return node.kind === 242 /* ForInStatement */ || node.kind === 243 /* ForOfStatement */;
     }
     ts.isForInOrOfStatement = isForInOrOfStatement;
     // Element
@@ -12962,114 +13536,115 @@ var ts;
     /* @internal */
     function isModuleBody(node) {
         var kind = node.kind;
-        return kind === 257 /* ModuleBlock */
-            || kind === 256 /* ModuleDeclaration */
-            || kind === 78 /* Identifier */;
+        return kind === 261 /* ModuleBlock */
+            || kind === 260 /* ModuleDeclaration */
+            || kind === 79 /* Identifier */;
     }
     ts.isModuleBody = isModuleBody;
     /* @internal */
     function isNamespaceBody(node) {
         var kind = node.kind;
-        return kind === 257 /* ModuleBlock */
-            || kind === 256 /* ModuleDeclaration */;
+        return kind === 261 /* ModuleBlock */
+            || kind === 260 /* ModuleDeclaration */;
     }
     ts.isNamespaceBody = isNamespaceBody;
     /* @internal */
     function isJSDocNamespaceBody(node) {
         var kind = node.kind;
-        return kind === 78 /* Identifier */
-            || kind === 256 /* ModuleDeclaration */;
+        return kind === 79 /* Identifier */
+            || kind === 260 /* ModuleDeclaration */;
     }
     ts.isJSDocNamespaceBody = isJSDocNamespaceBody;
     /* @internal */
     function isNamedImportBindings(node) {
         var kind = node.kind;
-        return kind === 264 /* NamedImports */
-            || kind === 263 /* NamespaceImport */;
+        return kind === 268 /* NamedImports */
+            || kind === 267 /* NamespaceImport */;
     }
     ts.isNamedImportBindings = isNamedImportBindings;
     /* @internal */
     function isModuleOrEnumDeclaration(node) {
-        return node.kind === 256 /* ModuleDeclaration */ || node.kind === 255 /* EnumDeclaration */;
+        return node.kind === 260 /* ModuleDeclaration */ || node.kind === 259 /* EnumDeclaration */;
     }
     ts.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration;
     function isDeclarationKind(kind) {
-        return kind === 209 /* ArrowFunction */
-            || kind === 198 /* BindingElement */
-            || kind === 252 /* ClassDeclaration */
-            || kind === 221 /* ClassExpression */
-            || kind === 166 /* Constructor */
-            || kind === 255 /* EnumDeclaration */
-            || kind === 291 /* EnumMember */
-            || kind === 270 /* ExportSpecifier */
-            || kind === 251 /* FunctionDeclaration */
-            || kind === 208 /* FunctionExpression */
-            || kind === 167 /* GetAccessor */
-            || kind === 262 /* ImportClause */
-            || kind === 260 /* ImportEqualsDeclaration */
-            || kind === 265 /* ImportSpecifier */
-            || kind === 253 /* InterfaceDeclaration */
-            || kind === 280 /* JsxAttribute */
-            || kind === 165 /* MethodDeclaration */
-            || kind === 164 /* MethodSignature */
-            || kind === 256 /* ModuleDeclaration */
-            || kind === 259 /* NamespaceExportDeclaration */
-            || kind === 263 /* NamespaceImport */
-            || kind === 269 /* NamespaceExport */
-            || kind === 160 /* Parameter */
-            || kind === 288 /* PropertyAssignment */
-            || kind === 163 /* PropertyDeclaration */
-            || kind === 162 /* PropertySignature */
-            || kind === 168 /* SetAccessor */
-            || kind === 289 /* ShorthandPropertyAssignment */
-            || kind === 254 /* TypeAliasDeclaration */
-            || kind === 159 /* TypeParameter */
-            || kind === 249 /* VariableDeclaration */
-            || kind === 331 /* JSDocTypedefTag */
-            || kind === 324 /* JSDocCallbackTag */
-            || kind === 333 /* JSDocPropertyTag */;
+        return kind === 213 /* ArrowFunction */
+            || kind === 202 /* BindingElement */
+            || kind === 256 /* ClassDeclaration */
+            || kind === 225 /* ClassExpression */
+            || kind === 169 /* ClassStaticBlockDeclaration */
+            || kind === 170 /* Constructor */
+            || kind === 259 /* EnumDeclaration */
+            || kind === 297 /* EnumMember */
+            || kind === 274 /* ExportSpecifier */
+            || kind === 255 /* FunctionDeclaration */
+            || kind === 212 /* FunctionExpression */
+            || kind === 171 /* GetAccessor */
+            || kind === 266 /* ImportClause */
+            || kind === 264 /* ImportEqualsDeclaration */
+            || kind === 269 /* ImportSpecifier */
+            || kind === 257 /* InterfaceDeclaration */
+            || kind === 284 /* JsxAttribute */
+            || kind === 168 /* MethodDeclaration */
+            || kind === 167 /* MethodSignature */
+            || kind === 260 /* ModuleDeclaration */
+            || kind === 263 /* NamespaceExportDeclaration */
+            || kind === 267 /* NamespaceImport */
+            || kind === 273 /* NamespaceExport */
+            || kind === 163 /* Parameter */
+            || kind === 294 /* PropertyAssignment */
+            || kind === 166 /* PropertyDeclaration */
+            || kind === 165 /* PropertySignature */
+            || kind === 172 /* SetAccessor */
+            || kind === 295 /* ShorthandPropertyAssignment */
+            || kind === 258 /* TypeAliasDeclaration */
+            || kind === 162 /* TypeParameter */
+            || kind === 253 /* VariableDeclaration */
+            || kind === 343 /* JSDocTypedefTag */
+            || kind === 336 /* JSDocCallbackTag */
+            || kind === 345 /* JSDocPropertyTag */;
     }
     function isDeclarationStatementKind(kind) {
-        return kind === 251 /* FunctionDeclaration */
-            || kind === 271 /* MissingDeclaration */
-            || kind === 252 /* ClassDeclaration */
-            || kind === 253 /* InterfaceDeclaration */
-            || kind === 254 /* TypeAliasDeclaration */
-            || kind === 255 /* EnumDeclaration */
-            || kind === 256 /* ModuleDeclaration */
-            || kind === 261 /* ImportDeclaration */
-            || kind === 260 /* ImportEqualsDeclaration */
-            || kind === 267 /* ExportDeclaration */
-            || kind === 266 /* ExportAssignment */
-            || kind === 259 /* NamespaceExportDeclaration */;
+        return kind === 255 /* FunctionDeclaration */
+            || kind === 275 /* MissingDeclaration */
+            || kind === 256 /* ClassDeclaration */
+            || kind === 257 /* InterfaceDeclaration */
+            || kind === 258 /* TypeAliasDeclaration */
+            || kind === 259 /* EnumDeclaration */
+            || kind === 260 /* ModuleDeclaration */
+            || kind === 265 /* ImportDeclaration */
+            || kind === 264 /* ImportEqualsDeclaration */
+            || kind === 271 /* ExportDeclaration */
+            || kind === 270 /* ExportAssignment */
+            || kind === 263 /* NamespaceExportDeclaration */;
     }
     function isStatementKindButNotDeclarationKind(kind) {
-        return kind === 241 /* BreakStatement */
-            || kind === 240 /* ContinueStatement */
-            || kind === 248 /* DebuggerStatement */
-            || kind === 235 /* DoStatement */
-            || kind === 233 /* ExpressionStatement */
-            || kind === 231 /* EmptyStatement */
-            || kind === 238 /* ForInStatement */
-            || kind === 239 /* ForOfStatement */
-            || kind === 237 /* ForStatement */
-            || kind === 234 /* IfStatement */
-            || kind === 245 /* LabeledStatement */
-            || kind === 242 /* ReturnStatement */
-            || kind === 244 /* SwitchStatement */
-            || kind === 246 /* ThrowStatement */
-            || kind === 247 /* TryStatement */
-            || kind === 232 /* VariableStatement */
-            || kind === 236 /* WhileStatement */
-            || kind === 243 /* WithStatement */
-            || kind === 335 /* NotEmittedStatement */
-            || kind === 339 /* EndOfDeclarationMarker */
-            || kind === 338 /* MergeDeclarationMarker */;
+        return kind === 245 /* BreakStatement */
+            || kind === 244 /* ContinueStatement */
+            || kind === 252 /* DebuggerStatement */
+            || kind === 239 /* DoStatement */
+            || kind === 237 /* ExpressionStatement */
+            || kind === 235 /* EmptyStatement */
+            || kind === 242 /* ForInStatement */
+            || kind === 243 /* ForOfStatement */
+            || kind === 241 /* ForStatement */
+            || kind === 238 /* IfStatement */
+            || kind === 249 /* LabeledStatement */
+            || kind === 246 /* ReturnStatement */
+            || kind === 248 /* SwitchStatement */
+            || kind === 250 /* ThrowStatement */
+            || kind === 251 /* TryStatement */
+            || kind === 236 /* VariableStatement */
+            || kind === 240 /* WhileStatement */
+            || kind === 247 /* WithStatement */
+            || kind === 347 /* NotEmittedStatement */
+            || kind === 351 /* EndOfDeclarationMarker */
+            || kind === 350 /* MergeDeclarationMarker */;
     }
     /* @internal */
     function isDeclaration(node) {
-        if (node.kind === 159 /* TypeParameter */) {
-            return (node.parent && node.parent.kind !== 330 /* JSDocTemplateTag */) || ts.isInJSFile(node);
+        if (node.kind === 162 /* TypeParameter */) {
+            return (node.parent && node.parent.kind !== 342 /* JSDocTemplateTag */) || ts.isInJSFile(node);
         }
         return isDeclarationKind(node.kind);
     }
@@ -13096,10 +13671,10 @@ var ts;
     }
     ts.isStatement = isStatement;
     function isBlockStatement(node) {
-        if (node.kind !== 230 /* Block */)
+        if (node.kind !== 234 /* Block */)
             return false;
         if (node.parent !== undefined) {
-            if (node.parent.kind === 247 /* TryStatement */ || node.parent.kind === 287 /* CatchClause */) {
+            if (node.parent.kind === 251 /* TryStatement */ || node.parent.kind === 291 /* CatchClause */) {
                 return false;
             }
         }
@@ -13113,88 +13688,94 @@ var ts;
         var kind = node.kind;
         return isStatementKindButNotDeclarationKind(kind)
             || isDeclarationStatementKind(kind)
-            || kind === 230 /* Block */;
+            || kind === 234 /* Block */;
     }
     ts.isStatementOrBlock = isStatementOrBlock;
     // Module references
     /* @internal */
     function isModuleReference(node) {
         var kind = node.kind;
-        return kind === 272 /* ExternalModuleReference */
-            || kind === 157 /* QualifiedName */
-            || kind === 78 /* Identifier */;
+        return kind === 276 /* ExternalModuleReference */
+            || kind === 160 /* QualifiedName */
+            || kind === 79 /* Identifier */;
     }
     ts.isModuleReference = isModuleReference;
     // JSX
     /* @internal */
     function isJsxTagNameExpression(node) {
         var kind = node.kind;
-        return kind === 107 /* ThisKeyword */
-            || kind === 78 /* Identifier */
-            || kind === 201 /* PropertyAccessExpression */;
+        return kind === 108 /* ThisKeyword */
+            || kind === 79 /* Identifier */
+            || kind === 205 /* PropertyAccessExpression */;
     }
     ts.isJsxTagNameExpression = isJsxTagNameExpression;
     /* @internal */
     function isJsxChild(node) {
         var kind = node.kind;
-        return kind === 273 /* JsxElement */
-            || kind === 283 /* JsxExpression */
-            || kind === 274 /* JsxSelfClosingElement */
+        return kind === 277 /* JsxElement */
+            || kind === 287 /* JsxExpression */
+            || kind === 278 /* JsxSelfClosingElement */
             || kind === 11 /* JsxText */
-            || kind === 277 /* JsxFragment */;
+            || kind === 281 /* JsxFragment */;
     }
     ts.isJsxChild = isJsxChild;
     /* @internal */
     function isJsxAttributeLike(node) {
         var kind = node.kind;
-        return kind === 280 /* JsxAttribute */
-            || kind === 282 /* JsxSpreadAttribute */;
+        return kind === 284 /* JsxAttribute */
+            || kind === 286 /* JsxSpreadAttribute */;
     }
     ts.isJsxAttributeLike = isJsxAttributeLike;
     /* @internal */
     function isStringLiteralOrJsxExpression(node) {
         var kind = node.kind;
         return kind === 10 /* StringLiteral */
-            || kind === 283 /* JsxExpression */;
+            || kind === 287 /* JsxExpression */;
     }
     ts.isStringLiteralOrJsxExpression = isStringLiteralOrJsxExpression;
     function isJsxOpeningLikeElement(node) {
         var kind = node.kind;
-        return kind === 275 /* JsxOpeningElement */
-            || kind === 274 /* JsxSelfClosingElement */;
+        return kind === 279 /* JsxOpeningElement */
+            || kind === 278 /* JsxSelfClosingElement */;
     }
     ts.isJsxOpeningLikeElement = isJsxOpeningLikeElement;
     // Clauses
     function isCaseOrDefaultClause(node) {
         var kind = node.kind;
-        return kind === 284 /* CaseClause */
-            || kind === 285 /* DefaultClause */;
+        return kind === 288 /* CaseClause */
+            || kind === 289 /* DefaultClause */;
     }
     ts.isCaseOrDefaultClause = isCaseOrDefaultClause;
     // JSDoc
     /** True if node is of some JSDoc syntax kind. */
     /* @internal */
     function isJSDocNode(node) {
-        return node.kind >= 301 /* FirstJSDocNode */ && node.kind <= 333 /* LastJSDocNode */;
+        return node.kind >= 307 /* FirstJSDocNode */ && node.kind <= 345 /* LastJSDocNode */;
     }
     ts.isJSDocNode = isJSDocNode;
     /** True if node is of a kind that may contain comment text. */
     function isJSDocCommentContainingNode(node) {
-        return node.kind === 311 /* JSDocComment */ || node.kind === 310 /* JSDocNamepathType */ || isJSDocTag(node) || ts.isJSDocTypeLiteral(node) || ts.isJSDocSignature(node);
+        return node.kind === 318 /* JSDocComment */
+            || node.kind === 317 /* JSDocNamepathType */
+            || node.kind === 319 /* JSDocText */
+            || isJSDocLinkLike(node)
+            || isJSDocTag(node)
+            || ts.isJSDocTypeLiteral(node)
+            || ts.isJSDocSignature(node);
     }
     ts.isJSDocCommentContainingNode = isJSDocCommentContainingNode;
     // TODO: determine what this does before making it public.
     /* @internal */
     function isJSDocTag(node) {
-        return node.kind >= 314 /* FirstJSDocTagNode */ && node.kind <= 333 /* LastJSDocTagNode */;
+        return node.kind >= 325 /* FirstJSDocTagNode */ && node.kind <= 345 /* LastJSDocTagNode */;
     }
     ts.isJSDocTag = isJSDocTag;
     function isSetAccessor(node) {
-        return node.kind === 168 /* SetAccessor */;
+        return node.kind === 172 /* SetAccessor */;
     }
     ts.isSetAccessor = isSetAccessor;
     function isGetAccessor(node) {
-        return node.kind === 167 /* GetAccessor */;
+        return node.kind === 171 /* GetAccessor */;
     }
     ts.isGetAccessor = isGetAccessor;
     /** True if has jsdoc nodes attached to it. */
@@ -13220,13 +13801,13 @@ var ts;
     /** True if has initializer node attached to it. */
     function hasOnlyExpressionInitializer(node) {
         switch (node.kind) {
-            case 249 /* VariableDeclaration */:
-            case 160 /* Parameter */:
-            case 198 /* BindingElement */:
-            case 162 /* PropertySignature */:
-            case 163 /* PropertyDeclaration */:
-            case 288 /* PropertyAssignment */:
-            case 291 /* EnumMember */:
+            case 253 /* VariableDeclaration */:
+            case 163 /* Parameter */:
+            case 202 /* BindingElement */:
+            case 165 /* PropertySignature */:
+            case 166 /* PropertyDeclaration */:
+            case 294 /* PropertyAssignment */:
+            case 297 /* EnumMember */:
                 return true;
             default:
                 return false;
@@ -13234,12 +13815,12 @@ var ts;
     }
     ts.hasOnlyExpressionInitializer = hasOnlyExpressionInitializer;
     function isObjectLiteralElement(node) {
-        return node.kind === 280 /* JsxAttribute */ || node.kind === 282 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node);
+        return node.kind === 284 /* JsxAttribute */ || node.kind === 286 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node);
     }
     ts.isObjectLiteralElement = isObjectLiteralElement;
     /* @internal */
     function isTypeReferenceType(node) {
-        return node.kind === 173 /* TypeReference */ || node.kind === 223 /* ExpressionWithTypeArguments */;
+        return node.kind === 177 /* TypeReference */ || node.kind === 227 /* ExpressionWithTypeArguments */;
     }
     ts.isTypeReferenceType = isTypeReferenceType;
     var MAX_SMI_X86 = 1073741823;
@@ -13271,6 +13852,10 @@ var ts;
         return node.kind === 10 /* StringLiteral */ || node.kind === 14 /* NoSubstitutionTemplateLiteral */;
     }
     ts.isStringLiteralLike = isStringLiteralLike;
+    function isJSDocLinkLike(node) {
+        return node.kind === 322 /* JSDocLink */ || node.kind === 323 /* JSDocLinkCode */ || node.kind === 324 /* JSDocLinkPlain */;
+    }
+    ts.isJSDocLinkLike = isJSDocLinkLike;
     // #endregion
 })(ts || (ts = {}));
 /* @internal */
@@ -13355,7 +13940,7 @@ var ts;
             increaseIndent: ts.noop,
             decreaseIndent: ts.noop,
             clear: function () { return str = ""; },
-            trackSymbol: ts.noop,
+            trackSymbol: function () { return false; },
             reportInaccessibleThisError: ts.noop,
             reportInaccessibleUniqueSymbolError: ts.noop,
             reportPrivateInBaseOfClassExpression: ts.noop,
@@ -13367,11 +13952,19 @@ var ts;
     }
     ts.changesAffectModuleResolution = changesAffectModuleResolution;
     function optionsHaveModuleResolutionChanges(oldOptions, newOptions) {
-        return ts.moduleResolutionOptionDeclarations.some(function (o) {
+        return optionsHaveChanges(oldOptions, newOptions, ts.moduleResolutionOptionDeclarations);
+    }
+    ts.optionsHaveModuleResolutionChanges = optionsHaveModuleResolutionChanges;
+    function changesAffectingProgramStructure(oldOptions, newOptions) {
+        return optionsHaveChanges(oldOptions, newOptions, ts.optionsAffectingProgramStructure);
+    }
+    ts.changesAffectingProgramStructure = changesAffectingProgramStructure;
+    function optionsHaveChanges(oldOptions, newOptions, optionDeclarations) {
+        return oldOptions !== newOptions && optionDeclarations.some(function (o) {
             return !isJsonEqual(getCompilerOptionValue(oldOptions, o), getCompilerOptionValue(newOptions, o));
         });
     }
-    ts.optionsHaveModuleResolutionChanges = optionsHaveModuleResolutionChanges;
+    ts.optionsHaveChanges = optionsHaveChanges;
     function forEachAncestor(node, callback) {
         while (true) {
             var res = callback(node);
@@ -13436,22 +14029,22 @@ var ts;
         return node.end - node.pos;
     }
     ts.getFullWidth = getFullWidth;
-    function getResolvedModule(sourceFile, moduleNameText) {
-        return sourceFile && sourceFile.resolvedModules && sourceFile.resolvedModules.get(moduleNameText);
+    function getResolvedModule(sourceFile, moduleNameText, mode) {
+        return sourceFile && sourceFile.resolvedModules && sourceFile.resolvedModules.get(moduleNameText, mode);
     }
     ts.getResolvedModule = getResolvedModule;
-    function setResolvedModule(sourceFile, moduleNameText, resolvedModule) {
+    function setResolvedModule(sourceFile, moduleNameText, resolvedModule, mode) {
         if (!sourceFile.resolvedModules) {
-            sourceFile.resolvedModules = new ts.Map();
+            sourceFile.resolvedModules = ts.createModeAwareCache();
         }
-        sourceFile.resolvedModules.set(moduleNameText, resolvedModule);
+        sourceFile.resolvedModules.set(moduleNameText, mode, resolvedModule);
     }
     ts.setResolvedModule = setResolvedModule;
     function setResolvedTypeReferenceDirective(sourceFile, typeReferenceDirectiveName, resolvedTypeReferenceDirective) {
         if (!sourceFile.resolvedTypeReferenceDirectiveNames) {
-            sourceFile.resolvedTypeReferenceDirectiveNames = new ts.Map();
+            sourceFile.resolvedTypeReferenceDirectiveNames = ts.createModeAwareCache();
         }
-        sourceFile.resolvedTypeReferenceDirectiveNames.set(typeReferenceDirectiveName, resolvedTypeReferenceDirective);
+        sourceFile.resolvedTypeReferenceDirectiveNames.set(typeReferenceDirectiveName, /*mode*/ undefined, resolvedTypeReferenceDirective);
     }
     ts.setResolvedTypeReferenceDirective = setResolvedTypeReferenceDirective;
     function projectReferenceIsEqualTo(oldRef, newRef) {
@@ -13473,19 +14066,21 @@ var ts;
     }
     function packageIdToString(_a) {
         var name = _a.name, subModuleName = _a.subModuleName, version = _a.version;
-        var fullName = subModuleName ? name + "/" + subModuleName : name;
-        return fullName + "@" + version;
+        var fullName = subModuleName ? "".concat(name, "/").concat(subModuleName) : name;
+        return "".concat(fullName, "@").concat(version);
     }
     ts.packageIdToString = packageIdToString;
     function typeDirectiveIsEqualTo(oldResolution, newResolution) {
-        return oldResolution.resolvedFileName === newResolution.resolvedFileName && oldResolution.primary === newResolution.primary;
+        return oldResolution.resolvedFileName === newResolution.resolvedFileName
+            && oldResolution.primary === newResolution.primary
+            && oldResolution.originalPath === newResolution.originalPath;
     }
     ts.typeDirectiveIsEqualTo = typeDirectiveIsEqualTo;
-    function hasChangesInResolutions(names, newResolutions, oldResolutions, comparer) {
+    function hasChangesInResolutions(names, newResolutions, oldResolutions, oldSourceFile, comparer) {
         ts.Debug.assert(names.length === newResolutions.length);
         for (var i = 0; i < names.length; i++) {
             var newResolution = newResolutions[i];
-            var oldResolution = oldResolutions && oldResolutions.get(names[i]);
+            var oldResolution = oldResolutions && oldResolutions.get(names[i], oldSourceFile && ts.getModeForResolutionAtIndex(oldSourceFile, i));
             var changed = oldResolution
                 ? !newResolution || !comparer(oldResolution, newResolution)
                 : newResolution;
@@ -13520,19 +14115,23 @@ var ts;
         }
     }
     function getSourceFileOfNode(node) {
-        while (node && node.kind !== 297 /* SourceFile */) {
+        while (node && node.kind !== 303 /* SourceFile */) {
             node = node.parent;
         }
         return node;
     }
     ts.getSourceFileOfNode = getSourceFileOfNode;
+    function getSourceFileOfModule(module) {
+        return getSourceFileOfNode(module.valueDeclaration || getNonAugmentationDeclaration(module));
+    }
+    ts.getSourceFileOfModule = getSourceFileOfModule;
     function isStatementWithLocals(node) {
         switch (node.kind) {
-            case 230 /* Block */:
-            case 258 /* CaseBlock */:
-            case 237 /* ForStatement */:
-            case 238 /* ForInStatement */:
-            case 239 /* ForOfStatement */:
+            case 234 /* Block */:
+            case 262 /* CaseBlock */:
+            case 241 /* ForStatement */:
+            case 242 /* ForInStatement */:
+            case 243 /* ForOfStatement */:
                 return true;
         }
         return false;
@@ -13547,7 +14146,7 @@ var ts;
     function nodePosToString(node) {
         var file = getSourceFileOfNode(node);
         var loc = ts.getLineAndCharacterOfPosition(file, node.pos);
-        return file.fileName + "(" + (loc.line + 1) + "," + (loc.character + 1) + ")";
+        return "".concat(file.fileName, "(").concat(loc.line + 1, ",").concat(loc.character + 1, ")");
     }
     ts.nodePosToString = nodePosToString;
     function getEndLinePosition(line, sourceFile) {
@@ -13617,7 +14216,7 @@ var ts;
                 break;
             }
         }
-        to.splice.apply(to, __spreadArray([statementIndex, 0], from));
+        to.splice.apply(to, __spreadArray([statementIndex, 0], from, false));
         return to;
     }
     function insertStatementAfterPrologue(to, statement, isPrologueDirective) {
@@ -13670,10 +14269,10 @@ var ts;
             commentPos + 2 < commentEnd &&
             text.charCodeAt(commentPos + 2) === 47 /* slash */) {
             var textSubStr = text.substring(commentPos, commentEnd);
-            return textSubStr.match(ts.fullTripleSlashReferencePathRegEx) ||
-                textSubStr.match(ts.fullTripleSlashAMDReferencePathRegEx) ||
-                textSubStr.match(fullTripleSlashReferenceTypeReferenceDirectiveRegEx) ||
-                textSubStr.match(defaultLibReferenceRegEx) ?
+            return ts.fullTripleSlashReferencePathRegEx.test(textSubStr) ||
+                ts.fullTripleSlashAMDReferencePathRegEx.test(textSubStr) ||
+                fullTripleSlashReferenceTypeReferenceDirectiveRegEx.test(textSubStr) ||
+                defaultLibReferenceRegEx.test(textSubStr) ?
                 true : false;
         }
         return false;
@@ -13686,7 +14285,7 @@ var ts;
     ts.isPinnedComment = isPinnedComment;
     function createCommentDirectivesMap(sourceFile, commentDirectives) {
         var directivesByLine = new ts.Map(commentDirectives.map(function (commentDirective) { return ([
-            "" + ts.getLineAndCharacterOfPosition(sourceFile, commentDirective.range.end).line,
+            "".concat(ts.getLineAndCharacterOfPosition(sourceFile, commentDirective.range.end).line),
             commentDirective,
         ]); }));
         var usedLines = new ts.Map();
@@ -13703,10 +14302,10 @@ var ts;
             });
         }
         function markUsed(line) {
-            if (!directivesByLine.has("" + line)) {
+            if (!directivesByLine.has("".concat(line))) {
                 return false;
             }
-            usedLines.set("" + line, true);
+            usedLines.set("".concat(line), true);
             return true;
         }
     }
@@ -13728,10 +14327,12 @@ var ts;
         // the syntax list itself considers them as normal trivia. Therefore if we simply skip
         // trivia for the list, we may have skipped the JSDocComment as well. So we should process its
         // first child to determine the actual position of its first token.
-        if (node.kind === 334 /* SyntaxList */ && node._children.length > 0) {
+        if (node.kind === 346 /* SyntaxList */ && node._children.length > 0) {
             return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc);
         }
-        return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos);
+        return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos, 
+        /*stopAfterLineBreak*/ false, 
+        /*stopAtComments*/ false, isInJSDoc(node));
     }
     ts.getTokenPosOfNode = getTokenPosOfNode;
     function getNonDecoratorTokenPosOfNode(node, sourceFile) {
@@ -13761,7 +14362,7 @@ var ts;
         var text = sourceText.substring(includeTrivia ? node.pos : ts.skipTrivia(sourceText, node.pos), node.end);
         if (isJSDocTypeExpressionOrChild(node)) {
             // strip space + asterisk at line start
-            text = text.replace(/(^|\r?\n|\r)\s*\*\s*/g, "$1");
+            text = text.split(/\r\n|\n|\r/).map(function (line) { return ts.trimStringStart(line.replace(/^\s*\*/, "")); }).join("\n");
         }
         return text;
     }
@@ -13850,9 +14451,11 @@ var ts;
                 DataView: ["setBigInt64", "setBigUint64", "getBigInt64", "getBigUint64"],
                 RelativeTimeFormat: ["format", "formatToParts", "resolvedOptions"]
             },
-            esnext: {
+            es2021: {
                 PromiseConstructor: ["any"],
-                String: ["replaceAll"],
+                String: ["replaceAll"]
+            },
+            esnext: {
                 NumberFormat: ["formatToParts"]
             }
         };
@@ -13867,6 +14470,7 @@ var ts;
         GetLiteralTextFlags[GetLiteralTextFlags["AllowNumericSeparator"] = 8] = "AllowNumericSeparator";
     })(GetLiteralTextFlags = ts.GetLiteralTextFlags || (ts.GetLiteralTextFlags = {}));
     function getLiteralText(node, sourceFile, flags) {
+        var _a;
         // If we don't need to downlevel and we can reach the original source text using
         // the node's parent reference, then simply get the text as it was originally written.
         if (canUseOriginalText(node, flags)) {
@@ -13894,7 +14498,7 @@ var ts;
                 // had to include a backslash: `not \${a} substitution`.
                 var escapeText = flags & 1 /* NeverAsciiEscape */ || (getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? escapeString :
                     escapeNonAsciiString;
-                var rawText = node.rawText || escapeTemplateSubstitution(escapeText(node.text, 96 /* backtick */));
+                var rawText = (_a = node.rawText) !== null && _a !== void 0 ? _a : escapeTemplateSubstitution(escapeText(node.text, 96 /* backtick */));
                 switch (node.kind) {
                     case 14 /* NoSubstitutionTemplateLiteral */:
                         return "`" + rawText + "`";
@@ -13916,7 +14520,7 @@ var ts;
                 }
                 return node.text;
         }
-        return ts.Debug.fail("Literal kind '" + node.kind + "' not accounted for.");
+        return ts.Debug.fail("Literal kind '".concat(node.kind, "' not accounted for."));
     }
     ts.getLiteralText = getLiteralText;
     function canUseOriginalText(node, flags) {
@@ -13945,7 +14549,7 @@ var ts;
     ts.isBlockOrCatchScoped = isBlockOrCatchScoped;
     function isCatchClauseVariableDeclarationOrBindingElement(declaration) {
         var node = getRootDeclaration(declaration);
-        return node.kind === 249 /* VariableDeclaration */ && node.parent.kind === 287 /* CatchClause */;
+        return node.kind === 253 /* VariableDeclaration */ && node.parent.kind === 291 /* CatchClause */;
     }
     ts.isCatchClauseVariableDeclarationOrBindingElement = isCatchClauseVariableDeclarationOrBindingElement;
     function isAmbientModule(node) {
@@ -13977,12 +14581,12 @@ var ts;
     ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol;
     function isShorthandAmbientModule(node) {
         // The only kind of module that can be missing a body is a shorthand ambient module.
-        return node && node.kind === 256 /* ModuleDeclaration */ && (!node.body);
+        return !!node && node.kind === 260 /* ModuleDeclaration */ && (!node.body);
     }
     function isBlockScopedContainerTopLevel(node) {
-        return node.kind === 297 /* SourceFile */ ||
-            node.kind === 256 /* ModuleDeclaration */ ||
-            ts.isFunctionLike(node);
+        return node.kind === 303 /* SourceFile */ ||
+            node.kind === 260 /* ModuleDeclaration */ ||
+            ts.isFunctionLikeOrClassStaticBlockDeclaration(node);
     }
     ts.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel;
     function isGlobalScopeAugmentation(module) {
@@ -13998,20 +14602,24 @@ var ts;
         // - defined in the top level scope and source file is an external module
         // - defined inside ambient module declaration located in the top level scope and source file not an external module
         switch (node.parent.kind) {
-            case 297 /* SourceFile */:
+            case 303 /* SourceFile */:
                 return ts.isExternalModule(node.parent);
-            case 257 /* ModuleBlock */:
+            case 261 /* ModuleBlock */:
                 return isAmbientModule(node.parent.parent) && ts.isSourceFile(node.parent.parent.parent) && !ts.isExternalModule(node.parent.parent.parent);
         }
         return false;
     }
     ts.isModuleAugmentationExternal = isModuleAugmentationExternal;
     function getNonAugmentationDeclaration(symbol) {
-        return ts.find(symbol.declarations, function (d) { return !isExternalModuleAugmentation(d) && !(ts.isModuleDeclaration(d) && isGlobalScopeAugmentation(d)); });
+        var _a;
+        return (_a = symbol.declarations) === null || _a === void 0 ? void 0 : _a.find(function (d) { return !isExternalModuleAugmentation(d) && !(ts.isModuleDeclaration(d) && isGlobalScopeAugmentation(d)); });
     }
     ts.getNonAugmentationDeclaration = getNonAugmentationDeclaration;
+    function isCommonJSContainingModuleKind(kind) {
+        return kind === ts.ModuleKind.CommonJS || kind === ts.ModuleKind.Node12 || kind === ts.ModuleKind.NodeNext;
+    }
     function isEffectiveExternalModule(node, compilerOptions) {
-        return ts.isExternalModule(node) || compilerOptions.isolatedModules || ((getEmitModuleKind(compilerOptions) === ts.ModuleKind.CommonJS) && !!node.commonJsModuleIndicator);
+        return ts.isExternalModule(node) || compilerOptions.isolatedModules || (isCommonJSContainingModuleKind(getEmitModuleKind(compilerOptions)) && !!node.commonJsModuleIndicator);
     }
     ts.isEffectiveExternalModule = isEffectiveExternalModule;
     /**
@@ -14053,34 +14661,36 @@ var ts;
     ts.isEffectiveStrictModeSourceFile = isEffectiveStrictModeSourceFile;
     function isBlockScope(node, parentNode) {
         switch (node.kind) {
-            case 297 /* SourceFile */:
-            case 258 /* CaseBlock */:
-            case 287 /* CatchClause */:
-            case 256 /* ModuleDeclaration */:
-            case 237 /* ForStatement */:
-            case 238 /* ForInStatement */:
-            case 239 /* ForOfStatement */:
-            case 166 /* Constructor */:
-            case 165 /* MethodDeclaration */:
-            case 167 /* GetAccessor */:
-            case 168 /* SetAccessor */:
-            case 251 /* FunctionDeclaration */:
-            case 208 /* FunctionExpression */:
-            case 209 /* ArrowFunction */:
+            case 303 /* SourceFile */:
+            case 262 /* CaseBlock */:
+            case 291 /* CatchClause */:
+            case 260 /* ModuleDeclaration */:
+            case 241 /* ForStatement */:
+            case 242 /* ForInStatement */:
+            case 243 /* ForOfStatement */:
+            case 170 /* Constructor */:
+            case 168 /* MethodDeclaration */:
+            case 171 /* GetAccessor */:
+            case 172 /* SetAccessor */:
+            case 255 /* FunctionDeclaration */:
+            case 212 /* FunctionExpression */:
+            case 213 /* ArrowFunction */:
+            case 166 /* PropertyDeclaration */:
+            case 169 /* ClassStaticBlockDeclaration */:
                 return true;
-            case 230 /* Block */:
+            case 234 /* Block */:
                 // function block is not considered block-scope container
                 // see comment in binder.ts: bind(...), case for SyntaxKind.Block
-                return !ts.isFunctionLike(parentNode);
+                return !ts.isFunctionLikeOrClassStaticBlockDeclaration(parentNode);
         }
         return false;
     }
     ts.isBlockScope = isBlockScope;
     function isDeclarationWithTypeParameters(node) {
         switch (node.kind) {
-            case 324 /* JSDocCallbackTag */:
-            case 331 /* JSDocTypedefTag */:
-            case 313 /* JSDocSignature */:
+            case 336 /* JSDocCallbackTag */:
+            case 343 /* JSDocTypedefTag */:
+            case 321 /* JSDocSignature */:
                 return true;
             default:
                 ts.assertType(node);
@@ -14090,25 +14700,25 @@ var ts;
     ts.isDeclarationWithTypeParameters = isDeclarationWithTypeParameters;
     function isDeclarationWithTypeParameterChildren(node) {
         switch (node.kind) {
-            case 169 /* CallSignature */:
-            case 170 /* ConstructSignature */:
-            case 164 /* MethodSignature */:
-            case 171 /* IndexSignature */:
-            case 174 /* FunctionType */:
-            case 175 /* ConstructorType */:
-            case 308 /* JSDocFunctionType */:
-            case 252 /* ClassDeclaration */:
-            case 221 /* ClassExpression */:
-            case 253 /* InterfaceDeclaration */:
-            case 254 /* TypeAliasDeclaration */:
-            case 330 /* JSDocTemplateTag */:
-            case 251 /* FunctionDeclaration */:
-            case 165 /* MethodDeclaration */:
-            case 166 /* Constructor */:
-            case 167 /* GetAccessor */:
-            case 168 /* SetAccessor */:
-            case 208 /* FunctionExpression */:
-            case 209 /* ArrowFunction */:
+            case 173 /* CallSignature */:
+            case 174 /* ConstructSignature */:
+            case 167 /* MethodSignature */:
+            case 175 /* IndexSignature */:
+            case 178 /* FunctionType */:
+            case 179 /* ConstructorType */:
+            case 315 /* JSDocFunctionType */:
+            case 256 /* ClassDeclaration */:
+            case 225 /* ClassExpression */:
+            case 257 /* InterfaceDeclaration */:
+            case 258 /* TypeAliasDeclaration */:
+            case 342 /* JSDocTemplateTag */:
+            case 255 /* FunctionDeclaration */:
+            case 168 /* MethodDeclaration */:
+            case 170 /* Constructor */:
+            case 171 /* GetAccessor */:
+            case 172 /* SetAccessor */:
+            case 212 /* FunctionExpression */:
+            case 213 /* ArrowFunction */:
                 return true;
             default:
                 ts.assertType(node);
@@ -14118,8 +14728,8 @@ var ts;
     ts.isDeclarationWithTypeParameterChildren = isDeclarationWithTypeParameterChildren;
     function isAnyImportSyntax(node) {
         switch (node.kind) {
-            case 261 /* ImportDeclaration */:
-            case 260 /* ImportEqualsDeclaration */:
+            case 265 /* ImportDeclaration */:
+            case 264 /* ImportEqualsDeclaration */:
                 return true;
             default:
                 return false;
@@ -14128,15 +14738,15 @@ var ts;
     ts.isAnyImportSyntax = isAnyImportSyntax;
     function isLateVisibilityPaintedStatement(node) {
         switch (node.kind) {
-            case 261 /* ImportDeclaration */:
-            case 260 /* ImportEqualsDeclaration */:
-            case 232 /* VariableStatement */:
-            case 252 /* ClassDeclaration */:
-            case 251 /* FunctionDeclaration */:
-            case 256 /* ModuleDeclaration */:
-            case 254 /* TypeAliasDeclaration */:
-            case 253 /* InterfaceDeclaration */:
-            case 255 /* EnumDeclaration */:
+            case 265 /* ImportDeclaration */:
+            case 264 /* ImportEqualsDeclaration */:
+            case 236 /* VariableStatement */:
+            case 256 /* ClassDeclaration */:
+            case 255 /* FunctionDeclaration */:
+            case 260 /* ModuleDeclaration */:
+            case 258 /* TypeAliasDeclaration */:
+            case 257 /* InterfaceDeclaration */:
+            case 259 /* EnumDeclaration */:
                 return true;
             default:
                 return false;
@@ -14157,6 +14767,14 @@ var ts;
         return ts.findAncestor(node.parent, function (current) { return isBlockScope(current, current.parent); });
     }
     ts.getEnclosingBlockScopeContainer = getEnclosingBlockScopeContainer;
+    function forEachEnclosingBlockScopeContainer(node, cb) {
+        var container = getEnclosingBlockScopeContainer(node);
+        while (container) {
+            cb(container);
+            container = getEnclosingBlockScopeContainer(container);
+        }
+    }
+    ts.forEachEnclosingBlockScopeContainer = forEachEnclosingBlockScopeContainer;
     // Return display name of an identifier
     // Computed property names will just be emitted as "[<expr>]", where <expr> is the source
     // text of the expression in the computed property.
@@ -14169,19 +14787,19 @@ var ts;
     }
     ts.getNameFromIndexInfo = getNameFromIndexInfo;
     function isComputedNonLiteralName(name) {
-        return name.kind === 158 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression);
+        return name.kind === 161 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression);
     }
     ts.isComputedNonLiteralName = isComputedNonLiteralName;
     function getTextOfPropertyName(name) {
         switch (name.kind) {
-            case 78 /* Identifier */:
-            case 79 /* PrivateIdentifier */:
+            case 79 /* Identifier */:
+            case 80 /* PrivateIdentifier */:
                 return name.escapedText;
             case 10 /* StringLiteral */:
             case 8 /* NumericLiteral */:
             case 14 /* NoSubstitutionTemplateLiteral */:
                 return ts.escapeLeadingUnderscores(name.text);
-            case 158 /* ComputedPropertyName */:
+            case 161 /* ComputedPropertyName */:
                 if (isStringOrNumericLiteralLike(name.expression))
                     return ts.escapeLeadingUnderscores(name.expression.text);
                 return ts.Debug.fail("Text of property name cannot be read from non-literal-valued ComputedPropertyNames");
@@ -14192,20 +14810,22 @@ var ts;
     ts.getTextOfPropertyName = getTextOfPropertyName;
     function entityNameToString(name) {
         switch (name.kind) {
-            case 107 /* ThisKeyword */:
+            case 108 /* ThisKeyword */:
                 return "this";
-            case 79 /* PrivateIdentifier */:
-            case 78 /* Identifier */:
+            case 80 /* PrivateIdentifier */:
+            case 79 /* Identifier */:
                 return getFullWidth(name) === 0 ? ts.idText(name) : getTextOfNode(name);
-            case 157 /* QualifiedName */:
+            case 160 /* QualifiedName */:
                 return entityNameToString(name.left) + "." + entityNameToString(name.right);
-            case 201 /* PropertyAccessExpression */:
+            case 205 /* PropertyAccessExpression */:
                 if (ts.isIdentifier(name.name) || ts.isPrivateIdentifier(name.name)) {
                     return entityNameToString(name.expression) + "." + entityNameToString(name.name);
                 }
                 else {
                     return ts.Debug.assertNever(name.name);
                 }
+            case 309 /* JSDocMemberName */:
+                return entityNameToString(name.left) + entityNameToString(name.right);
             default:
                 return ts.Debug.assertNever(name);
         }
@@ -14285,7 +14905,7 @@ var ts;
     ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition;
     function getErrorSpanForArrowFunction(sourceFile, node) {
         var pos = ts.skipTrivia(sourceFile.text, node.pos);
-        if (node.body && node.body.kind === 230 /* Block */) {
+        if (node.body && node.body.kind === 234 /* Block */) {
             var startLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line;
             var endLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.end).line;
             if (startLine < endLine) {
@@ -14299,7 +14919,7 @@ var ts;
     function getErrorSpanForNode(sourceFile, node) {
         var errorNode = node;
         switch (node.kind) {
-            case 297 /* SourceFile */:
+            case 303 /* SourceFile */:
                 var pos_1 = ts.skipTrivia(sourceFile.text, 0, /*stopAfterLineBreak*/ false);
                 if (pos_1 === sourceFile.text.length) {
                     // file is empty - return span for the beginning of the file
@@ -14308,28 +14928,29 @@ var ts;
                 return getSpanOfTokenAtPosition(sourceFile, pos_1);
             // This list is a work in progress. Add missing node kinds to improve their error
             // spans.
-            case 249 /* VariableDeclaration */:
-            case 198 /* BindingElement */:
-            case 252 /* ClassDeclaration */:
-            case 221 /* ClassExpression */:
-            case 253 /* InterfaceDeclaration */:
-            case 256 /* ModuleDeclaration */:
-            case 255 /* EnumDeclaration */:
-            case 291 /* EnumMember */:
-            case 251 /* FunctionDeclaration */:
-            case 208 /* FunctionExpression */:
-            case 165 /* MethodDeclaration */:
-            case 167 /* GetAccessor */:
-            case 168 /* SetAccessor */:
-            case 254 /* TypeAliasDeclaration */:
-            case 163 /* PropertyDeclaration */:
-            case 162 /* PropertySignature */:
+            case 253 /* VariableDeclaration */:
+            case 202 /* BindingElement */:
+            case 256 /* ClassDeclaration */:
+            case 225 /* ClassExpression */:
+            case 257 /* InterfaceDeclaration */:
+            case 260 /* ModuleDeclaration */:
+            case 259 /* EnumDeclaration */:
+            case 297 /* EnumMember */:
+            case 255 /* FunctionDeclaration */:
+            case 212 /* FunctionExpression */:
+            case 168 /* MethodDeclaration */:
+            case 171 /* GetAccessor */:
+            case 172 /* SetAccessor */:
+            case 258 /* TypeAliasDeclaration */:
+            case 166 /* PropertyDeclaration */:
+            case 165 /* PropertySignature */:
+            case 267 /* NamespaceImport */:
                 errorNode = node.name;
                 break;
-            case 209 /* ArrowFunction */:
+            case 213 /* ArrowFunction */:
                 return getErrorSpanForArrowFunction(sourceFile, node);
-            case 284 /* CaseClause */:
-            case 285 /* DefaultClause */:
+            case 288 /* CaseClause */:
+            case 289 /* DefaultClause */:
                 var start = ts.skipTrivia(sourceFile.text, node.pos);
                 var end = node.statements.length > 0 ? node.statements[0].pos : node.end;
                 return ts.createTextSpanFromBounds(start, end);
@@ -14381,16 +15002,16 @@ var ts;
     }
     ts.isLet = isLet;
     function isSuperCall(n) {
-        return n.kind === 203 /* CallExpression */ && n.expression.kind === 105 /* SuperKeyword */;
+        return n.kind === 207 /* CallExpression */ && n.expression.kind === 106 /* SuperKeyword */;
     }
     ts.isSuperCall = isSuperCall;
     function isImportCall(n) {
-        return n.kind === 203 /* CallExpression */ && n.expression.kind === 99 /* ImportKeyword */;
+        return n.kind === 207 /* CallExpression */ && n.expression.kind === 100 /* ImportKeyword */;
     }
     ts.isImportCall = isImportCall;
     function isImportMeta(n) {
         return ts.isMetaProperty(n)
-            && n.keywordToken === 99 /* ImportKeyword */
+            && n.keywordToken === 100 /* ImportKeyword */
             && n.name.escapedText === "meta";
     }
     ts.isImportMeta = isImportMeta;
@@ -14399,7 +15020,7 @@ var ts;
     }
     ts.isLiteralImportTypeNode = isLiteralImportTypeNode;
     function isPrologueDirective(node) {
-        return node.kind === 233 /* ExpressionStatement */
+        return node.kind === 237 /* ExpressionStatement */
             && node.expression.kind === 10 /* StringLiteral */;
     }
     ts.isPrologueDirective = isPrologueDirective;
@@ -14427,11 +15048,12 @@ var ts;
     }
     ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode;
     function getJSDocCommentRanges(node, text) {
-        var commentRanges = (node.kind === 160 /* Parameter */ ||
-            node.kind === 159 /* TypeParameter */ ||
-            node.kind === 208 /* FunctionExpression */ ||
-            node.kind === 209 /* ArrowFunction */ ||
-            node.kind === 207 /* ParenthesizedExpression */) ?
+        var commentRanges = (node.kind === 163 /* Parameter */ ||
+            node.kind === 162 /* TypeParameter */ ||
+            node.kind === 212 /* FunctionExpression */ ||
+            node.kind === 213 /* ArrowFunction */ ||
+            node.kind === 211 /* ParenthesizedExpression */ ||
+            node.kind === 253 /* VariableDeclaration */) ?
             ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) :
             ts.getLeadingCommentRanges(text, node.pos);
         // True if the comment starts with '/**' but not if it is '/**/'
@@ -14442,53 +15064,53 @@ var ts;
         });
     }
     ts.getJSDocCommentRanges = getJSDocCommentRanges;
-    ts.fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*<reference\s+path\s*=\s*)('|")(.+?)\2.*?\/>/;
-    var fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^(\/\/\/\s*<reference\s+types\s*=\s*)('|")(.+?)\2.*?\/>/;
-    ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*<amd-dependency\s+path\s*=\s*)('|")(.+?)\2.*?\/>/;
-    var defaultLibReferenceRegEx = /^(\/\/\/\s*<reference\s+no-default-lib\s*=\s*)('|")(.+?)\2\s*\/>/;
+    ts.fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*<reference\s+path\s*=\s*)(('[^']*')|("[^"]*")).*?\/>/;
+    var fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^(\/\/\/\s*<reference\s+types\s*=\s*)(('[^']*')|("[^"]*")).*?\/>/;
+    ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*<amd-dependency\s+path\s*=\s*)(('[^']*')|("[^"]*")).*?\/>/;
+    var defaultLibReferenceRegEx = /^(\/\/\/\s*<reference\s+no-default-lib\s*=\s*)(('[^']*')|("[^"]*"))\s*\/>/;
     function isPartOfTypeNode(node) {
-        if (172 /* FirstTypeNode */ <= node.kind && node.kind <= 195 /* LastTypeNode */) {
+        if (176 /* FirstTypeNode */ <= node.kind && node.kind <= 199 /* LastTypeNode */) {
             return true;
         }
         switch (node.kind) {
-            case 128 /* AnyKeyword */:
-            case 152 /* UnknownKeyword */:
-            case 144 /* NumberKeyword */:
-            case 155 /* BigIntKeyword */:
-            case 147 /* StringKeyword */:
-            case 131 /* BooleanKeyword */:
-            case 148 /* SymbolKeyword */:
-            case 145 /* ObjectKeyword */:
-            case 150 /* UndefinedKeyword */:
-            case 141 /* NeverKeyword */:
+            case 130 /* AnyKeyword */:
+            case 154 /* UnknownKeyword */:
+            case 146 /* NumberKeyword */:
+            case 157 /* BigIntKeyword */:
+            case 149 /* StringKeyword */:
+            case 133 /* BooleanKeyword */:
+            case 150 /* SymbolKeyword */:
+            case 147 /* ObjectKeyword */:
+            case 152 /* UndefinedKeyword */:
+            case 143 /* NeverKeyword */:
                 return true;
-            case 113 /* VoidKeyword */:
-                return node.parent.kind !== 212 /* VoidExpression */;
-            case 223 /* ExpressionWithTypeArguments */:
+            case 114 /* VoidKeyword */:
+                return node.parent.kind !== 216 /* VoidExpression */;
+            case 227 /* ExpressionWithTypeArguments */:
                 return !isExpressionWithTypeArgumentsInClassExtendsClause(node);
-            case 159 /* TypeParameter */:
-                return node.parent.kind === 190 /* MappedType */ || node.parent.kind === 185 /* InferType */;
+            case 162 /* TypeParameter */:
+                return node.parent.kind === 194 /* MappedType */ || node.parent.kind === 189 /* InferType */;
             // Identifiers and qualified names may be type nodes, depending on their context. Climb
             // above them to find the lowest container
-            case 78 /* Identifier */:
+            case 79 /* Identifier */:
                 // If the identifier is the RHS of a qualified name, then it's a type iff its parent is.
-                if (node.parent.kind === 157 /* QualifiedName */ && node.parent.right === node) {
+                if (node.parent.kind === 160 /* QualifiedName */ && node.parent.right === node) {
                     node = node.parent;
                 }
-                else if (node.parent.kind === 201 /* PropertyAccessExpression */ && node.parent.name === node) {
+                else if (node.parent.kind === 205 /* PropertyAccessExpression */ && node.parent.name === node) {
                     node = node.parent;
                 }
                 // At this point, node is either a qualified name or an identifier
-                ts.Debug.assert(node.kind === 78 /* Identifier */ || node.kind === 157 /* QualifiedName */ || node.kind === 201 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'.");
+                ts.Debug.assert(node.kind === 79 /* Identifier */ || node.kind === 160 /* QualifiedName */ || node.kind === 205 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'.");
             // falls through
-            case 157 /* QualifiedName */:
-            case 201 /* PropertyAccessExpression */:
-            case 107 /* ThisKeyword */: {
+            case 160 /* QualifiedName */:
+            case 205 /* PropertyAccessExpression */:
+            case 108 /* ThisKeyword */: {
                 var parent = node.parent;
-                if (parent.kind === 176 /* TypeQuery */) {
+                if (parent.kind === 180 /* TypeQuery */) {
                     return false;
                 }
-                if (parent.kind === 195 /* ImportType */) {
+                if (parent.kind === 199 /* ImportType */) {
                     return !parent.isTypeOf;
                 }
                 // Do not recursively call isPartOfTypeNode on the parent. In the example:
@@ -14497,40 +15119,40 @@ var ts;
                 //
                 // Calling isPartOfTypeNode would consider the qualified name A.B a type node.
                 // Only C and A.B.C are type nodes.
-                if (172 /* FirstTypeNode */ <= parent.kind && parent.kind <= 195 /* LastTypeNode */) {
+                if (176 /* FirstTypeNode */ <= parent.kind && parent.kind <= 199 /* LastTypeNode */) {
                     return true;
                 }
                 switch (parent.kind) {
-                    case 223 /* ExpressionWithTypeArguments */:
+                    case 227 /* ExpressionWithTypeArguments */:
                         return !isExpressionWithTypeArgumentsInClassExtendsClause(parent);
-                    case 159 /* TypeParameter */:
+                    case 162 /* TypeParameter */:
                         return node === parent.constraint;
-                    case 330 /* JSDocTemplateTag */:
+                    case 342 /* JSDocTemplateTag */:
                         return node === parent.constraint;
-                    case 163 /* PropertyDeclaration */:
-                    case 162 /* PropertySignature */:
-                    case 160 /* Parameter */:
-                    case 249 /* VariableDeclaration */:
+                    case 166 /* PropertyDeclaration */:
+                    case 165 /* PropertySignature */:
+                    case 163 /* Parameter */:
+                    case 253 /* VariableDeclaration */:
                         return node === parent.type;
-                    case 251 /* FunctionDeclaration */:
-                    case 208 /* FunctionExpression */:
-                    case 209 /* ArrowFunction */:
-                    case 166 /* Constructor */:
-                    case 165 /* MethodDeclaration */:
-                    case 164 /* MethodSignature */:
-                    case 167 /* GetAccessor */:
-                    case 168 /* SetAccessor */:
+                    case 255 /* FunctionDeclaration */:
+                    case 212 /* FunctionExpression */:
+                    case 213 /* ArrowFunction */:
+                    case 170 /* Constructor */:
+                    case 168 /* MethodDeclaration */:
+                    case 167 /* MethodSignature */:
+                    case 171 /* GetAccessor */:
+                    case 172 /* SetAccessor */:
                         return node === parent.type;
-                    case 169 /* CallSignature */:
-                    case 170 /* ConstructSignature */:
-                    case 171 /* IndexSignature */:
+                    case 173 /* CallSignature */:
+                    case 174 /* ConstructSignature */:
+                    case 175 /* IndexSignature */:
                         return node === parent.type;
-                    case 206 /* TypeAssertionExpression */:
+                    case 210 /* TypeAssertionExpression */:
                         return node === parent.type;
-                    case 203 /* CallExpression */:
-                    case 204 /* NewExpression */:
+                    case 207 /* CallExpression */:
+                    case 208 /* NewExpression */:
                         return ts.contains(parent.typeArguments, node);
-                    case 205 /* TaggedTemplateExpression */:
+                    case 209 /* TaggedTemplateExpression */:
                         // TODO (drosen): TaggedTemplateExpressions may eventually support type arguments.
                         return false;
                 }
@@ -14555,23 +15177,23 @@ var ts;
         return traverse(body);
         function traverse(node) {
             switch (node.kind) {
-                case 242 /* ReturnStatement */:
+                case 246 /* ReturnStatement */:
                     return visitor(node);
-                case 258 /* CaseBlock */:
-                case 230 /* Block */:
-                case 234 /* IfStatement */:
-                case 235 /* DoStatement */:
-                case 236 /* WhileStatement */:
-                case 237 /* ForStatement */:
-                case 238 /* ForInStatement */:
-                case 239 /* ForOfStatement */:
-                case 243 /* WithStatement */:
-                case 244 /* SwitchStatement */:
-                case 284 /* CaseClause */:
-                case 285 /* DefaultClause */:
-                case 245 /* LabeledStatement */:
-                case 247 /* TryStatement */:
-                case 287 /* CatchClause */:
+                case 262 /* CaseBlock */:
+                case 234 /* Block */:
+                case 238 /* IfStatement */:
+                case 239 /* DoStatement */:
+                case 240 /* WhileStatement */:
+                case 241 /* ForStatement */:
+                case 242 /* ForInStatement */:
+                case 243 /* ForOfStatement */:
+                case 247 /* WithStatement */:
+                case 248 /* SwitchStatement */:
+                case 288 /* CaseClause */:
+                case 289 /* DefaultClause */:
+                case 249 /* LabeledStatement */:
+                case 251 /* TryStatement */:
+                case 291 /* CatchClause */:
                     return ts.forEachChild(node, traverse);
             }
         }
@@ -14581,23 +15203,23 @@ var ts;
         return traverse(body);
         function traverse(node) {
             switch (node.kind) {
-                case 219 /* YieldExpression */:
+                case 223 /* YieldExpression */:
                     visitor(node);
                     var operand = node.expression;
                     if (operand) {
                         traverse(operand);
                     }
                     return;
-                case 255 /* EnumDeclaration */:
-                case 253 /* InterfaceDeclaration */:
-                case 256 /* ModuleDeclaration */:
-                case 254 /* TypeAliasDeclaration */:
+                case 259 /* EnumDeclaration */:
+                case 257 /* InterfaceDeclaration */:
+                case 260 /* ModuleDeclaration */:
+                case 258 /* TypeAliasDeclaration */:
                     // These are not allowed inside a generator now, but eventually they may be allowed
                     // as local types. Regardless, skip them to avoid the work.
                     return;
                 default:
                     if (ts.isFunctionLike(node)) {
-                        if (node.name && node.name.kind === 158 /* ComputedPropertyName */) {
+                        if (node.name && node.name.kind === 161 /* ComputedPropertyName */) {
                             // Note that we will not include methods/accessors of a class because they would require
                             // first descending into the class. This is by design.
                             traverse(node.name.expression);
@@ -14620,10 +15242,10 @@ var ts;
      * @param node The type node.
      */
     function getRestParameterElementType(node) {
-        if (node && node.kind === 178 /* ArrayType */) {
+        if (node && node.kind === 182 /* ArrayType */) {
             return node.elementType;
         }
-        else if (node && node.kind === 173 /* TypeReference */) {
+        else if (node && node.kind === 177 /* TypeReference */) {
             return ts.singleOrUndefined(node.typeArguments);
         }
         else {
@@ -14633,12 +15255,12 @@ var ts;
     ts.getRestParameterElementType = getRestParameterElementType;
     function getMembersOfDeclaration(node) {
         switch (node.kind) {
-            case 253 /* InterfaceDeclaration */:
-            case 252 /* ClassDeclaration */:
-            case 221 /* ClassExpression */:
-            case 177 /* TypeLiteral */:
+            case 257 /* InterfaceDeclaration */:
+            case 256 /* ClassDeclaration */:
+            case 225 /* ClassExpression */:
+            case 181 /* TypeLiteral */:
                 return node.members;
-            case 200 /* ObjectLiteralExpression */:
+            case 204 /* ObjectLiteralExpression */:
                 return node.properties;
         }
     }
@@ -14646,14 +15268,14 @@ var ts;
     function isVariableLike(node) {
         if (node) {
             switch (node.kind) {
-                case 198 /* BindingElement */:
-                case 291 /* EnumMember */:
-                case 160 /* Parameter */:
-                case 288 /* PropertyAssignment */:
-                case 163 /* PropertyDeclaration */:
-                case 162 /* PropertySignature */:
-                case 289 /* ShorthandPropertyAssignment */:
-                case 249 /* VariableDeclaration */:
+                case 202 /* BindingElement */:
+                case 297 /* EnumMember */:
+                case 163 /* Parameter */:
+                case 294 /* PropertyAssignment */:
+                case 166 /* PropertyDeclaration */:
+                case 165 /* PropertySignature */:
+                case 295 /* ShorthandPropertyAssignment */:
+                case 253 /* VariableDeclaration */:
                     return true;
             }
         }
@@ -14665,8 +15287,8 @@ var ts;
     }
     ts.isVariableLikeOrAccessor = isVariableLikeOrAccessor;
     function isVariableDeclarationInVariableStatement(node) {
-        return node.parent.kind === 250 /* VariableDeclarationList */
-            && node.parent.parent.kind === 232 /* VariableStatement */;
+        return node.parent.kind === 254 /* VariableDeclarationList */
+            && node.parent.parent.kind === 236 /* VariableStatement */;
     }
     ts.isVariableDeclarationInVariableStatement = isVariableDeclarationInVariableStatement;
     function isValidESSymbolDeclaration(node) {
@@ -14677,13 +15299,13 @@ var ts;
     ts.isValidESSymbolDeclaration = isValidESSymbolDeclaration;
     function introducesArgumentsExoticObject(node) {
         switch (node.kind) {
-            case 165 /* MethodDeclaration */:
-            case 164 /* MethodSignature */:
-            case 166 /* Constructor */:
-            case 167 /* GetAccessor */:
-            case 168 /* SetAccessor */:
-            case 251 /* FunctionDeclaration */:
-            case 208 /* FunctionExpression */:
+            case 168 /* MethodDeclaration */:
+            case 167 /* MethodSignature */:
+            case 170 /* Constructor */:
+            case 171 /* GetAccessor */:
+            case 172 /* SetAccessor */:
+            case 255 /* FunctionDeclaration */:
+            case 212 /* FunctionExpression */:
                 return true;
         }
         return false;
@@ -14694,7 +15316,7 @@ var ts;
             if (beforeUnwrapLabelCallback) {
                 beforeUnwrapLabelCallback(node);
             }
-            if (node.statement.kind !== 245 /* LabeledStatement */) {
+            if (node.statement.kind !== 249 /* LabeledStatement */) {
                 return node.statement;
             }
             node = node.statement;
@@ -14702,19 +15324,19 @@ var ts;
     }
     ts.unwrapInnermostStatementOfLabel = unwrapInnermostStatementOfLabel;
     function isFunctionBlock(node) {
-        return node && node.kind === 230 /* Block */ && ts.isFunctionLike(node.parent);
+        return node && node.kind === 234 /* Block */ && ts.isFunctionLike(node.parent);
     }
     ts.isFunctionBlock = isFunctionBlock;
     function isObjectLiteralMethod(node) {
-        return node && node.kind === 165 /* MethodDeclaration */ && node.parent.kind === 200 /* ObjectLiteralExpression */;
+        return node && node.kind === 168 /* MethodDeclaration */ && node.parent.kind === 204 /* ObjectLiteralExpression */;
     }
     ts.isObjectLiteralMethod = isObjectLiteralMethod;
-    function isObjectLiteralOrClassExpressionMethod(node) {
-        return node.kind === 165 /* MethodDeclaration */ &&
-            (node.parent.kind === 200 /* ObjectLiteralExpression */ ||
-                node.parent.kind === 221 /* ClassExpression */);
+    function isObjectLiteralOrClassExpressionMethodOrAccessor(node) {
+        return (node.kind === 168 /* MethodDeclaration */ || node.kind === 171 /* GetAccessor */ || node.kind === 172 /* SetAccessor */) &&
+            (node.parent.kind === 204 /* ObjectLiteralExpression */ ||
+                node.parent.kind === 225 /* ClassExpression */);
     }
-    ts.isObjectLiteralOrClassExpressionMethod = isObjectLiteralOrClassExpressionMethod;
+    ts.isObjectLiteralOrClassExpressionMethodOrAccessor = isObjectLiteralOrClassExpressionMethodOrAccessor;
     function isIdentifierTypePredicate(predicate) {
         return predicate && predicate.kind === 1 /* Identifier */;
     }
@@ -14725,7 +15347,7 @@ var ts;
     ts.isThisTypePredicate = isThisTypePredicate;
     function getPropertyAssignment(objectLiteral, key, key2) {
         return objectLiteral.properties.filter(function (property) {
-            if (property.kind === 288 /* PropertyAssignment */) {
+            if (property.kind === 294 /* PropertyAssignment */) {
                 var propName = getTextOfPropertyName(property.name);
                 return key === propName || (!!key2 && key2 === propName);
             }
@@ -14773,15 +15395,28 @@ var ts;
         return ts.findAncestor(node.parent, ts.isClassLike);
     }
     ts.getContainingClass = getContainingClass;
+    function getContainingClassStaticBlock(node) {
+        return ts.findAncestor(node.parent, function (n) {
+            if (ts.isClassLike(n) || ts.isFunctionLike(n)) {
+                return "quit";
+            }
+            return ts.isClassStaticBlockDeclaration(n);
+        });
+    }
+    ts.getContainingClassStaticBlock = getContainingClassStaticBlock;
+    function getContainingFunctionOrClassStaticBlock(node) {
+        return ts.findAncestor(node.parent, ts.isFunctionLikeOrClassStaticBlockDeclaration);
+    }
+    ts.getContainingFunctionOrClassStaticBlock = getContainingFunctionOrClassStaticBlock;
     function getThisContainer(node, includeArrowFunctions) {
-        ts.Debug.assert(node.kind !== 297 /* SourceFile */);
+        ts.Debug.assert(node.kind !== 303 /* SourceFile */);
         while (true) {
             node = node.parent;
             if (!node) {
                 return ts.Debug.fail(); // If we never pass in a SourceFile, this should be unreachable, since we'll stop when we reach that.
             }
             switch (node.kind) {
-                case 158 /* ComputedPropertyName */:
+                case 161 /* ComputedPropertyName */:
                     // If the grandparent node is an object literal (as opposed to a class),
                     // then the computed property is not a 'this' container.
                     // A computed property name in a class needs to be a this container
@@ -14796,9 +15431,9 @@ var ts;
                     // the *body* of the container.
                     node = node.parent;
                     break;
-                case 161 /* Decorator */:
+                case 164 /* Decorator */:
                     // Decorators are always applied outside of the body of a class or method.
-                    if (node.parent.kind === 160 /* Parameter */ && ts.isClassElement(node.parent.parent)) {
+                    if (node.parent.kind === 163 /* Parameter */ && ts.isClassElement(node.parent.parent)) {
                         // If the decorator's parent is a Parameter, we resolve the this container from
                         // the grandparent class declaration.
                         node = node.parent.parent;
@@ -14809,26 +15444,27 @@ var ts;
                         node = node.parent;
                     }
                     break;
-                case 209 /* ArrowFunction */:
+                case 213 /* ArrowFunction */:
                     if (!includeArrowFunctions) {
                         continue;
                     }
                 // falls through
-                case 251 /* FunctionDeclaration */:
-                case 208 /* FunctionExpression */:
-                case 256 /* ModuleDeclaration */:
-                case 163 /* PropertyDeclaration */:
-                case 162 /* PropertySignature */:
-                case 165 /* MethodDeclaration */:
-                case 164 /* MethodSignature */:
-                case 166 /* Constructor */:
-                case 167 /* GetAccessor */:
-                case 168 /* SetAccessor */:
-                case 169 /* CallSignature */:
-                case 170 /* ConstructSignature */:
-                case 171 /* IndexSignature */:
-                case 255 /* EnumDeclaration */:
-                case 297 /* SourceFile */:
+                case 255 /* FunctionDeclaration */:
+                case 212 /* FunctionExpression */:
+                case 260 /* ModuleDeclaration */:
+                case 169 /* ClassStaticBlockDeclaration */:
+                case 166 /* PropertyDeclaration */:
+                case 165 /* PropertySignature */:
+                case 168 /* MethodDeclaration */:
+                case 167 /* MethodSignature */:
+                case 170 /* Constructor */:
+                case 171 /* GetAccessor */:
+                case 172 /* SetAccessor */:
+                case 173 /* CallSignature */:
+                case 174 /* ConstructSignature */:
+                case 175 /* IndexSignature */:
+                case 259 /* EnumDeclaration */:
+                case 303 /* SourceFile */:
                     return node;
             }
         }
@@ -14847,9 +15483,9 @@ var ts;
         var container = getThisContainer(node, /*includeArrowFunctions*/ false);
         if (container) {
             switch (container.kind) {
-                case 166 /* Constructor */:
-                case 251 /* FunctionDeclaration */:
-                case 208 /* FunctionExpression */:
+                case 170 /* Constructor */:
+                case 255 /* FunctionDeclaration */:
+                case 212 /* FunctionExpression */:
                     return container;
             }
         }
@@ -14871,27 +15507,28 @@ var ts;
                 return node;
             }
             switch (node.kind) {
-                case 158 /* ComputedPropertyName */:
+                case 161 /* ComputedPropertyName */:
                     node = node.parent;
                     break;
-                case 251 /* FunctionDeclaration */:
-                case 208 /* FunctionExpression */:
-                case 209 /* ArrowFunction */:
+                case 255 /* FunctionDeclaration */:
+                case 212 /* FunctionExpression */:
+                case 213 /* ArrowFunction */:
                     if (!stopOnFunctions) {
                         continue;
                     }
                 // falls through
-                case 163 /* PropertyDeclaration */:
-                case 162 /* PropertySignature */:
-                case 165 /* MethodDeclaration */:
-                case 164 /* MethodSignature */:
-                case 166 /* Constructor */:
-                case 167 /* GetAccessor */:
-                case 168 /* SetAccessor */:
+                case 166 /* PropertyDeclaration */:
+                case 165 /* PropertySignature */:
+                case 168 /* MethodDeclaration */:
+                case 167 /* MethodSignature */:
+                case 170 /* Constructor */:
+                case 171 /* GetAccessor */:
+                case 172 /* SetAccessor */:
+                case 169 /* ClassStaticBlockDeclaration */:
                     return node;
-                case 161 /* Decorator */:
+                case 164 /* Decorator */:
                     // Decorators are always applied outside of the body of a class or method.
-                    if (node.parent.kind === 160 /* Parameter */ && ts.isClassElement(node.parent.parent)) {
+                    if (node.parent.kind === 163 /* Parameter */ && ts.isClassElement(node.parent.parent)) {
                         // If the decorator's parent is a Parameter, we resolve the this container from
                         // the grandparent class declaration.
                         node = node.parent.parent;
@@ -14907,21 +15544,21 @@ var ts;
     }
     ts.getSuperContainer = getSuperContainer;
     function getImmediatelyInvokedFunctionExpression(func) {
-        if (func.kind === 208 /* FunctionExpression */ || func.kind === 209 /* ArrowFunction */) {
+        if (func.kind === 212 /* FunctionExpression */ || func.kind === 213 /* ArrowFunction */) {
             var prev = func;
             var parent = func.parent;
-            while (parent.kind === 207 /* ParenthesizedExpression */) {
+            while (parent.kind === 211 /* ParenthesizedExpression */) {
                 prev = parent;
                 parent = parent.parent;
             }
-            if (parent.kind === 203 /* CallExpression */ && parent.expression === prev) {
+            if (parent.kind === 207 /* CallExpression */ && parent.expression === prev) {
                 return parent;
             }
         }
     }
     ts.getImmediatelyInvokedFunctionExpression = getImmediatelyInvokedFunctionExpression;
     function isSuperOrSuperProperty(node) {
-        return node.kind === 105 /* SuperKeyword */
+        return node.kind === 106 /* SuperKeyword */
             || isSuperProperty(node);
     }
     ts.isSuperOrSuperProperty = isSuperOrSuperProperty;
@@ -14930,8 +15567,8 @@ var ts;
      */
     function isSuperProperty(node) {
         var kind = node.kind;
-        return (kind === 201 /* PropertyAccessExpression */ || kind === 202 /* ElementAccessExpression */)
-            && node.expression.kind === 105 /* SuperKeyword */;
+        return (kind === 205 /* PropertyAccessExpression */ || kind === 206 /* ElementAccessExpression */)
+            && node.expression.kind === 106 /* SuperKeyword */;
     }
     ts.isSuperProperty = isSuperProperty;
     /**
@@ -14939,26 +15576,34 @@ var ts;
      */
     function isThisProperty(node) {
         var kind = node.kind;
-        return (kind === 201 /* PropertyAccessExpression */ || kind === 202 /* ElementAccessExpression */)
-            && node.expression.kind === 107 /* ThisKeyword */;
+        return (kind === 205 /* PropertyAccessExpression */ || kind === 206 /* ElementAccessExpression */)
+            && node.expression.kind === 108 /* ThisKeyword */;
     }
     ts.isThisProperty = isThisProperty;
     function isThisInitializedDeclaration(node) {
         var _a;
-        return !!node && ts.isVariableDeclaration(node) && ((_a = node.initializer) === null || _a === void 0 ? void 0 : _a.kind) === 107 /* ThisKeyword */;
+        return !!node && ts.isVariableDeclaration(node) && ((_a = node.initializer) === null || _a === void 0 ? void 0 : _a.kind) === 108 /* ThisKeyword */;
     }
     ts.isThisInitializedDeclaration = isThisInitializedDeclaration;
+    function isThisInitializedObjectBindingExpression(node) {
+        return !!node
+            && (ts.isShorthandPropertyAssignment(node) || ts.isPropertyAssignment(node))
+            && ts.isBinaryExpression(node.parent.parent)
+            && node.parent.parent.operatorToken.kind === 63 /* EqualsToken */
+            && node.parent.parent.right.kind === 108 /* ThisKeyword */;
+    }
+    ts.isThisInitializedObjectBindingExpression = isThisInitializedObjectBindingExpression;
     function getEntityNameFromTypeNode(node) {
         switch (node.kind) {
-            case 173 /* TypeReference */:
+            case 177 /* TypeReference */:
                 return node.typeName;
-            case 223 /* ExpressionWithTypeArguments */:
+            case 227 /* ExpressionWithTypeArguments */:
                 return isEntityNameExpression(node.expression)
                     ? node.expression
                     : undefined;
             // TODO(rbuckton): These aren't valid TypeNodes, but we treat them as such because of `isPartOfTypeNode`, which returns `true` for things that aren't `TypeNode`s.
-            case 78 /* Identifier */:
-            case 157 /* QualifiedName */:
+            case 79 /* Identifier */:
+            case 160 /* QualifiedName */:
                 return node;
         }
         return undefined;
@@ -14966,10 +15611,10 @@ var ts;
     ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode;
     function getInvokedExpression(node) {
         switch (node.kind) {
-            case 205 /* TaggedTemplateExpression */:
+            case 209 /* TaggedTemplateExpression */:
                 return node.tag;
-            case 275 /* JsxOpeningElement */:
-            case 274 /* JsxSelfClosingElement */:
+            case 279 /* JsxOpeningElement */:
+            case 278 /* JsxSelfClosingElement */:
                 return node.tagName;
             default:
                 return node.expression;
@@ -14982,25 +15627,25 @@ var ts;
             return false;
         }
         switch (node.kind) {
-            case 252 /* ClassDeclaration */:
+            case 256 /* ClassDeclaration */:
                 // classes are valid targets
                 return true;
-            case 163 /* PropertyDeclaration */:
+            case 166 /* PropertyDeclaration */:
                 // property declarations are valid if their parent is a class declaration.
-                return parent.kind === 252 /* ClassDeclaration */;
-            case 167 /* GetAccessor */:
-            case 168 /* SetAccessor */:
-            case 165 /* MethodDeclaration */:
+                return parent.kind === 256 /* ClassDeclaration */;
+            case 171 /* GetAccessor */:
+            case 172 /* SetAccessor */:
+            case 168 /* MethodDeclaration */:
                 // if this method has a body and its parent is a class declaration, this is a valid target.
                 return node.body !== undefined
-                    && parent.kind === 252 /* ClassDeclaration */;
-            case 160 /* Parameter */:
+                    && parent.kind === 256 /* ClassDeclaration */;
+            case 163 /* Parameter */:
                 // if the parameter's parent has a body and its grandparent is a class declaration, this is a valid target;
                 return parent.body !== undefined
-                    && (parent.kind === 166 /* Constructor */
-                        || parent.kind === 165 /* MethodDeclaration */
-                        || parent.kind === 168 /* SetAccessor */)
-                    && grandparent.kind === 252 /* ClassDeclaration */;
+                    && (parent.kind === 170 /* Constructor */
+                        || parent.kind === 168 /* MethodDeclaration */
+                        || parent.kind === 172 /* SetAccessor */)
+                    && grandparent.kind === 256 /* ClassDeclaration */;
         }
         return false;
     }
@@ -15016,21 +15661,29 @@ var ts;
     ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated;
     function childIsDecorated(node, parent) {
         switch (node.kind) {
-            case 252 /* ClassDeclaration */:
+            case 256 /* ClassDeclaration */:
                 return ts.some(node.members, function (m) { return nodeOrChildIsDecorated(m, node, parent); }); // TODO: GH#18217
-            case 165 /* MethodDeclaration */:
-            case 168 /* SetAccessor */:
+            case 168 /* MethodDeclaration */:
+            case 172 /* SetAccessor */:
+            case 170 /* Constructor */:
                 return ts.some(node.parameters, function (p) { return nodeIsDecorated(p, node, parent); }); // TODO: GH#18217
             default:
                 return false;
         }
     }
     ts.childIsDecorated = childIsDecorated;
+    function classOrConstructorParameterIsDecorated(node) {
+        if (nodeIsDecorated(node))
+            return true;
+        var constructor = getFirstConstructorWithBody(node);
+        return !!constructor && childIsDecorated(constructor, node);
+    }
+    ts.classOrConstructorParameterIsDecorated = classOrConstructorParameterIsDecorated;
     function isJSXTagName(node) {
         var parent = node.parent;
-        if (parent.kind === 275 /* JsxOpeningElement */ ||
-            parent.kind === 274 /* JsxSelfClosingElement */ ||
-            parent.kind === 276 /* JsxClosingElement */) {
+        if (parent.kind === 279 /* JsxOpeningElement */ ||
+            parent.kind === 278 /* JsxSelfClosingElement */ ||
+            parent.kind === 280 /* JsxClosingElement */) {
             return parent.tagName === node;
         }
         return false;
@@ -15038,49 +15691,56 @@ var ts;
     ts.isJSXTagName = isJSXTagName;
     function isExpressionNode(node) {
         switch (node.kind) {
-            case 105 /* SuperKeyword */:
-            case 103 /* NullKeyword */:
-            case 109 /* TrueKeyword */:
-            case 94 /* FalseKeyword */:
+            case 106 /* SuperKeyword */:
+            case 104 /* NullKeyword */:
+            case 110 /* TrueKeyword */:
+            case 95 /* FalseKeyword */:
             case 13 /* RegularExpressionLiteral */:
-            case 199 /* ArrayLiteralExpression */:
-            case 200 /* ObjectLiteralExpression */:
-            case 201 /* PropertyAccessExpression */:
-            case 202 /* ElementAccessExpression */:
-            case 203 /* CallExpression */:
-            case 204 /* NewExpression */:
-            case 205 /* TaggedTemplateExpression */:
-            case 224 /* AsExpression */:
-            case 206 /* TypeAssertionExpression */:
-            case 225 /* NonNullExpression */:
-            case 207 /* ParenthesizedExpression */:
-            case 208 /* FunctionExpression */:
-            case 221 /* ClassExpression */:
-            case 209 /* ArrowFunction */:
-            case 212 /* VoidExpression */:
-            case 210 /* DeleteExpression */:
-            case 211 /* TypeOfExpression */:
-            case 214 /* PrefixUnaryExpression */:
-            case 215 /* PostfixUnaryExpression */:
-            case 216 /* BinaryExpression */:
-            case 217 /* ConditionalExpression */:
-            case 220 /* SpreadElement */:
-            case 218 /* TemplateExpression */:
-            case 222 /* OmittedExpression */:
-            case 273 /* JsxElement */:
-            case 274 /* JsxSelfClosingElement */:
-            case 277 /* JsxFragment */:
-            case 219 /* YieldExpression */:
-            case 213 /* AwaitExpression */:
-            case 226 /* MetaProperty */:
+            case 203 /* ArrayLiteralExpression */:
+            case 204 /* ObjectLiteralExpression */:
+            case 205 /* PropertyAccessExpression */:
+            case 206 /* ElementAccessExpression */:
+            case 207 /* CallExpression */:
+            case 208 /* NewExpression */:
+            case 209 /* TaggedTemplateExpression */:
+            case 228 /* AsExpression */:
+            case 210 /* TypeAssertionExpression */:
+            case 229 /* NonNullExpression */:
+            case 211 /* ParenthesizedExpression */:
+            case 212 /* FunctionExpression */:
+            case 225 /* ClassExpression */:
+            case 213 /* ArrowFunction */:
+            case 216 /* VoidExpression */:
+            case 214 /* DeleteExpression */:
+            case 215 /* TypeOfExpression */:
+            case 218 /* PrefixUnaryExpression */:
+            case 219 /* PostfixUnaryExpression */:
+            case 220 /* BinaryExpression */:
+            case 221 /* ConditionalExpression */:
+            case 224 /* SpreadElement */:
+            case 222 /* TemplateExpression */:
+            case 226 /* OmittedExpression */:
+            case 277 /* JsxElement */:
+            case 278 /* JsxSelfClosingElement */:
+            case 281 /* JsxFragment */:
+            case 223 /* YieldExpression */:
+            case 217 /* AwaitExpression */:
+            case 230 /* MetaProperty */:
                 return true;
-            case 157 /* QualifiedName */:
-                while (node.parent.kind === 157 /* QualifiedName */) {
+            case 160 /* QualifiedName */:
+                while (node.parent.kind === 160 /* QualifiedName */) {
+                    node = node.parent;
+                }
+                return node.parent.kind === 180 /* TypeQuery */ || ts.isJSDocLinkLike(node.parent) || ts.isJSDocNameReference(node.parent) || ts.isJSDocMemberName(node.parent) || isJSXTagName(node);
+            case 309 /* JSDocMemberName */:
+                while (ts.isJSDocMemberName(node.parent)) {
                     node = node.parent;
                 }
-                return node.parent.kind === 176 /* TypeQuery */ || isJSXTagName(node);
-            case 78 /* Identifier */:
-                if (node.parent.kind === 176 /* TypeQuery */ || isJSXTagName(node)) {
+                return node.parent.kind === 180 /* TypeQuery */ || ts.isJSDocLinkLike(node.parent) || ts.isJSDocNameReference(node.parent) || ts.isJSDocMemberName(node.parent) || isJSXTagName(node);
+            case 80 /* PrivateIdentifier */:
+                return ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 101 /* InKeyword */;
+            case 79 /* Identifier */:
+                if (node.parent.kind === 180 /* TypeQuery */ || ts.isJSDocLinkLike(node.parent) || ts.isJSDocNameReference(node.parent) || ts.isJSDocMemberName(node.parent) || isJSXTagName(node)) {
                     return true;
                 }
             // falls through
@@ -15088,7 +15748,7 @@ var ts;
             case 9 /* BigIntLiteral */:
             case 10 /* StringLiteral */:
             case 14 /* NoSubstitutionTemplateLiteral */:
-            case 107 /* ThisKeyword */:
+            case 108 /* ThisKeyword */:
                 return isInExpressionContext(node);
             default:
                 return false;
@@ -15098,49 +15758,49 @@ var ts;
     function isInExpressionContext(node) {
         var parent = node.parent;
         switch (parent.kind) {
-            case 249 /* VariableDeclaration */:
-            case 160 /* Parameter */:
-            case 163 /* PropertyDeclaration */:
-            case 162 /* PropertySignature */:
-            case 291 /* EnumMember */:
-            case 288 /* PropertyAssignment */:
-            case 198 /* BindingElement */:
+            case 253 /* VariableDeclaration */:
+            case 163 /* Parameter */:
+            case 166 /* PropertyDeclaration */:
+            case 165 /* PropertySignature */:
+            case 297 /* EnumMember */:
+            case 294 /* PropertyAssignment */:
+            case 202 /* BindingElement */:
                 return parent.initializer === node;
-            case 233 /* ExpressionStatement */:
-            case 234 /* IfStatement */:
-            case 235 /* DoStatement */:
-            case 236 /* WhileStatement */:
-            case 242 /* ReturnStatement */:
-            case 243 /* WithStatement */:
-            case 244 /* SwitchStatement */:
-            case 284 /* CaseClause */:
-            case 246 /* ThrowStatement */:
+            case 237 /* ExpressionStatement */:
+            case 238 /* IfStatement */:
+            case 239 /* DoStatement */:
+            case 240 /* WhileStatement */:
+            case 246 /* ReturnStatement */:
+            case 247 /* WithStatement */:
+            case 248 /* SwitchStatement */:
+            case 288 /* CaseClause */:
+            case 250 /* ThrowStatement */:
                 return parent.expression === node;
-            case 237 /* ForStatement */:
+            case 241 /* ForStatement */:
                 var forStatement = parent;
-                return (forStatement.initializer === node && forStatement.initializer.kind !== 250 /* VariableDeclarationList */) ||
+                return (forStatement.initializer === node && forStatement.initializer.kind !== 254 /* VariableDeclarationList */) ||
                     forStatement.condition === node ||
                     forStatement.incrementor === node;
-            case 238 /* ForInStatement */:
-            case 239 /* ForOfStatement */:
+            case 242 /* ForInStatement */:
+            case 243 /* ForOfStatement */:
                 var forInStatement = parent;
-                return (forInStatement.initializer === node && forInStatement.initializer.kind !== 250 /* VariableDeclarationList */) ||
+                return (forInStatement.initializer === node && forInStatement.initializer.kind !== 254 /* VariableDeclarationList */) ||
                     forInStatement.expression === node;
-            case 206 /* TypeAssertionExpression */:
-            case 224 /* AsExpression */:
+            case 210 /* TypeAssertionExpression */:
+            case 228 /* AsExpression */:
                 return node === parent.expression;
-            case 228 /* TemplateSpan */:
+            case 232 /* TemplateSpan */:
                 return node === parent.expression;
-            case 158 /* ComputedPropertyName */:
+            case 161 /* ComputedPropertyName */:
                 return node === parent.expression;
-            case 161 /* Decorator */:
-            case 283 /* JsxExpression */:
-            case 282 /* JsxSpreadAttribute */:
-            case 290 /* SpreadAssignment */:
+            case 164 /* Decorator */:
+            case 287 /* JsxExpression */:
+            case 286 /* JsxSpreadAttribute */:
+            case 296 /* SpreadAssignment */:
                 return true;
-            case 223 /* ExpressionWithTypeArguments */:
+            case 227 /* ExpressionWithTypeArguments */:
                 return parent.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent);
-            case 289 /* ShorthandPropertyAssignment */:
+            case 295 /* ShorthandPropertyAssignment */:
                 return parent.objectAssignmentInitializer === node;
             default:
                 return isExpressionNode(parent);
@@ -15148,14 +15808,18 @@ var ts;
     }
     ts.isInExpressionContext = isInExpressionContext;
     function isPartOfTypeQuery(node) {
-        while (node.kind === 157 /* QualifiedName */ || node.kind === 78 /* Identifier */) {
+        while (node.kind === 160 /* QualifiedName */ || node.kind === 79 /* Identifier */) {
             node = node.parent;
         }
-        return node.kind === 176 /* TypeQuery */;
+        return node.kind === 180 /* TypeQuery */;
     }
     ts.isPartOfTypeQuery = isPartOfTypeQuery;
+    function isNamespaceReexportDeclaration(node) {
+        return ts.isNamespaceExport(node) && !!node.parent.moduleSpecifier;
+    }
+    ts.isNamespaceReexportDeclaration = isNamespaceReexportDeclaration;
     function isExternalModuleImportEqualsDeclaration(node) {
-        return node.kind === 260 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 272 /* ExternalModuleReference */;
+        return node.kind === 264 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 276 /* ExternalModuleReference */;
     }
     ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration;
     function getExternalModuleImportEqualsDeclarationExpression(node) {
@@ -15164,12 +15828,11 @@ var ts;
     }
     ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression;
     function getExternalModuleRequireArgument(node) {
-        return isRequireVariableDeclaration(node, /*requireStringLiteralLikeArgument*/ true)
-            && getLeftmostAccessExpression(node.initializer).arguments[0];
+        return isRequireVariableDeclaration(node) && getLeftmostAccessExpression(node.initializer).arguments[0];
     }
     ts.getExternalModuleRequireArgument = getExternalModuleRequireArgument;
     function isInternalModuleImportEqualsDeclaration(node) {
-        return node.kind === 260 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 272 /* ExternalModuleReference */;
+        return node.kind === 264 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 276 /* ExternalModuleReference */;
     }
     ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration;
     function isSourceFileJS(file) {
@@ -15201,15 +15864,15 @@ var ts;
             ts.isIdentifier(node.typeName) &&
             node.typeName.escapedText === "Object" &&
             node.typeArguments && node.typeArguments.length === 2 &&
-            (node.typeArguments[0].kind === 147 /* StringKeyword */ || node.typeArguments[0].kind === 144 /* NumberKeyword */);
+            (node.typeArguments[0].kind === 149 /* StringKeyword */ || node.typeArguments[0].kind === 146 /* NumberKeyword */);
     }
     ts.isJSDocIndexSignature = isJSDocIndexSignature;
     function isRequireCall(callExpression, requireStringLiteralLikeArgument) {
-        if (callExpression.kind !== 203 /* CallExpression */) {
+        if (callExpression.kind !== 207 /* CallExpression */) {
             return false;
         }
         var _a = callExpression, expression = _a.expression, args = _a.arguments;
-        if (expression.kind !== 78 /* Identifier */ || expression.escapedText !== "require") {
+        if (expression.kind !== 79 /* Identifier */ || expression.escapedText !== "require") {
             return false;
         }
         if (args.length !== 1) {
@@ -15219,18 +15882,21 @@ var ts;
         return !requireStringLiteralLikeArgument || ts.isStringLiteralLike(arg);
     }
     ts.isRequireCall = isRequireCall;
-    function isRequireVariableDeclaration(node, requireStringLiteralLikeArgument) {
-        if (node.kind === 198 /* BindingElement */) {
+    /**
+     * Returns true if the node is a VariableDeclaration initialized to a require call (see `isRequireCall`).
+     * This function does not test if the node is in a JavaScript file or not.
+     */
+    function isRequireVariableDeclaration(node) {
+        if (node.kind === 202 /* BindingElement */) {
             node = node.parent.parent;
         }
-        return ts.isVariableDeclaration(node) && !!node.initializer && isRequireCall(getLeftmostAccessExpression(node.initializer), requireStringLiteralLikeArgument);
+        return ts.isVariableDeclaration(node) && !!node.initializer && isRequireCall(getLeftmostAccessExpression(node.initializer), /*requireStringLiteralLikeArgument*/ true);
     }
     ts.isRequireVariableDeclaration = isRequireVariableDeclaration;
-    function isRequireVariableStatement(node, requireStringLiteralLikeArgument) {
-        if (requireStringLiteralLikeArgument === void 0) { requireStringLiteralLikeArgument = true; }
+    function isRequireVariableStatement(node) {
         return ts.isVariableStatement(node)
             && node.declarationList.declarations.length > 0
-            && ts.every(node.declarationList.declarations, function (decl) { return isRequireVariableDeclaration(decl, requireStringLiteralLikeArgument); });
+            && ts.every(node.declarationList.declarations, function (decl) { return isRequireVariableDeclaration(decl); });
     }
     ts.isRequireVariableStatement = isRequireVariableStatement;
     function isSingleOrDoubleQuote(charCode) {
@@ -15276,7 +15942,7 @@ var ts;
      * We treat the right hand side of assignments with container-like initializers as declarations.
      */
     function getAssignedExpandoInitializer(node) {
-        if (node && node.parent && ts.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 62 /* EqualsToken */) {
+        if (node && node.parent && ts.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 63 /* EqualsToken */) {
             var isPrototypeAssignment = isPrototypeAccess(node.parent.left);
             return getExpandoInitializer(node.parent.right, isPrototypeAssignment) ||
                 getDefaultedExpandoInitializer(node.parent.left, node.parent.right, isPrototypeAssignment);
@@ -15302,11 +15968,11 @@ var ts;
     function getExpandoInitializer(initializer, isPrototypeAssignment) {
         if (ts.isCallExpression(initializer)) {
             var e = skipParentheses(initializer.expression);
-            return e.kind === 208 /* FunctionExpression */ || e.kind === 209 /* ArrowFunction */ ? initializer : undefined;
+            return e.kind === 212 /* FunctionExpression */ || e.kind === 213 /* ArrowFunction */ ? initializer : undefined;
         }
-        if (initializer.kind === 208 /* FunctionExpression */ ||
-            initializer.kind === 221 /* ClassExpression */ ||
-            initializer.kind === 209 /* ArrowFunction */) {
+        if (initializer.kind === 212 /* FunctionExpression */ ||
+            initializer.kind === 225 /* ClassExpression */ ||
+            initializer.kind === 213 /* ArrowFunction */) {
             return initializer;
         }
         if (ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAssignment)) {
@@ -15332,7 +15998,7 @@ var ts;
     }
     function isDefaultedExpandoInitializer(node) {
         var name = ts.isVariableDeclaration(node.parent) ? node.parent.name :
-            ts.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 62 /* EqualsToken */ ? node.parent.left :
+            ts.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 63 /* EqualsToken */ ? node.parent.left :
                 undefined;
         return name && getExpandoInitializer(node.right, isPrototypeAccess(name)) && isEntityNameExpression(name) && isSameEntityName(name, node.left);
     }
@@ -15341,7 +16007,7 @@ var ts;
     function getNameOfExpando(node) {
         if (ts.isBinaryExpression(node.parent)) {
             var parent = ((node.parent.operatorToken.kind === 56 /* BarBarToken */ || node.parent.operatorToken.kind === 60 /* QuestionQuestionToken */) && ts.isBinaryExpression(node.parent.parent)) ? node.parent.parent : node.parent;
-            if (parent.operatorToken.kind === 62 /* EqualsToken */ && ts.isIdentifier(parent.left)) {
+            if (parent.operatorToken.kind === 63 /* EqualsToken */ && ts.isIdentifier(parent.left)) {
                 return parent.left;
             }
         }
@@ -15364,7 +16030,7 @@ var ts;
             return getTextOfIdentifierOrLiteral(name) === getTextOfIdentifierOrLiteral(initializer);
         }
         if (ts.isIdentifier(name) && isLiteralLikeAccess(initializer) &&
-            (initializer.expression.kind === 107 /* ThisKeyword */ ||
+            (initializer.expression.kind === 108 /* ThisKeyword */ ||
                 ts.isIdentifier(initializer.expression) &&
                     (initializer.expression.escapedText === "window" ||
                         initializer.expression.escapedText === "self" ||
@@ -15427,20 +16093,19 @@ var ts;
     ts.isLiteralLikeAccess = isLiteralLikeAccess;
     /** x[0] OR x['a'] OR x[Symbol.y] */
     function isLiteralLikeElementAccess(node) {
-        return ts.isElementAccessExpression(node) && (isStringOrNumericLiteralLike(node.argumentExpression) ||
-            isWellKnownSymbolSyntactically(node.argumentExpression));
+        return ts.isElementAccessExpression(node) && isStringOrNumericLiteralLike(node.argumentExpression);
     }
     ts.isLiteralLikeElementAccess = isLiteralLikeElementAccess;
     /** Any series of property and element accesses. */
     function isBindableStaticAccessExpression(node, excludeThisKeyword) {
-        return ts.isPropertyAccessExpression(node) && (!excludeThisKeyword && node.expression.kind === 107 /* ThisKeyword */ || ts.isIdentifier(node.name) && isBindableStaticNameExpression(node.expression, /*excludeThisKeyword*/ true))
+        return ts.isPropertyAccessExpression(node) && (!excludeThisKeyword && node.expression.kind === 108 /* ThisKeyword */ || ts.isIdentifier(node.name) && isBindableStaticNameExpression(node.expression, /*excludeThisKeyword*/ true))
             || isBindableStaticElementAccessExpression(node, excludeThisKeyword);
     }
     ts.isBindableStaticAccessExpression = isBindableStaticAccessExpression;
     /** Any series of property and element accesses, ending in a literal element access */
     function isBindableStaticElementAccessExpression(node, excludeThisKeyword) {
         return isLiteralLikeElementAccess(node)
-            && ((!excludeThisKeyword && node.expression.kind === 107 /* ThisKeyword */) ||
+            && ((!excludeThisKeyword && node.expression.kind === 108 /* ThisKeyword */) ||
                 isEntityNameExpression(node.expression) ||
                 isBindableStaticAccessExpression(node.expression, /*excludeThisKeyword*/ true));
     }
@@ -15470,7 +16135,7 @@ var ts;
             }
             return 7 /* ObjectDefinePropertyValue */;
         }
-        if (expr.operatorToken.kind !== 62 /* EqualsToken */ || !isAccessExpression(expr.left) || isVoidZero(getRightMostAssignedExpression(expr))) {
+        if (expr.operatorToken.kind !== 63 /* EqualsToken */ || !isAccessExpression(expr.left) || isVoidZero(getRightMostAssignedExpression(expr))) {
             return 0 /* None */;
         }
         if (isBindableStaticNameExpression(expr.left.expression, /*excludeThisKeyword*/ true) && getElementOrPropertyAccessName(expr.left) === "prototype" && ts.isObjectLiteralExpression(getInitializerOfBinaryExpression(expr))) {
@@ -15508,14 +16173,11 @@ var ts;
                 return ts.escapeLeadingUnderscores(name.text);
             }
         }
-        if (ts.isElementAccessExpression(node) && isWellKnownSymbolSyntactically(node.argumentExpression)) {
-            return getPropertyNameForKnownSymbolName(ts.idText(node.argumentExpression.name));
-        }
         return undefined;
     }
     ts.getElementOrPropertyAccessName = getElementOrPropertyAccessName;
     function getAssignmentDeclarationPropertyAccessKind(lhs) {
-        if (lhs.expression.kind === 107 /* ThisKeyword */) {
+        if (lhs.expression.kind === 108 /* ThisKeyword */) {
             return 4 /* ThisProperty */;
         }
         else if (isModuleExportsAccessExpression(lhs)) {
@@ -15560,7 +16222,7 @@ var ts;
     ts.isPrototypePropertyAssignment = isPrototypePropertyAssignment;
     function isSpecialPropertyDeclaration(expr) {
         return isInJSFile(expr) &&
-            expr.parent && expr.parent.kind === 233 /* ExpressionStatement */ &&
+            expr.parent && expr.parent.kind === 237 /* ExpressionStatement */ &&
             (!ts.isElementAccessExpression(expr) || isLiteralLikeElementAccess(expr)) &&
             !!ts.getJSDocTypeTag(expr.parent);
     }
@@ -15581,23 +16243,37 @@ var ts;
             return false;
         }
         var decl = symbol.valueDeclaration;
-        return decl.kind === 251 /* FunctionDeclaration */ || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer);
+        return decl.kind === 255 /* FunctionDeclaration */ || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer);
     }
     ts.isFunctionSymbol = isFunctionSymbol;
+    function tryGetModuleSpecifierFromDeclaration(node) {
+        var _a, _b, _c;
+        switch (node.kind) {
+            case 253 /* VariableDeclaration */:
+                return node.initializer.arguments[0].text;
+            case 265 /* ImportDeclaration */:
+                return (_a = ts.tryCast(node.moduleSpecifier, ts.isStringLiteralLike)) === null || _a === void 0 ? void 0 : _a.text;
+            case 264 /* ImportEqualsDeclaration */:
+                return (_c = ts.tryCast((_b = ts.tryCast(node.moduleReference, ts.isExternalModuleReference)) === null || _b === void 0 ? void 0 : _b.expression, ts.isStringLiteralLike)) === null || _c === void 0 ? void 0 : _c.text;
+            default:
+                ts.Debug.assertNever(node);
+        }
+    }
+    ts.tryGetModuleSpecifierFromDeclaration = tryGetModuleSpecifierFromDeclaration;
     function importFromModuleSpecifier(node) {
         return tryGetImportFromModuleSpecifier(node) || ts.Debug.failBadSyntaxKind(node.parent);
     }
     ts.importFromModuleSpecifier = importFromModuleSpecifier;
     function tryGetImportFromModuleSpecifier(node) {
         switch (node.parent.kind) {
-            case 261 /* ImportDeclaration */:
-            case 267 /* ExportDeclaration */:
+            case 265 /* ImportDeclaration */:
+            case 271 /* ExportDeclaration */:
                 return node.parent;
-            case 272 /* ExternalModuleReference */:
+            case 276 /* ExternalModuleReference */:
                 return node.parent.parent;
-            case 203 /* CallExpression */:
+            case 207 /* CallExpression */:
                 return isImportCall(node.parent) || isRequireCall(node.parent, /*checkArg*/ false) ? node.parent : undefined;
-            case 191 /* LiteralType */:
+            case 195 /* LiteralType */:
                 ts.Debug.assert(ts.isStringLiteral(node));
                 return ts.tryCast(node.parent.parent, ts.isImportTypeNode);
             default:
@@ -15607,16 +16283,16 @@ var ts;
     ts.tryGetImportFromModuleSpecifier = tryGetImportFromModuleSpecifier;
     function getExternalModuleName(node) {
         switch (node.kind) {
-            case 261 /* ImportDeclaration */:
-            case 267 /* ExportDeclaration */:
+            case 265 /* ImportDeclaration */:
+            case 271 /* ExportDeclaration */:
                 return node.moduleSpecifier;
-            case 260 /* ImportEqualsDeclaration */:
-                return node.moduleReference.kind === 272 /* ExternalModuleReference */ ? node.moduleReference.expression : undefined;
-            case 195 /* ImportType */:
+            case 264 /* ImportEqualsDeclaration */:
+                return node.moduleReference.kind === 276 /* ExternalModuleReference */ ? node.moduleReference.expression : undefined;
+            case 199 /* ImportType */:
                 return isLiteralImportTypeNode(node) ? node.argument.literal : undefined;
-            case 203 /* CallExpression */:
+            case 207 /* CallExpression */:
                 return node.arguments[0];
-            case 256 /* ModuleDeclaration */:
+            case 260 /* ModuleDeclaration */:
                 return node.name.kind === 10 /* StringLiteral */ ? node.name : undefined;
             default:
                 return ts.Debug.assertNever(node);
@@ -15625,11 +16301,11 @@ var ts;
     ts.getExternalModuleName = getExternalModuleName;
     function getNamespaceDeclarationNode(node) {
         switch (node.kind) {
-            case 261 /* ImportDeclaration */:
+            case 265 /* ImportDeclaration */:
                 return node.importClause && ts.tryCast(node.importClause.namedBindings, ts.isNamespaceImport);
-            case 260 /* ImportEqualsDeclaration */:
+            case 264 /* ImportEqualsDeclaration */:
                 return node;
-            case 267 /* ExportDeclaration */:
+            case 271 /* ExportDeclaration */:
                 return node.exportClause && ts.tryCast(node.exportClause, ts.isNamespaceExport);
             default:
                 return ts.Debug.assertNever(node);
@@ -15637,7 +16313,7 @@ var ts;
     }
     ts.getNamespaceDeclarationNode = getNamespaceDeclarationNode;
     function isDefaultImport(node) {
-        return node.kind === 261 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name;
+        return node.kind === 265 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name;
     }
     ts.isDefaultImport = isDefaultImport;
     function forEachImportClauseDeclaration(node, action) {
@@ -15658,13 +16334,13 @@ var ts;
     function hasQuestionToken(node) {
         if (node) {
             switch (node.kind) {
-                case 160 /* Parameter */:
-                case 165 /* MethodDeclaration */:
-                case 164 /* MethodSignature */:
-                case 289 /* ShorthandPropertyAssignment */:
-                case 288 /* PropertyAssignment */:
-                case 163 /* PropertyDeclaration */:
-                case 162 /* PropertySignature */:
+                case 163 /* Parameter */:
+                case 168 /* MethodDeclaration */:
+                case 167 /* MethodSignature */:
+                case 295 /* ShorthandPropertyAssignment */:
+                case 294 /* PropertyAssignment */:
+                case 166 /* PropertyDeclaration */:
+                case 165 /* PropertySignature */:
                     return node.questionToken !== undefined;
             }
         }
@@ -15678,7 +16354,7 @@ var ts;
     }
     ts.isJSDocConstructSignature = isJSDocConstructSignature;
     function isJSDocTypeAlias(node) {
-        return node.kind === 331 /* JSDocTypedefTag */ || node.kind === 324 /* JSDocCallbackTag */ || node.kind === 325 /* JSDocEnumTag */;
+        return node.kind === 343 /* JSDocTypedefTag */ || node.kind === 336 /* JSDocCallbackTag */ || node.kind === 337 /* JSDocEnumTag */;
     }
     ts.isJSDocTypeAlias = isJSDocTypeAlias;
     function isTypeAlias(node) {
@@ -15688,7 +16364,7 @@ var ts;
     function getSourceOfAssignment(node) {
         return ts.isExpressionStatement(node) &&
             ts.isBinaryExpression(node.expression) &&
-            node.expression.operatorToken.kind === 62 /* EqualsToken */
+            node.expression.operatorToken.kind === 63 /* EqualsToken */
             ? getRightMostAssignedExpression(node.expression)
             : undefined;
     }
@@ -15703,12 +16379,12 @@ var ts;
     }
     function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node) {
         switch (node.kind) {
-            case 232 /* VariableStatement */:
+            case 236 /* VariableStatement */:
                 var v = getSingleVariableOfVariableStatement(node);
                 return v && v.initializer;
-            case 163 /* PropertyDeclaration */:
+            case 166 /* PropertyDeclaration */:
                 return node.initializer;
-            case 288 /* PropertyAssignment */:
+            case 294 /* PropertyAssignment */:
                 return node.initializer;
         }
     }
@@ -15720,7 +16396,7 @@ var ts;
     function getNestedModuleDeclaration(node) {
         return ts.isModuleDeclaration(node) &&
             node.body &&
-            node.body.kind === 256 /* ModuleDeclaration */
+            node.body.kind === 260 /* ModuleDeclaration */
             ? node.body
             : undefined;
     }
@@ -15728,18 +16404,18 @@ var ts;
         var result;
         // Pull parameter comments from declaring function as well
         if (isVariableLike(hostNode) && ts.hasInitializer(hostNode) && ts.hasJSDocNodes(hostNode.initializer)) {
-            result = ts.append(result, ts.last(hostNode.initializer.jsDoc));
+            result = ts.addRange(result, filterOwnedJSDocTags(hostNode, ts.last(hostNode.initializer.jsDoc)));
         }
         var node = hostNode;
         while (node && node.parent) {
             if (ts.hasJSDocNodes(node)) {
-                result = ts.append(result, ts.last(node.jsDoc));
+                result = ts.addRange(result, filterOwnedJSDocTags(hostNode, ts.last(node.jsDoc)));
             }
-            if (node.kind === 160 /* Parameter */) {
+            if (node.kind === 163 /* Parameter */) {
                 result = ts.addRange(result, (noCache ? ts.getJSDocParameterTagsNoCache : ts.getJSDocParameterTags)(node));
                 break;
             }
-            if (node.kind === 159 /* TypeParameter */) {
+            if (node.kind === 162 /* TypeParameter */) {
                 result = ts.addRange(result, (noCache ? ts.getJSDocTypeParameterTagsNoCache : ts.getJSDocTypeParameterTags)(node));
                 break;
             }
@@ -15748,14 +16424,33 @@ var ts;
         return result || ts.emptyArray;
     }
     ts.getJSDocCommentsAndTags = getJSDocCommentsAndTags;
+    function filterOwnedJSDocTags(hostNode, jsDoc) {
+        if (ts.isJSDoc(jsDoc)) {
+            var ownedTags = ts.filter(jsDoc.tags, function (tag) { return ownsJSDocTag(hostNode, tag); });
+            return jsDoc.tags === ownedTags ? [jsDoc] : ownedTags;
+        }
+        return ownsJSDocTag(hostNode, jsDoc) ? [jsDoc] : undefined;
+    }
+    /**
+     * Determines whether a host node owns a jsDoc tag. A `@type` tag attached to a
+     * a ParenthesizedExpression belongs only to the ParenthesizedExpression.
+     */
+    function ownsJSDocTag(hostNode, tag) {
+        return !ts.isJSDocTypeTag(tag)
+            || !tag.parent
+            || !ts.isJSDoc(tag.parent)
+            || !ts.isParenthesizedExpression(tag.parent.parent)
+            || tag.parent.parent === hostNode;
+    }
     function getNextJSDocCommentLocation(node) {
         var parent = node.parent;
-        if (parent.kind === 288 /* PropertyAssignment */ ||
-            parent.kind === 266 /* ExportAssignment */ ||
-            parent.kind === 163 /* PropertyDeclaration */ ||
-            parent.kind === 233 /* ExpressionStatement */ && node.kind === 201 /* PropertyAccessExpression */ ||
+        if (parent.kind === 294 /* PropertyAssignment */ ||
+            parent.kind === 270 /* ExportAssignment */ ||
+            parent.kind === 166 /* PropertyDeclaration */ ||
+            parent.kind === 237 /* ExpressionStatement */ && node.kind === 205 /* PropertyAccessExpression */ ||
+            parent.kind === 246 /* ReturnStatement */ ||
             getNestedModuleDeclaration(parent) ||
-            ts.isBinaryExpression(node) && node.operatorToken.kind === 62 /* EqualsToken */) {
+            ts.isBinaryExpression(node) && node.operatorToken.kind === 63 /* EqualsToken */) {
             return parent;
         }
         // Try to recognize this pattern when node is initializer of variable declaration and JSDoc comments are on containing variable statement.
@@ -15766,7 +16461,7 @@ var ts;
         // var x = function(name) { return name.length; }
         else if (parent.parent &&
             (getSingleVariableOfVariableStatement(parent.parent) === node ||
-                ts.isBinaryExpression(parent) && parent.operatorToken.kind === 62 /* EqualsToken */)) {
+                ts.isBinaryExpression(parent) && parent.operatorToken.kind === 63 /* EqualsToken */)) {
             return parent.parent;
         }
         else if (parent.parent && parent.parent.parent &&
@@ -15790,10 +16485,22 @@ var ts;
         if (!decl) {
             return undefined;
         }
-        var parameter = ts.find(decl.parameters, function (p) { return p.name.kind === 78 /* Identifier */ && p.name.escapedText === name; });
+        var parameter = ts.find(decl.parameters, function (p) { return p.name.kind === 79 /* Identifier */ && p.name.escapedText === name; });
         return parameter && parameter.symbol;
     }
     ts.getParameterSymbolFromJSDoc = getParameterSymbolFromJSDoc;
+    function getEffectiveContainerForJSDocTemplateTag(node) {
+        if (ts.isJSDoc(node.parent) && node.parent.tags) {
+            // A @template tag belongs to any @typedef, @callback, or @enum tags in the same comment block, if they exist.
+            var typeAlias = ts.find(node.parent.tags, isJSDocTypeAlias);
+            if (typeAlias) {
+                return typeAlias;
+            }
+        }
+        // otherwise it belongs to the host it annotates
+        return getHostSignatureFromJSDoc(node);
+    }
+    ts.getEffectiveContainerForJSDocTemplateTag = getEffectiveContainerForJSDocTemplateTag;
     function getHostSignatureFromJSDoc(node) {
         var host = getEffectiveJSDocHost(node);
         return host && ts.isFunctionLike(host) ? host : undefined;
@@ -15840,7 +16547,7 @@ var ts;
     ts.hasRestParameter = hasRestParameter;
     function isRestParameter(node) {
         var type = ts.isJSDocParameterTag(node) ? (node.typeExpression && node.typeExpression.type) : node.type;
-        return node.dotDotDotToken !== undefined || !!type && type.kind === 309 /* JSDocVariadicType */;
+        return node.dotDotDotToken !== undefined || !!type && type.kind === 316 /* JSDocVariadicType */;
     }
     ts.isRestParameter = isRestParameter;
     function hasTypeArguments(node) {
@@ -15857,31 +16564,34 @@ var ts;
         var parent = node.parent;
         while (true) {
             switch (parent.kind) {
-                case 216 /* BinaryExpression */:
+                case 220 /* BinaryExpression */:
                     var binaryOperator = parent.operatorToken.kind;
                     return isAssignmentOperator(binaryOperator) && parent.left === node ?
-                        binaryOperator === 62 /* EqualsToken */ || isLogicalOrCoalescingAssignmentOperator(binaryOperator) ? 1 /* Definite */ : 2 /* Compound */ :
+                        binaryOperator === 63 /* EqualsToken */ || isLogicalOrCoalescingAssignmentOperator(binaryOperator) ? 1 /* Definite */ : 2 /* Compound */ :
                         0 /* None */;
-                case 214 /* PrefixUnaryExpression */:
-                case 215 /* PostfixUnaryExpression */:
+                case 218 /* PrefixUnaryExpression */:
+                case 219 /* PostfixUnaryExpression */:
                     var unaryOperator = parent.operator;
                     return unaryOperator === 45 /* PlusPlusToken */ || unaryOperator === 46 /* MinusMinusToken */ ? 2 /* Compound */ : 0 /* None */;
-                case 238 /* ForInStatement */:
-                case 239 /* ForOfStatement */:
+                case 242 /* ForInStatement */:
+                case 243 /* ForOfStatement */:
                     return parent.initializer === node ? 1 /* Definite */ : 0 /* None */;
-                case 207 /* ParenthesizedExpression */:
-                case 199 /* ArrayLiteralExpression */:
-                case 220 /* SpreadElement */:
-                case 225 /* NonNullExpression */:
+                case 211 /* ParenthesizedExpression */:
+                case 203 /* ArrayLiteralExpression */:
+                case 224 /* SpreadElement */:
+                case 229 /* NonNullExpression */:
                     node = parent;
                     break;
-                case 289 /* ShorthandPropertyAssignment */:
+                case 296 /* SpreadAssignment */:
+                    node = parent.parent;
+                    break;
+                case 295 /* ShorthandPropertyAssignment */:
                     if (parent.name !== node) {
                         return 0 /* None */;
                     }
                     node = parent.parent;
                     break;
-                case 288 /* PropertyAssignment */:
+                case 294 /* PropertyAssignment */:
                     if (parent.name === node) {
                         return 0 /* None */;
                     }
@@ -15908,22 +16618,22 @@ var ts;
      */
     function isNodeWithPossibleHoistedDeclaration(node) {
         switch (node.kind) {
-            case 230 /* Block */:
-            case 232 /* VariableStatement */:
-            case 243 /* WithStatement */:
-            case 234 /* IfStatement */:
-            case 244 /* SwitchStatement */:
-            case 258 /* CaseBlock */:
-            case 284 /* CaseClause */:
-            case 285 /* DefaultClause */:
-            case 245 /* LabeledStatement */:
-            case 237 /* ForStatement */:
-            case 238 /* ForInStatement */:
-            case 239 /* ForOfStatement */:
-            case 235 /* DoStatement */:
-            case 236 /* WhileStatement */:
-            case 247 /* TryStatement */:
-            case 287 /* CatchClause */:
+            case 234 /* Block */:
+            case 236 /* VariableStatement */:
+            case 247 /* WithStatement */:
+            case 238 /* IfStatement */:
+            case 248 /* SwitchStatement */:
+            case 262 /* CaseBlock */:
+            case 288 /* CaseClause */:
+            case 289 /* DefaultClause */:
+            case 249 /* LabeledStatement */:
+            case 241 /* ForStatement */:
+            case 242 /* ForInStatement */:
+            case 243 /* ForOfStatement */:
+            case 239 /* DoStatement */:
+            case 240 /* WhileStatement */:
+            case 251 /* TryStatement */:
+            case 291 /* CatchClause */:
                 return true;
         }
         return false;
@@ -15940,11 +16650,11 @@ var ts;
         return node;
     }
     function walkUpParenthesizedTypes(node) {
-        return walkUp(node, 186 /* ParenthesizedType */);
+        return walkUp(node, 190 /* ParenthesizedType */);
     }
     ts.walkUpParenthesizedTypes = walkUpParenthesizedTypes;
     function walkUpParenthesizedExpressions(node) {
-        return walkUp(node, 207 /* ParenthesizedExpression */);
+        return walkUp(node, 211 /* ParenthesizedExpression */);
     }
     ts.walkUpParenthesizedExpressions = walkUpParenthesizedExpressions;
     /**
@@ -15954,30 +16664,27 @@ var ts;
      */
     function walkUpParenthesizedTypesAndGetParentAndChild(node) {
         var child;
-        while (node && node.kind === 186 /* ParenthesizedType */) {
+        while (node && node.kind === 190 /* ParenthesizedType */) {
             child = node;
             node = node.parent;
         }
         return [child, node];
     }
     ts.walkUpParenthesizedTypesAndGetParentAndChild = walkUpParenthesizedTypesAndGetParentAndChild;
-    function skipParentheses(node) {
-        return ts.skipOuterExpressions(node, 1 /* Parentheses */);
+    function skipParentheses(node, excludeJSDocTypeAssertions) {
+        var flags = excludeJSDocTypeAssertions ?
+            1 /* Parentheses */ | 16 /* ExcludeJSDocTypeAssertion */ :
+            1 /* Parentheses */;
+        return ts.skipOuterExpressions(node, flags);
     }
     ts.skipParentheses = skipParentheses;
-    function skipParenthesesUp(node) {
-        while (node.kind === 207 /* ParenthesizedExpression */) {
-            node = node.parent;
-        }
-        return node;
-    }
     // a node is delete target iff. it is PropertyAccessExpression/ElementAccessExpression with parentheses skipped
     function isDeleteTarget(node) {
-        if (node.kind !== 201 /* PropertyAccessExpression */ && node.kind !== 202 /* ElementAccessExpression */) {
+        if (node.kind !== 205 /* PropertyAccessExpression */ && node.kind !== 206 /* ElementAccessExpression */) {
             return false;
         }
         node = walkUpParenthesizedExpressions(node.parent);
-        return node && node.kind === 210 /* DeleteExpression */;
+        return node && node.kind === 214 /* DeleteExpression */;
     }
     ts.isDeleteTarget = isDeleteTarget;
     function isNodeDescendantOf(node, ancestor) {
@@ -16004,7 +16711,7 @@ var ts;
                 if (ts.isComputedPropertyName(parent))
                     return parent.parent;
             // falls through
-            case 78 /* Identifier */:
+            case 79 /* Identifier */:
                 if (ts.isDeclaration(parent)) {
                     return parent.name === name ? parent : undefined;
                 }
@@ -16021,7 +16728,7 @@ var ts;
                         ? binExp
                         : undefined;
                 }
-            case 79 /* PrivateIdentifier */:
+            case 80 /* PrivateIdentifier */:
                 return ts.isDeclaration(parent) && parent.name === name ? parent : undefined;
             default:
                 return undefined;
@@ -16030,7 +16737,7 @@ var ts;
     ts.getDeclarationFromName = getDeclarationFromName;
     function isLiteralComputedPropertyDeclarationName(node) {
         return isStringOrNumericLiteralLike(node) &&
-            node.parent.kind === 158 /* ComputedPropertyName */ &&
+            node.parent.kind === 161 /* ComputedPropertyName */ &&
             ts.isDeclaration(node.parent.parent);
     }
     ts.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName;
@@ -16038,26 +16745,26 @@ var ts;
     function isIdentifierName(node) {
         var parent = node.parent;
         switch (parent.kind) {
-            case 163 /* PropertyDeclaration */:
-            case 162 /* PropertySignature */:
-            case 165 /* MethodDeclaration */:
-            case 164 /* MethodSignature */:
-            case 167 /* GetAccessor */:
-            case 168 /* SetAccessor */:
-            case 291 /* EnumMember */:
-            case 288 /* PropertyAssignment */:
-            case 201 /* PropertyAccessExpression */:
+            case 166 /* PropertyDeclaration */:
+            case 165 /* PropertySignature */:
+            case 168 /* MethodDeclaration */:
+            case 167 /* MethodSignature */:
+            case 171 /* GetAccessor */:
+            case 172 /* SetAccessor */:
+            case 297 /* EnumMember */:
+            case 294 /* PropertyAssignment */:
+            case 205 /* PropertyAccessExpression */:
                 // Name in member declaration or property name in property access
                 return parent.name === node;
-            case 157 /* QualifiedName */:
+            case 160 /* QualifiedName */:
                 // Name on right hand side of dot in a type query or type reference
                 return parent.right === node;
-            case 198 /* BindingElement */:
-            case 265 /* ImportSpecifier */:
+            case 202 /* BindingElement */:
+            case 269 /* ImportSpecifier */:
                 // Property name in binding element or import specifier
                 return parent.propertyName === node;
-            case 270 /* ExportSpecifier */:
-            case 280 /* JsxAttribute */:
+            case 274 /* ExportSpecifier */:
+            case 284 /* JsxAttribute */:
                 // Any name in an export specifier or JSX Attribute
                 return true;
         }
@@ -16077,33 +16784,33 @@ var ts;
     // {<Identifier>}
     // {name: <EntityNameExpression>}
     function isAliasSymbolDeclaration(node) {
-        return node.kind === 260 /* ImportEqualsDeclaration */ ||
-            node.kind === 259 /* NamespaceExportDeclaration */ ||
-            node.kind === 262 /* ImportClause */ && !!node.name ||
-            node.kind === 263 /* NamespaceImport */ ||
-            node.kind === 269 /* NamespaceExport */ ||
-            node.kind === 265 /* ImportSpecifier */ ||
-            node.kind === 270 /* ExportSpecifier */ ||
-            node.kind === 266 /* ExportAssignment */ && exportAssignmentIsAlias(node) ||
+        return node.kind === 264 /* ImportEqualsDeclaration */ ||
+            node.kind === 263 /* NamespaceExportDeclaration */ ||
+            node.kind === 266 /* ImportClause */ && !!node.name ||
+            node.kind === 267 /* NamespaceImport */ ||
+            node.kind === 273 /* NamespaceExport */ ||
+            node.kind === 269 /* ImportSpecifier */ ||
+            node.kind === 274 /* ExportSpecifier */ ||
+            node.kind === 270 /* ExportAssignment */ && exportAssignmentIsAlias(node) ||
             ts.isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && exportAssignmentIsAlias(node) ||
-            ts.isPropertyAccessExpression(node) && ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */ && isAliasableExpression(node.parent.right) ||
-            node.kind === 289 /* ShorthandPropertyAssignment */ ||
-            node.kind === 288 /* PropertyAssignment */ && isAliasableExpression(node.initializer);
+            ts.isPropertyAccessExpression(node) && ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 63 /* EqualsToken */ && isAliasableExpression(node.parent.right) ||
+            node.kind === 295 /* ShorthandPropertyAssignment */ ||
+            node.kind === 294 /* PropertyAssignment */ && isAliasableExpression(node.initializer);
     }
     ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration;
     function getAliasDeclarationFromName(node) {
         switch (node.parent.kind) {
-            case 262 /* ImportClause */:
-            case 265 /* ImportSpecifier */:
-            case 263 /* NamespaceImport */:
-            case 270 /* ExportSpecifier */:
-            case 266 /* ExportAssignment */:
-            case 260 /* ImportEqualsDeclaration */:
+            case 266 /* ImportClause */:
+            case 269 /* ImportSpecifier */:
+            case 267 /* NamespaceImport */:
+            case 274 /* ExportSpecifier */:
+            case 270 /* ExportAssignment */:
+            case 264 /* ImportEqualsDeclaration */:
                 return node.parent;
-            case 157 /* QualifiedName */:
+            case 160 /* QualifiedName */:
                 do {
                     node = node.parent;
-                } while (node.parent.kind === 157 /* QualifiedName */);
+                } while (node.parent.kind === 160 /* QualifiedName */);
                 return getAliasDeclarationFromName(node);
         }
     }
@@ -16122,7 +16829,7 @@ var ts;
     }
     ts.getExportAssignmentExpression = getExportAssignmentExpression;
     function getPropertyAssignmentAliasLikeExpression(node) {
-        return node.kind === 289 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 288 /* PropertyAssignment */ ? node.initializer :
+        return node.kind === 295 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 294 /* PropertyAssignment */ ? node.initializer :
             node.parent.right;
     }
     ts.getPropertyAssignmentAliasLikeExpression = getPropertyAssignmentAliasLikeExpression;
@@ -16139,7 +16846,7 @@ var ts;
     }
     ts.getEffectiveBaseTypeNode = getEffectiveBaseTypeNode;
     function getClassExtendsHeritageElement(node) {
-        var heritageClause = getHeritageClause(node.heritageClauses, 93 /* ExtendsKeyword */);
+        var heritageClause = getHeritageClause(node.heritageClauses, 94 /* ExtendsKeyword */);
         return heritageClause && heritageClause.types.length > 0 ? heritageClause.types[0] : undefined;
     }
     ts.getClassExtendsHeritageElement = getClassExtendsHeritageElement;
@@ -16148,7 +16855,7 @@ var ts;
             return ts.getJSDocImplementsTags(node).map(function (n) { return n.class; });
         }
         else {
-            var heritageClause = getHeritageClause(node.heritageClauses, 116 /* ImplementsKeyword */);
+            var heritageClause = getHeritageClause(node.heritageClauses, 117 /* ImplementsKeyword */);
             return heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.types;
         }
     }
@@ -16161,7 +16868,7 @@ var ts;
     }
     ts.getAllSuperTypeNodes = getAllSuperTypeNodes;
     function getInterfaceBaseTypeNodes(node) {
-        var heritageClause = getHeritageClause(node.heritageClauses, 93 /* ExtendsKeyword */);
+        var heritageClause = getHeritageClause(node.heritageClauses, 94 /* ExtendsKeyword */);
         return heritageClause ? heritageClause.types : undefined;
     }
     ts.getInterfaceBaseTypeNodes = getInterfaceBaseTypeNodes;
@@ -16188,11 +16895,11 @@ var ts;
     }
     ts.getAncestor = getAncestor;
     function isKeyword(token) {
-        return 80 /* FirstKeyword */ <= token && token <= 156 /* LastKeyword */;
+        return 81 /* FirstKeyword */ <= token && token <= 159 /* LastKeyword */;
     }
     ts.isKeyword = isKeyword;
     function isContextualKeyword(token) {
-        return 125 /* FirstContextualKeyword */ <= token && token <= 156 /* LastContextualKeyword */;
+        return 126 /* FirstContextualKeyword */ <= token && token <= 159 /* LastContextualKeyword */;
     }
     ts.isContextualKeyword = isContextualKeyword;
     function isNonContextualKeyword(token) {
@@ -16200,7 +16907,7 @@ var ts;
     }
     ts.isNonContextualKeyword = isNonContextualKeyword;
     function isFutureReservedKeyword(token) {
-        return 116 /* FirstFutureReservedWord */ <= token && token <= 124 /* LastFutureReservedWord */;
+        return 117 /* FirstFutureReservedWord */ <= token && token <= 125 /* LastFutureReservedWord */;
     }
     ts.isFutureReservedKeyword = isFutureReservedKeyword;
     function isStringANonContextualKeyword(name) {
@@ -16236,14 +16943,14 @@ var ts;
         }
         var flags = 0 /* Normal */;
         switch (node.kind) {
-            case 251 /* FunctionDeclaration */:
-            case 208 /* FunctionExpression */:
-            case 165 /* MethodDeclaration */:
+            case 255 /* FunctionDeclaration */:
+            case 212 /* FunctionExpression */:
+            case 168 /* MethodDeclaration */:
                 if (node.asteriskToken) {
                     flags |= 1 /* Generator */;
                 }
             // falls through
-            case 209 /* ArrowFunction */:
+            case 213 /* ArrowFunction */:
                 if (hasSyntacticModifier(node, 256 /* Async */)) {
                     flags |= 2 /* Async */;
                 }
@@ -16257,10 +16964,10 @@ var ts;
     ts.getFunctionFlags = getFunctionFlags;
     function isAsyncFunction(node) {
         switch (node.kind) {
-            case 251 /* FunctionDeclaration */:
-            case 208 /* FunctionExpression */:
-            case 209 /* ArrowFunction */:
-            case 165 /* MethodDeclaration */:
+            case 255 /* FunctionDeclaration */:
+            case 212 /* FunctionExpression */:
+            case 213 /* ArrowFunction */:
+            case 168 /* MethodDeclaration */:
                 return node.body !== undefined
                     && node.asteriskToken === undefined
                     && hasSyntacticModifier(node, 256 /* Async */);
@@ -16283,9 +16990,6 @@ var ts;
      *   3. The computed name is *not* expressed as a NumericLiteral.
      *   4. The computed name is *not* expressed as a PlusToken or MinusToken
      *      immediately followed by a NumericLiteral.
-     *   5. The computed name is *not* expressed as `Symbol.<name>`, where `<name>`
-     *      is a property of the Symbol constructor that denotes a built-in
-     *      Symbol.
      */
     function hasDynamicName(declaration) {
         var name = ts.getNameOfDeclaration(declaration);
@@ -16293,38 +16997,25 @@ var ts;
     }
     ts.hasDynamicName = hasDynamicName;
     function isDynamicName(name) {
-        if (!(name.kind === 158 /* ComputedPropertyName */ || name.kind === 202 /* ElementAccessExpression */)) {
+        if (!(name.kind === 161 /* ComputedPropertyName */ || name.kind === 206 /* ElementAccessExpression */)) {
             return false;
         }
         var expr = ts.isElementAccessExpression(name) ? skipParentheses(name.argumentExpression) : name.expression;
         return !isStringOrNumericLiteralLike(expr) &&
-            !isSignedNumericLiteral(expr) &&
-            !isWellKnownSymbolSyntactically(expr);
+            !isSignedNumericLiteral(expr);
     }
     ts.isDynamicName = isDynamicName;
-    /**
-     * Checks if the expression is of the form:
-     *    Symbol.name
-     * where Symbol is literally the word "Symbol", and name is any identifierName
-     */
-    function isWellKnownSymbolSyntactically(node) {
-        return ts.isPropertyAccessExpression(node) && isESSymbolIdentifier(node.expression);
-    }
-    ts.isWellKnownSymbolSyntactically = isWellKnownSymbolSyntactically;
     function getPropertyNameForPropertyNameNode(name) {
         switch (name.kind) {
-            case 78 /* Identifier */:
-            case 79 /* PrivateIdentifier */:
+            case 79 /* Identifier */:
+            case 80 /* PrivateIdentifier */:
                 return name.escapedText;
             case 10 /* StringLiteral */:
             case 8 /* NumericLiteral */:
                 return ts.escapeLeadingUnderscores(name.text);
-            case 158 /* ComputedPropertyName */:
+            case 161 /* ComputedPropertyName */:
                 var nameExpression = name.expression;
-                if (isWellKnownSymbolSyntactically(nameExpression)) {
-                    return getPropertyNameForKnownSymbolName(ts.idText(nameExpression.name));
-                }
-                else if (isStringOrNumericLiteralLike(nameExpression)) {
+                if (isStringOrNumericLiteralLike(nameExpression)) {
                     return ts.escapeLeadingUnderscores(nameExpression.text);
                 }
                 else if (isSignedNumericLiteral(nameExpression)) {
@@ -16341,7 +17032,7 @@ var ts;
     ts.getPropertyNameForPropertyNameNode = getPropertyNameForPropertyNameNode;
     function isPropertyNameLiteral(node) {
         switch (node.kind) {
-            case 78 /* Identifier */:
+            case 79 /* Identifier */:
             case 10 /* StringLiteral */:
             case 14 /* NoSubstitutionTemplateLiteral */:
             case 8 /* NumericLiteral */:
@@ -16352,34 +17043,34 @@ var ts;
     }
     ts.isPropertyNameLiteral = isPropertyNameLiteral;
     function getTextOfIdentifierOrLiteral(node) {
-        return ts.isIdentifierOrPrivateIdentifier(node) ? ts.idText(node) : node.text;
+        return ts.isMemberName(node) ? ts.idText(node) : node.text;
     }
     ts.getTextOfIdentifierOrLiteral = getTextOfIdentifierOrLiteral;
     function getEscapedTextOfIdentifierOrLiteral(node) {
-        return ts.isIdentifierOrPrivateIdentifier(node) ? node.escapedText : ts.escapeLeadingUnderscores(node.text);
+        return ts.isMemberName(node) ? node.escapedText : ts.escapeLeadingUnderscores(node.text);
     }
     ts.getEscapedTextOfIdentifierOrLiteral = getEscapedTextOfIdentifierOrLiteral;
     function getPropertyNameForUniqueESSymbol(symbol) {
-        return "__@" + ts.getSymbolId(symbol) + "@" + symbol.escapedName;
+        return "__@".concat(ts.getSymbolId(symbol), "@").concat(symbol.escapedName);
     }
     ts.getPropertyNameForUniqueESSymbol = getPropertyNameForUniqueESSymbol;
-    function getPropertyNameForKnownSymbolName(symbolName) {
-        return "__@" + symbolName;
-    }
-    ts.getPropertyNameForKnownSymbolName = getPropertyNameForKnownSymbolName;
     function getSymbolNameForPrivateIdentifier(containingClassSymbol, description) {
-        return "__#" + ts.getSymbolId(containingClassSymbol) + "@" + description;
+        return "__#".concat(ts.getSymbolId(containingClassSymbol), "@").concat(description);
     }
     ts.getSymbolNameForPrivateIdentifier = getSymbolNameForPrivateIdentifier;
     function isKnownSymbol(symbol) {
         return ts.startsWith(symbol.escapedName, "__@");
     }
     ts.isKnownSymbol = isKnownSymbol;
+    function isPrivateIdentifierSymbol(symbol) {
+        return ts.startsWith(symbol.escapedName, "__#");
+    }
+    ts.isPrivateIdentifierSymbol = isPrivateIdentifierSymbol;
     /**
      * Includes the word "Symbol" with unicode escapes
      */
     function isESSymbolIdentifier(node) {
-        return node.kind === 78 /* Identifier */ && node.escapedText === "Symbol";
+        return node.kind === 79 /* Identifier */ && node.escapedText === "Symbol";
     }
     ts.isESSymbolIdentifier = isESSymbolIdentifier;
     function isPushOrUnshiftIdentifier(node) {
@@ -16388,11 +17079,11 @@ var ts;
     ts.isPushOrUnshiftIdentifier = isPushOrUnshiftIdentifier;
     function isParameterDeclaration(node) {
         var root = getRootDeclaration(node);
-        return root.kind === 160 /* Parameter */;
+        return root.kind === 163 /* Parameter */;
     }
     ts.isParameterDeclaration = isParameterDeclaration;
     function getRootDeclaration(node) {
-        while (node.kind === 198 /* BindingElement */) {
+        while (node.kind === 202 /* BindingElement */) {
             node = node.parent.parent;
         }
         return node;
@@ -16400,15 +17091,15 @@ var ts;
     ts.getRootDeclaration = getRootDeclaration;
     function nodeStartsNewLexicalEnvironment(node) {
         var kind = node.kind;
-        return kind === 166 /* Constructor */
-            || kind === 208 /* FunctionExpression */
-            || kind === 251 /* FunctionDeclaration */
-            || kind === 209 /* ArrowFunction */
-            || kind === 165 /* MethodDeclaration */
-            || kind === 167 /* GetAccessor */
-            || kind === 168 /* SetAccessor */
-            || kind === 256 /* ModuleDeclaration */
-            || kind === 297 /* SourceFile */;
+        return kind === 170 /* Constructor */
+            || kind === 212 /* FunctionExpression */
+            || kind === 255 /* FunctionDeclaration */
+            || kind === 213 /* ArrowFunction */
+            || kind === 168 /* MethodDeclaration */
+            || kind === 171 /* GetAccessor */
+            || kind === 172 /* SetAccessor */
+            || kind === 260 /* ModuleDeclaration */
+            || kind === 303 /* SourceFile */;
     }
     ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment;
     function nodeIsSynthesized(range) {
@@ -16427,41 +17118,41 @@ var ts;
     })(Associativity = ts.Associativity || (ts.Associativity = {}));
     function getExpressionAssociativity(expression) {
         var operator = getOperator(expression);
-        var hasArguments = expression.kind === 204 /* NewExpression */ && expression.arguments !== undefined;
+        var hasArguments = expression.kind === 208 /* NewExpression */ && expression.arguments !== undefined;
         return getOperatorAssociativity(expression.kind, operator, hasArguments);
     }
     ts.getExpressionAssociativity = getExpressionAssociativity;
     function getOperatorAssociativity(kind, operator, hasArguments) {
         switch (kind) {
-            case 204 /* NewExpression */:
+            case 208 /* NewExpression */:
                 return hasArguments ? 0 /* Left */ : 1 /* Right */;
-            case 214 /* PrefixUnaryExpression */:
-            case 211 /* TypeOfExpression */:
-            case 212 /* VoidExpression */:
-            case 210 /* DeleteExpression */:
-            case 213 /* AwaitExpression */:
-            case 217 /* ConditionalExpression */:
-            case 219 /* YieldExpression */:
+            case 218 /* PrefixUnaryExpression */:
+            case 215 /* TypeOfExpression */:
+            case 216 /* VoidExpression */:
+            case 214 /* DeleteExpression */:
+            case 217 /* AwaitExpression */:
+            case 221 /* ConditionalExpression */:
+            case 223 /* YieldExpression */:
                 return 1 /* Right */;
-            case 216 /* BinaryExpression */:
+            case 220 /* BinaryExpression */:
                 switch (operator) {
                     case 42 /* AsteriskAsteriskToken */:
-                    case 62 /* EqualsToken */:
-                    case 63 /* PlusEqualsToken */:
-                    case 64 /* MinusEqualsToken */:
-                    case 66 /* AsteriskAsteriskEqualsToken */:
-                    case 65 /* AsteriskEqualsToken */:
-                    case 67 /* SlashEqualsToken */:
-                    case 68 /* PercentEqualsToken */:
-                    case 69 /* LessThanLessThanEqualsToken */:
-                    case 70 /* GreaterThanGreaterThanEqualsToken */:
-                    case 71 /* GreaterThanGreaterThanGreaterThanEqualsToken */:
-                    case 72 /* AmpersandEqualsToken */:
-                    case 77 /* CaretEqualsToken */:
-                    case 73 /* BarEqualsToken */:
-                    case 74 /* BarBarEqualsToken */:
-                    case 75 /* AmpersandAmpersandEqualsToken */:
-                    case 76 /* QuestionQuestionEqualsToken */:
+                    case 63 /* EqualsToken */:
+                    case 64 /* PlusEqualsToken */:
+                    case 65 /* MinusEqualsToken */:
+                    case 67 /* AsteriskAsteriskEqualsToken */:
+                    case 66 /* AsteriskEqualsToken */:
+                    case 68 /* SlashEqualsToken */:
+                    case 69 /* PercentEqualsToken */:
+                    case 70 /* LessThanLessThanEqualsToken */:
+                    case 71 /* GreaterThanGreaterThanEqualsToken */:
+                    case 72 /* GreaterThanGreaterThanGreaterThanEqualsToken */:
+                    case 73 /* AmpersandEqualsToken */:
+                    case 78 /* CaretEqualsToken */:
+                    case 74 /* BarEqualsToken */:
+                    case 75 /* BarBarEqualsToken */:
+                    case 76 /* AmpersandAmpersandEqualsToken */:
+                    case 77 /* QuestionQuestionEqualsToken */:
                         return 1 /* Right */;
                 }
         }
@@ -16470,15 +17161,15 @@ var ts;
     ts.getOperatorAssociativity = getOperatorAssociativity;
     function getExpressionPrecedence(expression) {
         var operator = getOperator(expression);
-        var hasArguments = expression.kind === 204 /* NewExpression */ && expression.arguments !== undefined;
+        var hasArguments = expression.kind === 208 /* NewExpression */ && expression.arguments !== undefined;
         return getOperatorPrecedence(expression.kind, operator, hasArguments);
     }
     ts.getExpressionPrecedence = getExpressionPrecedence;
     function getOperator(expression) {
-        if (expression.kind === 216 /* BinaryExpression */) {
+        if (expression.kind === 220 /* BinaryExpression */) {
             return expression.operatorToken.kind;
         }
-        else if (expression.kind === 214 /* PrefixUnaryExpression */ || expression.kind === 215 /* PostfixUnaryExpression */) {
+        else if (expression.kind === 218 /* PrefixUnaryExpression */ || expression.kind === 219 /* PostfixUnaryExpression */) {
             return expression.operator;
         }
         else {
@@ -16657,81 +17348,83 @@ var ts;
     })(OperatorPrecedence = ts.OperatorPrecedence || (ts.OperatorPrecedence = {}));
     function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
         switch (nodeKind) {
-            case 337 /* CommaListExpression */:
+            case 349 /* CommaListExpression */:
                 return 0 /* Comma */;
-            case 220 /* SpreadElement */:
+            case 224 /* SpreadElement */:
                 return 1 /* Spread */;
-            case 219 /* YieldExpression */:
+            case 223 /* YieldExpression */:
                 return 2 /* Yield */;
-            case 217 /* ConditionalExpression */:
+            case 221 /* ConditionalExpression */:
                 return 4 /* Conditional */;
-            case 216 /* BinaryExpression */:
+            case 220 /* BinaryExpression */:
                 switch (operatorKind) {
                     case 27 /* CommaToken */:
                         return 0 /* Comma */;
-                    case 62 /* EqualsToken */:
-                    case 63 /* PlusEqualsToken */:
-                    case 64 /* MinusEqualsToken */:
-                    case 66 /* AsteriskAsteriskEqualsToken */:
-                    case 65 /* AsteriskEqualsToken */:
-                    case 67 /* SlashEqualsToken */:
-                    case 68 /* PercentEqualsToken */:
-                    case 69 /* LessThanLessThanEqualsToken */:
-                    case 70 /* GreaterThanGreaterThanEqualsToken */:
-                    case 71 /* GreaterThanGreaterThanGreaterThanEqualsToken */:
-                    case 72 /* AmpersandEqualsToken */:
-                    case 77 /* CaretEqualsToken */:
-                    case 73 /* BarEqualsToken */:
-                    case 74 /* BarBarEqualsToken */:
-                    case 75 /* AmpersandAmpersandEqualsToken */:
-                    case 76 /* QuestionQuestionEqualsToken */:
+                    case 63 /* EqualsToken */:
+                    case 64 /* PlusEqualsToken */:
+                    case 65 /* MinusEqualsToken */:
+                    case 67 /* AsteriskAsteriskEqualsToken */:
+                    case 66 /* AsteriskEqualsToken */:
+                    case 68 /* SlashEqualsToken */:
+                    case 69 /* PercentEqualsToken */:
+                    case 70 /* LessThanLessThanEqualsToken */:
+                    case 71 /* GreaterThanGreaterThanEqualsToken */:
+                    case 72 /* GreaterThanGreaterThanGreaterThanEqualsToken */:
+                    case 73 /* AmpersandEqualsToken */:
+                    case 78 /* CaretEqualsToken */:
+                    case 74 /* BarEqualsToken */:
+                    case 75 /* BarBarEqualsToken */:
+                    case 76 /* AmpersandAmpersandEqualsToken */:
+                    case 77 /* QuestionQuestionEqualsToken */:
                         return 3 /* Assignment */;
                     default:
                         return getBinaryOperatorPrecedence(operatorKind);
                 }
             // TODO: Should prefix `++` and `--` be moved to the `Update` precedence?
-            case 206 /* TypeAssertionExpression */:
-            case 225 /* NonNullExpression */:
-            case 214 /* PrefixUnaryExpression */:
-            case 211 /* TypeOfExpression */:
-            case 212 /* VoidExpression */:
-            case 210 /* DeleteExpression */:
-            case 213 /* AwaitExpression */:
+            case 210 /* TypeAssertionExpression */:
+            case 229 /* NonNullExpression */:
+            case 218 /* PrefixUnaryExpression */:
+            case 215 /* TypeOfExpression */:
+            case 216 /* VoidExpression */:
+            case 214 /* DeleteExpression */:
+            case 217 /* AwaitExpression */:
                 return 16 /* Unary */;
-            case 215 /* PostfixUnaryExpression */:
+            case 219 /* PostfixUnaryExpression */:
                 return 17 /* Update */;
-            case 203 /* CallExpression */:
+            case 207 /* CallExpression */:
                 return 18 /* LeftHandSide */;
-            case 204 /* NewExpression */:
+            case 208 /* NewExpression */:
                 return hasArguments ? 19 /* Member */ : 18 /* LeftHandSide */;
-            case 205 /* TaggedTemplateExpression */:
-            case 201 /* PropertyAccessExpression */:
-            case 202 /* ElementAccessExpression */:
+            case 209 /* TaggedTemplateExpression */:
+            case 205 /* PropertyAccessExpression */:
+            case 206 /* ElementAccessExpression */:
+            case 230 /* MetaProperty */:
                 return 19 /* Member */;
-            case 224 /* AsExpression */:
+            case 228 /* AsExpression */:
                 return 11 /* Relational */;
-            case 107 /* ThisKeyword */:
-            case 105 /* SuperKeyword */:
-            case 78 /* Identifier */:
-            case 103 /* NullKeyword */:
-            case 109 /* TrueKeyword */:
-            case 94 /* FalseKeyword */:
+            case 108 /* ThisKeyword */:
+            case 106 /* SuperKeyword */:
+            case 79 /* Identifier */:
+            case 80 /* PrivateIdentifier */:
+            case 104 /* NullKeyword */:
+            case 110 /* TrueKeyword */:
+            case 95 /* FalseKeyword */:
             case 8 /* NumericLiteral */:
             case 9 /* BigIntLiteral */:
             case 10 /* StringLiteral */:
-            case 199 /* ArrayLiteralExpression */:
-            case 200 /* ObjectLiteralExpression */:
-            case 208 /* FunctionExpression */:
-            case 209 /* ArrowFunction */:
-            case 221 /* ClassExpression */:
+            case 203 /* ArrayLiteralExpression */:
+            case 204 /* ObjectLiteralExpression */:
+            case 212 /* FunctionExpression */:
+            case 213 /* ArrowFunction */:
+            case 225 /* ClassExpression */:
             case 13 /* RegularExpressionLiteral */:
             case 14 /* NoSubstitutionTemplateLiteral */:
-            case 218 /* TemplateExpression */:
-            case 207 /* ParenthesizedExpression */:
-            case 222 /* OmittedExpression */:
-            case 273 /* JsxElement */:
-            case 274 /* JsxSelfClosingElement */:
-            case 277 /* JsxFragment */:
+            case 222 /* TemplateExpression */:
+            case 211 /* ParenthesizedExpression */:
+            case 226 /* OmittedExpression */:
+            case 277 /* JsxElement */:
+            case 278 /* JsxSelfClosingElement */:
+            case 281 /* JsxFragment */:
                 return 20 /* Primary */;
             default:
                 return -1 /* Invalid */;
@@ -16761,9 +17454,9 @@ var ts;
             case 31 /* GreaterThanToken */:
             case 32 /* LessThanEqualsToken */:
             case 33 /* GreaterThanEqualsToken */:
-            case 101 /* InstanceOfKeyword */:
-            case 100 /* InKeyword */:
-            case 126 /* AsKeyword */:
+            case 102 /* InstanceOfKeyword */:
+            case 101 /* InKeyword */:
+            case 127 /* AsKeyword */:
                 return 11 /* Relational */;
             case 47 /* LessThanLessThanToken */:
             case 48 /* GreaterThanGreaterThanToken */:
@@ -16787,7 +17480,7 @@ var ts;
     function getSemanticJsxChildren(children) {
         return ts.filter(children, function (i) {
             switch (i.kind) {
-                case 283 /* JsxExpression */:
+                case 287 /* JsxExpression */:
                     return !!i.expression;
                 case 11 /* JsxText */:
                     return !i.containsOnlyTriviaWhiteSpaces;
@@ -16880,8 +17573,8 @@ var ts;
     // There is no reason for this other than that JSON.stringify does not handle it either.
     var doubleQuoteEscapedCharsRegExp = /[\\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g;
     var singleQuoteEscapedCharsRegExp = /[\\\'\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g;
-    // Template strings should be preserved as much as possible
-    var backtickQuoteEscapedCharsRegExp = /[\\`]/g;
+    // Template strings preserve simple LF newlines, still encode CRLF (or CR)
+    var backtickQuoteEscapedCharsRegExp = /\r\n|[\\\`\u0000-\u001f\t\v\f\b\r\u2028\u2029\u0085]/g;
     var escapedCharsMap = new ts.Map(ts.getEntries({
         "\t": "\\t",
         "\v": "\\v",
@@ -16895,7 +17588,8 @@ var ts;
         "\`": "\\\`",
         "\u2028": "\\u2028",
         "\u2029": "\\u2029",
-        "\u0085": "\\u0085" // nextLine
+        "\u0085": "\\u0085",
+        "\r\n": "\\r\\n", // special case for CRLFs in backticks
     }));
     function encodeUtf16EscapeSequence(charCode) {
         var hexCharCode = charCode.toString(16).toUpperCase();
@@ -17089,7 +17783,7 @@ var ts;
             reportInaccessibleThisError: ts.noop,
             reportPrivateInBaseOfClassExpression: ts.noop,
             reportInaccessibleUniqueSymbolError: ts.noop,
-            trackSymbol: ts.noop,
+            trackSymbol: function () { return false; },
             writeKeyword: write,
             writeOperator: write,
             writeParameter: write,
@@ -17114,56 +17808,43 @@ var ts;
         }
         return __assign(__assign({}, writer), { writeTrailingSemicolon: function () {
                 pendingTrailingSemicolon = true;
-            },
-            writeLiteral: function (s) {
+            }, writeLiteral: function (s) {
                 commitPendingTrailingSemicolon();
                 writer.writeLiteral(s);
-            },
-            writeStringLiteral: function (s) {
+            }, writeStringLiteral: function (s) {
                 commitPendingTrailingSemicolon();
                 writer.writeStringLiteral(s);
-            },
-            writeSymbol: function (s, sym) {
+            }, writeSymbol: function (s, sym) {
                 commitPendingTrailingSemicolon();
                 writer.writeSymbol(s, sym);
-            },
-            writePunctuation: function (s) {
+            }, writePunctuation: function (s) {
                 commitPendingTrailingSemicolon();
                 writer.writePunctuation(s);
-            },
-            writeKeyword: function (s) {
+            }, writeKeyword: function (s) {
                 commitPendingTrailingSemicolon();
                 writer.writeKeyword(s);
-            },
-            writeOperator: function (s) {
+            }, writeOperator: function (s) {
                 commitPendingTrailingSemicolon();
                 writer.writeOperator(s);
-            },
-            writeParameter: function (s) {
+            }, writeParameter: function (s) {
                 commitPendingTrailingSemicolon();
                 writer.writeParameter(s);
-            },
-            writeSpace: function (s) {
+            }, writeSpace: function (s) {
                 commitPendingTrailingSemicolon();
                 writer.writeSpace(s);
-            },
-            writeProperty: function (s) {
+            }, writeProperty: function (s) {
                 commitPendingTrailingSemicolon();
                 writer.writeProperty(s);
-            },
-            writeComment: function (s) {
+            }, writeComment: function (s) {
                 commitPendingTrailingSemicolon();
                 writer.writeComment(s);
-            },
-            writeLine: function () {
+            }, writeLine: function () {
                 commitPendingTrailingSemicolon();
                 writer.writeLine();
-            },
-            increaseIndent: function () {
+            }, increaseIndent: function () {
                 commitPendingTrailingSemicolon();
                 writer.increaseIndent();
-            },
-            decreaseIndent: function () {
+            }, decreaseIndent: function () {
                 commitPendingTrailingSemicolon();
                 writer.decreaseIndent();
             } });
@@ -17231,9 +17912,17 @@ var ts;
         var path = outputDir
             ? getSourceFilePathInNewDirWorker(fileName, outputDir, currentDirectory, commonSourceDirectory, getCanonicalFileName)
             : fileName;
-        return removeFileExtension(path) + ".d.ts" /* Dts */;
+        var declarationExtension = getDeclarationEmitExtensionForPath(path);
+        return removeFileExtension(path) + declarationExtension;
     }
     ts.getDeclarationEmitOutputFilePathWorker = getDeclarationEmitOutputFilePathWorker;
+    function getDeclarationEmitExtensionForPath(path) {
+        return ts.fileExtensionIsOneOf(path, [".mjs" /* Mjs */, ".mts" /* Mts */]) ? ".d.mts" /* Dmts */ :
+            ts.fileExtensionIsOneOf(path, [".cjs" /* Cjs */, ".cts" /* Cts */]) ? ".d.cts" /* Dcts */ :
+                ts.fileExtensionIsOneOf(path, [".json" /* Json */]) ? ".json.d.ts" : // Drive-by redefinition of json declaration file output name so if it's ever enabled, it behaves well
+                    ".d.ts" /* Dts */;
+    }
+    ts.getDeclarationEmitExtensionForPath = getDeclarationEmitExtensionForPath;
     function outFile(options) {
         return options.outFile || options.out;
     }
@@ -17278,8 +17967,8 @@ var ts;
         return !(options.noEmitForJsFiles && isSourceFileJS(sourceFile)) &&
             !sourceFile.isDeclarationFile &&
             !host.isSourceFileFromExternalLibrary(sourceFile) &&
-            !(isJsonSourceFile(sourceFile) && host.getResolvedProjectReferenceToRedirect(sourceFile.fileName)) &&
-            (forceDtsEmit || !host.isSourceOfProjectReferenceRedirect(sourceFile.fileName));
+            (forceDtsEmit || (!(isJsonSourceFile(sourceFile) && host.getResolvedProjectReferenceToRedirect(sourceFile.fileName)) &&
+                !host.isSourceOfProjectReferenceRedirect(sourceFile.fileName)));
     }
     ts.sourceFileMayBeEmitted = sourceFileMayBeEmitted;
     function getSourceFilePathInNewDir(fileName, host, newDirPath) {
@@ -17359,11 +18048,21 @@ var ts;
     }
     ts.parameterIsThisKeyword = parameterIsThisKeyword;
     function isThisIdentifier(node) {
-        return !!node && node.kind === 78 /* Identifier */ && identifierIsThisKeyword(node);
+        return !!node && node.kind === 79 /* Identifier */ && identifierIsThisKeyword(node);
     }
     ts.isThisIdentifier = isThisIdentifier;
+    function isThisInTypeQuery(node) {
+        if (!isThisIdentifier(node)) {
+            return false;
+        }
+        while (ts.isQualifiedName(node.parent) && node.parent.left === node) {
+            node = node.parent;
+        }
+        return node.parent.kind === 180 /* TypeQuery */;
+    }
+    ts.isThisInTypeQuery = isThisInTypeQuery;
     function identifierIsThisKeyword(id) {
-        return id.originalKeywordKind === 107 /* ThisKeyword */;
+        return id.originalKeywordKind === 108 /* ThisKeyword */;
     }
     ts.identifierIsThisKeyword = identifierIsThisKeyword;
     function getAllAccessorDeclarations(declarations, accessor) {
@@ -17374,10 +18073,10 @@ var ts;
         var setAccessor;
         if (hasDynamicName(accessor)) {
             firstAccessor = accessor;
-            if (accessor.kind === 167 /* GetAccessor */) {
+            if (accessor.kind === 171 /* GetAccessor */) {
                 getAccessor = accessor;
             }
-            else if (accessor.kind === 168 /* SetAccessor */) {
+            else if (accessor.kind === 172 /* SetAccessor */) {
                 setAccessor = accessor;
             }
             else {
@@ -17387,7 +18086,7 @@ var ts;
         else {
             ts.forEach(declarations, function (member) {
                 if (ts.isAccessor(member)
-                    && hasSyntacticModifier(member, 32 /* Static */) === hasSyntacticModifier(accessor, 32 /* Static */)) {
+                    && isStatic(member) === isStatic(accessor)) {
                     var memberName = getPropertyNameForPropertyNameNode(member.name);
                     var accessorName = getPropertyNameForPropertyNameNode(accessor.name);
                     if (memberName === accessorName) {
@@ -17397,10 +18096,10 @@ var ts;
                         else if (!secondAccessor) {
                             secondAccessor = member;
                         }
-                        if (member.kind === 167 /* GetAccessor */ && !getAccessor) {
+                        if (member.kind === 171 /* GetAccessor */ && !getAccessor) {
                             getAccessor = member;
                         }
-                        if (member.kind === 168 /* SetAccessor */ && !setAccessor) {
+                        if (member.kind === 172 /* SetAccessor */ && !setAccessor) {
                             setAccessor = member;
                         }
                     }
@@ -17449,7 +18148,7 @@ var ts;
     ts.getJSDocTypeParameterDeclarations = getJSDocTypeParameterDeclarations;
     /** template tags are only available when a typedef isn't already using them */
     function isNonTypeAliasTemplate(tag) {
-        return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 311 /* JSDocComment */ && tag.parent.tags.some(isJSDocTypeAlias));
+        return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 318 /* JSDocComment */ && tag.parent.tags.some(isJSDocTypeAlias));
     }
     /**
      * Gets the effective type annotation of the value parameter of a set accessor. If the node
@@ -17625,7 +18324,7 @@ var ts;
     ts.writeCommentRange = writeCommentRange;
     function writeTrimmedCurrentLine(text, commentEnd, writer, newLine, pos, nextLineStart) {
         var end = Math.min(commentEnd, nextLineStart - 1);
-        var currentLineText = text.substring(pos, end).replace(/^\s+|\s+$/g, "");
+        var currentLineText = ts.trimString(text.substring(pos, end));
         if (currentLineText) {
             // trimmed forward and ending spaces text
             writer.writeComment(currentLineText);
@@ -17668,10 +18367,27 @@ var ts;
         return !!getSelectedSyntacticModifierFlags(node, flags);
     }
     ts.hasSyntacticModifier = hasSyntacticModifier;
+    function isStatic(node) {
+        // https://tc39.es/ecma262/#sec-static-semantics-isstatic
+        return ts.isClassElement(node) && hasStaticModifier(node) || ts.isClassStaticBlockDeclaration(node);
+    }
+    ts.isStatic = isStatic;
     function hasStaticModifier(node) {
         return hasSyntacticModifier(node, 32 /* Static */);
     }
     ts.hasStaticModifier = hasStaticModifier;
+    function hasOverrideModifier(node) {
+        return hasEffectiveModifier(node, 16384 /* Override */);
+    }
+    ts.hasOverrideModifier = hasOverrideModifier;
+    function hasAbstractModifier(node) {
+        return hasSyntacticModifier(node, 128 /* Abstract */);
+    }
+    ts.hasAbstractModifier = hasAbstractModifier;
+    function hasAmbientModifier(node) {
+        return hasSyntacticModifier(node, 2 /* Ambient */);
+    }
+    ts.hasAmbientModifier = hasAmbientModifier;
     function hasEffectiveReadonlyModifier(node) {
         return hasEffectiveModifier(node, 64 /* Readonly */);
     }
@@ -17685,7 +18401,7 @@ var ts;
     }
     ts.getSelectedSyntacticModifierFlags = getSelectedSyntacticModifierFlags;
     function getModifierFlagsWorker(node, includeJSDoc, alwaysIncludeJSDoc) {
-        if (node.kind >= 0 /* FirstToken */ && node.kind <= 156 /* LastToken */) {
+        if (node.kind >= 0 /* FirstToken */ && node.kind <= 159 /* LastToken */) {
             return 0 /* None */;
         }
         if (!(node.modifierFlagsCache & 536870912 /* HasComputedFlags */)) {
@@ -17730,6 +18446,8 @@ var ts;
                     flags |= 16 /* Protected */;
                 if (ts.getJSDocReadonlyTagNoCache(node))
                     flags |= 64 /* Readonly */;
+                if (ts.getJSDocOverrideTagNoCache(node))
+                    flags |= 16384 /* Override */;
             }
             if (ts.getJSDocDeprecatedTagNoCache(node))
                 flags |= 8192 /* Deprecated */;
@@ -17752,7 +18470,7 @@ var ts;
      */
     function getSyntacticModifierFlagsNoCache(node) {
         var flags = modifiersToFlags(node.modifiers);
-        if (node.flags & 4 /* NestedNamespace */ || (node.kind === 78 /* Identifier */ && node.isInJSDocNamespace)) {
+        if (node.flags & 4 /* NestedNamespace */ || (node.kind === 79 /* Identifier */ && node.isInJSDocNamespace)) {
             flags |= 1 /* Export */;
         }
         return flags;
@@ -17771,21 +18489,26 @@ var ts;
     ts.modifiersToFlags = modifiersToFlags;
     function modifierToFlag(token) {
         switch (token) {
-            case 123 /* StaticKeyword */: return 32 /* Static */;
-            case 122 /* PublicKeyword */: return 4 /* Public */;
-            case 121 /* ProtectedKeyword */: return 16 /* Protected */;
-            case 120 /* PrivateKeyword */: return 8 /* Private */;
-            case 125 /* AbstractKeyword */: return 128 /* Abstract */;
-            case 92 /* ExportKeyword */: return 1 /* Export */;
-            case 133 /* DeclareKeyword */: return 2 /* Ambient */;
-            case 84 /* ConstKeyword */: return 2048 /* Const */;
-            case 87 /* DefaultKeyword */: return 512 /* Default */;
-            case 129 /* AsyncKeyword */: return 256 /* Async */;
-            case 142 /* ReadonlyKeyword */: return 64 /* Readonly */;
+            case 124 /* StaticKeyword */: return 32 /* Static */;
+            case 123 /* PublicKeyword */: return 4 /* Public */;
+            case 122 /* ProtectedKeyword */: return 16 /* Protected */;
+            case 121 /* PrivateKeyword */: return 8 /* Private */;
+            case 126 /* AbstractKeyword */: return 128 /* Abstract */;
+            case 93 /* ExportKeyword */: return 1 /* Export */;
+            case 135 /* DeclareKeyword */: return 2 /* Ambient */;
+            case 85 /* ConstKeyword */: return 2048 /* Const */;
+            case 88 /* DefaultKeyword */: return 512 /* Default */;
+            case 131 /* AsyncKeyword */: return 256 /* Async */;
+            case 144 /* ReadonlyKeyword */: return 64 /* Readonly */;
+            case 158 /* OverrideKeyword */: return 16384 /* Override */;
         }
         return 0 /* None */;
     }
     ts.modifierToFlag = modifierToFlag;
+    function createModifiers(modifierFlags) {
+        return modifierFlags ? ts.factory.createNodeArray(ts.factory.createModifiersFromModifierFlags(modifierFlags)) : undefined;
+    }
+    ts.createModifiers = createModifiers;
     function isLogicalOperator(token) {
         return token === 56 /* BarBarToken */
             || token === 55 /* AmpersandAmpersandToken */
@@ -17793,9 +18516,9 @@ var ts;
     }
     ts.isLogicalOperator = isLogicalOperator;
     function isLogicalOrCoalescingAssignmentOperator(token) {
-        return token === 74 /* BarBarEqualsToken */
-            || token === 75 /* AmpersandAmpersandEqualsToken */
-            || token === 76 /* QuestionQuestionEqualsToken */;
+        return token === 75 /* BarBarEqualsToken */
+            || token === 76 /* AmpersandAmpersandEqualsToken */
+            || token === 77 /* QuestionQuestionEqualsToken */;
     }
     ts.isLogicalOrCoalescingAssignmentOperator = isLogicalOrCoalescingAssignmentOperator;
     function isLogicalOrCoalescingAssignmentExpression(expr) {
@@ -17803,7 +18526,7 @@ var ts;
     }
     ts.isLogicalOrCoalescingAssignmentExpression = isLogicalOrCoalescingAssignmentExpression;
     function isAssignmentOperator(token) {
-        return token >= 62 /* FirstAssignment */ && token <= 77 /* LastAssignment */;
+        return token >= 63 /* FirstAssignment */ && token <= 78 /* LastAssignment */;
     }
     ts.isAssignmentOperator = isAssignmentOperator;
     /** Get `C` given `N` if `N` is in the position `class C extends N` where `N` is an ExpressionWithTypeArguments. */
@@ -17816,23 +18539,27 @@ var ts;
         return ts.isExpressionWithTypeArguments(node)
             && ts.isHeritageClause(node.parent)
             && ts.isClassLike(node.parent.parent)
-            ? { class: node.parent.parent, isImplements: node.parent.token === 116 /* ImplementsKeyword */ }
+            ? { class: node.parent.parent, isImplements: node.parent.token === 117 /* ImplementsKeyword */ }
             : undefined;
     }
     ts.tryGetClassImplementingOrExtendingExpressionWithTypeArguments = tryGetClassImplementingOrExtendingExpressionWithTypeArguments;
     function isAssignmentExpression(node, excludeCompoundAssignment) {
         return ts.isBinaryExpression(node)
             && (excludeCompoundAssignment
-                ? node.operatorToken.kind === 62 /* EqualsToken */
+                ? node.operatorToken.kind === 63 /* EqualsToken */
                 : isAssignmentOperator(node.operatorToken.kind))
             && ts.isLeftHandSideExpression(node.left);
     }
     ts.isAssignmentExpression = isAssignmentExpression;
+    function isLeftHandSideOfAssignment(node) {
+        return isAssignmentExpression(node.parent) && node.parent.left === node;
+    }
+    ts.isLeftHandSideOfAssignment = isLeftHandSideOfAssignment;
     function isDestructuringAssignment(node) {
         if (isAssignmentExpression(node, /*excludeCompoundAssignment*/ true)) {
             var kind = node.left.kind;
-            return kind === 200 /* ObjectLiteralExpression */
-                || kind === 199 /* ArrayLiteralExpression */;
+            return kind === 204 /* ObjectLiteralExpression */
+                || kind === 203 /* ArrayLiteralExpression */;
         }
         return false;
     }
@@ -17842,30 +18569,33 @@ var ts;
     }
     ts.isExpressionWithTypeArgumentsInClassExtendsClause = isExpressionWithTypeArgumentsInClassExtendsClause;
     function isEntityNameExpression(node) {
-        return node.kind === 78 /* Identifier */ || isPropertyAccessEntityNameExpression(node);
+        return node.kind === 79 /* Identifier */ || isPropertyAccessEntityNameExpression(node);
     }
     ts.isEntityNameExpression = isEntityNameExpression;
     function getFirstIdentifier(node) {
         switch (node.kind) {
-            case 78 /* Identifier */:
+            case 79 /* Identifier */:
                 return node;
-            case 157 /* QualifiedName */:
+            case 160 /* QualifiedName */:
                 do {
                     node = node.left;
-                } while (node.kind !== 78 /* Identifier */);
+                } while (node.kind !== 79 /* Identifier */);
                 return node;
-            case 201 /* PropertyAccessExpression */:
+            case 205 /* PropertyAccessExpression */:
                 do {
                     node = node.expression;
-                } while (node.kind !== 78 /* Identifier */);
+                } while (node.kind !== 79 /* Identifier */);
                 return node;
         }
     }
     ts.getFirstIdentifier = getFirstIdentifier;
     function isDottedName(node) {
-        return node.kind === 78 /* Identifier */ || node.kind === 107 /* ThisKeyword */ || node.kind === 105 /* SuperKeyword */ ||
-            node.kind === 201 /* PropertyAccessExpression */ && isDottedName(node.expression) ||
-            node.kind === 207 /* ParenthesizedExpression */ && isDottedName(node.expression);
+        return node.kind === 79 /* Identifier */
+            || node.kind === 108 /* ThisKeyword */
+            || node.kind === 106 /* SuperKeyword */
+            || node.kind === 230 /* MetaProperty */
+            || node.kind === 205 /* PropertyAccessExpression */ && isDottedName(node.expression)
+            || node.kind === 211 /* ParenthesizedExpression */ && isDottedName(node.expression);
     }
     ts.isDottedName = isDottedName;
     function isPropertyAccessEntityNameExpression(node) {
@@ -17896,22 +18626,28 @@ var ts;
     }
     ts.isPrototypeAccess = isPrototypeAccess;
     function isRightSideOfQualifiedNameOrPropertyAccess(node) {
-        return (node.parent.kind === 157 /* QualifiedName */ && node.parent.right === node) ||
-            (node.parent.kind === 201 /* PropertyAccessExpression */ && node.parent.name === node);
+        return (node.parent.kind === 160 /* QualifiedName */ && node.parent.right === node) ||
+            (node.parent.kind === 205 /* PropertyAccessExpression */ && node.parent.name === node);
     }
     ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess;
+    function isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName(node) {
+        return ts.isQualifiedName(node.parent) && node.parent.right === node
+            || ts.isPropertyAccessExpression(node.parent) && node.parent.name === node
+            || ts.isJSDocMemberName(node.parent) && node.parent.right === node;
+    }
+    ts.isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName = isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName;
     function isEmptyObjectLiteral(expression) {
-        return expression.kind === 200 /* ObjectLiteralExpression */ &&
+        return expression.kind === 204 /* ObjectLiteralExpression */ &&
             expression.properties.length === 0;
     }
     ts.isEmptyObjectLiteral = isEmptyObjectLiteral;
     function isEmptyArrayLiteral(expression) {
-        return expression.kind === 199 /* ArrayLiteralExpression */ &&
+        return expression.kind === 203 /* ArrayLiteralExpression */ &&
             expression.elements.length === 0;
     }
     ts.isEmptyArrayLiteral = isEmptyArrayLiteral;
     function getLocalSymbolForExportDefault(symbol) {
-        if (!isExportDefaultSymbol(symbol))
+        if (!isExportDefaultSymbol(symbol) || !symbol.declarations)
             return undefined;
         for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
             var decl = _a[_i];
@@ -17926,7 +18662,7 @@ var ts;
     }
     /** Return ".ts", ".d.ts", or ".tsx", if that is the extension. */
     function tryExtractTSExtension(fileName) {
-        return ts.find(ts.supportedTSExtensionsForExtractExtension, function (extension) { return ts.fileExtensionIs(fileName, extension); });
+        return ts.find(supportedTSExtensionsForExtractExtension, function (extension) { return ts.fileExtensionIs(fileName, extension); });
     }
     ts.tryExtractTSExtension = tryExtractTSExtension;
     /**
@@ -18238,8 +18974,8 @@ var ts;
         var parseNode = ts.getParseTreeNode(node);
         if (parseNode) {
             switch (parseNode.parent.kind) {
-                case 255 /* EnumDeclaration */:
-                case 256 /* ModuleDeclaration */:
+                case 259 /* EnumDeclaration */:
+                case 260 /* ModuleDeclaration */:
                     return parseNode === parseNode.parent.name;
             }
         }
@@ -18266,9 +19002,11 @@ var ts;
         return symbol.flags & 33554432 /* Transient */ ? symbol.checkFlags : 0;
     }
     ts.getCheckFlags = getCheckFlags;
-    function getDeclarationModifierFlagsFromSymbol(s) {
+    function getDeclarationModifierFlagsFromSymbol(s, isWrite) {
+        if (isWrite === void 0) { isWrite = false; }
         if (s.valueDeclaration) {
-            var flags = ts.getCombinedModifierFlags(s.valueDeclaration);
+            var declaration = (isWrite && s.declarations && ts.find(s.declarations, function (d) { return d.kind === 172 /* SetAccessor */; })) || s.valueDeclaration;
+            var flags = ts.getCombinedModifierFlags(declaration);
             return s.parent && s.parent.flags & 32 /* Class */ ? flags : flags & ~28 /* AccessibilityModifier */;
         }
         if (getCheckFlags(s) & 6 /* Synthetic */) {
@@ -18316,35 +19054,35 @@ var ts;
         if (!parent)
             return 0 /* Read */;
         switch (parent.kind) {
-            case 207 /* ParenthesizedExpression */:
+            case 211 /* ParenthesizedExpression */:
                 return accessKind(parent);
-            case 215 /* PostfixUnaryExpression */:
-            case 214 /* PrefixUnaryExpression */:
+            case 219 /* PostfixUnaryExpression */:
+            case 218 /* PrefixUnaryExpression */:
                 var operator = parent.operator;
                 return operator === 45 /* PlusPlusToken */ || operator === 46 /* MinusMinusToken */ ? writeOrReadWrite() : 0 /* Read */;
-            case 216 /* BinaryExpression */:
+            case 220 /* BinaryExpression */:
                 var _a = parent, left = _a.left, operatorToken = _a.operatorToken;
                 return left === node && isAssignmentOperator(operatorToken.kind) ?
-                    operatorToken.kind === 62 /* EqualsToken */ ? 1 /* Write */ : writeOrReadWrite()
+                    operatorToken.kind === 63 /* EqualsToken */ ? 1 /* Write */ : writeOrReadWrite()
                     : 0 /* Read */;
-            case 201 /* PropertyAccessExpression */:
+            case 205 /* PropertyAccessExpression */:
                 return parent.name !== node ? 0 /* Read */ : accessKind(parent);
-            case 288 /* PropertyAssignment */: {
+            case 294 /* PropertyAssignment */: {
                 var parentAccess = accessKind(parent.parent);
                 // In `({ x: varname }) = { x: 1 }`, the left `x` is a read, the right `x` is a write.
                 return node === parent.name ? reverseAccessKind(parentAccess) : parentAccess;
             }
-            case 289 /* ShorthandPropertyAssignment */:
+            case 295 /* ShorthandPropertyAssignment */:
                 // Assume it's the local variable being accessed, since we don't check public properties for --noUnusedLocals.
                 return node === parent.objectAssignmentInitializer ? 0 /* Read */ : accessKind(parent.parent);
-            case 199 /* ArrayLiteralExpression */:
+            case 203 /* ArrayLiteralExpression */:
                 return accessKind(parent);
             default:
                 return 0 /* Read */;
         }
         function writeOrReadWrite() {
             // If grandparent is not an ExpressionStatement, this is used as an expression in addition to having a side effect.
-            return parent.parent && skipParenthesesUp(parent.parent).kind === 233 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */;
+            return parent.parent && walkUpParenthesizedExpressions(parent.parent).kind === 237 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */;
         }
     }
     function reverseAccessKind(a) {
@@ -18432,7 +19170,8 @@ var ts;
     }
     ts.isAbstractConstructorSymbol = isAbstractConstructorSymbol;
     function getClassLikeDeclarationOfSymbol(symbol) {
-        return ts.find(symbol.declarations, ts.isClassLike);
+        var _a;
+        return (_a = symbol.declarations) === null || _a === void 0 ? void 0 : _a.find(ts.isClassLike);
     }
     ts.getClassLikeDeclarationOfSymbol = getClassLikeDeclarationOfSymbol;
     function getObjectFlags(type) {
@@ -18475,7 +19214,6 @@ var ts;
     ts.getLastChild = getLastChild;
     function addToSeen(seen, key, value) {
         if (value === void 0) { value = true; }
-        key = String(key);
         if (seen.has(key)) {
             return false;
         }
@@ -18488,37 +19226,37 @@ var ts;
     }
     ts.isObjectTypeDeclaration = isObjectTypeDeclaration;
     function isTypeNodeKind(kind) {
-        return (kind >= 172 /* FirstTypeNode */ && kind <= 195 /* LastTypeNode */)
-            || kind === 128 /* AnyKeyword */
-            || kind === 152 /* UnknownKeyword */
-            || kind === 144 /* NumberKeyword */
-            || kind === 155 /* BigIntKeyword */
-            || kind === 145 /* ObjectKeyword */
-            || kind === 131 /* BooleanKeyword */
-            || kind === 147 /* StringKeyword */
-            || kind === 148 /* SymbolKeyword */
-            || kind === 113 /* VoidKeyword */
-            || kind === 150 /* UndefinedKeyword */
-            || kind === 141 /* NeverKeyword */
-            || kind === 223 /* ExpressionWithTypeArguments */
-            || kind === 303 /* JSDocAllType */
-            || kind === 304 /* JSDocUnknownType */
-            || kind === 305 /* JSDocNullableType */
-            || kind === 306 /* JSDocNonNullableType */
-            || kind === 307 /* JSDocOptionalType */
-            || kind === 308 /* JSDocFunctionType */
-            || kind === 309 /* JSDocVariadicType */;
+        return (kind >= 176 /* FirstTypeNode */ && kind <= 199 /* LastTypeNode */)
+            || kind === 130 /* AnyKeyword */
+            || kind === 154 /* UnknownKeyword */
+            || kind === 146 /* NumberKeyword */
+            || kind === 157 /* BigIntKeyword */
+            || kind === 147 /* ObjectKeyword */
+            || kind === 133 /* BooleanKeyword */
+            || kind === 149 /* StringKeyword */
+            || kind === 150 /* SymbolKeyword */
+            || kind === 114 /* VoidKeyword */
+            || kind === 152 /* UndefinedKeyword */
+            || kind === 143 /* NeverKeyword */
+            || kind === 227 /* ExpressionWithTypeArguments */
+            || kind === 310 /* JSDocAllType */
+            || kind === 311 /* JSDocUnknownType */
+            || kind === 312 /* JSDocNullableType */
+            || kind === 313 /* JSDocNonNullableType */
+            || kind === 314 /* JSDocOptionalType */
+            || kind === 315 /* JSDocFunctionType */
+            || kind === 316 /* JSDocVariadicType */;
     }
     ts.isTypeNodeKind = isTypeNodeKind;
     function isAccessExpression(node) {
-        return node.kind === 201 /* PropertyAccessExpression */ || node.kind === 202 /* ElementAccessExpression */;
+        return node.kind === 205 /* PropertyAccessExpression */ || node.kind === 206 /* ElementAccessExpression */;
     }
     ts.isAccessExpression = isAccessExpression;
     function getNameOfAccessExpression(node) {
-        if (node.kind === 201 /* PropertyAccessExpression */) {
+        if (node.kind === 205 /* PropertyAccessExpression */) {
             return node.name;
         }
-        ts.Debug.assert(node.kind === 202 /* ElementAccessExpression */);
+        ts.Debug.assert(node.kind === 206 /* ElementAccessExpression */);
         return node.argumentExpression;
     }
     ts.getNameOfAccessExpression = getNameOfAccessExpression;
@@ -18533,7 +19271,7 @@ var ts;
     }
     ts.isBundleFileTextLike = isBundleFileTextLike;
     function isNamedImportsOrExports(node) {
-        return node.kind === 264 /* NamedImports */ || node.kind === 268 /* NamedExports */;
+        return node.kind === 268 /* NamedImports */ || node.kind === 272 /* NamedExports */;
     }
     ts.isNamedImportsOrExports = isNamedImportsOrExports;
     function getLeftmostAccessExpression(expr) {
@@ -18546,28 +19284,28 @@ var ts;
     function getLeftmostExpression(node, stopAtCallExpressions) {
         while (true) {
             switch (node.kind) {
-                case 215 /* PostfixUnaryExpression */:
+                case 219 /* PostfixUnaryExpression */:
                     node = node.operand;
                     continue;
-                case 216 /* BinaryExpression */:
+                case 220 /* BinaryExpression */:
                     node = node.left;
                     continue;
-                case 217 /* ConditionalExpression */:
+                case 221 /* ConditionalExpression */:
                     node = node.condition;
                     continue;
-                case 205 /* TaggedTemplateExpression */:
+                case 209 /* TaggedTemplateExpression */:
                     node = node.tag;
                     continue;
-                case 203 /* CallExpression */:
+                case 207 /* CallExpression */:
                     if (stopAtCallExpressions) {
                         return node;
                     }
                 // falls through
-                case 224 /* AsExpression */:
-                case 202 /* ElementAccessExpression */:
-                case 201 /* PropertyAccessExpression */:
-                case 225 /* NonNullExpression */:
-                case 336 /* PartiallyEmittedExpression */:
+                case 228 /* AsExpression */:
+                case 206 /* ElementAccessExpression */:
+                case 205 /* PropertyAccessExpression */:
+                case 229 /* NonNullExpression */:
+                case 348 /* PartiallyEmittedExpression */:
                     node = node.expression;
                     continue;
             }
@@ -18876,7 +19614,10 @@ var ts;
     }
     ts.getLanguageVariant = getLanguageVariant;
     function getEmitScriptTarget(compilerOptions) {
-        return compilerOptions.target || 0 /* ES3 */;
+        return compilerOptions.target ||
+            (compilerOptions.module === ts.ModuleKind.Node12 && 7 /* ES2020 */) ||
+            (compilerOptions.module === ts.ModuleKind.NodeNext && 99 /* ESNext */) ||
+            0 /* ES3 */;
     }
     ts.getEmitScriptTarget = getEmitScriptTarget;
     function getEmitModuleKind(compilerOptions) {
@@ -18888,7 +19629,20 @@ var ts;
     function getEmitModuleResolutionKind(compilerOptions) {
         var moduleResolution = compilerOptions.moduleResolution;
         if (moduleResolution === undefined) {
-            moduleResolution = getEmitModuleKind(compilerOptions) === ts.ModuleKind.CommonJS ? ts.ModuleResolutionKind.NodeJs : ts.ModuleResolutionKind.Classic;
+            switch (getEmitModuleKind(compilerOptions)) {
+                case ts.ModuleKind.CommonJS:
+                    moduleResolution = ts.ModuleResolutionKind.NodeJs;
+                    break;
+                case ts.ModuleKind.Node12:
+                    moduleResolution = ts.ModuleResolutionKind.Node12;
+                    break;
+                case ts.ModuleKind.NodeNext:
+                    moduleResolution = ts.ModuleResolutionKind.NodeNext;
+                    break;
+                default:
+                    moduleResolution = ts.ModuleResolutionKind.Classic;
+                    break;
+            }
         }
         return moduleResolution;
     }
@@ -18899,7 +19653,10 @@ var ts;
             case ts.ModuleKind.AMD:
             case ts.ModuleKind.ES2015:
             case ts.ModuleKind.ES2020:
+            case ts.ModuleKind.ES2022:
             case ts.ModuleKind.ESNext:
+            case ts.ModuleKind.Node12:
+            case ts.ModuleKind.NodeNext:
                 return true;
             default:
                 return false;
@@ -18918,11 +19675,23 @@ var ts;
         return !!(getEmitDeclarations(options) && options.declarationMap);
     }
     ts.getAreDeclarationMapsEnabled = getAreDeclarationMapsEnabled;
+    function getESModuleInterop(compilerOptions) {
+        if (compilerOptions.esModuleInterop !== undefined) {
+            return compilerOptions.esModuleInterop;
+        }
+        switch (getEmitModuleKind(compilerOptions)) {
+            case ts.ModuleKind.Node12:
+            case ts.ModuleKind.NodeNext:
+                return true;
+        }
+        return undefined;
+    }
+    ts.getESModuleInterop = getESModuleInterop;
     function getAllowSyntheticDefaultImports(compilerOptions) {
         var moduleKind = getEmitModuleKind(compilerOptions);
         return compilerOptions.allowSyntheticDefaultImports !== undefined
             ? compilerOptions.allowSyntheticDefaultImports
-            : compilerOptions.esModuleInterop ||
+            : getESModuleInterop(compilerOptions) ||
                 moduleKind === ts.ModuleKind.System;
     }
     ts.getAllowSyntheticDefaultImports = getAllowSyntheticDefaultImports;
@@ -18946,14 +19715,16 @@ var ts;
         return compilerOptions.allowJs === undefined ? !!compilerOptions.checkJs : compilerOptions.allowJs;
     }
     ts.getAllowJSCompilerOption = getAllowJSCompilerOption;
+    function getUseDefineForClassFields(compilerOptions) {
+        return compilerOptions.useDefineForClassFields === undefined ? getEmitScriptTarget(compilerOptions) === 99 /* ESNext */ : compilerOptions.useDefineForClassFields;
+    }
+    ts.getUseDefineForClassFields = getUseDefineForClassFields;
     function compilerOptionsAffectSemanticDiagnostics(newOptions, oldOptions) {
-        return oldOptions !== newOptions &&
-            ts.semanticDiagnosticsOptionDeclarations.some(function (option) { return !isJsonEqual(getCompilerOptionValue(oldOptions, option), getCompilerOptionValue(newOptions, option)); });
+        return optionsHaveChanges(oldOptions, newOptions, ts.semanticDiagnosticsOptionDeclarations);
     }
     ts.compilerOptionsAffectSemanticDiagnostics = compilerOptionsAffectSemanticDiagnostics;
     function compilerOptionsAffectEmit(newOptions, oldOptions) {
-        return oldOptions !== newOptions &&
-            ts.affectsEmitOptionDeclarations.some(function (option) { return !isJsonEqual(getCompilerOptionValue(oldOptions, option), getCompilerOptionValue(newOptions, option)); });
+        return optionsHaveChanges(oldOptions, newOptions, ts.affectsEmitOptionDeclarations);
     }
     ts.compilerOptionsAffectEmit = compilerOptionsAffectEmit;
     function getCompilerOptionValue(options, option) {
@@ -18967,7 +19738,7 @@ var ts;
     ts.getJSXTransformEnabled = getJSXTransformEnabled;
     function getJSXImplicitImportBase(compilerOptions, file) {
         var jsxImportSourcePragmas = file === null || file === void 0 ? void 0 : file.pragmas.get("jsximportsource");
-        var jsxImportSourcePragma = ts.isArray(jsxImportSourcePragmas) ? jsxImportSourcePragmas[0] : jsxImportSourcePragmas;
+        var jsxImportSourcePragma = ts.isArray(jsxImportSourcePragmas) ? jsxImportSourcePragmas[jsxImportSourcePragmas.length - 1] : jsxImportSourcePragmas;
         return compilerOptions.jsx === 4 /* ReactJSX */ ||
             compilerOptions.jsx === 5 /* ReactJSXDev */ ||
             compilerOptions.jsxImportSource ||
@@ -18977,7 +19748,7 @@ var ts;
     }
     ts.getJSXImplicitImportBase = getJSXImplicitImportBase;
     function getJSXRuntimeImport(base, options) {
-        return base ? base + "/" + (options.jsx === 5 /* ReactJSXDev */ ? "jsx-dev-runtime" : "jsx-runtime") : undefined;
+        return base ? "".concat(base, "/").concat(options.jsx === 5 /* ReactJSXDev */ ? "jsx-dev-runtime" : "jsx-runtime") : undefined;
     }
     ts.getJSXRuntimeImport = getJSXRuntimeImport;
     function hasZeroOrOneAsteriskCharacter(str) {
@@ -19000,6 +19771,7 @@ var ts;
         var symlinkedDirectories;
         var symlinkedDirectoriesByRealpath;
         var symlinkedFiles;
+        var hasProcessedResolutions = false;
         return {
             getSymlinkedFiles: function () { return symlinkedFiles; },
             getSymlinkedDirectories: function () { return symlinkedDirectories; },
@@ -19017,32 +19789,48 @@ var ts;
                     }
                     (symlinkedDirectories || (symlinkedDirectories = new ts.Map())).set(symlinkPath, real);
                 }
-            }
+            },
+            setSymlinkedDirectoryFromSymlinkedFile: function (symlink, real) {
+                this.setSymlinkedFile(ts.toPath(symlink, cwd, getCanonicalFileName), real);
+                var _a = guessDirectorySymlink(real, symlink, cwd, getCanonicalFileName) || ts.emptyArray, commonResolved = _a[0], commonOriginal = _a[1];
+                if (commonResolved && commonOriginal) {
+                    this.setSymlinkedDirectory(commonOriginal, {
+                        real: commonResolved,
+                        realPath: ts.toPath(commonResolved, cwd, getCanonicalFileName),
+                    });
+                }
+            },
+            setSymlinksFromResolutions: function (files, typeReferenceDirectives) {
+                var _this = this;
+                var _a;
+                ts.Debug.assert(!hasProcessedResolutions);
+                hasProcessedResolutions = true;
+                for (var _i = 0, files_1 = files; _i < files_1.length; _i++) {
+                    var file = files_1[_i];
+                    (_a = file.resolvedModules) === null || _a === void 0 ? void 0 : _a.forEach(function (resolution) { return processResolution(_this, resolution); });
+                }
+                typeReferenceDirectives === null || typeReferenceDirectives === void 0 ? void 0 : typeReferenceDirectives.forEach(function (resolution) { return processResolution(_this, resolution); });
+            },
+            hasProcessedResolutions: function () { return hasProcessedResolutions; },
         };
-    }
-    ts.createSymlinkCache = createSymlinkCache;
-    function discoverProbableSymlinks(files, getCanonicalFileName, cwd) {
-        var cache = createSymlinkCache(cwd, getCanonicalFileName);
-        var symlinks = ts.flatten(ts.mapDefined(files, function (sf) {
-            return sf.resolvedModules && ts.compact(ts.arrayFrom(ts.mapIterator(sf.resolvedModules.values(), function (res) {
-                return res && res.originalPath && res.resolvedFileName !== res.originalPath ? [res.resolvedFileName, res.originalPath] : undefined;
-            })));
-        }));
-        for (var _i = 0, symlinks_1 = symlinks; _i < symlinks_1.length; _i++) {
-            var _a = symlinks_1[_i], resolvedPath = _a[0], originalPath = _a[1];
-            var _b = guessDirectorySymlink(resolvedPath, originalPath, cwd, getCanonicalFileName) || ts.emptyArray, commonResolved = _b[0], commonOriginal = _b[1];
+        function processResolution(cache, resolution) {
+            if (!resolution || !resolution.originalPath || !resolution.resolvedFileName)
+                return;
+            var resolvedFileName = resolution.resolvedFileName, originalPath = resolution.originalPath;
+            cache.setSymlinkedFile(ts.toPath(originalPath, cwd, getCanonicalFileName), resolvedFileName);
+            var _a = guessDirectorySymlink(resolvedFileName, originalPath, cwd, getCanonicalFileName) || ts.emptyArray, commonResolved = _a[0], commonOriginal = _a[1];
             if (commonResolved && commonOriginal) {
                 cache.setSymlinkedDirectory(commonOriginal, { real: commonResolved, realPath: ts.toPath(commonResolved, cwd, getCanonicalFileName) });
             }
         }
-        return cache;
     }
-    ts.discoverProbableSymlinks = discoverProbableSymlinks;
+    ts.createSymlinkCache = createSymlinkCache;
     function guessDirectorySymlink(a, b, cwd, getCanonicalFileName) {
         var aParts = ts.getPathComponents(ts.getNormalizedAbsolutePath(a, cwd));
         var bParts = ts.getPathComponents(ts.getNormalizedAbsolutePath(b, cwd));
         var isDirectory = false;
-        while (!isNodeModulesOrScopedPackageDirectory(aParts[aParts.length - 2], getCanonicalFileName) &&
+        while (aParts.length >= 2 && bParts.length >= 2 &&
+            !isNodeModulesOrScopedPackageDirectory(aParts[aParts.length - 2], getCanonicalFileName) &&
             !isNodeModulesOrScopedPackageDirectory(bParts[bParts.length - 2], getCanonicalFileName) &&
             getCanonicalFileName(aParts[aParts.length - 1]) === getCanonicalFileName(bParts[bParts.length - 1])) {
             aParts.pop();
@@ -19054,7 +19842,7 @@ var ts;
     // KLUDGE: Don't assume one 'node_modules' links to another. More likely a single directory inside the node_modules is the symlink.
     // ALso, don't assume that an `@foo` directory is linked. More likely the contents of that are linked.
     function isNodeModulesOrScopedPackageDirectory(s, getCanonicalFileName) {
-        return getCanonicalFileName(s) === "node_modules" || ts.startsWith(s, "@");
+        return s !== undefined && (getCanonicalFileName(s) === "node_modules" || ts.startsWith(s, "@"));
     }
     function stripLeadingDirectorySeparator(s) {
         return ts.isAnyDirectorySeparator(s.charCodeAt(0)) ? s.slice(1) : undefined;
@@ -19077,7 +19865,7 @@ var ts;
     }
     var wildcardCharCodes = [42 /* asterisk */, 63 /* question */];
     ts.commonPackageFolders = ["node_modules", "bower_components", "jspm_packages"];
-    var implicitExcludePathRegexPattern = "(?!(" + ts.commonPackageFolders.join("|") + ")(/|$))";
+    var implicitExcludePathRegexPattern = "(?!(".concat(ts.commonPackageFolders.join("|"), ")(/|$))");
     var filesMatcher = {
         /**
          * Matches any single directory segment unless it is the last segment and a .min.js file
@@ -19090,7 +19878,7 @@ var ts;
          * 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: "(/" + implicitExcludePathRegexPattern + "[^/.][^/]*)*?",
+        doubleAsteriskRegexFragment: "(/".concat(implicitExcludePathRegexPattern, "[^/.][^/]*)*?"),
         replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, filesMatcher.singleAsteriskRegexFragment); }
     };
     var directoriesMatcher = {
@@ -19099,7 +19887,7 @@ var ts;
          * 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: "(/" + implicitExcludePathRegexPattern + "[^/.][^/]*)*?",
+        doubleAsteriskRegexFragment: "(/".concat(implicitExcludePathRegexPattern, "[^/.][^/]*)*?"),
         replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, directoriesMatcher.singleAsteriskRegexFragment); }
     };
     var excludeMatcher = {
@@ -19117,10 +19905,10 @@ var ts;
         if (!patterns || !patterns.length) {
             return undefined;
         }
-        var pattern = patterns.map(function (pattern) { return "(" + pattern + ")"; }).join("|");
+        var pattern = patterns.map(function (pattern) { return "(".concat(pattern, ")"); }).join("|");
         // If excluding, match "foo/bar/baz...", but if including, only allow "foo".
         var terminator = usage === "exclude" ? "($|/)" : "$";
-        return "^(" + pattern + ")" + terminator;
+        return "^(".concat(pattern, ")").concat(terminator);
     }
     ts.getRegularExpressionForWildcard = getRegularExpressionForWildcard;
     function getRegularExpressionsForWildcards(specs, basePath, usage) {
@@ -19142,7 +19930,7 @@ var ts;
     ts.isImplicitGlob = isImplicitGlob;
     function getPatternFromSpec(spec, basePath, usage) {
         var pattern = spec && getSubPatternFromSpec(spec, basePath, usage, wildcardMatchers[usage]);
-        return pattern && "^(" + pattern + ")" + (usage === "exclude" ? "($|/)" : "$");
+        return pattern && "^(".concat(pattern, ")").concat(usage === "exclude" ? "($|/)" : "$");
     }
     ts.getPatternFromSpec = getPatternFromSpec;
     function getSubPatternFromSpec(spec, basePath, usage, _a) {
@@ -19220,7 +20008,7 @@ var ts;
         currentDirectory = ts.normalizePath(currentDirectory);
         var absolutePath = ts.combinePaths(currentDirectory, path);
         return {
-            includeFilePatterns: ts.map(getRegularExpressionsForWildcards(includes, absolutePath, "files"), function (pattern) { return "^" + pattern + "$"; }),
+            includeFilePatterns: ts.map(getRegularExpressionsForWildcards(includes, absolutePath, "files"), function (pattern) { return "^".concat(pattern, "$"); }),
             includeFilePattern: getRegularExpressionForWildcard(includes, absolutePath, "files"),
             includeDirectoryPattern: getRegularExpressionForWildcard(includes, absolutePath, "directories"),
             excludePattern: getRegularExpressionForWildcard(excludes, absolutePath, "exclude"),
@@ -19352,10 +20140,14 @@ var ts;
         var ext = fileName.substr(fileName.lastIndexOf("."));
         switch (ext.toLowerCase()) {
             case ".js" /* Js */:
+            case ".cjs" /* Cjs */:
+            case ".mjs" /* Mjs */:
                 return 1 /* JS */;
             case ".jsx" /* Jsx */:
                 return 2 /* JSX */;
             case ".ts" /* Ts */:
+            case ".cts" /* Cts */:
+            case ".mts" /* Mts */:
                 return 3 /* TS */;
             case ".tsx" /* Tsx */:
                 return 4 /* TSX */;
@@ -19367,55 +20159,54 @@ var ts;
     }
     ts.getScriptKindFromFileName = getScriptKindFromFileName;
     /**
-     *  List of supported extensions in order of file resolution precedence.
+     *  Groups of supported extensions in order of file resolution precedence. (eg, TS > TSX > DTS and seperately, CTS > DCTS)
      */
-    ts.supportedTSExtensions = [".ts" /* Ts */, ".tsx" /* Tsx */, ".d.ts" /* Dts */];
-    ts.supportedTSExtensionsWithJson = [".ts" /* Ts */, ".tsx" /* Tsx */, ".d.ts" /* Dts */, ".json" /* Json */];
+    ts.supportedTSExtensions = [[".ts" /* Ts */, ".tsx" /* Tsx */, ".d.ts" /* Dts */], [".cts" /* Cts */, ".d.cts" /* Dcts */], [".mts" /* Mts */, ".d.mts" /* Dmts */]];
+    ts.supportedTSExtensionsFlat = ts.flatten(ts.supportedTSExtensions);
+    var supportedTSExtensionsWithJson = __spreadArray(__spreadArray([], ts.supportedTSExtensions, true), [[".json" /* Json */]], false);
     /** Must have ".d.ts" first because if ".ts" goes first, that will be detected as the extension instead of ".d.ts". */
-    ts.supportedTSExtensionsForExtractExtension = [".d.ts" /* Dts */, ".ts" /* Ts */, ".tsx" /* Tsx */];
-    ts.supportedJSExtensions = [".js" /* Js */, ".jsx" /* Jsx */];
-    ts.supportedJSAndJsonExtensions = [".js" /* Js */, ".jsx" /* Jsx */, ".json" /* Json */];
-    var allSupportedExtensions = __spreadArray(__spreadArray([], ts.supportedTSExtensions), ts.supportedJSExtensions);
-    var allSupportedExtensionsWithJson = __spreadArray(__spreadArray(__spreadArray([], ts.supportedTSExtensions), ts.supportedJSExtensions), [".json" /* Json */]);
+    var supportedTSExtensionsForExtractExtension = [".d.ts" /* Dts */, ".d.cts" /* Dcts */, ".d.mts" /* Dmts */, ".cts" /* Cts */, ".mts" /* Mts */, ".ts" /* Ts */, ".tsx" /* Tsx */, ".cts" /* Cts */, ".mts" /* Mts */];
+    ts.supportedJSExtensions = [[".js" /* Js */, ".jsx" /* Jsx */], [".mjs" /* Mjs */], [".cjs" /* Cjs */]];
+    ts.supportedJSExtensionsFlat = ts.flatten(ts.supportedJSExtensions);
+    var allSupportedExtensions = [[".ts" /* Ts */, ".tsx" /* Tsx */, ".d.ts" /* Dts */, ".js" /* Js */, ".jsx" /* Jsx */], [".cts" /* Cts */, ".d.cts" /* Dcts */, ".cjs" /* Cjs */], [".mts" /* Mts */, ".d.mts" /* Dmts */, ".mjs" /* Mjs */]];
+    var allSupportedExtensionsWithJson = __spreadArray(__spreadArray([], allSupportedExtensions, true), [[".json" /* Json */]], false);
     function getSupportedExtensions(options, extraFileExtensions) {
         var needJsExtensions = options && getAllowJSCompilerOption(options);
         if (!extraFileExtensions || extraFileExtensions.length === 0) {
             return needJsExtensions ? allSupportedExtensions : ts.supportedTSExtensions;
         }
-        var extensions = __spreadArray(__spreadArray([], needJsExtensions ? allSupportedExtensions : ts.supportedTSExtensions), ts.mapDefined(extraFileExtensions, function (x) { return x.scriptKind === 7 /* Deferred */ || needJsExtensions && isJSLike(x.scriptKind) ? x.extension : undefined; }));
-        return ts.deduplicate(extensions, ts.equateStringsCaseSensitive, ts.compareStringsCaseSensitive);
+        var builtins = needJsExtensions ? allSupportedExtensions : ts.supportedTSExtensions;
+        var flatBuiltins = ts.flatten(builtins);
+        var extensions = __spreadArray(__spreadArray([], builtins, true), ts.mapDefined(extraFileExtensions, function (x) { return x.scriptKind === 7 /* Deferred */ || needJsExtensions && isJSLike(x.scriptKind) && flatBuiltins.indexOf(x.extension) === -1 ? [x.extension] : undefined; }), true);
+        return extensions;
     }
     ts.getSupportedExtensions = getSupportedExtensions;
-    function getSuppoertedExtensionsWithJsonIfResolveJsonModule(options, supportedExtensions) {
-        if (!options || !options.resolveJsonModule) {
+    function getSupportedExtensionsWithJsonIfResolveJsonModule(options, supportedExtensions) {
+        if (!options || !options.resolveJsonModule)
             return supportedExtensions;
-        }
-        if (supportedExtensions === allSupportedExtensions) {
+        if (supportedExtensions === allSupportedExtensions)
             return allSupportedExtensionsWithJson;
-        }
-        if (supportedExtensions === ts.supportedTSExtensions) {
-            return ts.supportedTSExtensionsWithJson;
-        }
-        return __spreadArray(__spreadArray([], supportedExtensions), [".json" /* Json */]);
+        if (supportedExtensions === ts.supportedTSExtensions)
+            return supportedTSExtensionsWithJson;
+        return __spreadArray(__spreadArray([], supportedExtensions, true), [[".json" /* Json */]], false);
     }
-    ts.getSuppoertedExtensionsWithJsonIfResolveJsonModule = getSuppoertedExtensionsWithJsonIfResolveJsonModule;
+    ts.getSupportedExtensionsWithJsonIfResolveJsonModule = getSupportedExtensionsWithJsonIfResolveJsonModule;
     function isJSLike(scriptKind) {
         return scriptKind === 1 /* JS */ || scriptKind === 2 /* JSX */;
     }
     function hasJSFileExtension(fileName) {
-        return ts.some(ts.supportedJSExtensions, function (extension) { return ts.fileExtensionIs(fileName, extension); });
+        return ts.some(ts.supportedJSExtensionsFlat, function (extension) { return ts.fileExtensionIs(fileName, extension); });
     }
     ts.hasJSFileExtension = hasJSFileExtension;
     function hasTSFileExtension(fileName) {
-        return ts.some(ts.supportedTSExtensions, function (extension) { return ts.fileExtensionIs(fileName, extension); });
+        return ts.some(ts.supportedTSExtensionsFlat, function (extension) { return ts.fileExtensionIs(fileName, extension); });
     }
     ts.hasTSFileExtension = hasTSFileExtension;
     function isSupportedSourceFileName(fileName, compilerOptions, extraFileExtensions) {
-        if (!fileName) {
+        if (!fileName)
             return false;
-        }
         var supportedExtensions = getSupportedExtensions(compilerOptions, extraFileExtensions);
-        for (var _i = 0, _a = getSuppoertedExtensionsWithJsonIfResolveJsonModule(compilerOptions, supportedExtensions); _i < _a.length; _i++) {
+        for (var _i = 0, _a = ts.flatten(getSupportedExtensionsWithJsonIfResolveJsonModule(compilerOptions, supportedExtensions)); _i < _a.length; _i++) {
             var extension = _a[_i];
             if (ts.fileExtensionIs(fileName, extension)) {
                 return true;
@@ -19432,57 +20223,7 @@ var ts;
         return ts.compareValues(numberOfDirectorySeparators(path1), numberOfDirectorySeparators(path2));
     }
     ts.compareNumberOfDirectorySeparators = compareNumberOfDirectorySeparators;
-    /**
-     * Extension boundaries by priority. Lower numbers indicate higher priorities, and are
-     * aligned to the offset of the highest priority extension in the
-     * allSupportedExtensions array.
-     */
-    var ExtensionPriority;
-    (function (ExtensionPriority) {
-        ExtensionPriority[ExtensionPriority["TypeScriptFiles"] = 0] = "TypeScriptFiles";
-        ExtensionPriority[ExtensionPriority["DeclarationAndJavaScriptFiles"] = 2] = "DeclarationAndJavaScriptFiles";
-        ExtensionPriority[ExtensionPriority["Highest"] = 0] = "Highest";
-        ExtensionPriority[ExtensionPriority["Lowest"] = 2] = "Lowest";
-    })(ExtensionPriority = ts.ExtensionPriority || (ts.ExtensionPriority = {}));
-    function getExtensionPriority(path, supportedExtensions) {
-        for (var i = supportedExtensions.length - 1; i >= 0; i--) {
-            if (ts.fileExtensionIs(path, supportedExtensions[i])) {
-                return adjustExtensionPriority(i, supportedExtensions);
-            }
-        }
-        // If its not in the list of supported extensions, this is likely a
-        // TypeScript file with a non-ts extension
-        return 0 /* Highest */;
-    }
-    ts.getExtensionPriority = getExtensionPriority;
-    /**
-     * Adjusts an extension priority to be the highest priority within the same range.
-     */
-    function adjustExtensionPriority(extensionPriority, supportedExtensions) {
-        if (extensionPriority < 2 /* DeclarationAndJavaScriptFiles */) {
-            return 0 /* TypeScriptFiles */;
-        }
-        else if (extensionPriority < supportedExtensions.length) {
-            return 2 /* DeclarationAndJavaScriptFiles */;
-        }
-        else {
-            return supportedExtensions.length;
-        }
-    }
-    ts.adjustExtensionPriority = adjustExtensionPriority;
-    /**
-     * Gets the next lowest extension priority for a given priority.
-     */
-    function getNextLowestExtensionPriority(extensionPriority, supportedExtensions) {
-        if (extensionPriority < 2 /* DeclarationAndJavaScriptFiles */) {
-            return 2 /* DeclarationAndJavaScriptFiles */;
-        }
-        else {
-            return supportedExtensions.length;
-        }
-    }
-    ts.getNextLowestExtensionPriority = getNextLowestExtensionPriority;
-    var extensionsToRemove = [".d.ts" /* Dts */, ".ts" /* Ts */, ".js" /* Js */, ".tsx" /* Tsx */, ".jsx" /* Jsx */, ".json" /* Json */];
+    var extensionsToRemove = [".d.ts" /* Dts */, ".d.mts" /* Dmts */, ".d.cts" /* Dcts */, ".mjs" /* Mjs */, ".mts" /* Mts */, ".cjs" /* Cjs */, ".cts" /* Cts */, ".ts" /* Ts */, ".js" /* Js */, ".tsx" /* Tsx */, ".jsx" /* Jsx */, ".json" /* Json */];
     function removeFileExtension(path) {
         for (var _i = 0, extensionsToRemove_1 = extensionsToRemove; _i < extensionsToRemove_1.length; _i++) {
             var ext = extensionsToRemove_1[_i];
@@ -19506,16 +20247,27 @@ var ts;
         return ts.changeAnyExtension(path, newExtension, extensionsToRemove, /*ignoreCase*/ false);
     }
     ts.changeExtension = changeExtension;
+    /**
+     * Returns the input if there are no stars, a pattern if there is exactly one,
+     * and undefined if there are more.
+     */
     function tryParsePattern(pattern) {
-        // This should be verified outside of here and a proper error thrown.
-        ts.Debug.assert(hasZeroOrOneAsteriskCharacter(pattern));
         var indexOfStar = pattern.indexOf("*");
-        return indexOfStar === -1 ? undefined : {
-            prefix: pattern.substr(0, indexOfStar),
-            suffix: pattern.substr(indexOfStar + 1)
-        };
+        if (indexOfStar === -1) {
+            return pattern;
+        }
+        return pattern.indexOf("*", indexOfStar + 1) !== -1
+            ? undefined
+            : {
+                prefix: pattern.substr(0, indexOfStar),
+                suffix: pattern.substr(indexOfStar + 1)
+            };
     }
     ts.tryParsePattern = tryParsePattern;
+    function tryParsePatterns(paths) {
+        return ts.mapDefined(ts.getOwnKeys(paths), function (path) { return tryParsePattern(path); });
+    }
+    ts.tryParsePatterns = tryParsePatterns;
     function positionIsSynthesized(pos) {
         // This is a fast way of testing the following conditions:
         //  pos === undefined || pos === null || isNaN(pos) || pos < 0;
@@ -19524,7 +20276,7 @@ var ts;
     ts.positionIsSynthesized = positionIsSynthesized;
     /** True if an extension is one of the supported TypeScript extensions. */
     function extensionIsTS(ext) {
-        return ext === ".ts" /* Ts */ || ext === ".tsx" /* Tsx */ || ext === ".d.ts" /* Dts */;
+        return ext === ".ts" /* Ts */ || ext === ".tsx" /* Tsx */ || ext === ".d.ts" /* Dts */ || ext === ".cts" /* Cts */ || ext === ".mts" /* Mts */ || ext === ".d.mts" /* Dmts */ || ext === ".d.cts" /* Dcts */;
     }
     ts.extensionIsTS = extensionIsTS;
     function resolutionExtensionIsTSOrJson(ext) {
@@ -19537,7 +20289,7 @@ var ts;
      */
     function extensionFromPath(path) {
         var ext = tryGetExtensionFromPath(path);
-        return ext !== undefined ? ext : ts.Debug.fail("File " + path + " has unknown extension.");
+        return ext !== undefined ? ext : ts.Debug.fail("File ".concat(path, " has unknown extension."));
     }
     ts.extensionFromPath = extensionFromPath;
     function isAnySupportedFileExtension(path) {
@@ -19557,23 +20309,19 @@ var ts;
         directories: ts.emptyArray
     };
     /**
-     * patternStrings contains both pattern strings (containing "*") and regular strings.
+     * patternOrStrings contains both patterns (containing "*") and regular strings.
      * Return an exact match if possible, or a pattern match, or undefined.
      * (These are verified by verifyCompilerOptions to have 0 or 1 "*" characters.)
      */
-    function matchPatternOrExact(patternStrings, candidate) {
+    function matchPatternOrExact(patternOrStrings, candidate) {
         var patterns = [];
-        for (var _i = 0, patternStrings_1 = patternStrings; _i < patternStrings_1.length; _i++) {
-            var patternString = patternStrings_1[_i];
-            if (!hasZeroOrOneAsteriskCharacter(patternString))
-                continue;
-            var pattern = tryParsePattern(patternString);
-            if (pattern) {
-                patterns.push(pattern);
+        for (var _i = 0, patternOrStrings_1 = patternOrStrings; _i < patternOrStrings_1.length; _i++) {
+            var patternOrString = patternOrStrings_1[_i];
+            if (patternOrString === candidate) {
+                return candidate;
             }
-            else if (patternString === candidate) {
-                // pattern was matched as is - no need to search further
-                return patternString;
+            if (!ts.isString(patternOrString)) {
+                patterns.push(patternOrString);
             }
         }
         return ts.findBestPatternMatch(patterns, function (_) { return _; }, candidate);
@@ -19724,42 +20472,41 @@ var ts;
             || isPartOfTypeQuery(useSite)
             || isIdentifierInNonEmittingHeritageClause(useSite)
             || isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(useSite)
-            || !isExpressionNode(useSite);
+            || !(isExpressionNode(useSite) || isShorthandPropertyNameUseSite(useSite));
     }
     ts.isValidTypeOnlyAliasUseSite = isValidTypeOnlyAliasUseSite;
-    function typeOnlyDeclarationIsExport(typeOnlyDeclaration) {
-        return typeOnlyDeclaration.kind === 270 /* ExportSpecifier */;
+    function isShorthandPropertyNameUseSite(useSite) {
+        return ts.isIdentifier(useSite) && ts.isShorthandPropertyAssignment(useSite.parent) && useSite.parent.name === useSite;
     }
-    ts.typeOnlyDeclarationIsExport = typeOnlyDeclarationIsExport;
     function isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(node) {
-        while (node.kind === 78 /* Identifier */ || node.kind === 201 /* PropertyAccessExpression */) {
+        while (node.kind === 79 /* Identifier */ || node.kind === 205 /* PropertyAccessExpression */) {
             node = node.parent;
         }
-        if (node.kind !== 158 /* ComputedPropertyName */) {
+        if (node.kind !== 161 /* ComputedPropertyName */) {
             return false;
         }
         if (hasSyntacticModifier(node.parent, 128 /* Abstract */)) {
             return true;
         }
         var containerKind = node.parent.parent.kind;
-        return containerKind === 253 /* InterfaceDeclaration */ || containerKind === 177 /* TypeLiteral */;
+        return containerKind === 257 /* InterfaceDeclaration */ || containerKind === 181 /* TypeLiteral */;
     }
     /** Returns true for an identifier in 1) an `implements` clause, and 2) an `extends` clause of an interface. */
     function isIdentifierInNonEmittingHeritageClause(node) {
-        if (node.kind !== 78 /* Identifier */)
+        if (node.kind !== 79 /* Identifier */)
             return false;
         var heritageClause = ts.findAncestor(node.parent, function (parent) {
             switch (parent.kind) {
-                case 286 /* HeritageClause */:
+                case 290 /* HeritageClause */:
                     return true;
-                case 201 /* PropertyAccessExpression */:
-                case 223 /* ExpressionWithTypeArguments */:
+                case 205 /* PropertyAccessExpression */:
+                case 227 /* ExpressionWithTypeArguments */:
                     return false;
                 default:
                     return "quit";
             }
         });
-        return (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.token) === 116 /* ImplementsKeyword */ || (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.parent.kind) === 253 /* InterfaceDeclaration */;
+        return (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.token) === 117 /* ImplementsKeyword */ || (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.parent.kind) === 257 /* InterfaceDeclaration */;
     }
     function isIdentifierTypeReference(node) {
         return ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName);
@@ -19916,6 +20663,113 @@ var ts;
         return ts.some(ts.ignoredPaths, function (p) { return ts.stringContains(path, p); });
     }
     ts.containsIgnoredPath = containsIgnoredPath;
+    function getContainingNodeArray(node) {
+        if (!node.parent)
+            return undefined;
+        switch (node.kind) {
+            case 162 /* TypeParameter */:
+                var parent_1 = node.parent;
+                return parent_1.kind === 189 /* InferType */ ? undefined : parent_1.typeParameters;
+            case 163 /* Parameter */:
+                return node.parent.parameters;
+            case 198 /* TemplateLiteralTypeSpan */:
+                return node.parent.templateSpans;
+            case 232 /* TemplateSpan */:
+                return node.parent.templateSpans;
+            case 164 /* Decorator */:
+                return node.parent.decorators;
+            case 290 /* HeritageClause */:
+                return node.parent.heritageClauses;
+        }
+        var parent = node.parent;
+        if (ts.isJSDocTag(node)) {
+            return ts.isJSDocTypeLiteral(node.parent) ? undefined : node.parent.tags;
+        }
+        switch (parent.kind) {
+            case 181 /* TypeLiteral */:
+            case 257 /* InterfaceDeclaration */:
+                return ts.isTypeElement(node) ? parent.members : undefined;
+            case 186 /* UnionType */:
+            case 187 /* IntersectionType */:
+                return parent.types;
+            case 183 /* TupleType */:
+            case 203 /* ArrayLiteralExpression */:
+            case 349 /* CommaListExpression */:
+            case 268 /* NamedImports */:
+            case 272 /* NamedExports */:
+                return parent.elements;
+            case 204 /* ObjectLiteralExpression */:
+            case 285 /* JsxAttributes */:
+                return parent.properties;
+            case 207 /* CallExpression */:
+            case 208 /* NewExpression */:
+                return ts.isTypeNode(node) ? parent.typeArguments :
+                    parent.expression === node ? undefined :
+                        parent.arguments;
+            case 277 /* JsxElement */:
+            case 281 /* JsxFragment */:
+                return ts.isJsxChild(node) ? parent.children : undefined;
+            case 279 /* JsxOpeningElement */:
+            case 278 /* JsxSelfClosingElement */:
+                return ts.isTypeNode(node) ? parent.typeArguments : undefined;
+            case 234 /* Block */:
+            case 288 /* CaseClause */:
+            case 289 /* DefaultClause */:
+            case 261 /* ModuleBlock */:
+                return parent.statements;
+            case 262 /* CaseBlock */:
+                return parent.clauses;
+            case 256 /* ClassDeclaration */:
+            case 225 /* ClassExpression */:
+                return ts.isClassElement(node) ? parent.members : undefined;
+            case 259 /* EnumDeclaration */:
+                return ts.isEnumMember(node) ? parent.members : undefined;
+            case 303 /* SourceFile */:
+                return parent.statements;
+        }
+    }
+    ts.getContainingNodeArray = getContainingNodeArray;
+    function hasContextSensitiveParameters(node) {
+        // Functions with type parameters are not context sensitive.
+        if (!node.typeParameters) {
+            // Functions with any parameters that lack type annotations are context sensitive.
+            if (ts.some(node.parameters, function (p) { return !getEffectiveTypeAnnotationNode(p); })) {
+                return true;
+            }
+            if (node.kind !== 213 /* ArrowFunction */) {
+                // If the first parameter is not an explicit 'this' parameter, then the function has
+                // an implicit 'this' parameter which is subject to contextual typing.
+                var parameter = ts.firstOrUndefined(node.parameters);
+                if (!(parameter && parameterIsThisKeyword(parameter))) {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+    ts.hasContextSensitiveParameters = hasContextSensitiveParameters;
+    /* @internal */
+    function isInfinityOrNaNString(name) {
+        return name === "Infinity" || name === "-Infinity" || name === "NaN";
+    }
+    ts.isInfinityOrNaNString = isInfinityOrNaNString;
+    function isCatchClauseVariableDeclaration(node) {
+        return node.kind === 253 /* VariableDeclaration */ && node.parent.kind === 291 /* CatchClause */;
+    }
+    ts.isCatchClauseVariableDeclaration = isCatchClauseVariableDeclaration;
+    function isParameterOrCatchClauseVariable(symbol) {
+        var declaration = symbol.valueDeclaration && getRootDeclaration(symbol.valueDeclaration);
+        return !!declaration && (ts.isParameter(declaration) || isCatchClauseVariableDeclaration(declaration));
+    }
+    ts.isParameterOrCatchClauseVariable = isParameterOrCatchClauseVariable;
+    function isFunctionExpressionOrArrowFunction(node) {
+        return node.kind === 212 /* FunctionExpression */ || node.kind === 213 /* ArrowFunction */;
+    }
+    ts.isFunctionExpressionOrArrowFunction = isFunctionExpressionOrArrowFunction;
+    function escapeSnippetText(text) {
+        return text.replace(/\$/gm, "\\$");
+    }
+    ts.escapeSnippetText = escapeSnippetText;
 })(ts || (ts = {}));
 /* @internal */
 var ts;
@@ -19960,7 +20814,11 @@ var ts;
 var ts;
 (function (ts) {
     function createParenthesizerRules(factory) {
+        var binaryLeftOperandParenthesizerCache;
+        var binaryRightOperandParenthesizerCache;
         return {
+            getParenthesizeLeftSideOfBinaryForOperator: getParenthesizeLeftSideOfBinaryForOperator,
+            getParenthesizeRightSideOfBinaryForOperator: getParenthesizeRightSideOfBinaryForOperator,
             parenthesizeLeftSideOfBinary: parenthesizeLeftSideOfBinary,
             parenthesizeRightSideOfBinary: parenthesizeRightSideOfBinary,
             parenthesizeExpressionOfComputedPropertyName: parenthesizeExpressionOfComputedPropertyName,
@@ -19981,6 +20839,24 @@ var ts;
             parenthesizeConstituentTypesOfUnionOrIntersectionType: parenthesizeConstituentTypesOfUnionOrIntersectionType,
             parenthesizeTypeArguments: parenthesizeTypeArguments,
         };
+        function getParenthesizeLeftSideOfBinaryForOperator(operatorKind) {
+            binaryLeftOperandParenthesizerCache || (binaryLeftOperandParenthesizerCache = new ts.Map());
+            var parenthesizerRule = binaryLeftOperandParenthesizerCache.get(operatorKind);
+            if (!parenthesizerRule) {
+                parenthesizerRule = function (node) { return parenthesizeLeftSideOfBinary(operatorKind, node); };
+                binaryLeftOperandParenthesizerCache.set(operatorKind, parenthesizerRule);
+            }
+            return parenthesizerRule;
+        }
+        function getParenthesizeRightSideOfBinaryForOperator(operatorKind) {
+            binaryRightOperandParenthesizerCache || (binaryRightOperandParenthesizerCache = new ts.Map());
+            var parenthesizerRule = binaryRightOperandParenthesizerCache.get(operatorKind);
+            if (!parenthesizerRule) {
+                parenthesizerRule = function (node) { return parenthesizeRightSideOfBinary(operatorKind, /*leftSide*/ undefined, node); };
+                binaryRightOperandParenthesizerCache.set(operatorKind, parenthesizerRule);
+            }
+            return parenthesizerRule;
+        }
         /**
          * Determines whether the operand to a BinaryExpression needs to be parenthesized.
          *
@@ -20007,10 +20883,10 @@ var ts;
             //
             // If `a ** d` is on the left of operator `**`, we need to parenthesize to preserve
             // the intended order of operations: `(a ** b) ** c`
-            var binaryOperatorPrecedence = ts.getOperatorPrecedence(216 /* BinaryExpression */, binaryOperator);
-            var binaryOperatorAssociativity = ts.getOperatorAssociativity(216 /* BinaryExpression */, binaryOperator);
+            var binaryOperatorPrecedence = ts.getOperatorPrecedence(220 /* BinaryExpression */, binaryOperator);
+            var binaryOperatorAssociativity = ts.getOperatorAssociativity(220 /* BinaryExpression */, binaryOperator);
             var emittedOperand = ts.skipPartiallyEmittedExpressions(operand);
-            if (!isLeftSideOfBinary && operand.kind === 209 /* ArrowFunction */ && binaryOperatorPrecedence > 3 /* Assignment */) {
+            if (!isLeftSideOfBinary && operand.kind === 213 /* ArrowFunction */ && binaryOperatorPrecedence > 3 /* Assignment */) {
                 // We need to parenthesize arrow functions on the right side to avoid it being
                 // parsed as parenthesized expression: `a && (() => {})`
                 return true;
@@ -20022,7 +20898,7 @@ var ts;
                     // and is a yield expression, then we do not need parentheses.
                     if (!isLeftSideOfBinary
                         && binaryOperatorAssociativity === 1 /* Right */
-                        && operand.kind === 219 /* YieldExpression */) {
+                        && operand.kind === 223 /* YieldExpression */) {
                         return false;
                     }
                     return true;
@@ -20110,7 +20986,7 @@ var ts;
             if (ts.isLiteralKind(node.kind)) {
                 return node.kind;
             }
-            if (node.kind === 216 /* BinaryExpression */ && node.operatorToken.kind === 39 /* PlusToken */) {
+            if (node.kind === 220 /* BinaryExpression */ && node.operatorToken.kind === 39 /* PlusToken */) {
                 if (node.cachedLiteralKind !== undefined) {
                     return node.cachedLiteralKind;
                 }
@@ -20136,7 +21012,7 @@ var ts;
         function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) {
             var skipped = ts.skipPartiallyEmittedExpressions(operand);
             // If the resulting expression is already parenthesized, we do not need to do any further processing.
-            if (skipped.kind === 207 /* ParenthesizedExpression */) {
+            if (skipped.kind === 211 /* ParenthesizedExpression */) {
                 return operand;
             }
             return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand)
@@ -20153,7 +21029,7 @@ var ts;
             return ts.isCommaSequence(expression) ? factory.createParenthesizedExpression(expression) : expression;
         }
         function parenthesizeConditionOfConditionalExpression(condition) {
-            var conditionalPrecedence = ts.getOperatorPrecedence(217 /* ConditionalExpression */, 57 /* QuestionToken */);
+            var conditionalPrecedence = ts.getOperatorPrecedence(221 /* ConditionalExpression */, 57 /* QuestionToken */);
             var emittedCondition = ts.skipPartiallyEmittedExpressions(condition);
             var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition);
             if (ts.compareValues(conditionPrecedence, conditionalPrecedence) !== 1 /* GreaterThan */) {
@@ -20186,8 +21062,8 @@ var ts;
             var needsParens = ts.isCommaSequence(check);
             if (!needsParens) {
                 switch (ts.getLeftmostExpression(check, /*stopAtCallExpression*/ false).kind) {
-                    case 221 /* ClassExpression */:
-                    case 208 /* FunctionExpression */:
+                    case 225 /* ClassExpression */:
+                    case 212 /* FunctionExpression */:
                         needsParens = true;
                 }
             }
@@ -20200,9 +21076,9 @@ var ts;
         function parenthesizeExpressionOfNew(expression) {
             var leftmostExpr = ts.getLeftmostExpression(expression, /*stopAtCallExpressions*/ true);
             switch (leftmostExpr.kind) {
-                case 203 /* CallExpression */:
+                case 207 /* CallExpression */:
                     return factory.createParenthesizedExpression(expression);
-                case 204 /* NewExpression */:
+                case 208 /* NewExpression */:
                     return !leftmostExpr.arguments
                         ? factory.createParenthesizedExpression(expression)
                         : expression; // TODO(rbuckton): Verify this assertion holds
@@ -20222,7 +21098,7 @@ var ts;
             //
             var emittedExpression = ts.skipPartiallyEmittedExpressions(expression);
             if (ts.isLeftHandSideExpression(emittedExpression)
-                && (emittedExpression.kind !== 204 /* NewExpression */ || emittedExpression.arguments)) {
+                && (emittedExpression.kind !== 208 /* NewExpression */ || emittedExpression.arguments)) {
                 // TODO(rbuckton): Verify whether this assertion holds.
                 return expression;
             }
@@ -20244,7 +21120,7 @@ var ts;
         function parenthesizeExpressionForDisallowedComma(expression) {
             var emittedExpression = ts.skipPartiallyEmittedExpressions(expression);
             var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression);
-            var commaPrecedence = ts.getOperatorPrecedence(216 /* BinaryExpression */, 27 /* CommaToken */);
+            var commaPrecedence = ts.getOperatorPrecedence(220 /* BinaryExpression */, 27 /* CommaToken */);
             // TODO(rbuckton): Verifiy whether `setTextRange` is needed.
             return expressionPrecedence > commaPrecedence ? expression : ts.setTextRange(factory.createParenthesizedExpression(expression), expression);
         }
@@ -20253,44 +21129,44 @@ var ts;
             if (ts.isCallExpression(emittedExpression)) {
                 var callee = emittedExpression.expression;
                 var kind = ts.skipPartiallyEmittedExpressions(callee).kind;
-                if (kind === 208 /* FunctionExpression */ || kind === 209 /* ArrowFunction */) {
+                if (kind === 212 /* FunctionExpression */ || kind === 213 /* ArrowFunction */) {
                     // TODO(rbuckton): Verifiy whether `setTextRange` is needed.
                     var updated = factory.updateCallExpression(emittedExpression, ts.setTextRange(factory.createParenthesizedExpression(callee), callee), emittedExpression.typeArguments, emittedExpression.arguments);
                     return factory.restoreOuterExpressions(expression, updated, 8 /* PartiallyEmittedExpressions */);
                 }
             }
             var leftmostExpressionKind = ts.getLeftmostExpression(emittedExpression, /*stopAtCallExpressions*/ false).kind;
-            if (leftmostExpressionKind === 200 /* ObjectLiteralExpression */ || leftmostExpressionKind === 208 /* FunctionExpression */) {
+            if (leftmostExpressionKind === 204 /* ObjectLiteralExpression */ || leftmostExpressionKind === 212 /* FunctionExpression */) {
                 // TODO(rbuckton): Verifiy whether `setTextRange` is needed.
                 return ts.setTextRange(factory.createParenthesizedExpression(expression), expression);
             }
             return expression;
         }
         function parenthesizeConciseBodyOfArrowFunction(body) {
-            if (!ts.isBlock(body) && (ts.isCommaSequence(body) || ts.getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 200 /* ObjectLiteralExpression */)) {
+            if (!ts.isBlock(body) && (ts.isCommaSequence(body) || ts.getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 204 /* ObjectLiteralExpression */)) {
                 // TODO(rbuckton): Verifiy whether `setTextRange` is needed.
                 return ts.setTextRange(factory.createParenthesizedExpression(body), body);
             }
             return body;
         }
         function parenthesizeMemberOfConditionalType(member) {
-            return member.kind === 184 /* ConditionalType */ ? factory.createParenthesizedType(member) : member;
+            return member.kind === 188 /* ConditionalType */ ? factory.createParenthesizedType(member) : member;
         }
         function parenthesizeMemberOfElementType(member) {
             switch (member.kind) {
-                case 182 /* UnionType */:
-                case 183 /* IntersectionType */:
-                case 174 /* FunctionType */:
-                case 175 /* ConstructorType */:
+                case 186 /* UnionType */:
+                case 187 /* IntersectionType */:
+                case 178 /* FunctionType */:
+                case 179 /* ConstructorType */:
                     return factory.createParenthesizedType(member);
             }
             return parenthesizeMemberOfConditionalType(member);
         }
         function parenthesizeElementTypeOfArrayType(member) {
             switch (member.kind) {
-                case 176 /* TypeQuery */:
-                case 188 /* TypeOperator */:
-                case 185 /* InferType */:
+                case 180 /* TypeQuery */:
+                case 192 /* TypeOperator */:
+                case 189 /* InferType */:
                     return factory.createParenthesizedType(member);
             }
             return parenthesizeMemberOfElementType(member);
@@ -20309,6 +21185,8 @@ var ts;
     }
     ts.createParenthesizerRules = createParenthesizerRules;
     ts.nullParenthesizerRules = {
+        getParenthesizeLeftSideOfBinaryForOperator: function (_) { return ts.identity; },
+        getParenthesizeRightSideOfBinaryForOperator: function (_) { return ts.identity; },
         parenthesizeLeftSideOfBinary: function (_binaryOperator, leftSide) { return leftSide; },
         parenthesizeRightSideOfBinary: function (_binaryOperator, _leftSide, rightSide) { return rightSide; },
         parenthesizeExpressionOfComputedPropertyName: ts.identity,
@@ -20394,11 +21272,11 @@ var ts;
         }
         function convertToAssignmentPattern(node) {
             switch (node.kind) {
-                case 197 /* ArrayBindingPattern */:
-                case 199 /* ArrayLiteralExpression */:
+                case 201 /* ArrayBindingPattern */:
+                case 203 /* ArrayLiteralExpression */:
                     return convertToArrayAssignmentPattern(node);
-                case 196 /* ObjectBindingPattern */:
-                case 200 /* ObjectLiteralExpression */:
+                case 200 /* ObjectBindingPattern */:
+                case 204 /* ObjectLiteralExpression */:
                     return convertToObjectAssignmentPattern(node);
             }
         }
@@ -20526,6 +21404,8 @@ var ts;
             updateConstructSignature: updateConstructSignature,
             createIndexSignature: createIndexSignature,
             updateIndexSignature: updateIndexSignature,
+            createClassStaticBlockDeclaration: createClassStaticBlockDeclaration,
+            updateClassStaticBlockDeclaration: updateClassStaticBlockDeclaration,
             createTemplateLiteralTypeSpan: createTemplateLiteralTypeSpan,
             updateTemplateLiteralTypeSpan: updateTemplateLiteralTypeSpan,
             createKeywordTypeNode: createKeywordTypeNode,
@@ -20719,6 +21599,10 @@ var ts;
             updateImportDeclaration: updateImportDeclaration,
             createImportClause: createImportClause,
             updateImportClause: updateImportClause,
+            createAssertClause: createAssertClause,
+            updateAssertClause: updateAssertClause,
+            createAssertEntry: createAssertEntry,
+            updateAssertEntry: updateAssertEntry,
             createNamespaceImport: createNamespaceImport,
             updateNamespaceImport: updateNamespaceImport,
             createNamespaceExport: createNamespaceExport,
@@ -20739,18 +21623,18 @@ var ts;
             createExternalModuleReference: createExternalModuleReference,
             updateExternalModuleReference: updateExternalModuleReference,
             // lazily load factory members for JSDoc types with similar structure
-            get createJSDocAllType() { return getJSDocPrimaryTypeCreateFunction(303 /* JSDocAllType */); },
-            get createJSDocUnknownType() { return getJSDocPrimaryTypeCreateFunction(304 /* JSDocUnknownType */); },
-            get createJSDocNonNullableType() { return getJSDocUnaryTypeCreateFunction(306 /* JSDocNonNullableType */); },
-            get updateJSDocNonNullableType() { return getJSDocUnaryTypeUpdateFunction(306 /* JSDocNonNullableType */); },
-            get createJSDocNullableType() { return getJSDocUnaryTypeCreateFunction(305 /* JSDocNullableType */); },
-            get updateJSDocNullableType() { return getJSDocUnaryTypeUpdateFunction(305 /* JSDocNullableType */); },
-            get createJSDocOptionalType() { return getJSDocUnaryTypeCreateFunction(307 /* JSDocOptionalType */); },
-            get updateJSDocOptionalType() { return getJSDocUnaryTypeUpdateFunction(307 /* JSDocOptionalType */); },
-            get createJSDocVariadicType() { return getJSDocUnaryTypeCreateFunction(309 /* JSDocVariadicType */); },
-            get updateJSDocVariadicType() { return getJSDocUnaryTypeUpdateFunction(309 /* JSDocVariadicType */); },
-            get createJSDocNamepathType() { return getJSDocUnaryTypeCreateFunction(310 /* JSDocNamepathType */); },
-            get updateJSDocNamepathType() { return getJSDocUnaryTypeUpdateFunction(310 /* JSDocNamepathType */); },
+            get createJSDocAllType() { return getJSDocPrimaryTypeCreateFunction(310 /* JSDocAllType */); },
+            get createJSDocUnknownType() { return getJSDocPrimaryTypeCreateFunction(311 /* JSDocUnknownType */); },
+            get createJSDocNonNullableType() { return getJSDocUnaryTypeCreateFunction(313 /* JSDocNonNullableType */); },
+            get updateJSDocNonNullableType() { return getJSDocUnaryTypeUpdateFunction(313 /* JSDocNonNullableType */); },
+            get createJSDocNullableType() { return getJSDocUnaryTypeCreateFunction(312 /* JSDocNullableType */); },
+            get updateJSDocNullableType() { return getJSDocUnaryTypeUpdateFunction(312 /* JSDocNullableType */); },
+            get createJSDocOptionalType() { return getJSDocUnaryTypeCreateFunction(314 /* JSDocOptionalType */); },
+            get updateJSDocOptionalType() { return getJSDocUnaryTypeUpdateFunction(314 /* JSDocOptionalType */); },
+            get createJSDocVariadicType() { return getJSDocUnaryTypeCreateFunction(316 /* JSDocVariadicType */); },
+            get updateJSDocVariadicType() { return getJSDocUnaryTypeUpdateFunction(316 /* JSDocVariadicType */); },
+            get createJSDocNamepathType() { return getJSDocUnaryTypeCreateFunction(317 /* JSDocNamepathType */); },
+            get updateJSDocNamepathType() { return getJSDocUnaryTypeUpdateFunction(317 /* JSDocNamepathType */); },
             createJSDocFunctionType: createJSDocFunctionType,
             updateJSDocFunctionType: updateJSDocFunctionType,
             createJSDocTypeLiteral: createJSDocTypeLiteral,
@@ -20777,31 +21661,43 @@ var ts;
             updateJSDocSeeTag: updateJSDocSeeTag,
             createJSDocNameReference: createJSDocNameReference,
             updateJSDocNameReference: updateJSDocNameReference,
+            createJSDocMemberName: createJSDocMemberName,
+            updateJSDocMemberName: updateJSDocMemberName,
+            createJSDocLink: createJSDocLink,
+            updateJSDocLink: updateJSDocLink,
+            createJSDocLinkCode: createJSDocLinkCode,
+            updateJSDocLinkCode: updateJSDocLinkCode,
+            createJSDocLinkPlain: createJSDocLinkPlain,
+            updateJSDocLinkPlain: updateJSDocLinkPlain,
             // lazily load factory members for JSDoc tags with similar structure
-            get createJSDocTypeTag() { return getJSDocTypeLikeTagCreateFunction(329 /* JSDocTypeTag */); },
-            get updateJSDocTypeTag() { return getJSDocTypeLikeTagUpdateFunction(329 /* JSDocTypeTag */); },
-            get createJSDocReturnTag() { return getJSDocTypeLikeTagCreateFunction(327 /* JSDocReturnTag */); },
-            get updateJSDocReturnTag() { return getJSDocTypeLikeTagUpdateFunction(327 /* JSDocReturnTag */); },
-            get createJSDocThisTag() { return getJSDocTypeLikeTagCreateFunction(328 /* JSDocThisTag */); },
-            get updateJSDocThisTag() { return getJSDocTypeLikeTagUpdateFunction(328 /* JSDocThisTag */); },
-            get createJSDocEnumTag() { return getJSDocTypeLikeTagCreateFunction(325 /* JSDocEnumTag */); },
-            get updateJSDocEnumTag() { return getJSDocTypeLikeTagUpdateFunction(325 /* JSDocEnumTag */); },
-            get createJSDocAuthorTag() { return getJSDocSimpleTagCreateFunction(317 /* JSDocAuthorTag */); },
-            get updateJSDocAuthorTag() { return getJSDocSimpleTagUpdateFunction(317 /* JSDocAuthorTag */); },
-            get createJSDocClassTag() { return getJSDocSimpleTagCreateFunction(319 /* JSDocClassTag */); },
-            get updateJSDocClassTag() { return getJSDocSimpleTagUpdateFunction(319 /* JSDocClassTag */); },
-            get createJSDocPublicTag() { return getJSDocSimpleTagCreateFunction(320 /* JSDocPublicTag */); },
-            get updateJSDocPublicTag() { return getJSDocSimpleTagUpdateFunction(320 /* JSDocPublicTag */); },
-            get createJSDocPrivateTag() { return getJSDocSimpleTagCreateFunction(321 /* JSDocPrivateTag */); },
-            get updateJSDocPrivateTag() { return getJSDocSimpleTagUpdateFunction(321 /* JSDocPrivateTag */); },
-            get createJSDocProtectedTag() { return getJSDocSimpleTagCreateFunction(322 /* JSDocProtectedTag */); },
-            get updateJSDocProtectedTag() { return getJSDocSimpleTagUpdateFunction(322 /* JSDocProtectedTag */); },
-            get createJSDocReadonlyTag() { return getJSDocSimpleTagCreateFunction(323 /* JSDocReadonlyTag */); },
-            get updateJSDocReadonlyTag() { return getJSDocSimpleTagUpdateFunction(323 /* JSDocReadonlyTag */); },
-            get createJSDocDeprecatedTag() { return getJSDocSimpleTagCreateFunction(318 /* JSDocDeprecatedTag */); },
-            get updateJSDocDeprecatedTag() { return getJSDocSimpleTagUpdateFunction(318 /* JSDocDeprecatedTag */); },
+            get createJSDocTypeTag() { return getJSDocTypeLikeTagCreateFunction(341 /* JSDocTypeTag */); },
+            get updateJSDocTypeTag() { return getJSDocTypeLikeTagUpdateFunction(341 /* JSDocTypeTag */); },
+            get createJSDocReturnTag() { return getJSDocTypeLikeTagCreateFunction(339 /* JSDocReturnTag */); },
+            get updateJSDocReturnTag() { return getJSDocTypeLikeTagUpdateFunction(339 /* JSDocReturnTag */); },
+            get createJSDocThisTag() { return getJSDocTypeLikeTagCreateFunction(340 /* JSDocThisTag */); },
+            get updateJSDocThisTag() { return getJSDocTypeLikeTagUpdateFunction(340 /* JSDocThisTag */); },
+            get createJSDocEnumTag() { return getJSDocTypeLikeTagCreateFunction(337 /* JSDocEnumTag */); },
+            get updateJSDocEnumTag() { return getJSDocTypeLikeTagUpdateFunction(337 /* JSDocEnumTag */); },
+            get createJSDocAuthorTag() { return getJSDocSimpleTagCreateFunction(328 /* JSDocAuthorTag */); },
+            get updateJSDocAuthorTag() { return getJSDocSimpleTagUpdateFunction(328 /* JSDocAuthorTag */); },
+            get createJSDocClassTag() { return getJSDocSimpleTagCreateFunction(330 /* JSDocClassTag */); },
+            get updateJSDocClassTag() { return getJSDocSimpleTagUpdateFunction(330 /* JSDocClassTag */); },
+            get createJSDocPublicTag() { return getJSDocSimpleTagCreateFunction(331 /* JSDocPublicTag */); },
+            get updateJSDocPublicTag() { return getJSDocSimpleTagUpdateFunction(331 /* JSDocPublicTag */); },
+            get createJSDocPrivateTag() { return getJSDocSimpleTagCreateFunction(332 /* JSDocPrivateTag */); },
+            get updateJSDocPrivateTag() { return getJSDocSimpleTagUpdateFunction(332 /* JSDocPrivateTag */); },
+            get createJSDocProtectedTag() { return getJSDocSimpleTagCreateFunction(333 /* JSDocProtectedTag */); },
+            get updateJSDocProtectedTag() { return getJSDocSimpleTagUpdateFunction(333 /* JSDocProtectedTag */); },
+            get createJSDocReadonlyTag() { return getJSDocSimpleTagCreateFunction(334 /* JSDocReadonlyTag */); },
+            get updateJSDocReadonlyTag() { return getJSDocSimpleTagUpdateFunction(334 /* JSDocReadonlyTag */); },
+            get createJSDocOverrideTag() { return getJSDocSimpleTagCreateFunction(335 /* JSDocOverrideTag */); },
+            get updateJSDocOverrideTag() { return getJSDocSimpleTagUpdateFunction(335 /* JSDocOverrideTag */); },
+            get createJSDocDeprecatedTag() { return getJSDocSimpleTagCreateFunction(329 /* JSDocDeprecatedTag */); },
+            get updateJSDocDeprecatedTag() { return getJSDocSimpleTagUpdateFunction(329 /* JSDocDeprecatedTag */); },
             createJSDocUnknownTag: createJSDocUnknownTag,
             updateJSDocUnknownTag: updateJSDocUnknownTag,
+            createJSDocText: createJSDocText,
+            updateJSDocText: updateJSDocText,
             createJSDocComment: createJSDocComment,
             updateJSDocComment: updateJSDocComment,
             createJsxElement: createJsxElement,
@@ -20866,7 +21762,7 @@ var ts;
             cloneNode: cloneNode,
             // Lazily load factory methods for common operator factories and utilities
             get createComma() { return getBinaryCreateFunction(27 /* CommaToken */); },
-            get createAssignment() { return getBinaryCreateFunction(62 /* EqualsToken */); },
+            get createAssignment() { return getBinaryCreateFunction(63 /* EqualsToken */); },
             get createLogicalOr() { return getBinaryCreateFunction(56 /* BarBarToken */); },
             get createLogicalAnd() { return getBinaryCreateFunction(55 /* AmpersandAmpersandToken */); },
             get createBitwiseOr() { return getBinaryCreateFunction(51 /* BarToken */); },
@@ -20912,8 +21808,11 @@ var ts;
             createArraySliceCall: createArraySliceCall,
             createArrayConcatCall: createArrayConcatCall,
             createObjectDefinePropertyCall: createObjectDefinePropertyCall,
+            createReflectGetCall: createReflectGetCall,
+            createReflectSetCall: createReflectSetCall,
             createPropertyDescriptor: createPropertyDescriptor,
             createCallBinding: createCallBinding,
+            createAssignmentTargetWrapper: createAssignmentTargetWrapper,
             // Utilities
             inlineExpressions: inlineExpressions,
             getInternalName: getInternalName,
@@ -20940,12 +21839,24 @@ var ts;
                 elements = [];
             }
             else if (ts.isNodeArray(elements)) {
-                // Ensure the transform flags have been aggregated for this NodeArray
-                if (elements.transformFlags === undefined) {
-                    aggregateChildrenFlags(elements);
-                }
-                ts.Debug.attachNodeArrayDebugInfo(elements);
-                return elements;
+                if (hasTrailingComma === undefined || elements.hasTrailingComma === hasTrailingComma) {
+                    // Ensure the transform flags have been aggregated for this NodeArray
+                    if (elements.transformFlags === undefined) {
+                        aggregateChildrenFlags(elements);
+                    }
+                    ts.Debug.attachNodeArrayDebugInfo(elements);
+                    return elements;
+                }
+                // This *was* a `NodeArray`, but the `hasTrailingComma` option differs. Recreate the
+                // array with the same elements, text range, and transform flags but with the updated
+                // value for `hasTrailingComma`
+                var array_8 = elements.slice();
+                array_8.pos = elements.pos;
+                array_8.end = elements.end;
+                array_8.hasTrailingComma = hasTrailingComma;
+                array_8.transformFlags = elements.transformFlags;
+                ts.Debug.attachNodeArrayDebugInfo(array_8);
+                return array_8;
             }
             // Since the element list of a node array is typically created by starting with an empty array and
             // repeatedly calling push(), the list may not have the optimal memory layout. We invoke slice() for
@@ -20985,11 +21896,11 @@ var ts;
             // don't propagate child flags.
             if (name) {
                 switch (node.kind) {
-                    case 165 /* MethodDeclaration */:
-                    case 167 /* GetAccessor */:
-                    case 168 /* SetAccessor */:
-                    case 163 /* PropertyDeclaration */:
-                    case 288 /* PropertyAssignment */:
+                    case 168 /* MethodDeclaration */:
+                    case 171 /* GetAccessor */:
+                    case 172 /* SetAccessor */:
+                    case 166 /* PropertyDeclaration */:
+                    case 294 /* PropertyAssignment */:
                         if (ts.isIdentifier(name)) {
                             node.transformFlags |= propagateIdentifierNameFlags(name);
                             break;
@@ -21030,7 +21941,7 @@ var ts;
         function createBaseFunctionLikeDeclaration(kind, decorators, modifiers, name, typeParameters, parameters, type, body) {
             var node = createBaseSignatureDeclaration(kind, decorators, modifiers, name, typeParameters, parameters, type);
             node.body = body;
-            node.transformFlags |= propagateChildFlags(node.body) & ~8388608 /* ContainsPossibleTopLevelAwait */;
+            node.transformFlags |= propagateChildFlags(node.body) & ~16777216 /* ContainsPossibleTopLevelAwait */;
             if (!body)
                 node.transformFlags |= 1 /* ContainsTypeScript */;
             return node;
@@ -21083,7 +21994,7 @@ var ts;
             var node = createBaseLiteral(8 /* NumericLiteral */, typeof value === "number" ? value + "" : value);
             node.numericLiteralFlags = numericLiteralFlags;
             if (numericLiteralFlags & 384 /* BinaryOrOctalSpecifier */)
-                node.transformFlags |= 256 /* ContainsES2015 */;
+                node.transformFlags |= 512 /* ContainsES2015 */;
             return node;
         }
         // @api
@@ -21102,7 +22013,7 @@ var ts;
             var node = createBaseStringLiteral(text, isSingleQuote);
             node.hasExtendedUnicodeEscape = hasExtendedUnicodeEscape;
             if (hasExtendedUnicodeEscape)
-                node.transformFlags |= 256 /* ContainsES2015 */;
+                node.transformFlags |= 512 /* ContainsES2015 */;
             return node;
         }
         // @api
@@ -21135,10 +22046,10 @@ var ts;
             if (originalKeywordKind === undefined && text) {
                 originalKeywordKind = ts.stringToToken(text);
             }
-            if (originalKeywordKind === 78 /* Identifier */) {
+            if (originalKeywordKind === 79 /* Identifier */) {
                 originalKeywordKind = undefined;
             }
-            var node = baseFactory.createBaseIdentifierNode(78 /* Identifier */);
+            var node = baseFactory.createBaseIdentifierNode(79 /* Identifier */);
             node.originalKeywordKind = originalKeywordKind;
             node.escapedText = ts.escapeLeadingUnderscores(text);
             return node;
@@ -21157,8 +22068,8 @@ var ts;
                 // NOTE: we do not use `setChildren` here because typeArguments in an identifier do not contribute to transformations
                 node.typeArguments = createNodeArray(typeArguments);
             }
-            if (node.originalKeywordKind === 130 /* AwaitKeyword */) {
-                node.transformFlags |= 8388608 /* ContainsPossibleTopLevelAwait */;
+            if (node.originalKeywordKind === 132 /* AwaitKeyword */) {
+                node.transformFlags |= 16777216 /* ContainsPossibleTopLevelAwait */;
             }
             return node;
         }
@@ -21181,8 +22092,11 @@ var ts;
         }
         /** Create a unique temporary variable for use in a loop. */
         // @api
-        function createLoopVariable() {
-            return createBaseGeneratedIdentifier("", 2 /* Loop */);
+        function createLoopVariable(reservedInNestedScopes) {
+            var flags = 2 /* Loop */;
+            if (reservedInNestedScopes)
+                flags |= 8 /* ReservedInNestedScopes */;
+            return createBaseGeneratedIdentifier("", flags);
         }
         /** Create a unique name based on the supplied text. */
         // @api
@@ -21205,9 +22119,9 @@ var ts;
         function createPrivateIdentifier(text) {
             if (!ts.startsWith(text, "#"))
                 ts.Debug.fail("First character of private identifier must be #: " + text);
-            var node = baseFactory.createBasePrivateIdentifierNode(79 /* PrivateIdentifier */);
+            var node = baseFactory.createBasePrivateIdentifierNode(80 /* PrivateIdentifier */);
             node.escapedText = ts.escapeLeadingUnderscores(text);
-            node.transformFlags |= 4194304 /* ContainsClassFields */;
+            node.transformFlags |= 8388608 /* ContainsClassFields */;
             return node;
         }
         //
@@ -21217,46 +22131,49 @@ var ts;
             return baseFactory.createBaseTokenNode(kind);
         }
         function createToken(token) {
-            ts.Debug.assert(token >= 0 /* FirstToken */ && token <= 156 /* LastToken */, "Invalid token");
+            ts.Debug.assert(token >= 0 /* FirstToken */ && token <= 159 /* LastToken */, "Invalid token");
             ts.Debug.assert(token <= 14 /* FirstTemplateToken */ || token >= 17 /* LastTemplateToken */, "Invalid token. Use 'createTemplateLiteralLikeNode' to create template literals.");
             ts.Debug.assert(token <= 8 /* FirstLiteralToken */ || token >= 14 /* LastLiteralToken */, "Invalid token. Use 'createLiteralLikeNode' to create literals.");
-            ts.Debug.assert(token !== 78 /* Identifier */, "Invalid token. Use 'createIdentifier' to create identifiers");
+            ts.Debug.assert(token !== 79 /* Identifier */, "Invalid token. Use 'createIdentifier' to create identifiers");
             var node = createBaseToken(token);
             var transformFlags = 0 /* None */;
             switch (token) {
-                case 129 /* AsyncKeyword */:
+                case 131 /* AsyncKeyword */:
                     // 'async' modifier is ES2017 (async functions) or ES2018 (async generators)
                     transformFlags =
-                        64 /* ContainsES2017 */ |
-                            32 /* ContainsES2018 */;
+                        128 /* ContainsES2017 */ |
+                            64 /* ContainsES2018 */;
                     break;
-                case 122 /* PublicKeyword */:
-                case 120 /* PrivateKeyword */:
-                case 121 /* ProtectedKeyword */:
-                case 142 /* ReadonlyKeyword */:
-                case 125 /* AbstractKeyword */:
-                case 133 /* DeclareKeyword */:
-                case 84 /* ConstKeyword */:
-                case 128 /* AnyKeyword */:
-                case 144 /* NumberKeyword */:
-                case 155 /* BigIntKeyword */:
-                case 141 /* NeverKeyword */:
-                case 145 /* ObjectKeyword */:
-                case 147 /* StringKeyword */:
-                case 131 /* BooleanKeyword */:
-                case 148 /* SymbolKeyword */:
-                case 113 /* VoidKeyword */:
-                case 152 /* UnknownKeyword */:
-                case 150 /* UndefinedKeyword */: // `undefined` is an Identifier in the expression case.
+                case 123 /* PublicKeyword */:
+                case 121 /* PrivateKeyword */:
+                case 122 /* ProtectedKeyword */:
+                case 144 /* ReadonlyKeyword */:
+                case 126 /* AbstractKeyword */:
+                case 135 /* DeclareKeyword */:
+                case 85 /* ConstKeyword */:
+                case 130 /* AnyKeyword */:
+                case 146 /* NumberKeyword */:
+                case 157 /* BigIntKeyword */:
+                case 143 /* NeverKeyword */:
+                case 147 /* ObjectKeyword */:
+                case 158 /* OverrideKeyword */:
+                case 149 /* StringKeyword */:
+                case 133 /* BooleanKeyword */:
+                case 150 /* SymbolKeyword */:
+                case 114 /* VoidKeyword */:
+                case 154 /* UnknownKeyword */:
+                case 152 /* UndefinedKeyword */: // `undefined` is an Identifier in the expression case.
                     transformFlags = 1 /* ContainsTypeScript */;
                     break;
-                case 123 /* StaticKeyword */:
-                case 105 /* SuperKeyword */:
-                    transformFlags = 256 /* ContainsES2015 */;
+                case 106 /* SuperKeyword */:
+                    transformFlags = 512 /* ContainsES2015 */ | 33554432 /* ContainsLexicalSuper */;
                     break;
-                case 107 /* ThisKeyword */:
+                case 124 /* StaticKeyword */:
+                    transformFlags = 512 /* ContainsES2015 */;
+                    break;
+                case 108 /* ThisKeyword */:
                     // 'this' indicates a lexical 'this'
-                    transformFlags = 4096 /* ContainsLexicalThis */;
+                    transformFlags = 8192 /* ContainsLexicalThis */;
                     break;
             }
             if (transformFlags) {
@@ -21269,23 +22186,23 @@ var ts;
         //
         // @api
         function createSuper() {
-            return createToken(105 /* SuperKeyword */);
+            return createToken(106 /* SuperKeyword */);
         }
         // @api
         function createThis() {
-            return createToken(107 /* ThisKeyword */);
+            return createToken(108 /* ThisKeyword */);
         }
         // @api
         function createNull() {
-            return createToken(103 /* NullKeyword */);
+            return createToken(104 /* NullKeyword */);
         }
         // @api
         function createTrue() {
-            return createToken(109 /* TrueKeyword */);
+            return createToken(110 /* TrueKeyword */);
         }
         // @api
         function createFalse() {
-            return createToken(94 /* FalseKeyword */);
+            return createToken(95 /* FalseKeyword */);
         }
         //
         // Modifiers
@@ -21297,39 +22214,30 @@ var ts;
         // @api
         function createModifiersFromModifierFlags(flags) {
             var result = [];
-            if (flags & 1 /* Export */) {
-                result.push(createModifier(92 /* ExportKeyword */));
-            }
-            if (flags & 2 /* Ambient */) {
-                result.push(createModifier(133 /* DeclareKeyword */));
-            }
-            if (flags & 512 /* Default */) {
-                result.push(createModifier(87 /* DefaultKeyword */));
-            }
-            if (flags & 2048 /* Const */) {
-                result.push(createModifier(84 /* ConstKeyword */));
-            }
-            if (flags & 4 /* Public */) {
-                result.push(createModifier(122 /* PublicKeyword */));
-            }
-            if (flags & 8 /* Private */) {
-                result.push(createModifier(120 /* PrivateKeyword */));
-            }
-            if (flags & 16 /* Protected */) {
-                result.push(createModifier(121 /* ProtectedKeyword */));
-            }
-            if (flags & 128 /* Abstract */) {
-                result.push(createModifier(125 /* AbstractKeyword */));
-            }
-            if (flags & 32 /* Static */) {
-                result.push(createModifier(123 /* StaticKeyword */));
-            }
-            if (flags & 64 /* Readonly */) {
-                result.push(createModifier(142 /* ReadonlyKeyword */));
-            }
-            if (flags & 256 /* Async */) {
-                result.push(createModifier(129 /* AsyncKeyword */));
-            }
+            if (flags & 1 /* Export */)
+                result.push(createModifier(93 /* ExportKeyword */));
+            if (flags & 2 /* Ambient */)
+                result.push(createModifier(135 /* DeclareKeyword */));
+            if (flags & 512 /* Default */)
+                result.push(createModifier(88 /* DefaultKeyword */));
+            if (flags & 2048 /* Const */)
+                result.push(createModifier(85 /* ConstKeyword */));
+            if (flags & 4 /* Public */)
+                result.push(createModifier(123 /* PublicKeyword */));
+            if (flags & 8 /* Private */)
+                result.push(createModifier(121 /* PrivateKeyword */));
+            if (flags & 16 /* Protected */)
+                result.push(createModifier(122 /* ProtectedKeyword */));
+            if (flags & 128 /* Abstract */)
+                result.push(createModifier(126 /* AbstractKeyword */));
+            if (flags & 32 /* Static */)
+                result.push(createModifier(124 /* StaticKeyword */));
+            if (flags & 16384 /* Override */)
+                result.push(createModifier(158 /* OverrideKeyword */));
+            if (flags & 64 /* Readonly */)
+                result.push(createModifier(144 /* ReadonlyKeyword */));
+            if (flags & 256 /* Async */)
+                result.push(createModifier(131 /* AsyncKeyword */));
             return result;
         }
         //
@@ -21337,7 +22245,7 @@ var ts;
         //
         // @api
         function createQualifiedName(left, right) {
-            var node = createBaseNode(157 /* QualifiedName */);
+            var node = createBaseNode(160 /* QualifiedName */);
             node.left = left;
             node.right = asName(right);
             node.transformFlags |=
@@ -21354,12 +22262,12 @@ var ts;
         }
         // @api
         function createComputedPropertyName(expression) {
-            var node = createBaseNode(158 /* ComputedPropertyName */);
+            var node = createBaseNode(161 /* ComputedPropertyName */);
             node.expression = parenthesizerRules().parenthesizeExpressionOfComputedPropertyName(expression);
             node.transformFlags |=
                 propagateChildFlags(node.expression) |
-                    256 /* ContainsES2015 */ |
-                    32768 /* ContainsComputedPropertyName */;
+                    512 /* ContainsES2015 */ |
+                    65536 /* ContainsComputedPropertyName */;
             return node;
         }
         // @api
@@ -21373,7 +22281,7 @@ var ts;
         //
         // @api
         function createTypeParameterDeclaration(name, constraint, defaultType) {
-            var node = createBaseNamedDeclaration(159 /* TypeParameter */, 
+            var node = createBaseNamedDeclaration(162 /* TypeParameter */, 
             /*decorators*/ undefined, 
             /*modifiers*/ undefined, name);
             node.constraint = constraint;
@@ -21391,7 +22299,7 @@ var ts;
         }
         // @api
         function createParameterDeclaration(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) {
-            var node = createBaseVariableLikeDeclaration(160 /* Parameter */, decorators, modifiers, name, type, initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer));
+            var node = createBaseVariableLikeDeclaration(163 /* Parameter */, decorators, modifiers, name, type, initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer));
             node.dotDotDotToken = dotDotDotToken;
             node.questionToken = questionToken;
             if (ts.isThisIdentifier(node.name)) {
@@ -21403,10 +22311,10 @@ var ts;
                         propagateChildFlags(node.questionToken);
                 if (questionToken)
                     node.transformFlags |= 1 /* ContainsTypeScript */;
-                if (ts.modifiersToFlags(node.modifiers) & 92 /* ParameterPropertyModifier */)
-                    node.transformFlags |= 2048 /* ContainsTypeScriptClassSyntax */;
+                if (ts.modifiersToFlags(node.modifiers) & 16476 /* ParameterPropertyModifier */)
+                    node.transformFlags |= 4096 /* ContainsTypeScriptClassSyntax */;
                 if (initializer || dotDotDotToken)
-                    node.transformFlags |= 256 /* ContainsES2015 */;
+                    node.transformFlags |= 512 /* ContainsES2015 */;
             }
             return node;
         }
@@ -21424,12 +22332,12 @@ var ts;
         }
         // @api
         function createDecorator(expression) {
-            var node = createBaseNode(161 /* Decorator */);
+            var node = createBaseNode(164 /* Decorator */);
             node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);
             node.transformFlags |=
                 propagateChildFlags(node.expression) |
                     1 /* ContainsTypeScript */ |
-                    2048 /* ContainsTypeScriptClassSyntax */;
+                    4096 /* ContainsTypeScriptClassSyntax */;
             return node;
         }
         // @api
@@ -21443,7 +22351,7 @@ var ts;
         //
         // @api
         function createPropertySignature(modifiers, name, questionToken, type) {
-            var node = createBaseNamedDeclaration(162 /* PropertySignature */, 
+            var node = createBaseNamedDeclaration(165 /* PropertySignature */, 
             /*decorators*/ undefined, modifiers, name);
             node.type = type;
             node.questionToken = questionToken;
@@ -21461,15 +22369,15 @@ var ts;
         }
         // @api
         function createPropertyDeclaration(decorators, modifiers, name, questionOrExclamationToken, type, initializer) {
-            var node = createBaseVariableLikeDeclaration(163 /* PropertyDeclaration */, decorators, modifiers, name, type, initializer);
+            var node = createBaseVariableLikeDeclaration(166 /* PropertyDeclaration */, decorators, modifiers, name, type, initializer);
             node.questionToken = questionOrExclamationToken && ts.isQuestionToken(questionOrExclamationToken) ? questionOrExclamationToken : undefined;
             node.exclamationToken = questionOrExclamationToken && ts.isExclamationToken(questionOrExclamationToken) ? questionOrExclamationToken : undefined;
             node.transformFlags |=
                 propagateChildFlags(node.questionToken) |
                     propagateChildFlags(node.exclamationToken) |
-                    4194304 /* ContainsClassFields */;
+                    8388608 /* ContainsClassFields */;
             if (ts.isComputedPropertyName(node.name) || (ts.hasStaticModifier(node) && node.initializer)) {
-                node.transformFlags |= 2048 /* ContainsTypeScriptClassSyntax */;
+                node.transformFlags |= 4096 /* ContainsTypeScriptClassSyntax */;
             }
             if (questionOrExclamationToken || ts.modifiersToFlags(node.modifiers) & 2 /* Ambient */) {
                 node.transformFlags |= 1 /* ContainsTypeScript */;
@@ -21490,7 +22398,7 @@ var ts;
         }
         // @api
         function createMethodSignature(modifiers, name, questionToken, typeParameters, parameters, type) {
-            var node = createBaseSignatureDeclaration(164 /* MethodSignature */, 
+            var node = createBaseSignatureDeclaration(167 /* MethodSignature */, 
             /*decorators*/ undefined, modifiers, name, typeParameters, parameters, type);
             node.questionToken = questionToken;
             node.transformFlags = 1 /* ContainsTypeScript */;
@@ -21509,26 +22417,26 @@ var ts;
         }
         // @api
         function createMethodDeclaration(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) {
-            var node = createBaseFunctionLikeDeclaration(165 /* MethodDeclaration */, decorators, modifiers, name, typeParameters, parameters, type, body);
+            var node = createBaseFunctionLikeDeclaration(168 /* MethodDeclaration */, decorators, modifiers, name, typeParameters, parameters, type, body);
             node.asteriskToken = asteriskToken;
             node.questionToken = questionToken;
             node.transformFlags |=
                 propagateChildFlags(node.asteriskToken) |
                     propagateChildFlags(node.questionToken) |
-                    256 /* ContainsES2015 */;
+                    512 /* ContainsES2015 */;
             if (questionToken) {
                 node.transformFlags |= 1 /* ContainsTypeScript */;
             }
             if (ts.modifiersToFlags(node.modifiers) & 256 /* Async */) {
                 if (asteriskToken) {
-                    node.transformFlags |= 32 /* ContainsES2018 */;
+                    node.transformFlags |= 64 /* ContainsES2018 */;
                 }
                 else {
-                    node.transformFlags |= 64 /* ContainsES2017 */;
+                    node.transformFlags |= 128 /* ContainsES2017 */;
                 }
             }
             else if (asteriskToken) {
-                node.transformFlags |= 512 /* ContainsGenerator */;
+                node.transformFlags |= 1024 /* ContainsGenerator */;
             }
             return node;
         }
@@ -21547,12 +22455,29 @@ var ts;
                 : node;
         }
         // @api
+        function createClassStaticBlockDeclaration(decorators, modifiers, body) {
+            var node = createBaseGenericNamedDeclaration(169 /* ClassStaticBlockDeclaration */, decorators, modifiers, 
+            /*name*/ undefined, 
+            /*typeParameters*/ undefined);
+            node.body = body;
+            node.transformFlags = propagateChildFlags(body) | 8388608 /* ContainsClassFields */;
+            return node;
+        }
+        // @api
+        function updateClassStaticBlockDeclaration(node, decorators, modifiers, body) {
+            return node.decorators !== decorators
+                || node.modifier !== modifiers
+                || node.body !== body
+                ? update(createClassStaticBlockDeclaration(decorators, modifiers, body), node)
+                : node;
+        }
+        // @api
         function createConstructorDeclaration(decorators, modifiers, parameters, body) {
-            var node = createBaseFunctionLikeDeclaration(166 /* Constructor */, decorators, modifiers, 
+            var node = createBaseFunctionLikeDeclaration(170 /* Constructor */, decorators, modifiers, 
             /*name*/ undefined, 
             /*typeParameters*/ undefined, parameters, 
             /*type*/ undefined, body);
-            node.transformFlags |= 256 /* ContainsES2015 */;
+            node.transformFlags |= 512 /* ContainsES2015 */;
             return node;
         }
         // @api
@@ -21566,7 +22491,7 @@ var ts;
         }
         // @api
         function createGetAccessorDeclaration(decorators, modifiers, name, parameters, type, body) {
-            return createBaseFunctionLikeDeclaration(167 /* GetAccessor */, decorators, modifiers, name, 
+            return createBaseFunctionLikeDeclaration(171 /* GetAccessor */, decorators, modifiers, name, 
             /*typeParameters*/ undefined, parameters, type, body);
         }
         // @api
@@ -21582,7 +22507,7 @@ var ts;
         }
         // @api
         function createSetAccessorDeclaration(decorators, modifiers, name, parameters, body) {
-            return createBaseFunctionLikeDeclaration(168 /* SetAccessor */, decorators, modifiers, name, 
+            return createBaseFunctionLikeDeclaration(172 /* SetAccessor */, decorators, modifiers, name, 
             /*typeParameters*/ undefined, parameters, 
             /*type*/ undefined, body);
         }
@@ -21598,7 +22523,7 @@ var ts;
         }
         // @api
         function createCallSignature(typeParameters, parameters, type) {
-            var node = createBaseSignatureDeclaration(169 /* CallSignature */, 
+            var node = createBaseSignatureDeclaration(173 /* CallSignature */, 
             /*decorators*/ undefined, 
             /*modifiers*/ undefined, 
             /*name*/ undefined, typeParameters, parameters, type);
@@ -21615,7 +22540,7 @@ var ts;
         }
         // @api
         function createConstructSignature(typeParameters, parameters, type) {
-            var node = createBaseSignatureDeclaration(170 /* ConstructSignature */, 
+            var node = createBaseSignatureDeclaration(174 /* ConstructSignature */, 
             /*decorators*/ undefined, 
             /*modifiers*/ undefined, 
             /*name*/ undefined, typeParameters, parameters, type);
@@ -21632,7 +22557,7 @@ var ts;
         }
         // @api
         function createIndexSignature(decorators, modifiers, parameters, type) {
-            var node = createBaseSignatureDeclaration(171 /* IndexSignature */, decorators, modifiers, 
+            var node = createBaseSignatureDeclaration(175 /* IndexSignature */, decorators, modifiers, 
             /*name*/ undefined, 
             /*typeParameters*/ undefined, parameters, type);
             node.transformFlags = 1 /* ContainsTypeScript */;
@@ -21649,7 +22574,7 @@ var ts;
         }
         // @api
         function createTemplateLiteralTypeSpan(type, literal) {
-            var node = createBaseNode(194 /* TemplateLiteralTypeSpan */);
+            var node = createBaseNode(198 /* TemplateLiteralTypeSpan */);
             node.type = type;
             node.literal = literal;
             node.transformFlags = 1 /* ContainsTypeScript */;
@@ -21671,7 +22596,7 @@ var ts;
         }
         // @api
         function createTypePredicateNode(assertsModifier, parameterName, type) {
-            var node = createBaseNode(172 /* TypePredicate */);
+            var node = createBaseNode(176 /* TypePredicate */);
             node.assertsModifier = assertsModifier;
             node.parameterName = asName(parameterName);
             node.type = type;
@@ -21688,7 +22613,7 @@ var ts;
         }
         // @api
         function createTypeReferenceNode(typeName, typeArguments) {
-            var node = createBaseNode(173 /* TypeReference */);
+            var node = createBaseNode(177 /* TypeReference */);
             node.typeName = asName(typeName);
             node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(createNodeArray(typeArguments));
             node.transformFlags = 1 /* ContainsTypeScript */;
@@ -21703,7 +22628,7 @@ var ts;
         }
         // @api
         function createFunctionTypeNode(typeParameters, parameters, type) {
-            var node = createBaseSignatureDeclaration(174 /* FunctionType */, 
+            var node = createBaseSignatureDeclaration(178 /* FunctionType */, 
             /*decorators*/ undefined, 
             /*modifiers*/ undefined, 
             /*name*/ undefined, typeParameters, parameters, type);
@@ -21729,7 +22654,7 @@ var ts;
                     ts.Debug.fail("Incorrect number of arguments specified.");
         }
         function createConstructorTypeNode1(modifiers, typeParameters, parameters, type) {
-            var node = createBaseSignatureDeclaration(175 /* ConstructorType */, 
+            var node = createBaseSignatureDeclaration(179 /* ConstructorType */, 
             /*decorators*/ undefined, modifiers, 
             /*name*/ undefined, typeParameters, parameters, type);
             node.transformFlags = 1 /* ContainsTypeScript */;
@@ -21763,7 +22688,7 @@ var ts;
         }
         // @api
         function createTypeQueryNode(exprName) {
-            var node = createBaseNode(176 /* TypeQuery */);
+            var node = createBaseNode(180 /* TypeQuery */);
             node.exprName = exprName;
             node.transformFlags = 1 /* ContainsTypeScript */;
             return node;
@@ -21776,7 +22701,7 @@ var ts;
         }
         // @api
         function createTypeLiteralNode(members) {
-            var node = createBaseNode(177 /* TypeLiteral */);
+            var node = createBaseNode(181 /* TypeLiteral */);
             node.members = createNodeArray(members);
             node.transformFlags = 1 /* ContainsTypeScript */;
             return node;
@@ -21789,7 +22714,7 @@ var ts;
         }
         // @api
         function createArrayTypeNode(elementType) {
-            var node = createBaseNode(178 /* ArrayType */);
+            var node = createBaseNode(182 /* ArrayType */);
             node.elementType = parenthesizerRules().parenthesizeElementTypeOfArrayType(elementType);
             node.transformFlags = 1 /* ContainsTypeScript */;
             return node;
@@ -21802,7 +22727,7 @@ var ts;
         }
         // @api
         function createTupleTypeNode(elements) {
-            var node = createBaseNode(179 /* TupleType */);
+            var node = createBaseNode(183 /* TupleType */);
             node.elements = createNodeArray(elements);
             node.transformFlags = 1 /* ContainsTypeScript */;
             return node;
@@ -21815,7 +22740,7 @@ var ts;
         }
         // @api
         function createNamedTupleMember(dotDotDotToken, name, questionToken, type) {
-            var node = createBaseNode(192 /* NamedTupleMember */);
+            var node = createBaseNode(196 /* NamedTupleMember */);
             node.dotDotDotToken = dotDotDotToken;
             node.name = name;
             node.questionToken = questionToken;
@@ -21834,7 +22759,7 @@ var ts;
         }
         // @api
         function createOptionalTypeNode(type) {
-            var node = createBaseNode(180 /* OptionalType */);
+            var node = createBaseNode(184 /* OptionalType */);
             node.type = parenthesizerRules().parenthesizeElementTypeOfArrayType(type);
             node.transformFlags = 1 /* ContainsTypeScript */;
             return node;
@@ -21847,7 +22772,7 @@ var ts;
         }
         // @api
         function createRestTypeNode(type) {
-            var node = createBaseNode(181 /* RestType */);
+            var node = createBaseNode(185 /* RestType */);
             node.type = type;
             node.transformFlags = 1 /* ContainsTypeScript */;
             return node;
@@ -21871,7 +22796,7 @@ var ts;
         }
         // @api
         function createUnionTypeNode(types) {
-            return createUnionOrIntersectionTypeNode(182 /* UnionType */, types);
+            return createUnionOrIntersectionTypeNode(186 /* UnionType */, types);
         }
         // @api
         function updateUnionTypeNode(node, types) {
@@ -21879,7 +22804,7 @@ var ts;
         }
         // @api
         function createIntersectionTypeNode(types) {
-            return createUnionOrIntersectionTypeNode(183 /* IntersectionType */, types);
+            return createUnionOrIntersectionTypeNode(187 /* IntersectionType */, types);
         }
         // @api
         function updateIntersectionTypeNode(node, types) {
@@ -21887,7 +22812,7 @@ var ts;
         }
         // @api
         function createConditionalTypeNode(checkType, extendsType, trueType, falseType) {
-            var node = createBaseNode(184 /* ConditionalType */);
+            var node = createBaseNode(188 /* ConditionalType */);
             node.checkType = parenthesizerRules().parenthesizeMemberOfConditionalType(checkType);
             node.extendsType = parenthesizerRules().parenthesizeMemberOfConditionalType(extendsType);
             node.trueType = trueType;
@@ -21906,7 +22831,7 @@ var ts;
         }
         // @api
         function createInferTypeNode(typeParameter) {
-            var node = createBaseNode(185 /* InferType */);
+            var node = createBaseNode(189 /* InferType */);
             node.typeParameter = typeParameter;
             node.transformFlags = 1 /* ContainsTypeScript */;
             return node;
@@ -21919,7 +22844,7 @@ var ts;
         }
         // @api
         function createTemplateLiteralType(head, templateSpans) {
-            var node = createBaseNode(193 /* TemplateLiteralType */);
+            var node = createBaseNode(197 /* TemplateLiteralType */);
             node.head = head;
             node.templateSpans = createNodeArray(templateSpans);
             node.transformFlags = 1 /* ContainsTypeScript */;
@@ -21935,7 +22860,7 @@ var ts;
         // @api
         function createImportTypeNode(argument, qualifier, typeArguments, isTypeOf) {
             if (isTypeOf === void 0) { isTypeOf = false; }
-            var node = createBaseNode(195 /* ImportType */);
+            var node = createBaseNode(199 /* ImportType */);
             node.argument = argument;
             node.qualifier = qualifier;
             node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments);
@@ -21955,7 +22880,7 @@ var ts;
         }
         // @api
         function createParenthesizedType(type) {
-            var node = createBaseNode(186 /* ParenthesizedType */);
+            var node = createBaseNode(190 /* ParenthesizedType */);
             node.type = type;
             node.transformFlags = 1 /* ContainsTypeScript */;
             return node;
@@ -21968,13 +22893,13 @@ var ts;
         }
         // @api
         function createThisTypeNode() {
-            var node = createBaseNode(187 /* ThisType */);
+            var node = createBaseNode(191 /* ThisType */);
             node.transformFlags = 1 /* ContainsTypeScript */;
             return node;
         }
         // @api
         function createTypeOperatorNode(operator, type) {
-            var node = createBaseNode(188 /* TypeOperator */);
+            var node = createBaseNode(192 /* TypeOperator */);
             node.operator = operator;
             node.type = parenthesizerRules().parenthesizeMemberOfElementType(type);
             node.transformFlags = 1 /* ContainsTypeScript */;
@@ -21988,7 +22913,7 @@ var ts;
         }
         // @api
         function createIndexedAccessTypeNode(objectType, indexType) {
-            var node = createBaseNode(189 /* IndexedAccessType */);
+            var node = createBaseNode(193 /* IndexedAccessType */);
             node.objectType = parenthesizerRules().parenthesizeMemberOfElementType(objectType);
             node.indexType = indexType;
             node.transformFlags = 1 /* ContainsTypeScript */;
@@ -22002,29 +22927,31 @@ var ts;
                 : node;
         }
         // @api
-        function createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type) {
-            var node = createBaseNode(190 /* MappedType */);
+        function createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type, members) {
+            var node = createBaseNode(194 /* MappedType */);
             node.readonlyToken = readonlyToken;
             node.typeParameter = typeParameter;
             node.nameType = nameType;
             node.questionToken = questionToken;
             node.type = type;
+            node.members = members && createNodeArray(members);
             node.transformFlags = 1 /* ContainsTypeScript */;
             return node;
         }
         // @api
-        function updateMappedTypeNode(node, readonlyToken, typeParameter, nameType, questionToken, type) {
+        function updateMappedTypeNode(node, readonlyToken, typeParameter, nameType, questionToken, type, members) {
             return node.readonlyToken !== readonlyToken
                 || node.typeParameter !== typeParameter
                 || node.nameType !== nameType
                 || node.questionToken !== questionToken
                 || node.type !== type
-                ? update(createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type), node)
+                || node.members !== members
+                ? update(createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type, members), node)
                 : node;
         }
         // @api
         function createLiteralTypeNode(literal) {
-            var node = createBaseNode(191 /* LiteralType */);
+            var node = createBaseNode(195 /* LiteralType */);
             node.literal = literal;
             node.transformFlags = 1 /* ContainsTypeScript */;
             return node;
@@ -22040,16 +22967,16 @@ var ts;
         //
         // @api
         function createObjectBindingPattern(elements) {
-            var node = createBaseNode(196 /* ObjectBindingPattern */);
+            var node = createBaseNode(200 /* ObjectBindingPattern */);
             node.elements = createNodeArray(elements);
             node.transformFlags |=
                 propagateChildrenFlags(node.elements) |
-                    256 /* ContainsES2015 */ |
-                    131072 /* ContainsBindingPattern */;
-            if (node.transformFlags & 8192 /* ContainsRestOrSpread */) {
+                    512 /* ContainsES2015 */ |
+                    262144 /* ContainsBindingPattern */;
+            if (node.transformFlags & 16384 /* ContainsRestOrSpread */) {
                 node.transformFlags |=
-                    32 /* ContainsES2018 */ |
-                        16384 /* ContainsObjectRestOrSpread */;
+                    64 /* ContainsES2018 */ |
+                        32768 /* ContainsObjectRestOrSpread */;
             }
             return node;
         }
@@ -22061,12 +22988,12 @@ var ts;
         }
         // @api
         function createArrayBindingPattern(elements) {
-            var node = createBaseNode(197 /* ArrayBindingPattern */);
+            var node = createBaseNode(201 /* ArrayBindingPattern */);
             node.elements = createNodeArray(elements);
             node.transformFlags |=
                 propagateChildrenFlags(node.elements) |
-                    256 /* ContainsES2015 */ |
-                    131072 /* ContainsBindingPattern */;
+                    512 /* ContainsES2015 */ |
+                    262144 /* ContainsBindingPattern */;
             return node;
         }
         // @api
@@ -22077,21 +23004,21 @@ var ts;
         }
         // @api
         function createBindingElement(dotDotDotToken, propertyName, name, initializer) {
-            var node = createBaseBindingLikeDeclaration(198 /* BindingElement */, 
+            var node = createBaseBindingLikeDeclaration(202 /* BindingElement */, 
             /*decorators*/ undefined, 
-            /*modifiers*/ undefined, name, initializer);
+            /*modifiers*/ undefined, name, initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer));
             node.propertyName = asName(propertyName);
             node.dotDotDotToken = dotDotDotToken;
             node.transformFlags |=
                 propagateChildFlags(node.dotDotDotToken) |
-                    256 /* ContainsES2015 */;
+                    512 /* ContainsES2015 */;
             if (node.propertyName) {
                 node.transformFlags |= ts.isIdentifier(node.propertyName) ?
                     propagateIdentifierNameFlags(node.propertyName) :
                     propagateChildFlags(node.propertyName);
             }
             if (dotDotDotToken)
-                node.transformFlags |= 8192 /* ContainsRestOrSpread */;
+                node.transformFlags |= 16384 /* ContainsRestOrSpread */;
             return node;
         }
         // @api
@@ -22113,8 +23040,13 @@ var ts;
         }
         // @api
         function createArrayLiteralExpression(elements, multiLine) {
-            var node = createBaseExpression(199 /* ArrayLiteralExpression */);
-            node.elements = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(elements));
+            var node = createBaseExpression(203 /* ArrayLiteralExpression */);
+            // Ensure we add a trailing comma for something like `[NumericLiteral(1), NumericLiteral(2), OmittedExpresion]` so that
+            // we end up with `[1, 2, ,]` instead of `[1, 2, ]` otherwise the `OmittedExpression` will just end up being treated like
+            // a trailing comma.
+            var lastElement = elements && ts.lastOrUndefined(elements);
+            var elementsArray = createNodeArray(elements, lastElement && ts.isOmittedExpression(lastElement) ? true : undefined);
+            node.elements = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(elementsArray);
             node.multiLine = multiLine;
             node.transformFlags |= propagateChildrenFlags(node.elements);
             return node;
@@ -22127,7 +23059,7 @@ var ts;
         }
         // @api
         function createObjectLiteralExpression(properties, multiLine) {
-            var node = createBaseExpression(200 /* ObjectLiteralExpression */);
+            var node = createBaseExpression(204 /* ObjectLiteralExpression */);
             node.properties = createNodeArray(properties);
             node.multiLine = multiLine;
             node.transformFlags |= propagateChildrenFlags(node.properties);
@@ -22141,7 +23073,7 @@ var ts;
         }
         // @api
         function createPropertyAccessExpression(expression, name) {
-            var node = createBaseExpression(201 /* PropertyAccessExpression */);
+            var node = createBaseExpression(205 /* PropertyAccessExpression */);
             node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);
             node.name = asName(name);
             node.transformFlags =
@@ -22153,8 +23085,8 @@ var ts;
                 // super method calls require a lexical 'this'
                 // super method calls require 'super' hoisting in ES2017 and ES2018 async functions and async generators
                 node.transformFlags |=
-                    64 /* ContainsES2017 */ |
-                        32 /* ContainsES2018 */;
+                    128 /* ContainsES2017 */ |
+                        64 /* ContainsES2018 */;
             }
             return node;
         }
@@ -22170,13 +23102,13 @@ var ts;
         }
         // @api
         function createPropertyAccessChain(expression, questionDotToken, name) {
-            var node = createBaseExpression(201 /* PropertyAccessExpression */);
+            var node = createBaseExpression(205 /* PropertyAccessExpression */);
             node.flags |= 32 /* OptionalChain */;
             node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);
             node.questionDotToken = questionDotToken;
             node.name = asName(name);
             node.transformFlags |=
-                8 /* ContainsES2020 */ |
+                16 /* ContainsES2020 */ |
                     propagateChildFlags(node.expression) |
                     propagateChildFlags(node.questionDotToken) |
                     (ts.isIdentifier(node.name) ?
@@ -22197,7 +23129,7 @@ var ts;
         }
         // @api
         function createElementAccessExpression(expression, index) {
-            var node = createBaseExpression(202 /* ElementAccessExpression */);
+            var node = createBaseExpression(206 /* ElementAccessExpression */);
             node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);
             node.argumentExpression = asExpression(index);
             node.transformFlags |=
@@ -22207,8 +23139,8 @@ var ts;
                 // super method calls require a lexical 'this'
                 // super method calls require 'super' hoisting in ES2017 and ES2018 async functions and async generators
                 node.transformFlags |=
-                    64 /* ContainsES2017 */ |
-                        32 /* ContainsES2018 */;
+                    128 /* ContainsES2017 */ |
+                        64 /* ContainsES2018 */;
             }
             return node;
         }
@@ -22224,7 +23156,7 @@ var ts;
         }
         // @api
         function createElementAccessChain(expression, questionDotToken, index) {
-            var node = createBaseExpression(202 /* ElementAccessExpression */);
+            var node = createBaseExpression(206 /* ElementAccessExpression */);
             node.flags |= 32 /* OptionalChain */;
             node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);
             node.questionDotToken = questionDotToken;
@@ -22233,7 +23165,7 @@ var ts;
                 propagateChildFlags(node.expression) |
                     propagateChildFlags(node.questionDotToken) |
                     propagateChildFlags(node.argumentExpression) |
-                    8 /* ContainsES2020 */;
+                    16 /* ContainsES2020 */;
             return node;
         }
         // @api
@@ -22249,7 +23181,7 @@ var ts;
         }
         // @api
         function createCallExpression(expression, typeArguments, argumentsArray) {
-            var node = createBaseExpression(203 /* CallExpression */);
+            var node = createBaseExpression(207 /* CallExpression */);
             node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);
             node.typeArguments = asNodeArray(typeArguments);
             node.arguments = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray));
@@ -22261,10 +23193,10 @@ var ts;
                 node.transformFlags |= 1 /* ContainsTypeScript */;
             }
             if (ts.isImportKeyword(node.expression)) {
-                node.transformFlags |= 2097152 /* ContainsDynamicImport */;
+                node.transformFlags |= 4194304 /* ContainsDynamicImport */;
             }
             else if (ts.isSuperProperty(node.expression)) {
-                node.transformFlags |= 4096 /* ContainsLexicalThis */;
+                node.transformFlags |= 8192 /* ContainsLexicalThis */;
             }
             return node;
         }
@@ -22281,7 +23213,7 @@ var ts;
         }
         // @api
         function createCallChain(expression, questionDotToken, typeArguments, argumentsArray) {
-            var node = createBaseExpression(203 /* CallExpression */);
+            var node = createBaseExpression(207 /* CallExpression */);
             node.flags |= 32 /* OptionalChain */;
             node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);
             node.questionDotToken = questionDotToken;
@@ -22292,12 +23224,12 @@ var ts;
                     propagateChildFlags(node.questionDotToken) |
                     propagateChildrenFlags(node.typeArguments) |
                     propagateChildrenFlags(node.arguments) |
-                    8 /* ContainsES2020 */;
+                    16 /* ContainsES2020 */;
             if (node.typeArguments) {
                 node.transformFlags |= 1 /* ContainsTypeScript */;
             }
             if (ts.isSuperProperty(node.expression)) {
-                node.transformFlags |= 4096 /* ContainsLexicalThis */;
+                node.transformFlags |= 8192 /* ContainsLexicalThis */;
             }
             return node;
         }
@@ -22313,7 +23245,7 @@ var ts;
         }
         // @api
         function createNewExpression(expression, typeArguments, argumentsArray) {
-            var node = createBaseExpression(204 /* NewExpression */);
+            var node = createBaseExpression(208 /* NewExpression */);
             node.expression = parenthesizerRules().parenthesizeExpressionOfNew(expression);
             node.typeArguments = asNodeArray(typeArguments);
             node.arguments = argumentsArray ? parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(argumentsArray) : undefined;
@@ -22321,7 +23253,7 @@ var ts;
                 propagateChildFlags(node.expression) |
                     propagateChildrenFlags(node.typeArguments) |
                     propagateChildrenFlags(node.arguments) |
-                    8 /* ContainsES2020 */;
+                    16 /* ContainsES2020 */;
             if (node.typeArguments) {
                 node.transformFlags |= 1 /* ContainsTypeScript */;
             }
@@ -22337,7 +23269,7 @@ var ts;
         }
         // @api
         function createTaggedTemplateExpression(tag, typeArguments, template) {
-            var node = createBaseExpression(205 /* TaggedTemplateExpression */);
+            var node = createBaseExpression(209 /* TaggedTemplateExpression */);
             node.tag = parenthesizerRules().parenthesizeLeftSideOfAccess(tag);
             node.typeArguments = asNodeArray(typeArguments);
             node.template = template;
@@ -22345,12 +23277,12 @@ var ts;
                 propagateChildFlags(node.tag) |
                     propagateChildrenFlags(node.typeArguments) |
                     propagateChildFlags(node.template) |
-                    256 /* ContainsES2015 */;
+                    512 /* ContainsES2015 */;
             if (node.typeArguments) {
                 node.transformFlags |= 1 /* ContainsTypeScript */;
             }
             if (ts.hasInvalidEscape(node.template)) {
-                node.transformFlags |= 32 /* ContainsES2018 */;
+                node.transformFlags |= 64 /* ContainsES2018 */;
             }
             return node;
         }
@@ -22364,7 +23296,7 @@ var ts;
         }
         // @api
         function createTypeAssertion(type, expression) {
-            var node = createBaseExpression(206 /* TypeAssertionExpression */);
+            var node = createBaseExpression(210 /* TypeAssertionExpression */);
             node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
             node.type = type;
             node.transformFlags |=
@@ -22382,7 +23314,7 @@ var ts;
         }
         // @api
         function createParenthesizedExpression(expression) {
-            var node = createBaseExpression(207 /* ParenthesizedExpression */);
+            var node = createBaseExpression(211 /* ParenthesizedExpression */);
             node.expression = expression;
             node.transformFlags = propagateChildFlags(node.expression);
             return node;
@@ -22395,7 +23327,7 @@ var ts;
         }
         // @api
         function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) {
-            var node = createBaseFunctionLikeDeclaration(208 /* FunctionExpression */, 
+            var node = createBaseFunctionLikeDeclaration(212 /* FunctionExpression */, 
             /*decorators*/ undefined, modifiers, name, typeParameters, parameters, type, body);
             node.asteriskToken = asteriskToken;
             node.transformFlags |= propagateChildFlags(node.asteriskToken);
@@ -22404,14 +23336,14 @@ var ts;
             }
             if (ts.modifiersToFlags(node.modifiers) & 256 /* Async */) {
                 if (node.asteriskToken) {
-                    node.transformFlags |= 32 /* ContainsES2018 */;
+                    node.transformFlags |= 64 /* ContainsES2018 */;
                 }
                 else {
-                    node.transformFlags |= 64 /* ContainsES2017 */;
+                    node.transformFlags |= 128 /* ContainsES2017 */;
                 }
             }
             else if (node.asteriskToken) {
-                node.transformFlags |= 512 /* ContainsGenerator */;
+                node.transformFlags |= 1024 /* ContainsGenerator */;
             }
             return node;
         }
@@ -22429,15 +23361,15 @@ var ts;
         }
         // @api
         function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) {
-            var node = createBaseFunctionLikeDeclaration(209 /* ArrowFunction */, 
+            var node = createBaseFunctionLikeDeclaration(213 /* ArrowFunction */, 
             /*decorators*/ undefined, modifiers, 
             /*name*/ undefined, typeParameters, parameters, type, parenthesizerRules().parenthesizeConciseBodyOfArrowFunction(body));
             node.equalsGreaterThanToken = equalsGreaterThanToken !== null && equalsGreaterThanToken !== void 0 ? equalsGreaterThanToken : createToken(38 /* EqualsGreaterThanToken */);
             node.transformFlags |=
                 propagateChildFlags(node.equalsGreaterThanToken) |
-                    256 /* ContainsES2015 */;
+                    512 /* ContainsES2015 */;
             if (ts.modifiersToFlags(node.modifiers) & 256 /* Async */) {
-                node.transformFlags |= 64 /* ContainsES2017 */;
+                node.transformFlags |= 128 /* ContainsES2017 */ | 8192 /* ContainsLexicalThis */;
             }
             return node;
         }
@@ -22454,7 +23386,7 @@ var ts;
         }
         // @api
         function createDeleteExpression(expression) {
-            var node = createBaseExpression(210 /* DeleteExpression */);
+            var node = createBaseExpression(214 /* DeleteExpression */);
             node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
             node.transformFlags |= propagateChildFlags(node.expression);
             return node;
@@ -22467,7 +23399,7 @@ var ts;
         }
         // @api
         function createTypeOfExpression(expression) {
-            var node = createBaseExpression(211 /* TypeOfExpression */);
+            var node = createBaseExpression(215 /* TypeOfExpression */);
             node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
             node.transformFlags |= propagateChildFlags(node.expression);
             return node;
@@ -22480,7 +23412,7 @@ var ts;
         }
         // @api
         function createVoidExpression(expression) {
-            var node = createBaseExpression(212 /* VoidExpression */);
+            var node = createBaseExpression(216 /* VoidExpression */);
             node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
             node.transformFlags |= propagateChildFlags(node.expression);
             return node;
@@ -22493,13 +23425,13 @@ var ts;
         }
         // @api
         function createAwaitExpression(expression) {
-            var node = createBaseExpression(213 /* AwaitExpression */);
+            var node = createBaseExpression(217 /* AwaitExpression */);
             node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
             node.transformFlags |=
                 propagateChildFlags(node.expression) |
-                    64 /* ContainsES2017 */ |
-                    32 /* ContainsES2018 */ |
-                    524288 /* ContainsAwait */;
+                    128 /* ContainsES2017 */ |
+                    64 /* ContainsES2018 */ |
+                    1048576 /* ContainsAwait */;
             return node;
         }
         // @api
@@ -22510,10 +23442,18 @@ var ts;
         }
         // @api
         function createPrefixUnaryExpression(operator, operand) {
-            var node = createBaseExpression(214 /* PrefixUnaryExpression */);
+            var node = createBaseExpression(218 /* PrefixUnaryExpression */);
             node.operator = operator;
             node.operand = parenthesizerRules().parenthesizeOperandOfPrefixUnary(operand);
             node.transformFlags |= propagateChildFlags(node.operand);
+            // Only set this flag for non-generated identifiers and non-"local" names. See the
+            // comment in `visitPreOrPostfixUnaryExpression` in module.ts
+            if ((operator === 45 /* PlusPlusToken */ || operator === 46 /* MinusMinusToken */) &&
+                ts.isIdentifier(node.operand) &&
+                !ts.isGeneratedIdentifier(node.operand) &&
+                !ts.isLocalName(node.operand)) {
+                node.transformFlags |= 67108864 /* ContainsUpdateExpressionForIdentifier */;
+            }
             return node;
         }
         // @api
@@ -22524,10 +23464,17 @@ var ts;
         }
         // @api
         function createPostfixUnaryExpression(operand, operator) {
-            var node = createBaseExpression(215 /* PostfixUnaryExpression */);
+            var node = createBaseExpression(219 /* PostfixUnaryExpression */);
             node.operator = operator;
             node.operand = parenthesizerRules().parenthesizeOperandOfPostfixUnary(operand);
-            node.transformFlags = propagateChildFlags(node.operand);
+            node.transformFlags |= propagateChildFlags(node.operand);
+            // Only set this flag for non-generated identifiers and non-"local" names. See the
+            // comment in `visitPreOrPostfixUnaryExpression` in module.ts
+            if (ts.isIdentifier(node.operand) &&
+                !ts.isGeneratedIdentifier(node.operand) &&
+                !ts.isLocalName(node.operand)) {
+                node.transformFlags |= 67108864 /* ContainsUpdateExpressionForIdentifier */;
+            }
             return node;
         }
         // @api
@@ -22538,7 +23485,7 @@ var ts;
         }
         // @api
         function createBinaryExpression(left, operator, right) {
-            var node = createBaseExpression(216 /* BinaryExpression */);
+            var node = createBaseExpression(220 /* BinaryExpression */);
             var operatorToken = asToken(operator);
             var operatorKind = operatorToken.kind;
             node.left = parenthesizerRules().parenthesizeLeftSideOfBinary(operatorKind, left);
@@ -22549,45 +23496,45 @@ var ts;
                     propagateChildFlags(node.operatorToken) |
                     propagateChildFlags(node.right);
             if (operatorKind === 60 /* QuestionQuestionToken */) {
-                node.transformFlags |= 8 /* ContainsES2020 */;
+                node.transformFlags |= 16 /* ContainsES2020 */;
             }
-            else if (operatorKind === 62 /* EqualsToken */) {
+            else if (operatorKind === 63 /* EqualsToken */) {
                 if (ts.isObjectLiteralExpression(node.left)) {
                     node.transformFlags |=
-                        256 /* ContainsES2015 */ |
-                            32 /* ContainsES2018 */ |
-                            1024 /* ContainsDestructuringAssignment */ |
+                        512 /* ContainsES2015 */ |
+                            64 /* ContainsES2018 */ |
+                            2048 /* ContainsDestructuringAssignment */ |
                             propagateAssignmentPatternFlags(node.left);
                 }
                 else if (ts.isArrayLiteralExpression(node.left)) {
                     node.transformFlags |=
-                        256 /* ContainsES2015 */ |
-                            1024 /* ContainsDestructuringAssignment */ |
+                        512 /* ContainsES2015 */ |
+                            2048 /* ContainsDestructuringAssignment */ |
                             propagateAssignmentPatternFlags(node.left);
                 }
             }
-            else if (operatorKind === 42 /* AsteriskAsteriskToken */ || operatorKind === 66 /* AsteriskAsteriskEqualsToken */) {
-                node.transformFlags |= 128 /* ContainsES2016 */;
+            else if (operatorKind === 42 /* AsteriskAsteriskToken */ || operatorKind === 67 /* AsteriskAsteriskEqualsToken */) {
+                node.transformFlags |= 256 /* ContainsES2016 */;
             }
             else if (ts.isLogicalOrCoalescingAssignmentOperator(operatorKind)) {
-                node.transformFlags |= 4 /* ContainsESNext */;
+                node.transformFlags |= 8 /* ContainsES2021 */;
             }
             return node;
         }
         function propagateAssignmentPatternFlags(node) {
-            if (node.transformFlags & 16384 /* ContainsObjectRestOrSpread */)
-                return 16384 /* ContainsObjectRestOrSpread */;
-            if (node.transformFlags & 32 /* ContainsES2018 */) {
+            if (node.transformFlags & 32768 /* ContainsObjectRestOrSpread */)
+                return 32768 /* ContainsObjectRestOrSpread */;
+            if (node.transformFlags & 64 /* ContainsES2018 */) {
                 // check for nested spread assignments, otherwise '{ x: { a, ...b } = foo } = c'
                 // will not be correctly interpreted by the ES2018 transformer
                 for (var _i = 0, _a = ts.getElementsOfBindingOrAssignmentPattern(node); _i < _a.length; _i++) {
                     var element = _a[_i];
                     var target = ts.getTargetOfBindingOrAssignmentElement(element);
                     if (target && ts.isAssignmentPattern(target)) {
-                        if (target.transformFlags & 16384 /* ContainsObjectRestOrSpread */) {
-                            return 16384 /* ContainsObjectRestOrSpread */;
+                        if (target.transformFlags & 32768 /* ContainsObjectRestOrSpread */) {
+                            return 32768 /* ContainsObjectRestOrSpread */;
                         }
-                        if (target.transformFlags & 32 /* ContainsES2018 */) {
+                        if (target.transformFlags & 64 /* ContainsES2018 */) {
                             var flags_1 = propagateAssignmentPatternFlags(target);
                             if (flags_1)
                                 return flags_1;
@@ -22607,7 +23554,7 @@ var ts;
         }
         // @api
         function createConditionalExpression(condition, questionToken, whenTrue, colonToken, whenFalse) {
-            var node = createBaseExpression(217 /* ConditionalExpression */);
+            var node = createBaseExpression(221 /* ConditionalExpression */);
             node.condition = parenthesizerRules().parenthesizeConditionOfConditionalExpression(condition);
             node.questionToken = questionToken !== null && questionToken !== void 0 ? questionToken : createToken(57 /* QuestionToken */);
             node.whenTrue = parenthesizerRules().parenthesizeBranchOfConditionalExpression(whenTrue);
@@ -22633,13 +23580,13 @@ var ts;
         }
         // @api
         function createTemplateExpression(head, templateSpans) {
-            var node = createBaseExpression(218 /* TemplateExpression */);
+            var node = createBaseExpression(222 /* TemplateExpression */);
             node.head = head;
             node.templateSpans = createNodeArray(templateSpans);
             node.transformFlags |=
                 propagateChildFlags(node.head) |
                     propagateChildrenFlags(node.templateSpans) |
-                    256 /* ContainsES2015 */;
+                    512 /* ContainsES2015 */;
             return node;
         }
         // @api
@@ -22678,9 +23625,9 @@ var ts;
             node.text = text;
             node.rawText = rawText;
             node.templateFlags = templateFlags & 2048 /* TemplateLiteralLikeFlags */;
-            node.transformFlags |= 256 /* ContainsES2015 */;
+            node.transformFlags |= 512 /* ContainsES2015 */;
             if (node.templateFlags) {
-                node.transformFlags |= 32 /* ContainsES2018 */;
+                node.transformFlags |= 64 /* ContainsES2018 */;
             }
             return node;
         }
@@ -22703,15 +23650,15 @@ var ts;
         // @api
         function createYieldExpression(asteriskToken, expression) {
             ts.Debug.assert(!asteriskToken || !!expression, "A `YieldExpression` with an asteriskToken must have an expression.");
-            var node = createBaseExpression(219 /* YieldExpression */);
+            var node = createBaseExpression(223 /* YieldExpression */);
             node.expression = expression && parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
             node.asteriskToken = asteriskToken;
             node.transformFlags |=
                 propagateChildFlags(node.expression) |
                     propagateChildFlags(node.asteriskToken) |
-                    256 /* ContainsES2015 */ |
-                    32 /* ContainsES2018 */ |
-                    262144 /* ContainsYield */;
+                    512 /* ContainsES2015 */ |
+                    64 /* ContainsES2018 */ |
+                    524288 /* ContainsYield */;
             return node;
         }
         // @api
@@ -22723,12 +23670,12 @@ var ts;
         }
         // @api
         function createSpreadElement(expression) {
-            var node = createBaseExpression(220 /* SpreadElement */);
+            var node = createBaseExpression(224 /* SpreadElement */);
             node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
             node.transformFlags |=
                 propagateChildFlags(node.expression) |
-                    256 /* ContainsES2015 */ |
-                    8192 /* ContainsRestOrSpread */;
+                    512 /* ContainsES2015 */ |
+                    16384 /* ContainsRestOrSpread */;
             return node;
         }
         // @api
@@ -22739,8 +23686,8 @@ var ts;
         }
         // @api
         function createClassExpression(decorators, modifiers, name, typeParameters, heritageClauses, members) {
-            var node = createBaseClassLikeDeclaration(221 /* ClassExpression */, decorators, modifiers, name, typeParameters, heritageClauses, members);
-            node.transformFlags |= 256 /* ContainsES2015 */;
+            var node = createBaseClassLikeDeclaration(225 /* ClassExpression */, decorators, modifiers, name, typeParameters, heritageClauses, members);
+            node.transformFlags |= 512 /* ContainsES2015 */;
             return node;
         }
         // @api
@@ -22756,17 +23703,17 @@ var ts;
         }
         // @api
         function createOmittedExpression() {
-            return createBaseExpression(222 /* OmittedExpression */);
+            return createBaseExpression(226 /* OmittedExpression */);
         }
         // @api
         function createExpressionWithTypeArguments(expression, typeArguments) {
-            var node = createBaseNode(223 /* ExpressionWithTypeArguments */);
+            var node = createBaseNode(227 /* ExpressionWithTypeArguments */);
             node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);
             node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments);
             node.transformFlags |=
                 propagateChildFlags(node.expression) |
                     propagateChildrenFlags(node.typeArguments) |
-                    256 /* ContainsES2015 */;
+                    512 /* ContainsES2015 */;
             return node;
         }
         // @api
@@ -22778,7 +23725,7 @@ var ts;
         }
         // @api
         function createAsExpression(expression, type) {
-            var node = createBaseExpression(224 /* AsExpression */);
+            var node = createBaseExpression(228 /* AsExpression */);
             node.expression = expression;
             node.type = type;
             node.transformFlags |=
@@ -22796,7 +23743,7 @@ var ts;
         }
         // @api
         function createNonNullExpression(expression) {
-            var node = createBaseExpression(225 /* NonNullExpression */);
+            var node = createBaseExpression(229 /* NonNullExpression */);
             node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);
             node.transformFlags |=
                 propagateChildFlags(node.expression) |
@@ -22814,7 +23761,7 @@ var ts;
         }
         // @api
         function createNonNullChain(expression) {
-            var node = createBaseExpression(225 /* NonNullExpression */);
+            var node = createBaseExpression(229 /* NonNullExpression */);
             node.flags |= 32 /* OptionalChain */;
             node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);
             node.transformFlags |=
@@ -22831,15 +23778,15 @@ var ts;
         }
         // @api
         function createMetaProperty(keywordToken, name) {
-            var node = createBaseExpression(226 /* MetaProperty */);
+            var node = createBaseExpression(230 /* MetaProperty */);
             node.keywordToken = keywordToken;
             node.name = name;
             node.transformFlags |= propagateChildFlags(node.name);
             switch (keywordToken) {
-                case 102 /* NewKeyword */:
-                    node.transformFlags |= 256 /* ContainsES2015 */;
+                case 103 /* NewKeyword */:
+                    node.transformFlags |= 512 /* ContainsES2015 */;
                     break;
-                case 99 /* ImportKeyword */:
+                case 100 /* ImportKeyword */:
                     node.transformFlags |= 4 /* ContainsESNext */;
                     break;
                 default:
@@ -22858,13 +23805,13 @@ var ts;
         //
         // @api
         function createTemplateSpan(expression, literal) {
-            var node = createBaseNode(228 /* TemplateSpan */);
+            var node = createBaseNode(232 /* TemplateSpan */);
             node.expression = expression;
             node.literal = literal;
             node.transformFlags |=
                 propagateChildFlags(node.expression) |
                     propagateChildFlags(node.literal) |
-                    256 /* ContainsES2015 */;
+                    512 /* ContainsES2015 */;
             return node;
         }
         // @api
@@ -22876,8 +23823,8 @@ var ts;
         }
         // @api
         function createSemicolonClassElement() {
-            var node = createBaseNode(229 /* SemicolonClassElement */);
-            node.transformFlags |= 256 /* ContainsES2015 */;
+            var node = createBaseNode(233 /* SemicolonClassElement */);
+            node.transformFlags |= 512 /* ContainsES2015 */;
             return node;
         }
         //
@@ -22885,7 +23832,7 @@ var ts;
         //
         // @api
         function createBlock(statements, multiLine) {
-            var node = createBaseNode(230 /* Block */);
+            var node = createBaseNode(234 /* Block */);
             node.statements = createNodeArray(statements);
             node.multiLine = multiLine;
             node.transformFlags |= propagateChildrenFlags(node.statements);
@@ -22899,7 +23846,7 @@ var ts;
         }
         // @api
         function createVariableStatement(modifiers, declarationList) {
-            var node = createBaseDeclaration(232 /* VariableStatement */, /*decorators*/ undefined, modifiers);
+            var node = createBaseDeclaration(236 /* VariableStatement */, /*decorators*/ undefined, modifiers);
             node.declarationList = ts.isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList;
             node.transformFlags |=
                 propagateChildFlags(node.declarationList);
@@ -22917,11 +23864,11 @@ var ts;
         }
         // @api
         function createEmptyStatement() {
-            return createBaseNode(231 /* EmptyStatement */);
+            return createBaseNode(235 /* EmptyStatement */);
         }
         // @api
         function createExpressionStatement(expression) {
-            var node = createBaseNode(233 /* ExpressionStatement */);
+            var node = createBaseNode(237 /* ExpressionStatement */);
             node.expression = parenthesizerRules().parenthesizeExpressionOfExpressionStatement(expression);
             node.transformFlags |= propagateChildFlags(node.expression);
             return node;
@@ -22934,7 +23881,7 @@ var ts;
         }
         // @api
         function createIfStatement(expression, thenStatement, elseStatement) {
-            var node = createBaseNode(234 /* IfStatement */);
+            var node = createBaseNode(238 /* IfStatement */);
             node.expression = expression;
             node.thenStatement = asEmbeddedStatement(thenStatement);
             node.elseStatement = asEmbeddedStatement(elseStatement);
@@ -22954,7 +23901,7 @@ var ts;
         }
         // @api
         function createDoStatement(statement, expression) {
-            var node = createBaseNode(235 /* DoStatement */);
+            var node = createBaseNode(239 /* DoStatement */);
             node.statement = asEmbeddedStatement(statement);
             node.expression = expression;
             node.transformFlags |=
@@ -22971,7 +23918,7 @@ var ts;
         }
         // @api
         function createWhileStatement(expression, statement) {
-            var node = createBaseNode(236 /* WhileStatement */);
+            var node = createBaseNode(240 /* WhileStatement */);
             node.expression = expression;
             node.statement = asEmbeddedStatement(statement);
             node.transformFlags |=
@@ -22988,7 +23935,7 @@ var ts;
         }
         // @api
         function createForStatement(initializer, condition, incrementor, statement) {
-            var node = createBaseNode(237 /* ForStatement */);
+            var node = createBaseNode(241 /* ForStatement */);
             node.initializer = initializer;
             node.condition = condition;
             node.incrementor = incrementor;
@@ -23011,7 +23958,7 @@ var ts;
         }
         // @api
         function createForInStatement(initializer, expression, statement) {
-            var node = createBaseNode(238 /* ForInStatement */);
+            var node = createBaseNode(242 /* ForInStatement */);
             node.initializer = initializer;
             node.expression = expression;
             node.statement = asEmbeddedStatement(statement);
@@ -23031,7 +23978,7 @@ var ts;
         }
         // @api
         function createForOfStatement(awaitModifier, initializer, expression, statement) {
-            var node = createBaseNode(239 /* ForOfStatement */);
+            var node = createBaseNode(243 /* ForOfStatement */);
             node.awaitModifier = awaitModifier;
             node.initializer = initializer;
             node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
@@ -23041,9 +23988,9 @@ var ts;
                     propagateChildFlags(node.initializer) |
                     propagateChildFlags(node.expression) |
                     propagateChildFlags(node.statement) |
-                    256 /* ContainsES2015 */;
+                    512 /* ContainsES2015 */;
             if (awaitModifier)
-                node.transformFlags |= 32 /* ContainsES2018 */;
+                node.transformFlags |= 64 /* ContainsES2018 */;
             return node;
         }
         // @api
@@ -23057,11 +24004,11 @@ var ts;
         }
         // @api
         function createContinueStatement(label) {
-            var node = createBaseNode(240 /* ContinueStatement */);
+            var node = createBaseNode(244 /* ContinueStatement */);
             node.label = asName(label);
             node.transformFlags |=
                 propagateChildFlags(node.label) |
-                    1048576 /* ContainsHoistedDeclarationOrCompletion */;
+                    2097152 /* ContainsHoistedDeclarationOrCompletion */;
             return node;
         }
         // @api
@@ -23072,11 +24019,11 @@ var ts;
         }
         // @api
         function createBreakStatement(label) {
-            var node = createBaseNode(241 /* BreakStatement */);
+            var node = createBaseNode(245 /* BreakStatement */);
             node.label = asName(label);
             node.transformFlags |=
                 propagateChildFlags(node.label) |
-                    1048576 /* ContainsHoistedDeclarationOrCompletion */;
+                    2097152 /* ContainsHoistedDeclarationOrCompletion */;
             return node;
         }
         // @api
@@ -23087,13 +24034,13 @@ var ts;
         }
         // @api
         function createReturnStatement(expression) {
-            var node = createBaseNode(242 /* ReturnStatement */);
+            var node = createBaseNode(246 /* ReturnStatement */);
             node.expression = expression;
             // return in an ES2018 async generator must be awaited
             node.transformFlags |=
                 propagateChildFlags(node.expression) |
-                    32 /* ContainsES2018 */ |
-                    1048576 /* ContainsHoistedDeclarationOrCompletion */;
+                    64 /* ContainsES2018 */ |
+                    2097152 /* ContainsHoistedDeclarationOrCompletion */;
             return node;
         }
         // @api
@@ -23104,7 +24051,7 @@ var ts;
         }
         // @api
         function createWithStatement(expression, statement) {
-            var node = createBaseNode(243 /* WithStatement */);
+            var node = createBaseNode(247 /* WithStatement */);
             node.expression = expression;
             node.statement = asEmbeddedStatement(statement);
             node.transformFlags |=
@@ -23121,7 +24068,7 @@ var ts;
         }
         // @api
         function createSwitchStatement(expression, caseBlock) {
-            var node = createBaseNode(244 /* SwitchStatement */);
+            var node = createBaseNode(248 /* SwitchStatement */);
             node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
             node.caseBlock = caseBlock;
             node.transformFlags |=
@@ -23138,7 +24085,7 @@ var ts;
         }
         // @api
         function createLabeledStatement(label, statement) {
-            var node = createBaseNode(245 /* LabeledStatement */);
+            var node = createBaseNode(249 /* LabeledStatement */);
             node.label = asName(label);
             node.statement = asEmbeddedStatement(statement);
             node.transformFlags |=
@@ -23155,7 +24102,7 @@ var ts;
         }
         // @api
         function createThrowStatement(expression) {
-            var node = createBaseNode(246 /* ThrowStatement */);
+            var node = createBaseNode(250 /* ThrowStatement */);
             node.expression = expression;
             node.transformFlags |= propagateChildFlags(node.expression);
             return node;
@@ -23168,7 +24115,7 @@ var ts;
         }
         // @api
         function createTryStatement(tryBlock, catchClause, finallyBlock) {
-            var node = createBaseNode(247 /* TryStatement */);
+            var node = createBaseNode(251 /* TryStatement */);
             node.tryBlock = tryBlock;
             node.catchClause = catchClause;
             node.finallyBlock = finallyBlock;
@@ -23188,11 +24135,11 @@ var ts;
         }
         // @api
         function createDebuggerStatement() {
-            return createBaseNode(248 /* DebuggerStatement */);
+            return createBaseNode(252 /* DebuggerStatement */);
         }
         // @api
         function createVariableDeclaration(name, exclamationToken, type, initializer) {
-            var node = createBaseVariableLikeDeclaration(249 /* VariableDeclaration */, 
+            var node = createBaseVariableLikeDeclaration(253 /* VariableDeclaration */, 
             /*decorators*/ undefined, 
             /*modifiers*/ undefined, name, type, initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer));
             node.exclamationToken = exclamationToken;
@@ -23214,16 +24161,16 @@ var ts;
         // @api
         function createVariableDeclarationList(declarations, flags) {
             if (flags === void 0) { flags = 0 /* None */; }
-            var node = createBaseNode(250 /* VariableDeclarationList */);
+            var node = createBaseNode(254 /* VariableDeclarationList */);
             node.flags |= flags & 3 /* BlockScoped */;
             node.declarations = createNodeArray(declarations);
             node.transformFlags |=
                 propagateChildrenFlags(node.declarations) |
-                    1048576 /* ContainsHoistedDeclarationOrCompletion */;
+                    2097152 /* ContainsHoistedDeclarationOrCompletion */;
             if (flags & 3 /* BlockScoped */) {
                 node.transformFlags |=
-                    256 /* ContainsES2015 */ |
-                        65536 /* ContainsBlockScopedBinding */;
+                    512 /* ContainsES2015 */ |
+                        131072 /* ContainsBlockScopedBinding */;
             }
             return node;
         }
@@ -23235,7 +24182,7 @@ var ts;
         }
         // @api
         function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) {
-            var node = createBaseFunctionLikeDeclaration(251 /* FunctionDeclaration */, decorators, modifiers, name, typeParameters, parameters, type, body);
+            var node = createBaseFunctionLikeDeclaration(255 /* FunctionDeclaration */, decorators, modifiers, name, typeParameters, parameters, type, body);
             node.asteriskToken = asteriskToken;
             if (!node.body || ts.modifiersToFlags(node.modifiers) & 2 /* Ambient */) {
                 node.transformFlags = 1 /* ContainsTypeScript */;
@@ -23243,17 +24190,17 @@ var ts;
             else {
                 node.transformFlags |=
                     propagateChildFlags(node.asteriskToken) |
-                        1048576 /* ContainsHoistedDeclarationOrCompletion */;
+                        2097152 /* ContainsHoistedDeclarationOrCompletion */;
                 if (ts.modifiersToFlags(node.modifiers) & 256 /* Async */) {
                     if (node.asteriskToken) {
-                        node.transformFlags |= 32 /* ContainsES2018 */;
+                        node.transformFlags |= 64 /* ContainsES2018 */;
                     }
                     else {
-                        node.transformFlags |= 64 /* ContainsES2017 */;
+                        node.transformFlags |= 128 /* ContainsES2017 */;
                     }
                 }
                 else if (node.asteriskToken) {
-                    node.transformFlags |= 512 /* ContainsGenerator */;
+                    node.transformFlags |= 1024 /* ContainsGenerator */;
                 }
             }
             return node;
@@ -23273,13 +24220,13 @@ var ts;
         }
         // @api
         function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) {
-            var node = createBaseClassLikeDeclaration(252 /* ClassDeclaration */, decorators, modifiers, name, typeParameters, heritageClauses, members);
+            var node = createBaseClassLikeDeclaration(256 /* ClassDeclaration */, decorators, modifiers, name, typeParameters, heritageClauses, members);
             if (ts.modifiersToFlags(node.modifiers) & 2 /* Ambient */) {
                 node.transformFlags = 1 /* ContainsTypeScript */;
             }
             else {
-                node.transformFlags |= 256 /* ContainsES2015 */;
-                if (node.transformFlags & 2048 /* ContainsTypeScriptClassSyntax */) {
+                node.transformFlags |= 512 /* ContainsES2015 */;
+                if (node.transformFlags & 4096 /* ContainsTypeScriptClassSyntax */) {
                     node.transformFlags |= 1 /* ContainsTypeScript */;
                 }
             }
@@ -23298,7 +24245,7 @@ var ts;
         }
         // @api
         function createInterfaceDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) {
-            var node = createBaseInterfaceOrClassLikeDeclaration(253 /* InterfaceDeclaration */, decorators, modifiers, name, typeParameters, heritageClauses);
+            var node = createBaseInterfaceOrClassLikeDeclaration(257 /* InterfaceDeclaration */, decorators, modifiers, name, typeParameters, heritageClauses);
             node.members = createNodeArray(members);
             node.transformFlags = 1 /* ContainsTypeScript */;
             return node;
@@ -23316,7 +24263,7 @@ var ts;
         }
         // @api
         function createTypeAliasDeclaration(decorators, modifiers, name, typeParameters, type) {
-            var node = createBaseGenericNamedDeclaration(254 /* TypeAliasDeclaration */, decorators, modifiers, name, typeParameters);
+            var node = createBaseGenericNamedDeclaration(258 /* TypeAliasDeclaration */, decorators, modifiers, name, typeParameters);
             node.type = type;
             node.transformFlags = 1 /* ContainsTypeScript */;
             return node;
@@ -23333,12 +24280,12 @@ var ts;
         }
         // @api
         function createEnumDeclaration(decorators, modifiers, name, members) {
-            var node = createBaseNamedDeclaration(255 /* EnumDeclaration */, decorators, modifiers, name);
+            var node = createBaseNamedDeclaration(259 /* EnumDeclaration */, decorators, modifiers, name);
             node.members = createNodeArray(members);
             node.transformFlags |=
                 propagateChildrenFlags(node.members) |
                     1 /* ContainsTypeScript */;
-            node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // Enum declarations cannot contain `await`
+            node.transformFlags &= ~16777216 /* ContainsPossibleTopLevelAwait */; // Enum declarations cannot contain `await`
             return node;
         }
         // @api
@@ -23353,7 +24300,7 @@ var ts;
         // @api
         function createModuleDeclaration(decorators, modifiers, name, body, flags) {
             if (flags === void 0) { flags = 0 /* None */; }
-            var node = createBaseDeclaration(256 /* ModuleDeclaration */, decorators, modifiers);
+            var node = createBaseDeclaration(260 /* ModuleDeclaration */, decorators, modifiers);
             node.flags |= flags & (16 /* Namespace */ | 4 /* NestedNamespace */ | 1024 /* GlobalAugmentation */);
             node.name = name;
             node.body = body;
@@ -23366,7 +24313,7 @@ var ts;
                         propagateChildFlags(node.body) |
                         1 /* ContainsTypeScript */;
             }
-            node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // Module declarations cannot contain `await`.
+            node.transformFlags &= ~16777216 /* ContainsPossibleTopLevelAwait */; // Module declarations cannot contain `await`.
             return node;
         }
         // @api
@@ -23380,7 +24327,7 @@ var ts;
         }
         // @api
         function createModuleBlock(statements) {
-            var node = createBaseNode(257 /* ModuleBlock */);
+            var node = createBaseNode(261 /* ModuleBlock */);
             node.statements = createNodeArray(statements);
             node.transformFlags |= propagateChildrenFlags(node.statements);
             return node;
@@ -23393,7 +24340,7 @@ var ts;
         }
         // @api
         function createCaseBlock(clauses) {
-            var node = createBaseNode(258 /* CaseBlock */);
+            var node = createBaseNode(262 /* CaseBlock */);
             node.clauses = createNodeArray(clauses);
             node.transformFlags |= propagateChildrenFlags(node.clauses);
             return node;
@@ -23406,7 +24353,7 @@ var ts;
         }
         // @api
         function createNamespaceExportDeclaration(name) {
-            var node = createBaseNamedDeclaration(259 /* NamespaceExportDeclaration */, 
+            var node = createBaseNamedDeclaration(263 /* NamespaceExportDeclaration */, 
             /*decorators*/ undefined, 
             /*modifiers*/ undefined, name);
             node.transformFlags = 1 /* ContainsTypeScript */;
@@ -23420,13 +24367,13 @@ var ts;
         }
         // @api
         function createImportEqualsDeclaration(decorators, modifiers, isTypeOnly, name, moduleReference) {
-            var node = createBaseNamedDeclaration(260 /* ImportEqualsDeclaration */, decorators, modifiers, name);
+            var node = createBaseNamedDeclaration(264 /* ImportEqualsDeclaration */, decorators, modifiers, name);
             node.isTypeOnly = isTypeOnly;
             node.moduleReference = moduleReference;
             node.transformFlags |= propagateChildFlags(node.moduleReference);
             if (!ts.isExternalModuleReference(node.moduleReference))
                 node.transformFlags |= 1 /* ContainsTypeScript */;
-            node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // Import= declaration is always parsed in an Await context
+            node.transformFlags &= ~16777216 /* ContainsPossibleTopLevelAwait */; // Import= declaration is always parsed in an Await context
             return node;
         }
         // @api
@@ -23440,28 +24387,30 @@ var ts;
                 : node;
         }
         // @api
-        function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier) {
-            var node = createBaseDeclaration(261 /* ImportDeclaration */, decorators, modifiers);
+        function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier, assertClause) {
+            var node = createBaseDeclaration(265 /* ImportDeclaration */, decorators, modifiers);
             node.importClause = importClause;
             node.moduleSpecifier = moduleSpecifier;
+            node.assertClause = assertClause;
             node.transformFlags |=
                 propagateChildFlags(node.importClause) |
                     propagateChildFlags(node.moduleSpecifier);
-            node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context
+            node.transformFlags &= ~16777216 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context
             return node;
         }
         // @api
-        function updateImportDeclaration(node, decorators, modifiers, importClause, moduleSpecifier) {
+        function updateImportDeclaration(node, decorators, modifiers, importClause, moduleSpecifier, assertClause) {
             return node.decorators !== decorators
                 || node.modifiers !== modifiers
                 || node.importClause !== importClause
                 || node.moduleSpecifier !== moduleSpecifier
-                ? update(createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier), node)
+                || node.assertClause !== assertClause
+                ? update(createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier, assertClause), node)
                 : node;
         }
         // @api
         function createImportClause(isTypeOnly, name, namedBindings) {
-            var node = createBaseNode(262 /* ImportClause */);
+            var node = createBaseNode(266 /* ImportClause */);
             node.isTypeOnly = isTypeOnly;
             node.name = name;
             node.namedBindings = namedBindings;
@@ -23471,7 +24420,7 @@ var ts;
             if (isTypeOnly) {
                 node.transformFlags |= 1 /* ContainsTypeScript */;
             }
-            node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context
+            node.transformFlags &= ~16777216 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context
             return node;
         }
         // @api
@@ -23483,11 +24432,41 @@ var ts;
                 : node;
         }
         // @api
+        function createAssertClause(elements, multiLine) {
+            var node = createBaseNode(292 /* AssertClause */);
+            node.elements = elements;
+            node.multiLine = multiLine;
+            node.transformFlags |= 4 /* ContainsESNext */;
+            return node;
+        }
+        // @api
+        function updateAssertClause(node, elements, multiLine) {
+            return node.elements !== elements
+                || node.multiLine !== multiLine
+                ? update(createAssertClause(elements, multiLine), node)
+                : node;
+        }
+        // @api
+        function createAssertEntry(name, value) {
+            var node = createBaseNode(293 /* AssertEntry */);
+            node.name = name;
+            node.value = value;
+            node.transformFlags |= 4 /* ContainsESNext */;
+            return node;
+        }
+        // @api
+        function updateAssertEntry(node, name, value) {
+            return node.name !== name
+                || node.value !== value
+                ? update(createAssertEntry(name, value), node)
+                : node;
+        }
+        // @api
         function createNamespaceImport(name) {
-            var node = createBaseNode(263 /* NamespaceImport */);
+            var node = createBaseNode(267 /* NamespaceImport */);
             node.name = name;
             node.transformFlags |= propagateChildFlags(node.name);
-            node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context
+            node.transformFlags &= ~16777216 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context
             return node;
         }
         // @api
@@ -23498,12 +24477,12 @@ var ts;
         }
         // @api
         function createNamespaceExport(name) {
-            var node = createBaseNode(269 /* NamespaceExport */);
+            var node = createBaseNode(273 /* NamespaceExport */);
             node.name = name;
             node.transformFlags |=
                 propagateChildFlags(node.name) |
                     4 /* ContainsESNext */;
-            node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context
+            node.transformFlags &= ~16777216 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context
             return node;
         }
         // @api
@@ -23514,10 +24493,10 @@ var ts;
         }
         // @api
         function createNamedImports(elements) {
-            var node = createBaseNode(264 /* NamedImports */);
+            var node = createBaseNode(268 /* NamedImports */);
             node.elements = createNodeArray(elements);
             node.transformFlags |= propagateChildrenFlags(node.elements);
-            node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context
+            node.transformFlags &= ~16777216 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context
             return node;
         }
         // @api
@@ -23527,32 +24506,34 @@ var ts;
                 : node;
         }
         // @api
-        function createImportSpecifier(propertyName, name) {
-            var node = createBaseNode(265 /* ImportSpecifier */);
+        function createImportSpecifier(isTypeOnly, propertyName, name) {
+            var node = createBaseNode(269 /* ImportSpecifier */);
+            node.isTypeOnly = isTypeOnly;
             node.propertyName = propertyName;
             node.name = name;
             node.transformFlags |=
                 propagateChildFlags(node.propertyName) |
                     propagateChildFlags(node.name);
-            node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context
+            node.transformFlags &= ~16777216 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context
             return node;
         }
         // @api
-        function updateImportSpecifier(node, propertyName, name) {
-            return node.propertyName !== propertyName
+        function updateImportSpecifier(node, isTypeOnly, propertyName, name) {
+            return node.isTypeOnly !== isTypeOnly
+                || node.propertyName !== propertyName
                 || node.name !== name
-                ? update(createImportSpecifier(propertyName, name), node)
+                ? update(createImportSpecifier(isTypeOnly, propertyName, name), node)
                 : node;
         }
         // @api
         function createExportAssignment(decorators, modifiers, isExportEquals, expression) {
-            var node = createBaseDeclaration(266 /* ExportAssignment */, decorators, modifiers);
+            var node = createBaseDeclaration(270 /* ExportAssignment */, decorators, modifiers);
             node.isExportEquals = isExportEquals;
             node.expression = isExportEquals
-                ? parenthesizerRules().parenthesizeRightSideOfBinary(62 /* EqualsToken */, /*leftSide*/ undefined, expression)
+                ? parenthesizerRules().parenthesizeRightSideOfBinary(63 /* EqualsToken */, /*leftSide*/ undefined, expression)
                 : parenthesizerRules().parenthesizeExpressionOfExportDefault(expression);
             node.transformFlags |= propagateChildFlags(node.expression);
-            node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context
+            node.transformFlags &= ~16777216 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context
             return node;
         }
         // @api
@@ -23564,33 +24545,35 @@ var ts;
                 : node;
         }
         // @api
-        function createExportDeclaration(decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier) {
-            var node = createBaseDeclaration(267 /* ExportDeclaration */, decorators, modifiers);
+        function createExportDeclaration(decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) {
+            var node = createBaseDeclaration(271 /* ExportDeclaration */, decorators, modifiers);
             node.isTypeOnly = isTypeOnly;
             node.exportClause = exportClause;
             node.moduleSpecifier = moduleSpecifier;
+            node.assertClause = assertClause;
             node.transformFlags |=
                 propagateChildFlags(node.exportClause) |
                     propagateChildFlags(node.moduleSpecifier);
-            node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context
+            node.transformFlags &= ~16777216 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context
             return node;
         }
         // @api
-        function updateExportDeclaration(node, decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier) {
+        function updateExportDeclaration(node, decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) {
             return node.decorators !== decorators
                 || node.modifiers !== modifiers
                 || node.isTypeOnly !== isTypeOnly
                 || node.exportClause !== exportClause
                 || node.moduleSpecifier !== moduleSpecifier
-                ? update(createExportDeclaration(decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier), node)
+                || node.assertClause !== assertClause
+                ? update(createExportDeclaration(decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause), node)
                 : node;
         }
         // @api
         function createNamedExports(elements) {
-            var node = createBaseNode(268 /* NamedExports */);
+            var node = createBaseNode(272 /* NamedExports */);
             node.elements = createNodeArray(elements);
             node.transformFlags |= propagateChildrenFlags(node.elements);
-            node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context
+            node.transformFlags &= ~16777216 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context
             return node;
         }
         // @api
@@ -23600,26 +24583,28 @@ var ts;
                 : node;
         }
         // @api
-        function createExportSpecifier(propertyName, name) {
-            var node = createBaseNode(270 /* ExportSpecifier */);
+        function createExportSpecifier(isTypeOnly, propertyName, name) {
+            var node = createBaseNode(274 /* ExportSpecifier */);
+            node.isTypeOnly = isTypeOnly;
             node.propertyName = asName(propertyName);
             node.name = asName(name);
             node.transformFlags |=
                 propagateChildFlags(node.propertyName) |
                     propagateChildFlags(node.name);
-            node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context
+            node.transformFlags &= ~16777216 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context
             return node;
         }
         // @api
-        function updateExportSpecifier(node, propertyName, name) {
-            return node.propertyName !== propertyName
+        function updateExportSpecifier(node, isTypeOnly, propertyName, name) {
+            return node.isTypeOnly !== isTypeOnly
+                || node.propertyName !== propertyName
                 || node.name !== name
-                ? update(createExportSpecifier(propertyName, name), node)
+                ? update(createExportSpecifier(isTypeOnly, propertyName, name), node)
                 : node;
         }
         // @api
         function createMissingDeclaration() {
-            var node = createBaseDeclaration(271 /* MissingDeclaration */, 
+            var node = createBaseDeclaration(275 /* MissingDeclaration */, 
             /*decorators*/ undefined, 
             /*modifiers*/ undefined);
             return node;
@@ -23629,10 +24614,10 @@ var ts;
         //
         // @api
         function createExternalModuleReference(expression) {
-            var node = createBaseNode(272 /* ExternalModuleReference */);
+            var node = createBaseNode(276 /* ExternalModuleReference */);
             node.expression = expression;
             node.transformFlags |= propagateChildFlags(node.expression);
-            node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context
+            node.transformFlags &= ~16777216 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context
             return node;
         }
         // @api
@@ -23674,7 +24659,7 @@ var ts;
         }
         // @api
         function createJSDocFunctionType(parameters, type) {
-            var node = createBaseSignatureDeclaration(308 /* JSDocFunctionType */, 
+            var node = createBaseSignatureDeclaration(315 /* JSDocFunctionType */, 
             /*decorators*/ undefined, 
             /*modifiers*/ undefined, 
             /*name*/ undefined, 
@@ -23691,7 +24676,7 @@ var ts;
         // @api
         function createJSDocTypeLiteral(propertyTags, isArrayType) {
             if (isArrayType === void 0) { isArrayType = false; }
-            var node = createBaseNode(312 /* JSDocTypeLiteral */);
+            var node = createBaseNode(320 /* JSDocTypeLiteral */);
             node.jsDocPropertyTags = asNodeArray(propertyTags);
             node.isArrayType = isArrayType;
             return node;
@@ -23705,7 +24690,7 @@ var ts;
         }
         // @api
         function createJSDocTypeExpression(type) {
-            var node = createBaseNode(301 /* JSDocTypeExpression */);
+            var node = createBaseNode(307 /* JSDocTypeExpression */);
             node.type = type;
             return node;
         }
@@ -23717,7 +24702,7 @@ var ts;
         }
         // @api
         function createJSDocSignature(typeParameters, parameters, type) {
-            var node = createBaseNode(313 /* JSDocSignature */);
+            var node = createBaseNode(321 /* JSDocSignature */);
             node.typeParameters = asNodeArray(typeParameters);
             node.parameters = createNodeArray(parameters);
             node.type = type;
@@ -23746,7 +24731,7 @@ var ts;
         }
         // @api
         function createJSDocTemplateTag(tagName, constraint, typeParameters, comment) {
-            var node = createBaseJSDocTag(330 /* JSDocTemplateTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("template"), comment);
+            var node = createBaseJSDocTag(342 /* JSDocTemplateTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("template"), comment);
             node.constraint = constraint;
             node.typeParameters = createNodeArray(typeParameters);
             return node;
@@ -23763,7 +24748,7 @@ var ts;
         }
         // @api
         function createJSDocTypedefTag(tagName, typeExpression, fullName, comment) {
-            var node = createBaseJSDocTag(331 /* JSDocTypedefTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("typedef"), comment);
+            var node = createBaseJSDocTag(343 /* JSDocTypedefTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("typedef"), comment);
             node.typeExpression = typeExpression;
             node.fullName = fullName;
             node.name = ts.getJSDocTypeAliasName(fullName);
@@ -23781,7 +24766,7 @@ var ts;
         }
         // @api
         function createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) {
-            var node = createBaseJSDocTag(326 /* JSDocParameterTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("param"), comment);
+            var node = createBaseJSDocTag(338 /* JSDocParameterTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("param"), comment);
             node.typeExpression = typeExpression;
             node.name = name;
             node.isNameFirst = !!isNameFirst;
@@ -23802,7 +24787,7 @@ var ts;
         }
         // @api
         function createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) {
-            var node = createBaseJSDocTag(333 /* JSDocPropertyTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("prop"), comment);
+            var node = createBaseJSDocTag(345 /* JSDocPropertyTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("prop"), comment);
             node.typeExpression = typeExpression;
             node.name = name;
             node.isNameFirst = !!isNameFirst;
@@ -23823,7 +24808,7 @@ var ts;
         }
         // @api
         function createJSDocCallbackTag(tagName, typeExpression, fullName, comment) {
-            var node = createBaseJSDocTag(324 /* JSDocCallbackTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("callback"), comment);
+            var node = createBaseJSDocTag(336 /* JSDocCallbackTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("callback"), comment);
             node.typeExpression = typeExpression;
             node.fullName = fullName;
             node.name = ts.getJSDocTypeAliasName(fullName);
@@ -23841,7 +24826,7 @@ var ts;
         }
         // @api
         function createJSDocAugmentsTag(tagName, className, comment) {
-            var node = createBaseJSDocTag(315 /* JSDocAugmentsTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("augments"), comment);
+            var node = createBaseJSDocTag(326 /* JSDocAugmentsTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("augments"), comment);
             node.class = className;
             return node;
         }
@@ -23856,13 +24841,13 @@ var ts;
         }
         // @api
         function createJSDocImplementsTag(tagName, className, comment) {
-            var node = createBaseJSDocTag(316 /* JSDocImplementsTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("implements"), comment);
+            var node = createBaseJSDocTag(327 /* JSDocImplementsTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("implements"), comment);
             node.class = className;
             return node;
         }
         // @api
         function createJSDocSeeTag(tagName, name, comment) {
-            var node = createBaseJSDocTag(332 /* JSDocSeeTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("see"), comment);
+            var node = createBaseJSDocTag(344 /* JSDocSeeTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("see"), comment);
             node.name = name;
             return node;
         }
@@ -23876,7 +24861,7 @@ var ts;
         }
         // @api
         function createJSDocNameReference(name) {
-            var node = createBaseNode(302 /* JSDocNameReference */);
+            var node = createBaseNode(308 /* JSDocNameReference */);
             node.name = name;
             return node;
         }
@@ -23887,6 +24872,62 @@ var ts;
                 : node;
         }
         // @api
+        function createJSDocMemberName(left, right) {
+            var node = createBaseNode(309 /* JSDocMemberName */);
+            node.left = left;
+            node.right = right;
+            node.transformFlags |=
+                propagateChildFlags(node.left) |
+                    propagateChildFlags(node.right);
+            return node;
+        }
+        // @api
+        function updateJSDocMemberName(node, left, right) {
+            return node.left !== left
+                || node.right !== right
+                ? update(createJSDocMemberName(left, right), node)
+                : node;
+        }
+        // @api
+        function createJSDocLink(name, text) {
+            var node = createBaseNode(322 /* JSDocLink */);
+            node.name = name;
+            node.text = text;
+            return node;
+        }
+        // @api
+        function updateJSDocLink(node, name, text) {
+            return node.name !== name
+                ? update(createJSDocLink(name, text), node)
+                : node;
+        }
+        // @api
+        function createJSDocLinkCode(name, text) {
+            var node = createBaseNode(323 /* JSDocLinkCode */);
+            node.name = name;
+            node.text = text;
+            return node;
+        }
+        // @api
+        function updateJSDocLinkCode(node, name, text) {
+            return node.name !== name
+                ? update(createJSDocLinkCode(name, text), node)
+                : node;
+        }
+        // @api
+        function createJSDocLinkPlain(name, text) {
+            var node = createBaseNode(324 /* JSDocLinkPlain */);
+            node.name = name;
+            node.text = text;
+            return node;
+        }
+        // @api
+        function updateJSDocLinkPlain(node, name, text) {
+            return node.name !== name
+                ? update(createJSDocLinkPlain(name, text), node)
+                : node;
+        }
+        // @api
         function updateJSDocImplementsTag(node, tagName, className, comment) {
             if (tagName === void 0) { tagName = getDefaultTagName(node); }
             return node.tagName !== tagName
@@ -23947,7 +24988,7 @@ var ts;
         }
         // @api
         function createJSDocUnknownTag(tagName, comment) {
-            var node = createBaseJSDocTag(314 /* JSDocTag */, tagName, comment);
+            var node = createBaseJSDocTag(325 /* JSDocTag */, tagName, comment);
             return node;
         }
         // @api
@@ -23958,8 +24999,20 @@ var ts;
                 : node;
         }
         // @api
+        function createJSDocText(text) {
+            var node = createBaseNode(319 /* JSDocText */);
+            node.text = text;
+            return node;
+        }
+        // @api
+        function updateJSDocText(node, text) {
+            return node.text !== text
+                ? update(createJSDocText(text), node)
+                : node;
+        }
+        // @api
         function createJSDocComment(comment, tags) {
-            var node = createBaseNode(311 /* JSDocComment */);
+            var node = createBaseNode(318 /* JSDocComment */);
             node.comment = comment;
             node.tags = asNodeArray(tags);
             return node;
@@ -23976,7 +25029,7 @@ var ts;
         //
         // @api
         function createJsxElement(openingElement, children, closingElement) {
-            var node = createBaseNode(273 /* JsxElement */);
+            var node = createBaseNode(277 /* JsxElement */);
             node.openingElement = openingElement;
             node.children = createNodeArray(children);
             node.closingElement = closingElement;
@@ -23997,7 +25050,7 @@ var ts;
         }
         // @api
         function createJsxSelfClosingElement(tagName, typeArguments, attributes) {
-            var node = createBaseNode(274 /* JsxSelfClosingElement */);
+            var node = createBaseNode(278 /* JsxSelfClosingElement */);
             node.tagName = tagName;
             node.typeArguments = asNodeArray(typeArguments);
             node.attributes = attributes;
@@ -24021,7 +25074,7 @@ var ts;
         }
         // @api
         function createJsxOpeningElement(tagName, typeArguments, attributes) {
-            var node = createBaseNode(275 /* JsxOpeningElement */);
+            var node = createBaseNode(279 /* JsxOpeningElement */);
             node.tagName = tagName;
             node.typeArguments = asNodeArray(typeArguments);
             node.attributes = attributes;
@@ -24045,7 +25098,7 @@ var ts;
         }
         // @api
         function createJsxClosingElement(tagName) {
-            var node = createBaseNode(276 /* JsxClosingElement */);
+            var node = createBaseNode(280 /* JsxClosingElement */);
             node.tagName = tagName;
             node.transformFlags |=
                 propagateChildFlags(node.tagName) |
@@ -24060,7 +25113,7 @@ var ts;
         }
         // @api
         function createJsxFragment(openingFragment, children, closingFragment) {
-            var node = createBaseNode(277 /* JsxFragment */);
+            var node = createBaseNode(281 /* JsxFragment */);
             node.openingFragment = openingFragment;
             node.children = createNodeArray(children);
             node.closingFragment = closingFragment;
@@ -24096,19 +25149,19 @@ var ts;
         }
         // @api
         function createJsxOpeningFragment() {
-            var node = createBaseNode(278 /* JsxOpeningFragment */);
+            var node = createBaseNode(282 /* JsxOpeningFragment */);
             node.transformFlags |= 2 /* ContainsJsx */;
             return node;
         }
         // @api
         function createJsxJsxClosingFragment() {
-            var node = createBaseNode(279 /* JsxClosingFragment */);
+            var node = createBaseNode(283 /* JsxClosingFragment */);
             node.transformFlags |= 2 /* ContainsJsx */;
             return node;
         }
         // @api
         function createJsxAttribute(name, initializer) {
-            var node = createBaseNode(280 /* JsxAttribute */);
+            var node = createBaseNode(284 /* JsxAttribute */);
             node.name = name;
             node.initializer = initializer;
             node.transformFlags |=
@@ -24126,7 +25179,7 @@ var ts;
         }
         // @api
         function createJsxAttributes(properties) {
-            var node = createBaseNode(281 /* JsxAttributes */);
+            var node = createBaseNode(285 /* JsxAttributes */);
             node.properties = createNodeArray(properties);
             node.transformFlags |=
                 propagateChildrenFlags(node.properties) |
@@ -24141,7 +25194,7 @@ var ts;
         }
         // @api
         function createJsxSpreadAttribute(expression) {
-            var node = createBaseNode(282 /* JsxSpreadAttribute */);
+            var node = createBaseNode(286 /* JsxSpreadAttribute */);
             node.expression = expression;
             node.transformFlags |=
                 propagateChildFlags(node.expression) |
@@ -24156,7 +25209,7 @@ var ts;
         }
         // @api
         function createJsxExpression(dotDotDotToken, expression) {
-            var node = createBaseNode(283 /* JsxExpression */);
+            var node = createBaseNode(287 /* JsxExpression */);
             node.dotDotDotToken = dotDotDotToken;
             node.expression = expression;
             node.transformFlags |=
@@ -24176,7 +25229,7 @@ var ts;
         //
         // @api
         function createCaseClause(expression, statements) {
-            var node = createBaseNode(284 /* CaseClause */);
+            var node = createBaseNode(288 /* CaseClause */);
             node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
             node.statements = createNodeArray(statements);
             node.transformFlags |=
@@ -24193,7 +25246,7 @@ var ts;
         }
         // @api
         function createDefaultClause(statements) {
-            var node = createBaseNode(285 /* DefaultClause */);
+            var node = createBaseNode(289 /* DefaultClause */);
             node.statements = createNodeArray(statements);
             node.transformFlags = propagateChildrenFlags(node.statements);
             return node;
@@ -24206,15 +25259,15 @@ var ts;
         }
         // @api
         function createHeritageClause(token, types) {
-            var node = createBaseNode(286 /* HeritageClause */);
+            var node = createBaseNode(290 /* HeritageClause */);
             node.token = token;
             node.types = createNodeArray(types);
             node.transformFlags |= propagateChildrenFlags(node.types);
             switch (token) {
-                case 93 /* ExtendsKeyword */:
-                    node.transformFlags |= 256 /* ContainsES2015 */;
+                case 94 /* ExtendsKeyword */:
+                    node.transformFlags |= 512 /* ContainsES2015 */;
                     break;
-                case 116 /* ImplementsKeyword */:
+                case 117 /* ImplementsKeyword */:
                     node.transformFlags |= 1 /* ContainsTypeScript */;
                     break;
                 default:
@@ -24230,18 +25283,20 @@ var ts;
         }
         // @api
         function createCatchClause(variableDeclaration, block) {
-            var node = createBaseNode(287 /* CatchClause */);
-            variableDeclaration = !ts.isString(variableDeclaration) ? variableDeclaration : createVariableDeclaration(variableDeclaration, 
-            /*exclamationToken*/ undefined, 
-            /*type*/ undefined, 
-            /*initializer*/ undefined);
+            var node = createBaseNode(291 /* CatchClause */);
+            if (typeof variableDeclaration === "string" || variableDeclaration && !ts.isVariableDeclaration(variableDeclaration)) {
+                variableDeclaration = createVariableDeclaration(variableDeclaration, 
+                /*exclamationToken*/ undefined, 
+                /*type*/ undefined, 
+                /*initializer*/ undefined);
+            }
             node.variableDeclaration = variableDeclaration;
             node.block = block;
             node.transformFlags |=
                 propagateChildFlags(node.variableDeclaration) |
                     propagateChildFlags(node.block);
             if (!variableDeclaration)
-                node.transformFlags |= 16 /* ContainsES2019 */;
+                node.transformFlags |= 32 /* ContainsES2019 */;
             return node;
         }
         // @api
@@ -24256,7 +25311,7 @@ var ts;
         //
         // @api
         function createPropertyAssignment(name, initializer) {
-            var node = createBaseNamedDeclaration(288 /* PropertyAssignment */, 
+            var node = createBaseNamedDeclaration(294 /* PropertyAssignment */, 
             /*decorators*/ undefined, 
             /*modifiers*/ undefined, name);
             node.initializer = parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer);
@@ -24286,13 +25341,13 @@ var ts;
         }
         // @api
         function createShorthandPropertyAssignment(name, objectAssignmentInitializer) {
-            var node = createBaseNamedDeclaration(289 /* ShorthandPropertyAssignment */, 
+            var node = createBaseNamedDeclaration(295 /* ShorthandPropertyAssignment */, 
             /*decorators*/ undefined, 
             /*modifiers*/ undefined, name);
             node.objectAssignmentInitializer = objectAssignmentInitializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(objectAssignmentInitializer);
             node.transformFlags |=
                 propagateChildFlags(node.objectAssignmentInitializer) |
-                    256 /* ContainsES2015 */;
+                    512 /* ContainsES2015 */;
             return node;
         }
         function finishUpdateShorthandPropertyAssignment(updated, original) {
@@ -24318,12 +25373,12 @@ var ts;
         }
         // @api
         function createSpreadAssignment(expression) {
-            var node = createBaseNode(290 /* SpreadAssignment */);
+            var node = createBaseNode(296 /* SpreadAssignment */);
             node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
             node.transformFlags |=
                 propagateChildFlags(node.expression) |
-                    32 /* ContainsES2018 */ |
-                    16384 /* ContainsObjectRestOrSpread */;
+                    64 /* ContainsES2018 */ |
+                    32768 /* ContainsObjectRestOrSpread */;
             return node;
         }
         // @api
@@ -24337,7 +25392,7 @@ var ts;
         //
         // @api
         function createEnumMember(name, initializer) {
-            var node = createBaseNode(291 /* EnumMember */);
+            var node = createBaseNode(297 /* EnumMember */);
             node.name = asName(name);
             node.initializer = initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer);
             node.transformFlags |=
@@ -24358,7 +25413,7 @@ var ts;
         //
         // @api
         function createSourceFile(statements, endOfFileToken, flags) {
-            var node = baseFactory.createBaseSourceFileNode(297 /* SourceFile */);
+            var node = baseFactory.createBaseSourceFileNode(303 /* SourceFile */);
             node.statements = createNodeArray(statements);
             node.endOfFileToken = endOfFileToken;
             node.flags |= flags;
@@ -24375,7 +25430,7 @@ var ts;
             return node;
         }
         function cloneSourceFileWithChanges(source, statements, isDeclarationFile, referencedFiles, typeReferences, hasNoDefaultLib, libReferences) {
-            var node = baseFactory.createBaseSourceFileNode(297 /* SourceFile */);
+            var node = baseFactory.createBaseSourceFileNode(303 /* SourceFile */);
             for (var p in source) {
                 if (p === "emitNode" || ts.hasProperty(node, p) || !ts.hasProperty(source, p))
                     continue;
@@ -24392,6 +25447,7 @@ var ts;
             node.transformFlags =
                 propagateChildrenFlags(node.statements) |
                     propagateChildFlags(node.endOfFileToken);
+            node.impliedNodeFormat = source.impliedNodeFormat;
             return node;
         }
         // @api
@@ -24413,7 +25469,7 @@ var ts;
         // @api
         function createBundle(sourceFiles, prepends) {
             if (prepends === void 0) { prepends = ts.emptyArray; }
-            var node = createBaseNode(298 /* Bundle */);
+            var node = createBaseNode(304 /* Bundle */);
             node.prepends = prepends;
             node.sourceFiles = sourceFiles;
             return node;
@@ -24428,7 +25484,7 @@ var ts;
         }
         // @api
         function createUnparsedSource(prologues, syntheticReferences, texts) {
-            var node = createBaseNode(299 /* UnparsedSource */);
+            var node = createBaseNode(305 /* UnparsedSource */);
             node.prologues = prologues;
             node.syntheticReferences = syntheticReferences;
             node.texts = texts;
@@ -24446,28 +25502,28 @@ var ts;
         }
         // @api
         function createUnparsedPrologue(data) {
-            return createBaseUnparsedNode(292 /* UnparsedPrologue */, data);
+            return createBaseUnparsedNode(298 /* UnparsedPrologue */, data);
         }
         // @api
         function createUnparsedPrepend(data, texts) {
-            var node = createBaseUnparsedNode(293 /* UnparsedPrepend */, data);
+            var node = createBaseUnparsedNode(299 /* UnparsedPrepend */, data);
             node.texts = texts;
             return node;
         }
         // @api
         function createUnparsedTextLike(data, internal) {
-            return createBaseUnparsedNode(internal ? 295 /* UnparsedInternalText */ : 294 /* UnparsedText */, data);
+            return createBaseUnparsedNode(internal ? 301 /* UnparsedInternalText */ : 300 /* UnparsedText */, data);
         }
         // @api
         function createUnparsedSyntheticReference(section) {
-            var node = createBaseNode(296 /* UnparsedSyntheticReference */);
+            var node = createBaseNode(302 /* UnparsedSyntheticReference */);
             node.data = section.data;
             node.section = section;
             return node;
         }
         // @api
         function createInputFiles() {
-            var node = createBaseNode(300 /* InputFiles */);
+            var node = createBaseNode(306 /* InputFiles */);
             node.javascriptText = "";
             node.declarationText = "";
             return node;
@@ -24478,7 +25534,7 @@ var ts;
         // @api
         function createSyntheticExpression(type, isSpread, tupleNameSource) {
             if (isSpread === void 0) { isSpread = false; }
-            var node = createBaseNode(227 /* SyntheticExpression */);
+            var node = createBaseNode(231 /* SyntheticExpression */);
             node.type = type;
             node.isSpread = isSpread;
             node.tupleNameSource = tupleNameSource;
@@ -24486,7 +25542,7 @@ var ts;
         }
         // @api
         function createSyntaxList(children) {
-            var node = createBaseNode(334 /* SyntaxList */);
+            var node = createBaseNode(346 /* SyntaxList */);
             node._children = children;
             return node;
         }
@@ -24501,7 +25557,7 @@ var ts;
          */
         // @api
         function createNotEmittedStatement(original) {
-            var node = createBaseNode(335 /* NotEmittedStatement */);
+            var node = createBaseNode(347 /* NotEmittedStatement */);
             node.original = original;
             ts.setTextRange(node, original);
             return node;
@@ -24515,7 +25571,7 @@ var ts;
          */
         // @api
         function createPartiallyEmittedExpression(expression, original) {
-            var node = createBaseNode(336 /* PartiallyEmittedExpression */);
+            var node = createBaseNode(348 /* PartiallyEmittedExpression */);
             node.expression = expression;
             node.original = original;
             node.transformFlags |=
@@ -24543,7 +25599,7 @@ var ts;
         }
         // @api
         function createCommaListExpression(elements) {
-            var node = createBaseNode(337 /* CommaListExpression */);
+            var node = createBaseNode(349 /* CommaListExpression */);
             node.elements = createNodeArray(ts.sameFlatMap(elements, flattenCommaElements));
             node.transformFlags |= propagateChildrenFlags(node.elements);
             return node;
@@ -24560,7 +25616,7 @@ var ts;
          */
         // @api
         function createEndOfDeclarationMarker(original) {
-            var node = createBaseNode(339 /* EndOfDeclarationMarker */);
+            var node = createBaseNode(351 /* EndOfDeclarationMarker */);
             node.emitNode = {};
             node.original = original;
             return node;
@@ -24571,14 +25627,14 @@ var ts;
          */
         // @api
         function createMergeDeclarationMarker(original) {
-            var node = createBaseNode(338 /* MergeDeclarationMarker */);
+            var node = createBaseNode(350 /* MergeDeclarationMarker */);
             node.emitNode = {};
             node.original = original;
             return node;
         }
         // @api
         function createSyntheticReferenceExpression(expression, thisArg) {
-            var node = createBaseNode(340 /* SyntheticReferenceExpression */);
+            var node = createBaseNode(352 /* SyntheticReferenceExpression */);
             node.expression = expression;
             node.thisArg = thisArg;
             node.transformFlags |=
@@ -24600,9 +25656,9 @@ var ts;
             if (node === undefined) {
                 return node;
             }
-            var clone = ts.isSourceFile(node) ? baseFactory.createBaseSourceFileNode(297 /* SourceFile */) :
-                ts.isIdentifier(node) ? baseFactory.createBaseIdentifierNode(78 /* Identifier */) :
-                    ts.isPrivateIdentifier(node) ? baseFactory.createBasePrivateIdentifierNode(79 /* PrivateIdentifier */) :
+            var clone = ts.isSourceFile(node) ? baseFactory.createBaseSourceFileNode(303 /* SourceFile */) :
+                ts.isIdentifier(node) ? baseFactory.createBaseIdentifierNode(79 /* Identifier */) :
+                    ts.isPrivateIdentifier(node) ? baseFactory.createBasePrivateIdentifierNode(80 /* PrivateIdentifier */) :
                         !ts.isNodeKind(node.kind) ? baseFactory.createBaseTokenNode(node.kind) :
                             baseFactory.createBaseNode(node.kind);
             clone.flags |= (node.flags & ~8 /* Synthesized */);
@@ -24651,7 +25707,7 @@ var ts;
             /*decorators*/ undefined, 
             /*modifiers*/ undefined, 
             /*isTypeOnly*/ false, createNamedExports([
-                createExportSpecifier(/*propertyName*/ undefined, exportName)
+                createExportSpecifier(/*isTypeOnly*/ false, /*propertyName*/ undefined, exportName)
             ]));
         }
         //
@@ -24663,14 +25719,20 @@ var ts;
                 : factory.createStrictEquality(createTypeOfExpression(value), createStringLiteral(tag));
         }
         function createMethodCall(object, methodName, argumentsList) {
+            // Preserve the optionality of `object`.
+            if (ts.isCallChain(object)) {
+                return createCallChain(createPropertyAccessChain(object, /*questionDotToken*/ undefined, methodName), 
+                /*questionDotToken*/ undefined, 
+                /*typeArguments*/ undefined, argumentsList);
+            }
             return createCallExpression(createPropertyAccessExpression(object, methodName), 
             /*typeArguments*/ undefined, argumentsList);
         }
         function createFunctionBindCall(target, thisArg, argumentsList) {
-            return createMethodCall(target, "bind", __spreadArray([thisArg], argumentsList));
+            return createMethodCall(target, "bind", __spreadArray([thisArg], argumentsList, true));
         }
         function createFunctionCallCall(target, thisArg, argumentsList) {
-            return createMethodCall(target, "call", __spreadArray([thisArg], argumentsList));
+            return createMethodCall(target, "call", __spreadArray([thisArg], argumentsList, true));
         }
         function createFunctionApplyCall(target, thisArg, argumentsExpression) {
             return createMethodCall(target, "apply", [thisArg, argumentsExpression]);
@@ -24687,6 +25749,12 @@ var ts;
         function createObjectDefinePropertyCall(target, propertyName, attributes) {
             return createGlobalMethodCall("Object", "defineProperty", [target, asExpression(propertyName), attributes]);
         }
+        function createReflectGetCall(target, propertyKey, receiver) {
+            return createGlobalMethodCall("Reflect", "get", receiver ? [target, propertyKey, receiver] : [target, propertyKey]);
+        }
+        function createReflectSetCall(target, propertyKey, value, receiver) {
+            return createGlobalMethodCall("Reflect", "set", receiver ? [target, propertyKey, value, receiver] : [target, propertyKey, value]);
+        }
         function tryAddPropertyAssignment(properties, propertyName, expression) {
             if (expression) {
                 properties.push(createPropertyAssignment(propertyName, expression));
@@ -24707,11 +25775,11 @@ var ts;
         }
         function updateOuterExpression(outerExpression, expression) {
             switch (outerExpression.kind) {
-                case 207 /* ParenthesizedExpression */: return updateParenthesizedExpression(outerExpression, expression);
-                case 206 /* TypeAssertionExpression */: return updateTypeAssertion(outerExpression, outerExpression.type, expression);
-                case 224 /* AsExpression */: return updateAsExpression(outerExpression, expression, outerExpression.type);
-                case 225 /* NonNullExpression */: return updateNonNullExpression(outerExpression, expression);
-                case 336 /* PartiallyEmittedExpression */: return updatePartiallyEmittedExpression(outerExpression, expression);
+                case 211 /* ParenthesizedExpression */: return updateParenthesizedExpression(outerExpression, expression);
+                case 210 /* TypeAssertionExpression */: return updateTypeAssertion(outerExpression, outerExpression.type, expression);
+                case 228 /* AsExpression */: return updateAsExpression(outerExpression, expression, outerExpression.type);
+                case 229 /* NonNullExpression */: return updateNonNullExpression(outerExpression, expression);
+                case 348 /* PartiallyEmittedExpression */: return updatePartiallyEmittedExpression(outerExpression, expression);
             }
         }
         /**
@@ -24758,20 +25826,20 @@ var ts;
         function shouldBeCapturedInTempVariable(node, cacheIdentifiers) {
             var target = ts.skipParentheses(node);
             switch (target.kind) {
-                case 78 /* Identifier */:
+                case 79 /* Identifier */:
                     return cacheIdentifiers;
-                case 107 /* ThisKeyword */:
+                case 108 /* ThisKeyword */:
                 case 8 /* NumericLiteral */:
                 case 9 /* BigIntLiteral */:
                 case 10 /* StringLiteral */:
                     return false;
-                case 199 /* ArrayLiteralExpression */:
+                case 203 /* ArrayLiteralExpression */:
                     var elements = target.elements;
                     if (elements.length === 0) {
                         return false;
                     }
                     return true;
-                case 200 /* ObjectLiteralExpression */:
+                case 204 /* ObjectLiteralExpression */:
                     return target.properties.length > 0;
                 default:
                     return true;
@@ -24827,6 +25895,23 @@ var ts;
             }
             return { target: target, thisArg: thisArg };
         }
+        function createAssignmentTargetWrapper(paramName, expression) {
+            return createPropertyAccessExpression(
+            // Explicit parens required because of v8 regression (https://bugs.chromium.org/p/v8/issues/detail?id=9560)
+            createParenthesizedExpression(createObjectLiteralExpression([
+                createSetAccessorDeclaration(
+                /*decorators*/ undefined, 
+                /*modifiers*/ undefined, "value", [createParameterDeclaration(
+                    /*decorators*/ undefined, 
+                    /*modifiers*/ undefined, 
+                    /*dotDotDotToken*/ undefined, paramName, 
+                    /*questionToken*/ undefined, 
+                    /*type*/ undefined, 
+                    /*initializer*/ undefined)], createBlock([
+                    createExpressionStatement(expression)
+                ]))
+            ])), "value");
+        }
         function inlineExpressions(expressions) {
             // Avoid deeply nested comma expressions as traversing them during emit can result in "Maximum call
             // stack size exceeded" errors.
@@ -25007,7 +26092,7 @@ var ts;
         function ensureUseStrict(statements) {
             var foundUseStrict = ts.findUseStrictPrologue(statements);
             if (!foundUseStrict) {
-                return ts.setTextRange(createNodeArray(__spreadArray([createUseStrictPrologue()], statements)), statements);
+                return ts.setTextRange(createNodeArray(__spreadArray([createUseStrictPrologue()], statements, true)), statements);
             }
             return statements;
         }
@@ -25074,20 +26159,20 @@ var ts;
             var left = ts.isNodeArray(statements) ? statements.slice() : statements;
             // splice other custom prologues from right into left
             if (rightCustomPrologueEnd > rightHoistedVariablesEnd) {
-                left.splice.apply(left, __spreadArray([leftHoistedVariablesEnd, 0], declarations.slice(rightHoistedVariablesEnd, rightCustomPrologueEnd)));
+                left.splice.apply(left, __spreadArray([leftHoistedVariablesEnd, 0], declarations.slice(rightHoistedVariablesEnd, rightCustomPrologueEnd), false));
             }
             // splice hoisted variables from right into left
             if (rightHoistedVariablesEnd > rightHoistedFunctionsEnd) {
-                left.splice.apply(left, __spreadArray([leftHoistedFunctionsEnd, 0], declarations.slice(rightHoistedFunctionsEnd, rightHoistedVariablesEnd)));
+                left.splice.apply(left, __spreadArray([leftHoistedFunctionsEnd, 0], declarations.slice(rightHoistedFunctionsEnd, rightHoistedVariablesEnd), false));
             }
             // splice hoisted functions from right into left
             if (rightHoistedFunctionsEnd > rightStandardPrologueEnd) {
-                left.splice.apply(left, __spreadArray([leftStandardPrologueEnd, 0], declarations.slice(rightStandardPrologueEnd, rightHoistedFunctionsEnd)));
+                left.splice.apply(left, __spreadArray([leftStandardPrologueEnd, 0], declarations.slice(rightStandardPrologueEnd, rightHoistedFunctionsEnd), false));
             }
             // splice standard prologues from right into left (that are not already in left)
             if (rightStandardPrologueEnd > 0) {
                 if (leftStandardPrologueEnd === 0) {
-                    left.splice.apply(left, __spreadArray([0, 0], declarations.slice(0, rightStandardPrologueEnd)));
+                    left.splice.apply(left, __spreadArray([0, 0], declarations.slice(0, rightStandardPrologueEnd), false));
                 }
                 else {
                     var leftPrologues = new ts.Map();
@@ -25133,9 +26218,9 @@ var ts;
                                                                                 ts.isEnumDeclaration(node) ? updateEnumDeclaration(node, node.decorators, modifiers, node.name, node.members) :
                                                                                     ts.isModuleDeclaration(node) ? updateModuleDeclaration(node, node.decorators, modifiers, node.name, node.body) :
                                                                                         ts.isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, node.decorators, modifiers, node.isTypeOnly, node.name, node.moduleReference) :
-                                                                                            ts.isImportDeclaration(node) ? updateImportDeclaration(node, node.decorators, modifiers, node.importClause, node.moduleSpecifier) :
+                                                                                            ts.isImportDeclaration(node) ? updateImportDeclaration(node, node.decorators, modifiers, node.importClause, node.moduleSpecifier, node.assertClause) :
                                                                                                 ts.isExportAssignment(node) ? updateExportAssignment(node, node.decorators, modifiers, node.expression) :
-                                                                                                    ts.isExportDeclaration(node) ? updateExportDeclaration(node, node.decorators, modifiers, node.isTypeOnly, node.exportClause, node.moduleSpecifier) :
+                                                                                                    ts.isExportDeclaration(node) ? updateExportDeclaration(node, node.decorators, modifiers, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) :
                                                                                                         ts.Debug.assertNever(node);
         }
         function asNodeArray(array) {
@@ -25174,25 +26259,26 @@ var ts;
     }
     function getDefaultTagNameForKind(kind) {
         switch (kind) {
-            case 329 /* JSDocTypeTag */: return "type";
-            case 327 /* JSDocReturnTag */: return "returns";
-            case 328 /* JSDocThisTag */: return "this";
-            case 325 /* JSDocEnumTag */: return "enum";
-            case 317 /* JSDocAuthorTag */: return "author";
-            case 319 /* JSDocClassTag */: return "class";
-            case 320 /* JSDocPublicTag */: return "public";
-            case 321 /* JSDocPrivateTag */: return "private";
-            case 322 /* JSDocProtectedTag */: return "protected";
-            case 323 /* JSDocReadonlyTag */: return "readonly";
-            case 330 /* JSDocTemplateTag */: return "template";
-            case 331 /* JSDocTypedefTag */: return "typedef";
-            case 326 /* JSDocParameterTag */: return "param";
-            case 333 /* JSDocPropertyTag */: return "prop";
-            case 324 /* JSDocCallbackTag */: return "callback";
-            case 315 /* JSDocAugmentsTag */: return "augments";
-            case 316 /* JSDocImplementsTag */: return "implements";
+            case 341 /* JSDocTypeTag */: return "type";
+            case 339 /* JSDocReturnTag */: return "returns";
+            case 340 /* JSDocThisTag */: return "this";
+            case 337 /* JSDocEnumTag */: return "enum";
+            case 328 /* JSDocAuthorTag */: return "author";
+            case 330 /* JSDocClassTag */: return "class";
+            case 331 /* JSDocPublicTag */: return "public";
+            case 332 /* JSDocPrivateTag */: return "private";
+            case 333 /* JSDocProtectedTag */: return "protected";
+            case 334 /* JSDocReadonlyTag */: return "readonly";
+            case 335 /* JSDocOverrideTag */: return "override";
+            case 342 /* JSDocTemplateTag */: return "template";
+            case 343 /* JSDocTypedefTag */: return "typedef";
+            case 338 /* JSDocParameterTag */: return "param";
+            case 345 /* JSDocPropertyTag */: return "prop";
+            case 336 /* JSDocCallbackTag */: return "callback";
+            case 326 /* JSDocAugmentsTag */: return "augments";
+            case 327 /* JSDocImplementsTag */: return "implements";
             default:
-                return ts.Debug.fail("Unsupported kind: " + ts.Debug.formatSyntaxKind(kind));
+                return ts.Debug.fail("Unsupported kind: ".concat(ts.Debug.formatSyntaxKind(kind)));
         }
     }
     var rawTextScanner;
@@ -25218,7 +26304,7 @@ var ts;
                 break;
         }
         var token = rawTextScanner.scan();
-        if (token === 23 /* CloseBracketToken */) {
+        if (token === 19 /* CloseBraceToken */) {
             token = rawTextScanner.reScanTemplateToken(/*isTaggedTemplate*/ false);
         }
         if (rawTextScanner.isUnterminated()) {
@@ -25243,10 +26329,10 @@ var ts;
     }
     function propagateIdentifierNameFlags(node) {
         // An IdentifierName is allowed to be `await`
-        return propagateChildFlags(node) & ~8388608 /* ContainsPossibleTopLevelAwait */;
+        return propagateChildFlags(node) & ~16777216 /* ContainsPossibleTopLevelAwait */;
     }
     function propagatePropertyNameFlagsOfChild(node, transformFlags) {
-        return transformFlags | (node.transformFlags & 4096 /* PropertyNamePropagatingFlags */);
+        return transformFlags | (node.transformFlags & 33562624 /* PropertyNamePropagatingFlags */);
     }
     function propagateChildFlags(child) {
         if (!child)
@@ -25270,69 +26356,69 @@ var ts;
      */
     /* @internal */
     function getTransformFlagsSubtreeExclusions(kind) {
-        if (kind >= 172 /* FirstTypeNode */ && kind <= 195 /* LastTypeNode */) {
+        if (kind >= 176 /* FirstTypeNode */ && kind <= 199 /* LastTypeNode */) {
             return -2 /* TypeExcludes */;
         }
         switch (kind) {
-            case 203 /* CallExpression */:
-            case 204 /* NewExpression */:
-            case 199 /* ArrayLiteralExpression */:
-                return 536879104 /* ArrayLiteralOrCallOrNewExcludes */;
-            case 256 /* ModuleDeclaration */:
-                return 546379776 /* ModuleExcludes */;
-            case 160 /* Parameter */:
+            case 207 /* CallExpression */:
+            case 208 /* NewExpression */:
+            case 203 /* ArrayLiteralExpression */:
+                return 536887296 /* ArrayLiteralOrCallOrNewExcludes */;
+            case 260 /* ModuleDeclaration */:
+                return 589443072 /* ModuleExcludes */;
+            case 163 /* Parameter */:
                 return 536870912 /* ParameterExcludes */;
-            case 209 /* ArrowFunction */:
-                return 547309568 /* ArrowFunctionExcludes */;
-            case 208 /* FunctionExpression */:
-            case 251 /* FunctionDeclaration */:
-                return 547313664 /* FunctionExcludes */;
-            case 250 /* VariableDeclarationList */:
-                return 537018368 /* VariableDeclarationListExcludes */;
-            case 252 /* ClassDeclaration */:
-            case 221 /* ClassExpression */:
-                return 536905728 /* ClassExcludes */;
-            case 166 /* Constructor */:
-                return 547311616 /* ConstructorExcludes */;
-            case 163 /* PropertyDeclaration */:
-                return 536875008 /* PropertyExcludes */;
-            case 165 /* MethodDeclaration */:
-            case 167 /* GetAccessor */:
-            case 168 /* SetAccessor */:
-                return 538923008 /* MethodOrAccessorExcludes */;
-            case 128 /* AnyKeyword */:
-            case 144 /* NumberKeyword */:
-            case 155 /* BigIntKeyword */:
-            case 141 /* NeverKeyword */:
-            case 147 /* StringKeyword */:
-            case 145 /* ObjectKeyword */:
-            case 131 /* BooleanKeyword */:
-            case 148 /* SymbolKeyword */:
-            case 113 /* VoidKeyword */:
-            case 159 /* TypeParameter */:
-            case 162 /* PropertySignature */:
-            case 164 /* MethodSignature */:
-            case 169 /* CallSignature */:
-            case 170 /* ConstructSignature */:
-            case 171 /* IndexSignature */:
-            case 253 /* InterfaceDeclaration */:
-            case 254 /* TypeAliasDeclaration */:
+            case 213 /* ArrowFunction */:
+                return 557748224 /* ArrowFunctionExcludes */;
+            case 212 /* FunctionExpression */:
+            case 255 /* FunctionDeclaration */:
+                return 591310848 /* FunctionExcludes */;
+            case 254 /* VariableDeclarationList */:
+                return 537165824 /* VariableDeclarationListExcludes */;
+            case 256 /* ClassDeclaration */:
+            case 225 /* ClassExpression */:
+                return 536940544 /* ClassExcludes */;
+            case 170 /* Constructor */:
+                return 591306752 /* ConstructorExcludes */;
+            case 166 /* PropertyDeclaration */:
+                return 570433536 /* PropertyExcludes */;
+            case 168 /* MethodDeclaration */:
+            case 171 /* GetAccessor */:
+            case 172 /* SetAccessor */:
+                return 574529536 /* MethodOrAccessorExcludes */;
+            case 130 /* AnyKeyword */:
+            case 146 /* NumberKeyword */:
+            case 157 /* BigIntKeyword */:
+            case 143 /* NeverKeyword */:
+            case 149 /* StringKeyword */:
+            case 147 /* ObjectKeyword */:
+            case 133 /* BooleanKeyword */:
+            case 150 /* SymbolKeyword */:
+            case 114 /* VoidKeyword */:
+            case 162 /* TypeParameter */:
+            case 165 /* PropertySignature */:
+            case 167 /* MethodSignature */:
+            case 173 /* CallSignature */:
+            case 174 /* ConstructSignature */:
+            case 175 /* IndexSignature */:
+            case 257 /* InterfaceDeclaration */:
+            case 258 /* TypeAliasDeclaration */:
                 return -2 /* TypeExcludes */;
-            case 200 /* ObjectLiteralExpression */:
-                return 536922112 /* ObjectLiteralExcludes */;
-            case 287 /* CatchClause */:
-                return 536887296 /* CatchClauseExcludes */;
-            case 196 /* ObjectBindingPattern */:
-            case 197 /* ArrayBindingPattern */:
-                return 536879104 /* BindingPatternExcludes */;
-            case 206 /* TypeAssertionExpression */:
-            case 224 /* AsExpression */:
-            case 336 /* PartiallyEmittedExpression */:
-            case 207 /* ParenthesizedExpression */:
-            case 105 /* SuperKeyword */:
+            case 204 /* ObjectLiteralExpression */:
+                return 536973312 /* ObjectLiteralExcludes */;
+            case 291 /* CatchClause */:
+                return 536903680 /* CatchClauseExcludes */;
+            case 200 /* ObjectBindingPattern */:
+            case 201 /* ArrayBindingPattern */:
+                return 536887296 /* BindingPatternExcludes */;
+            case 210 /* TypeAssertionExpression */:
+            case 228 /* AsExpression */:
+            case 348 /* PartiallyEmittedExpression */:
+            case 211 /* ParenthesizedExpression */:
+            case 106 /* SuperKeyword */:
                 return 536870912 /* OuterExpressionExcludes */;
-            case 201 /* PropertyAccessExpression */:
-            case 202 /* ElementAccessExpression */:
+            case 205 /* PropertyAccessExpression */:
+            case 206 /* ElementAccessExpression */:
                 return 536870912 /* PropertyAccessExcludes */;
             default:
                 return 536870912 /* NodeExcludes */;
@@ -25520,7 +26606,7 @@ var ts;
             };
             var definedTextGetter_1 = function (path) {
                 var result = textGetter_1(path);
-                return result !== undefined ? result : "/* Input file " + path + " was missing */\r\n";
+                return result !== undefined ? result : "/* Input file ".concat(path, " was missing */\r\n");
             };
             var buildInfo_1;
             var getAndCacheBuildInfo_1 = function (getText) {
@@ -25589,7 +26675,7 @@ var ts;
         if (trailingComments)
             destEmitNode.trailingComments = ts.addRange(trailingComments.slice(), destEmitNode.trailingComments);
         if (flags)
-            destEmitNode.flags = flags;
+            destEmitNode.flags = flags & ~268435456 /* Immutable */;
         if (commentRange)
             destEmitNode.commentRange = commentRange;
         if (sourceMapRange)
@@ -25631,7 +26717,7 @@ var ts;
                 // To avoid holding onto transformation artifacts, we keep track of any
                 // parse tree node we are annotating. This allows us to clean them up after
                 // all transformations have completed.
-                if (node.kind === 297 /* SourceFile */) {
+                if (node.kind === 303 /* SourceFile */) {
                     return node.emitNode = { annotatedNodes: [node] };
                 }
                 var sourceFile = (_a = ts.getSourceFileOfNode(ts.getParseTreeNode(ts.getSourceFileOfNode(node)))) !== null && _a !== void 0 ? _a : ts.Debug.fail("Could not determine parsed source file.");
@@ -25639,6 +26725,9 @@ var ts;
             }
             node.emitNode = {};
         }
+        else {
+            ts.Debug.assert(!(node.emitNode.flags & 268435456 /* Immutable */), "Invalid attempt to mutate an immutable node.");
+        }
         return node.emitNode;
     }
     ts.getOrCreateEmitNode = getOrCreateEmitNode;
@@ -25884,6 +26973,25 @@ var ts;
         }
     }
     ts.moveEmitHelpers = moveEmitHelpers;
+    /**
+     * Gets the SnippetElement of a node.
+     */
+    /* @internal */
+    function getSnippetElement(node) {
+        var _a;
+        return (_a = node.emitNode) === null || _a === void 0 ? void 0 : _a.snippetElement;
+    }
+    ts.getSnippetElement = getSnippetElement;
+    /**
+     * Sets the SnippetElement of a node.
+     */
+    /* @internal */
+    function setSnippetElement(node, snippet) {
+        var emitNode = getOrCreateEmitNode(node);
+        emitNode.snippetElement = snippet;
+        return node;
+    }
+    ts.setSnippetElement = setSnippetElement;
     /* @internal */
     function ignoreSourceNewlines(node) {
         getOrCreateEmitNode(node).flags |= 134217728 /* IgnoreSourceNewlines */;
@@ -25896,6 +27004,8 @@ var ts;
 (function (ts) {
     function createEmitHelperFactory(context) {
         var factory = context.factory;
+        var immutableTrue = ts.memoize(function () { return ts.setEmitFlags(factory.createTrue(), 268435456 /* Immutable */); });
+        var immutableFalse = ts.memoize(function () { return ts.setEmitFlags(factory.createFalse(), 268435456 /* Immutable */); });
         return {
             getUnscopedHelperName: getUnscopedHelperName,
             // TypeScript Helpers
@@ -25930,6 +27040,7 @@ var ts;
             // Class Fields Helpers
             createClassPrivateFieldGetHelper: createClassPrivateFieldGetHelper,
             createClassPrivateFieldSetHelper: createClassPrivateFieldSetHelper,
+            createClassPrivateFieldInHelper: createClassPrivateFieldInHelper
         };
         /**
          * Gets an identifier for the name of an *unscoped* emit helper.
@@ -25970,7 +27081,7 @@ var ts;
         }
         // ES2018 Helpers
         function createAssignHelper(attributesSegments) {
-            if (context.getCompilerOptions().target >= 2 /* ES2015 */) {
+            if (ts.getEmitScriptTarget(context.getCompilerOptions()) >= 2 /* ES2015 */) {
                 return factory.createCallExpression(factory.createPropertyAccessExpression(factory.createIdentifier("Object"), "assign"), 
                 /*typeArguments*/ undefined, attributesSegments);
             }
@@ -26066,10 +27177,10 @@ var ts;
             return factory.createCallExpression(getUnscopedHelperName("__makeTemplateObject"), 
             /*typeArguments*/ undefined, [cooked, raw]);
         }
-        function createSpreadArrayHelper(to, from) {
+        function createSpreadArrayHelper(to, from, packFrom) {
             context.requestEmitHelper(ts.spreadArrayHelper);
             return factory.createCallExpression(getUnscopedHelperName("__spreadArray"), 
-            /*typeArguments*/ undefined, [to, from]);
+            /*typeArguments*/ undefined, [to, from, packFrom ? immutableTrue() : immutableFalse()]);
         }
         // ES2015 Destructuring Helpers
         function createValuesHelper(expression) {
@@ -26094,7 +27205,7 @@ var ts;
         function createCreateBindingHelper(module, inputName, outputName) {
             context.requestEmitHelper(ts.createBindingHelper);
             return factory.createCallExpression(getUnscopedHelperName("__createBinding"), 
-            /*typeArguments*/ undefined, __spreadArray([factory.createIdentifier("exports"), module, inputName], (outputName ? [outputName] : [])));
+            /*typeArguments*/ undefined, __spreadArray([factory.createIdentifier("exports"), module, inputName], (outputName ? [outputName] : []), true));
         }
         function createImportStarHelper(expression) {
             context.requestEmitHelper(ts.importStarHelper);
@@ -26118,13 +27229,31 @@ var ts;
             /*typeArguments*/ undefined, [moduleExpression, exportsExpression]);
         }
         // Class Fields Helpers
-        function createClassPrivateFieldGetHelper(receiver, privateField) {
+        function createClassPrivateFieldGetHelper(receiver, state, kind, f) {
             context.requestEmitHelper(ts.classPrivateFieldGetHelper);
-            return factory.createCallExpression(getUnscopedHelperName("__classPrivateFieldGet"), /*typeArguments*/ undefined, [receiver, privateField]);
+            var args;
+            if (!f) {
+                args = [receiver, state, factory.createStringLiteral(kind)];
+            }
+            else {
+                args = [receiver, state, factory.createStringLiteral(kind), f];
+            }
+            return factory.createCallExpression(getUnscopedHelperName("__classPrivateFieldGet"), /*typeArguments*/ undefined, args);
         }
-        function createClassPrivateFieldSetHelper(receiver, privateField, value) {
+        function createClassPrivateFieldSetHelper(receiver, state, value, kind, f) {
             context.requestEmitHelper(ts.classPrivateFieldSetHelper);
-            return factory.createCallExpression(getUnscopedHelperName("__classPrivateFieldSet"), /*typeArguments*/ undefined, [receiver, privateField, value]);
+            var args;
+            if (!f) {
+                args = [receiver, state, value, factory.createStringLiteral(kind)];
+            }
+            else {
+                args = [receiver, state, value, factory.createStringLiteral(kind), f];
+            }
+            return factory.createCallExpression(getUnscopedHelperName("__classPrivateFieldSet"), /*typeArguments*/ undefined, args);
+        }
+        function createClassPrivateFieldInHelper(state, receiver) {
+            context.requestEmitHelper(ts.classPrivateFieldInHelper);
+            return factory.createCallExpression(getUnscopedHelperName("__classPrivateFieldIn"), /* typeArguments*/ undefined, [state, receiver]);
         }
     }
     ts.createEmitHelperFactory = createEmitHelperFactory;
@@ -26257,7 +27386,7 @@ var ts;
         name: "typescript:spreadArray",
         importName: "__spreadArray",
         scoped: false,
-        text: "\n            var __spreadArray = (this && this.__spreadArray) || function (to, from) {\n                for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n                    to[j] = from[i];\n                return to;\n            };"
+        text: "\n            var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n                if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n                    if (ar || !(i in from)) {\n                        if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n                        ar[i] = from[i];\n                    }\n                }\n                return to.concat(ar || Array.prototype.slice.call(from));\n            };"
     };
     // ES2015 Destructuring Helpers
     ts.valuesHelper = {
@@ -26364,7 +27493,6 @@ var ts;
         scoped: false,
         text: "\n            var __importDefault = (this && this.__importDefault) || function (mod) {\n                return (mod && mod.__esModule) ? mod : { \"default\": mod };\n            };"
     };
-    // emit output for the __export helper function
     ts.exportStarHelper = {
         name: "typescript:export-star",
         importName: "__exportStar",
@@ -26373,18 +27501,134 @@ var ts;
         priority: 2,
         text: "\n            var __exportStar = (this && this.__exportStar) || function(m, exports) {\n                for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n            };"
     };
-    // Class fields helpers
+    /**
+     * Parameters:
+     *  @param receiver â€” The object from which the private member will be read.
+     *  @param state â€” One of the following:
+     *      - A WeakMap used to read a private instance field.
+     *      - A WeakSet used as an instance brand for private instance methods and accessors.
+     *      - A function value that should be the undecorated class constructor used to brand check private static fields, methods, and accessors.
+     *  @param kind â€” (optional pre TS 4.3, required for TS 4.3+) One of the following values:
+     *      - undefined â€” Indicates a private instance field (pre TS 4.3).
+     *      - "f" â€” Indicates a private field (instance or static).
+     *      - "m" â€” Indicates a private method (instance or static).
+     *      - "a" â€” Indicates a private accessor (instance or static).
+     *  @param f â€” (optional pre TS 4.3) Depends on the arguments for state and kind:
+     *      - If kind is "m", this should be the function corresponding to the static or instance method.
+     *      - If kind is "a", this should be the function corresponding to the getter method, or undefined if the getter was not defined.
+     *      - If kind is "f" and state is a function, this should be an object holding the value of a static field, or undefined if the static field declaration has not yet been evaluated.
+     * Usage:
+     * This helper will only ever be used by the compiler in the following ways:
+     *
+     * Reading from a private instance field (pre TS 4.3):
+     *      __classPrivateFieldGet(<any>, <WeakMap>)
+     *
+     * Reading from a private instance field (TS 4.3+):
+     *      __classPrivateFieldGet(<any>, <WeakMap>, "f")
+     *
+     * Reading from a private instance get accessor (when defined, TS 4.3+):
+     *      __classPrivateFieldGet(<any>, <WeakSet>, "a", <function>)
+     *
+     * Reading from a private instance get accessor (when not defined, TS 4.3+):
+     *      __classPrivateFieldGet(<any>, <WeakSet>, "a", void 0)
+     *      NOTE: This always results in a runtime error.
+     *
+     * Reading from a private instance method (TS 4.3+):
+     *      __classPrivateFieldGet(<any>, <WeakSet>, "m", <function>)
+     *
+     * Reading from a private static field (TS 4.3+):
+     *      __classPrivateFieldGet(<any>, <constructor>, "f", <{ value: any }>)
+     *
+     * Reading from a private static get accessor (when defined, TS 4.3+):
+     *      __classPrivateFieldGet(<any>, <constructor>, "a", <function>)
+     *
+     * Reading from a private static get accessor (when not defined, TS 4.3+):
+     *      __classPrivateFieldGet(<any>, <constructor>, "a", void 0)
+     *      NOTE: This always results in a runtime error.
+     *
+     * Reading from a private static method (TS 4.3+):
+     *      __classPrivateFieldGet(<any>, <constructor>, "m", <function>)
+     */
     ts.classPrivateFieldGetHelper = {
         name: "typescript:classPrivateFieldGet",
         importName: "__classPrivateFieldGet",
         scoped: false,
-        text: "\n            var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) {\n                if (!privateMap.has(receiver)) {\n                    throw new TypeError(\"attempted to get private field on non-instance\");\n                }\n                return privateMap.get(receiver);\n            };"
+        text: "\n            var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n                if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n                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\");\n                return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n            };"
     };
+    /**
+     * Parameters:
+     *  @param receiver â€” The object on which the private member will be set.
+     *  @param state â€” One of the following:
+     *      - A WeakMap used to store a private instance field.
+     *      - A WeakSet used as an instance brand for private instance methods and accessors.
+     *      - A function value that should be the undecorated class constructor used to brand check private static fields, methods, and accessors.
+     *  @param value â€” The value to set.
+     *  @param kind â€” (optional pre TS 4.3, required for TS 4.3+) One of the following values:
+     *       - undefined â€” Indicates a private instance field (pre TS 4.3).
+     *       - "f" â€” Indicates a private field (instance or static).
+     *       - "m" â€” Indicates a private method (instance or static).
+     *       - "a" â€” Indicates a private accessor (instance or static).
+     *   @param f â€” (optional pre TS 4.3) Depends on the arguments for state and kind:
+     *       - If kind is "m", this should be the function corresponding to the static or instance method.
+     *       - If kind is "a", this should be the function corresponding to the setter method, or undefined if the setter was not defined.
+     *       - If kind is "f" and state is a function, this should be an object holding the value of a static field, or undefined if the static field declaration has not yet been evaluated.
+     * Usage:
+     * This helper will only ever be used by the compiler in the following ways:
+     *
+     * Writing to a private instance field (pre TS 4.3):
+     *      __classPrivateFieldSet(<any>, <WeakMap>, <any>)
+     *
+     * Writing to a private instance field (TS 4.3+):
+     *      __classPrivateFieldSet(<any>, <WeakMap>, <any>, "f")
+     *
+     * Writing to a private instance set accessor (when defined, TS 4.3+):
+     *      __classPrivateFieldSet(<any>, <WeakSet>, <any>, "a", <function>)
+     *
+     * Writing to a private instance set accessor (when not defined, TS 4.3+):
+     *      __classPrivateFieldSet(<any>, <WeakSet>, <any>, "a", void 0)
+     *      NOTE: This always results in a runtime error.
+     *
+     * Writing to a private instance method (TS 4.3+):
+     *      __classPrivateFieldSet(<any>, <WeakSet>, <any>, "m", <function>)
+     *      NOTE: This always results in a runtime error.
+     *
+     * Writing to a private static field (TS 4.3+):
+     *      __classPrivateFieldSet(<any>, <constructor>, <any>, "f", <{ value: any }>)
+     *
+     * Writing to a private static set accessor (when defined, TS 4.3+):
+     *      __classPrivateFieldSet(<any>, <constructor>, <any>, "a", <function>)
+     *
+     * Writing to a private static set accessor (when not defined, TS 4.3+):
+     *      __classPrivateFieldSet(<any>, <constructor>, <any>, "a", void 0)
+     *      NOTE: This always results in a runtime error.
+     *
+     * Writing to a private static method (TS 4.3+):
+     *      __classPrivateFieldSet(<any>, <constructor>, <any>, "m", <function>)
+     *      NOTE: This always results in a runtime error.
+     */
     ts.classPrivateFieldSetHelper = {
         name: "typescript:classPrivateFieldSet",
         importName: "__classPrivateFieldSet",
         scoped: false,
-        text: "\n            var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) {\n                if (!privateMap.has(receiver)) {\n                    throw new TypeError(\"attempted to set private field on non-instance\");\n                }\n                privateMap.set(receiver, value);\n                return value;\n            };"
+        text: "\n            var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n                if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n                if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n                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\");\n                return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n            };"
+    };
+    /**
+     * Parameters:
+     *  @param state â€” One of the following:
+     *      - A WeakMap when the member is a private instance field.
+     *      - A WeakSet when the member is a private instance method or accessor.
+     *      - A function value that should be the undecorated class constructor when the member is a private static field, method, or accessor.
+     *  @param receiver â€” The object being checked if it has the private member.
+     *
+     * Usage:
+     * This helper is used to transform `#field in expression` to
+     *      `__classPrivateFieldIn(<weakMap/weakSet/constructor>, expression)`
+     */
+    ts.classPrivateFieldInHelper = {
+        name: "typescript:classPrivateFieldIn",
+        importName: "__classPrivateFieldIn",
+        scoped: false,
+        text: "\n            var __classPrivateFieldIn = (this && this.__classPrivateFieldIn) || function(state, receiver) {\n                if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n                return typeof state === \"function\" ? receiver === state : state.has(receiver);\n            };"
     };
     var allUnscopedEmitHelpers;
     function getAllUnscopedEmitHelpers() {
@@ -26410,6 +27654,7 @@ var ts;
             ts.exportStarHelper,
             ts.classPrivateFieldGetHelper,
             ts.classPrivateFieldSetHelper,
+            ts.classPrivateFieldInHelper,
             ts.createBindingHelper,
             ts.setModuleDefaultHelper
         ], function (helper) { return helper.name; }));
@@ -26428,7 +27673,7 @@ var ts;
     function isCallToHelper(firstSegment, helperName) {
         return ts.isCallExpression(firstSegment)
             && ts.isIdentifier(firstSegment.expression)
-            && (ts.getEmitFlags(firstSegment.expression) & 4096 /* HelperName */)
+            && (ts.getEmitFlags(firstSegment.expression) & 4096 /* HelperName */) !== 0
             && firstSegment.expression.escapedText === helperName;
     }
     ts.isCallToHelper = isCallToHelper;
@@ -26473,626 +27718,705 @@ var ts;
         return node.kind === 17 /* TemplateTail */;
     }
     ts.isTemplateTail = isTemplateTail;
+    // Punctuation
+    function isDotDotDotToken(node) {
+        return node.kind === 25 /* DotDotDotToken */;
+    }
+    ts.isDotDotDotToken = isDotDotDotToken;
+    /*@internal*/
+    function isCommaToken(node) {
+        return node.kind === 27 /* CommaToken */;
+    }
+    ts.isCommaToken = isCommaToken;
+    function isPlusToken(node) {
+        return node.kind === 39 /* PlusToken */;
+    }
+    ts.isPlusToken = isPlusToken;
+    function isMinusToken(node) {
+        return node.kind === 40 /* MinusToken */;
+    }
+    ts.isMinusToken = isMinusToken;
+    function isAsteriskToken(node) {
+        return node.kind === 41 /* AsteriskToken */;
+    }
+    ts.isAsteriskToken = isAsteriskToken;
+    /*@internal*/
+    function isExclamationToken(node) {
+        return node.kind === 53 /* ExclamationToken */;
+    }
+    ts.isExclamationToken = isExclamationToken;
+    /*@internal*/
+    function isQuestionToken(node) {
+        return node.kind === 57 /* QuestionToken */;
+    }
+    ts.isQuestionToken = isQuestionToken;
+    /*@internal*/
+    function isColonToken(node) {
+        return node.kind === 58 /* ColonToken */;
+    }
+    ts.isColonToken = isColonToken;
+    /*@internal*/
+    function isQuestionDotToken(node) {
+        return node.kind === 28 /* QuestionDotToken */;
+    }
+    ts.isQuestionDotToken = isQuestionDotToken;
+    /*@internal*/
+    function isEqualsGreaterThanToken(node) {
+        return node.kind === 38 /* EqualsGreaterThanToken */;
+    }
+    ts.isEqualsGreaterThanToken = isEqualsGreaterThanToken;
     // Identifiers
     function isIdentifier(node) {
-        return node.kind === 78 /* Identifier */;
+        return node.kind === 79 /* Identifier */;
     }
     ts.isIdentifier = isIdentifier;
-    // Names
-    function isQualifiedName(node) {
-        return node.kind === 157 /* QualifiedName */;
-    }
-    ts.isQualifiedName = isQualifiedName;
-    function isComputedPropertyName(node) {
-        return node.kind === 158 /* ComputedPropertyName */;
-    }
-    ts.isComputedPropertyName = isComputedPropertyName;
     function isPrivateIdentifier(node) {
-        return node.kind === 79 /* PrivateIdentifier */;
+        return node.kind === 80 /* PrivateIdentifier */;
     }
     ts.isPrivateIdentifier = isPrivateIdentifier;
-    // Tokens
+    // Reserved Words
+    /* @internal */
+    function isExportModifier(node) {
+        return node.kind === 93 /* ExportKeyword */;
+    }
+    ts.isExportModifier = isExportModifier;
+    /* @internal */
+    function isAsyncModifier(node) {
+        return node.kind === 131 /* AsyncKeyword */;
+    }
+    ts.isAsyncModifier = isAsyncModifier;
+    /* @internal */
+    function isAssertsKeyword(node) {
+        return node.kind === 128 /* AssertsKeyword */;
+    }
+    ts.isAssertsKeyword = isAssertsKeyword;
+    /* @internal */
+    function isAwaitKeyword(node) {
+        return node.kind === 132 /* AwaitKeyword */;
+    }
+    ts.isAwaitKeyword = isAwaitKeyword;
+    /* @internal */
+    function isReadonlyKeyword(node) {
+        return node.kind === 144 /* ReadonlyKeyword */;
+    }
+    ts.isReadonlyKeyword = isReadonlyKeyword;
+    /* @internal */
+    function isStaticModifier(node) {
+        return node.kind === 124 /* StaticKeyword */;
+    }
+    ts.isStaticModifier = isStaticModifier;
+    /* @internal */
+    function isAbstractModifier(node) {
+        return node.kind === 126 /* AbstractKeyword */;
+    }
+    ts.isAbstractModifier = isAbstractModifier;
     /*@internal*/
     function isSuperKeyword(node) {
-        return node.kind === 105 /* SuperKeyword */;
+        return node.kind === 106 /* SuperKeyword */;
     }
     ts.isSuperKeyword = isSuperKeyword;
     /*@internal*/
     function isImportKeyword(node) {
-        return node.kind === 99 /* ImportKeyword */;
+        return node.kind === 100 /* ImportKeyword */;
     }
     ts.isImportKeyword = isImportKeyword;
-    /*@internal*/
-    function isCommaToken(node) {
-        return node.kind === 27 /* CommaToken */;
-    }
-    ts.isCommaToken = isCommaToken;
-    /*@internal*/
-    function isQuestionToken(node) {
-        return node.kind === 57 /* QuestionToken */;
+    // Names
+    function isQualifiedName(node) {
+        return node.kind === 160 /* QualifiedName */;
     }
-    ts.isQuestionToken = isQuestionToken;
-    /*@internal*/
-    function isExclamationToken(node) {
-        return node.kind === 53 /* ExclamationToken */;
+    ts.isQualifiedName = isQualifiedName;
+    function isComputedPropertyName(node) {
+        return node.kind === 161 /* ComputedPropertyName */;
     }
-    ts.isExclamationToken = isExclamationToken;
+    ts.isComputedPropertyName = isComputedPropertyName;
     // Signature elements
     function isTypeParameterDeclaration(node) {
-        return node.kind === 159 /* TypeParameter */;
+        return node.kind === 162 /* TypeParameter */;
     }
     ts.isTypeParameterDeclaration = isTypeParameterDeclaration;
     // TODO(rbuckton): Rename to 'isParameterDeclaration'
     function isParameter(node) {
-        return node.kind === 160 /* Parameter */;
+        return node.kind === 163 /* Parameter */;
     }
     ts.isParameter = isParameter;
     function isDecorator(node) {
-        return node.kind === 161 /* Decorator */;
+        return node.kind === 164 /* Decorator */;
     }
     ts.isDecorator = isDecorator;
     // TypeMember
     function isPropertySignature(node) {
-        return node.kind === 162 /* PropertySignature */;
+        return node.kind === 165 /* PropertySignature */;
     }
     ts.isPropertySignature = isPropertySignature;
     function isPropertyDeclaration(node) {
-        return node.kind === 163 /* PropertyDeclaration */;
+        return node.kind === 166 /* PropertyDeclaration */;
     }
     ts.isPropertyDeclaration = isPropertyDeclaration;
     function isMethodSignature(node) {
-        return node.kind === 164 /* MethodSignature */;
+        return node.kind === 167 /* MethodSignature */;
     }
     ts.isMethodSignature = isMethodSignature;
     function isMethodDeclaration(node) {
-        return node.kind === 165 /* MethodDeclaration */;
+        return node.kind === 168 /* MethodDeclaration */;
     }
     ts.isMethodDeclaration = isMethodDeclaration;
+    function isClassStaticBlockDeclaration(node) {
+        return node.kind === 169 /* ClassStaticBlockDeclaration */;
+    }
+    ts.isClassStaticBlockDeclaration = isClassStaticBlockDeclaration;
     function isConstructorDeclaration(node) {
-        return node.kind === 166 /* Constructor */;
+        return node.kind === 170 /* Constructor */;
     }
     ts.isConstructorDeclaration = isConstructorDeclaration;
     function isGetAccessorDeclaration(node) {
-        return node.kind === 167 /* GetAccessor */;
+        return node.kind === 171 /* GetAccessor */;
     }
     ts.isGetAccessorDeclaration = isGetAccessorDeclaration;
     function isSetAccessorDeclaration(node) {
-        return node.kind === 168 /* SetAccessor */;
+        return node.kind === 172 /* SetAccessor */;
     }
     ts.isSetAccessorDeclaration = isSetAccessorDeclaration;
     function isCallSignatureDeclaration(node) {
-        return node.kind === 169 /* CallSignature */;
+        return node.kind === 173 /* CallSignature */;
     }
     ts.isCallSignatureDeclaration = isCallSignatureDeclaration;
     function isConstructSignatureDeclaration(node) {
-        return node.kind === 170 /* ConstructSignature */;
+        return node.kind === 174 /* ConstructSignature */;
     }
     ts.isConstructSignatureDeclaration = isConstructSignatureDeclaration;
     function isIndexSignatureDeclaration(node) {
-        return node.kind === 171 /* IndexSignature */;
+        return node.kind === 175 /* IndexSignature */;
     }
     ts.isIndexSignatureDeclaration = isIndexSignatureDeclaration;
     // Type
     function isTypePredicateNode(node) {
-        return node.kind === 172 /* TypePredicate */;
+        return node.kind === 176 /* TypePredicate */;
     }
     ts.isTypePredicateNode = isTypePredicateNode;
     function isTypeReferenceNode(node) {
-        return node.kind === 173 /* TypeReference */;
+        return node.kind === 177 /* TypeReference */;
     }
     ts.isTypeReferenceNode = isTypeReferenceNode;
     function isFunctionTypeNode(node) {
-        return node.kind === 174 /* FunctionType */;
+        return node.kind === 178 /* FunctionType */;
     }
     ts.isFunctionTypeNode = isFunctionTypeNode;
     function isConstructorTypeNode(node) {
-        return node.kind === 175 /* ConstructorType */;
+        return node.kind === 179 /* ConstructorType */;
     }
     ts.isConstructorTypeNode = isConstructorTypeNode;
     function isTypeQueryNode(node) {
-        return node.kind === 176 /* TypeQuery */;
+        return node.kind === 180 /* TypeQuery */;
     }
     ts.isTypeQueryNode = isTypeQueryNode;
     function isTypeLiteralNode(node) {
-        return node.kind === 177 /* TypeLiteral */;
+        return node.kind === 181 /* TypeLiteral */;
     }
     ts.isTypeLiteralNode = isTypeLiteralNode;
     function isArrayTypeNode(node) {
-        return node.kind === 178 /* ArrayType */;
+        return node.kind === 182 /* ArrayType */;
     }
     ts.isArrayTypeNode = isArrayTypeNode;
     function isTupleTypeNode(node) {
-        return node.kind === 179 /* TupleType */;
+        return node.kind === 183 /* TupleType */;
     }
     ts.isTupleTypeNode = isTupleTypeNode;
     function isNamedTupleMember(node) {
-        return node.kind === 192 /* NamedTupleMember */;
+        return node.kind === 196 /* NamedTupleMember */;
     }
     ts.isNamedTupleMember = isNamedTupleMember;
     function isOptionalTypeNode(node) {
-        return node.kind === 180 /* OptionalType */;
+        return node.kind === 184 /* OptionalType */;
     }
     ts.isOptionalTypeNode = isOptionalTypeNode;
     function isRestTypeNode(node) {
-        return node.kind === 181 /* RestType */;
+        return node.kind === 185 /* RestType */;
     }
     ts.isRestTypeNode = isRestTypeNode;
     function isUnionTypeNode(node) {
-        return node.kind === 182 /* UnionType */;
+        return node.kind === 186 /* UnionType */;
     }
     ts.isUnionTypeNode = isUnionTypeNode;
     function isIntersectionTypeNode(node) {
-        return node.kind === 183 /* IntersectionType */;
+        return node.kind === 187 /* IntersectionType */;
     }
     ts.isIntersectionTypeNode = isIntersectionTypeNode;
     function isConditionalTypeNode(node) {
-        return node.kind === 184 /* ConditionalType */;
+        return node.kind === 188 /* ConditionalType */;
     }
     ts.isConditionalTypeNode = isConditionalTypeNode;
     function isInferTypeNode(node) {
-        return node.kind === 185 /* InferType */;
+        return node.kind === 189 /* InferType */;
     }
     ts.isInferTypeNode = isInferTypeNode;
     function isParenthesizedTypeNode(node) {
-        return node.kind === 186 /* ParenthesizedType */;
+        return node.kind === 190 /* ParenthesizedType */;
     }
     ts.isParenthesizedTypeNode = isParenthesizedTypeNode;
     function isThisTypeNode(node) {
-        return node.kind === 187 /* ThisType */;
+        return node.kind === 191 /* ThisType */;
     }
     ts.isThisTypeNode = isThisTypeNode;
     function isTypeOperatorNode(node) {
-        return node.kind === 188 /* TypeOperator */;
+        return node.kind === 192 /* TypeOperator */;
     }
     ts.isTypeOperatorNode = isTypeOperatorNode;
     function isIndexedAccessTypeNode(node) {
-        return node.kind === 189 /* IndexedAccessType */;
+        return node.kind === 193 /* IndexedAccessType */;
     }
     ts.isIndexedAccessTypeNode = isIndexedAccessTypeNode;
     function isMappedTypeNode(node) {
-        return node.kind === 190 /* MappedType */;
+        return node.kind === 194 /* MappedType */;
     }
     ts.isMappedTypeNode = isMappedTypeNode;
     function isLiteralTypeNode(node) {
-        return node.kind === 191 /* LiteralType */;
+        return node.kind === 195 /* LiteralType */;
     }
     ts.isLiteralTypeNode = isLiteralTypeNode;
     function isImportTypeNode(node) {
-        return node.kind === 195 /* ImportType */;
+        return node.kind === 199 /* ImportType */;
     }
     ts.isImportTypeNode = isImportTypeNode;
     function isTemplateLiteralTypeSpan(node) {
-        return node.kind === 194 /* TemplateLiteralTypeSpan */;
+        return node.kind === 198 /* TemplateLiteralTypeSpan */;
     }
     ts.isTemplateLiteralTypeSpan = isTemplateLiteralTypeSpan;
     function isTemplateLiteralTypeNode(node) {
-        return node.kind === 193 /* TemplateLiteralType */;
+        return node.kind === 197 /* TemplateLiteralType */;
     }
     ts.isTemplateLiteralTypeNode = isTemplateLiteralTypeNode;
     // Binding patterns
     function isObjectBindingPattern(node) {
-        return node.kind === 196 /* ObjectBindingPattern */;
+        return node.kind === 200 /* ObjectBindingPattern */;
     }
     ts.isObjectBindingPattern = isObjectBindingPattern;
     function isArrayBindingPattern(node) {
-        return node.kind === 197 /* ArrayBindingPattern */;
+        return node.kind === 201 /* ArrayBindingPattern */;
     }
     ts.isArrayBindingPattern = isArrayBindingPattern;
     function isBindingElement(node) {
-        return node.kind === 198 /* BindingElement */;
+        return node.kind === 202 /* BindingElement */;
     }
     ts.isBindingElement = isBindingElement;
     // Expression
     function isArrayLiteralExpression(node) {
-        return node.kind === 199 /* ArrayLiteralExpression */;
+        return node.kind === 203 /* ArrayLiteralExpression */;
     }
     ts.isArrayLiteralExpression = isArrayLiteralExpression;
     function isObjectLiteralExpression(node) {
-        return node.kind === 200 /* ObjectLiteralExpression */;
+        return node.kind === 204 /* ObjectLiteralExpression */;
     }
     ts.isObjectLiteralExpression = isObjectLiteralExpression;
     function isPropertyAccessExpression(node) {
-        return node.kind === 201 /* PropertyAccessExpression */;
+        return node.kind === 205 /* PropertyAccessExpression */;
     }
     ts.isPropertyAccessExpression = isPropertyAccessExpression;
     function isElementAccessExpression(node) {
-        return node.kind === 202 /* ElementAccessExpression */;
+        return node.kind === 206 /* ElementAccessExpression */;
     }
     ts.isElementAccessExpression = isElementAccessExpression;
     function isCallExpression(node) {
-        return node.kind === 203 /* CallExpression */;
+        return node.kind === 207 /* CallExpression */;
     }
     ts.isCallExpression = isCallExpression;
     function isNewExpression(node) {
-        return node.kind === 204 /* NewExpression */;
+        return node.kind === 208 /* NewExpression */;
     }
     ts.isNewExpression = isNewExpression;
     function isTaggedTemplateExpression(node) {
-        return node.kind === 205 /* TaggedTemplateExpression */;
+        return node.kind === 209 /* TaggedTemplateExpression */;
     }
     ts.isTaggedTemplateExpression = isTaggedTemplateExpression;
     function isTypeAssertionExpression(node) {
-        return node.kind === 206 /* TypeAssertionExpression */;
+        return node.kind === 210 /* TypeAssertionExpression */;
     }
     ts.isTypeAssertionExpression = isTypeAssertionExpression;
     function isParenthesizedExpression(node) {
-        return node.kind === 207 /* ParenthesizedExpression */;
+        return node.kind === 211 /* ParenthesizedExpression */;
     }
     ts.isParenthesizedExpression = isParenthesizedExpression;
     function isFunctionExpression(node) {
-        return node.kind === 208 /* FunctionExpression */;
+        return node.kind === 212 /* FunctionExpression */;
     }
     ts.isFunctionExpression = isFunctionExpression;
     function isArrowFunction(node) {
-        return node.kind === 209 /* ArrowFunction */;
+        return node.kind === 213 /* ArrowFunction */;
     }
     ts.isArrowFunction = isArrowFunction;
     function isDeleteExpression(node) {
-        return node.kind === 210 /* DeleteExpression */;
+        return node.kind === 214 /* DeleteExpression */;
     }
     ts.isDeleteExpression = isDeleteExpression;
     function isTypeOfExpression(node) {
-        return node.kind === 211 /* TypeOfExpression */;
+        return node.kind === 215 /* TypeOfExpression */;
     }
     ts.isTypeOfExpression = isTypeOfExpression;
     function isVoidExpression(node) {
-        return node.kind === 212 /* VoidExpression */;
+        return node.kind === 216 /* VoidExpression */;
     }
     ts.isVoidExpression = isVoidExpression;
     function isAwaitExpression(node) {
-        return node.kind === 213 /* AwaitExpression */;
+        return node.kind === 217 /* AwaitExpression */;
     }
     ts.isAwaitExpression = isAwaitExpression;
     function isPrefixUnaryExpression(node) {
-        return node.kind === 214 /* PrefixUnaryExpression */;
+        return node.kind === 218 /* PrefixUnaryExpression */;
     }
     ts.isPrefixUnaryExpression = isPrefixUnaryExpression;
     function isPostfixUnaryExpression(node) {
-        return node.kind === 215 /* PostfixUnaryExpression */;
+        return node.kind === 219 /* PostfixUnaryExpression */;
     }
     ts.isPostfixUnaryExpression = isPostfixUnaryExpression;
     function isBinaryExpression(node) {
-        return node.kind === 216 /* BinaryExpression */;
+        return node.kind === 220 /* BinaryExpression */;
     }
     ts.isBinaryExpression = isBinaryExpression;
     function isConditionalExpression(node) {
-        return node.kind === 217 /* ConditionalExpression */;
+        return node.kind === 221 /* ConditionalExpression */;
     }
     ts.isConditionalExpression = isConditionalExpression;
     function isTemplateExpression(node) {
-        return node.kind === 218 /* TemplateExpression */;
+        return node.kind === 222 /* TemplateExpression */;
     }
     ts.isTemplateExpression = isTemplateExpression;
     function isYieldExpression(node) {
-        return node.kind === 219 /* YieldExpression */;
+        return node.kind === 223 /* YieldExpression */;
     }
     ts.isYieldExpression = isYieldExpression;
     function isSpreadElement(node) {
-        return node.kind === 220 /* SpreadElement */;
+        return node.kind === 224 /* SpreadElement */;
     }
     ts.isSpreadElement = isSpreadElement;
     function isClassExpression(node) {
-        return node.kind === 221 /* ClassExpression */;
+        return node.kind === 225 /* ClassExpression */;
     }
     ts.isClassExpression = isClassExpression;
     function isOmittedExpression(node) {
-        return node.kind === 222 /* OmittedExpression */;
+        return node.kind === 226 /* OmittedExpression */;
     }
     ts.isOmittedExpression = isOmittedExpression;
     function isExpressionWithTypeArguments(node) {
-        return node.kind === 223 /* ExpressionWithTypeArguments */;
+        return node.kind === 227 /* ExpressionWithTypeArguments */;
     }
     ts.isExpressionWithTypeArguments = isExpressionWithTypeArguments;
     function isAsExpression(node) {
-        return node.kind === 224 /* AsExpression */;
+        return node.kind === 228 /* AsExpression */;
     }
     ts.isAsExpression = isAsExpression;
     function isNonNullExpression(node) {
-        return node.kind === 225 /* NonNullExpression */;
+        return node.kind === 229 /* NonNullExpression */;
     }
     ts.isNonNullExpression = isNonNullExpression;
     function isMetaProperty(node) {
-        return node.kind === 226 /* MetaProperty */;
+        return node.kind === 230 /* MetaProperty */;
     }
     ts.isMetaProperty = isMetaProperty;
     function isSyntheticExpression(node) {
-        return node.kind === 227 /* SyntheticExpression */;
+        return node.kind === 231 /* SyntheticExpression */;
     }
     ts.isSyntheticExpression = isSyntheticExpression;
     function isPartiallyEmittedExpression(node) {
-        return node.kind === 336 /* PartiallyEmittedExpression */;
+        return node.kind === 348 /* PartiallyEmittedExpression */;
     }
     ts.isPartiallyEmittedExpression = isPartiallyEmittedExpression;
     function isCommaListExpression(node) {
-        return node.kind === 337 /* CommaListExpression */;
+        return node.kind === 349 /* CommaListExpression */;
     }
     ts.isCommaListExpression = isCommaListExpression;
     // Misc
     function isTemplateSpan(node) {
-        return node.kind === 228 /* TemplateSpan */;
+        return node.kind === 232 /* TemplateSpan */;
     }
     ts.isTemplateSpan = isTemplateSpan;
     function isSemicolonClassElement(node) {
-        return node.kind === 229 /* SemicolonClassElement */;
+        return node.kind === 233 /* SemicolonClassElement */;
     }
     ts.isSemicolonClassElement = isSemicolonClassElement;
     // Elements
     function isBlock(node) {
-        return node.kind === 230 /* Block */;
+        return node.kind === 234 /* Block */;
     }
     ts.isBlock = isBlock;
     function isVariableStatement(node) {
-        return node.kind === 232 /* VariableStatement */;
+        return node.kind === 236 /* VariableStatement */;
     }
     ts.isVariableStatement = isVariableStatement;
     function isEmptyStatement(node) {
-        return node.kind === 231 /* EmptyStatement */;
+        return node.kind === 235 /* EmptyStatement */;
     }
     ts.isEmptyStatement = isEmptyStatement;
     function isExpressionStatement(node) {
-        return node.kind === 233 /* ExpressionStatement */;
+        return node.kind === 237 /* ExpressionStatement */;
     }
     ts.isExpressionStatement = isExpressionStatement;
     function isIfStatement(node) {
-        return node.kind === 234 /* IfStatement */;
+        return node.kind === 238 /* IfStatement */;
     }
     ts.isIfStatement = isIfStatement;
     function isDoStatement(node) {
-        return node.kind === 235 /* DoStatement */;
+        return node.kind === 239 /* DoStatement */;
     }
     ts.isDoStatement = isDoStatement;
     function isWhileStatement(node) {
-        return node.kind === 236 /* WhileStatement */;
+        return node.kind === 240 /* WhileStatement */;
     }
     ts.isWhileStatement = isWhileStatement;
     function isForStatement(node) {
-        return node.kind === 237 /* ForStatement */;
+        return node.kind === 241 /* ForStatement */;
     }
     ts.isForStatement = isForStatement;
     function isForInStatement(node) {
-        return node.kind === 238 /* ForInStatement */;
+        return node.kind === 242 /* ForInStatement */;
     }
     ts.isForInStatement = isForInStatement;
     function isForOfStatement(node) {
-        return node.kind === 239 /* ForOfStatement */;
+        return node.kind === 243 /* ForOfStatement */;
     }
     ts.isForOfStatement = isForOfStatement;
     function isContinueStatement(node) {
-        return node.kind === 240 /* ContinueStatement */;
+        return node.kind === 244 /* ContinueStatement */;
     }
     ts.isContinueStatement = isContinueStatement;
     function isBreakStatement(node) {
-        return node.kind === 241 /* BreakStatement */;
+        return node.kind === 245 /* BreakStatement */;
     }
     ts.isBreakStatement = isBreakStatement;
     function isReturnStatement(node) {
-        return node.kind === 242 /* ReturnStatement */;
+        return node.kind === 246 /* ReturnStatement */;
     }
     ts.isReturnStatement = isReturnStatement;
     function isWithStatement(node) {
-        return node.kind === 243 /* WithStatement */;
+        return node.kind === 247 /* WithStatement */;
     }
     ts.isWithStatement = isWithStatement;
     function isSwitchStatement(node) {
-        return node.kind === 244 /* SwitchStatement */;
+        return node.kind === 248 /* SwitchStatement */;
     }
     ts.isSwitchStatement = isSwitchStatement;
     function isLabeledStatement(node) {
-        return node.kind === 245 /* LabeledStatement */;
+        return node.kind === 249 /* LabeledStatement */;
     }
     ts.isLabeledStatement = isLabeledStatement;
     function isThrowStatement(node) {
-        return node.kind === 246 /* ThrowStatement */;
+        return node.kind === 250 /* ThrowStatement */;
     }
     ts.isThrowStatement = isThrowStatement;
     function isTryStatement(node) {
-        return node.kind === 247 /* TryStatement */;
+        return node.kind === 251 /* TryStatement */;
     }
     ts.isTryStatement = isTryStatement;
     function isDebuggerStatement(node) {
-        return node.kind === 248 /* DebuggerStatement */;
+        return node.kind === 252 /* DebuggerStatement */;
     }
     ts.isDebuggerStatement = isDebuggerStatement;
     function isVariableDeclaration(node) {
-        return node.kind === 249 /* VariableDeclaration */;
+        return node.kind === 253 /* VariableDeclaration */;
     }
     ts.isVariableDeclaration = isVariableDeclaration;
     function isVariableDeclarationList(node) {
-        return node.kind === 250 /* VariableDeclarationList */;
+        return node.kind === 254 /* VariableDeclarationList */;
     }
     ts.isVariableDeclarationList = isVariableDeclarationList;
     function isFunctionDeclaration(node) {
-        return node.kind === 251 /* FunctionDeclaration */;
+        return node.kind === 255 /* FunctionDeclaration */;
     }
     ts.isFunctionDeclaration = isFunctionDeclaration;
     function isClassDeclaration(node) {
-        return node.kind === 252 /* ClassDeclaration */;
+        return node.kind === 256 /* ClassDeclaration */;
     }
     ts.isClassDeclaration = isClassDeclaration;
     function isInterfaceDeclaration(node) {
-        return node.kind === 253 /* InterfaceDeclaration */;
+        return node.kind === 257 /* InterfaceDeclaration */;
     }
     ts.isInterfaceDeclaration = isInterfaceDeclaration;
     function isTypeAliasDeclaration(node) {
-        return node.kind === 254 /* TypeAliasDeclaration */;
+        return node.kind === 258 /* TypeAliasDeclaration */;
     }
     ts.isTypeAliasDeclaration = isTypeAliasDeclaration;
     function isEnumDeclaration(node) {
-        return node.kind === 255 /* EnumDeclaration */;
+        return node.kind === 259 /* EnumDeclaration */;
     }
     ts.isEnumDeclaration = isEnumDeclaration;
     function isModuleDeclaration(node) {
-        return node.kind === 256 /* ModuleDeclaration */;
+        return node.kind === 260 /* ModuleDeclaration */;
     }
     ts.isModuleDeclaration = isModuleDeclaration;
     function isModuleBlock(node) {
-        return node.kind === 257 /* ModuleBlock */;
+        return node.kind === 261 /* ModuleBlock */;
     }
     ts.isModuleBlock = isModuleBlock;
     function isCaseBlock(node) {
-        return node.kind === 258 /* CaseBlock */;
+        return node.kind === 262 /* CaseBlock */;
     }
     ts.isCaseBlock = isCaseBlock;
     function isNamespaceExportDeclaration(node) {
-        return node.kind === 259 /* NamespaceExportDeclaration */;
+        return node.kind === 263 /* NamespaceExportDeclaration */;
     }
     ts.isNamespaceExportDeclaration = isNamespaceExportDeclaration;
     function isImportEqualsDeclaration(node) {
-        return node.kind === 260 /* ImportEqualsDeclaration */;
+        return node.kind === 264 /* ImportEqualsDeclaration */;
     }
     ts.isImportEqualsDeclaration = isImportEqualsDeclaration;
     function isImportDeclaration(node) {
-        return node.kind === 261 /* ImportDeclaration */;
+        return node.kind === 265 /* ImportDeclaration */;
     }
     ts.isImportDeclaration = isImportDeclaration;
     function isImportClause(node) {
-        return node.kind === 262 /* ImportClause */;
+        return node.kind === 266 /* ImportClause */;
     }
     ts.isImportClause = isImportClause;
+    function isAssertClause(node) {
+        return node.kind === 292 /* AssertClause */;
+    }
+    ts.isAssertClause = isAssertClause;
+    function isAssertEntry(node) {
+        return node.kind === 293 /* AssertEntry */;
+    }
+    ts.isAssertEntry = isAssertEntry;
     function isNamespaceImport(node) {
-        return node.kind === 263 /* NamespaceImport */;
+        return node.kind === 267 /* NamespaceImport */;
     }
     ts.isNamespaceImport = isNamespaceImport;
     function isNamespaceExport(node) {
-        return node.kind === 269 /* NamespaceExport */;
+        return node.kind === 273 /* NamespaceExport */;
     }
     ts.isNamespaceExport = isNamespaceExport;
     function isNamedImports(node) {
-        return node.kind === 264 /* NamedImports */;
+        return node.kind === 268 /* NamedImports */;
     }
     ts.isNamedImports = isNamedImports;
     function isImportSpecifier(node) {
-        return node.kind === 265 /* ImportSpecifier */;
+        return node.kind === 269 /* ImportSpecifier */;
     }
     ts.isImportSpecifier = isImportSpecifier;
     function isExportAssignment(node) {
-        return node.kind === 266 /* ExportAssignment */;
+        return node.kind === 270 /* ExportAssignment */;
     }
     ts.isExportAssignment = isExportAssignment;
     function isExportDeclaration(node) {
-        return node.kind === 267 /* ExportDeclaration */;
+        return node.kind === 271 /* ExportDeclaration */;
     }
     ts.isExportDeclaration = isExportDeclaration;
     function isNamedExports(node) {
-        return node.kind === 268 /* NamedExports */;
+        return node.kind === 272 /* NamedExports */;
     }
     ts.isNamedExports = isNamedExports;
     function isExportSpecifier(node) {
-        return node.kind === 270 /* ExportSpecifier */;
+        return node.kind === 274 /* ExportSpecifier */;
     }
     ts.isExportSpecifier = isExportSpecifier;
     function isMissingDeclaration(node) {
-        return node.kind === 271 /* MissingDeclaration */;
+        return node.kind === 275 /* MissingDeclaration */;
     }
     ts.isMissingDeclaration = isMissingDeclaration;
     function isNotEmittedStatement(node) {
-        return node.kind === 335 /* NotEmittedStatement */;
+        return node.kind === 347 /* NotEmittedStatement */;
     }
     ts.isNotEmittedStatement = isNotEmittedStatement;
     /* @internal */
     function isSyntheticReference(node) {
-        return node.kind === 340 /* SyntheticReferenceExpression */;
+        return node.kind === 352 /* SyntheticReferenceExpression */;
     }
     ts.isSyntheticReference = isSyntheticReference;
     /* @internal */
     function isMergeDeclarationMarker(node) {
-        return node.kind === 338 /* MergeDeclarationMarker */;
+        return node.kind === 350 /* MergeDeclarationMarker */;
     }
     ts.isMergeDeclarationMarker = isMergeDeclarationMarker;
     /* @internal */
     function isEndOfDeclarationMarker(node) {
-        return node.kind === 339 /* EndOfDeclarationMarker */;
+        return node.kind === 351 /* EndOfDeclarationMarker */;
     }
     ts.isEndOfDeclarationMarker = isEndOfDeclarationMarker;
     // Module References
     function isExternalModuleReference(node) {
-        return node.kind === 272 /* ExternalModuleReference */;
+        return node.kind === 276 /* ExternalModuleReference */;
     }
     ts.isExternalModuleReference = isExternalModuleReference;
     // JSX
     function isJsxElement(node) {
-        return node.kind === 273 /* JsxElement */;
+        return node.kind === 277 /* JsxElement */;
     }
     ts.isJsxElement = isJsxElement;
     function isJsxSelfClosingElement(node) {
-        return node.kind === 274 /* JsxSelfClosingElement */;
+        return node.kind === 278 /* JsxSelfClosingElement */;
     }
     ts.isJsxSelfClosingElement = isJsxSelfClosingElement;
     function isJsxOpeningElement(node) {
-        return node.kind === 275 /* JsxOpeningElement */;
+        return node.kind === 279 /* JsxOpeningElement */;
     }
     ts.isJsxOpeningElement = isJsxOpeningElement;
     function isJsxClosingElement(node) {
-        return node.kind === 276 /* JsxClosingElement */;
+        return node.kind === 280 /* JsxClosingElement */;
     }
     ts.isJsxClosingElement = isJsxClosingElement;
     function isJsxFragment(node) {
-        return node.kind === 277 /* JsxFragment */;
+        return node.kind === 281 /* JsxFragment */;
     }
     ts.isJsxFragment = isJsxFragment;
     function isJsxOpeningFragment(node) {
-        return node.kind === 278 /* JsxOpeningFragment */;
+        return node.kind === 282 /* JsxOpeningFragment */;
     }
     ts.isJsxOpeningFragment = isJsxOpeningFragment;
     function isJsxClosingFragment(node) {
-        return node.kind === 279 /* JsxClosingFragment */;
+        return node.kind === 283 /* JsxClosingFragment */;
     }
     ts.isJsxClosingFragment = isJsxClosingFragment;
     function isJsxAttribute(node) {
-        return node.kind === 280 /* JsxAttribute */;
+        return node.kind === 284 /* JsxAttribute */;
     }
     ts.isJsxAttribute = isJsxAttribute;
     function isJsxAttributes(node) {
-        return node.kind === 281 /* JsxAttributes */;
+        return node.kind === 285 /* JsxAttributes */;
     }
     ts.isJsxAttributes = isJsxAttributes;
     function isJsxSpreadAttribute(node) {
-        return node.kind === 282 /* JsxSpreadAttribute */;
+        return node.kind === 286 /* JsxSpreadAttribute */;
     }
     ts.isJsxSpreadAttribute = isJsxSpreadAttribute;
     function isJsxExpression(node) {
-        return node.kind === 283 /* JsxExpression */;
+        return node.kind === 287 /* JsxExpression */;
     }
     ts.isJsxExpression = isJsxExpression;
     // Clauses
     function isCaseClause(node) {
-        return node.kind === 284 /* CaseClause */;
+        return node.kind === 288 /* CaseClause */;
     }
     ts.isCaseClause = isCaseClause;
     function isDefaultClause(node) {
-        return node.kind === 285 /* DefaultClause */;
+        return node.kind === 289 /* DefaultClause */;
     }
     ts.isDefaultClause = isDefaultClause;
     function isHeritageClause(node) {
-        return node.kind === 286 /* HeritageClause */;
+        return node.kind === 290 /* HeritageClause */;
     }
     ts.isHeritageClause = isHeritageClause;
     function isCatchClause(node) {
-        return node.kind === 287 /* CatchClause */;
+        return node.kind === 291 /* CatchClause */;
     }
     ts.isCatchClause = isCatchClause;
     // Property assignments
     function isPropertyAssignment(node) {
-        return node.kind === 288 /* PropertyAssignment */;
+        return node.kind === 294 /* PropertyAssignment */;
     }
     ts.isPropertyAssignment = isPropertyAssignment;
     function isShorthandPropertyAssignment(node) {
-        return node.kind === 289 /* ShorthandPropertyAssignment */;
+        return node.kind === 295 /* ShorthandPropertyAssignment */;
     }
     ts.isShorthandPropertyAssignment = isShorthandPropertyAssignment;
     function isSpreadAssignment(node) {
-        return node.kind === 290 /* SpreadAssignment */;
+        return node.kind === 296 /* SpreadAssignment */;
     }
     ts.isSpreadAssignment = isSpreadAssignment;
     // Enum
     function isEnumMember(node) {
-        return node.kind === 291 /* EnumMember */;
+        return node.kind === 297 /* EnumMember */;
     }
     ts.isEnumMember = isEnumMember;
     // Unparsed
     // TODO(rbuckton): isUnparsedPrologue
     function isUnparsedPrepend(node) {
-        return node.kind === 293 /* UnparsedPrepend */;
+        return node.kind === 299 /* UnparsedPrepend */;
     }
     ts.isUnparsedPrepend = isUnparsedPrepend;
     // TODO(rbuckton): isUnparsedText
@@ -27100,156 +28424,176 @@ var ts;
     // TODO(rbuckton): isUnparsedSyntheticReference
     // Top-level nodes
     function isSourceFile(node) {
-        return node.kind === 297 /* SourceFile */;
+        return node.kind === 303 /* SourceFile */;
     }
     ts.isSourceFile = isSourceFile;
     function isBundle(node) {
-        return node.kind === 298 /* Bundle */;
+        return node.kind === 304 /* Bundle */;
     }
     ts.isBundle = isBundle;
     function isUnparsedSource(node) {
-        return node.kind === 299 /* UnparsedSource */;
+        return node.kind === 305 /* UnparsedSource */;
     }
     ts.isUnparsedSource = isUnparsedSource;
     // TODO(rbuckton): isInputFiles
     // JSDoc Elements
     function isJSDocTypeExpression(node) {
-        return node.kind === 301 /* JSDocTypeExpression */;
+        return node.kind === 307 /* JSDocTypeExpression */;
     }
     ts.isJSDocTypeExpression = isJSDocTypeExpression;
     function isJSDocNameReference(node) {
-        return node.kind === 302 /* JSDocNameReference */;
+        return node.kind === 308 /* JSDocNameReference */;
     }
     ts.isJSDocNameReference = isJSDocNameReference;
+    function isJSDocMemberName(node) {
+        return node.kind === 309 /* JSDocMemberName */;
+    }
+    ts.isJSDocMemberName = isJSDocMemberName;
+    function isJSDocLink(node) {
+        return node.kind === 322 /* JSDocLink */;
+    }
+    ts.isJSDocLink = isJSDocLink;
+    function isJSDocLinkCode(node) {
+        return node.kind === 323 /* JSDocLinkCode */;
+    }
+    ts.isJSDocLinkCode = isJSDocLinkCode;
+    function isJSDocLinkPlain(node) {
+        return node.kind === 324 /* JSDocLinkPlain */;
+    }
+    ts.isJSDocLinkPlain = isJSDocLinkPlain;
     function isJSDocAllType(node) {
-        return node.kind === 303 /* JSDocAllType */;
+        return node.kind === 310 /* JSDocAllType */;
     }
     ts.isJSDocAllType = isJSDocAllType;
     function isJSDocUnknownType(node) {
-        return node.kind === 304 /* JSDocUnknownType */;
+        return node.kind === 311 /* JSDocUnknownType */;
     }
     ts.isJSDocUnknownType = isJSDocUnknownType;
     function isJSDocNullableType(node) {
-        return node.kind === 305 /* JSDocNullableType */;
+        return node.kind === 312 /* JSDocNullableType */;
     }
     ts.isJSDocNullableType = isJSDocNullableType;
     function isJSDocNonNullableType(node) {
-        return node.kind === 306 /* JSDocNonNullableType */;
+        return node.kind === 313 /* JSDocNonNullableType */;
     }
     ts.isJSDocNonNullableType = isJSDocNonNullableType;
     function isJSDocOptionalType(node) {
-        return node.kind === 307 /* JSDocOptionalType */;
+        return node.kind === 314 /* JSDocOptionalType */;
     }
     ts.isJSDocOptionalType = isJSDocOptionalType;
     function isJSDocFunctionType(node) {
-        return node.kind === 308 /* JSDocFunctionType */;
+        return node.kind === 315 /* JSDocFunctionType */;
     }
     ts.isJSDocFunctionType = isJSDocFunctionType;
     function isJSDocVariadicType(node) {
-        return node.kind === 309 /* JSDocVariadicType */;
+        return node.kind === 316 /* JSDocVariadicType */;
     }
     ts.isJSDocVariadicType = isJSDocVariadicType;
     function isJSDocNamepathType(node) {
-        return node.kind === 310 /* JSDocNamepathType */;
+        return node.kind === 317 /* JSDocNamepathType */;
     }
     ts.isJSDocNamepathType = isJSDocNamepathType;
     function isJSDoc(node) {
-        return node.kind === 311 /* JSDocComment */;
+        return node.kind === 318 /* JSDocComment */;
     }
     ts.isJSDoc = isJSDoc;
     function isJSDocTypeLiteral(node) {
-        return node.kind === 312 /* JSDocTypeLiteral */;
+        return node.kind === 320 /* JSDocTypeLiteral */;
     }
     ts.isJSDocTypeLiteral = isJSDocTypeLiteral;
     function isJSDocSignature(node) {
-        return node.kind === 313 /* JSDocSignature */;
+        return node.kind === 321 /* JSDocSignature */;
     }
     ts.isJSDocSignature = isJSDocSignature;
     // JSDoc Tags
     function isJSDocAugmentsTag(node) {
-        return node.kind === 315 /* JSDocAugmentsTag */;
+        return node.kind === 326 /* JSDocAugmentsTag */;
     }
     ts.isJSDocAugmentsTag = isJSDocAugmentsTag;
     function isJSDocAuthorTag(node) {
-        return node.kind === 317 /* JSDocAuthorTag */;
+        return node.kind === 328 /* JSDocAuthorTag */;
     }
     ts.isJSDocAuthorTag = isJSDocAuthorTag;
     function isJSDocClassTag(node) {
-        return node.kind === 319 /* JSDocClassTag */;
+        return node.kind === 330 /* JSDocClassTag */;
     }
     ts.isJSDocClassTag = isJSDocClassTag;
     function isJSDocCallbackTag(node) {
-        return node.kind === 324 /* JSDocCallbackTag */;
+        return node.kind === 336 /* JSDocCallbackTag */;
     }
     ts.isJSDocCallbackTag = isJSDocCallbackTag;
     function isJSDocPublicTag(node) {
-        return node.kind === 320 /* JSDocPublicTag */;
+        return node.kind === 331 /* JSDocPublicTag */;
     }
     ts.isJSDocPublicTag = isJSDocPublicTag;
     function isJSDocPrivateTag(node) {
-        return node.kind === 321 /* JSDocPrivateTag */;
+        return node.kind === 332 /* JSDocPrivateTag */;
     }
     ts.isJSDocPrivateTag = isJSDocPrivateTag;
     function isJSDocProtectedTag(node) {
-        return node.kind === 322 /* JSDocProtectedTag */;
+        return node.kind === 333 /* JSDocProtectedTag */;
     }
     ts.isJSDocProtectedTag = isJSDocProtectedTag;
     function isJSDocReadonlyTag(node) {
-        return node.kind === 323 /* JSDocReadonlyTag */;
+        return node.kind === 334 /* JSDocReadonlyTag */;
     }
     ts.isJSDocReadonlyTag = isJSDocReadonlyTag;
+    function isJSDocOverrideTag(node) {
+        return node.kind === 335 /* JSDocOverrideTag */;
+    }
+    ts.isJSDocOverrideTag = isJSDocOverrideTag;
     function isJSDocDeprecatedTag(node) {
-        return node.kind === 318 /* JSDocDeprecatedTag */;
+        return node.kind === 329 /* JSDocDeprecatedTag */;
     }
     ts.isJSDocDeprecatedTag = isJSDocDeprecatedTag;
     function isJSDocSeeTag(node) {
-        return node.kind === 332 /* JSDocSeeTag */;
+        return node.kind === 344 /* JSDocSeeTag */;
     }
     ts.isJSDocSeeTag = isJSDocSeeTag;
     function isJSDocEnumTag(node) {
-        return node.kind === 325 /* JSDocEnumTag */;
+        return node.kind === 337 /* JSDocEnumTag */;
     }
     ts.isJSDocEnumTag = isJSDocEnumTag;
     function isJSDocParameterTag(node) {
-        return node.kind === 326 /* JSDocParameterTag */;
+        return node.kind === 338 /* JSDocParameterTag */;
     }
     ts.isJSDocParameterTag = isJSDocParameterTag;
     function isJSDocReturnTag(node) {
-        return node.kind === 327 /* JSDocReturnTag */;
+        return node.kind === 339 /* JSDocReturnTag */;
     }
     ts.isJSDocReturnTag = isJSDocReturnTag;
     function isJSDocThisTag(node) {
-        return node.kind === 328 /* JSDocThisTag */;
+        return node.kind === 340 /* JSDocThisTag */;
     }
     ts.isJSDocThisTag = isJSDocThisTag;
     function isJSDocTypeTag(node) {
-        return node.kind === 329 /* JSDocTypeTag */;
+        return node.kind === 341 /* JSDocTypeTag */;
     }
     ts.isJSDocTypeTag = isJSDocTypeTag;
     function isJSDocTemplateTag(node) {
-        return node.kind === 330 /* JSDocTemplateTag */;
+        return node.kind === 342 /* JSDocTemplateTag */;
     }
     ts.isJSDocTemplateTag = isJSDocTemplateTag;
     function isJSDocTypedefTag(node) {
-        return node.kind === 331 /* JSDocTypedefTag */;
+        return node.kind === 343 /* JSDocTypedefTag */;
     }
     ts.isJSDocTypedefTag = isJSDocTypedefTag;
     function isJSDocUnknownTag(node) {
-        return node.kind === 314 /* JSDocTag */;
+        return node.kind === 325 /* JSDocTag */;
     }
     ts.isJSDocUnknownTag = isJSDocUnknownTag;
     function isJSDocPropertyTag(node) {
-        return node.kind === 333 /* JSDocPropertyTag */;
+        return node.kind === 345 /* JSDocPropertyTag */;
     }
     ts.isJSDocPropertyTag = isJSDocPropertyTag;
     function isJSDocImplementsTag(node) {
-        return node.kind === 316 /* JSDocImplementsTag */;
+        return node.kind === 327 /* JSDocImplementsTag */;
     }
     ts.isJSDocImplementsTag = isJSDocImplementsTag;
     // Synthesized list
     /* @internal */
     function isSyntaxList(n) {
-        return n.kind === 334 /* SyntaxList */;
+        return n.kind === 346 /* SyntaxList */;
     }
     ts.isSyntaxList = isSyntaxList;
 })(ts || (ts = {}));
@@ -27266,7 +28610,7 @@ var ts;
             return ts.setTextRange(factory.createElementAccessExpression(target, memberName.expression), location);
         }
         else {
-            var expression = ts.setTextRange(ts.isIdentifierOrPrivateIdentifier(memberName)
+            var expression = ts.setTextRange(ts.isMemberName(memberName)
                 ? factory.createPropertyAccessExpression(target, memberName)
                 : factory.createElementAccessExpression(target, memberName), memberName);
             ts.getOrCreateEmitNode(expression).flags |= 64 /* NoNestedSourceMaps */;
@@ -27368,7 +28712,7 @@ var ts;
     ts.createForOfBindingStatement = createForOfBindingStatement;
     function insertLeadingStatement(factory, dest, source) {
         if (ts.isBlock(dest)) {
-            return factory.updateBlock(dest, ts.setTextRange(factory.createNodeArray(__spreadArray([source], dest.statements)), dest.statements));
+            return factory.updateBlock(dest, ts.setTextRange(factory.createNodeArray(__spreadArray([source], dest.statements, true)), dest.statements));
         }
         else {
             return factory.createBlock(factory.createNodeArray([dest, source]), /*multiLine*/ true);
@@ -27448,18 +28792,73 @@ var ts;
             ts.Debug.failBadSyntaxKind(property.name, "Private identifiers are not allowed in object literals.");
         }
         switch (property.kind) {
-            case 167 /* GetAccessor */:
-            case 168 /* SetAccessor */:
+            case 171 /* GetAccessor */:
+            case 172 /* SetAccessor */:
                 return createExpressionForAccessorDeclaration(factory, node.properties, property, receiver, !!node.multiLine);
-            case 288 /* PropertyAssignment */:
+            case 294 /* PropertyAssignment */:
                 return createExpressionForPropertyAssignment(factory, property, receiver);
-            case 289 /* ShorthandPropertyAssignment */:
+            case 295 /* ShorthandPropertyAssignment */:
                 return createExpressionForShorthandPropertyAssignment(factory, property, receiver);
-            case 165 /* MethodDeclaration */:
+            case 168 /* MethodDeclaration */:
                 return createExpressionForMethodDeclaration(factory, property, receiver);
         }
     }
     ts.createExpressionForObjectLiteralElementLike = createExpressionForObjectLiteralElementLike;
+    /**
+     * Expand the read and increment/decrement operations a pre- or post-increment or pre- or post-decrement expression.
+     *
+     * ```ts
+     * // input
+     * <expression>++
+     * // output (if result is not discarded)
+     * var <temp>;
+     * (<temp> = <expression>, <resultVariable> = <temp>++, <temp>)
+     * // output (if result is discarded)
+     * var <temp>;
+     * (<temp> = <expression>, <temp>++, <temp>)
+     *
+     * // input
+     * ++<expression>
+     * // output (if result is not discarded)
+     * var <temp>;
+     * (<temp> = <expression>, <resultVariable> = ++<temp>)
+     * // output (if result is discarded)
+     * var <temp>;
+     * (<temp> = <expression>, ++<temp>)
+     * ```
+     *
+     * It is up to the caller to supply a temporary variable for `<resultVariable>` if one is needed.
+     * The temporary variable `<temp>` is injected so that `++` and `--` work uniformly with `number` and `bigint`.
+     * The result of the expression is always the final result of incrementing or decrementing the expression, so that it can be used for storage.
+     *
+     * @param factory {@link NodeFactory} used to create the expanded representation.
+     * @param node The original prefix or postfix unary node.
+     * @param expression The expression to use as the value to increment or decrement
+     * @param resultVariable A temporary variable in which to store the result. Pass `undefined` if the result is discarded, or if the value of `<temp>` is the expected result.
+     */
+    function expandPreOrPostfixIncrementOrDecrementExpression(factory, node, expression, recordTempVariable, resultVariable) {
+        var operator = node.operator;
+        ts.Debug.assert(operator === 45 /* PlusPlusToken */ || operator === 46 /* MinusMinusToken */, "Expected 'node' to be a pre- or post-increment or pre- or post-decrement expression");
+        var temp = factory.createTempVariable(recordTempVariable);
+        expression = factory.createAssignment(temp, expression);
+        ts.setTextRange(expression, node.operand);
+        var operation = ts.isPrefixUnaryExpression(node) ?
+            factory.createPrefixUnaryExpression(operator, temp) :
+            factory.createPostfixUnaryExpression(temp, operator);
+        ts.setTextRange(operation, node);
+        if (resultVariable) {
+            operation = factory.createAssignment(resultVariable, operation);
+            ts.setTextRange(operation, node);
+        }
+        expression = factory.createComma(expression, operation);
+        ts.setTextRange(expression, node);
+        if (ts.isPostfixUnaryExpression(node)) {
+            expression = factory.createComma(expression, temp);
+            ts.setTextRange(expression, node);
+        }
+        return expression;
+    }
+    ts.expandPreOrPostfixIncrementOrDecrementExpression = expandPreOrPostfixIncrementOrDecrementExpression;
     /**
      * Gets whether an identifier should only be referred to by its internal name.
      */
@@ -27508,21 +28907,36 @@ var ts;
     }
     ts.startsWithUseStrict = startsWithUseStrict;
     function isCommaSequence(node) {
-        return node.kind === 216 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ ||
-            node.kind === 337 /* CommaListExpression */;
+        return node.kind === 220 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ ||
+            node.kind === 349 /* CommaListExpression */;
     }
     ts.isCommaSequence = isCommaSequence;
+    function isJSDocTypeAssertion(node) {
+        return ts.isParenthesizedExpression(node)
+            && ts.isInJSFile(node)
+            && !!ts.getJSDocTypeTag(node);
+    }
+    ts.isJSDocTypeAssertion = isJSDocTypeAssertion;
+    function getJSDocTypeAssertionType(node) {
+        var type = ts.getJSDocType(node);
+        ts.Debug.assertIsDefined(type);
+        return type;
+    }
+    ts.getJSDocTypeAssertionType = getJSDocTypeAssertionType;
     function isOuterExpression(node, kinds) {
         if (kinds === void 0) { kinds = 15 /* All */; }
         switch (node.kind) {
-            case 207 /* ParenthesizedExpression */:
+            case 211 /* ParenthesizedExpression */:
+                if (kinds & 16 /* ExcludeJSDocTypeAssertion */ && isJSDocTypeAssertion(node)) {
+                    return false;
+                }
                 return (kinds & 1 /* Parentheses */) !== 0;
-            case 206 /* TypeAssertionExpression */:
-            case 224 /* AsExpression */:
+            case 210 /* TypeAssertionExpression */:
+            case 228 /* AsExpression */:
                 return (kinds & 2 /* TypeAssertions */) !== 0;
-            case 225 /* NonNullExpression */:
+            case 229 /* NonNullExpression */:
                 return (kinds & 4 /* NonNullAssertions */) !== 0;
-            case 336 /* PartiallyEmittedExpression */:
+            case 348 /* PartiallyEmittedExpression */:
                 return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0;
         }
         return false;
@@ -27560,7 +28974,7 @@ var ts;
         if (compilerOptions.importHelpers && ts.isEffectiveExternalModule(sourceFile, compilerOptions)) {
             var namedBindings = void 0;
             var moduleKind = ts.getEmitModuleKind(compilerOptions);
-            if (moduleKind >= ts.ModuleKind.ES2015 && moduleKind <= ts.ModuleKind.ESNext) {
+            if ((moduleKind >= ts.ModuleKind.ES2015 && moduleKind <= ts.ModuleKind.ESNext) || sourceFile.impliedNodeFormat === ts.ModuleKind.ESNext) {
                 // use named imports
                 var helpers = ts.getEmitHelpers(sourceFile);
                 if (helpers) {
@@ -27579,8 +28993,8 @@ var ts;
                         // Alias the imports if the names are used somewhere in the file.
                         // NOTE: We don't need to care about global import collisions as this is a module.
                         namedBindings = nodeFactory.createNamedImports(ts.map(helperNames, function (name) { return ts.isFileLevelUniqueName(sourceFile, name)
-                            ? nodeFactory.createImportSpecifier(/*propertyName*/ undefined, nodeFactory.createIdentifier(name))
-                            : nodeFactory.createImportSpecifier(nodeFactory.createIdentifier(name), helperFactory.getUnscopedHelperName(name)); }));
+                            ? nodeFactory.createImportSpecifier(/*isTypeOnly*/ false, /*propertyName*/ undefined, nodeFactory.createIdentifier(name))
+                            : nodeFactory.createImportSpecifier(/*isTypeOnly*/ false, nodeFactory.createIdentifier(name), helperFactory.getUnscopedHelperName(name)); }));
                         var parseNode = ts.getOriginalNode(sourceFile, ts.isSourceFile);
                         var emitNode = ts.getOrCreateEmitNode(parseNode);
                         emitNode.externalHelpers = true;
@@ -27597,7 +29011,8 @@ var ts;
             if (namedBindings) {
                 var externalHelpersImportDeclaration = nodeFactory.createImportDeclaration(
                 /*decorators*/ undefined, 
-                /*modifiers*/ undefined, nodeFactory.createImportClause(/*isTypeOnly*/ false, /*name*/ undefined, namedBindings), nodeFactory.createStringLiteral(ts.externalHelpersModuleNameText));
+                /*modifiers*/ undefined, nodeFactory.createImportClause(/*isTypeOnly*/ false, /*name*/ undefined, namedBindings), nodeFactory.createStringLiteral(ts.externalHelpersModuleNameText), 
+                /*assertClause*/ undefined);
                 ts.addEmitFlags(externalHelpersImportDeclaration, 67108864 /* NeverApplyImportHelper */);
                 return externalHelpersImportDeclaration;
             }
@@ -27611,9 +29026,9 @@ var ts;
                 return externalHelpersModuleName;
             }
             var moduleKind = ts.getEmitModuleKind(compilerOptions);
-            var create = (hasExportStarsToExportValues || (compilerOptions.esModuleInterop && hasImportStarOrImportDefault))
+            var create = (hasExportStarsToExportValues || (ts.getESModuleInterop(compilerOptions) && hasImportStarOrImportDefault))
                 && moduleKind !== ts.ModuleKind.System
-                && moduleKind < ts.ModuleKind.ES2015;
+                && (moduleKind < ts.ModuleKind.ES2015 || node.impliedNodeFormat === ts.ModuleKind.CommonJS);
             if (!create) {
                 var helpers = ts.getEmitHelpers(node);
                 if (helpers) {
@@ -27643,10 +29058,10 @@ var ts;
             var name = namespaceDeclaration.name;
             return ts.isGeneratedIdentifier(name) ? name : factory.createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, name) || ts.idText(name));
         }
-        if (node.kind === 261 /* ImportDeclaration */ && node.importClause) {
+        if (node.kind === 265 /* ImportDeclaration */ && node.importClause) {
             return factory.getGeneratedNameForNode(node);
         }
-        if (node.kind === 267 /* ExportDeclaration */ && node.moduleSpecifier) {
+        if (node.kind === 271 /* ExportDeclaration */ && node.moduleSpecifier) {
             return factory.getGeneratedNameForNode(node);
         }
         return undefined;
@@ -27765,7 +29180,7 @@ var ts;
         }
         if (ts.isObjectLiteralElementLike(bindingElement)) {
             switch (bindingElement.kind) {
-                case 288 /* PropertyAssignment */:
+                case 294 /* PropertyAssignment */:
                     // `b` in `({ a: b } = ...)`
                     // `b` in `({ a: b = 1 } = ...)`
                     // `{b}` in `({ a: {b} } = ...)`
@@ -27777,11 +29192,11 @@ var ts;
                     // `b[0]` in `({ a: b[0] } = ...)`
                     // `b[0]` in `({ a: b[0] = 1 } = ...)`
                     return getTargetOfBindingOrAssignmentElement(bindingElement.initializer);
-                case 289 /* ShorthandPropertyAssignment */:
+                case 295 /* ShorthandPropertyAssignment */:
                     // `a` in `({ a } = ...)`
                     // `a` in `({ a = 1 } = ...)`
                     return bindingElement.name;
-                case 290 /* SpreadAssignment */:
+                case 296 /* SpreadAssignment */:
                     // `a` in `({ ...a } = ...)`
                     return getTargetOfBindingOrAssignmentElement(bindingElement.expression);
             }
@@ -27813,12 +29228,12 @@ var ts;
      */
     function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) {
         switch (bindingElement.kind) {
-            case 160 /* Parameter */:
-            case 198 /* BindingElement */:
+            case 163 /* Parameter */:
+            case 202 /* BindingElement */:
                 // `...` in `let [...a] = ...`
                 return bindingElement.dotDotDotToken;
-            case 220 /* SpreadElement */:
-            case 290 /* SpreadAssignment */:
+            case 224 /* SpreadElement */:
+            case 296 /* SpreadAssignment */:
                 // `...` in `[...a] = ...`
                 return bindingElement;
         }
@@ -27836,7 +29251,7 @@ var ts;
     ts.getPropertyNameOfBindingOrAssignmentElement = getPropertyNameOfBindingOrAssignmentElement;
     function tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement) {
         switch (bindingElement.kind) {
-            case 198 /* BindingElement */:
+            case 202 /* BindingElement */:
                 // `a` in `let { a: b } = ...`
                 // `[a]` in `let { [a]: b } = ...`
                 // `"a"` in `let { "a": b } = ...`
@@ -27851,7 +29266,7 @@ var ts;
                         : propertyName;
                 }
                 break;
-            case 288 /* PropertyAssignment */:
+            case 294 /* PropertyAssignment */:
                 // `a` in `({ a: b } = ...)`
                 // `[a]` in `({ [a]: b } = ...)`
                 // `"a"` in `({ "a": b } = ...)`
@@ -27866,7 +29281,7 @@ var ts;
                         : propertyName;
                 }
                 break;
-            case 290 /* SpreadAssignment */:
+            case 296 /* SpreadAssignment */:
                 // `a` in `({ ...a } = ...)`
                 if (bindingElement.name && ts.isPrivateIdentifier(bindingElement.name)) {
                     return ts.Debug.failBadSyntaxKind(bindingElement.name);
@@ -27889,13 +29304,13 @@ var ts;
      */
     function getElementsOfBindingOrAssignmentPattern(name) {
         switch (name.kind) {
-            case 196 /* ObjectBindingPattern */:
-            case 197 /* ArrayBindingPattern */:
-            case 199 /* ArrayLiteralExpression */:
+            case 200 /* ObjectBindingPattern */:
+            case 201 /* ArrayBindingPattern */:
+            case 203 /* ArrayLiteralExpression */:
                 // `a` in `{a}`
                 // `a` in `[a]`
                 return name.elements;
-            case 200 /* ObjectLiteralExpression */:
+            case 204 /* ObjectLiteralExpression */:
                 // `a` in `{a}`
                 return name.properties;
         }
@@ -27916,46 +29331,294 @@ var ts;
     ts.getJSDocTypeAliasName = getJSDocTypeAliasName;
     function canHaveModifiers(node) {
         var kind = node.kind;
-        return kind === 160 /* Parameter */
-            || kind === 162 /* PropertySignature */
-            || kind === 163 /* PropertyDeclaration */
-            || kind === 164 /* MethodSignature */
-            || kind === 165 /* MethodDeclaration */
-            || kind === 166 /* Constructor */
-            || kind === 167 /* GetAccessor */
-            || kind === 168 /* SetAccessor */
-            || kind === 171 /* IndexSignature */
-            || kind === 208 /* FunctionExpression */
-            || kind === 209 /* ArrowFunction */
-            || kind === 221 /* ClassExpression */
-            || kind === 232 /* VariableStatement */
-            || kind === 251 /* FunctionDeclaration */
-            || kind === 252 /* ClassDeclaration */
-            || kind === 253 /* InterfaceDeclaration */
-            || kind === 254 /* TypeAliasDeclaration */
-            || kind === 255 /* EnumDeclaration */
-            || kind === 256 /* ModuleDeclaration */
-            || kind === 260 /* ImportEqualsDeclaration */
-            || kind === 261 /* ImportDeclaration */
-            || kind === 266 /* ExportAssignment */
-            || kind === 267 /* ExportDeclaration */;
+        return kind === 163 /* Parameter */
+            || kind === 165 /* PropertySignature */
+            || kind === 166 /* PropertyDeclaration */
+            || kind === 167 /* MethodSignature */
+            || kind === 168 /* MethodDeclaration */
+            || kind === 170 /* Constructor */
+            || kind === 171 /* GetAccessor */
+            || kind === 172 /* SetAccessor */
+            || kind === 175 /* IndexSignature */
+            || kind === 212 /* FunctionExpression */
+            || kind === 213 /* ArrowFunction */
+            || kind === 225 /* ClassExpression */
+            || kind === 236 /* VariableStatement */
+            || kind === 255 /* FunctionDeclaration */
+            || kind === 256 /* ClassDeclaration */
+            || kind === 257 /* InterfaceDeclaration */
+            || kind === 258 /* TypeAliasDeclaration */
+            || kind === 259 /* EnumDeclaration */
+            || kind === 260 /* ModuleDeclaration */
+            || kind === 264 /* ImportEqualsDeclaration */
+            || kind === 265 /* ImportDeclaration */
+            || kind === 270 /* ExportAssignment */
+            || kind === 271 /* ExportDeclaration */;
     }
     ts.canHaveModifiers = canHaveModifiers;
-    /* @internal */
-    function isExportModifier(node) {
-        return node.kind === 92 /* ExportKeyword */;
-    }
-    ts.isExportModifier = isExportModifier;
-    /* @internal */
-    function isAsyncModifier(node) {
-        return node.kind === 129 /* AsyncKeyword */;
-    }
-    ts.isAsyncModifier = isAsyncModifier;
-    /* @internal */
-    function isStaticModifier(node) {
-        return node.kind === 123 /* StaticKeyword */;
+    ts.isTypeNodeOrTypeParameterDeclaration = ts.or(ts.isTypeNode, ts.isTypeParameterDeclaration);
+    ts.isQuestionOrExclamationToken = ts.or(ts.isQuestionToken, ts.isExclamationToken);
+    ts.isIdentifierOrThisTypeNode = ts.or(ts.isIdentifier, ts.isThisTypeNode);
+    ts.isReadonlyKeywordOrPlusOrMinusToken = ts.or(ts.isReadonlyKeyword, ts.isPlusToken, ts.isMinusToken);
+    ts.isQuestionOrPlusOrMinusToken = ts.or(ts.isQuestionToken, ts.isPlusToken, ts.isMinusToken);
+    ts.isModuleName = ts.or(ts.isIdentifier, ts.isStringLiteral);
+    function isLiteralTypeLikeExpression(node) {
+        var kind = node.kind;
+        return kind === 104 /* NullKeyword */
+            || kind === 110 /* TrueKeyword */
+            || kind === 95 /* FalseKeyword */
+            || ts.isLiteralExpression(node)
+            || ts.isPrefixUnaryExpression(node);
+    }
+    ts.isLiteralTypeLikeExpression = isLiteralTypeLikeExpression;
+    function isExponentiationOperator(kind) {
+        return kind === 42 /* AsteriskAsteriskToken */;
+    }
+    function isMultiplicativeOperator(kind) {
+        return kind === 41 /* AsteriskToken */
+            || kind === 43 /* SlashToken */
+            || kind === 44 /* PercentToken */;
+    }
+    function isMultiplicativeOperatorOrHigher(kind) {
+        return isExponentiationOperator(kind)
+            || isMultiplicativeOperator(kind);
+    }
+    function isAdditiveOperator(kind) {
+        return kind === 39 /* PlusToken */
+            || kind === 40 /* MinusToken */;
+    }
+    function isAdditiveOperatorOrHigher(kind) {
+        return isAdditiveOperator(kind)
+            || isMultiplicativeOperatorOrHigher(kind);
+    }
+    function isShiftOperator(kind) {
+        return kind === 47 /* LessThanLessThanToken */
+            || kind === 48 /* GreaterThanGreaterThanToken */
+            || kind === 49 /* GreaterThanGreaterThanGreaterThanToken */;
+    }
+    function isShiftOperatorOrHigher(kind) {
+        return isShiftOperator(kind)
+            || isAdditiveOperatorOrHigher(kind);
+    }
+    function isRelationalOperator(kind) {
+        return kind === 29 /* LessThanToken */
+            || kind === 32 /* LessThanEqualsToken */
+            || kind === 31 /* GreaterThanToken */
+            || kind === 33 /* GreaterThanEqualsToken */
+            || kind === 102 /* InstanceOfKeyword */
+            || kind === 101 /* InKeyword */;
+    }
+    function isRelationalOperatorOrHigher(kind) {
+        return isRelationalOperator(kind)
+            || isShiftOperatorOrHigher(kind);
+    }
+    function isEqualityOperator(kind) {
+        return kind === 34 /* EqualsEqualsToken */
+            || kind === 36 /* EqualsEqualsEqualsToken */
+            || kind === 35 /* ExclamationEqualsToken */
+            || kind === 37 /* ExclamationEqualsEqualsToken */;
+    }
+    function isEqualityOperatorOrHigher(kind) {
+        return isEqualityOperator(kind)
+            || isRelationalOperatorOrHigher(kind);
+    }
+    function isBitwiseOperator(kind) {
+        return kind === 50 /* AmpersandToken */
+            || kind === 51 /* BarToken */
+            || kind === 52 /* CaretToken */;
+    }
+    function isBitwiseOperatorOrHigher(kind) {
+        return isBitwiseOperator(kind)
+            || isEqualityOperatorOrHigher(kind);
+    }
+    // NOTE: The version in utilities includes ExclamationToken, which is not a binary operator.
+    function isLogicalOperator(kind) {
+        return kind === 55 /* AmpersandAmpersandToken */
+            || kind === 56 /* BarBarToken */;
+    }
+    function isLogicalOperatorOrHigher(kind) {
+        return isLogicalOperator(kind)
+            || isBitwiseOperatorOrHigher(kind);
+    }
+    function isAssignmentOperatorOrHigher(kind) {
+        return kind === 60 /* QuestionQuestionToken */
+            || isLogicalOperatorOrHigher(kind)
+            || ts.isAssignmentOperator(kind);
+    }
+    function isBinaryOperator(kind) {
+        return isAssignmentOperatorOrHigher(kind)
+            || kind === 27 /* CommaToken */;
+    }
+    function isBinaryOperatorToken(node) {
+        return isBinaryOperator(node.kind);
+    }
+    ts.isBinaryOperatorToken = isBinaryOperatorToken;
+    var BinaryExpressionState;
+    (function (BinaryExpressionState) {
+        /**
+         * Handles walking into a `BinaryExpression`.
+         * @param machine State machine handler functions
+         * @param frame The current frame
+         * @returns The new frame
+         */
+        function enter(machine, stackIndex, stateStack, nodeStack, userStateStack, _resultHolder, outerState) {
+            var prevUserState = stackIndex > 0 ? userStateStack[stackIndex - 1] : undefined;
+            ts.Debug.assertEqual(stateStack[stackIndex], enter);
+            userStateStack[stackIndex] = machine.onEnter(nodeStack[stackIndex], prevUserState, outerState);
+            stateStack[stackIndex] = nextState(machine, enter);
+            return stackIndex;
+        }
+        BinaryExpressionState.enter = enter;
+        /**
+         * Handles walking the `left` side of a `BinaryExpression`.
+         * @param machine State machine handler functions
+         * @param frame The current frame
+         * @returns The new frame
+         */
+        function left(machine, stackIndex, stateStack, nodeStack, userStateStack, _resultHolder, _outerState) {
+            ts.Debug.assertEqual(stateStack[stackIndex], left);
+            ts.Debug.assertIsDefined(machine.onLeft);
+            stateStack[stackIndex] = nextState(machine, left);
+            var nextNode = machine.onLeft(nodeStack[stackIndex].left, userStateStack[stackIndex], nodeStack[stackIndex]);
+            if (nextNode) {
+                checkCircularity(stackIndex, nodeStack, nextNode);
+                return pushStack(stackIndex, stateStack, nodeStack, userStateStack, nextNode);
+            }
+            return stackIndex;
+        }
+        BinaryExpressionState.left = left;
+        /**
+         * Handles walking the `operatorToken` of a `BinaryExpression`.
+         * @param machine State machine handler functions
+         * @param frame The current frame
+         * @returns The new frame
+         */
+        function operator(machine, stackIndex, stateStack, nodeStack, userStateStack, _resultHolder, _outerState) {
+            ts.Debug.assertEqual(stateStack[stackIndex], operator);
+            ts.Debug.assertIsDefined(machine.onOperator);
+            stateStack[stackIndex] = nextState(machine, operator);
+            machine.onOperator(nodeStack[stackIndex].operatorToken, userStateStack[stackIndex], nodeStack[stackIndex]);
+            return stackIndex;
+        }
+        BinaryExpressionState.operator = operator;
+        /**
+         * Handles walking the `right` side of a `BinaryExpression`.
+         * @param machine State machine handler functions
+         * @param frame The current frame
+         * @returns The new frame
+         */
+        function right(machine, stackIndex, stateStack, nodeStack, userStateStack, _resultHolder, _outerState) {
+            ts.Debug.assertEqual(stateStack[stackIndex], right);
+            ts.Debug.assertIsDefined(machine.onRight);
+            stateStack[stackIndex] = nextState(machine, right);
+            var nextNode = machine.onRight(nodeStack[stackIndex].right, userStateStack[stackIndex], nodeStack[stackIndex]);
+            if (nextNode) {
+                checkCircularity(stackIndex, nodeStack, nextNode);
+                return pushStack(stackIndex, stateStack, nodeStack, userStateStack, nextNode);
+            }
+            return stackIndex;
+        }
+        BinaryExpressionState.right = right;
+        /**
+         * Handles walking out of a `BinaryExpression`.
+         * @param machine State machine handler functions
+         * @param frame The current frame
+         * @returns The new frame
+         */
+        function exit(machine, stackIndex, stateStack, nodeStack, userStateStack, resultHolder, _outerState) {
+            ts.Debug.assertEqual(stateStack[stackIndex], exit);
+            stateStack[stackIndex] = nextState(machine, exit);
+            var result = machine.onExit(nodeStack[stackIndex], userStateStack[stackIndex]);
+            if (stackIndex > 0) {
+                stackIndex--;
+                if (machine.foldState) {
+                    var side = stateStack[stackIndex] === exit ? "right" : "left";
+                    userStateStack[stackIndex] = machine.foldState(userStateStack[stackIndex], result, side);
+                }
+            }
+            else {
+                resultHolder.value = result;
+            }
+            return stackIndex;
+        }
+        BinaryExpressionState.exit = exit;
+        /**
+         * Handles a frame that is already done.
+         * @returns The `done` state.
+         */
+        function done(_machine, stackIndex, stateStack, _nodeStack, _userStateStack, _resultHolder, _outerState) {
+            ts.Debug.assertEqual(stateStack[stackIndex], done);
+            return stackIndex;
+        }
+        BinaryExpressionState.done = done;
+        function nextState(machine, currentState) {
+            switch (currentState) {
+                case enter:
+                    if (machine.onLeft)
+                        return left;
+                // falls through
+                case left:
+                    if (machine.onOperator)
+                        return operator;
+                // falls through
+                case operator:
+                    if (machine.onRight)
+                        return right;
+                // falls through
+                case right: return exit;
+                case exit: return done;
+                case done: return done;
+                default: ts.Debug.fail("Invalid state");
+            }
+        }
+        BinaryExpressionState.nextState = nextState;
+        function pushStack(stackIndex, stateStack, nodeStack, userStateStack, node) {
+            stackIndex++;
+            stateStack[stackIndex] = enter;
+            nodeStack[stackIndex] = node;
+            userStateStack[stackIndex] = undefined;
+            return stackIndex;
+        }
+        function checkCircularity(stackIndex, nodeStack, node) {
+            if (ts.Debug.shouldAssert(2 /* Aggressive */)) {
+                while (stackIndex >= 0) {
+                    ts.Debug.assert(nodeStack[stackIndex] !== node, "Circular traversal detected.");
+                    stackIndex--;
+                }
+            }
+        }
+    })(BinaryExpressionState || (BinaryExpressionState = {}));
+    /**
+     * Holds state machine handler functions
+     */
+    var BinaryExpressionStateMachine = /** @class */ (function () {
+        function BinaryExpressionStateMachine(onEnter, onLeft, onOperator, onRight, onExit, foldState) {
+            this.onEnter = onEnter;
+            this.onLeft = onLeft;
+            this.onOperator = onOperator;
+            this.onRight = onRight;
+            this.onExit = onExit;
+            this.foldState = foldState;
+        }
+        return BinaryExpressionStateMachine;
+    }());
+    function createBinaryExpressionTrampoline(onEnter, onLeft, onOperator, onRight, onExit, foldState) {
+        var machine = new BinaryExpressionStateMachine(onEnter, onLeft, onOperator, onRight, onExit, foldState);
+        return trampoline;
+        function trampoline(node, outerState) {
+            var resultHolder = { value: undefined };
+            var stateStack = [BinaryExpressionState.enter];
+            var nodeStack = [node];
+            var userStateStack = [undefined];
+            var stackIndex = 0;
+            while (stateStack[stackIndex] !== BinaryExpressionState.done) {
+                stackIndex = stateStack[stackIndex](machine, stackIndex, stateStack, nodeStack, userStateStack, resultHolder, outerState);
+            }
+            ts.Debug.assertEqual(stackIndex, 0);
+            return resultHolder.value;
+        }
     }
-    ts.isStaticModifier = isStaticModifier;
+    ts.createBinaryExpressionTrampoline = createBinaryExpressionTrampoline;
 })(ts || (ts = {}));
 var ts;
 (function (ts) {
@@ -28037,19 +29700,19 @@ var ts;
      * that they appear in the source code. The language service depends on this property to locate nodes by position.
      */
     function forEachChild(node, cbNode, cbNodes) {
-        if (!node || node.kind <= 156 /* LastToken */) {
+        if (!node || node.kind <= 159 /* LastToken */) {
             return;
         }
         switch (node.kind) {
-            case 157 /* QualifiedName */:
+            case 160 /* QualifiedName */:
                 return visitNode(cbNode, node.left) ||
                     visitNode(cbNode, node.right);
-            case 159 /* TypeParameter */:
+            case 162 /* TypeParameter */:
                 return visitNode(cbNode, node.name) ||
                     visitNode(cbNode, node.constraint) ||
                     visitNode(cbNode, node.default) ||
                     visitNode(cbNode, node.expression);
-            case 289 /* ShorthandPropertyAssignment */:
+            case 295 /* ShorthandPropertyAssignment */:
                 return visitNodes(cbNode, cbNodes, node.decorators) ||
                     visitNodes(cbNode, cbNodes, node.modifiers) ||
                     visitNode(cbNode, node.name) ||
@@ -28057,9 +29720,9 @@ var ts;
                     visitNode(cbNode, node.exclamationToken) ||
                     visitNode(cbNode, node.equalsToken) ||
                     visitNode(cbNode, node.objectAssignmentInitializer);
-            case 290 /* SpreadAssignment */:
+            case 296 /* SpreadAssignment */:
                 return visitNode(cbNode, node.expression);
-            case 160 /* Parameter */:
+            case 163 /* Parameter */:
                 return visitNodes(cbNode, cbNodes, node.decorators) ||
                     visitNodes(cbNode, cbNodes, node.modifiers) ||
                     visitNode(cbNode, node.dotDotDotToken) ||
@@ -28067,7 +29730,7 @@ var ts;
                     visitNode(cbNode, node.questionToken) ||
                     visitNode(cbNode, node.type) ||
                     visitNode(cbNode, node.initializer);
-            case 163 /* PropertyDeclaration */:
+            case 166 /* PropertyDeclaration */:
                 return visitNodes(cbNode, cbNodes, node.decorators) ||
                     visitNodes(cbNode, cbNodes, node.modifiers) ||
                     visitNode(cbNode, node.name) ||
@@ -28075,51 +29738,51 @@ var ts;
                     visitNode(cbNode, node.exclamationToken) ||
                     visitNode(cbNode, node.type) ||
                     visitNode(cbNode, node.initializer);
-            case 162 /* PropertySignature */:
+            case 165 /* PropertySignature */:
                 return visitNodes(cbNode, cbNodes, node.decorators) ||
                     visitNodes(cbNode, cbNodes, node.modifiers) ||
                     visitNode(cbNode, node.name) ||
                     visitNode(cbNode, node.questionToken) ||
                     visitNode(cbNode, node.type) ||
                     visitNode(cbNode, node.initializer);
-            case 288 /* PropertyAssignment */:
+            case 294 /* PropertyAssignment */:
                 return visitNodes(cbNode, cbNodes, node.decorators) ||
                     visitNodes(cbNode, cbNodes, node.modifiers) ||
                     visitNode(cbNode, node.name) ||
                     visitNode(cbNode, node.questionToken) ||
                     visitNode(cbNode, node.initializer);
-            case 249 /* VariableDeclaration */:
+            case 253 /* VariableDeclaration */:
                 return visitNodes(cbNode, cbNodes, node.decorators) ||
                     visitNodes(cbNode, cbNodes, node.modifiers) ||
                     visitNode(cbNode, node.name) ||
                     visitNode(cbNode, node.exclamationToken) ||
                     visitNode(cbNode, node.type) ||
                     visitNode(cbNode, node.initializer);
-            case 198 /* BindingElement */:
+            case 202 /* BindingElement */:
                 return visitNodes(cbNode, cbNodes, node.decorators) ||
                     visitNodes(cbNode, cbNodes, node.modifiers) ||
                     visitNode(cbNode, node.dotDotDotToken) ||
                     visitNode(cbNode, node.propertyName) ||
                     visitNode(cbNode, node.name) ||
                     visitNode(cbNode, node.initializer);
-            case 174 /* FunctionType */:
-            case 175 /* ConstructorType */:
-            case 169 /* CallSignature */:
-            case 170 /* ConstructSignature */:
-            case 171 /* IndexSignature */:
+            case 178 /* FunctionType */:
+            case 179 /* ConstructorType */:
+            case 173 /* CallSignature */:
+            case 174 /* ConstructSignature */:
+            case 175 /* IndexSignature */:
                 return visitNodes(cbNode, cbNodes, node.decorators) ||
                     visitNodes(cbNode, cbNodes, node.modifiers) ||
                     visitNodes(cbNode, cbNodes, node.typeParameters) ||
                     visitNodes(cbNode, cbNodes, node.parameters) ||
                     visitNode(cbNode, node.type);
-            case 165 /* MethodDeclaration */:
-            case 164 /* MethodSignature */:
-            case 166 /* Constructor */:
-            case 167 /* GetAccessor */:
-            case 168 /* SetAccessor */:
-            case 208 /* FunctionExpression */:
-            case 251 /* FunctionDeclaration */:
-            case 209 /* ArrowFunction */:
+            case 168 /* MethodDeclaration */:
+            case 167 /* MethodSignature */:
+            case 170 /* Constructor */:
+            case 171 /* GetAccessor */:
+            case 172 /* SetAccessor */:
+            case 212 /* FunctionExpression */:
+            case 255 /* FunctionDeclaration */:
+            case 213 /* ArrowFunction */:
                 return visitNodes(cbNode, cbNodes, node.decorators) ||
                     visitNodes(cbNode, cbNodes, node.modifiers) ||
                     visitNode(cbNode, node.asteriskToken) ||
@@ -28131,374 +29794,407 @@ var ts;
                     visitNode(cbNode, node.type) ||
                     visitNode(cbNode, node.equalsGreaterThanToken) ||
                     visitNode(cbNode, node.body);
-            case 173 /* TypeReference */:
+            case 169 /* ClassStaticBlockDeclaration */:
+                return visitNodes(cbNode, cbNodes, node.decorators) ||
+                    visitNodes(cbNode, cbNodes, node.modifiers) ||
+                    visitNode(cbNode, node.body);
+            case 177 /* TypeReference */:
                 return visitNode(cbNode, node.typeName) ||
                     visitNodes(cbNode, cbNodes, node.typeArguments);
-            case 172 /* TypePredicate */:
+            case 176 /* TypePredicate */:
                 return visitNode(cbNode, node.assertsModifier) ||
                     visitNode(cbNode, node.parameterName) ||
                     visitNode(cbNode, node.type);
-            case 176 /* TypeQuery */:
+            case 180 /* TypeQuery */:
                 return visitNode(cbNode, node.exprName);
-            case 177 /* TypeLiteral */:
+            case 181 /* TypeLiteral */:
                 return visitNodes(cbNode, cbNodes, node.members);
-            case 178 /* ArrayType */:
+            case 182 /* ArrayType */:
                 return visitNode(cbNode, node.elementType);
-            case 179 /* TupleType */:
+            case 183 /* TupleType */:
                 return visitNodes(cbNode, cbNodes, node.elements);
-            case 182 /* UnionType */:
-            case 183 /* IntersectionType */:
+            case 186 /* UnionType */:
+            case 187 /* IntersectionType */:
                 return visitNodes(cbNode, cbNodes, node.types);
-            case 184 /* ConditionalType */:
+            case 188 /* ConditionalType */:
                 return visitNode(cbNode, node.checkType) ||
                     visitNode(cbNode, node.extendsType) ||
                     visitNode(cbNode, node.trueType) ||
                     visitNode(cbNode, node.falseType);
-            case 185 /* InferType */:
+            case 189 /* InferType */:
                 return visitNode(cbNode, node.typeParameter);
-            case 195 /* ImportType */:
+            case 199 /* ImportType */:
                 return visitNode(cbNode, node.argument) ||
                     visitNode(cbNode, node.qualifier) ||
                     visitNodes(cbNode, cbNodes, node.typeArguments);
-            case 186 /* ParenthesizedType */:
-            case 188 /* TypeOperator */:
+            case 190 /* ParenthesizedType */:
+            case 192 /* TypeOperator */:
                 return visitNode(cbNode, node.type);
-            case 189 /* IndexedAccessType */:
+            case 193 /* IndexedAccessType */:
                 return visitNode(cbNode, node.objectType) ||
                     visitNode(cbNode, node.indexType);
-            case 190 /* MappedType */:
+            case 194 /* MappedType */:
                 return visitNode(cbNode, node.readonlyToken) ||
                     visitNode(cbNode, node.typeParameter) ||
                     visitNode(cbNode, node.nameType) ||
                     visitNode(cbNode, node.questionToken) ||
-                    visitNode(cbNode, node.type);
-            case 191 /* LiteralType */:
+                    visitNode(cbNode, node.type) ||
+                    visitNodes(cbNode, cbNodes, node.members);
+            case 195 /* LiteralType */:
                 return visitNode(cbNode, node.literal);
-            case 192 /* NamedTupleMember */:
+            case 196 /* NamedTupleMember */:
                 return visitNode(cbNode, node.dotDotDotToken) ||
                     visitNode(cbNode, node.name) ||
                     visitNode(cbNode, node.questionToken) ||
                     visitNode(cbNode, node.type);
-            case 196 /* ObjectBindingPattern */:
-            case 197 /* ArrayBindingPattern */:
+            case 200 /* ObjectBindingPattern */:
+            case 201 /* ArrayBindingPattern */:
                 return visitNodes(cbNode, cbNodes, node.elements);
-            case 199 /* ArrayLiteralExpression */:
+            case 203 /* ArrayLiteralExpression */:
                 return visitNodes(cbNode, cbNodes, node.elements);
-            case 200 /* ObjectLiteralExpression */:
+            case 204 /* ObjectLiteralExpression */:
                 return visitNodes(cbNode, cbNodes, node.properties);
-            case 201 /* PropertyAccessExpression */:
+            case 205 /* PropertyAccessExpression */:
                 return visitNode(cbNode, node.expression) ||
                     visitNode(cbNode, node.questionDotToken) ||
                     visitNode(cbNode, node.name);
-            case 202 /* ElementAccessExpression */:
+            case 206 /* ElementAccessExpression */:
                 return visitNode(cbNode, node.expression) ||
                     visitNode(cbNode, node.questionDotToken) ||
                     visitNode(cbNode, node.argumentExpression);
-            case 203 /* CallExpression */:
-            case 204 /* NewExpression */:
+            case 207 /* CallExpression */:
+            case 208 /* NewExpression */:
                 return visitNode(cbNode, node.expression) ||
                     visitNode(cbNode, node.questionDotToken) ||
                     visitNodes(cbNode, cbNodes, node.typeArguments) ||
                     visitNodes(cbNode, cbNodes, node.arguments);
-            case 205 /* TaggedTemplateExpression */:
+            case 209 /* TaggedTemplateExpression */:
                 return visitNode(cbNode, node.tag) ||
                     visitNode(cbNode, node.questionDotToken) ||
                     visitNodes(cbNode, cbNodes, node.typeArguments) ||
                     visitNode(cbNode, node.template);
-            case 206 /* TypeAssertionExpression */:
+            case 210 /* TypeAssertionExpression */:
                 return visitNode(cbNode, node.type) ||
                     visitNode(cbNode, node.expression);
-            case 207 /* ParenthesizedExpression */:
+            case 211 /* ParenthesizedExpression */:
                 return visitNode(cbNode, node.expression);
-            case 210 /* DeleteExpression */:
+            case 214 /* DeleteExpression */:
                 return visitNode(cbNode, node.expression);
-            case 211 /* TypeOfExpression */:
+            case 215 /* TypeOfExpression */:
                 return visitNode(cbNode, node.expression);
-            case 212 /* VoidExpression */:
+            case 216 /* VoidExpression */:
                 return visitNode(cbNode, node.expression);
-            case 214 /* PrefixUnaryExpression */:
+            case 218 /* PrefixUnaryExpression */:
                 return visitNode(cbNode, node.operand);
-            case 219 /* YieldExpression */:
+            case 223 /* YieldExpression */:
                 return visitNode(cbNode, node.asteriskToken) ||
                     visitNode(cbNode, node.expression);
-            case 213 /* AwaitExpression */:
+            case 217 /* AwaitExpression */:
                 return visitNode(cbNode, node.expression);
-            case 215 /* PostfixUnaryExpression */:
+            case 219 /* PostfixUnaryExpression */:
                 return visitNode(cbNode, node.operand);
-            case 216 /* BinaryExpression */:
+            case 220 /* BinaryExpression */:
                 return visitNode(cbNode, node.left) ||
                     visitNode(cbNode, node.operatorToken) ||
                     visitNode(cbNode, node.right);
-            case 224 /* AsExpression */:
+            case 228 /* AsExpression */:
                 return visitNode(cbNode, node.expression) ||
                     visitNode(cbNode, node.type);
-            case 225 /* NonNullExpression */:
+            case 229 /* NonNullExpression */:
                 return visitNode(cbNode, node.expression);
-            case 226 /* MetaProperty */:
+            case 230 /* MetaProperty */:
                 return visitNode(cbNode, node.name);
-            case 217 /* ConditionalExpression */:
+            case 221 /* ConditionalExpression */:
                 return visitNode(cbNode, node.condition) ||
                     visitNode(cbNode, node.questionToken) ||
                     visitNode(cbNode, node.whenTrue) ||
                     visitNode(cbNode, node.colonToken) ||
                     visitNode(cbNode, node.whenFalse);
-            case 220 /* SpreadElement */:
+            case 224 /* SpreadElement */:
                 return visitNode(cbNode, node.expression);
-            case 230 /* Block */:
-            case 257 /* ModuleBlock */:
+            case 234 /* Block */:
+            case 261 /* ModuleBlock */:
                 return visitNodes(cbNode, cbNodes, node.statements);
-            case 297 /* SourceFile */:
+            case 303 /* SourceFile */:
                 return visitNodes(cbNode, cbNodes, node.statements) ||
                     visitNode(cbNode, node.endOfFileToken);
-            case 232 /* VariableStatement */:
+            case 236 /* VariableStatement */:
                 return visitNodes(cbNode, cbNodes, node.decorators) ||
                     visitNodes(cbNode, cbNodes, node.modifiers) ||
                     visitNode(cbNode, node.declarationList);
-            case 250 /* VariableDeclarationList */:
+            case 254 /* VariableDeclarationList */:
                 return visitNodes(cbNode, cbNodes, node.declarations);
-            case 233 /* ExpressionStatement */:
+            case 237 /* ExpressionStatement */:
                 return visitNode(cbNode, node.expression);
-            case 234 /* IfStatement */:
+            case 238 /* IfStatement */:
                 return visitNode(cbNode, node.expression) ||
                     visitNode(cbNode, node.thenStatement) ||
                     visitNode(cbNode, node.elseStatement);
-            case 235 /* DoStatement */:
+            case 239 /* DoStatement */:
                 return visitNode(cbNode, node.statement) ||
                     visitNode(cbNode, node.expression);
-            case 236 /* WhileStatement */:
+            case 240 /* WhileStatement */:
                 return visitNode(cbNode, node.expression) ||
                     visitNode(cbNode, node.statement);
-            case 237 /* ForStatement */:
+            case 241 /* ForStatement */:
                 return visitNode(cbNode, node.initializer) ||
                     visitNode(cbNode, node.condition) ||
                     visitNode(cbNode, node.incrementor) ||
                     visitNode(cbNode, node.statement);
-            case 238 /* ForInStatement */:
+            case 242 /* ForInStatement */:
                 return visitNode(cbNode, node.initializer) ||
                     visitNode(cbNode, node.expression) ||
                     visitNode(cbNode, node.statement);
-            case 239 /* ForOfStatement */:
+            case 243 /* ForOfStatement */:
                 return visitNode(cbNode, node.awaitModifier) ||
                     visitNode(cbNode, node.initializer) ||
                     visitNode(cbNode, node.expression) ||
                     visitNode(cbNode, node.statement);
-            case 240 /* ContinueStatement */:
-            case 241 /* BreakStatement */:
+            case 244 /* ContinueStatement */:
+            case 245 /* BreakStatement */:
                 return visitNode(cbNode, node.label);
-            case 242 /* ReturnStatement */:
+            case 246 /* ReturnStatement */:
                 return visitNode(cbNode, node.expression);
-            case 243 /* WithStatement */:
+            case 247 /* WithStatement */:
                 return visitNode(cbNode, node.expression) ||
                     visitNode(cbNode, node.statement);
-            case 244 /* SwitchStatement */:
+            case 248 /* SwitchStatement */:
                 return visitNode(cbNode, node.expression) ||
                     visitNode(cbNode, node.caseBlock);
-            case 258 /* CaseBlock */:
+            case 262 /* CaseBlock */:
                 return visitNodes(cbNode, cbNodes, node.clauses);
-            case 284 /* CaseClause */:
+            case 288 /* CaseClause */:
                 return visitNode(cbNode, node.expression) ||
                     visitNodes(cbNode, cbNodes, node.statements);
-            case 285 /* DefaultClause */:
+            case 289 /* DefaultClause */:
                 return visitNodes(cbNode, cbNodes, node.statements);
-            case 245 /* LabeledStatement */:
+            case 249 /* LabeledStatement */:
                 return visitNode(cbNode, node.label) ||
                     visitNode(cbNode, node.statement);
-            case 246 /* ThrowStatement */:
+            case 250 /* ThrowStatement */:
                 return visitNode(cbNode, node.expression);
-            case 247 /* TryStatement */:
+            case 251 /* TryStatement */:
                 return visitNode(cbNode, node.tryBlock) ||
                     visitNode(cbNode, node.catchClause) ||
                     visitNode(cbNode, node.finallyBlock);
-            case 287 /* CatchClause */:
+            case 291 /* CatchClause */:
                 return visitNode(cbNode, node.variableDeclaration) ||
                     visitNode(cbNode, node.block);
-            case 161 /* Decorator */:
+            case 164 /* Decorator */:
                 return visitNode(cbNode, node.expression);
-            case 252 /* ClassDeclaration */:
-            case 221 /* ClassExpression */:
+            case 256 /* ClassDeclaration */:
+            case 225 /* ClassExpression */:
                 return visitNodes(cbNode, cbNodes, node.decorators) ||
                     visitNodes(cbNode, cbNodes, node.modifiers) ||
                     visitNode(cbNode, node.name) ||
                     visitNodes(cbNode, cbNodes, node.typeParameters) ||
                     visitNodes(cbNode, cbNodes, node.heritageClauses) ||
                     visitNodes(cbNode, cbNodes, node.members);
-            case 253 /* InterfaceDeclaration */:
+            case 257 /* InterfaceDeclaration */:
                 return visitNodes(cbNode, cbNodes, node.decorators) ||
                     visitNodes(cbNode, cbNodes, node.modifiers) ||
                     visitNode(cbNode, node.name) ||
                     visitNodes(cbNode, cbNodes, node.typeParameters) ||
                     visitNodes(cbNode, cbNodes, node.heritageClauses) ||
                     visitNodes(cbNode, cbNodes, node.members);
-            case 254 /* TypeAliasDeclaration */:
+            case 258 /* TypeAliasDeclaration */:
                 return visitNodes(cbNode, cbNodes, node.decorators) ||
                     visitNodes(cbNode, cbNodes, node.modifiers) ||
                     visitNode(cbNode, node.name) ||
                     visitNodes(cbNode, cbNodes, node.typeParameters) ||
                     visitNode(cbNode, node.type);
-            case 255 /* EnumDeclaration */:
+            case 259 /* EnumDeclaration */:
                 return visitNodes(cbNode, cbNodes, node.decorators) ||
                     visitNodes(cbNode, cbNodes, node.modifiers) ||
                     visitNode(cbNode, node.name) ||
                     visitNodes(cbNode, cbNodes, node.members);
-            case 291 /* EnumMember */:
+            case 297 /* EnumMember */:
                 return visitNode(cbNode, node.name) ||
                     visitNode(cbNode, node.initializer);
-            case 256 /* ModuleDeclaration */:
+            case 260 /* ModuleDeclaration */:
                 return visitNodes(cbNode, cbNodes, node.decorators) ||
                     visitNodes(cbNode, cbNodes, node.modifiers) ||
                     visitNode(cbNode, node.name) ||
                     visitNode(cbNode, node.body);
-            case 260 /* ImportEqualsDeclaration */:
+            case 264 /* ImportEqualsDeclaration */:
                 return visitNodes(cbNode, cbNodes, node.decorators) ||
                     visitNodes(cbNode, cbNodes, node.modifiers) ||
                     visitNode(cbNode, node.name) ||
                     visitNode(cbNode, node.moduleReference);
-            case 261 /* ImportDeclaration */:
+            case 265 /* ImportDeclaration */:
                 return visitNodes(cbNode, cbNodes, node.decorators) ||
                     visitNodes(cbNode, cbNodes, node.modifiers) ||
                     visitNode(cbNode, node.importClause) ||
-                    visitNode(cbNode, node.moduleSpecifier);
-            case 262 /* ImportClause */:
+                    visitNode(cbNode, node.moduleSpecifier) ||
+                    visitNode(cbNode, node.assertClause);
+            case 266 /* ImportClause */:
                 return visitNode(cbNode, node.name) ||
                     visitNode(cbNode, node.namedBindings);
-            case 259 /* NamespaceExportDeclaration */:
+            case 292 /* AssertClause */:
+                return visitNodes(cbNode, cbNodes, node.elements);
+            case 293 /* AssertEntry */:
+                return visitNode(cbNode, node.name) ||
+                    visitNode(cbNode, node.value);
+            case 263 /* NamespaceExportDeclaration */:
                 return visitNode(cbNode, node.name);
-            case 263 /* NamespaceImport */:
+            case 267 /* NamespaceImport */:
                 return visitNode(cbNode, node.name);
-            case 269 /* NamespaceExport */:
+            case 273 /* NamespaceExport */:
                 return visitNode(cbNode, node.name);
-            case 264 /* NamedImports */:
-            case 268 /* NamedExports */:
+            case 268 /* NamedImports */:
+            case 272 /* NamedExports */:
                 return visitNodes(cbNode, cbNodes, node.elements);
-            case 267 /* ExportDeclaration */:
+            case 271 /* ExportDeclaration */:
                 return visitNodes(cbNode, cbNodes, node.decorators) ||
                     visitNodes(cbNode, cbNodes, node.modifiers) ||
                     visitNode(cbNode, node.exportClause) ||
-                    visitNode(cbNode, node.moduleSpecifier);
-            case 265 /* ImportSpecifier */:
-            case 270 /* ExportSpecifier */:
+                    visitNode(cbNode, node.moduleSpecifier) ||
+                    visitNode(cbNode, node.assertClause);
+            case 269 /* ImportSpecifier */:
+            case 274 /* ExportSpecifier */:
                 return visitNode(cbNode, node.propertyName) ||
                     visitNode(cbNode, node.name);
-            case 266 /* ExportAssignment */:
+            case 270 /* ExportAssignment */:
                 return visitNodes(cbNode, cbNodes, node.decorators) ||
                     visitNodes(cbNode, cbNodes, node.modifiers) ||
                     visitNode(cbNode, node.expression);
-            case 218 /* TemplateExpression */:
+            case 222 /* TemplateExpression */:
                 return visitNode(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans);
-            case 228 /* TemplateSpan */:
+            case 232 /* TemplateSpan */:
                 return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal);
-            case 193 /* TemplateLiteralType */:
+            case 197 /* TemplateLiteralType */:
                 return visitNode(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans);
-            case 194 /* TemplateLiteralTypeSpan */:
+            case 198 /* TemplateLiteralTypeSpan */:
                 return visitNode(cbNode, node.type) || visitNode(cbNode, node.literal);
-            case 158 /* ComputedPropertyName */:
+            case 161 /* ComputedPropertyName */:
                 return visitNode(cbNode, node.expression);
-            case 286 /* HeritageClause */:
+            case 290 /* HeritageClause */:
                 return visitNodes(cbNode, cbNodes, node.types);
-            case 223 /* ExpressionWithTypeArguments */:
+            case 227 /* ExpressionWithTypeArguments */:
                 return visitNode(cbNode, node.expression) ||
                     visitNodes(cbNode, cbNodes, node.typeArguments);
-            case 272 /* ExternalModuleReference */:
+            case 276 /* ExternalModuleReference */:
                 return visitNode(cbNode, node.expression);
-            case 271 /* MissingDeclaration */:
+            case 275 /* MissingDeclaration */:
                 return visitNodes(cbNode, cbNodes, node.decorators);
-            case 337 /* CommaListExpression */:
+            case 349 /* CommaListExpression */:
                 return visitNodes(cbNode, cbNodes, node.elements);
-            case 273 /* JsxElement */:
+            case 277 /* JsxElement */:
                 return visitNode(cbNode, node.openingElement) ||
                     visitNodes(cbNode, cbNodes, node.children) ||
                     visitNode(cbNode, node.closingElement);
-            case 277 /* JsxFragment */:
+            case 281 /* JsxFragment */:
                 return visitNode(cbNode, node.openingFragment) ||
                     visitNodes(cbNode, cbNodes, node.children) ||
                     visitNode(cbNode, node.closingFragment);
-            case 274 /* JsxSelfClosingElement */:
-            case 275 /* JsxOpeningElement */:
+            case 278 /* JsxSelfClosingElement */:
+            case 279 /* JsxOpeningElement */:
                 return visitNode(cbNode, node.tagName) ||
                     visitNodes(cbNode, cbNodes, node.typeArguments) ||
                     visitNode(cbNode, node.attributes);
-            case 281 /* JsxAttributes */:
+            case 285 /* JsxAttributes */:
                 return visitNodes(cbNode, cbNodes, node.properties);
-            case 280 /* JsxAttribute */:
+            case 284 /* JsxAttribute */:
                 return visitNode(cbNode, node.name) ||
                     visitNode(cbNode, node.initializer);
-            case 282 /* JsxSpreadAttribute */:
+            case 286 /* JsxSpreadAttribute */:
                 return visitNode(cbNode, node.expression);
-            case 283 /* JsxExpression */:
+            case 287 /* JsxExpression */:
                 return visitNode(cbNode, node.dotDotDotToken) ||
                     visitNode(cbNode, node.expression);
-            case 276 /* JsxClosingElement */:
+            case 280 /* JsxClosingElement */:
                 return visitNode(cbNode, node.tagName);
-            case 180 /* OptionalType */:
-            case 181 /* RestType */:
-            case 301 /* JSDocTypeExpression */:
-            case 306 /* JSDocNonNullableType */:
-            case 305 /* JSDocNullableType */:
-            case 307 /* JSDocOptionalType */:
-            case 309 /* JSDocVariadicType */:
+            case 184 /* OptionalType */:
+            case 185 /* RestType */:
+            case 307 /* JSDocTypeExpression */:
+            case 313 /* JSDocNonNullableType */:
+            case 312 /* JSDocNullableType */:
+            case 314 /* JSDocOptionalType */:
+            case 316 /* JSDocVariadicType */:
                 return visitNode(cbNode, node.type);
-            case 308 /* JSDocFunctionType */:
+            case 315 /* JSDocFunctionType */:
                 return visitNodes(cbNode, cbNodes, node.parameters) ||
                     visitNode(cbNode, node.type);
-            case 311 /* JSDocComment */:
-                return visitNodes(cbNode, cbNodes, node.tags);
-            case 332 /* JSDocSeeTag */:
+            case 318 /* JSDocComment */:
+                return (typeof node.comment === "string" ? undefined : visitNodes(cbNode, cbNodes, node.comment))
+                    || visitNodes(cbNode, cbNodes, node.tags);
+            case 344 /* JSDocSeeTag */:
                 return visitNode(cbNode, node.tagName) ||
-                    visitNode(cbNode, node.name);
-            case 302 /* JSDocNameReference */:
+                    visitNode(cbNode, node.name) ||
+                    (typeof node.comment === "string" ? undefined : visitNodes(cbNode, cbNodes, node.comment));
+            case 308 /* JSDocNameReference */:
                 return visitNode(cbNode, node.name);
-            case 326 /* JSDocParameterTag */:
-            case 333 /* JSDocPropertyTag */:
+            case 309 /* JSDocMemberName */:
+                return visitNode(cbNode, node.left) ||
+                    visitNode(cbNode, node.right);
+            case 338 /* JSDocParameterTag */:
+            case 345 /* JSDocPropertyTag */:
                 return visitNode(cbNode, node.tagName) ||
                     (node.isNameFirst
                         ? visitNode(cbNode, node.name) ||
-                            visitNode(cbNode, node.typeExpression)
+                            visitNode(cbNode, node.typeExpression) ||
+                            (typeof node.comment === "string" ? undefined : visitNodes(cbNode, cbNodes, node.comment))
                         : visitNode(cbNode, node.typeExpression) ||
-                            visitNode(cbNode, node.name));
-            case 317 /* JSDocAuthorTag */:
-                return visitNode(cbNode, node.tagName);
-            case 316 /* JSDocImplementsTag */:
+                            visitNode(cbNode, node.name) ||
+                            (typeof node.comment === "string" ? undefined : visitNodes(cbNode, cbNodes, node.comment)));
+            case 328 /* JSDocAuthorTag */:
                 return visitNode(cbNode, node.tagName) ||
-                    visitNode(cbNode, node.class);
-            case 315 /* JSDocAugmentsTag */:
+                    (typeof node.comment === "string" ? undefined : visitNodes(cbNode, cbNodes, node.comment));
+            case 327 /* JSDocImplementsTag */:
                 return visitNode(cbNode, node.tagName) ||
-                    visitNode(cbNode, node.class);
-            case 330 /* JSDocTemplateTag */:
+                    visitNode(cbNode, node.class) ||
+                    (typeof node.comment === "string" ? undefined : visitNodes(cbNode, cbNodes, node.comment));
+            case 326 /* JSDocAugmentsTag */:
+                return visitNode(cbNode, node.tagName) ||
+                    visitNode(cbNode, node.class) ||
+                    (typeof node.comment === "string" ? undefined : visitNodes(cbNode, cbNodes, node.comment));
+            case 342 /* JSDocTemplateTag */:
                 return visitNode(cbNode, node.tagName) ||
                     visitNode(cbNode, node.constraint) ||
-                    visitNodes(cbNode, cbNodes, node.typeParameters);
-            case 331 /* JSDocTypedefTag */:
+                    visitNodes(cbNode, cbNodes, node.typeParameters) ||
+                    (typeof node.comment === "string" ? undefined : visitNodes(cbNode, cbNodes, node.comment));
+            case 343 /* JSDocTypedefTag */:
                 return visitNode(cbNode, node.tagName) ||
                     (node.typeExpression &&
-                        node.typeExpression.kind === 301 /* JSDocTypeExpression */
+                        node.typeExpression.kind === 307 /* JSDocTypeExpression */
                         ? visitNode(cbNode, node.typeExpression) ||
-                            visitNode(cbNode, node.fullName)
+                            visitNode(cbNode, node.fullName) ||
+                            (typeof node.comment === "string" ? undefined : visitNodes(cbNode, cbNodes, node.comment))
                         : visitNode(cbNode, node.fullName) ||
-                            visitNode(cbNode, node.typeExpression));
-            case 324 /* JSDocCallbackTag */:
+                            visitNode(cbNode, node.typeExpression) ||
+                            (typeof node.comment === "string" ? undefined : visitNodes(cbNode, cbNodes, node.comment)));
+            case 336 /* JSDocCallbackTag */:
                 return visitNode(cbNode, node.tagName) ||
                     visitNode(cbNode, node.fullName) ||
-                    visitNode(cbNode, node.typeExpression);
-            case 327 /* JSDocReturnTag */:
-            case 329 /* JSDocTypeTag */:
-            case 328 /* JSDocThisTag */:
-            case 325 /* JSDocEnumTag */:
+                    visitNode(cbNode, node.typeExpression) ||
+                    (typeof node.comment === "string" ? undefined : visitNodes(cbNode, cbNodes, node.comment));
+            case 339 /* JSDocReturnTag */:
+            case 341 /* JSDocTypeTag */:
+            case 340 /* JSDocThisTag */:
+            case 337 /* JSDocEnumTag */:
                 return visitNode(cbNode, node.tagName) ||
-                    visitNode(cbNode, node.typeExpression);
-            case 313 /* JSDocSignature */:
+                    visitNode(cbNode, node.typeExpression) ||
+                    (typeof node.comment === "string" ? undefined : visitNodes(cbNode, cbNodes, node.comment));
+            case 321 /* JSDocSignature */:
                 return ts.forEach(node.typeParameters, cbNode) ||
                     ts.forEach(node.parameters, cbNode) ||
                     visitNode(cbNode, node.type);
-            case 312 /* JSDocTypeLiteral */:
+            case 322 /* JSDocLink */:
+            case 323 /* JSDocLinkCode */:
+            case 324 /* JSDocLinkPlain */:
+                return visitNode(cbNode, node.name);
+            case 320 /* JSDocTypeLiteral */:
                 return ts.forEach(node.jsDocPropertyTags, cbNode);
-            case 314 /* JSDocTag */:
-            case 319 /* JSDocClassTag */:
-            case 320 /* JSDocPublicTag */:
-            case 321 /* JSDocPrivateTag */:
-            case 322 /* JSDocProtectedTag */:
-            case 323 /* JSDocReadonlyTag */:
-                return visitNode(cbNode, node.tagName);
-            case 336 /* PartiallyEmittedExpression */:
+            case 325 /* JSDocTag */:
+            case 330 /* JSDocClassTag */:
+            case 331 /* JSDocPublicTag */:
+            case 332 /* JSDocPrivateTag */:
+            case 333 /* JSDocProtectedTag */:
+            case 334 /* JSDocReadonlyTag */:
+            case 329 /* JSDocDeprecatedTag */:
+                return visitNode(cbNode, node.tagName)
+                    || (typeof node.comment === "string" ? undefined : visitNodes(cbNode, cbNodes, node.comment));
+            case 348 /* PartiallyEmittedExpression */:
                 return visitNode(cbNode, node.expression);
         }
     }
@@ -28547,7 +30243,7 @@ var ts;
                         continue;
                     return res;
                 }
-                if (current.kind >= 157 /* FirstNode */) {
+                if (current.kind >= 160 /* FirstNode */) {
                     // add children in reverse order to the queue, so popping gives the first child
                     for (var _i = 0, _a = gatherPossibleChildren(current); _i < _a.length; _i++) {
                         var child = _a[_i];
@@ -28764,11 +30460,12 @@ var ts;
         // attached to the EOF token.
         var parseErrorBeforeNextFinishedNode = false;
         function parseSourceFile(fileName, sourceText, languageVersion, syntaxCursor, setParentNodes, scriptKind) {
+            var _a;
             if (setParentNodes === void 0) { setParentNodes = false; }
             scriptKind = ts.ensureScriptKind(fileName, scriptKind);
             if (scriptKind === 6 /* JSON */) {
                 var result_3 = parseJsonText(fileName, sourceText, languageVersion, syntaxCursor, setParentNodes);
-                ts.convertToObjectWorker(result_3, result_3.parseDiagnostics, /*returnValue*/ false, /*knownRootOptions*/ undefined, /*jsonConversionNotifier*/ undefined);
+                ts.convertToObjectWorker(result_3, (_a = result_3.statements[0]) === null || _a === void 0 ? void 0 : _a.expression, result_3.parseDiagnostics, /*returnValue*/ false, /*knownRootOptions*/ undefined, /*jsonConversionNotifier*/ undefined);
                 result_3.referencedFiles = ts.emptyArray;
                 result_3.typeReferenceDirectives = ts.emptyArray;
                 result_3.libReferenceDirectives = ts.emptyArray;
@@ -28808,35 +30505,54 @@ var ts;
                 endOfFileToken = parseTokenNode();
             }
             else {
-                var expression = void 0;
-                switch (token()) {
-                    case 22 /* OpenBracketToken */:
-                        expression = parseArrayLiteralExpression();
-                        break;
-                    case 109 /* TrueKeyword */:
-                    case 94 /* FalseKeyword */:
-                    case 103 /* NullKeyword */:
-                        expression = parseTokenNode();
-                        break;
-                    case 40 /* MinusToken */:
-                        if (lookAhead(function () { return nextToken() === 8 /* NumericLiteral */ && nextToken() !== 58 /* ColonToken */; })) {
-                            expression = parsePrefixUnaryExpression();
-                        }
-                        else {
-                            expression = parseObjectLiteralExpression();
-                        }
-                        break;
-                    case 8 /* NumericLiteral */:
-                    case 10 /* StringLiteral */:
-                        if (lookAhead(function () { return nextToken() !== 58 /* ColonToken */; })) {
-                            expression = parseLiteralNode();
+                // Loop and synthesize an ArrayLiteralExpression if there are more than
+                // one top-level expressions to ensure all input text is consumed.
+                var expressions = void 0;
+                while (token() !== 1 /* EndOfFileToken */) {
+                    var expression_1 = void 0;
+                    switch (token()) {
+                        case 22 /* OpenBracketToken */:
+                            expression_1 = parseArrayLiteralExpression();
+                            break;
+                        case 110 /* TrueKeyword */:
+                        case 95 /* FalseKeyword */:
+                        case 104 /* NullKeyword */:
+                            expression_1 = parseTokenNode();
+                            break;
+                        case 40 /* MinusToken */:
+                            if (lookAhead(function () { return nextToken() === 8 /* NumericLiteral */ && nextToken() !== 58 /* ColonToken */; })) {
+                                expression_1 = parsePrefixUnaryExpression();
+                            }
+                            else {
+                                expression_1 = parseObjectLiteralExpression();
+                            }
                             break;
+                        case 8 /* NumericLiteral */:
+                        case 10 /* StringLiteral */:
+                            if (lookAhead(function () { return nextToken() !== 58 /* ColonToken */; })) {
+                                expression_1 = parseLiteralNode();
+                                break;
+                            }
+                        // falls through
+                        default:
+                            expression_1 = parseObjectLiteralExpression();
+                            break;
+                    }
+                    // Error recovery: collect multiple top-level expressions
+                    if (expressions && ts.isArray(expressions)) {
+                        expressions.push(expression_1);
+                    }
+                    else if (expressions) {
+                        expressions = [expressions, expression_1];
+                    }
+                    else {
+                        expressions = expression_1;
+                        if (token() !== 1 /* EndOfFileToken */) {
+                            parseErrorAtCurrentToken(ts.Diagnostics.Unexpected_token);
                         }
-                    // falls through
-                    default:
-                        expression = parseObjectLiteralExpression();
-                        break;
+                    }
                 }
+                var expression = ts.isArray(expressions) ? finishNode(factory.createArrayLiteralExpression(expressions), pos) : ts.Debug.checkDefined(expressions);
                 var statement = factory.createExpressionStatement(expression);
                 finishNode(statement, pos);
                 statements = createNodeArray([statement], pos);
@@ -29031,7 +30747,7 @@ var ts;
             return factory.updateSourceFile(sourceFile, ts.setTextRange(factory.createNodeArray(statements), sourceFile.statements));
             function containsPossibleTopLevelAwait(node) {
                 return !(node.flags & 32768 /* AwaitContext */)
-                    && !!(node.transformFlags & 8388608 /* ContainsPossibleTopLevelAwait */);
+                    && !!(node.transformFlags & 16777216 /* ContainsPossibleTopLevelAwait */);
             }
             function findNextStatementWithAwait(statements, start) {
                 for (var i = start; i < statements.length; i++) {
@@ -29072,7 +30788,7 @@ var ts;
             ts.setTextRangePosWidth(sourceFile, 0, sourceText.length);
             setExternalModuleIndicator(sourceFile);
             // If we parsed this as an external module, it may contain top-level await
-            if (!isDeclarationFile && isExternalModule(sourceFile) && sourceFile.transformFlags & 8388608 /* ContainsPossibleTopLevelAwait */) {
+            if (!isDeclarationFile && isExternalModule(sourceFile) && sourceFile.transformFlags & 16777216 /* ContainsPossibleTopLevelAwait */) {
                 sourceFile = reparseTopLevelAwait(sourceFile);
             }
             sourceFile.text = sourceText;
@@ -29252,6 +30968,9 @@ var ts;
         function reScanLessThanToken() {
             return currentToken = scanner.reScanLessThanToken();
         }
+        function reScanHashToken() {
+            return currentToken = scanner.reScanHashToken();
+        }
         function scanJsxIdentifier() {
             return currentToken = scanner.scanJsxIdentifier();
         }
@@ -29306,27 +31025,28 @@ var ts;
             return speculationHelper(callback, 0 /* TryParse */);
         }
         function isBindingIdentifier() {
-            if (token() === 78 /* Identifier */) {
+            if (token() === 79 /* Identifier */) {
                 return true;
             }
-            return token() > 115 /* LastReservedWord */;
+            // `let await`/`let yield` in [Yield] or [Await] are allowed here and disallowed in the binder.
+            return token() > 116 /* LastReservedWord */;
         }
         // Ignore strict mode flag because we will report an error in type checker instead.
         function isIdentifier() {
-            if (token() === 78 /* Identifier */) {
+            if (token() === 79 /* Identifier */) {
                 return true;
             }
             // If we have a 'yield' keyword, and we're in the [yield] context, then 'yield' is
             // considered a keyword and is not an identifier.
-            if (token() === 124 /* YieldKeyword */ && inYieldContext()) {
+            if (token() === 125 /* YieldKeyword */ && inYieldContext()) {
                 return false;
             }
             // If we have a 'await' keyword, and we're in the [Await] context, then 'await' is
             // considered a keyword and is not an identifier.
-            if (token() === 130 /* AwaitKeyword */ && inAwaitContext()) {
+            if (token() === 132 /* AwaitKeyword */ && inAwaitContext()) {
                 return false;
             }
-            return token() > 115 /* LastReservedWord */;
+            return token() > 116 /* LastReservedWord */;
         }
         function parseExpected(kind, diagnosticMessage, shouldAdvance) {
             if (shouldAdvance === void 0) { shouldAdvance = true; }
@@ -29345,6 +31065,128 @@ var ts;
             }
             return false;
         }
+        var viableKeywordSuggestions = Object.keys(ts.textToKeywordObj).filter(function (keyword) { return keyword.length > 2; });
+        /**
+         * Provides a better error message than the generic "';' expected" if possible for
+         * known common variants of a missing semicolon, such as from a mispelled names.
+         *
+         * @param node Node preceding the expected semicolon location.
+         */
+        function parseErrorForMissingSemicolonAfter(node) {
+            var _a;
+            // Tagged template literals are sometimes used in places where only simple strings are allowed, i.e.:
+            //   module `M1` {
+            //   ^^^^^^^^^^^ This block is parsed as a template literal like module`M1`.
+            if (ts.isTaggedTemplateExpression(node)) {
+                parseErrorAt(ts.skipTrivia(sourceText, node.template.pos), node.template.end, ts.Diagnostics.Module_declaration_names_may_only_use_or_quoted_strings);
+                return;
+            }
+            // Otherwise, if this isn't a well-known keyword-like identifier, give the generic fallback message.
+            var expressionText = ts.isIdentifier(node) ? ts.idText(node) : undefined;
+            if (!expressionText || !ts.isIdentifierText(expressionText, languageVersion)) {
+                parseErrorAtCurrentToken(ts.Diagnostics._0_expected, ts.tokenToString(26 /* SemicolonToken */));
+                return;
+            }
+            var pos = ts.skipTrivia(sourceText, node.pos);
+            // Some known keywords are likely signs of syntax being used improperly.
+            switch (expressionText) {
+                case "const":
+                case "let":
+                case "var":
+                    parseErrorAt(pos, node.end, ts.Diagnostics.Variable_declaration_not_allowed_at_this_location);
+                    return;
+                case "declare":
+                    // If a declared node failed to parse, it would have emitted a diagnostic already.
+                    return;
+                case "interface":
+                    parseErrorForInvalidName(ts.Diagnostics.Interface_name_cannot_be_0, ts.Diagnostics.Interface_must_be_given_a_name, 18 /* OpenBraceToken */);
+                    return;
+                case "is":
+                    parseErrorAt(pos, scanner.getTextPos(), ts.Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods);
+                    return;
+                case "module":
+                case "namespace":
+                    parseErrorForInvalidName(ts.Diagnostics.Namespace_name_cannot_be_0, ts.Diagnostics.Namespace_must_be_given_a_name, 18 /* OpenBraceToken */);
+                    return;
+                case "type":
+                    parseErrorForInvalidName(ts.Diagnostics.Type_alias_name_cannot_be_0, ts.Diagnostics.Type_alias_must_be_given_a_name, 63 /* EqualsToken */);
+                    return;
+            }
+            // The user alternatively might have misspelled or forgotten to add a space after a common keyword.
+            var suggestion = (_a = ts.getSpellingSuggestion(expressionText, viableKeywordSuggestions, function (n) { return n; })) !== null && _a !== void 0 ? _a : getSpaceSuggestion(expressionText);
+            if (suggestion) {
+                parseErrorAt(pos, node.end, ts.Diagnostics.Unknown_keyword_or_identifier_Did_you_mean_0, suggestion);
+                return;
+            }
+            // Unknown tokens are handled with their own errors in the scanner
+            if (token() === 0 /* Unknown */) {
+                return;
+            }
+            // Otherwise, we know this some kind of unknown word, not just a missing expected semicolon.
+            parseErrorAt(pos, node.end, ts.Diagnostics.Unexpected_keyword_or_identifier);
+        }
+        /**
+         * Reports a diagnostic error for the current token being an invalid name.
+         *
+         * @param blankDiagnostic Diagnostic to report for the case of the name being blank (matched tokenIfBlankName).
+         * @param nameDiagnostic Diagnostic to report for all other cases.
+         * @param tokenIfBlankName Current token if the name was invalid for being blank (not provided / skipped).
+         */
+        function parseErrorForInvalidName(nameDiagnostic, blankDiagnostic, tokenIfBlankName) {
+            if (token() === tokenIfBlankName) {
+                parseErrorAtCurrentToken(blankDiagnostic);
+            }
+            else {
+                parseErrorAtCurrentToken(nameDiagnostic, scanner.getTokenValue());
+            }
+        }
+        function getSpaceSuggestion(expressionText) {
+            for (var _i = 0, viableKeywordSuggestions_1 = viableKeywordSuggestions; _i < viableKeywordSuggestions_1.length; _i++) {
+                var keyword = viableKeywordSuggestions_1[_i];
+                if (expressionText.length > keyword.length + 2 && ts.startsWith(expressionText, keyword)) {
+                    return "".concat(keyword, " ").concat(expressionText.slice(keyword.length));
+                }
+            }
+            return undefined;
+        }
+        function parseSemicolonAfterPropertyName(name, type, initializer) {
+            if (token() === 59 /* AtToken */ && !scanner.hasPrecedingLineBreak()) {
+                parseErrorAtCurrentToken(ts.Diagnostics.Decorators_must_precede_the_name_and_all_keywords_of_property_declarations);
+                return;
+            }
+            if (token() === 20 /* OpenParenToken */) {
+                parseErrorAtCurrentToken(ts.Diagnostics.Cannot_start_a_function_call_in_a_type_annotation);
+                nextToken();
+                return;
+            }
+            if (type && !canParseSemicolon()) {
+                if (initializer) {
+                    parseErrorAtCurrentToken(ts.Diagnostics._0_expected, ts.tokenToString(26 /* SemicolonToken */));
+                }
+                else {
+                    parseErrorAtCurrentToken(ts.Diagnostics.Expected_for_property_initializer);
+                }
+                return;
+            }
+            if (tryParseSemicolon()) {
+                return;
+            }
+            // If an initializer was parsed but there is still an error in finding the next semicolon,
+            // we generally know there was an error already reported in the initializer...
+            //   class Example { a = new Map([), ) }
+            //                                ~
+            if (initializer) {
+                // ...unless we've found the start of a block after a property declaration, in which
+                // case we can know that regardless of the initializer we should complain on the block.
+                //   class Example { a = 0 {} }
+                //                         ~
+                if (token() === 18 /* OpenBraceToken */) {
+                    parseErrorAtCurrentToken(ts.Diagnostics._0_expected, ts.tokenToString(26 /* SemicolonToken */));
+                }
+                return;
+            }
+            parseErrorForMissingSemicolonAfter(name);
+        }
         function parseExpectedJSDoc(kind) {
             if (token() === kind) {
                 nextTokenJSDoc();
@@ -29400,17 +31242,18 @@ var ts;
             // We can parse out an optional semicolon in ASI cases in the following cases.
             return token() === 19 /* CloseBraceToken */ || token() === 1 /* EndOfFileToken */ || scanner.hasPrecedingLineBreak();
         }
-        function parseSemicolon() {
-            if (canParseSemicolon()) {
-                if (token() === 26 /* SemicolonToken */) {
-                    // consume the semicolon if it was explicitly provided.
-                    nextToken();
-                }
-                return true;
+        function tryParseSemicolon() {
+            if (!canParseSemicolon()) {
+                return false;
             }
-            else {
-                return parseExpected(26 /* SemicolonToken */);
+            if (token() === 26 /* SemicolonToken */) {
+                // consume the semicolon if it was explicitly provided.
+                nextToken();
             }
+            return true;
+        }
+        function parseSemicolon() {
+            return tryParseSemicolon() || parseExpected(26 /* SemicolonToken */);
         }
         function createNodeArray(elements, pos, end, hasTrailingComma) {
             var array = factory.createNodeArray(elements, hasTrailingComma);
@@ -29439,11 +31282,11 @@ var ts;
                 parseErrorAtCurrentToken(diagnosticMessage, arg0);
             }
             var pos = getNodePos();
-            var result = kind === 78 /* Identifier */ ? factory.createIdentifier("", /*typeArguments*/ undefined, /*originalKeywordKind*/ undefined) :
+            var result = kind === 79 /* Identifier */ ? factory.createIdentifier("", /*typeArguments*/ undefined, /*originalKeywordKind*/ undefined) :
                 ts.isTemplateLiteralKind(kind) ? factory.createTemplateLiteralLikeNode(kind, "", "", /*templateFlags*/ undefined) :
                     kind === 8 /* NumericLiteral */ ? factory.createNumericLiteral("", /*numericLiteralFlags*/ undefined) :
                         kind === 10 /* StringLiteral */ ? factory.createStringLiteral("", /*isSingleQuote*/ undefined) :
-                            kind === 271 /* MissingDeclaration */ ? factory.createMissingDeclaration() :
+                            kind === 275 /* MissingDeclaration */ ? factory.createMissingDeclaration() :
                                 factory.createToken(kind);
             return finishNode(result, pos);
         }
@@ -29467,11 +31310,11 @@ var ts;
                 nextTokenWithoutCheck();
                 return finishNode(factory.createIdentifier(text, /*typeArguments*/ undefined, originalKeywordKind), pos);
             }
-            if (token() === 79 /* PrivateIdentifier */) {
+            if (token() === 80 /* PrivateIdentifier */) {
                 parseErrorAtCurrentToken(privateIdentifierDiagnosticMessage || ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);
                 return createIdentifier(/*isIdentifier*/ true);
             }
-            if (token() === 0 /* Unknown */ && scanner.tryScan(function () { return scanner.reScanInvalidIdentifier() === 78 /* Identifier */; })) {
+            if (token() === 0 /* Unknown */ && scanner.tryScan(function () { return scanner.reScanInvalidIdentifier() === 79 /* Identifier */; })) {
                 // Scanner has already recorded an 'Invalid character' error, so no need to add another from the parser.
                 return createIdentifier(/*isIdentifier*/ true);
             }
@@ -29483,7 +31326,7 @@ var ts;
             var defaultMessage = isReservedWord ?
                 ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here :
                 ts.Diagnostics.Identifier_expected;
-            return createMissingNode(78 /* Identifier */, reportAtCurrentPosition, diagnosticMessage || defaultMessage, msgArg);
+            return createMissingNode(79 /* Identifier */, reportAtCurrentPosition, diagnosticMessage || defaultMessage, msgArg);
         }
         function parseBindingIdentifier(privateIdentifierDiagnosticMessage) {
             return createIdentifier(isBindingIdentifier(), /*diagnosticMessage*/ undefined, privateIdentifierDiagnosticMessage);
@@ -29499,6 +31342,10 @@ var ts;
                 token() === 10 /* StringLiteral */ ||
                 token() === 8 /* NumericLiteral */;
         }
+        function isAssertionKey() {
+            return ts.tokenIsIdentifierOrKeyword(token()) ||
+                token() === 10 /* StringLiteral */;
+        }
         function parsePropertyNameWorker(allowComputedPropertyNames) {
             if (token() === 10 /* StringLiteral */ || token() === 8 /* NumericLiteral */) {
                 var node = parseLiteralNode();
@@ -29508,7 +31355,7 @@ var ts;
             if (allowComputedPropertyNames && token() === 22 /* OpenBracketToken */) {
                 return parseComputedPropertyName();
             }
-            if (token() === 79 /* PrivateIdentifier */) {
+            if (token() === 80 /* PrivateIdentifier */) {
                 return parsePrivateIdentifier();
             }
             return parseIdentifierName();
@@ -29554,24 +31401,23 @@ var ts;
         }
         function nextTokenCanFollowModifier() {
             switch (token()) {
-                case 84 /* ConstKeyword */:
+                case 85 /* ConstKeyword */:
                     // 'const' is only a modifier if followed by 'enum'.
-                    return nextToken() === 91 /* EnumKeyword */;
-                case 92 /* ExportKeyword */:
+                    return nextToken() === 92 /* EnumKeyword */;
+                case 93 /* ExportKeyword */:
                     nextToken();
-                    if (token() === 87 /* DefaultKeyword */) {
+                    if (token() === 88 /* DefaultKeyword */) {
                         return lookAhead(nextTokenCanFollowDefaultKeyword);
                     }
-                    if (token() === 149 /* TypeKeyword */) {
+                    if (token() === 151 /* TypeKeyword */) {
                         return lookAhead(nextTokenCanFollowExportModifier);
                     }
                     return canFollowExportModifier();
-                case 87 /* DefaultKeyword */:
+                case 88 /* DefaultKeyword */:
                     return nextTokenCanFollowDefaultKeyword();
-                case 123 /* StaticKeyword */:
-                    return nextTokenIsOnSameLineAndCanFollowModifier();
-                case 134 /* GetKeyword */:
-                case 146 /* SetKeyword */:
+                case 124 /* StaticKeyword */:
+                case 136 /* GetKeyword */:
+                case 148 /* SetKeyword */:
                     nextToken();
                     return canFollowModifier();
                 default:
@@ -29580,7 +31426,7 @@ var ts;
         }
         function canFollowExportModifier() {
             return token() !== 41 /* AsteriskToken */
-                && token() !== 126 /* AsKeyword */
+                && token() !== 127 /* AsKeyword */
                 && token() !== 18 /* OpenBraceToken */
                 && canFollowModifier();
         }
@@ -29600,10 +31446,10 @@ var ts;
         }
         function nextTokenCanFollowDefaultKeyword() {
             nextToken();
-            return token() === 83 /* ClassKeyword */ || token() === 97 /* FunctionKeyword */ ||
-                token() === 117 /* InterfaceKeyword */ ||
-                (token() === 125 /* AbstractKeyword */ && lookAhead(nextTokenIsClassKeywordOnSameLine)) ||
-                (token() === 129 /* AsyncKeyword */ && lookAhead(nextTokenIsFunctionKeywordOnSameLine));
+            return token() === 84 /* ClassKeyword */ || token() === 98 /* FunctionKeyword */ ||
+                token() === 118 /* InterfaceKeyword */ ||
+                (token() === 126 /* AbstractKeyword */ && lookAhead(nextTokenIsClassKeywordOnSameLine)) ||
+                (token() === 131 /* AsyncKeyword */ && lookAhead(nextTokenIsFunctionKeywordOnSameLine));
         }
         // True if positioned at the start of a list element
         function isListElement(parsingContext, inErrorRecovery) {
@@ -29623,7 +31469,7 @@ var ts;
                     // outer module.  We just want to consume and move on.
                     return !(token() === 26 /* SemicolonToken */ && inErrorRecovery) && isStartOfStatement();
                 case 2 /* SwitchClauses */:
-                    return token() === 81 /* CaseKeyword */ || token() === 87 /* DefaultKeyword */;
+                    return token() === 82 /* CaseKeyword */ || token() === 88 /* DefaultKeyword */;
                 case 4 /* TypeMembers */:
                     return lookAhead(isTypeMemberStart);
                 case 5 /* ClassMembers */:
@@ -29650,6 +31496,8 @@ var ts;
                     return isLiteralPropertyName();
                 case 9 /* ObjectBindingElements */:
                     return token() === 22 /* OpenBracketToken */ || token() === 25 /* DotDotDotToken */ || isLiteralPropertyName();
+                case 24 /* AssertEntries */:
+                    return isAssertionKey();
                 case 7 /* HeritageClauseElement */:
                     // If we see `{ ... }` then only consume it as an expression if it is followed by `,` or `{`
                     // That way we won't consume the body of a class in its heritage clause.
@@ -29709,7 +31557,7 @@ var ts;
                 //      extends {} extends
                 //      extends {} implements
                 var next = nextToken();
-                return next === 27 /* CommaToken */ || next === 18 /* OpenBraceToken */ || next === 93 /* ExtendsKeyword */ || next === 116 /* ImplementsKeyword */;
+                return next === 27 /* CommaToken */ || next === 18 /* OpenBraceToken */ || next === 94 /* ExtendsKeyword */ || next === 117 /* ImplementsKeyword */;
             }
             return true;
         }
@@ -29726,8 +31574,8 @@ var ts;
             return ts.tokenIsIdentifierOrKeywordOrGreaterThan(token());
         }
         function isHeritageClauseExtendsOrImplementsKeyword() {
-            if (token() === 116 /* ImplementsKeyword */ ||
-                token() === 93 /* ExtendsKeyword */) {
+            if (token() === 117 /* ImplementsKeyword */ ||
+                token() === 94 /* ExtendsKeyword */) {
                 return lookAhead(nextTokenIsStartOfExpression);
             }
             return false;
@@ -29755,16 +31603,17 @@ var ts;
                 case 12 /* ObjectLiteralMembers */:
                 case 9 /* ObjectBindingElements */:
                 case 23 /* ImportOrExportSpecifiers */:
+                case 24 /* AssertEntries */:
                     return token() === 19 /* CloseBraceToken */;
                 case 3 /* SwitchClauseStatements */:
-                    return token() === 19 /* CloseBraceToken */ || token() === 81 /* CaseKeyword */ || token() === 87 /* DefaultKeyword */;
+                    return token() === 19 /* CloseBraceToken */ || token() === 82 /* CaseKeyword */ || token() === 88 /* DefaultKeyword */;
                 case 7 /* HeritageClauseElement */:
-                    return token() === 18 /* OpenBraceToken */ || token() === 93 /* ExtendsKeyword */ || token() === 116 /* ImplementsKeyword */;
+                    return token() === 18 /* OpenBraceToken */ || token() === 94 /* ExtendsKeyword */ || token() === 117 /* ImplementsKeyword */;
                 case 8 /* VariableDeclarations */:
                     return isVariableDeclaratorListTerminator();
                 case 19 /* TypeParameters */:
                     // Tokens other than '>' are here for better error recovery
-                    return token() === 31 /* GreaterThanToken */ || token() === 20 /* OpenParenToken */ || token() === 18 /* OpenBraceToken */ || token() === 93 /* ExtendsKeyword */ || token() === 116 /* ImplementsKeyword */;
+                    return token() === 31 /* GreaterThanToken */ || token() === 20 /* OpenParenToken */ || token() === 18 /* OpenBraceToken */ || token() === 94 /* ExtendsKeyword */ || token() === 117 /* ImplementsKeyword */;
                 case 11 /* ArgumentExpressions */:
                     // Tokens other than ')' are here for better error recovery
                     return token() === 21 /* CloseParenToken */ || token() === 26 /* SemicolonToken */;
@@ -29813,7 +31662,7 @@ var ts;
         }
         // True if positioned at element or terminator of the current list or any enclosing list
         function isInSomeParsingContext() {
-            for (var kind = 0; kind < 24 /* Count */; kind++) {
+            for (var kind = 0; kind < 25 /* Count */; kind++) {
                 if (parsingContext & (1 << kind)) {
                     if (isListElement(kind, /*inErrorRecovery*/ true) || isListTerminator(kind)) {
                         return true;
@@ -29830,8 +31679,7 @@ var ts;
             var listPos = getNodePos();
             while (!isListTerminator(kind)) {
                 if (isListElement(kind, /*inErrorRecovery*/ false)) {
-                    var element = parseListElement(kind, parseElement);
-                    list.push(element);
+                    list.push(parseListElement(kind, parseElement));
                     continue;
                 }
                 if (abortParsingListOrMoveToNextToken(kind)) {
@@ -29981,20 +31829,20 @@ var ts;
         function isReusableClassMember(node) {
             if (node) {
                 switch (node.kind) {
-                    case 166 /* Constructor */:
-                    case 171 /* IndexSignature */:
-                    case 167 /* GetAccessor */:
-                    case 168 /* SetAccessor */:
-                    case 163 /* PropertyDeclaration */:
-                    case 229 /* SemicolonClassElement */:
+                    case 170 /* Constructor */:
+                    case 175 /* IndexSignature */:
+                    case 171 /* GetAccessor */:
+                    case 172 /* SetAccessor */:
+                    case 166 /* PropertyDeclaration */:
+                    case 233 /* SemicolonClassElement */:
                         return true;
-                    case 165 /* MethodDeclaration */:
+                    case 168 /* MethodDeclaration */:
                         // Method declarations are not necessarily reusable.  An object-literal
                         // may have a method calls "constructor(...)" and we must reparse that
                         // into an actual .ConstructorDeclaration.
                         var methodDeclaration = node;
-                        var nameIsConstructor = methodDeclaration.name.kind === 78 /* Identifier */ &&
-                            methodDeclaration.name.originalKeywordKind === 132 /* ConstructorKeyword */;
+                        var nameIsConstructor = methodDeclaration.name.kind === 79 /* Identifier */ &&
+                            methodDeclaration.name.originalKeywordKind === 134 /* ConstructorKeyword */;
                         return !nameIsConstructor;
                 }
             }
@@ -30003,8 +31851,8 @@ var ts;
         function isReusableSwitchClause(node) {
             if (node) {
                 switch (node.kind) {
-                    case 284 /* CaseClause */:
-                    case 285 /* DefaultClause */:
+                    case 288 /* CaseClause */:
+                    case 289 /* DefaultClause */:
                         return true;
                 }
             }
@@ -30013,58 +31861,58 @@ var ts;
         function isReusableStatement(node) {
             if (node) {
                 switch (node.kind) {
-                    case 251 /* FunctionDeclaration */:
-                    case 232 /* VariableStatement */:
-                    case 230 /* Block */:
-                    case 234 /* IfStatement */:
-                    case 233 /* ExpressionStatement */:
-                    case 246 /* ThrowStatement */:
-                    case 242 /* ReturnStatement */:
-                    case 244 /* SwitchStatement */:
-                    case 241 /* BreakStatement */:
-                    case 240 /* ContinueStatement */:
-                    case 238 /* ForInStatement */:
-                    case 239 /* ForOfStatement */:
-                    case 237 /* ForStatement */:
-                    case 236 /* WhileStatement */:
-                    case 243 /* WithStatement */:
-                    case 231 /* EmptyStatement */:
-                    case 247 /* TryStatement */:
-                    case 245 /* LabeledStatement */:
-                    case 235 /* DoStatement */:
-                    case 248 /* DebuggerStatement */:
-                    case 261 /* ImportDeclaration */:
-                    case 260 /* ImportEqualsDeclaration */:
-                    case 267 /* ExportDeclaration */:
-                    case 266 /* ExportAssignment */:
-                    case 256 /* ModuleDeclaration */:
-                    case 252 /* ClassDeclaration */:
-                    case 253 /* InterfaceDeclaration */:
-                    case 255 /* EnumDeclaration */:
-                    case 254 /* TypeAliasDeclaration */:
+                    case 255 /* FunctionDeclaration */:
+                    case 236 /* VariableStatement */:
+                    case 234 /* Block */:
+                    case 238 /* IfStatement */:
+                    case 237 /* ExpressionStatement */:
+                    case 250 /* ThrowStatement */:
+                    case 246 /* ReturnStatement */:
+                    case 248 /* SwitchStatement */:
+                    case 245 /* BreakStatement */:
+                    case 244 /* ContinueStatement */:
+                    case 242 /* ForInStatement */:
+                    case 243 /* ForOfStatement */:
+                    case 241 /* ForStatement */:
+                    case 240 /* WhileStatement */:
+                    case 247 /* WithStatement */:
+                    case 235 /* EmptyStatement */:
+                    case 251 /* TryStatement */:
+                    case 249 /* LabeledStatement */:
+                    case 239 /* DoStatement */:
+                    case 252 /* DebuggerStatement */:
+                    case 265 /* ImportDeclaration */:
+                    case 264 /* ImportEqualsDeclaration */:
+                    case 271 /* ExportDeclaration */:
+                    case 270 /* ExportAssignment */:
+                    case 260 /* ModuleDeclaration */:
+                    case 256 /* ClassDeclaration */:
+                    case 257 /* InterfaceDeclaration */:
+                    case 259 /* EnumDeclaration */:
+                    case 258 /* TypeAliasDeclaration */:
                         return true;
                 }
             }
             return false;
         }
         function isReusableEnumMember(node) {
-            return node.kind === 291 /* EnumMember */;
+            return node.kind === 297 /* EnumMember */;
         }
         function isReusableTypeMember(node) {
             if (node) {
                 switch (node.kind) {
-                    case 170 /* ConstructSignature */:
-                    case 164 /* MethodSignature */:
-                    case 171 /* IndexSignature */:
-                    case 162 /* PropertySignature */:
-                    case 169 /* CallSignature */:
+                    case 174 /* ConstructSignature */:
+                    case 167 /* MethodSignature */:
+                    case 175 /* IndexSignature */:
+                    case 165 /* PropertySignature */:
+                    case 173 /* CallSignature */:
                         return true;
                 }
             }
             return false;
         }
         function isReusableVariableDeclaration(node) {
-            if (node.kind !== 249 /* VariableDeclaration */) {
+            if (node.kind !== 253 /* VariableDeclaration */) {
                 return false;
             }
             // Very subtle incremental parsing bug.  Consider the following code:
@@ -30085,7 +31933,7 @@ var ts;
             return variableDeclarator.initializer === undefined;
         }
         function isReusableParameter(node) {
-            if (node.kind !== 160 /* Parameter */) {
+            if (node.kind !== 163 /* Parameter */) {
                 return false;
             }
             // See the comment in isReusableVariableDeclaration for why we do this.
@@ -30103,7 +31951,10 @@ var ts;
         }
         function parsingContextErrors(context) {
             switch (context) {
-                case 0 /* SourceElements */: return parseErrorAtCurrentToken(ts.Diagnostics.Declaration_or_statement_expected);
+                case 0 /* SourceElements */:
+                    return token() === 88 /* DefaultKeyword */
+                        ? parseErrorAtCurrentToken(ts.Diagnostics._0_expected, ts.tokenToString(93 /* ExportKeyword */))
+                        : parseErrorAtCurrentToken(ts.Diagnostics.Declaration_or_statement_expected);
                 case 1 /* BlockStatements */: return parseErrorAtCurrentToken(ts.Diagnostics.Declaration_or_statement_expected);
                 case 2 /* SwitchClauses */: return parseErrorAtCurrentToken(ts.Diagnostics.case_or_default_expected);
                 case 3 /* SwitchClauseStatements */: return parseErrorAtCurrentToken(ts.Diagnostics.Statement_expected);
@@ -30122,7 +31973,10 @@ var ts;
                 case 12 /* ObjectLiteralMembers */: return parseErrorAtCurrentToken(ts.Diagnostics.Property_assignment_expected);
                 case 15 /* ArrayLiteralMembers */: return parseErrorAtCurrentToken(ts.Diagnostics.Expression_or_comma_expected);
                 case 17 /* JSDocParameters */: return parseErrorAtCurrentToken(ts.Diagnostics.Parameter_declaration_expected);
-                case 16 /* Parameters */: return parseErrorAtCurrentToken(ts.Diagnostics.Parameter_declaration_expected);
+                case 16 /* Parameters */:
+                    return ts.isKeyword(token())
+                        ? parseErrorAtCurrentToken(ts.Diagnostics._0_is_not_allowed_as_a_parameter_name, ts.tokenToString(token()))
+                        : parseErrorAtCurrentToken(ts.Diagnostics.Parameter_declaration_expected);
                 case 19 /* TypeParameters */: return parseErrorAtCurrentToken(ts.Diagnostics.Type_parameter_declaration_expected);
                 case 20 /* TypeArguments */: return parseErrorAtCurrentToken(ts.Diagnostics.Type_argument_expected);
                 case 21 /* TupleElementTypes */: return parseErrorAtCurrentToken(ts.Diagnostics.Type_expected);
@@ -30252,12 +32106,12 @@ var ts;
                     // Report that we need an identifier.  However, report it right after the dot,
                     // and not on the next token.  This is because the next token might actually
                     // be an identifier and the error would be quite confusing.
-                    return createMissingNode(78 /* Identifier */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Identifier_expected);
+                    return createMissingNode(79 /* Identifier */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Identifier_expected);
                 }
             }
-            if (token() === 79 /* PrivateIdentifier */) {
+            if (token() === 80 /* PrivateIdentifier */) {
                 var node = parsePrivateIdentifier();
-                return allowPrivateIdentifiers ? node : createMissingNode(78 /* Identifier */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Identifier_expected);
+                return allowPrivateIdentifiers ? node : createMissingNode(79 /* Identifier */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Identifier_expected);
             }
             return allowIdentifierNames ? parseIdentifierName() : parseIdentifier();
         }
@@ -30366,14 +32220,14 @@ var ts;
         // If true, we should abort parsing an error function.
         function typeHasArrowFunctionBlockingParseError(node) {
             switch (node.kind) {
-                case 173 /* TypeReference */:
+                case 177 /* TypeReference */:
                     return ts.nodeIsMissing(node.typeName);
-                case 174 /* FunctionType */:
-                case 175 /* ConstructorType */: {
+                case 178 /* FunctionType */:
+                case 179 /* ConstructorType */: {
                     var _a = node, parameters = _a.parameters, type = _a.type;
                     return isMissingList(parameters) || typeHasArrowFunctionBlockingParseError(type);
                 }
-                case 186 /* ParenthesizedType */:
+                case 190 /* ParenthesizedType */:
                     return typeHasArrowFunctionBlockingParseError(node.type);
                 default:
                     return false;
@@ -30415,7 +32269,7 @@ var ts;
                 token() === 19 /* CloseBraceToken */ ||
                 token() === 21 /* CloseParenToken */ ||
                 token() === 31 /* GreaterThanToken */ ||
-                token() === 62 /* EqualsToken */ ||
+                token() === 63 /* EqualsToken */ ||
                 token() === 51 /* BarToken */) {
                 return finishNode(factory.createJSDocUnknownType(), pos);
             }
@@ -30437,7 +32291,7 @@ var ts;
         function parseJSDocParameter() {
             var pos = getNodePos();
             var name;
-            if (token() === 107 /* ThisKeyword */ || token() === 102 /* NewKeyword */) {
+            if (token() === 108 /* ThisKeyword */ || token() === 103 /* NewKeyword */) {
                 name = parseIdentifierName();
                 parseExpected(58 /* ColonToken */);
             }
@@ -30453,7 +32307,7 @@ var ts;
         function parseJSDocType() {
             scanner.setInJSDocType(true);
             var pos = getNodePos();
-            if (parseOptional(139 /* ModuleKeyword */)) {
+            if (parseOptional(141 /* ModuleKeyword */)) {
                 // TODO(rbuckton): We never set the type for a JSDocNamepathType. What should we put here?
                 var moduleTag = factory.createJSDocNamepathType(/*type*/ undefined);
                 terminate: while (true) {
@@ -30476,7 +32330,7 @@ var ts;
             if (hasDotDotDot) {
                 type = finishNode(factory.createJSDocVariadicType(type), pos);
             }
-            if (token() === 62 /* EqualsToken */) {
+            if (token() === 63 /* EqualsToken */) {
                 nextToken();
                 return finishNode(factory.createJSDocOptionalType(type), pos);
             }
@@ -30484,7 +32338,7 @@ var ts;
         }
         function parseTypeQuery() {
             var pos = getNodePos();
-            parseExpected(111 /* TypeOfKeyword */);
+            parseExpected(112 /* TypeOfKeyword */);
             return finishNode(factory.createTypeQueryNode(parseEntityName(/*allowReservedWords*/ true)), pos);
         }
         function parseTypeParameter() {
@@ -30492,7 +32346,7 @@ var ts;
             var name = parseIdentifier();
             var constraint;
             var expression;
-            if (parseOptional(93 /* ExtendsKeyword */)) {
+            if (parseOptional(94 /* ExtendsKeyword */)) {
                 // It's not uncommon for people to write improper constraints to a generic.  If the
                 // user writes a constraint that is an expression and not an actual type, then parse
                 // it out as an expression (so we can recover well), but report that a type is needed
@@ -30511,7 +32365,7 @@ var ts;
                     expression = parseUnaryExpressionOrHigher();
                 }
             }
-            var defaultType = parseOptional(62 /* EqualsToken */) ? parseType() : undefined;
+            var defaultType = parseOptional(63 /* EqualsToken */) ? parseType() : undefined;
             var node = factory.createTypeParameterDeclaration(name, constraint, defaultType);
             node.expression = expression;
             return finishNode(node, pos);
@@ -30554,19 +32408,21 @@ var ts;
         function parseParameterWorker(inOuterAwaitContext) {
             var pos = getNodePos();
             var hasJSDoc = hasPrecedingJSDocComment();
-            if (token() === 107 /* ThisKeyword */) {
-                var node_1 = factory.createParameterDeclaration(
-                /*decorators*/ undefined, 
+            // FormalParameter [Yield,Await]:
+            //      BindingElement[?Yield,?Await]
+            // Decorators are parsed in the outer [Await] context, the rest of the parameter is parsed in the function's [Await] context.
+            var decorators = inOuterAwaitContext ? doInAwaitContext(parseDecorators) : parseDecorators();
+            if (token() === 108 /* ThisKeyword */) {
+                var node_1 = factory.createParameterDeclaration(decorators, 
                 /*modifiers*/ undefined, 
                 /*dotDotDotToken*/ undefined, createIdentifier(/*isIdentifier*/ true), 
                 /*questionToken*/ undefined, parseTypeAnnotation(), 
                 /*initializer*/ undefined);
+                if (decorators) {
+                    parseErrorAtRange(decorators[0], ts.Diagnostics.Decorators_may_not_be_applied_to_this_parameters);
+                }
                 return withJSDoc(finishNode(node_1, pos), hasJSDoc);
             }
-            // FormalParameter [Yield,Await]:
-            //      BindingElement[?Yield,?Await]
-            // Decorators are parsed in the outer [Await] context, the rest of the parameter is parsed in the function's [Await] context.
-            var decorators = inOuterAwaitContext ? doInAwaitContext(parseDecorators) : parseDecorators();
             var savedTopLevel = topLevel;
             topLevel = false;
             var modifiers = parseModifiers();
@@ -30653,14 +32509,14 @@ var ts;
         function parseSignatureMember(kind) {
             var pos = getNodePos();
             var hasJSDoc = hasPrecedingJSDocComment();
-            if (kind === 170 /* ConstructSignature */) {
-                parseExpected(102 /* NewKeyword */);
+            if (kind === 174 /* ConstructSignature */) {
+                parseExpected(103 /* NewKeyword */);
             }
             var typeParameters = parseTypeParameters();
             var parameters = parseParameters(4 /* Type */);
             var type = parseReturnType(58 /* ColonToken */, /*isType*/ true);
             parseTypeMemberSemicolon();
-            var node = kind === 169 /* CallSignature */
+            var node = kind === 173 /* CallSignature */
                 ? factory.createCallSignature(typeParameters, parameters, type)
                 : factory.createConstructSignature(typeParameters, parameters, type);
             return withJSDoc(finishNode(node, pos), hasJSDoc);
@@ -30743,7 +32599,7 @@ var ts;
                 // Although type literal properties cannot not have initializers, we attempt
                 // to parse an initializer so we can report in the checker that an interface
                 // property or type literal property cannot have an initializer.
-                if (token() === 62 /* EqualsToken */)
+                if (token() === 63 /* EqualsToken */)
                     node.initializer = parseInitializer();
             }
             parseTypeMemberSemicolon();
@@ -30751,7 +32607,10 @@ var ts;
         }
         function isTypeMemberStart() {
             // Return true if we have the start of a signature member
-            if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) {
+            if (token() === 20 /* OpenParenToken */ ||
+                token() === 29 /* LessThanToken */ ||
+                token() === 136 /* GetKeyword */ ||
+                token() === 148 /* SetKeyword */) {
                 return true;
             }
             var idToken = false;
@@ -30783,14 +32642,20 @@ var ts;
         }
         function parseTypeMember() {
             if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) {
-                return parseSignatureMember(169 /* CallSignature */);
+                return parseSignatureMember(173 /* CallSignature */);
             }
-            if (token() === 102 /* NewKeyword */ && lookAhead(nextTokenIsOpenParenOrLessThan)) {
-                return parseSignatureMember(170 /* ConstructSignature */);
+            if (token() === 103 /* NewKeyword */ && lookAhead(nextTokenIsOpenParenOrLessThan)) {
+                return parseSignatureMember(174 /* ConstructSignature */);
             }
             var pos = getNodePos();
             var hasJSDoc = hasPrecedingJSDocComment();
             var modifiers = parseModifiers();
+            if (parseContextualModifier(136 /* GetKeyword */)) {
+                return parseAccessorDeclaration(pos, hasJSDoc, /*decorators*/ undefined, modifiers, 171 /* GetAccessor */);
+            }
+            if (parseContextualModifier(148 /* SetKeyword */)) {
+                return parseAccessorDeclaration(pos, hasJSDoc, /*decorators*/ undefined, modifiers, 172 /* SetAccessor */);
+            }
             if (isIndexSignature()) {
                 return parseIndexSignatureDeclaration(pos, hasJSDoc, /*decorators*/ undefined, modifiers);
             }
@@ -30830,17 +32695,17 @@ var ts;
         function isStartOfMappedType() {
             nextToken();
             if (token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) {
-                return nextToken() === 142 /* ReadonlyKeyword */;
+                return nextToken() === 144 /* ReadonlyKeyword */;
             }
-            if (token() === 142 /* ReadonlyKeyword */) {
+            if (token() === 144 /* ReadonlyKeyword */) {
                 nextToken();
             }
-            return token() === 22 /* OpenBracketToken */ && nextTokenIsIdentifier() && nextToken() === 100 /* InKeyword */;
+            return token() === 22 /* OpenBracketToken */ && nextTokenIsIdentifier() && nextToken() === 101 /* InKeyword */;
         }
         function parseMappedTypeParameter() {
             var pos = getNodePos();
             var name = parseIdentifierName();
-            parseExpected(100 /* InKeyword */);
+            parseExpected(101 /* InKeyword */);
             var type = parseType();
             return finishNode(factory.createTypeParameterDeclaration(name, type, /*defaultType*/ undefined), pos);
         }
@@ -30848,15 +32713,15 @@ var ts;
             var pos = getNodePos();
             parseExpected(18 /* OpenBraceToken */);
             var readonlyToken;
-            if (token() === 142 /* ReadonlyKeyword */ || token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) {
+            if (token() === 144 /* ReadonlyKeyword */ || token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) {
                 readonlyToken = parseTokenNode();
-                if (readonlyToken.kind !== 142 /* ReadonlyKeyword */) {
-                    parseExpected(142 /* ReadonlyKeyword */);
+                if (readonlyToken.kind !== 144 /* ReadonlyKeyword */) {
+                    parseExpected(144 /* ReadonlyKeyword */);
                 }
             }
             parseExpected(22 /* OpenBracketToken */);
             var typeParameter = parseMappedTypeParameter();
-            var nameType = parseOptional(126 /* AsKeyword */) ? parseType() : undefined;
+            var nameType = parseOptional(127 /* AsKeyword */) ? parseType() : undefined;
             parseExpected(23 /* CloseBracketToken */);
             var questionToken;
             if (token() === 57 /* QuestionToken */ || token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) {
@@ -30867,8 +32732,9 @@ var ts;
             }
             var type = parseTypeAnnotation();
             parseSemicolon();
+            var members = parseList(4 /* TypeMembers */, parseTypeMember);
             parseExpected(19 /* CloseBraceToken */);
-            return finishNode(factory.createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type), pos);
+            return finishNode(factory.createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type, members), pos);
         }
         function parseTupleElementType() {
             var pos = getNodePos();
@@ -30920,10 +32786,10 @@ var ts;
         }
         function parseModifiersForConstructorType() {
             var modifiers;
-            if (token() === 125 /* AbstractKeyword */) {
+            if (token() === 126 /* AbstractKeyword */) {
                 var pos = getNodePos();
                 nextToken();
-                var modifier = finishNode(factory.createToken(125 /* AbstractKeyword */), pos);
+                var modifier = finishNode(factory.createToken(126 /* AbstractKeyword */), pos);
                 modifiers = createNodeArray([modifier], pos);
             }
             return modifiers;
@@ -30932,7 +32798,7 @@ var ts;
             var pos = getNodePos();
             var hasJSDoc = hasPrecedingJSDocComment();
             var modifiers = parseModifiersForConstructorType();
-            var isConstructorType = parseOptional(102 /* NewKeyword */);
+            var isConstructorType = parseOptional(103 /* NewKeyword */);
             var typeParameters = parseTypeParameters();
             var parameters = parseParameters(4 /* Type */);
             var type = parseReturnType(38 /* EqualsGreaterThanToken */, /*isType*/ false);
@@ -30952,7 +32818,7 @@ var ts;
             if (negative) {
                 nextToken();
             }
-            var expression = token() === 109 /* TrueKeyword */ || token() === 94 /* FalseKeyword */ || token() === 103 /* NullKeyword */ ?
+            var expression = token() === 110 /* TrueKeyword */ || token() === 95 /* FalseKeyword */ || token() === 104 /* NullKeyword */ ?
                 parseTokenNode() :
                 parseLiteralLikeNode(token());
             if (negative) {
@@ -30962,13 +32828,13 @@ var ts;
         }
         function isStartOfTypeOfImportType() {
             nextToken();
-            return token() === 99 /* ImportKeyword */;
+            return token() === 100 /* ImportKeyword */;
         }
         function parseImportType() {
             sourceFlags |= 1048576 /* PossiblyContainsDynamicImport */;
             var pos = getNodePos();
-            var isTypeOf = parseOptional(111 /* TypeOfKeyword */);
-            parseExpected(99 /* ImportKeyword */);
+            var isTypeOf = parseOptional(112 /* TypeOfKeyword */);
+            parseExpected(100 /* ImportKeyword */);
             parseExpected(20 /* OpenParenToken */);
             var type = parseType();
             parseExpected(21 /* CloseParenToken */);
@@ -30982,19 +32848,19 @@ var ts;
         }
         function parseNonArrayType() {
             switch (token()) {
-                case 128 /* AnyKeyword */:
-                case 152 /* UnknownKeyword */:
-                case 147 /* StringKeyword */:
-                case 144 /* NumberKeyword */:
-                case 155 /* BigIntKeyword */:
-                case 148 /* SymbolKeyword */:
-                case 131 /* BooleanKeyword */:
-                case 150 /* UndefinedKeyword */:
-                case 141 /* NeverKeyword */:
-                case 145 /* ObjectKeyword */:
+                case 130 /* AnyKeyword */:
+                case 154 /* UnknownKeyword */:
+                case 149 /* StringKeyword */:
+                case 146 /* NumberKeyword */:
+                case 157 /* BigIntKeyword */:
+                case 150 /* SymbolKeyword */:
+                case 133 /* BooleanKeyword */:
+                case 152 /* UndefinedKeyword */:
+                case 143 /* NeverKeyword */:
+                case 147 /* ObjectKeyword */:
                     // If these are followed by a dot, then parse these out as a dotted type reference instead.
                     return tryParse(parseKeywordAndNoDot) || parseTypeReference();
-                case 65 /* AsteriskEqualsToken */:
+                case 66 /* AsteriskEqualsToken */:
                     // If there is '*=', treat it as * followed by postfix =
                     scanner.reScanAsteriskEqualsToken();
                 // falls through
@@ -31006,7 +32872,7 @@ var ts;
                 // falls through
                 case 57 /* QuestionToken */:
                     return parseJSDocUnknownOrNullableType();
-                case 97 /* FunctionKeyword */:
+                case 98 /* FunctionKeyword */:
                     return parseJSDocFunctionType();
                 case 53 /* ExclamationToken */:
                     return parseJSDocNonNullableType();
@@ -31014,24 +32880,24 @@ var ts;
                 case 10 /* StringLiteral */:
                 case 8 /* NumericLiteral */:
                 case 9 /* BigIntLiteral */:
-                case 109 /* TrueKeyword */:
-                case 94 /* FalseKeyword */:
-                case 103 /* NullKeyword */:
+                case 110 /* TrueKeyword */:
+                case 95 /* FalseKeyword */:
+                case 104 /* NullKeyword */:
                     return parseLiteralTypeNode();
                 case 40 /* MinusToken */:
                     return lookAhead(nextTokenIsNumericOrBigIntLiteral) ? parseLiteralTypeNode(/*negative*/ true) : parseTypeReference();
-                case 113 /* VoidKeyword */:
+                case 114 /* VoidKeyword */:
                     return parseTokenNode();
-                case 107 /* ThisKeyword */: {
+                case 108 /* ThisKeyword */: {
                     var thisKeyword = parseThisTypeNode();
-                    if (token() === 137 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) {
+                    if (token() === 139 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) {
                         return parseThisTypePredicate(thisKeyword);
                     }
                     else {
                         return thisKeyword;
                     }
                 }
-                case 111 /* TypeOfKeyword */:
+                case 112 /* TypeOfKeyword */:
                     return lookAhead(isStartOfTypeOfImportType) ? parseImportType() : parseTypeQuery();
                 case 18 /* OpenBraceToken */:
                     return lookAhead(isStartOfMappedType) ? parseMappedType() : parseTypeLiteral();
@@ -31039,9 +32905,9 @@ var ts;
                     return parseTupleType();
                 case 20 /* OpenParenToken */:
                     return parseParenthesizedType();
-                case 99 /* ImportKeyword */:
+                case 100 /* ImportKeyword */:
                     return parseImportType();
-                case 127 /* AssertsKeyword */:
+                case 128 /* AssertsKeyword */:
                     return lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine) ? parseAssertsTypePredicate() : parseTypeReference();
                 case 15 /* TemplateHead */:
                     return parseTemplateType();
@@ -31051,44 +32917,44 @@ var ts;
         }
         function isStartOfType(inStartOfParameter) {
             switch (token()) {
-                case 128 /* AnyKeyword */:
-                case 152 /* UnknownKeyword */:
-                case 147 /* StringKeyword */:
-                case 144 /* NumberKeyword */:
-                case 155 /* BigIntKeyword */:
-                case 131 /* BooleanKeyword */:
-                case 142 /* ReadonlyKeyword */:
-                case 148 /* SymbolKeyword */:
-                case 151 /* UniqueKeyword */:
-                case 113 /* VoidKeyword */:
-                case 150 /* UndefinedKeyword */:
-                case 103 /* NullKeyword */:
-                case 107 /* ThisKeyword */:
-                case 111 /* TypeOfKeyword */:
-                case 141 /* NeverKeyword */:
+                case 130 /* AnyKeyword */:
+                case 154 /* UnknownKeyword */:
+                case 149 /* StringKeyword */:
+                case 146 /* NumberKeyword */:
+                case 157 /* BigIntKeyword */:
+                case 133 /* BooleanKeyword */:
+                case 144 /* ReadonlyKeyword */:
+                case 150 /* SymbolKeyword */:
+                case 153 /* UniqueKeyword */:
+                case 114 /* VoidKeyword */:
+                case 152 /* UndefinedKeyword */:
+                case 104 /* NullKeyword */:
+                case 108 /* ThisKeyword */:
+                case 112 /* TypeOfKeyword */:
+                case 143 /* NeverKeyword */:
                 case 18 /* OpenBraceToken */:
                 case 22 /* OpenBracketToken */:
                 case 29 /* LessThanToken */:
                 case 51 /* BarToken */:
                 case 50 /* AmpersandToken */:
-                case 102 /* NewKeyword */:
+                case 103 /* NewKeyword */:
                 case 10 /* StringLiteral */:
                 case 8 /* NumericLiteral */:
                 case 9 /* BigIntLiteral */:
-                case 109 /* TrueKeyword */:
-                case 94 /* FalseKeyword */:
-                case 145 /* ObjectKeyword */:
+                case 110 /* TrueKeyword */:
+                case 95 /* FalseKeyword */:
+                case 147 /* ObjectKeyword */:
                 case 41 /* AsteriskToken */:
                 case 57 /* QuestionToken */:
                 case 53 /* ExclamationToken */:
                 case 25 /* DotDotDotToken */:
-                case 135 /* InferKeyword */:
-                case 99 /* ImportKeyword */:
-                case 127 /* AssertsKeyword */:
+                case 137 /* InferKeyword */:
+                case 100 /* ImportKeyword */:
+                case 128 /* AssertsKeyword */:
                 case 14 /* NoSubstitutionTemplateLiteral */:
                 case 15 /* TemplateHead */:
                     return true;
-                case 97 /* FunctionKeyword */:
+                case 98 /* FunctionKeyword */:
                     return !inStartOfParameter;
                 case 40 /* MinusToken */:
                     return !inStartOfParameter && lookAhead(nextTokenIsNumericOrBigIntLiteral);
@@ -31152,17 +33018,17 @@ var ts;
         }
         function parseInferType() {
             var pos = getNodePos();
-            parseExpected(135 /* InferKeyword */);
+            parseExpected(137 /* InferKeyword */);
             return finishNode(factory.createInferTypeNode(parseTypeParameterOfInferType()), pos);
         }
         function parseTypeOperatorOrHigher() {
             var operator = token();
             switch (operator) {
-                case 138 /* KeyOfKeyword */:
-                case 151 /* UniqueKeyword */:
-                case 142 /* ReadonlyKeyword */:
+                case 140 /* KeyOfKeyword */:
+                case 153 /* UniqueKeyword */:
+                case 144 /* ReadonlyKeyword */:
                     return parseTypeOperator(operator);
-                case 135 /* InferKeyword */:
+                case 137 /* InferKeyword */:
                     return parseInferType();
             }
             return parsePostfixTypeOrHigher();
@@ -31212,7 +33078,7 @@ var ts;
         }
         function nextTokenIsNewKeyword() {
             nextToken();
-            return token() === 102 /* NewKeyword */;
+            return token() === 103 /* NewKeyword */;
         }
         function isStartOfFunctionTypeOrConstructorType() {
             if (token() === 29 /* LessThanToken */) {
@@ -31221,15 +33087,15 @@ var ts;
             if (token() === 20 /* OpenParenToken */ && lookAhead(isUnambiguouslyStartOfFunctionType)) {
                 return true;
             }
-            return token() === 102 /* NewKeyword */ ||
-                token() === 125 /* AbstractKeyword */ && lookAhead(nextTokenIsNewKeyword);
+            return token() === 103 /* NewKeyword */ ||
+                token() === 126 /* AbstractKeyword */ && lookAhead(nextTokenIsNewKeyword);
         }
         function skipParameterStart() {
             if (ts.isModifierKind(token())) {
                 // Skip modifiers
                 parseModifiers();
             }
-            if (isIdentifier() || token() === 107 /* ThisKeyword */) {
+            if (isIdentifier() || token() === 108 /* ThisKeyword */) {
                 nextToken();
                 return true;
             }
@@ -31252,7 +33118,7 @@ var ts;
                 // We successfully skipped modifiers (if any) and an identifier or binding pattern,
                 // now see if we have something that indicates a parameter declaration
                 if (token() === 58 /* ColonToken */ || token() === 27 /* CommaToken */ ||
-                    token() === 57 /* QuestionToken */ || token() === 62 /* EqualsToken */) {
+                    token() === 57 /* QuestionToken */ || token() === 63 /* EqualsToken */) {
                     // ( xxx :
                     // ( xxx ,
                     // ( xxx ?
@@ -31282,16 +33148,16 @@ var ts;
         }
         function parseTypePredicatePrefix() {
             var id = parseIdentifier();
-            if (token() === 137 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) {
+            if (token() === 139 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) {
                 nextToken();
                 return id;
             }
         }
         function parseAssertsTypePredicate() {
             var pos = getNodePos();
-            var assertsModifier = parseExpectedToken(127 /* AssertsKeyword */);
-            var parameterName = token() === 107 /* ThisKeyword */ ? parseThisTypeNode() : parseIdentifier();
-            var type = parseOptional(137 /* IsKeyword */) ? parseType() : undefined;
+            var assertsModifier = parseExpectedToken(128 /* AssertsKeyword */);
+            var parameterName = token() === 108 /* ThisKeyword */ ? parseThisTypeNode() : parseIdentifier();
+            var type = parseOptional(139 /* IsKeyword */) ? parseType() : undefined;
             return finishNode(factory.createTypePredicateNode(assertsModifier, parameterName, type), pos);
         }
         function parseType() {
@@ -31305,7 +33171,7 @@ var ts;
             }
             var pos = getNodePos();
             var type = parseUnionTypeOrHigher();
-            if (!noConditionalTypes && !scanner.hasPrecedingLineBreak() && parseOptional(93 /* ExtendsKeyword */)) {
+            if (!noConditionalTypes && !scanner.hasPrecedingLineBreak() && parseOptional(94 /* ExtendsKeyword */)) {
                 // The type following 'extends' is not permitted to be another conditional type
                 var extendsType = parseTypeWorker(/*noConditionalTypes*/ true);
                 parseExpected(57 /* QuestionToken */);
@@ -31322,11 +33188,11 @@ var ts;
         // EXPRESSIONS
         function isStartOfLeftHandSideExpression() {
             switch (token()) {
-                case 107 /* ThisKeyword */:
-                case 105 /* SuperKeyword */:
-                case 103 /* NullKeyword */:
-                case 109 /* TrueKeyword */:
-                case 94 /* FalseKeyword */:
+                case 108 /* ThisKeyword */:
+                case 106 /* SuperKeyword */:
+                case 104 /* NullKeyword */:
+                case 110 /* TrueKeyword */:
+                case 95 /* FalseKeyword */:
                 case 8 /* NumericLiteral */:
                 case 9 /* BigIntLiteral */:
                 case 10 /* StringLiteral */:
@@ -31335,14 +33201,14 @@ var ts;
                 case 20 /* OpenParenToken */:
                 case 22 /* OpenBracketToken */:
                 case 18 /* OpenBraceToken */:
-                case 97 /* FunctionKeyword */:
-                case 83 /* ClassKeyword */:
-                case 102 /* NewKeyword */:
+                case 98 /* FunctionKeyword */:
+                case 84 /* ClassKeyword */:
+                case 103 /* NewKeyword */:
                 case 43 /* SlashToken */:
-                case 67 /* SlashEqualsToken */:
-                case 78 /* Identifier */:
+                case 68 /* SlashEqualsToken */:
+                case 79 /* Identifier */:
                     return true;
-                case 99 /* ImportKeyword */:
+                case 100 /* ImportKeyword */:
                     return lookAhead(nextTokenIsOpenParenOrLessThanOrDot);
                 default:
                     return isIdentifier();
@@ -31357,15 +33223,15 @@ var ts;
                 case 40 /* MinusToken */:
                 case 54 /* TildeToken */:
                 case 53 /* ExclamationToken */:
-                case 88 /* DeleteKeyword */:
-                case 111 /* TypeOfKeyword */:
-                case 113 /* VoidKeyword */:
+                case 89 /* DeleteKeyword */:
+                case 112 /* TypeOfKeyword */:
+                case 114 /* VoidKeyword */:
                 case 45 /* PlusPlusToken */:
                 case 46 /* MinusMinusToken */:
                 case 29 /* LessThanToken */:
-                case 130 /* AwaitKeyword */:
-                case 124 /* YieldKeyword */:
-                case 79 /* PrivateIdentifier */:
+                case 132 /* AwaitKeyword */:
+                case 125 /* YieldKeyword */:
+                case 80 /* PrivateIdentifier */:
                     // Yield/await always starts an expression.  Either it is an identifier (in which case
                     // it is definitely an expression).  Or it's a keyword (either because we're in
                     // a generator or async function, or in strict mode (or both)) and it started a yield or await expression.
@@ -31384,8 +33250,8 @@ var ts;
         function isStartOfExpressionStatement() {
             // As per the grammar, none of '{' or 'function' or 'class' can start an expression statement.
             return token() !== 18 /* OpenBraceToken */ &&
-                token() !== 97 /* FunctionKeyword */ &&
-                token() !== 83 /* ClassKeyword */ &&
+                token() !== 98 /* FunctionKeyword */ &&
+                token() !== 84 /* ClassKeyword */ &&
                 token() !== 59 /* AtToken */ &&
                 isStartOfExpression();
         }
@@ -31410,7 +33276,7 @@ var ts;
             return expr;
         }
         function parseInitializer() {
-            return parseOptional(62 /* EqualsToken */) ? parseAssignmentExpressionOrHigher() : undefined;
+            return parseOptional(63 /* EqualsToken */) ? parseAssignmentExpressionOrHigher() : undefined;
         }
         function parseAssignmentExpressionOrHigher() {
             //  AssignmentExpression[in,yield]:
@@ -31456,7 +33322,7 @@ var ts;
             // To avoid a look-ahead, we did not handle the case of an arrow function with a single un-parenthesized
             // parameter ('x => ...') above. We handle it here by checking if the parsed expression was a single
             // identifier and the current token is an arrow.
-            if (expr.kind === 78 /* Identifier */ && token() === 38 /* EqualsGreaterThanToken */) {
+            if (expr.kind === 79 /* Identifier */ && token() === 38 /* EqualsGreaterThanToken */) {
                 return parseSimpleArrowFunctionExpression(pos, expr, /*asyncModifier*/ undefined);
             }
             // Now see if we might be in cases '2' or '3'.
@@ -31472,7 +33338,7 @@ var ts;
             return parseConditionalExpressionRest(expr, pos);
         }
         function isYieldExpression() {
-            if (token() === 124 /* YieldKeyword */) {
+            if (token() === 125 /* YieldKeyword */) {
                 // If we have a 'yield' keyword, and this is a context where yield expressions are
                 // allowed, then definitely parse out a yield expression.
                 if (inYieldContext()) {
@@ -31552,7 +33418,7 @@ var ts;
         //  Unknown     -> There *might* be a parenthesized arrow function here.
         //                 Speculatively look ahead to be sure, and rollback if not.
         function isParenthesizedArrowFunctionExpression() {
-            if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */ || token() === 129 /* AsyncKeyword */) {
+            if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */ || token() === 131 /* AsyncKeyword */) {
                 return lookAhead(isParenthesizedArrowFunctionExpressionWorker);
             }
             if (token() === 38 /* EqualsGreaterThanToken */) {
@@ -31565,7 +33431,7 @@ var ts;
             return 0 /* False */;
         }
         function isParenthesizedArrowFunctionExpressionWorker() {
-            if (token() === 129 /* AsyncKeyword */) {
+            if (token() === 131 /* AsyncKeyword */) {
                 nextToken();
                 if (scanner.hasPrecedingLineBreak()) {
                     return 0 /* False */;
@@ -31609,13 +33475,13 @@ var ts;
                 // Check for "(xxx yyy", where xxx is a modifier and yyy is an identifier. This
                 // isn't actually allowed, but we want to treat it as a lambda so we can provide
                 // a good error message.
-                if (ts.isModifierKind(second) && second !== 129 /* AsyncKeyword */ && lookAhead(nextTokenIsIdentifier)) {
+                if (ts.isModifierKind(second) && second !== 131 /* AsyncKeyword */ && lookAhead(nextTokenIsIdentifier)) {
                     return 1 /* True */;
                 }
                 // If we had "(" followed by something that's not an identifier,
                 // then this definitely doesn't look like a lambda.  "this" is not
                 // valid, but we want to parse it and then give a semantic error.
-                if (!isIdentifier() && second !== 107 /* ThisKeyword */) {
+                if (!isIdentifier() && second !== 108 /* ThisKeyword */) {
                     return 0 /* False */;
                 }
                 switch (nextToken()) {
@@ -31626,13 +33492,13 @@ var ts;
                     case 57 /* QuestionToken */:
                         nextToken();
                         // If we have "(a?:" or "(a?," or "(a?=" or "(a?)" then it is definitely a lambda.
-                        if (token() === 58 /* ColonToken */ || token() === 27 /* CommaToken */ || token() === 62 /* EqualsToken */ || token() === 21 /* CloseParenToken */) {
+                        if (token() === 58 /* ColonToken */ || token() === 27 /* CommaToken */ || token() === 63 /* EqualsToken */ || token() === 21 /* CloseParenToken */) {
                             return 1 /* True */;
                         }
                         // Otherwise it is definitely not a lambda.
                         return 0 /* False */;
                     case 27 /* CommaToken */:
-                    case 62 /* EqualsToken */:
+                    case 63 /* EqualsToken */:
                     case 21 /* CloseParenToken */:
                         // If we have "(a," or "(a=" or "(a)" this *could* be an arrow function
                         return 2 /* Unknown */;
@@ -31651,10 +33517,10 @@ var ts;
                 if (languageVariant === 1 /* JSX */) {
                     var isArrowFunctionInJsx = lookAhead(function () {
                         var third = nextToken();
-                        if (third === 93 /* ExtendsKeyword */) {
+                        if (third === 94 /* ExtendsKeyword */) {
                             var fourth = nextToken();
                             switch (fourth) {
-                                case 62 /* EqualsToken */:
+                                case 63 /* EqualsToken */:
                                 case 31 /* GreaterThanToken */:
                                     return false;
                                 default:
@@ -31688,7 +33554,7 @@ var ts;
         }
         function tryParseAsyncSimpleArrowFunctionExpression() {
             // We do a check here so that we won't be doing unnecessarily call to "lookAhead"
-            if (token() === 129 /* AsyncKeyword */) {
+            if (token() === 131 /* AsyncKeyword */) {
                 if (lookAhead(isUnParenthesizedAsyncArrowFunctionWorker) === 1 /* True */) {
                     var pos = getNodePos();
                     var asyncModifier = parseModifiersForArrowFunction();
@@ -31702,7 +33568,7 @@ var ts;
             // AsyncArrowFunctionExpression:
             //      1) async[no LineTerminator here]AsyncArrowBindingIdentifier[?Yield][no LineTerminator here]=>AsyncConciseBody[?In]
             //      2) CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await][no LineTerminator here]=>AsyncConciseBody[?In]
-            if (token() === 129 /* AsyncKeyword */) {
+            if (token() === 131 /* AsyncKeyword */) {
                 nextToken();
                 // If the "async" is followed by "=>" token then it is not a beginning of an async arrow-function
                 // but instead a simple arrow-function which will be parsed inside "parseAssignmentExpressionOrHigher"
@@ -31711,7 +33577,7 @@ var ts;
                 }
                 // Check for un-parenthesized AsyncArrowFunction
                 var expr = parseBinaryExpressionOrHigher(0 /* Lowest */);
-                if (!scanner.hasPrecedingLineBreak() && expr.kind === 78 /* Identifier */ && token() === 38 /* EqualsGreaterThanToken */) {
+                if (!scanner.hasPrecedingLineBreak() && expr.kind === 79 /* Identifier */ && token() === 38 /* EqualsGreaterThanToken */) {
                     return 1 /* True */;
                 }
             }
@@ -31776,8 +33642,8 @@ var ts;
                 return parseFunctionBlock(isAsync ? 2 /* Await */ : 0 /* None */);
             }
             if (token() !== 26 /* SemicolonToken */ &&
-                token() !== 97 /* FunctionKeyword */ &&
-                token() !== 83 /* ClassKeyword */ &&
+                token() !== 98 /* FunctionKeyword */ &&
+                token() !== 84 /* ClassKeyword */ &&
                 isStartOfStatement() &&
                 !isStartOfExpressionStatement()) {
                 // Check if we got a plain statement (i.e. no expression-statements, no function/class expressions/declarations)
@@ -31815,7 +33681,7 @@ var ts;
             var colonToken;
             return finishNode(factory.createConditionalExpression(leftOperand, questionToken, doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher), colonToken = parseExpectedToken(58 /* ColonToken */), ts.nodeIsPresent(colonToken)
                 ? parseAssignmentExpressionOrHigher()
-                : createMissingNode(78 /* Identifier */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, ts.tokenToString(58 /* ColonToken */))), pos);
+                : createMissingNode(79 /* Identifier */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, ts.tokenToString(58 /* ColonToken */))), pos);
         }
         function parseBinaryExpressionOrHigher(precedence) {
             var pos = getNodePos();
@@ -31823,7 +33689,7 @@ var ts;
             return parseBinaryExpressionRest(precedence, leftOperand, pos);
         }
         function isInOrOfKeyword(t) {
-            return t === 100 /* InKeyword */ || t === 156 /* OfKeyword */;
+            return t === 101 /* InKeyword */ || t === 159 /* OfKeyword */;
         }
         function parseBinaryExpressionRest(precedence, leftOperand, pos) {
             while (true) {
@@ -31858,10 +33724,10 @@ var ts;
                 if (!consumeCurrentOperator) {
                     break;
                 }
-                if (token() === 100 /* InKeyword */ && inDisallowInContext()) {
+                if (token() === 101 /* InKeyword */ && inDisallowInContext()) {
                     break;
                 }
-                if (token() === 126 /* AsKeyword */) {
+                if (token() === 127 /* AsKeyword */) {
                     // Make sure we *do* perform ASI for constructs like this:
                     //    var x = foo
                     //    as (Bar)
@@ -31882,7 +33748,7 @@ var ts;
             return leftOperand;
         }
         function isBinaryOperator() {
-            if (inDisallowInContext() && token() === 100 /* InKeyword */) {
+            if (inDisallowInContext() && token() === 101 /* InKeyword */) {
                 return false;
             }
             return ts.getBinaryOperatorPrecedence(token()) > 0;
@@ -31910,7 +33776,7 @@ var ts;
             return finishNode(factory.createVoidExpression(nextTokenAnd(parseSimpleUnaryExpression)), pos);
         }
         function isAwaitExpression() {
-            if (token() === 130 /* AwaitKeyword */) {
+            if (token() === 132 /* AwaitKeyword */) {
                 if (inAwaitContext()) {
                     return true;
                 }
@@ -31963,7 +33829,7 @@ var ts;
             if (token() === 42 /* AsteriskAsteriskToken */) {
                 var pos = ts.skipTrivia(sourceText, simpleUnaryExpression.pos);
                 var end = simpleUnaryExpression.end;
-                if (simpleUnaryExpression.kind === 206 /* TypeAssertionExpression */) {
+                if (simpleUnaryExpression.kind === 210 /* TypeAssertionExpression */) {
                     parseErrorAt(pos, end, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses);
                 }
                 else {
@@ -31993,18 +33859,18 @@ var ts;
                 case 54 /* TildeToken */:
                 case 53 /* ExclamationToken */:
                     return parsePrefixUnaryExpression();
-                case 88 /* DeleteKeyword */:
+                case 89 /* DeleteKeyword */:
                     return parseDeleteExpression();
-                case 111 /* TypeOfKeyword */:
+                case 112 /* TypeOfKeyword */:
                     return parseTypeOfExpression();
-                case 113 /* VoidKeyword */:
+                case 114 /* VoidKeyword */:
                     return parseVoidExpression();
                 case 29 /* LessThanToken */:
                     // This is modified UnaryExpression grammar in TypeScript
                     //  UnaryExpression (modified):
                     //      < type > UnaryExpression
                     return parseTypeAssertion();
-                case 130 /* AwaitKeyword */:
+                case 132 /* AwaitKeyword */:
                     if (isAwaitExpression()) {
                         return parseAwaitExpression();
                     }
@@ -32031,10 +33897,10 @@ var ts;
                 case 40 /* MinusToken */:
                 case 54 /* TildeToken */:
                 case 53 /* ExclamationToken */:
-                case 88 /* DeleteKeyword */:
-                case 111 /* TypeOfKeyword */:
-                case 113 /* VoidKeyword */:
-                case 130 /* AwaitKeyword */:
+                case 89 /* DeleteKeyword */:
+                case 112 /* TypeOfKeyword */:
+                case 114 /* VoidKeyword */:
+                case 132 /* AwaitKeyword */:
                     return false;
                 case 29 /* LessThanToken */:
                     // If we are not in JSX context, we are parsing TypeAssertion which is an UnaryExpression
@@ -32110,7 +33976,7 @@ var ts;
             // or starts the beginning of the first four CallExpression productions.
             var pos = getNodePos();
             var expression;
-            if (token() === 99 /* ImportKeyword */) {
+            if (token() === 100 /* ImportKeyword */) {
                 if (lookAhead(nextTokenIsOpenParenOrLessThan)) {
                     // We don't want to eagerly consume all import keyword as import call expression so we look ahead to find "("
                     // For example:
@@ -32124,7 +33990,7 @@ var ts;
                     // This is an 'import.*' metaproperty (i.e. 'import.meta')
                     nextToken(); // advance past the 'import'
                     nextToken(); // advance past the dot
-                    expression = finishNode(factory.createMetaProperty(99 /* ImportKeyword */, parseIdentifierName()), pos);
+                    expression = finishNode(factory.createMetaProperty(100 /* ImportKeyword */, parseIdentifierName()), pos);
                     sourceFlags |= 2097152 /* PossiblyContainsImportMeta */;
                 }
                 else {
@@ -32132,7 +33998,7 @@ var ts;
                 }
             }
             else {
-                expression = token() === 105 /* SuperKeyword */ ? parseSuperExpression() : parseMemberExpressionOrHigher();
+                expression = token() === 106 /* SuperKeyword */ ? parseSuperExpression() : parseMemberExpressionOrHigher();
             }
             // Now, we *may* be complete.  However, we might have consumed the start of a
             // CallExpression or OptionalExpression.  As such, we need to consume the rest
@@ -32210,23 +34076,45 @@ var ts;
             // private names will never work with `super` (`super.#foo`), but that's a semantic error, not syntactic
             return finishNode(factory.createPropertyAccessExpression(expression, parseRightSideOfDot(/*allowIdentifierNames*/ true, /*allowPrivateIdentifiers*/ true)), pos);
         }
-        function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext, topInvalidNodePosition) {
+        function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext, topInvalidNodePosition, openingTag) {
             var pos = getNodePos();
             var opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext);
             var result;
-            if (opening.kind === 275 /* JsxOpeningElement */) {
+            if (opening.kind === 279 /* JsxOpeningElement */) {
                 var children = parseJsxChildren(opening);
-                var closingElement = parseJsxClosingElement(inExpressionContext);
-                if (!tagNamesAreEquivalent(opening.tagName, closingElement.tagName)) {
-                    parseErrorAtRange(closingElement, ts.Diagnostics.Expected_corresponding_JSX_closing_tag_for_0, ts.getTextOfNodeFromSourceText(sourceText, opening.tagName));
+                var closingElement = void 0;
+                var lastChild = children[children.length - 1];
+                if ((lastChild === null || lastChild === void 0 ? void 0 : lastChild.kind) === 277 /* JsxElement */
+                    && !tagNamesAreEquivalent(lastChild.openingElement.tagName, lastChild.closingElement.tagName)
+                    && tagNamesAreEquivalent(opening.tagName, lastChild.closingElement.tagName)) {
+                    // when an unclosed JsxOpeningElement incorrectly parses its parent's JsxClosingElement,
+                    // restructure (<div>(...<span>...</div>)) --> (<div>(...<span>...</>)</div>)
+                    // (no need to error; the parent will error)
+                    var end = lastChild.children.end;
+                    var newLast = finishNode(factory.createJsxElement(lastChild.openingElement, lastChild.children, finishNode(factory.createJsxClosingElement(finishNode(factory.createIdentifier(""), end, end)), end, end)), lastChild.openingElement.pos, end);
+                    children = createNodeArray(__spreadArray(__spreadArray([], children.slice(0, children.length - 1), true), [newLast], false), children.pos, end);
+                    closingElement = lastChild.closingElement;
+                }
+                else {
+                    closingElement = parseJsxClosingElement(opening, inExpressionContext);
+                    if (!tagNamesAreEquivalent(opening.tagName, closingElement.tagName)) {
+                        if (openingTag && ts.isJsxOpeningElement(openingTag) && tagNamesAreEquivalent(closingElement.tagName, openingTag.tagName)) {
+                            // opening incorrectly matched with its parent's closing -- put error on opening
+                            parseErrorAtRange(opening.tagName, ts.Diagnostics.JSX_element_0_has_no_corresponding_closing_tag, ts.getTextOfNodeFromSourceText(sourceText, opening.tagName));
+                        }
+                        else {
+                            // other opening/closing mismatches -- put error on closing
+                            parseErrorAtRange(closingElement.tagName, ts.Diagnostics.Expected_corresponding_JSX_closing_tag_for_0, ts.getTextOfNodeFromSourceText(sourceText, opening.tagName));
+                        }
+                    }
                 }
                 result = finishNode(factory.createJsxElement(opening, children, closingElement), pos);
             }
-            else if (opening.kind === 278 /* JsxOpeningFragment */) {
+            else if (opening.kind === 282 /* JsxOpeningFragment */) {
                 result = finishNode(factory.createJsxFragment(opening, parseJsxChildren(opening), parseJsxClosingFragment(inExpressionContext)), pos);
             }
             else {
-                ts.Debug.assert(opening.kind === 274 /* JsxSelfClosingElement */);
+                ts.Debug.assert(opening.kind === 278 /* JsxSelfClosingElement */);
                 // Nothing else to do for self-closing elements
                 result = opening;
             }
@@ -32280,7 +34168,7 @@ var ts;
                 case 18 /* OpenBraceToken */:
                     return parseJsxExpression(/*inExpressionContext*/ false);
                 case 29 /* LessThanToken */:
-                    return parseJsxElementOrSelfClosingElementOrFragment(/*inExpressionContext*/ false);
+                    return parseJsxElementOrSelfClosingElementOrFragment(/*inExpressionContext*/ false, /*topInvalidNodePosition*/ undefined, openingTag);
                 default:
                     return ts.Debug.assertNever(token);
             }
@@ -32295,6 +34183,13 @@ var ts;
                 if (!child)
                     break;
                 list.push(child);
+                if (ts.isJsxOpeningElement(openingTag)
+                    && (child === null || child === void 0 ? void 0 : child.kind) === 277 /* JsxElement */
+                    && !tagNamesAreEquivalent(child.openingElement.tagName, child.closingElement.tagName)
+                    && tagNamesAreEquivalent(openingTag.tagName, child.closingElement.tagName)) {
+                    // stop after parsing a mismatched child like <div>...(<span></div>) in order to reattach the </div> higher
+                    break;
+                }
             }
             parsingContext = saveParsingContext;
             return createNodeArray(list, listPos);
@@ -32324,12 +34219,14 @@ var ts;
             }
             else {
                 parseExpected(43 /* SlashToken */);
-                if (inExpressionContext) {
-                    parseExpected(31 /* GreaterThanToken */);
-                }
-                else {
-                    parseExpected(31 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false);
-                    scanJsxText();
+                if (parseExpected(31 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false)) {
+                    // manually advance the scanner in order to look for jsx text inside jsx
+                    if (inExpressionContext) {
+                        nextToken();
+                    }
+                    else {
+                        scanJsxText();
+                    }
                 }
                 node = factory.createJsxSelfClosingElement(tagName, typeArguments, attributes);
             }
@@ -32343,7 +34240,7 @@ var ts;
             //      primaryExpression in the form of an identifier and "this" keyword
             // We can't just simply use parseLeftHandSideExpressionOrHigher because then we will start consider class,function etc as a keyword
             // We only want to consider "this" as a primaryExpression
-            var expression = token() === 107 /* ThisKeyword */ ?
+            var expression = token() === 108 /* ThisKeyword */ ?
                 parseTokenNode() : parseIdentifierName();
             while (parseOptional(24 /* DotToken */)) {
                 expression = finishNode(factory.createPropertyAccessExpression(expression, parseRightSideOfDot(/*allowIdentifierNames*/ true, /*allowPrivateIdentifiers*/ false)), pos);
@@ -32380,7 +34277,7 @@ var ts;
             }
             scanJsxIdentifier();
             var pos = getNodePos();
-            return finishNode(factory.createJsxAttribute(parseIdentifierName(), token() !== 62 /* EqualsToken */ ? undefined :
+            return finishNode(factory.createJsxAttribute(parseIdentifierName(), token() !== 63 /* EqualsToken */ ? undefined :
                 scanJsxAttributeValue() === 10 /* StringLiteral */ ? parseLiteralNode() :
                     parseJsxExpression(/*inExpressionContext*/ true)), pos);
         }
@@ -32392,16 +34289,18 @@ var ts;
             parseExpected(19 /* CloseBraceToken */);
             return finishNode(factory.createJsxSpreadAttribute(expression), pos);
         }
-        function parseJsxClosingElement(inExpressionContext) {
+        function parseJsxClosingElement(open, inExpressionContext) {
             var pos = getNodePos();
             parseExpected(30 /* LessThanSlashToken */);
             var tagName = parseJsxElementName();
-            if (inExpressionContext) {
-                parseExpected(31 /* GreaterThanToken */);
-            }
-            else {
-                parseExpected(31 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false);
-                scanJsxText();
+            if (parseExpected(31 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false)) {
+                // manually advance the scanner in order to look for jsx text inside jsx
+                if (inExpressionContext || !tagNamesAreEquivalent(open.tagName, tagName)) {
+                    nextToken();
+                }
+                else {
+                    scanJsxText();
+                }
             }
             return finishNode(factory.createJsxClosingElement(tagName), pos);
         }
@@ -32411,12 +34310,14 @@ var ts;
             if (ts.tokenIsIdentifierOrKeyword(token())) {
                 parseErrorAtRange(parseJsxElementName(), ts.Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment);
             }
-            if (inExpressionContext) {
-                parseExpected(31 /* GreaterThanToken */);
-            }
-            else {
-                parseExpected(31 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false);
-                scanJsxText();
+            if (parseExpected(31 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false)) {
+                // manually advance the scanner in order to look for jsx text inside jsx
+                if (inExpressionContext) {
+                    nextToken();
+                }
+                else {
+                    scanJsxText();
+                }
             }
             return finishNode(factory.createJsxJsxClosingFragment(), pos);
         }
@@ -32473,7 +34374,7 @@ var ts;
         function parseElementAccessExpressionRest(pos, expression, questionDotToken) {
             var argumentExpression;
             if (token() === 23 /* CloseBracketToken */) {
-                argumentExpression = createMissingNode(78 /* Identifier */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.An_element_access_expression_should_take_an_argument);
+                argumentExpression = createMissingNode(79 /* Identifier */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.An_element_access_expression_should_take_an_argument);
             }
             else {
                 var argument = allowInAnd(parseExpression);
@@ -32568,7 +34469,7 @@ var ts;
                 }
                 if (questionDotToken) {
                     // We failed to parse anything, so report a missing identifier here.
-                    var name = createMissingNode(78 /* Identifier */, /*reportAtCurrentPosition*/ false, ts.Diagnostics.Identifier_expected);
+                    var name = createMissingNode(79 /* Identifier */, /*reportAtCurrentPosition*/ false, ts.Diagnostics.Identifier_expected);
                     expression = finishNode(factory.createPropertyAccessChain(expression, questionDotToken, name), pos);
                 }
                 break;
@@ -32649,11 +34550,11 @@ var ts;
                 case 10 /* StringLiteral */:
                 case 14 /* NoSubstitutionTemplateLiteral */:
                     return parseLiteralNode();
-                case 107 /* ThisKeyword */:
-                case 105 /* SuperKeyword */:
-                case 103 /* NullKeyword */:
-                case 109 /* TrueKeyword */:
-                case 94 /* FalseKeyword */:
+                case 108 /* ThisKeyword */:
+                case 106 /* SuperKeyword */:
+                case 104 /* NullKeyword */:
+                case 110 /* TrueKeyword */:
+                case 95 /* FalseKeyword */:
                     return parseTokenNode();
                 case 20 /* OpenParenToken */:
                     return parseParenthesizedExpression();
@@ -32661,7 +34562,7 @@ var ts;
                     return parseArrayLiteralExpression();
                 case 18 /* OpenBraceToken */:
                     return parseObjectLiteralExpression();
-                case 129 /* AsyncKeyword */:
+                case 131 /* AsyncKeyword */:
                     // Async arrow functions are parsed earlier in parseAssignmentExpressionOrHigher.
                     // If we encounter `async [no LineTerminator here] function` then this is an async
                     // function; otherwise, its an identifier.
@@ -32669,20 +34570,22 @@ var ts;
                         break;
                     }
                     return parseFunctionExpression();
-                case 83 /* ClassKeyword */:
+                case 84 /* ClassKeyword */:
                     return parseClassExpression();
-                case 97 /* FunctionKeyword */:
+                case 98 /* FunctionKeyword */:
                     return parseFunctionExpression();
-                case 102 /* NewKeyword */:
+                case 103 /* NewKeyword */:
                     return parseNewExpressionOrNewDotTarget();
                 case 43 /* SlashToken */:
-                case 67 /* SlashEqualsToken */:
+                case 68 /* SlashEqualsToken */:
                     if (reScanSlashToken() === 13 /* RegularExpressionLiteral */) {
                         return parseLiteralNode();
                     }
                     break;
                 case 15 /* TemplateHead */:
                     return parseTemplateExpression(/* isTaggedTemplate */ false);
+                case 80 /* PrivateIdentifier */:
+                    return parsePrivateIdentifier();
             }
             return parseIdentifier(ts.Diagnostics.Expression_expected);
         }
@@ -32725,11 +34628,11 @@ var ts;
             }
             var decorators = parseDecorators();
             var modifiers = parseModifiers();
-            if (parseContextualModifier(134 /* GetKeyword */)) {
-                return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 167 /* GetAccessor */);
+            if (parseContextualModifier(136 /* GetKeyword */)) {
+                return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 171 /* GetAccessor */);
             }
-            if (parseContextualModifier(146 /* SetKeyword */)) {
-                return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 168 /* SetAccessor */);
+            if (parseContextualModifier(148 /* SetKeyword */)) {
+                return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 172 /* SetAccessor */);
             }
             var asteriskToken = parseOptionalToken(41 /* AsteriskToken */);
             var tokenIsIdentifier = isIdentifier();
@@ -32748,7 +34651,7 @@ var ts;
             var node;
             var isShorthandPropertyAssignment = tokenIsIdentifier && (token() !== 58 /* ColonToken */);
             if (isShorthandPropertyAssignment) {
-                var equalsToken = parseOptionalToken(62 /* EqualsToken */);
+                var equalsToken = parseOptionalToken(63 /* EqualsToken */);
                 var objectAssignmentInitializer = equalsToken ? allowInAnd(parseAssignmentExpressionOrHigher) : undefined;
                 node = factory.createShorthandPropertyAssignment(name, objectAssignmentInitializer);
                 // Save equals token for error reporting.
@@ -32787,14 +34690,12 @@ var ts;
             //
             // FunctionExpression:
             //      function BindingIdentifier[opt](FormalParameters){ FunctionBody }
-            var saveDecoratorContext = inDecoratorContext();
-            if (saveDecoratorContext) {
-                setDecoratorContext(/*val*/ false);
-            }
+            var savedDecoratorContext = inDecoratorContext();
+            setDecoratorContext(/*val*/ false);
             var pos = getNodePos();
             var hasJSDoc = hasPrecedingJSDocComment();
             var modifiers = parseModifiers();
-            parseExpected(97 /* FunctionKeyword */);
+            parseExpected(98 /* FunctionKeyword */);
             var asteriskToken = parseOptionalToken(41 /* AsteriskToken */);
             var isGenerator = asteriskToken ? 1 /* Yield */ : 0 /* None */;
             var isAsync = ts.some(modifiers, ts.isAsyncModifier) ? 2 /* Await */ : 0 /* None */;
@@ -32806,9 +34707,7 @@ var ts;
             var parameters = parseParameters(isGenerator | isAsync);
             var type = parseReturnType(58 /* ColonToken */, /*isType*/ false);
             var body = parseFunctionBlock(isGenerator | isAsync);
-            if (saveDecoratorContext) {
-                setDecoratorContext(/*val*/ true);
-            }
+            setDecoratorContext(savedDecoratorContext);
             var node = factory.createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body);
             return withJSDoc(finishNode(node, pos), hasJSDoc);
         }
@@ -32817,10 +34716,10 @@ var ts;
         }
         function parseNewExpressionOrNewDotTarget() {
             var pos = getNodePos();
-            parseExpected(102 /* NewKeyword */);
+            parseExpected(103 /* NewKeyword */);
             if (parseOptional(24 /* DotToken */)) {
                 var name = parseIdentifierName();
-                return finishNode(factory.createMetaProperty(102 /* NewKeyword */, name), pos);
+                return finishNode(factory.createMetaProperty(103 /* NewKeyword */, name), pos);
             }
             var expressionPos = getNodePos();
             var expression = parsePrimaryExpression();
@@ -32847,6 +34746,7 @@ var ts;
         // STATEMENTS
         function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) {
             var pos = getNodePos();
+            var hasJSDoc = hasPrecedingJSDocComment();
             var openBracePosition = scanner.getTokenPos();
             if (parseExpected(18 /* OpenBraceToken */, diagnosticMessage) || ignoreMissingOpenBrace) {
                 var multiLine = scanner.hasPrecedingLineBreak();
@@ -32857,11 +34757,16 @@ var ts;
                         ts.addRelatedInfo(lastError, ts.createDetachedDiagnostic(fileName, openBracePosition, 1, ts.Diagnostics.The_parser_expected_to_find_a_to_match_the_token_here));
                     }
                 }
-                return finishNode(factory.createBlock(statements, multiLine), pos);
+                var result = withJSDoc(finishNode(factory.createBlock(statements, multiLine), pos), hasJSDoc);
+                if (token() === 63 /* EqualsToken */) {
+                    parseErrorAtCurrentToken(ts.Diagnostics.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_the_whole_assignment_in_parentheses);
+                    nextToken();
+                }
+                return result;
             }
             else {
                 var statements = createMissingList();
-                return finishNode(factory.createBlock(statements, /*multiLine*/ undefined), pos);
+                return withJSDoc(finishNode(factory.createBlock(statements, /*multiLine*/ undefined), pos), hasJSDoc);
             }
         }
         function parseFunctionBlock(flags, diagnosticMessage) {
@@ -32888,24 +34793,27 @@ var ts;
         }
         function parseEmptyStatement() {
             var pos = getNodePos();
+            var hasJSDoc = hasPrecedingJSDocComment();
             parseExpected(26 /* SemicolonToken */);
-            return finishNode(factory.createEmptyStatement(), pos);
+            return withJSDoc(finishNode(factory.createEmptyStatement(), pos), hasJSDoc);
         }
         function parseIfStatement() {
             var pos = getNodePos();
-            parseExpected(98 /* IfKeyword */);
+            var hasJSDoc = hasPrecedingJSDocComment();
+            parseExpected(99 /* IfKeyword */);
             parseExpected(20 /* OpenParenToken */);
             var expression = allowInAnd(parseExpression);
             parseExpected(21 /* CloseParenToken */);
             var thenStatement = parseStatement();
-            var elseStatement = parseOptional(90 /* ElseKeyword */) ? parseStatement() : undefined;
-            return finishNode(factory.createIfStatement(expression, thenStatement, elseStatement), pos);
+            var elseStatement = parseOptional(91 /* ElseKeyword */) ? parseStatement() : undefined;
+            return withJSDoc(finishNode(factory.createIfStatement(expression, thenStatement, elseStatement), pos), hasJSDoc);
         }
         function parseDoStatement() {
             var pos = getNodePos();
-            parseExpected(89 /* DoKeyword */);
+            var hasJSDoc = hasPrecedingJSDocComment();
+            parseExpected(90 /* DoKeyword */);
             var statement = parseStatement();
-            parseExpected(114 /* WhileKeyword */);
+            parseExpected(115 /* WhileKeyword */);
             parseExpected(20 /* OpenParenToken */);
             var expression = allowInAnd(parseExpression);
             parseExpected(21 /* CloseParenToken */);
@@ -32914,25 +34822,27 @@ var ts;
             // spec but allowed in consensus reality. Approved -- this is the de-facto standard whereby
             //  do;while(0)x will have a semicolon inserted before x.
             parseOptional(26 /* SemicolonToken */);
-            return finishNode(factory.createDoStatement(statement, expression), pos);
+            return withJSDoc(finishNode(factory.createDoStatement(statement, expression), pos), hasJSDoc);
         }
         function parseWhileStatement() {
             var pos = getNodePos();
-            parseExpected(114 /* WhileKeyword */);
+            var hasJSDoc = hasPrecedingJSDocComment();
+            parseExpected(115 /* WhileKeyword */);
             parseExpected(20 /* OpenParenToken */);
             var expression = allowInAnd(parseExpression);
             parseExpected(21 /* CloseParenToken */);
             var statement = parseStatement();
-            return finishNode(factory.createWhileStatement(expression, statement), pos);
+            return withJSDoc(finishNode(factory.createWhileStatement(expression, statement), pos), hasJSDoc);
         }
         function parseForOrForInOrForOfStatement() {
             var pos = getNodePos();
-            parseExpected(96 /* ForKeyword */);
-            var awaitToken = parseOptionalToken(130 /* AwaitKeyword */);
+            var hasJSDoc = hasPrecedingJSDocComment();
+            parseExpected(97 /* ForKeyword */);
+            var awaitToken = parseOptionalToken(132 /* AwaitKeyword */);
             parseExpected(20 /* OpenParenToken */);
             var initializer;
             if (token() !== 26 /* SemicolonToken */) {
-                if (token() === 112 /* VarKeyword */ || token() === 118 /* LetKeyword */ || token() === 84 /* ConstKeyword */) {
+                if (token() === 113 /* VarKeyword */ || token() === 119 /* LetKeyword */ || token() === 85 /* ConstKeyword */) {
                     initializer = parseVariableDeclarationList(/*inForStatementInitializer*/ true);
                 }
                 else {
@@ -32940,12 +34850,12 @@ var ts;
                 }
             }
             var node;
-            if (awaitToken ? parseExpected(156 /* OfKeyword */) : parseOptional(156 /* OfKeyword */)) {
+            if (awaitToken ? parseExpected(159 /* OfKeyword */) : parseOptional(159 /* OfKeyword */)) {
                 var expression = allowInAnd(parseAssignmentExpressionOrHigher);
                 parseExpected(21 /* CloseParenToken */);
                 node = factory.createForOfStatement(awaitToken, initializer, expression, parseStatement());
             }
-            else if (parseOptional(100 /* InKeyword */)) {
+            else if (parseOptional(101 /* InKeyword */)) {
                 var expression = allowInAnd(parseExpression);
                 parseExpected(21 /* CloseParenToken */);
                 node = factory.createForInStatement(initializer, expression, parseStatement());
@@ -32962,37 +34872,40 @@ var ts;
                 parseExpected(21 /* CloseParenToken */);
                 node = factory.createForStatement(initializer, condition, incrementor, parseStatement());
             }
-            return finishNode(node, pos);
+            return withJSDoc(finishNode(node, pos), hasJSDoc);
         }
         function parseBreakOrContinueStatement(kind) {
             var pos = getNodePos();
-            parseExpected(kind === 241 /* BreakStatement */ ? 80 /* BreakKeyword */ : 85 /* ContinueKeyword */);
+            var hasJSDoc = hasPrecedingJSDocComment();
+            parseExpected(kind === 245 /* BreakStatement */ ? 81 /* BreakKeyword */ : 86 /* ContinueKeyword */);
             var label = canParseSemicolon() ? undefined : parseIdentifier();
             parseSemicolon();
-            var node = kind === 241 /* BreakStatement */
+            var node = kind === 245 /* BreakStatement */
                 ? factory.createBreakStatement(label)
                 : factory.createContinueStatement(label);
-            return finishNode(node, pos);
+            return withJSDoc(finishNode(node, pos), hasJSDoc);
         }
         function parseReturnStatement() {
             var pos = getNodePos();
-            parseExpected(104 /* ReturnKeyword */);
+            var hasJSDoc = hasPrecedingJSDocComment();
+            parseExpected(105 /* ReturnKeyword */);
             var expression = canParseSemicolon() ? undefined : allowInAnd(parseExpression);
             parseSemicolon();
-            return finishNode(factory.createReturnStatement(expression), pos);
+            return withJSDoc(finishNode(factory.createReturnStatement(expression), pos), hasJSDoc);
         }
         function parseWithStatement() {
             var pos = getNodePos();
-            parseExpected(115 /* WithKeyword */);
+            var hasJSDoc = hasPrecedingJSDocComment();
+            parseExpected(116 /* WithKeyword */);
             parseExpected(20 /* OpenParenToken */);
             var expression = allowInAnd(parseExpression);
             parseExpected(21 /* CloseParenToken */);
             var statement = doInsideOfContext(16777216 /* InWithStatement */, parseStatement);
-            return finishNode(factory.createWithStatement(expression, statement), pos);
+            return withJSDoc(finishNode(factory.createWithStatement(expression, statement), pos), hasJSDoc);
         }
         function parseCaseClause() {
             var pos = getNodePos();
-            parseExpected(81 /* CaseKeyword */);
+            parseExpected(82 /* CaseKeyword */);
             var expression = allowInAnd(parseExpression);
             parseExpected(58 /* ColonToken */);
             var statements = parseList(3 /* SwitchClauseStatements */, parseStatement);
@@ -33000,13 +34913,13 @@ var ts;
         }
         function parseDefaultClause() {
             var pos = getNodePos();
-            parseExpected(87 /* DefaultKeyword */);
+            parseExpected(88 /* DefaultKeyword */);
             parseExpected(58 /* ColonToken */);
             var statements = parseList(3 /* SwitchClauseStatements */, parseStatement);
             return finishNode(factory.createDefaultClause(statements), pos);
         }
         function parseCaseOrDefaultClause() {
-            return token() === 81 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause();
+            return token() === 82 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause();
         }
         function parseCaseBlock() {
             var pos = getNodePos();
@@ -33017,18 +34930,20 @@ var ts;
         }
         function parseSwitchStatement() {
             var pos = getNodePos();
-            parseExpected(106 /* SwitchKeyword */);
+            var hasJSDoc = hasPrecedingJSDocComment();
+            parseExpected(107 /* SwitchKeyword */);
             parseExpected(20 /* OpenParenToken */);
             var expression = allowInAnd(parseExpression);
             parseExpected(21 /* CloseParenToken */);
             var caseBlock = parseCaseBlock();
-            return finishNode(factory.createSwitchStatement(expression, caseBlock), pos);
+            return withJSDoc(finishNode(factory.createSwitchStatement(expression, caseBlock), pos), hasJSDoc);
         }
         function parseThrowStatement() {
             // ThrowStatement[Yield] :
             //      throw [no LineTerminator here]Expression[In, ?Yield];
             var pos = getNodePos();
-            parseExpected(108 /* ThrowKeyword */);
+            var hasJSDoc = hasPrecedingJSDocComment();
+            parseExpected(109 /* ThrowKeyword */);
             // Because of automatic semicolon insertion, we need to report error if this
             // throw could be terminated with a semicolon.  Note: we can't call 'parseExpression'
             // directly as that might consume an expression on the following line.
@@ -33039,27 +34954,30 @@ var ts;
                 identifierCount++;
                 expression = finishNode(factory.createIdentifier(""), getNodePos());
             }
-            parseSemicolon();
-            return finishNode(factory.createThrowStatement(expression), pos);
+            if (!tryParseSemicolon()) {
+                parseErrorForMissingSemicolonAfter(expression);
+            }
+            return withJSDoc(finishNode(factory.createThrowStatement(expression), pos), hasJSDoc);
         }
         // TODO: Review for error recovery
         function parseTryStatement() {
             var pos = getNodePos();
-            parseExpected(110 /* TryKeyword */);
+            var hasJSDoc = hasPrecedingJSDocComment();
+            parseExpected(111 /* TryKeyword */);
             var tryBlock = parseBlock(/*ignoreMissingOpenBrace*/ false);
-            var catchClause = token() === 82 /* CatchKeyword */ ? parseCatchClause() : undefined;
+            var catchClause = token() === 83 /* CatchKeyword */ ? parseCatchClause() : undefined;
             // If we don't have a catch clause, then we must have a finally clause.  Try to parse
             // one out no matter what.
             var finallyBlock;
-            if (!catchClause || token() === 95 /* FinallyKeyword */) {
-                parseExpected(95 /* FinallyKeyword */);
+            if (!catchClause || token() === 96 /* FinallyKeyword */) {
+                parseExpected(96 /* FinallyKeyword */);
                 finallyBlock = parseBlock(/*ignoreMissingOpenBrace*/ false);
             }
-            return finishNode(factory.createTryStatement(tryBlock, catchClause, finallyBlock), pos);
+            return withJSDoc(finishNode(factory.createTryStatement(tryBlock, catchClause, finallyBlock), pos), hasJSDoc);
         }
         function parseCatchClause() {
             var pos = getNodePos();
-            parseExpected(82 /* CatchKeyword */);
+            parseExpected(83 /* CatchKeyword */);
             var variableDeclaration;
             if (parseOptional(20 /* OpenParenToken */)) {
                 variableDeclaration = parseVariableDeclaration();
@@ -33074,9 +34992,10 @@ var ts;
         }
         function parseDebuggerStatement() {
             var pos = getNodePos();
-            parseExpected(86 /* DebuggerKeyword */);
+            var hasJSDoc = hasPrecedingJSDocComment();
+            parseExpected(87 /* DebuggerKeyword */);
             parseSemicolon();
-            return finishNode(factory.createDebuggerStatement(), pos);
+            return withJSDoc(finishNode(factory.createDebuggerStatement(), pos), hasJSDoc);
         }
         function parseExpressionOrLabeledStatement() {
             // Avoiding having to do the lookahead for a labeled statement by just trying to parse
@@ -33091,7 +35010,9 @@ var ts;
                 node = factory.createLabeledStatement(expression, parseStatement());
             }
             else {
-                parseSemicolon();
+                if (!tryParseSemicolon()) {
+                    parseErrorForMissingSemicolonAfter(expression);
+                }
                 node = factory.createExpressionStatement(expression);
                 if (hasParen) {
                     // do not parse the same jsdoc twice
@@ -33106,11 +35027,11 @@ var ts;
         }
         function nextTokenIsClassKeywordOnSameLine() {
             nextToken();
-            return token() === 83 /* ClassKeyword */ && !scanner.hasPrecedingLineBreak();
+            return token() === 84 /* ClassKeyword */ && !scanner.hasPrecedingLineBreak();
         }
         function nextTokenIsFunctionKeywordOnSameLine() {
             nextToken();
-            return token() === 97 /* FunctionKeyword */ && !scanner.hasPrecedingLineBreak();
+            return token() === 98 /* FunctionKeyword */ && !scanner.hasPrecedingLineBreak();
         }
         function nextTokenIsIdentifierOrKeywordOrLiteralOnSameLine() {
             nextToken();
@@ -33119,12 +35040,12 @@ var ts;
         function isDeclaration() {
             while (true) {
                 switch (token()) {
-                    case 112 /* VarKeyword */:
-                    case 118 /* LetKeyword */:
-                    case 84 /* ConstKeyword */:
-                    case 97 /* FunctionKeyword */:
-                    case 83 /* ClassKeyword */:
-                    case 91 /* EnumKeyword */:
+                    case 113 /* VarKeyword */:
+                    case 119 /* LetKeyword */:
+                    case 85 /* ConstKeyword */:
+                    case 98 /* FunctionKeyword */:
+                    case 84 /* ClassKeyword */:
+                    case 92 /* EnumKeyword */:
                         return true;
                     // 'declare', 'module', 'namespace', 'interface'* and 'type' are all legal JavaScript identifiers;
                     // however, an identifier cannot be followed by another identifier on the same line. This is what we
@@ -33147,44 +35068,44 @@ var ts;
                     //   I {}
                     //
                     // could be legal, it would add complexity for very little gain.
-                    case 117 /* InterfaceKeyword */:
-                    case 149 /* TypeKeyword */:
+                    case 118 /* InterfaceKeyword */:
+                    case 151 /* TypeKeyword */:
                         return nextTokenIsIdentifierOnSameLine();
-                    case 139 /* ModuleKeyword */:
-                    case 140 /* NamespaceKeyword */:
+                    case 141 /* ModuleKeyword */:
+                    case 142 /* NamespaceKeyword */:
                         return nextTokenIsIdentifierOrStringLiteralOnSameLine();
-                    case 125 /* AbstractKeyword */:
-                    case 129 /* AsyncKeyword */:
-                    case 133 /* DeclareKeyword */:
-                    case 120 /* PrivateKeyword */:
-                    case 121 /* ProtectedKeyword */:
-                    case 122 /* PublicKeyword */:
-                    case 142 /* ReadonlyKeyword */:
+                    case 126 /* AbstractKeyword */:
+                    case 131 /* AsyncKeyword */:
+                    case 135 /* DeclareKeyword */:
+                    case 121 /* PrivateKeyword */:
+                    case 122 /* ProtectedKeyword */:
+                    case 123 /* PublicKeyword */:
+                    case 144 /* ReadonlyKeyword */:
                         nextToken();
                         // ASI takes effect for this modifier.
                         if (scanner.hasPrecedingLineBreak()) {
                             return false;
                         }
                         continue;
-                    case 154 /* GlobalKeyword */:
+                    case 156 /* GlobalKeyword */:
                         nextToken();
-                        return token() === 18 /* OpenBraceToken */ || token() === 78 /* Identifier */ || token() === 92 /* ExportKeyword */;
-                    case 99 /* ImportKeyword */:
+                        return token() === 18 /* OpenBraceToken */ || token() === 79 /* Identifier */ || token() === 93 /* ExportKeyword */;
+                    case 100 /* ImportKeyword */:
                         nextToken();
                         return token() === 10 /* StringLiteral */ || token() === 41 /* AsteriskToken */ ||
                             token() === 18 /* OpenBraceToken */ || ts.tokenIsIdentifierOrKeyword(token());
-                    case 92 /* ExportKeyword */:
+                    case 93 /* ExportKeyword */:
                         var currentToken_1 = nextToken();
-                        if (currentToken_1 === 149 /* TypeKeyword */) {
+                        if (currentToken_1 === 151 /* TypeKeyword */) {
                             currentToken_1 = lookAhead(nextToken);
                         }
-                        if (currentToken_1 === 62 /* EqualsToken */ || currentToken_1 === 41 /* AsteriskToken */ ||
-                            currentToken_1 === 18 /* OpenBraceToken */ || currentToken_1 === 87 /* DefaultKeyword */ ||
-                            currentToken_1 === 126 /* AsKeyword */) {
+                        if (currentToken_1 === 63 /* EqualsToken */ || currentToken_1 === 41 /* AsteriskToken */ ||
+                            currentToken_1 === 18 /* OpenBraceToken */ || currentToken_1 === 88 /* DefaultKeyword */ ||
+                            currentToken_1 === 127 /* AsKeyword */) {
                             return true;
                         }
                         continue;
-                    case 123 /* StaticKeyword */:
+                    case 124 /* StaticKeyword */:
                         nextToken();
                         continue;
                     default:
@@ -33200,48 +35121,48 @@ var ts;
                 case 59 /* AtToken */:
                 case 26 /* SemicolonToken */:
                 case 18 /* OpenBraceToken */:
-                case 112 /* VarKeyword */:
-                case 118 /* LetKeyword */:
-                case 97 /* FunctionKeyword */:
-                case 83 /* ClassKeyword */:
-                case 91 /* EnumKeyword */:
-                case 98 /* IfKeyword */:
-                case 89 /* DoKeyword */:
-                case 114 /* WhileKeyword */:
-                case 96 /* ForKeyword */:
-                case 85 /* ContinueKeyword */:
-                case 80 /* BreakKeyword */:
-                case 104 /* ReturnKeyword */:
-                case 115 /* WithKeyword */:
-                case 106 /* SwitchKeyword */:
-                case 108 /* ThrowKeyword */:
-                case 110 /* TryKeyword */:
-                case 86 /* DebuggerKeyword */:
+                case 113 /* VarKeyword */:
+                case 119 /* LetKeyword */:
+                case 98 /* FunctionKeyword */:
+                case 84 /* ClassKeyword */:
+                case 92 /* EnumKeyword */:
+                case 99 /* IfKeyword */:
+                case 90 /* DoKeyword */:
+                case 115 /* WhileKeyword */:
+                case 97 /* ForKeyword */:
+                case 86 /* ContinueKeyword */:
+                case 81 /* BreakKeyword */:
+                case 105 /* ReturnKeyword */:
+                case 116 /* WithKeyword */:
+                case 107 /* SwitchKeyword */:
+                case 109 /* ThrowKeyword */:
+                case 111 /* TryKeyword */:
+                case 87 /* DebuggerKeyword */:
                 // 'catch' and 'finally' do not actually indicate that the code is part of a statement,
                 // however, we say they are here so that we may gracefully parse them and error later.
                 // falls through
-                case 82 /* CatchKeyword */:
-                case 95 /* FinallyKeyword */:
+                case 83 /* CatchKeyword */:
+                case 96 /* FinallyKeyword */:
                     return true;
-                case 99 /* ImportKeyword */:
+                case 100 /* ImportKeyword */:
                     return isStartOfDeclaration() || lookAhead(nextTokenIsOpenParenOrLessThanOrDot);
-                case 84 /* ConstKeyword */:
-                case 92 /* ExportKeyword */:
+                case 85 /* ConstKeyword */:
+                case 93 /* ExportKeyword */:
                     return isStartOfDeclaration();
-                case 129 /* AsyncKeyword */:
-                case 133 /* DeclareKeyword */:
-                case 117 /* InterfaceKeyword */:
-                case 139 /* ModuleKeyword */:
-                case 140 /* NamespaceKeyword */:
-                case 149 /* TypeKeyword */:
-                case 154 /* GlobalKeyword */:
+                case 131 /* AsyncKeyword */:
+                case 135 /* DeclareKeyword */:
+                case 118 /* InterfaceKeyword */:
+                case 141 /* ModuleKeyword */:
+                case 142 /* NamespaceKeyword */:
+                case 151 /* TypeKeyword */:
+                case 156 /* GlobalKeyword */:
                     // When these don't start a declaration, they're an identifier in an expression statement
                     return true;
-                case 122 /* PublicKeyword */:
-                case 120 /* PrivateKeyword */:
-                case 121 /* ProtectedKeyword */:
-                case 123 /* StaticKeyword */:
-                case 142 /* ReadonlyKeyword */:
+                case 123 /* PublicKeyword */:
+                case 121 /* PrivateKeyword */:
+                case 122 /* ProtectedKeyword */:
+                case 124 /* StaticKeyword */:
+                case 144 /* ReadonlyKeyword */:
                     // When these don't start a declaration, they may be the start of a class member if an identifier
                     // immediately follows. Otherwise they're an identifier in an expression statement.
                     return isStartOfDeclaration() || !lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine);
@@ -33249,14 +35170,14 @@ var ts;
                     return isStartOfExpression();
             }
         }
-        function nextTokenIsIdentifierOrStartOfDestructuring() {
+        function nextTokenIsBindingIdentifierOrStartOfDestructuring() {
             nextToken();
-            return isIdentifier() || token() === 18 /* OpenBraceToken */ || token() === 22 /* OpenBracketToken */;
+            return isBindingIdentifier() || token() === 18 /* OpenBraceToken */ || token() === 22 /* OpenBracketToken */;
         }
         function isLetDeclaration() {
             // In ES6 'let' always starts a lexical declaration if followed by an identifier or {
             // or [.
-            return lookAhead(nextTokenIsIdentifierOrStartOfDestructuring);
+            return lookAhead(nextTokenIsBindingIdentifierOrStartOfDestructuring);
         }
         function parseStatement() {
             switch (token()) {
@@ -33264,64 +35185,64 @@ var ts;
                     return parseEmptyStatement();
                 case 18 /* OpenBraceToken */:
                     return parseBlock(/*ignoreMissingOpenBrace*/ false);
-                case 112 /* VarKeyword */:
+                case 113 /* VarKeyword */:
                     return parseVariableStatement(getNodePos(), hasPrecedingJSDocComment(), /*decorators*/ undefined, /*modifiers*/ undefined);
-                case 118 /* LetKeyword */:
+                case 119 /* LetKeyword */:
                     if (isLetDeclaration()) {
                         return parseVariableStatement(getNodePos(), hasPrecedingJSDocComment(), /*decorators*/ undefined, /*modifiers*/ undefined);
                     }
                     break;
-                case 97 /* FunctionKeyword */:
+                case 98 /* FunctionKeyword */:
                     return parseFunctionDeclaration(getNodePos(), hasPrecedingJSDocComment(), /*decorators*/ undefined, /*modifiers*/ undefined);
-                case 83 /* ClassKeyword */:
+                case 84 /* ClassKeyword */:
                     return parseClassDeclaration(getNodePos(), hasPrecedingJSDocComment(), /*decorators*/ undefined, /*modifiers*/ undefined);
-                case 98 /* IfKeyword */:
+                case 99 /* IfKeyword */:
                     return parseIfStatement();
-                case 89 /* DoKeyword */:
+                case 90 /* DoKeyword */:
                     return parseDoStatement();
-                case 114 /* WhileKeyword */:
+                case 115 /* WhileKeyword */:
                     return parseWhileStatement();
-                case 96 /* ForKeyword */:
+                case 97 /* ForKeyword */:
                     return parseForOrForInOrForOfStatement();
-                case 85 /* ContinueKeyword */:
-                    return parseBreakOrContinueStatement(240 /* ContinueStatement */);
-                case 80 /* BreakKeyword */:
-                    return parseBreakOrContinueStatement(241 /* BreakStatement */);
-                case 104 /* ReturnKeyword */:
+                case 86 /* ContinueKeyword */:
+                    return parseBreakOrContinueStatement(244 /* ContinueStatement */);
+                case 81 /* BreakKeyword */:
+                    return parseBreakOrContinueStatement(245 /* BreakStatement */);
+                case 105 /* ReturnKeyword */:
                     return parseReturnStatement();
-                case 115 /* WithKeyword */:
+                case 116 /* WithKeyword */:
                     return parseWithStatement();
-                case 106 /* SwitchKeyword */:
+                case 107 /* SwitchKeyword */:
                     return parseSwitchStatement();
-                case 108 /* ThrowKeyword */:
+                case 109 /* ThrowKeyword */:
                     return parseThrowStatement();
-                case 110 /* TryKeyword */:
+                case 111 /* TryKeyword */:
                 // Include 'catch' and 'finally' for error recovery.
                 // falls through
-                case 82 /* CatchKeyword */:
-                case 95 /* FinallyKeyword */:
+                case 83 /* CatchKeyword */:
+                case 96 /* FinallyKeyword */:
                     return parseTryStatement();
-                case 86 /* DebuggerKeyword */:
+                case 87 /* DebuggerKeyword */:
                     return parseDebuggerStatement();
                 case 59 /* AtToken */:
                     return parseDeclaration();
-                case 129 /* AsyncKeyword */:
-                case 117 /* InterfaceKeyword */:
-                case 149 /* TypeKeyword */:
-                case 139 /* ModuleKeyword */:
-                case 140 /* NamespaceKeyword */:
-                case 133 /* DeclareKeyword */:
-                case 84 /* ConstKeyword */:
-                case 91 /* EnumKeyword */:
-                case 92 /* ExportKeyword */:
-                case 99 /* ImportKeyword */:
-                case 120 /* PrivateKeyword */:
-                case 121 /* ProtectedKeyword */:
-                case 122 /* PublicKeyword */:
-                case 125 /* AbstractKeyword */:
-                case 123 /* StaticKeyword */:
-                case 142 /* ReadonlyKeyword */:
-                case 154 /* GlobalKeyword */:
+                case 131 /* AsyncKeyword */:
+                case 118 /* InterfaceKeyword */:
+                case 151 /* TypeKeyword */:
+                case 141 /* ModuleKeyword */:
+                case 142 /* NamespaceKeyword */:
+                case 135 /* DeclareKeyword */:
+                case 85 /* ConstKeyword */:
+                case 92 /* EnumKeyword */:
+                case 93 /* ExportKeyword */:
+                case 100 /* ImportKeyword */:
+                case 121 /* PrivateKeyword */:
+                case 122 /* ProtectedKeyword */:
+                case 123 /* PublicKeyword */:
+                case 126 /* AbstractKeyword */:
+                case 124 /* StaticKeyword */:
+                case 144 /* ReadonlyKeyword */:
+                case 156 /* GlobalKeyword */:
                     if (isStartOfDeclaration()) {
                         return parseDeclaration();
                     }
@@ -33330,7 +35251,7 @@ var ts;
             return parseExpressionOrLabeledStatement();
         }
         function isDeclareModifier(modifier) {
-            return modifier.kind === 133 /* DeclareKeyword */;
+            return modifier.kind === 135 /* DeclareKeyword */;
         }
         function parseDeclaration() {
             // TODO: Can we hold onto the parsed decorators/modifiers and advance the scanner
@@ -33371,33 +35292,33 @@ var ts;
         }
         function parseDeclarationWorker(pos, hasJSDoc, decorators, modifiers) {
             switch (token()) {
-                case 112 /* VarKeyword */:
-                case 118 /* LetKeyword */:
-                case 84 /* ConstKeyword */:
+                case 113 /* VarKeyword */:
+                case 119 /* LetKeyword */:
+                case 85 /* ConstKeyword */:
                     return parseVariableStatement(pos, hasJSDoc, decorators, modifiers);
-                case 97 /* FunctionKeyword */:
+                case 98 /* FunctionKeyword */:
                     return parseFunctionDeclaration(pos, hasJSDoc, decorators, modifiers);
-                case 83 /* ClassKeyword */:
+                case 84 /* ClassKeyword */:
                     return parseClassDeclaration(pos, hasJSDoc, decorators, modifiers);
-                case 117 /* InterfaceKeyword */:
+                case 118 /* InterfaceKeyword */:
                     return parseInterfaceDeclaration(pos, hasJSDoc, decorators, modifiers);
-                case 149 /* TypeKeyword */:
+                case 151 /* TypeKeyword */:
                     return parseTypeAliasDeclaration(pos, hasJSDoc, decorators, modifiers);
-                case 91 /* EnumKeyword */:
+                case 92 /* EnumKeyword */:
                     return parseEnumDeclaration(pos, hasJSDoc, decorators, modifiers);
-                case 154 /* GlobalKeyword */:
-                case 139 /* ModuleKeyword */:
-                case 140 /* NamespaceKeyword */:
+                case 156 /* GlobalKeyword */:
+                case 141 /* ModuleKeyword */:
+                case 142 /* NamespaceKeyword */:
                     return parseModuleDeclaration(pos, hasJSDoc, decorators, modifiers);
-                case 99 /* ImportKeyword */:
+                case 100 /* ImportKeyword */:
                     return parseImportDeclarationOrImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers);
-                case 92 /* ExportKeyword */:
+                case 93 /* ExportKeyword */:
                     nextToken();
                     switch (token()) {
-                        case 87 /* DefaultKeyword */:
-                        case 62 /* EqualsToken */:
+                        case 88 /* DefaultKeyword */:
+                        case 63 /* EqualsToken */:
                             return parseExportAssignment(pos, hasJSDoc, decorators, modifiers);
-                        case 126 /* AsKeyword */:
+                        case 127 /* AsKeyword */:
                             return parseNamespaceExportDeclaration(pos, hasJSDoc, decorators, modifiers);
                         default:
                             return parseExportDeclaration(pos, hasJSDoc, decorators, modifiers);
@@ -33406,7 +35327,7 @@ var ts;
                     if (decorators || modifiers) {
                         // We reached this point because we encountered decorators and/or modifiers and assumed a declaration
                         // would follow. For recovery and error reporting purposes, return an incomplete declaration.
-                        var missing = createMissingNode(271 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected);
+                        var missing = createMissingNode(275 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected);
                         ts.setTextRangePos(missing, pos);
                         missing.decorators = decorators;
                         missing.modifiers = modifiers;
@@ -33471,7 +35392,7 @@ var ts;
         function isBindingIdentifierOrPrivateIdentifierOrPattern() {
             return token() === 18 /* OpenBraceToken */
                 || token() === 22 /* OpenBracketToken */
-                || token() === 79 /* PrivateIdentifier */
+                || token() === 80 /* PrivateIdentifier */
                 || isBindingIdentifier();
         }
         function parseIdentifierOrPattern(privateIdentifierDiagnosticMessage) {
@@ -33488,27 +35409,28 @@ var ts;
         }
         function parseVariableDeclaration(allowExclamation) {
             var pos = getNodePos();
+            var hasJSDoc = hasPrecedingJSDocComment();
             var name = parseIdentifierOrPattern(ts.Diagnostics.Private_identifiers_are_not_allowed_in_variable_declarations);
             var exclamationToken;
-            if (allowExclamation && name.kind === 78 /* Identifier */ &&
+            if (allowExclamation && name.kind === 79 /* Identifier */ &&
                 token() === 53 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) {
                 exclamationToken = parseTokenNode();
             }
             var type = parseTypeAnnotation();
             var initializer = isInOrOfKeyword(token()) ? undefined : parseInitializer();
             var node = factory.createVariableDeclaration(name, exclamationToken, type, initializer);
-            return finishNode(node, pos);
+            return withJSDoc(finishNode(node, pos), hasJSDoc);
         }
         function parseVariableDeclarationList(inForStatementInitializer) {
             var pos = getNodePos();
             var flags = 0;
             switch (token()) {
-                case 112 /* VarKeyword */:
+                case 113 /* VarKeyword */:
                     break;
-                case 118 /* LetKeyword */:
+                case 119 /* LetKeyword */:
                     flags |= 1 /* Let */;
                     break;
-                case 84 /* ConstKeyword */:
+                case 85 /* ConstKeyword */:
                     flags |= 2 /* Const */;
                     break;
                 default:
@@ -33525,7 +35447,7 @@ var ts;
             // this context.
             // The checker will then give an error that there is an empty declaration list.
             var declarations;
-            if (token() === 156 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) {
+            if (token() === 159 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) {
                 declarations = createMissingList();
             }
             else {
@@ -33550,7 +35472,7 @@ var ts;
         function parseFunctionDeclaration(pos, hasJSDoc, decorators, modifiers) {
             var savedAwaitContext = inAwaitContext();
             var modifierFlags = ts.modifiersToFlags(modifiers);
-            parseExpected(97 /* FunctionKeyword */);
+            parseExpected(98 /* FunctionKeyword */);
             var asteriskToken = parseOptionalToken(41 /* AsteriskToken */);
             // We don't parse the name here in await context, instead we will report a grammar error in the checker.
             var name = modifierFlags & 512 /* Default */ ? parseOptionalBindingIdentifier() : parseBindingIdentifier();
@@ -33567,8 +35489,8 @@ var ts;
             return withJSDoc(finishNode(node, pos), hasJSDoc);
         }
         function parseConstructorName() {
-            if (token() === 132 /* ConstructorKeyword */) {
-                return parseExpected(132 /* ConstructorKeyword */);
+            if (token() === 134 /* ConstructorKeyword */) {
+                return parseExpected(134 /* ConstructorKeyword */);
             }
             if (token() === 10 /* StringLiteral */ && lookAhead(nextToken) === 20 /* OpenParenToken */) {
                 return tryParse(function () {
@@ -33608,7 +35530,7 @@ var ts;
             var exclamationToken = !questionToken && !scanner.hasPrecedingLineBreak() ? parseOptionalToken(53 /* ExclamationToken */) : undefined;
             var type = parseTypeAnnotation();
             var initializer = doOutsideOfContext(8192 /* YieldContext */ | 32768 /* AwaitContext */ | 4096 /* DisallowInContext */, parseInitializer);
-            parseSemicolon();
+            parseSemicolonAfterPropertyName(name, type, initializer);
             var node = factory.createPropertyDeclaration(decorators, modifiers, name, questionToken || exclamationToken, type, initializer);
             return withJSDoc(finishNode(node, pos), hasJSDoc);
         }
@@ -33629,12 +35551,12 @@ var ts;
             var parameters = parseParameters(0 /* None */);
             var type = parseReturnType(58 /* ColonToken */, /*isType*/ false);
             var body = parseFunctionBlockOrSemicolon(0 /* None */);
-            var node = kind === 167 /* GetAccessor */
+            var node = kind === 171 /* GetAccessor */
                 ? factory.createGetAccessorDeclaration(decorators, modifiers, name, parameters, type, body)
                 : factory.createSetAccessorDeclaration(decorators, modifiers, name, parameters, body);
             // Keep track of `typeParameters` (for both) and `type` (for setters) if they were parsed those indicate grammar errors
             node.typeParameters = typeParameters;
-            if (type && node.kind === 168 /* SetAccessor */)
+            if (type && node.kind === 172 /* SetAccessor */)
                 node.type = type;
             return withJSDoc(finishNode(node, pos), hasJSDoc);
         }
@@ -33673,7 +35595,7 @@ var ts;
             // If we were able to get any potential identifier...
             if (idToken !== undefined) {
                 // If we have a non-keyword identifier, or if we have an accessor, then it's safe to parse.
-                if (!ts.isKeyword(idToken) || idToken === 146 /* SetKeyword */ || idToken === 134 /* GetKeyword */) {
+                if (!ts.isKeyword(idToken) || idToken === 148 /* SetKeyword */ || idToken === 136 /* GetKeyword */) {
                     return true;
                 }
                 // If it *is* a keyword, but not an accessor, check a little farther along
@@ -33683,7 +35605,7 @@ var ts;
                     case 29 /* LessThanToken */: // Generic Method declaration
                     case 53 /* ExclamationToken */: // Non-null assertion on property name
                     case 58 /* ColonToken */: // Type Annotation for declaration
-                    case 62 /* EqualsToken */: // Initializer for declaration
+                    case 63 /* EqualsToken */: // Initializer for declaration
                     case 57 /* QuestionToken */: // Not valid, but permitted so that it gets caught later on.
                         return true;
                     default:
@@ -33697,8 +35619,23 @@ var ts;
             }
             return false;
         }
+        function parseClassStaticBlockDeclaration(pos, hasJSDoc, decorators, modifiers) {
+            parseExpectedToken(124 /* StaticKeyword */);
+            var body = parseClassStaticBlockBody();
+            return withJSDoc(finishNode(factory.createClassStaticBlockDeclaration(decorators, modifiers, body), pos), hasJSDoc);
+        }
+        function parseClassStaticBlockBody() {
+            var savedYieldContext = inYieldContext();
+            var savedAwaitContext = inAwaitContext();
+            setYieldContext(false);
+            setAwaitContext(true);
+            var body = parseBlock(/*ignoreMissingOpenBrace*/ false);
+            setYieldContext(savedYieldContext);
+            setAwaitContext(savedAwaitContext);
+            return body;
+        }
         function parseDecoratorExpression() {
-            if (inAwaitContext() && token() === 130 /* AwaitKeyword */) {
+            if (inAwaitContext() && token() === 132 /* AwaitKeyword */) {
                 // `@await` is is disallowed in an [Await] context, but can cause parsing to go off the rails
                 // This simply parses the missing identifier and moves on.
                 var pos = getNodePos();
@@ -33725,16 +35662,22 @@ var ts;
             }
             return list && createNodeArray(list, pos);
         }
-        function tryParseModifier(permitInvalidConstAsModifier) {
+        function tryParseModifier(permitInvalidConstAsModifier, stopOnStartOfClassStaticBlock, hasSeenStaticModifier) {
             var pos = getNodePos();
             var kind = token();
-            if (token() === 84 /* ConstKeyword */ && permitInvalidConstAsModifier) {
+            if (token() === 85 /* ConstKeyword */ && permitInvalidConstAsModifier) {
                 // We need to ensure that any subsequent modifiers appear on the same line
                 // so that when 'const' is a standalone declaration, we don't issue an error.
                 if (!tryParse(nextTokenIsOnSameLineAndCanFollowModifier)) {
                     return undefined;
                 }
             }
+            else if (stopOnStartOfClassStaticBlock && token() === 124 /* StaticKeyword */ && lookAhead(nextTokenIsOpenBrace)) {
+                return undefined;
+            }
+            else if (hasSeenStaticModifier && token() === 124 /* StaticKeyword */) {
+                return undefined;
+            }
             else {
                 if (!parseAnyContextualModifier()) {
                     return undefined;
@@ -33749,20 +35692,22 @@ var ts;
          *
          * In such situations, 'permitInvalidConstAsModifier' should be set to true.
          */
-        function parseModifiers(permitInvalidConstAsModifier) {
+        function parseModifiers(permitInvalidConstAsModifier, stopOnStartOfClassStaticBlock) {
             var pos = getNodePos();
-            var list, modifier;
-            while (modifier = tryParseModifier(permitInvalidConstAsModifier)) {
+            var list, modifier, hasSeenStatic = false;
+            while (modifier = tryParseModifier(permitInvalidConstAsModifier, stopOnStartOfClassStaticBlock, hasSeenStatic)) {
+                if (modifier.kind === 124 /* StaticKeyword */)
+                    hasSeenStatic = true;
                 list = ts.append(list, modifier);
             }
             return list && createNodeArray(list, pos);
         }
         function parseModifiersForArrowFunction() {
             var modifiers;
-            if (token() === 129 /* AsyncKeyword */) {
+            if (token() === 131 /* AsyncKeyword */) {
                 var pos = getNodePos();
                 nextToken();
-                var modifier = finishNode(factory.createToken(129 /* AsyncKeyword */), pos);
+                var modifier = finishNode(factory.createToken(131 /* AsyncKeyword */), pos);
                 modifiers = createNodeArray([modifier], pos);
             }
             return modifiers;
@@ -33775,14 +35720,17 @@ var ts;
             }
             var hasJSDoc = hasPrecedingJSDocComment();
             var decorators = parseDecorators();
-            var modifiers = parseModifiers(/*permitInvalidConstAsModifier*/ true);
-            if (parseContextualModifier(134 /* GetKeyword */)) {
-                return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 167 /* GetAccessor */);
+            var modifiers = parseModifiers(/*permitInvalidConstAsModifier*/ true, /*stopOnStartOfClassStaticBlock*/ true);
+            if (token() === 124 /* StaticKeyword */ && lookAhead(nextTokenIsOpenBrace)) {
+                return parseClassStaticBlockDeclaration(pos, hasJSDoc, decorators, modifiers);
+            }
+            if (parseContextualModifier(136 /* GetKeyword */)) {
+                return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 171 /* GetAccessor */);
             }
-            if (parseContextualModifier(146 /* SetKeyword */)) {
-                return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 168 /* SetAccessor */);
+            if (parseContextualModifier(148 /* SetKeyword */)) {
+                return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 172 /* SetAccessor */);
             }
-            if (token() === 132 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) {
+            if (token() === 134 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) {
                 var constructorDeclaration = tryParseConstructorDeclaration(pos, hasJSDoc, decorators, modifiers);
                 if (constructorDeclaration) {
                     return constructorDeclaration;
@@ -33812,21 +35760,21 @@ var ts;
             }
             if (decorators || modifiers) {
                 // treat this as a property declaration with a missing name.
-                var name = createMissingNode(78 /* Identifier */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected);
+                var name = createMissingNode(79 /* Identifier */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected);
                 return parsePropertyDeclaration(pos, hasJSDoc, decorators, modifiers, name, /*questionToken*/ undefined);
             }
             // 'isClassMemberStart' should have hinted not to attempt parsing.
             return ts.Debug.fail("Should not have attempted to parse class member declaration.");
         }
         function parseClassExpression() {
-            return parseClassDeclarationOrExpression(getNodePos(), hasPrecedingJSDocComment(), /*decorators*/ undefined, /*modifiers*/ undefined, 221 /* ClassExpression */);
+            return parseClassDeclarationOrExpression(getNodePos(), hasPrecedingJSDocComment(), /*decorators*/ undefined, /*modifiers*/ undefined, 225 /* ClassExpression */);
         }
         function parseClassDeclaration(pos, hasJSDoc, decorators, modifiers) {
-            return parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, 252 /* ClassDeclaration */);
+            return parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, 256 /* ClassDeclaration */);
         }
         function parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, kind) {
             var savedAwaitContext = inAwaitContext();
-            parseExpected(83 /* ClassKeyword */);
+            parseExpected(84 /* ClassKeyword */);
             // We don't parse the name here in await context, instead we will report a grammar error in the checker.
             var name = parseNameOfClassDeclarationOrExpression();
             var typeParameters = parseTypeParameters();
@@ -33844,7 +35792,7 @@ var ts;
                 members = createMissingList();
             }
             setAwaitContext(savedAwaitContext);
-            var node = kind === 252 /* ClassDeclaration */
+            var node = kind === 256 /* ClassDeclaration */
                 ? factory.createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members)
                 : factory.createClassExpression(decorators, modifiers, name, typeParameters, heritageClauses, members);
             return withJSDoc(finishNode(node, pos), hasJSDoc);
@@ -33860,7 +35808,7 @@ var ts;
                 : undefined;
         }
         function isImplementsClause() {
-            return token() === 116 /* ImplementsKeyword */ && lookAhead(nextTokenIsIdentifierOrKeyword);
+            return token() === 117 /* ImplementsKeyword */ && lookAhead(nextTokenIsIdentifierOrKeyword);
         }
         function parseHeritageClauses() {
             // ClassTail[Yield,Await] : (Modified) See 14.5
@@ -33873,7 +35821,7 @@ var ts;
         function parseHeritageClause() {
             var pos = getNodePos();
             var tok = token();
-            ts.Debug.assert(tok === 93 /* ExtendsKeyword */ || tok === 116 /* ImplementsKeyword */); // isListElement() should ensure this.
+            ts.Debug.assert(tok === 94 /* ExtendsKeyword */ || tok === 117 /* ImplementsKeyword */); // isListElement() should ensure this.
             nextToken();
             var types = parseDelimitedList(7 /* HeritageClauseElement */, parseExpressionWithTypeArguments);
             return finishNode(factory.createHeritageClause(tok, types), pos);
@@ -33889,13 +35837,13 @@ var ts;
                 parseBracketedList(20 /* TypeArguments */, parseType, 29 /* LessThanToken */, 31 /* GreaterThanToken */) : undefined;
         }
         function isHeritageClause() {
-            return token() === 93 /* ExtendsKeyword */ || token() === 116 /* ImplementsKeyword */;
+            return token() === 94 /* ExtendsKeyword */ || token() === 117 /* ImplementsKeyword */;
         }
         function parseClassMembers() {
             return parseList(5 /* ClassMembers */, parseClassElement);
         }
         function parseInterfaceDeclaration(pos, hasJSDoc, decorators, modifiers) {
-            parseExpected(117 /* InterfaceKeyword */);
+            parseExpected(118 /* InterfaceKeyword */);
             var name = parseIdentifier();
             var typeParameters = parseTypeParameters();
             var heritageClauses = parseHeritageClauses();
@@ -33904,11 +35852,11 @@ var ts;
             return withJSDoc(finishNode(node, pos), hasJSDoc);
         }
         function parseTypeAliasDeclaration(pos, hasJSDoc, decorators, modifiers) {
-            parseExpected(149 /* TypeKeyword */);
+            parseExpected(151 /* TypeKeyword */);
             var name = parseIdentifier();
             var typeParameters = parseTypeParameters();
-            parseExpected(62 /* EqualsToken */);
-            var type = token() === 136 /* IntrinsicKeyword */ && tryParse(parseKeywordAndNoDot) || parseType();
+            parseExpected(63 /* EqualsToken */);
+            var type = token() === 138 /* IntrinsicKeyword */ && tryParse(parseKeywordAndNoDot) || parseType();
             parseSemicolon();
             var node = factory.createTypeAliasDeclaration(decorators, modifiers, name, typeParameters, type);
             return withJSDoc(finishNode(node, pos), hasJSDoc);
@@ -33925,7 +35873,7 @@ var ts;
             return withJSDoc(finishNode(factory.createEnumMember(name, initializer), pos), hasJSDoc);
         }
         function parseEnumDeclaration(pos, hasJSDoc, decorators, modifiers) {
-            parseExpected(91 /* EnumKeyword */);
+            parseExpected(92 /* EnumKeyword */);
             var name = parseIdentifier();
             var members;
             if (parseExpected(18 /* OpenBraceToken */)) {
@@ -33964,7 +35912,7 @@ var ts;
         function parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers) {
             var flags = 0;
             var name;
-            if (token() === 154 /* GlobalKeyword */) {
+            if (token() === 156 /* GlobalKeyword */) {
                 // parse 'global' as name of global scope augmentation
                 name = parseIdentifier();
                 flags |= 1024 /* GlobalAugmentation */;
@@ -33985,15 +35933,15 @@ var ts;
         }
         function parseModuleDeclaration(pos, hasJSDoc, decorators, modifiers) {
             var flags = 0;
-            if (token() === 154 /* GlobalKeyword */) {
+            if (token() === 156 /* GlobalKeyword */) {
                 // global augmentation
                 return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers);
             }
-            else if (parseOptional(140 /* NamespaceKeyword */)) {
+            else if (parseOptional(142 /* NamespaceKeyword */)) {
                 flags |= 16 /* Namespace */;
             }
             else {
-                parseExpected(139 /* ModuleKeyword */);
+                parseExpected(141 /* ModuleKeyword */);
                 if (token() === 10 /* StringLiteral */) {
                     return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers);
                 }
@@ -34001,18 +35949,21 @@ var ts;
             return parseModuleOrNamespaceDeclaration(pos, hasJSDoc, decorators, modifiers, flags);
         }
         function isExternalModuleReference() {
-            return token() === 143 /* RequireKeyword */ &&
+            return token() === 145 /* RequireKeyword */ &&
                 lookAhead(nextTokenIsOpenParen);
         }
         function nextTokenIsOpenParen() {
             return nextToken() === 20 /* OpenParenToken */;
         }
+        function nextTokenIsOpenBrace() {
+            return nextToken() === 18 /* OpenBraceToken */;
+        }
         function nextTokenIsSlash() {
             return nextToken() === 43 /* SlashToken */;
         }
         function parseNamespaceExportDeclaration(pos, hasJSDoc, decorators, modifiers) {
-            parseExpected(126 /* AsKeyword */);
-            parseExpected(140 /* NamespaceKeyword */);
+            parseExpected(127 /* AsKeyword */);
+            parseExpected(142 /* NamespaceKeyword */);
             var name = parseIdentifier();
             parseSemicolon();
             var node = factory.createNamespaceExportDeclaration(name);
@@ -34022,7 +35973,7 @@ var ts;
             return withJSDoc(finishNode(node, pos), hasJSDoc);
         }
         function parseImportDeclarationOrImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers) {
-            parseExpected(99 /* ImportKeyword */);
+            parseExpected(100 /* ImportKeyword */);
             var afterImportPos = scanner.getStartPos();
             // We don't parse the identifier here in await context, instead we will report a grammar error in the checker.
             var identifier;
@@ -34030,7 +35981,7 @@ var ts;
                 identifier = parseIdentifier();
             }
             var isTypeOnly = false;
-            if (token() !== 153 /* FromKeyword */ &&
+            if (token() !== 155 /* FromKeyword */ &&
                 (identifier === null || identifier === void 0 ? void 0 : identifier.escapedText) === "type" &&
                 (isIdentifier() || tokenAfterImportDefinitelyProducesImportDeclaration())) {
                 isTypeOnly = true;
@@ -34048,23 +35999,54 @@ var ts;
                 token() === 18 /* OpenBraceToken */ // import {
             ) {
                 importClause = parseImportClause(identifier, afterImportPos, isTypeOnly);
-                parseExpected(153 /* FromKeyword */);
+                parseExpected(155 /* FromKeyword */);
             }
             var moduleSpecifier = parseModuleSpecifier();
+            var assertClause;
+            if (token() === 129 /* AssertKeyword */ && !scanner.hasPrecedingLineBreak()) {
+                assertClause = parseAssertClause();
+            }
             parseSemicolon();
-            var node = factory.createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier);
+            var node = factory.createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier, assertClause);
             return withJSDoc(finishNode(node, pos), hasJSDoc);
         }
+        function parseAssertEntry() {
+            var pos = getNodePos();
+            var name = ts.tokenIsIdentifierOrKeyword(token()) ? parseIdentifierName() : parseLiteralLikeNode(10 /* StringLiteral */);
+            parseExpected(58 /* ColonToken */);
+            var value = parseLiteralLikeNode(10 /* StringLiteral */);
+            return finishNode(factory.createAssertEntry(name, value), pos);
+        }
+        function parseAssertClause() {
+            var pos = getNodePos();
+            parseExpected(129 /* AssertKeyword */);
+            var openBracePosition = scanner.getTokenPos();
+            if (parseExpected(18 /* OpenBraceToken */)) {
+                var multiLine = scanner.hasPrecedingLineBreak();
+                var elements = parseDelimitedList(24 /* AssertEntries */, parseAssertEntry, /*considerSemicolonAsDelimiter*/ true);
+                if (!parseExpected(19 /* CloseBraceToken */)) {
+                    var lastError = ts.lastOrUndefined(parseDiagnostics);
+                    if (lastError && lastError.code === ts.Diagnostics._0_expected.code) {
+                        ts.addRelatedInfo(lastError, ts.createDetachedDiagnostic(fileName, openBracePosition, 1, ts.Diagnostics.The_parser_expected_to_find_a_to_match_the_token_here));
+                    }
+                }
+                return finishNode(factory.createAssertClause(elements, multiLine), pos);
+            }
+            else {
+                var elements = createNodeArray([], getNodePos(), /*end*/ undefined, /*hasTrailingComma*/ false);
+                return finishNode(factory.createAssertClause(elements, /*multiLine*/ false), pos);
+            }
+        }
         function tokenAfterImportDefinitelyProducesImportDeclaration() {
             return token() === 41 /* AsteriskToken */ || token() === 18 /* OpenBraceToken */;
         }
         function tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration() {
             // In `import id ___`, the current token decides whether to produce
             // an ImportDeclaration or ImportEqualsDeclaration.
-            return token() === 27 /* CommaToken */ || token() === 153 /* FromKeyword */;
+            return token() === 27 /* CommaToken */ || token() === 155 /* FromKeyword */;
         }
         function parseImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers, identifier, isTypeOnly) {
-            parseExpected(62 /* EqualsToken */);
+            parseExpected(63 /* EqualsToken */);
             var moduleReference = parseModuleReference();
             parseSemicolon();
             var node = factory.createImportEqualsDeclaration(decorators, modifiers, isTypeOnly, identifier, moduleReference);
@@ -34083,7 +36065,7 @@ var ts;
             var namedBindings;
             if (!identifier ||
                 parseOptional(27 /* CommaToken */)) {
-                namedBindings = token() === 41 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(264 /* NamedImports */);
+                namedBindings = token() === 41 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(268 /* NamedImports */);
             }
             return finishNode(factory.createImportClause(isTypeOnly, identifier, namedBindings), pos);
         }
@@ -34094,7 +36076,7 @@ var ts;
         }
         function parseExternalModuleReference() {
             var pos = getNodePos();
-            parseExpected(143 /* RequireKeyword */);
+            parseExpected(145 /* RequireKeyword */);
             parseExpected(20 /* OpenParenToken */);
             var expression = parseModuleSpecifier();
             parseExpected(21 /* CloseParenToken */);
@@ -34118,7 +36100,7 @@ var ts;
             //  * as ImportedBinding
             var pos = getNodePos();
             parseExpected(41 /* AsteriskToken */);
-            parseExpected(126 /* AsKeyword */);
+            parseExpected(127 /* AsKeyword */);
             var name = parseIdentifier();
             return finishNode(factory.createNamespaceImport(name), pos);
         }
@@ -34131,16 +36113,16 @@ var ts;
             // ImportsList:
             //  ImportSpecifier
             //  ImportsList, ImportSpecifier
-            var node = kind === 264 /* NamedImports */
+            var node = kind === 268 /* NamedImports */
                 ? factory.createNamedImports(parseBracketedList(23 /* ImportOrExportSpecifiers */, parseImportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */))
                 : factory.createNamedExports(parseBracketedList(23 /* ImportOrExportSpecifiers */, parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */));
             return finishNode(node, pos);
         }
         function parseExportSpecifier() {
-            return parseImportOrExportSpecifier(270 /* ExportSpecifier */);
+            return parseImportOrExportSpecifier(274 /* ExportSpecifier */);
         }
         function parseImportSpecifier() {
-            return parseImportOrExportSpecifier(265 /* ImportSpecifier */);
+            return parseImportOrExportSpecifier(269 /* ImportSpecifier */);
         }
         function parseImportOrExportSpecifier(kind) {
             var pos = getNodePos();
@@ -34153,27 +36135,74 @@ var ts;
             var checkIdentifierIsKeyword = ts.isKeyword(token()) && !isIdentifier();
             var checkIdentifierStart = scanner.getTokenPos();
             var checkIdentifierEnd = scanner.getTextPos();
-            var identifierName = parseIdentifierName();
+            var isTypeOnly = false;
             var propertyName;
-            var name;
-            if (token() === 126 /* AsKeyword */) {
-                propertyName = identifierName;
-                parseExpected(126 /* AsKeyword */);
-                checkIdentifierIsKeyword = ts.isKeyword(token()) && !isIdentifier();
-                checkIdentifierStart = scanner.getTokenPos();
-                checkIdentifierEnd = scanner.getTextPos();
-                name = parseIdentifierName();
+            var canParseAsKeyword = true;
+            var name = parseIdentifierName();
+            if (name.escapedText === "type") {
+                // If the first token of an import specifier is 'type', there are a lot of possibilities,
+                // especially if we see 'as' afterwards:
+                //
+                // import { type } from "mod";          - isTypeOnly: false,   name: type
+                // import { type as } from "mod";       - isTypeOnly: true,    name: as
+                // import { type as as } from "mod";    - isTypeOnly: false,   name: as,    propertyName: type
+                // import { type as as as } from "mod"; - isTypeOnly: true,    name: as,    propertyName: as
+                if (token() === 127 /* AsKeyword */) {
+                    // { type as ...? }
+                    var firstAs = parseIdentifierName();
+                    if (token() === 127 /* AsKeyword */) {
+                        // { type as as ...? }
+                        var secondAs = parseIdentifierName();
+                        if (ts.tokenIsIdentifierOrKeyword(token())) {
+                            // { type as as something }
+                            isTypeOnly = true;
+                            propertyName = firstAs;
+                            name = parseNameWithKeywordCheck();
+                            canParseAsKeyword = false;
+                        }
+                        else {
+                            // { type as as }
+                            propertyName = name;
+                            name = secondAs;
+                            canParseAsKeyword = false;
+                        }
+                    }
+                    else if (ts.tokenIsIdentifierOrKeyword(token())) {
+                        // { type as something }
+                        propertyName = name;
+                        canParseAsKeyword = false;
+                        name = parseNameWithKeywordCheck();
+                    }
+                    else {
+                        // { type as }
+                        isTypeOnly = true;
+                        name = firstAs;
+                    }
+                }
+                else if (ts.tokenIsIdentifierOrKeyword(token())) {
+                    // { type something ...? }
+                    isTypeOnly = true;
+                    name = parseNameWithKeywordCheck();
+                }
             }
-            else {
-                name = identifierName;
+            if (canParseAsKeyword && token() === 127 /* AsKeyword */) {
+                propertyName = name;
+                parseExpected(127 /* AsKeyword */);
+                name = parseNameWithKeywordCheck();
             }
-            if (kind === 265 /* ImportSpecifier */ && checkIdentifierIsKeyword) {
+            if (kind === 269 /* ImportSpecifier */ && checkIdentifierIsKeyword) {
                 parseErrorAt(checkIdentifierStart, checkIdentifierEnd, ts.Diagnostics.Identifier_expected);
             }
-            var node = kind === 265 /* ImportSpecifier */
-                ? factory.createImportSpecifier(propertyName, name)
-                : factory.createExportSpecifier(propertyName, name);
+            var node = kind === 269 /* ImportSpecifier */
+                ? factory.createImportSpecifier(isTypeOnly, propertyName, name)
+                : factory.createExportSpecifier(isTypeOnly, propertyName, name);
             return finishNode(node, pos);
+            function parseNameWithKeywordCheck() {
+                checkIdentifierIsKeyword = ts.isKeyword(token()) && !isIdentifier();
+                checkIdentifierStart = scanner.getTokenPos();
+                checkIdentifierEnd = scanner.getTextPos();
+                return parseIdentifierName();
+            }
         }
         function parseNamespaceExport(pos) {
             return finishNode(factory.createNamespaceExport(parseIdentifierName()), pos);
@@ -34183,39 +36212,43 @@ var ts;
             setAwaitContext(/*value*/ true);
             var exportClause;
             var moduleSpecifier;
-            var isTypeOnly = parseOptional(149 /* TypeKeyword */);
+            var assertClause;
+            var isTypeOnly = parseOptional(151 /* TypeKeyword */);
             var namespaceExportPos = getNodePos();
             if (parseOptional(41 /* AsteriskToken */)) {
-                if (parseOptional(126 /* AsKeyword */)) {
+                if (parseOptional(127 /* AsKeyword */)) {
                     exportClause = parseNamespaceExport(namespaceExportPos);
                 }
-                parseExpected(153 /* FromKeyword */);
+                parseExpected(155 /* FromKeyword */);
                 moduleSpecifier = parseModuleSpecifier();
             }
             else {
-                exportClause = parseNamedImportsOrExports(268 /* NamedExports */);
+                exportClause = parseNamedImportsOrExports(272 /* NamedExports */);
                 // It is not uncommon to accidentally omit the 'from' keyword. Additionally, in editing scenarios,
                 // the 'from' keyword can be parsed as a named export when the export clause is unterminated (i.e. `export { from "moduleName";`)
                 // If we don't have a 'from' keyword, see if we have a string literal such that ASI won't take effect.
-                if (token() === 153 /* FromKeyword */ || (token() === 10 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) {
-                    parseExpected(153 /* FromKeyword */);
+                if (token() === 155 /* FromKeyword */ || (token() === 10 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) {
+                    parseExpected(155 /* FromKeyword */);
                     moduleSpecifier = parseModuleSpecifier();
                 }
             }
+            if (moduleSpecifier && token() === 129 /* AssertKeyword */ && !scanner.hasPrecedingLineBreak()) {
+                assertClause = parseAssertClause();
+            }
             parseSemicolon();
             setAwaitContext(savedAwaitContext);
-            var node = factory.createExportDeclaration(decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier);
+            var node = factory.createExportDeclaration(decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause);
             return withJSDoc(finishNode(node, pos), hasJSDoc);
         }
         function parseExportAssignment(pos, hasJSDoc, decorators, modifiers) {
             var savedAwaitContext = inAwaitContext();
             setAwaitContext(/*value*/ true);
             var isExportEquals;
-            if (parseOptional(62 /* EqualsToken */)) {
+            if (parseOptional(63 /* EqualsToken */)) {
                 isExportEquals = true;
             }
             else {
-                parseExpected(87 /* DefaultKeyword */);
+                parseExpected(88 /* DefaultKeyword */);
             }
             var expression = parseAssignmentExpressionOrHigher();
             parseSemicolon();
@@ -34231,7 +36264,7 @@ var ts;
                     getImportMetaIfNecessary(sourceFile);
         }
         function isAnExternalModuleIndicatorNode(node) {
-            return hasModifierOfKind(node, 92 /* ExportKeyword */)
+            return hasModifierOfKind(node, 93 /* ExportKeyword */)
                 || ts.isImportEqualsDeclaration(node) && ts.isExternalModuleReference(node.moduleReference)
                 || ts.isImportDeclaration(node)
                 || ts.isExportAssignment(node)
@@ -34250,7 +36283,7 @@ var ts;
             return ts.some(node.modifiers, function (m) { return m.kind === kind; });
         }
         function isImportMeta(node) {
-            return ts.isMetaProperty(node) && node.keywordToken === 99 /* ImportKeyword */ && node.name.escapedText === "meta";
+            return ts.isMetaProperty(node) && node.keywordToken === 100 /* ImportKeyword */ && node.name.escapedText === "meta";
         }
         var ParsingContext;
         (function (ParsingContext) {
@@ -34278,7 +36311,8 @@ var ts;
             ParsingContext[ParsingContext["TupleElementTypes"] = 21] = "TupleElementTypes";
             ParsingContext[ParsingContext["HeritageClauses"] = 22] = "HeritageClauses";
             ParsingContext[ParsingContext["ImportOrExportSpecifiers"] = 23] = "ImportOrExportSpecifiers";
-            ParsingContext[ParsingContext["Count"] = 24] = "Count"; // Number of parsing contexts
+            ParsingContext[ParsingContext["AssertEntries"] = 24] = "AssertEntries";
+            ParsingContext[ParsingContext["Count"] = 25] = "Count"; // Number of parsing contexts
         })(ParsingContext || (ParsingContext = {}));
         var Tristate;
         (function (Tristate) {
@@ -34318,7 +36352,13 @@ var ts;
             function parseJSDocNameReference() {
                 var pos = getNodePos();
                 var hasBrace = parseOptional(18 /* OpenBraceToken */);
+                var p2 = getNodePos();
                 var entityName = parseEntityName(/* allowReservedWords*/ false);
+                while (token() === 80 /* PrivateIdentifier */) {
+                    reScanHashToken(); // rescan #id as # id
+                    nextTokenJSDoc(); // then skip the #
+                    entityName = finishNode(factory.createJSDocMemberName(entityName, parseIdentifier()), p2);
+                }
                 if (hasBrace) {
                     parseExpectedJSDoc(19 /* CloseBraceToken */);
                 }
@@ -34382,7 +36422,10 @@ var ts;
                 var tags;
                 var tagsPos;
                 var tagsEnd;
+                var linkEnd;
+                var commentsPos;
                 var comments = [];
+                var parts = [];
                 // + 3 for leading /**, - 5 in total for /** */
                 return scanner.scanRange(start + 3, length - 5, function () {
                     // Initially we can parse out a tag.  We also have seen a starting asterisk.
@@ -34411,6 +36454,8 @@ var ts;
                             case 59 /* AtToken */:
                                 if (state === 0 /* BeginningOfLine */ || state === 1 /* SawAsterisk */) {
                                     removeTrailingWhitespace(comments);
+                                    if (!commentsPos)
+                                        commentsPos = getNodePos();
                                     addTag(parseTag(indent));
                                     // NOTE: According to usejsdoc.org, a tag goes to end of line, except the last tag.
                                     // Real-world comments may break this rule, so "BeginningOfLine" will not be a real line beginning
@@ -34453,6 +36498,22 @@ var ts;
                                 break;
                             case 1 /* EndOfFileToken */:
                                 break loop;
+                            case 18 /* OpenBraceToken */:
+                                state = 2 /* SavingComments */;
+                                var commentEnd = scanner.getStartPos();
+                                var linkStart = scanner.getTextPos() - 1;
+                                var link = parseJSDocLink(linkStart);
+                                if (link) {
+                                    if (!linkEnd) {
+                                        removeLeadingNewlines(comments);
+                                    }
+                                    parts.push(finishNode(factory.createJSDocText(comments.join("")), linkEnd !== null && linkEnd !== void 0 ? linkEnd : start, commentEnd));
+                                    parts.push(link);
+                                    comments = [];
+                                    linkEnd = scanner.getTextPos();
+                                    break;
+                                }
+                            // fallthrough if it's not a {@link sequence
                             default:
                                 // Anything else is doc comment text. We just save it. Because it
                                 // wasn't a tag, we can no longer parse a tag on this line until we hit the next
@@ -34463,9 +36524,14 @@ var ts;
                         }
                         nextTokenJSDoc();
                     }
-                    removeLeadingNewlines(comments);
                     removeTrailingWhitespace(comments);
-                    return createJSDocComment();
+                    if (parts.length && comments.length) {
+                        parts.push(finishNode(factory.createJSDocText(comments.join("")), linkEnd !== null && linkEnd !== void 0 ? linkEnd : start, commentsPos));
+                    }
+                    if (parts.length && tags)
+                        ts.Debug.assertIsDefined(commentsPos, "having parsed tags implies that the end of the comment span should be set");
+                    var tagsArray = tags && createNodeArray(tags, tagsPos, tagsEnd);
+                    return finishNode(factory.createJSDocComment(parts.length ? createNodeArray(parts, start, commentsPos) : comments.length ? comments.join("") : undefined, tagsArray), start, end);
                 });
                 function removeLeadingNewlines(comments) {
                     while (comments.length && (comments[0] === "\n" || comments[0] === "\r")) {
@@ -34477,11 +36543,6 @@ var ts;
                         comments.pop();
                     }
                 }
-                function createJSDocComment() {
-                    var comment = comments.length ? comments.join("") : undefined;
-                    var tagsArray = tags && createNodeArray(tags, tagsPos, tagsEnd);
-                    return finishNode(factory.createJSDocComment(comment, tagsArray), start, end);
-                }
                 function isNextNonwhitespaceTokenEndOfFile() {
                     // We must use infinite lookahead, as there could be any number of newlines :(
                     while (true) {
@@ -34561,6 +36622,9 @@ var ts;
                         case "readonly":
                             tag = parseSimpleTag(start, factory.createJSDocReadonlyTag, tagName, margin, indentText);
                             break;
+                        case "override":
+                            tag = parseSimpleTag(start, factory.createJSDocOverrideTag, tagName, margin, indentText);
+                            break;
                         case "deprecated":
                             hasDeprecatedTag = true;
                             tag = parseSimpleTag(start, factory.createJSDocDeprecatedTag, tagName, margin, indentText);
@@ -34608,7 +36672,10 @@ var ts;
                     return parseTagComments(margin, indentText.slice(margin));
                 }
                 function parseTagComments(indent, initialMargin) {
+                    var commentsPos = getNodePos();
                     var comments = [];
+                    var parts = [];
+                    var linkEnd;
                     var state = 0 /* BeginningOfLine */;
                     var previousWhitespace = true;
                     var margin;
@@ -34636,8 +36703,9 @@ var ts;
                                 indent = 0;
                                 break;
                             case 59 /* AtToken */:
-                                if (state === 3 /* SavingBackticks */ || !previousWhitespace && state === 2 /* SavingComments */) {
-                                    // @ doesn't start a new tag inside ``, and inside a comment, only after whitespace
+                                if (state === 3 /* SavingBackticks */
+                                    || state === 2 /* SavingComments */ && (!previousWhitespace || lookAhead(isNextJSDocTokenWhitespace))) {
+                                    // @ doesn't start a new tag inside ``, and inside a comment, only after whitespace or not before whitespace
                                     comments.push(scanner.getTokenText());
                                     break;
                                 }
@@ -34661,13 +36729,18 @@ var ts;
                                 break;
                             case 18 /* OpenBraceToken */:
                                 state = 2 /* SavingComments */;
-                                if (lookAhead(function () { return nextTokenJSDoc() === 59 /* AtToken */ && ts.tokenIsIdentifierOrKeyword(nextTokenJSDoc()) && scanner.getTokenText() === "link"; })) {
-                                    pushComment(scanner.getTokenText());
-                                    nextTokenJSDoc();
+                                var commentEnd = scanner.getStartPos();
+                                var linkStart = scanner.getTextPos() - 1;
+                                var link = parseJSDocLink(linkStart);
+                                if (link) {
+                                    parts.push(finishNode(factory.createJSDocText(comments.join("")), linkEnd !== null && linkEnd !== void 0 ? linkEnd : commentsPos, commentEnd));
+                                    parts.push(link);
+                                    comments = [];
+                                    linkEnd = scanner.getTextPos();
+                                }
+                                else {
                                     pushComment(scanner.getTokenText());
-                                    nextTokenJSDoc();
                                 }
-                                pushComment(scanner.getTokenText());
                                 break;
                             case 61 /* BacktickToken */:
                                 if (state === 3 /* SavingBackticks */) {
@@ -34699,11 +36772,62 @@ var ts;
                     }
                     removeLeadingNewlines(comments);
                     removeTrailingWhitespace(comments);
-                    return comments.length === 0 ? undefined : comments.join("");
+                    if (parts.length) {
+                        if (comments.length) {
+                            parts.push(finishNode(factory.createJSDocText(comments.join("")), linkEnd !== null && linkEnd !== void 0 ? linkEnd : commentsPos));
+                        }
+                        return createNodeArray(parts, commentsPos, scanner.getTextPos());
+                    }
+                    else if (comments.length) {
+                        return comments.join("");
+                    }
+                }
+                function isNextJSDocTokenWhitespace() {
+                    var next = nextTokenJSDoc();
+                    return next === 5 /* WhitespaceTrivia */ || next === 4 /* NewLineTrivia */;
+                }
+                function parseJSDocLink(start) {
+                    var linkType = tryParse(parseJSDocLinkPrefix);
+                    if (!linkType) {
+                        return undefined;
+                    }
+                    nextTokenJSDoc(); // start at token after link, then skip any whitespace
+                    skipWhitespace();
+                    // parseEntityName logs an error for non-identifier, so create a MissingNode ourselves to avoid the error
+                    var p2 = getNodePos();
+                    var name = ts.tokenIsIdentifierOrKeyword(token())
+                        ? parseEntityName(/*allowReservedWords*/ true)
+                        : undefined;
+                    if (name) {
+                        while (token() === 80 /* PrivateIdentifier */) {
+                            reScanHashToken(); // rescan #id as # id
+                            nextTokenJSDoc(); // then skip the #
+                            name = finishNode(factory.createJSDocMemberName(name, parseIdentifier()), p2);
+                        }
+                    }
+                    var text = [];
+                    while (token() !== 19 /* CloseBraceToken */ && token() !== 4 /* NewLineTrivia */ && token() !== 1 /* EndOfFileToken */) {
+                        text.push(scanner.getTokenText());
+                        nextTokenJSDoc();
+                    }
+                    var create = linkType === "link" ? factory.createJSDocLink
+                        : linkType === "linkcode" ? factory.createJSDocLinkCode
+                            : factory.createJSDocLinkPlain;
+                    return finishNode(create(name, text.join("")), start, scanner.getTextPos());
+                }
+                function parseJSDocLinkPrefix() {
+                    skipWhitespaceOrAsterisk();
+                    if (token() === 18 /* OpenBraceToken */
+                        && nextTokenJSDoc() === 59 /* AtToken */
+                        && ts.tokenIsIdentifierOrKeyword(nextTokenJSDoc())) {
+                        var kind = scanner.getTokenValue();
+                        if (kind === "link" || kind === "linkcode" || kind === "linkplain") {
+                            return kind;
+                        }
+                    }
                 }
                 function parseUnknownTag(start, tagName, indent, indentText) {
-                    var end = getNodePos();
-                    return finishNode(factory.createJSDocUnknownTag(tagName, parseTrailingTagComments(start, end, indent, indentText)), start, end);
+                    return finishNode(factory.createJSDocUnknownTag(tagName, parseTrailingTagComments(start, getNodePos(), indent, indentText)), start);
                 }
                 function addTag(tag) {
                     if (!tag) {
@@ -34737,7 +36861,7 @@ var ts;
                     if (isBracketed) {
                         skipWhitespace();
                         // May have an optional default, e.g. '[foo = 42]'
-                        if (parseOptionalToken(62 /* EqualsToken */)) {
+                        if (parseOptionalToken(63 /* EqualsToken */)) {
                             parseExpression();
                         }
                         parseExpected(23 /* CloseBracketToken */);
@@ -34746,9 +36870,9 @@ var ts;
                 }
                 function isObjectOrObjectArrayTypeReference(node) {
                     switch (node.kind) {
-                        case 145 /* ObjectKeyword */:
+                        case 147 /* ObjectKeyword */:
                             return true;
-                        case 178 /* ArrayType */:
+                        case 182 /* ArrayType */:
                             return isObjectOrObjectArrayTypeReference(node.elementType);
                         default:
                             return ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && !node.typeArguments;
@@ -34760,7 +36884,7 @@ var ts;
                     skipWhitespaceOrAsterisk();
                     var _a = parseBracketNameInPropertyAndParamTag(), name = _a.name, isBracketed = _a.isBracketed;
                     var indentText = skipWhitespaceOrAsterisk();
-                    if (isNameFirst) {
+                    if (isNameFirst && !lookAhead(parseJSDocLinkPrefix)) {
                         typeExpression = tryParseTypeExpression();
                     }
                     var comment = parseTrailingTagComments(start, getNodePos(), indent, indentText);
@@ -34780,12 +36904,12 @@ var ts;
                         var child = void 0;
                         var children = void 0;
                         while (child = tryParse(function () { return parseChildParameterOrPropertyTag(target, indent, name); })) {
-                            if (child.kind === 326 /* JSDocParameterTag */ || child.kind === 333 /* JSDocPropertyTag */) {
+                            if (child.kind === 338 /* JSDocParameterTag */ || child.kind === 345 /* JSDocPropertyTag */) {
                                 children = ts.append(children, child);
                             }
                         }
                         if (children) {
-                            var literal = finishNode(factory.createJSDocTypeLiteral(children, typeExpression.type.kind === 178 /* ArrayType */), pos);
+                            var literal = finishNode(factory.createJSDocTypeLiteral(children, typeExpression.type.kind === 182 /* ArrayType */), pos);
                             return finishNode(factory.createJSDocTypeExpression(literal), pos);
                         }
                     }
@@ -34795,27 +36919,35 @@ var ts;
                         parseErrorAt(tagName.pos, scanner.getTokenPos(), ts.Diagnostics._0_tag_already_specified, tagName.escapedText);
                     }
                     var typeExpression = tryParseTypeExpression();
-                    var end = getNodePos();
-                    return finishNode(factory.createJSDocReturnTag(tagName, typeExpression, parseTrailingTagComments(start, end, indent, indentText)), start, end);
+                    return finishNode(factory.createJSDocReturnTag(tagName, typeExpression, parseTrailingTagComments(start, getNodePos(), indent, indentText)), start);
                 }
                 function parseTypeTag(start, tagName, indent, indentText) {
                     if (ts.some(tags, ts.isJSDocTypeTag)) {
                         parseErrorAt(tagName.pos, scanner.getTokenPos(), ts.Diagnostics._0_tag_already_specified, tagName.escapedText);
                     }
                     var typeExpression = parseJSDocTypeExpression(/*mayOmitBraces*/ true);
-                    var end = getNodePos();
-                    var comments = indent !== undefined && indentText !== undefined ? parseTrailingTagComments(start, end, indent, indentText) : undefined;
-                    return finishNode(factory.createJSDocTypeTag(tagName, typeExpression, comments), start, end);
+                    var comments = indent !== undefined && indentText !== undefined ? parseTrailingTagComments(start, getNodePos(), indent, indentText) : undefined;
+                    return finishNode(factory.createJSDocTypeTag(tagName, typeExpression, comments), start);
                 }
                 function parseSeeTag(start, tagName, indent, indentText) {
-                    var nameExpression = parseJSDocNameReference();
-                    var end = getNodePos();
-                    var comments = indent !== undefined && indentText !== undefined ? parseTrailingTagComments(start, end, indent, indentText) : undefined;
-                    return finishNode(factory.createJSDocSeeTag(tagName, nameExpression, comments), start, end);
+                    var isMarkdownOrJSDocLink = token() === 22 /* OpenBracketToken */
+                        || lookAhead(function () { return nextTokenJSDoc() === 59 /* AtToken */ && ts.tokenIsIdentifierOrKeyword(nextTokenJSDoc()) && scanner.getTokenValue() === "link"; });
+                    var nameExpression = isMarkdownOrJSDocLink ? undefined : parseJSDocNameReference();
+                    var comments = indent !== undefined && indentText !== undefined ? parseTrailingTagComments(start, getNodePos(), indent, indentText) : undefined;
+                    return finishNode(factory.createJSDocSeeTag(tagName, nameExpression, comments), start);
                 }
                 function parseAuthorTag(start, tagName, indent, indentText) {
-                    var comments = parseAuthorNameAndEmail() + (parseTrailingTagComments(start, end, indent, indentText) || "");
-                    return finishNode(factory.createJSDocAuthorTag(tagName, comments || undefined), start);
+                    var commentStart = getNodePos();
+                    var textOnly = parseAuthorNameAndEmail();
+                    var commentEnd = scanner.getStartPos();
+                    var comments = parseTrailingTagComments(start, commentEnd, indent, indentText);
+                    if (!comments) {
+                        commentEnd = scanner.getStartPos();
+                    }
+                    var allParts = typeof comments !== "string"
+                        ? createNodeArray(ts.concatenate([finishNode(textOnly, commentStart, commentEnd)], comments), commentStart) // cast away readonly
+                        : textOnly.text + comments;
+                    return finishNode(factory.createJSDocAuthorTag(tagName, allParts), start);
                 }
                 function parseAuthorNameAndEmail() {
                     var comments = [];
@@ -34836,17 +36968,15 @@ var ts;
                         comments.push(scanner.getTokenText());
                         token = nextTokenJSDoc();
                     }
-                    return comments.join("");
+                    return factory.createJSDocText(comments.join(""));
                 }
                 function parseImplementsTag(start, tagName, margin, indentText) {
                     var className = parseExpressionWithTypeArgumentsForAugments();
-                    var end = getNodePos();
-                    return finishNode(factory.createJSDocImplementsTag(tagName, className, parseTrailingTagComments(start, end, margin, indentText)), start, end);
+                    return finishNode(factory.createJSDocImplementsTag(tagName, className, parseTrailingTagComments(start, getNodePos(), margin, indentText)), start);
                 }
                 function parseAugmentsTag(start, tagName, margin, indentText) {
                     var className = parseExpressionWithTypeArgumentsForAugments();
-                    var end = getNodePos();
-                    return finishNode(factory.createJSDocAugmentsTag(tagName, className, parseTrailingTagComments(start, end, margin, indentText)), start, end);
+                    return finishNode(factory.createJSDocAugmentsTag(tagName, className, parseTrailingTagComments(start, getNodePos(), margin, indentText)), start);
                 }
                 function parseExpressionWithTypeArgumentsForAugments() {
                     var usedBrace = parseOptional(18 /* OpenBraceToken */);
@@ -34870,20 +37000,17 @@ var ts;
                     return node;
                 }
                 function parseSimpleTag(start, createTag, tagName, margin, indentText) {
-                    var end = getNodePos();
-                    return finishNode(createTag(tagName, parseTrailingTagComments(start, end, margin, indentText)), start, end);
+                    return finishNode(createTag(tagName, parseTrailingTagComments(start, getNodePos(), margin, indentText)), start);
                 }
                 function parseThisTag(start, tagName, margin, indentText) {
                     var typeExpression = parseJSDocTypeExpression(/*mayOmitBraces*/ true);
                     skipWhitespace();
-                    var end = getNodePos();
-                    return finishNode(factory.createJSDocThisTag(tagName, typeExpression, parseTrailingTagComments(start, end, margin, indentText)), start, end);
+                    return finishNode(factory.createJSDocThisTag(tagName, typeExpression, parseTrailingTagComments(start, getNodePos(), margin, indentText)), start);
                 }
                 function parseEnumTag(start, tagName, margin, indentText) {
                     var typeExpression = parseJSDocTypeExpression(/*mayOmitBraces*/ true);
                     skipWhitespace();
-                    var end = getNodePos();
-                    return finishNode(factory.createJSDocEnumTag(tagName, typeExpression, parseTrailingTagComments(start, end, margin, indentText)), start, end);
+                    return finishNode(factory.createJSDocEnumTag(tagName, typeExpression, parseTrailingTagComments(start, getNodePos(), margin, indentText)), start);
                 }
                 function parseTypedefTag(start, tagName, indent, indentText) {
                     var _a;
@@ -34900,7 +37027,7 @@ var ts;
                         var hasChildren = false;
                         while (child = tryParse(function () { return parseChildPropertyTag(indent); })) {
                             hasChildren = true;
-                            if (child.kind === 329 /* JSDocTypeTag */) {
+                            if (child.kind === 341 /* JSDocTypeTag */) {
                                 if (childTypeTag) {
                                     parseErrorAtCurrentToken(ts.Diagnostics.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags);
                                     var lastError = ts.lastOrUndefined(parseDiagnostics);
@@ -34918,7 +37045,7 @@ var ts;
                             }
                         }
                         if (hasChildren) {
-                            var isArrayType = typeExpression && typeExpression.type.kind === 178 /* ArrayType */;
+                            var isArrayType = typeExpression && typeExpression.type.kind === 182 /* ArrayType */;
                             var jsdocTypeLiteral = factory.createJSDocTypeLiteral(jsDocPropertyTags, isArrayType);
                             typeExpression = childTypeTag && childTypeTag.typeExpression && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type) ?
                                 childTypeTag.typeExpression :
@@ -34971,17 +37098,16 @@ var ts;
                     var returnTag = tryParse(function () {
                         if (parseOptionalJsdoc(59 /* AtToken */)) {
                             var tag = parseTag(indent);
-                            if (tag && tag.kind === 327 /* JSDocReturnTag */) {
+                            if (tag && tag.kind === 339 /* JSDocReturnTag */) {
                                 return tag;
                             }
                         }
                     });
                     var typeExpression = finishNode(factory.createJSDocSignature(/*typeParameters*/ undefined, parameters, returnTag), start);
-                    var end = getNodePos();
                     if (!comment) {
-                        comment = parseTrailingTagComments(start, end, indent, indentText);
+                        comment = parseTrailingTagComments(start, getNodePos(), indent, indentText);
                     }
-                    return finishNode(factory.createJSDocCallbackTag(tagName, typeExpression, fullName, comment), start, end);
+                    return finishNode(factory.createJSDocCallbackTag(tagName, typeExpression, fullName, comment), start);
                 }
                 function escapedTextsEqual(a, b) {
                     while (!ts.isIdentifier(a) || !ts.isIdentifier(b)) {
@@ -35006,7 +37132,7 @@ var ts;
                             case 59 /* AtToken */:
                                 if (canParseTag) {
                                     var child = tryParseChildTag(target, indent);
-                                    if (child && (child.kind === 326 /* JSDocParameterTag */ || child.kind === 333 /* JSDocPropertyTag */) &&
+                                    if (child && (child.kind === 338 /* JSDocParameterTag */ || child.kind === 345 /* JSDocPropertyTag */) &&
                                         target !== 4 /* CallbackParameter */ &&
                                         name && (ts.isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) {
                                         return false;
@@ -35025,7 +37151,7 @@ var ts;
                                 }
                                 seenAsterisk = true;
                                 break;
-                            case 78 /* Identifier */:
+                            case 79 /* Identifier */:
                                 canParseTag = false;
                                 break;
                             case 1 /* EndOfFileToken */:
@@ -35062,15 +37188,32 @@ var ts;
                 }
                 function parseTemplateTagTypeParameter() {
                     var typeParameterPos = getNodePos();
+                    var isBracketed = parseOptionalJsdoc(22 /* OpenBracketToken */);
+                    if (isBracketed) {
+                        skipWhitespace();
+                    }
                     var name = parseJSDocIdentifierName(ts.Diagnostics.Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces);
-                    return finishNode(factory.createTypeParameterDeclaration(name, /*constraint*/ undefined, /*defaultType*/ undefined), typeParameterPos);
+                    var defaultType;
+                    if (isBracketed) {
+                        skipWhitespace();
+                        parseExpected(63 /* EqualsToken */);
+                        defaultType = doInsideOfContext(4194304 /* JSDoc */, parseJSDocType);
+                        parseExpected(23 /* CloseBracketToken */);
+                    }
+                    if (ts.nodeIsMissing(name)) {
+                        return undefined;
+                    }
+                    return finishNode(factory.createTypeParameterDeclaration(name, /*constraint*/ undefined, defaultType), typeParameterPos);
                 }
                 function parseTemplateTagTypeParameters() {
                     var pos = getNodePos();
                     var typeParameters = [];
                     do {
                         skipWhitespace();
-                        typeParameters.push(parseTemplateTagTypeParameter());
+                        var node = parseTemplateTagTypeParameter();
+                        if (node !== undefined) {
+                            typeParameters.push(node);
+                        }
                         skipWhitespaceOrAsterisk();
                     } while (parseOptionalJsdoc(27 /* CommaToken */));
                     return createNodeArray(typeParameters, pos);
@@ -35089,8 +37232,7 @@ var ts;
                     // TODO: Consider only parsing a single type parameter if there is a constraint.
                     var constraint = token() === 18 /* OpenBraceToken */ ? parseJSDocTypeExpression() : undefined;
                     var typeParameters = parseTemplateTagTypeParameters();
-                    var end = getNodePos();
-                    return finishNode(factory.createJSDocTemplateTag(tagName, constraint, typeParameters, parseTrailingTagComments(start, end, indent, indentText)), start, end);
+                    return finishNode(factory.createJSDocTemplateTag(tagName, constraint, typeParameters, parseTrailingTagComments(start, getNodePos(), indent, indentText)), start);
                 }
                 function parseOptionalJsdoc(t) {
                     if (token() === t) {
@@ -35118,7 +37260,7 @@ var ts;
                 }
                 function parseJSDocIdentifierName(message) {
                     if (!ts.tokenIsIdentifierOrKeyword(token())) {
-                        return createMissingNode(78 /* Identifier */, /*reportAtCurrentPosition*/ !message, message || ts.Diagnostics.Identifier_expected);
+                        return createMissingNode(79 /* Identifier */, /*reportAtCurrentPosition*/ !message, message || ts.Diagnostics.Identifier_expected);
                     }
                     identifierCount++;
                     var pos = scanner.getTokenPos();
@@ -35203,6 +37345,7 @@ var ts;
             // are already correct.
             var result = Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, syntaxCursor, /*setParentNodes*/ true, sourceFile.scriptKind);
             result.commentDirectives = getNewCommentDirectives(sourceFile.commentDirectives, result.commentDirectives, changeRange.span.start, ts.textSpanEnd(changeRange.span), delta, oldText, newText, aggressiveChecks);
+            result.impliedNodeFormat = sourceFile.impliedNodeFormat;
             return result;
         }
         IncrementalParser.updateSourceFile = updateSourceFile;
@@ -35281,8 +37424,8 @@ var ts;
             function visitArray(array) {
                 array._children = undefined;
                 ts.setTextRangePosEnd(array, array.pos + delta, array.end + delta);
-                for (var _i = 0, array_8 = array; _i < array_8.length; _i++) {
-                    var node = array_8[_i];
+                for (var _i = 0, array_9 = array; _i < array_9.length; _i++) {
+                    var node = array_9[_i];
                     visitNode(node);
                 }
             }
@@ -35291,7 +37434,7 @@ var ts;
             switch (node.kind) {
                 case 10 /* StringLiteral */:
                 case 8 /* NumericLiteral */:
-                case 78 /* Identifier */:
+                case 79 /* Identifier */:
                     return true;
             }
             return false;
@@ -35430,8 +37573,8 @@ var ts;
                     array._children = undefined;
                     // Adjust the pos or end (or both) of the intersecting array accordingly.
                     adjustIntersectingElement(array, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta);
-                    for (var _i = 0, array_9 = array; _i < array_9.length; _i++) {
-                        var node = array_9[_i];
+                    for (var _i = 0, array_10 = array; _i < array_10.length; _i++) {
+                        var node = array_10[_i];
                         visitNode(node);
                     }
                     return;
@@ -35652,7 +37795,7 @@ var ts;
     })(IncrementalParser || (IncrementalParser = {}));
     /** @internal */
     function isDeclarationFileName(fileName) {
-        return ts.fileExtensionIs(fileName, ".d.ts" /* Dts */);
+        return ts.fileExtensionIsOneOf(fileName, [".d.ts" /* Dts */, ".d.mts" /* Dmts */, ".d.cts" /* Dcts */]);
     }
     ts.isDeclarationFileName = isDeclarationFileName;
     /*@internal*/
@@ -35765,7 +37908,7 @@ var ts;
         if (namedArgRegExCache.has(name)) {
             return namedArgRegExCache.get(name);
         }
-        var result = new RegExp("(\\s" + name + "\\s*=\\s*)('|\")(.+?)\\2", "im");
+        var result = new RegExp("(\\s".concat(name, "\\s*=\\s*)(?:(?:'([^']*)')|(?:\"([^\"]*)\"))"), "im");
         namedArgRegExCache.set(name, result);
         return result;
     }
@@ -35789,16 +37932,17 @@ var ts;
                         return; // Missing required argument, don't parse
                     }
                     else if (matchResult) {
+                        var value = matchResult[2] || matchResult[3];
                         if (arg.captureSpan) {
-                            var startPos = range.pos + matchResult.index + matchResult[1].length + matchResult[2].length;
+                            var startPos = range.pos + matchResult.index + matchResult[1].length + 1;
                             argument[arg.name] = {
-                                value: matchResult[3],
+                                value: value,
                                 pos: startPos,
-                                end: startPos + matchResult[3].length
+                                end: startPos + value.length
                             };
                         }
                         else {
-                            argument[arg.name] = matchResult[3];
+                            argument[arg.name] = value;
                         }
                     }
                 }
@@ -35814,7 +37958,7 @@ var ts;
             return addPragmaForMatch(pragmas, range, 2 /* SingleLine */, singleLine);
         }
         if (range.kind === 3 /* MultiLineCommentTrivia */) {
-            var multiLinePragmaRegEx = /\s*@(\S+)\s*(.*)\s*$/gim; // Defined inline since it uses the "g" flag, which keeps a persistent index (for iterating)
+            var multiLinePragmaRegEx = /@(\S+)(\s+.*)?$/gim; // Defined inline since it uses the "g" flag, which keeps a persistent index (for iterating)
             var multiLineMatch = void 0;
             while (multiLineMatch = multiLinePragmaRegEx.exec(text)) {
                 addPragmaForMatch(pragmas, range, 4 /* MultiLine */, multiLineMatch);
@@ -35841,7 +37985,7 @@ var ts;
             return {};
         if (!pragma.args)
             return {};
-        var args = text.split(/\s+/);
+        var args = ts.trimString(text).split(/\s+/);
         var argMap = {};
         for (var i = 0; i < pragma.args.length; i++) {
             var argument = pragma.args[i];
@@ -35860,10 +38004,10 @@ var ts;
         if (lhs.kind !== rhs.kind) {
             return false;
         }
-        if (lhs.kind === 78 /* Identifier */) {
+        if (lhs.kind === 79 /* Identifier */) {
             return lhs.escapedText === rhs.escapedText;
         }
-        if (lhs.kind === 107 /* ThisKeyword */) {
+        if (lhs.kind === 108 /* ThisKeyword */) {
             return true;
         }
         // If we are at this statement then we must have PropertyAccessExpression and because tag name in Jsx element can only
@@ -35877,7 +38021,7 @@ var ts;
 var ts;
 (function (ts) {
     /* @internal */
-    ts.compileOnSaveCommandLineOption = { name: "compileOnSave", type: "boolean" };
+    ts.compileOnSaveCommandLineOption = { name: "compileOnSave", type: "boolean", defaultValueDescription: "false" };
     var jsxOptionMap = new ts.Map(ts.getEntries({
         "preserve": 1 /* Preserve */,
         "react-native": 3 /* ReactNative */,
@@ -35905,6 +38049,7 @@ var ts;
         ["es2018", "lib.es2018.d.ts"],
         ["es2019", "lib.es2019.d.ts"],
         ["es2020", "lib.es2020.d.ts"],
+        ["es2021", "lib.es2021.d.ts"],
         ["esnext", "lib.esnext.d.ts"],
         // Host only
         ["dom", "lib.dom.d.ts"],
@@ -35944,14 +38089,18 @@ var ts;
         ["es2020.string", "lib.es2020.string.d.ts"],
         ["es2020.symbol.wellknown", "lib.es2020.symbol.wellknown.d.ts"],
         ["es2020.intl", "lib.es2020.intl.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"],
         ["esnext.array", "lib.es2019.array.d.ts"],
         ["esnext.symbol", "lib.es2019.symbol.d.ts"],
         ["esnext.asynciterable", "lib.es2018.asynciterable.d.ts"],
         ["esnext.intl", "lib.esnext.intl.d.ts"],
         ["esnext.bigint", "lib.es2020.bigint.d.ts"],
-        ["esnext.string", "lib.esnext.string.d.ts"],
-        ["esnext.promise", "lib.esnext.promise.d.ts"],
-        ["esnext.weakref", "lib.esnext.weakref.d.ts"]
+        ["esnext.string", "lib.es2021.string.d.ts"],
+        ["esnext.promise", "lib.es2021.promise.d.ts"],
+        ["esnext.weakref", "lib.es2021.weakref.d.ts"]
     ];
     /**
      * An array of supported "lib" reference file names used to determine the order for inclusion
@@ -35975,11 +38124,12 @@ var ts;
                 fixedpollinginterval: ts.WatchFileKind.FixedPollingInterval,
                 prioritypollinginterval: ts.WatchFileKind.PriorityPollingInterval,
                 dynamicprioritypolling: ts.WatchFileKind.DynamicPriorityPolling,
+                fixedchunksizepolling: ts.WatchFileKind.FixedChunkSizePolling,
                 usefsevents: ts.WatchFileKind.UseFsEvents,
                 usefseventsonparentdirectory: ts.WatchFileKind.UseFsEventsOnParentDirectory,
             })),
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.Specify_strategy_for_watching_file_Colon_FixedPollingInterval_default_PriorityPollingInterval_DynamicPriorityPolling_UseFsEvents_UseFsEventsOnParentDirectory,
+            category: ts.Diagnostics.Watch_and_Build_Modes,
+            description: ts.Diagnostics.Specify_how_the_TypeScript_watch_mode_works,
         },
         {
             name: "watchDirectory",
@@ -35987,9 +38137,10 @@ var ts;
                 usefsevents: ts.WatchDirectoryKind.UseFsEvents,
                 fixedpollinginterval: ts.WatchDirectoryKind.FixedPollingInterval,
                 dynamicprioritypolling: ts.WatchDirectoryKind.DynamicPriorityPolling,
+                fixedchunksizepolling: ts.WatchDirectoryKind.FixedChunkSizePolling,
             })),
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.Specify_strategy_for_watching_directory_on_platforms_that_don_t_support_recursive_watching_natively_Colon_UseFsEvents_default_FixedPollingInterval_DynamicPriorityPolling,
+            category: ts.Diagnostics.Watch_and_Build_Modes,
+            description: ts.Diagnostics.Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality,
         },
         {
             name: "fallbackPolling",
@@ -35997,15 +38148,17 @@ var ts;
                 fixedinterval: ts.PollingWatchKind.FixedInterval,
                 priorityinterval: ts.PollingWatchKind.PriorityInterval,
                 dynamicpriority: ts.PollingWatchKind.DynamicPriority,
+                fixedchunksize: ts.PollingWatchKind.FixedChunkSize,
             })),
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.Specify_strategy_for_creating_a_polling_watch_when_it_fails_to_create_using_file_system_events_Colon_FixedInterval_default_PriorityInterval_DynamicPriority,
+            category: ts.Diagnostics.Watch_and_Build_Modes,
+            description: ts.Diagnostics.Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers,
         },
         {
             name: "synchronousWatchDirectory",
             type: "boolean",
-            category: ts.Diagnostics.Advanced_Options,
+            category: ts.Diagnostics.Watch_and_Build_Modes,
             description: ts.Diagnostics.Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively,
+            defaultValueDescription: "false",
         },
         {
             name: "excludeDirectories",
@@ -36016,8 +38169,8 @@ var ts;
                 isFilePath: true,
                 extraValidation: specToDiagnostic
             },
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively,
+            category: ts.Diagnostics.Watch_and_Build_Modes,
+            description: ts.Diagnostics.Remove_a_list_of_directories_from_the_watch_process,
         },
         {
             name: "excludeFiles",
@@ -36028,8 +38181,8 @@ var ts;
                 isFilePath: true,
                 extraValidation: specToDiagnostic
             },
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively,
+            category: ts.Diagnostics.Watch_and_Build_Modes,
+            description: ts.Diagnostics.Remove_a_list_of_files_from_the_watch_mode_s_processing,
         },
     ];
     /* @internal */
@@ -36041,76 +38194,90 @@ var ts;
             showInSimplifiedHelpView: true,
             category: ts.Diagnostics.Command_line_Options,
             description: ts.Diagnostics.Print_this_message,
+            defaultValueDescription: "false",
         },
         {
             name: "help",
             shortName: "?",
-            type: "boolean"
+            type: "boolean",
+            defaultValueDescription: "false",
         },
         {
             name: "watch",
             shortName: "w",
             type: "boolean",
             showInSimplifiedHelpView: true,
+            isCommandLineOnly: true,
             category: ts.Diagnostics.Command_line_Options,
             description: ts.Diagnostics.Watch_input_files,
+            defaultValueDescription: "false",
         },
         {
             name: "preserveWatchOutput",
             type: "boolean",
             showInSimplifiedHelpView: false,
-            category: ts.Diagnostics.Command_line_Options,
-            description: ts.Diagnostics.Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen,
+            category: ts.Diagnostics.Output_Formatting,
+            description: ts.Diagnostics.Disable_wiping_the_console_in_watch_mode,
+            defaultValueDescription: "false",
         },
         {
             name: "listFiles",
             type: "boolean",
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.Print_names_of_files_part_of_the_compilation
+            category: ts.Diagnostics.Compiler_Diagnostics,
+            description: ts.Diagnostics.Print_all_of_the_files_read_during_the_compilation,
+            defaultValueDescription: "false"
         },
         {
             name: "explainFiles",
             type: "boolean",
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.Print_names_of_files_and_the_reason_they_are_part_of_the_compilation
-        }, {
+            category: ts.Diagnostics.Compiler_Diagnostics,
+            description: ts.Diagnostics.Print_files_read_during_the_compilation_including_why_it_was_included,
+            defaultValueDescription: "false",
+        },
+        {
             name: "listEmittedFiles",
             type: "boolean",
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.Print_names_of_generated_files_part_of_the_compilation
+            category: ts.Diagnostics.Compiler_Diagnostics,
+            description: ts.Diagnostics.Print_the_names_of_emitted_files_after_a_compilation,
+            defaultValueDescription: "false"
         },
         {
             name: "pretty",
             type: "boolean",
             showInSimplifiedHelpView: true,
-            category: ts.Diagnostics.Command_line_Options,
-            description: ts.Diagnostics.Stylize_errors_and_messages_using_color_and_context_experimental
+            category: ts.Diagnostics.Output_Formatting,
+            description: ts.Diagnostics.Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read,
+            defaultValueDescription: "true"
         },
         {
             name: "traceResolution",
             type: "boolean",
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.Enable_tracing_of_the_name_resolution_process
+            category: ts.Diagnostics.Compiler_Diagnostics,
+            description: ts.Diagnostics.Log_paths_used_during_the_moduleResolution_process,
+            defaultValueDescription: "false"
         },
         {
             name: "diagnostics",
             type: "boolean",
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.Show_diagnostic_information
+            category: ts.Diagnostics.Compiler_Diagnostics,
+            description: ts.Diagnostics.Output_compiler_performance_information_after_building,
+            defaultValueDescription: "false"
         },
         {
             name: "extendedDiagnostics",
             type: "boolean",
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.Show_verbose_diagnostic_information
+            category: ts.Diagnostics.Compiler_Diagnostics,
+            description: ts.Diagnostics.Output_more_detailed_compiler_performance_information_after_building,
+            defaultValueDescription: "false"
         },
         {
             name: "generateCpuProfile",
             type: "string",
             isFilePath: true,
             paramType: ts.Diagnostics.FILE_OR_DIRECTORY,
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.Generates_a_CPU_profile
+            category: ts.Diagnostics.Compiler_Diagnostics,
+            description: ts.Diagnostics.Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging,
+            defaultValueDescription: "profile.cpuprofile"
         },
         {
             name: "generateTrace",
@@ -36118,30 +38285,34 @@ var ts;
             isFilePath: true,
             isCommandLineOnly: true,
             paramType: ts.Diagnostics.DIRECTORY,
-            category: ts.Diagnostics.Advanced_Options,
+            category: ts.Diagnostics.Compiler_Diagnostics,
             description: ts.Diagnostics.Generates_an_event_trace_and_a_list_of_types
         },
         {
             name: "incremental",
             shortName: "i",
             type: "boolean",
-            category: ts.Diagnostics.Basic_Options,
+            category: ts.Diagnostics.Projects,
             description: ts.Diagnostics.Enable_incremental_compilation,
-            transpileOptionValue: undefined
+            transpileOptionValue: undefined,
+            defaultValueDescription: ts.Diagnostics.false_unless_composite_is_set
         },
         {
             name: "assumeChangesOnlyAffectDirectDependencies",
             type: "boolean",
             affectsSemanticDiagnostics: true,
             affectsEmit: true,
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it
+            category: ts.Diagnostics.Watch_and_Build_Modes,
+            description: ts.Diagnostics.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: "false",
         },
         {
             name: "locale",
             type: "string",
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.The_locale_used_when_displaying_messages_to_the_user_e_g_en_us
+            category: ts.Diagnostics.Command_line_Options,
+            isCommandLineOnly: true,
+            description: ts.Diagnostics.Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit,
+            defaultValueDescription: ts.Diagnostics.Platform_specific
         },
     ];
     /* @internal */
@@ -36158,6 +38329,7 @@ var ts;
             es2018: 5 /* ES2018 */,
             es2019: 6 /* ES2019 */,
             es2020: 7 /* ES2020 */,
+            es2021: 8 /* ES2021 */,
             esnext: 99 /* ESNext */,
         })),
         affectsSourceFile: true,
@@ -36165,17 +38337,19 @@ var ts;
         affectsEmit: true,
         paramType: ts.Diagnostics.VERSION,
         showInSimplifiedHelpView: true,
-        category: ts.Diagnostics.Basic_Options,
-        description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_ES2019_ES2020_or_ESNEXT,
+        category: ts.Diagnostics.Language_and_Environment,
+        description: ts.Diagnostics.Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations,
+        defaultValueDescription: "ES3"
     };
-    /* @internal */
-    ts.optionDeclarations = __spreadArray(__spreadArray([], ts.commonOptionsWithBuild), [
+    var commandOptionsWithoutBuild = [
+        // CommandLine only options
         {
             name: "all",
             type: "boolean",
             showInSimplifiedHelpView: true,
             category: ts.Diagnostics.Command_line_Options,
             description: ts.Diagnostics.Show_all_compiler_options,
+            defaultValueDescription: "false",
         },
         {
             name: "version",
@@ -36184,6 +38358,7 @@ var ts;
             showInSimplifiedHelpView: true,
             category: ts.Diagnostics.Command_line_Options,
             description: ts.Diagnostics.Print_the_compiler_s_version,
+            defaultValueDescription: "false",
         },
         {
             name: "init",
@@ -36191,6 +38366,7 @@ var ts;
             showInSimplifiedHelpView: true,
             category: ts.Diagnostics.Command_line_Options,
             description: ts.Diagnostics.Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file,
+            defaultValueDescription: "false",
         },
         {
             name: "project",
@@ -36208,14 +38384,17 @@ var ts;
             shortName: "b",
             showInSimplifiedHelpView: true,
             category: ts.Diagnostics.Command_line_Options,
-            description: ts.Diagnostics.Build_one_or_more_projects_and_their_dependencies_if_out_of_date
+            description: ts.Diagnostics.Build_one_or_more_projects_and_their_dependencies_if_out_of_date,
+            defaultValueDescription: "false",
         },
         {
             name: "showConfig",
             type: "boolean",
+            showInSimplifiedHelpView: true,
             category: ts.Diagnostics.Command_line_Options,
             isCommandLineOnly: true,
-            description: ts.Diagnostics.Print_the_final_configuration_instead_of_building
+            description: ts.Diagnostics.Print_the_final_configuration_instead_of_building,
+            defaultValueDescription: "false",
         },
         {
             name: "listFilesOnly",
@@ -36224,7 +38403,8 @@ var ts;
             affectsSemanticDiagnostics: true,
             affectsEmit: true,
             isCommandLineOnly: true,
-            description: ts.Diagnostics.Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing
+            description: ts.Diagnostics.Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing,
+            defaultValueDescription: "false",
         },
         // Basic
         ts.targetOptionDeclaration,
@@ -36240,14 +38420,17 @@ var ts;
                 es6: ts.ModuleKind.ES2015,
                 es2015: ts.ModuleKind.ES2015,
                 es2020: ts.ModuleKind.ES2020,
-                esnext: ts.ModuleKind.ESNext
+                es2022: ts.ModuleKind.ES2022,
+                esnext: ts.ModuleKind.ESNext,
+                node12: ts.ModuleKind.Node12,
+                nodenext: ts.ModuleKind.NodeNext,
             })),
             affectsModuleResolution: true,
             affectsEmit: true,
             paramType: ts.Diagnostics.KIND,
             showInSimplifiedHelpView: true,
-            category: ts.Diagnostics.Basic_Options,
-            description: ts.Diagnostics.Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_es2020_or_ESNext,
+            category: ts.Diagnostics.Modules,
+            description: ts.Diagnostics.Specify_what_module_code_is_generated,
         },
         {
             name: "lib",
@@ -36256,10 +38439,10 @@ var ts;
                 name: "lib",
                 type: ts.libMap
             },
-            affectsModuleResolution: true,
+            affectsProgramStructure: true,
             showInSimplifiedHelpView: true,
-            category: ts.Diagnostics.Basic_Options,
-            description: ts.Diagnostics.Specify_library_files_to_be_included_in_the_compilation,
+            category: ts.Diagnostics.Language_and_Environment,
+            description: ts.Diagnostics.Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment,
             transpileOptionValue: undefined
         },
         {
@@ -36267,14 +38450,17 @@ var ts;
             type: "boolean",
             affectsModuleResolution: true,
             showInSimplifiedHelpView: true,
-            category: ts.Diagnostics.Basic_Options,
-            description: ts.Diagnostics.Allow_javascript_files_to_be_compiled
+            category: ts.Diagnostics.JavaScript_Support,
+            description: ts.Diagnostics.Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these_files,
+            defaultValueDescription: "false"
         },
         {
             name: "checkJs",
             type: "boolean",
-            category: ts.Diagnostics.Basic_Options,
-            description: ts.Diagnostics.Report_errors_in_js_files
+            showInSimplifiedHelpView: true,
+            category: ts.Diagnostics.JavaScript_Support,
+            description: ts.Diagnostics.Enable_error_reporting_in_type_checked_JavaScript_files,
+            defaultValueDescription: "false"
         },
         {
             name: "jsx",
@@ -36284,8 +38470,9 @@ var ts;
             affectsModuleResolution: true,
             paramType: ts.Diagnostics.KIND,
             showInSimplifiedHelpView: true,
-            category: ts.Diagnostics.Basic_Options,
-            description: ts.Diagnostics.Specify_JSX_code_generation_Colon_preserve_react_native_react_react_jsx_or_react_jsxdev,
+            category: ts.Diagnostics.Language_and_Environment,
+            description: ts.Diagnostics.Specify_what_JSX_code_is_generated,
+            defaultValueDescription: "undefined"
         },
         {
             name: "declaration",
@@ -36293,34 +38480,39 @@ var ts;
             type: "boolean",
             affectsEmit: true,
             showInSimplifiedHelpView: true,
-            category: ts.Diagnostics.Basic_Options,
-            description: ts.Diagnostics.Generates_corresponding_d_ts_file,
-            transpileOptionValue: undefined
+            category: ts.Diagnostics.Emit,
+            transpileOptionValue: undefined,
+            description: ts.Diagnostics.Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project,
+            defaultValueDescription: ts.Diagnostics.false_unless_composite_is_set,
         },
         {
             name: "declarationMap",
             type: "boolean",
             affectsEmit: true,
             showInSimplifiedHelpView: true,
-            category: ts.Diagnostics.Basic_Options,
-            description: ts.Diagnostics.Generates_a_sourcemap_for_each_corresponding_d_ts_file,
-            transpileOptionValue: undefined
+            category: ts.Diagnostics.Emit,
+            transpileOptionValue: undefined,
+            defaultValueDescription: "false",
+            description: ts.Diagnostics.Create_sourcemaps_for_d_ts_files
         },
         {
             name: "emitDeclarationOnly",
             type: "boolean",
             affectsEmit: true,
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.Only_emit_d_ts_declaration_files,
-            transpileOptionValue: undefined
+            showInSimplifiedHelpView: true,
+            category: ts.Diagnostics.Emit,
+            description: ts.Diagnostics.Only_output_d_ts_files_and_not_JavaScript_files,
+            transpileOptionValue: undefined,
+            defaultValueDescription: "false",
         },
         {
             name: "sourceMap",
             type: "boolean",
             affectsEmit: true,
             showInSimplifiedHelpView: true,
-            category: ts.Diagnostics.Basic_Options,
-            description: ts.Diagnostics.Generates_corresponding_map_file,
+            category: ts.Diagnostics.Emit,
+            defaultValueDescription: "false",
+            description: ts.Diagnostics.Create_source_map_files_for_emitted_JavaScript_files,
         },
         {
             name: "outFile",
@@ -36329,9 +38521,9 @@ var ts;
             isFilePath: true,
             paramType: ts.Diagnostics.FILE,
             showInSimplifiedHelpView: true,
-            category: ts.Diagnostics.Basic_Options,
-            description: ts.Diagnostics.Concatenate_and_emit_output_to_single_file,
-            transpileOptionValue: undefined
+            category: ts.Diagnostics.Emit,
+            description: ts.Diagnostics.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: undefined,
         },
         {
             name: "outDir",
@@ -36340,8 +38532,8 @@ var ts;
             isFilePath: true,
             paramType: ts.Diagnostics.DIRECTORY,
             showInSimplifiedHelpView: true,
-            category: ts.Diagnostics.Basic_Options,
-            description: ts.Diagnostics.Redirect_output_structure_to_the_directory,
+            category: ts.Diagnostics.Emit,
+            description: ts.Diagnostics.Specify_an_output_folder_for_all_emitted_files,
         },
         {
             name: "rootDir",
@@ -36349,17 +38541,19 @@ var ts;
             affectsEmit: true,
             isFilePath: true,
             paramType: ts.Diagnostics.LOCATION,
-            category: ts.Diagnostics.Basic_Options,
-            description: ts.Diagnostics.Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir,
+            category: ts.Diagnostics.Modules,
+            description: ts.Diagnostics.Specify_the_root_folder_within_your_source_files,
+            defaultValueDescription: ts.Diagnostics.Computed_from_the_list_of_input_files
         },
         {
             name: "composite",
             type: "boolean",
             affectsEmit: true,
             isTSConfigOnly: true,
-            category: ts.Diagnostics.Basic_Options,
-            description: ts.Diagnostics.Enable_project_compilation,
-            transpileOptionValue: undefined
+            category: ts.Diagnostics.Projects,
+            transpileOptionValue: undefined,
+            defaultValueDescription: "false",
+            description: ts.Diagnostics.Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references,
         },
         {
             name: "tsBuildInfoFile",
@@ -36367,177 +38561,211 @@ var ts;
             affectsEmit: true,
             isFilePath: true,
             paramType: ts.Diagnostics.FILE,
-            category: ts.Diagnostics.Basic_Options,
-            description: ts.Diagnostics.Specify_file_to_store_incremental_compilation_information,
-            transpileOptionValue: undefined
+            category: ts.Diagnostics.Projects,
+            transpileOptionValue: undefined,
+            defaultValueDescription: ".tsbuildinfo",
+            description: ts.Diagnostics.Specify_the_folder_for_tsbuildinfo_incremental_compilation_files,
         },
         {
             name: "removeComments",
             type: "boolean",
             affectsEmit: true,
             showInSimplifiedHelpView: true,
-            category: ts.Diagnostics.Basic_Options,
-            description: ts.Diagnostics.Do_not_emit_comments_to_output,
+            category: ts.Diagnostics.Emit,
+            defaultValueDescription: "false",
+            description: ts.Diagnostics.Disable_emitting_comments,
         },
         {
             name: "noEmit",
             type: "boolean",
             showInSimplifiedHelpView: true,
-            category: ts.Diagnostics.Basic_Options,
-            description: ts.Diagnostics.Do_not_emit_outputs,
-            transpileOptionValue: undefined
+            category: ts.Diagnostics.Emit,
+            description: ts.Diagnostics.Disable_emitting_files_from_a_compilation,
+            transpileOptionValue: undefined,
+            defaultValueDescription: "false"
         },
         {
             name: "importHelpers",
             type: "boolean",
             affectsEmit: true,
-            category: ts.Diagnostics.Basic_Options,
-            description: ts.Diagnostics.Import_emit_helpers_from_tslib
+            category: ts.Diagnostics.Emit,
+            description: ts.Diagnostics.Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file,
+            defaultValueDescription: "false"
         },
         {
             name: "importsNotUsedAsValues",
             type: new ts.Map(ts.getEntries({
                 remove: 0 /* Remove */,
                 preserve: 1 /* Preserve */,
-                error: 2 /* Error */
+                error: 2 /* Error */,
             })),
             affectsEmit: true,
             affectsSemanticDiagnostics: true,
-            category: ts.Diagnostics.Advanced_Options,
+            category: ts.Diagnostics.Emit,
             description: ts.Diagnostics.Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types
         },
         {
             name: "downlevelIteration",
             type: "boolean",
             affectsEmit: true,
-            category: ts.Diagnostics.Basic_Options,
-            description: ts.Diagnostics.Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3
+            category: ts.Diagnostics.Emit,
+            description: ts.Diagnostics.Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration,
+            defaultValueDescription: "false"
         },
         {
             name: "isolatedModules",
             type: "boolean",
-            category: ts.Diagnostics.Basic_Options,
-            description: ts.Diagnostics.Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule,
-            transpileOptionValue: true
+            category: ts.Diagnostics.Interop_Constraints,
+            description: ts.Diagnostics.Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports,
+            transpileOptionValue: true,
+            defaultValueDescription: "false"
         },
         // 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.
             showInSimplifiedHelpView: true,
-            category: ts.Diagnostics.Strict_Type_Checking_Options,
-            description: ts.Diagnostics.Enable_all_strict_type_checking_options
+            category: ts.Diagnostics.Type_Checking,
+            description: ts.Diagnostics.Enable_all_strict_type_checking_options,
+            defaultValueDescription: "false"
         },
         {
             name: "noImplicitAny",
             type: "boolean",
             affectsSemanticDiagnostics: true,
             strictFlag: true,
-            showInSimplifiedHelpView: true,
-            category: ts.Diagnostics.Strict_Type_Checking_Options,
-            description: ts.Diagnostics.Raise_error_on_expressions_and_declarations_with_an_implied_any_type
+            category: ts.Diagnostics.Type_Checking,
+            description: ts.Diagnostics.Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type,
+            defaultValueDescription: ts.Diagnostics.false_unless_strict_is_set
         },
         {
             name: "strictNullChecks",
             type: "boolean",
             affectsSemanticDiagnostics: true,
             strictFlag: true,
-            showInSimplifiedHelpView: true,
-            category: ts.Diagnostics.Strict_Type_Checking_Options,
-            description: ts.Diagnostics.Enable_strict_null_checks
+            category: ts.Diagnostics.Type_Checking,
+            description: ts.Diagnostics.When_type_checking_take_into_account_null_and_undefined,
+            defaultValueDescription: ts.Diagnostics.false_unless_strict_is_set
         },
         {
             name: "strictFunctionTypes",
             type: "boolean",
-            affectsSemanticDiagnostics: true,
             strictFlag: true,
-            showInSimplifiedHelpView: true,
-            category: ts.Diagnostics.Strict_Type_Checking_Options,
-            description: ts.Diagnostics.Enable_strict_checking_of_function_types
+            category: ts.Diagnostics.Type_Checking,
+            description: ts.Diagnostics.When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible,
+            defaultValueDescription: ts.Diagnostics.false_unless_strict_is_set
         },
         {
             name: "strictBindCallApply",
             type: "boolean",
             strictFlag: true,
-            showInSimplifiedHelpView: true,
-            category: ts.Diagnostics.Strict_Type_Checking_Options,
-            description: ts.Diagnostics.Enable_strict_bind_call_and_apply_methods_on_functions
+            category: ts.Diagnostics.Type_Checking,
+            description: ts.Diagnostics.Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function,
+            defaultValueDescription: ts.Diagnostics.false_unless_strict_is_set
         },
         {
             name: "strictPropertyInitialization",
             type: "boolean",
             affectsSemanticDiagnostics: true,
             strictFlag: true,
-            showInSimplifiedHelpView: true,
-            category: ts.Diagnostics.Strict_Type_Checking_Options,
-            description: ts.Diagnostics.Enable_strict_checking_of_property_initialization_in_classes
+            category: ts.Diagnostics.Type_Checking,
+            description: ts.Diagnostics.Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor,
+            defaultValueDescription: ts.Diagnostics.false_unless_strict_is_set
         },
         {
             name: "noImplicitThis",
             type: "boolean",
             affectsSemanticDiagnostics: true,
             strictFlag: true,
-            showInSimplifiedHelpView: true,
-            category: ts.Diagnostics.Strict_Type_Checking_Options,
-            description: ts.Diagnostics.Raise_error_on_this_expressions_with_an_implied_any_type,
+            category: ts.Diagnostics.Type_Checking,
+            description: ts.Diagnostics.Enable_error_reporting_when_this_is_given_the_type_any,
+            defaultValueDescription: ts.Diagnostics.false_unless_strict_is_set
+        },
+        {
+            name: "useUnknownInCatchVariables",
+            type: "boolean",
+            affectsSemanticDiagnostics: true,
+            strictFlag: true,
+            category: ts.Diagnostics.Type_Checking,
+            description: ts.Diagnostics.Type_catch_clause_variables_as_unknown_instead_of_any,
+            defaultValueDescription: "false",
         },
         {
             name: "alwaysStrict",
             type: "boolean",
             affectsSourceFile: true,
             strictFlag: true,
-            showInSimplifiedHelpView: true,
-            category: ts.Diagnostics.Strict_Type_Checking_Options,
-            description: ts.Diagnostics.Parse_in_strict_mode_and_emit_use_strict_for_each_source_file
+            category: ts.Diagnostics.Type_Checking,
+            description: ts.Diagnostics.Ensure_use_strict_is_always_emitted,
+            defaultValueDescription: ts.Diagnostics.false_unless_strict_is_set
         },
         // Additional Checks
         {
             name: "noUnusedLocals",
             type: "boolean",
             affectsSemanticDiagnostics: true,
-            showInSimplifiedHelpView: true,
-            category: ts.Diagnostics.Additional_Checks,
-            description: ts.Diagnostics.Report_errors_on_unused_locals,
+            category: ts.Diagnostics.Type_Checking,
+            description: ts.Diagnostics.Enable_error_reporting_when_a_local_variables_aren_t_read,
+            defaultValueDescription: "false"
         },
         {
             name: "noUnusedParameters",
             type: "boolean",
             affectsSemanticDiagnostics: true,
-            showInSimplifiedHelpView: true,
-            category: ts.Diagnostics.Additional_Checks,
-            description: ts.Diagnostics.Report_errors_on_unused_parameters,
+            category: ts.Diagnostics.Type_Checking,
+            description: ts.Diagnostics.Raise_an_error_when_a_function_parameter_isn_t_read,
+            defaultValueDescription: "false"
+        },
+        {
+            name: "exactOptionalPropertyTypes",
+            type: "boolean",
+            affectsSemanticDiagnostics: true,
+            category: ts.Diagnostics.Type_Checking,
+            description: ts.Diagnostics.Interpret_optional_property_types_as_written_rather_than_adding_undefined,
+            defaultValueDescription: "false",
         },
         {
             name: "noImplicitReturns",
             type: "boolean",
             affectsSemanticDiagnostics: true,
-            showInSimplifiedHelpView: true,
-            category: ts.Diagnostics.Additional_Checks,
-            description: ts.Diagnostics.Report_error_when_not_all_code_paths_in_function_return_a_value
+            category: ts.Diagnostics.Type_Checking,
+            description: ts.Diagnostics.Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function,
+            defaultValueDescription: "false"
         },
         {
             name: "noFallthroughCasesInSwitch",
             type: "boolean",
             affectsBindDiagnostics: true,
             affectsSemanticDiagnostics: true,
-            showInSimplifiedHelpView: true,
-            category: ts.Diagnostics.Additional_Checks,
-            description: ts.Diagnostics.Report_errors_for_fallthrough_cases_in_switch_statement
+            category: ts.Diagnostics.Type_Checking,
+            description: ts.Diagnostics.Enable_error_reporting_for_fallthrough_cases_in_switch_statements,
+            defaultValueDescription: "false",
         },
         {
             name: "noUncheckedIndexedAccess",
             type: "boolean",
             affectsSemanticDiagnostics: true,
-            showInSimplifiedHelpView: false,
-            category: ts.Diagnostics.Additional_Checks,
-            description: ts.Diagnostics.Include_undefined_in_index_signature_results
+            category: ts.Diagnostics.Type_Checking,
+            description: ts.Diagnostics.Include_undefined_in_index_signature_results,
+            defaultValueDescription: "false",
+        },
+        {
+            name: "noImplicitOverride",
+            type: "boolean",
+            affectsSemanticDiagnostics: true,
+            category: ts.Diagnostics.Type_Checking,
+            description: ts.Diagnostics.Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier,
+            defaultValueDescription: "false",
         },
         {
             name: "noPropertyAccessFromIndexSignature",
             type: "boolean",
             showInSimplifiedHelpView: false,
-            category: ts.Diagnostics.Additional_Checks,
-            description: ts.Diagnostics.Require_undeclared_properties_from_index_signatures_to_use_element_accesses
+            category: ts.Diagnostics.Type_Checking,
+            description: ts.Diagnostics.Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type,
+            defaultValueDescription: "false"
         },
         // Module Resolution
         {
@@ -36545,19 +38773,22 @@ var ts;
             type: new ts.Map(ts.getEntries({
                 node: ts.ModuleResolutionKind.NodeJs,
                 classic: ts.ModuleResolutionKind.Classic,
+                node12: ts.ModuleResolutionKind.Node12,
+                nodenext: ts.ModuleResolutionKind.NodeNext,
             })),
             affectsModuleResolution: true,
             paramType: ts.Diagnostics.STRATEGY,
-            category: ts.Diagnostics.Module_Resolution_Options,
-            description: ts.Diagnostics.Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6,
+            category: ts.Diagnostics.Modules,
+            description: ts.Diagnostics.Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier,
+            defaultValueDescription: ts.Diagnostics.module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node
         },
         {
             name: "baseUrl",
             type: "string",
             affectsModuleResolution: true,
             isFilePath: true,
-            category: ts.Diagnostics.Module_Resolution_Options,
-            description: ts.Diagnostics.Base_directory_to_resolve_non_absolute_module_names
+            category: ts.Diagnostics.Modules,
+            description: ts.Diagnostics.Specify_the_base_directory_to_resolve_non_relative_module_names
         },
         {
             // this option can only be specified in tsconfig.json
@@ -36566,8 +38797,8 @@ var ts;
             type: "object",
             affectsModuleResolution: true,
             isTSConfigOnly: true,
-            category: ts.Diagnostics.Module_Resolution_Options,
-            description: ts.Diagnostics.A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl,
+            category: ts.Diagnostics.Modules,
+            description: ts.Diagnostics.Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations,
             transpileOptionValue: undefined
         },
         {
@@ -36582,9 +38813,10 @@ var ts;
                 isFilePath: true
             },
             affectsModuleResolution: true,
-            category: ts.Diagnostics.Module_Resolution_Options,
-            description: ts.Diagnostics.List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime,
-            transpileOptionValue: undefined
+            category: ts.Diagnostics.Modules,
+            description: ts.Diagnostics.Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules,
+            transpileOptionValue: undefined,
+            defaultValueDescription: ts.Diagnostics.Computed_from_the_list_of_input_files
         },
         {
             name: "typeRoots",
@@ -36595,8 +38827,8 @@ var ts;
                 isFilePath: true
             },
             affectsModuleResolution: true,
-            category: ts.Diagnostics.Module_Resolution_Options,
-            description: ts.Diagnostics.List_of_folders_to_include_type_definitions_from
+            category: ts.Diagnostics.Modules,
+            description: ts.Diagnostics.Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types
         },
         {
             name: "types",
@@ -36605,18 +38837,19 @@ var ts;
                 name: "types",
                 type: "string"
             },
-            affectsModuleResolution: true,
+            affectsProgramStructure: true,
             showInSimplifiedHelpView: true,
-            category: ts.Diagnostics.Module_Resolution_Options,
-            description: ts.Diagnostics.Type_declaration_files_to_be_included_in_compilation,
+            category: ts.Diagnostics.Modules,
+            description: ts.Diagnostics.Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file,
             transpileOptionValue: undefined
         },
         {
             name: "allowSyntheticDefaultImports",
             type: "boolean",
             affectsSemanticDiagnostics: true,
-            category: ts.Diagnostics.Module_Resolution_Options,
-            description: ts.Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking
+            category: ts.Diagnostics.Interop_Constraints,
+            description: ts.Diagnostics.Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export,
+            defaultValueDescription: ts.Diagnostics.module_system_or_esModuleInterop
         },
         {
             name: "esModuleInterop",
@@ -36624,21 +38857,24 @@ var ts;
             affectsSemanticDiagnostics: true,
             affectsEmit: true,
             showInSimplifiedHelpView: true,
-            category: ts.Diagnostics.Module_Resolution_Options,
-            description: ts.Diagnostics.Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for_all_imports_Implies_allowSyntheticDefaultImports
+            category: ts.Diagnostics.Interop_Constraints,
+            description: ts.Diagnostics.Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheticDefaultImports_for_type_compatibility,
+            defaultValueDescription: "false"
         },
         {
             name: "preserveSymlinks",
             type: "boolean",
-            category: ts.Diagnostics.Module_Resolution_Options,
-            description: ts.Diagnostics.Do_not_resolve_the_real_path_of_symlinks,
+            category: ts.Diagnostics.Interop_Constraints,
+            description: ts.Diagnostics.Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node,
+            defaultValueDescription: "false",
         },
         {
             name: "allowUmdGlobalAccess",
             type: "boolean",
             affectsSemanticDiagnostics: true,
-            category: ts.Diagnostics.Module_Resolution_Options,
+            category: ts.Diagnostics.Modules,
             description: ts.Diagnostics.Allow_accessing_UMD_globals_from_modules,
+            defaultValueDescription: "false"
         },
         // Source Maps
         {
@@ -36646,59 +38882,64 @@ var ts;
             type: "string",
             affectsEmit: true,
             paramType: ts.Diagnostics.LOCATION,
-            category: ts.Diagnostics.Source_Map_Options,
-            description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations,
+            category: ts.Diagnostics.Emit,
+            description: ts.Diagnostics.Specify_the_root_path_for_debuggers_to_find_the_reference_source_code,
         },
         {
             name: "mapRoot",
             type: "string",
             affectsEmit: true,
             paramType: ts.Diagnostics.LOCATION,
-            category: ts.Diagnostics.Source_Map_Options,
+            category: ts.Diagnostics.Emit,
             description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations,
         },
         {
             name: "inlineSourceMap",
             type: "boolean",
             affectsEmit: true,
-            category: ts.Diagnostics.Source_Map_Options,
-            description: ts.Diagnostics.Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file
+            category: ts.Diagnostics.Emit,
+            description: ts.Diagnostics.Include_sourcemap_files_inside_the_emitted_JavaScript,
+            defaultValueDescription: "false"
         },
         {
             name: "inlineSources",
             type: "boolean",
             affectsEmit: true,
-            category: ts.Diagnostics.Source_Map_Options,
-            description: ts.Diagnostics.Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set
+            category: ts.Diagnostics.Emit,
+            description: ts.Diagnostics.Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript,
+            defaultValueDescription: "false"
         },
         // Experimental
         {
             name: "experimentalDecorators",
             type: "boolean",
             affectsSemanticDiagnostics: true,
-            category: ts.Diagnostics.Experimental_Options,
-            description: ts.Diagnostics.Enables_experimental_support_for_ES7_decorators
+            category: ts.Diagnostics.Language_and_Environment,
+            description: ts.Diagnostics.Enable_experimental_support_for_TC39_stage_2_draft_decorators,
+            defaultValueDescription: "false",
         },
         {
             name: "emitDecoratorMetadata",
             type: "boolean",
             affectsSemanticDiagnostics: true,
             affectsEmit: true,
-            category: ts.Diagnostics.Experimental_Options,
-            description: ts.Diagnostics.Enables_experimental_support_for_emitting_type_metadata_for_decorators
+            category: ts.Diagnostics.Language_and_Environment,
+            description: ts.Diagnostics.Emit_design_type_metadata_for_decorated_declarations_in_source_files,
+            defaultValueDescription: "false",
         },
         // Advanced
         {
             name: "jsxFactory",
             type: "string",
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h
+            category: ts.Diagnostics.Language_and_Environment,
+            description: ts.Diagnostics.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: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.Specify_the_JSX_fragment_factory_function_to_use_when_targeting_react_JSX_emit_with_jsxFactory_compiler_option_is_specified_e_g_Fragment
+            category: ts.Diagnostics.Language_and_Environment,
+            description: ts.Diagnostics.Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragment_or_Fragment
         },
         {
             name: "jsxImportSource",
@@ -36706,15 +38947,17 @@ var ts;
             affectsSemanticDiagnostics: true,
             affectsEmit: true,
             affectsModuleResolution: true,
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react
+            category: ts.Diagnostics.Language_and_Environment,
+            description: ts.Diagnostics.Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk,
+            defaultValueDescription: "react"
         },
         {
             name: "resolveJsonModule",
             type: "boolean",
             affectsModuleResolution: true,
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.Include_modules_imported_with_json_extension
+            category: ts.Diagnostics.Modules,
+            description: ts.Diagnostics.Enable_importing_json_files,
+            defaultValueDescription: "false"
         },
         {
             name: "out",
@@ -36722,36 +38965,40 @@ var ts;
             affectsEmit: true,
             isFilePath: false,
             // for correct behaviour, please use outFile
-            category: ts.Diagnostics.Advanced_Options,
+            category: ts.Diagnostics.Backwards_Compatibility,
             paramType: ts.Diagnostics.FILE,
-            description: ts.Diagnostics.Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file,
-            transpileOptionValue: undefined
+            transpileOptionValue: undefined,
+            description: ts.Diagnostics.Deprecated_setting_Use_outFile_instead,
         },
         {
             name: "reactNamespace",
             type: "string",
             affectsEmit: true,
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit
+            category: ts.Diagnostics.Language_and_Environment,
+            description: ts.Diagnostics.Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit,
+            defaultValueDescription: "`React`",
         },
         {
             name: "skipDefaultLibCheck",
             type: "boolean",
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files
+            category: ts.Diagnostics.Completeness,
+            description: ts.Diagnostics.Skip_type_checking_d_ts_files_that_are_included_with_TypeScript,
+            defaultValueDescription: "false",
         },
         {
             name: "charset",
             type: "string",
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.The_character_set_of_the_input_files
+            category: ts.Diagnostics.Backwards_Compatibility,
+            description: ts.Diagnostics.No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files,
+            defaultValueDescription: "utf8"
         },
         {
             name: "emitBOM",
             type: "boolean",
             affectsEmit: true,
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files
+            category: ts.Diagnostics.Emit,
+            description: ts.Diagnostics.Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files,
+            defaultValueDescription: "false"
         },
         {
             name: "newLine",
@@ -36761,99 +39008,112 @@ var ts;
             })),
             affectsEmit: true,
             paramType: ts.Diagnostics.NEWLINE,
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix,
+            category: ts.Diagnostics.Emit,
+            description: ts.Diagnostics.Set_the_newline_character_for_emitting_files,
+            defaultValueDescription: ts.Diagnostics.Platform_specific
         },
         {
             name: "noErrorTruncation",
             type: "boolean",
             affectsSemanticDiagnostics: true,
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.Do_not_truncate_error_messages
+            category: ts.Diagnostics.Output_Formatting,
+            description: ts.Diagnostics.Disable_truncating_types_in_error_messages,
+            defaultValueDescription: "false"
         },
         {
             name: "noLib",
             type: "boolean",
-            affectsModuleResolution: true,
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.Do_not_include_the_default_library_file_lib_d_ts,
+            category: ts.Diagnostics.Language_and_Environment,
+            affectsProgramStructure: true,
+            description: ts.Diagnostics.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: true
+            transpileOptionValue: true,
+            defaultValueDescription: "false"
         },
         {
             name: "noResolve",
             type: "boolean",
             affectsModuleResolution: true,
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files,
+            category: ts.Diagnostics.Modules,
+            description: ts.Diagnostics.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: true
+            transpileOptionValue: true,
+            defaultValueDescription: "false"
         },
         {
             name: "stripInternal",
             type: "boolean",
             affectsEmit: true,
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.Do_not_emit_declarations_for_code_that_has_an_internal_annotation,
+            category: ts.Diagnostics.Emit,
+            description: ts.Diagnostics.Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments,
+            defaultValueDescription: "false",
         },
         {
             name: "disableSizeLimit",
             type: "boolean",
-            affectsSourceFile: true,
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.Disable_size_limitations_on_JavaScript_projects
+            affectsProgramStructure: true,
+            category: ts.Diagnostics.Editor_Support,
+            description: ts.Diagnostics.Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server,
+            defaultValueDescription: "false"
         },
         {
             name: "disableSourceOfProjectReferenceRedirect",
             type: "boolean",
             isTSConfigOnly: true,
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.Disable_use_of_source_files_instead_of_declaration_files_from_referenced_projects
+            category: ts.Diagnostics.Projects,
+            description: ts.Diagnostics.Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects,
+            defaultValueDescription: "false",
         },
         {
             name: "disableSolutionSearching",
             type: "boolean",
             isTSConfigOnly: true,
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.Disable_solution_searching_for_this_project
+            category: ts.Diagnostics.Projects,
+            description: ts.Diagnostics.Opt_a_project_out_of_multi_project_reference_checking_when_editing,
+            defaultValueDescription: "false",
         },
         {
             name: "disableReferencedProjectLoad",
             type: "boolean",
             isTSConfigOnly: true,
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.Disable_loading_referenced_projects
+            category: ts.Diagnostics.Projects,
+            description: ts.Diagnostics.Reduce_the_number_of_projects_loaded_automatically_by_TypeScript,
+            defaultValueDescription: "false",
         },
         {
             name: "noImplicitUseStrict",
             type: "boolean",
             affectsSemanticDiagnostics: true,
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.Do_not_emit_use_strict_directives_in_module_output
+            category: ts.Diagnostics.Backwards_Compatibility,
+            description: ts.Diagnostics.Disable_adding_use_strict_directives_in_emitted_JavaScript_files,
+            defaultValueDescription: "false"
         },
         {
             name: "noEmitHelpers",
             type: "boolean",
             affectsEmit: true,
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.Do_not_generate_custom_helper_functions_like_extends_in_compiled_output
+            category: ts.Diagnostics.Emit,
+            description: ts.Diagnostics.Disable_generating_custom_helper_functions_like_extends_in_compiled_output,
+            defaultValueDescription: "false"
         },
         {
             name: "noEmitOnError",
             type: "boolean",
             affectsEmit: true,
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.Do_not_emit_outputs_if_any_errors_were_reported,
-            transpileOptionValue: undefined
+            category: ts.Diagnostics.Emit,
+            transpileOptionValue: undefined,
+            description: ts.Diagnostics.Disable_emitting_files_if_any_type_checking_errors_are_reported,
+            defaultValueDescription: "false"
         },
         {
             name: "preserveConstEnums",
             type: "boolean",
             affectsEmit: true,
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.Do_not_erase_const_enum_declarations_in_generated_code
+            category: ts.Diagnostics.Emit,
+            description: ts.Diagnostics.Disable_erasing_const_enum_declarations_in_generated_code,
+            defaultValueDescription: "false",
         },
         {
             name: "declarationDir",
@@ -36861,80 +39121,98 @@ var ts;
             affectsEmit: true,
             isFilePath: true,
             paramType: ts.Diagnostics.DIRECTORY,
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.Output_directory_for_generated_declaration_files,
-            transpileOptionValue: undefined
+            category: ts.Diagnostics.Emit,
+            transpileOptionValue: undefined,
+            description: ts.Diagnostics.Specify_the_output_directory_for_generated_declaration_files,
         },
         {
             name: "skipLibCheck",
             type: "boolean",
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.Skip_type_checking_of_declaration_files,
+            category: ts.Diagnostics.Completeness,
+            description: ts.Diagnostics.Skip_type_checking_all_d_ts_files,
+            defaultValueDescription: "false"
         },
         {
             name: "allowUnusedLabels",
             type: "boolean",
             affectsBindDiagnostics: true,
             affectsSemanticDiagnostics: true,
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.Do_not_report_errors_on_unused_labels
+            category: ts.Diagnostics.Type_Checking,
+            description: ts.Diagnostics.Disable_error_reporting_for_unused_labels,
+            defaultValueDescription: "undefined"
         },
         {
             name: "allowUnreachableCode",
             type: "boolean",
             affectsBindDiagnostics: true,
             affectsSemanticDiagnostics: true,
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.Do_not_report_errors_on_unreachable_code
+            category: ts.Diagnostics.Type_Checking,
+            description: ts.Diagnostics.Disable_error_reporting_for_unreachable_code,
+            defaultValueDescription: "undefined"
         },
         {
             name: "suppressExcessPropertyErrors",
             type: "boolean",
             affectsSemanticDiagnostics: true,
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.Suppress_excess_property_checks_for_object_literals,
+            category: ts.Diagnostics.Backwards_Compatibility,
+            description: ts.Diagnostics.Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals,
+            defaultValueDescription: "false"
         },
         {
             name: "suppressImplicitAnyIndexErrors",
             type: "boolean",
             affectsSemanticDiagnostics: true,
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures,
+            category: ts.Diagnostics.Backwards_Compatibility,
+            description: ts.Diagnostics.Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures,
+            defaultValueDescription: "false"
         },
         {
             name: "forceConsistentCasingInFileNames",
             type: "boolean",
             affectsModuleResolution: true,
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.Disallow_inconsistently_cased_references_to_the_same_file
+            category: ts.Diagnostics.Interop_Constraints,
+            description: ts.Diagnostics.Ensure_that_casing_is_correct_in_imports,
+            defaultValueDescription: "false"
         },
         {
             name: "maxNodeModuleJsDepth",
             type: "number",
             affectsModuleResolution: true,
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files
+            category: ts.Diagnostics.JavaScript_Support,
+            description: ts.Diagnostics.Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicable_with_allowJs,
+            defaultValueDescription: "0"
         },
         {
             name: "noStrictGenericChecks",
             type: "boolean",
             affectsSemanticDiagnostics: true,
-            category: ts.Diagnostics.Advanced_Options,
+            category: ts.Diagnostics.Backwards_Compatibility,
             description: ts.Diagnostics.Disable_strict_checking_of_generic_signatures_in_function_types,
+            defaultValueDescription: "false"
         },
         {
             name: "useDefineForClassFields",
             type: "boolean",
             affectsSemanticDiagnostics: true,
             affectsEmit: true,
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.Emit_class_fields_with_Define_instead_of_Set,
+            category: ts.Diagnostics.Language_and_Environment,
+            description: ts.Diagnostics.Emit_ECMAScript_standard_compliant_class_fields,
+            defaultValueDescription: ts.Diagnostics.true_for_ES2022_and_above_including_ESNext
+        },
+        {
+            name: "preserveValueImports",
+            type: "boolean",
+            affectsEmit: true,
+            category: ts.Diagnostics.Emit,
+            description: ts.Diagnostics.Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed,
+            defaultValueDescription: "false",
         },
         {
             name: "keyofStringsOnly",
             type: "boolean",
-            category: ts.Diagnostics.Advanced_Options,
-            description: ts.Diagnostics.Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols,
+            category: ts.Diagnostics.Backwards_Compatibility,
+            description: ts.Diagnostics.Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option,
+            defaultValueDescription: "false"
         },
         {
             // A list of plugins to load in the language service
@@ -36945,9 +39223,12 @@ var ts;
                 name: "plugin",
                 type: "object"
             },
-            description: ts.Diagnostics.List_of_language_service_plugins
+            description: ts.Diagnostics.List_of_language_service_plugins,
+            category: ts.Diagnostics.Editor_Support,
         },
-    ]);
+    ];
+    /* @internal */
+    ts.optionDeclarations = __spreadArray(__spreadArray([], ts.commonOptionsWithBuild, true), commandOptionsWithoutBuild, true);
     /* @internal */
     ts.semanticDiagnosticsOptionDeclarations = ts.optionDeclarations.filter(function (option) { return !!option.affectsSemanticDiagnostics; });
     /* @internal */
@@ -36959,39 +39240,48 @@ var ts;
         return !!option.affectsSourceFile || !!option.affectsModuleResolution || !!option.affectsBindDiagnostics;
     });
     /* @internal */
+    ts.optionsAffectingProgramStructure = ts.optionDeclarations.filter(function (option) { return !!option.affectsProgramStructure; });
+    /* @internal */
     ts.transpileOptionValueCompilerOptions = ts.optionDeclarations.filter(function (option) {
         return ts.hasProperty(option, "transpileOptionValue");
     });
+    // Build related options
     /* @internal */
-    ts.buildOpts = __spreadArray(__spreadArray([], ts.commonOptionsWithBuild), [
+    ts.optionsForBuild = [
         {
             name: "verbose",
             shortName: "v",
             category: ts.Diagnostics.Command_line_Options,
             description: ts.Diagnostics.Enable_verbose_logging,
-            type: "boolean"
+            type: "boolean",
+            defaultValueDescription: "false",
         },
         {
             name: "dry",
             shortName: "d",
             category: ts.Diagnostics.Command_line_Options,
             description: ts.Diagnostics.Show_what_would_be_built_or_deleted_if_specified_with_clean,
-            type: "boolean"
+            type: "boolean",
+            defaultValueDescription: "false",
         },
         {
             name: "force",
             shortName: "f",
             category: ts.Diagnostics.Command_line_Options,
             description: ts.Diagnostics.Build_all_projects_including_those_that_appear_to_be_up_to_date,
-            type: "boolean"
+            type: "boolean",
+            defaultValueDescription: "false",
         },
         {
             name: "clean",
             category: ts.Diagnostics.Command_line_Options,
             description: ts.Diagnostics.Delete_the_outputs_of_all_projects,
-            type: "boolean"
+            type: "boolean",
+            defaultValueDescription: "false",
         }
-    ]);
+    ];
+    /* @internal */
+    ts.buildOpts = __spreadArray(__spreadArray([], ts.commonOptionsWithBuild, true), ts.optionsForBuild, true);
     /* @internal */
     ts.typeAcquisitionDeclarations = [
         {
@@ -37000,10 +39290,12 @@ var ts;
              */
             name: "enableAutoDiscovery",
             type: "boolean",
+            defaultValueDescription: "false",
         },
         {
             name: "enable",
             type: "boolean",
+            defaultValueDescription: "false",
         },
         {
             name: "include",
@@ -37024,6 +39316,7 @@ var ts;
         {
             name: "disableFilenameBasedTypeAcquisition",
             type: "boolean",
+            defaultValueDescription: "false",
         },
     ];
     /*@internal*/
@@ -37045,10 +39338,14 @@ var ts;
         return optionsNameMapCache || (optionsNameMapCache = createOptionNameMap(ts.optionDeclarations));
     }
     ts.getOptionsNameMap = getOptionsNameMap;
+    var compilerOptionsAlternateMode = {
+        diagnostic: ts.Diagnostics.Compiler_option_0_may_only_be_used_with_build,
+        getOptionsNameMap: getBuildOptionsNameMap
+    };
     /* @internal */
     ts.defaultInitCompilerOptions = {
         module: ts.ModuleKind.CommonJS,
-        target: 1 /* ES5 */,
+        target: 3 /* ES2016 */,
         strict: true,
         esModuleInterop: true,
         forceConsistentCasingInFileNames: true,
@@ -37073,18 +39370,18 @@ var ts;
     }
     ts.createCompilerDiagnosticForInvalidCustomType = createCompilerDiagnosticForInvalidCustomType;
     function createDiagnosticForInvalidCustomType(opt, createDiagnostic) {
-        var namesOfType = ts.arrayFrom(opt.type.keys()).map(function (key) { return "'" + key + "'"; }).join(", ");
-        return createDiagnostic(ts.Diagnostics.Argument_for_0_option_must_be_Colon_1, "--" + opt.name, namesOfType);
+        var namesOfType = ts.arrayFrom(opt.type.keys()).map(function (key) { return "'".concat(key, "'"); }).join(", ");
+        return createDiagnostic(ts.Diagnostics.Argument_for_0_option_must_be_Colon_1, "--".concat(opt.name), namesOfType);
     }
     /* @internal */
     function parseCustomTypeOption(opt, value, errors) {
-        return convertJsonOptionOfCustomType(opt, trimString(value || ""), errors);
+        return convertJsonOptionOfCustomType(opt, ts.trimString(value || ""), errors);
     }
     ts.parseCustomTypeOption = parseCustomTypeOption;
     /* @internal */
     function parseListTypeOption(opt, value, errors) {
         if (value === void 0) { value = ""; }
-        value = trimString(value);
+        value = ts.trimString(value);
         if (ts.startsWith(value, "-")) {
             return undefined;
         }
@@ -37106,6 +39403,10 @@ var ts;
         return option.name;
     }
     function createUnknownOptionError(unknownOption, diagnostics, createDiagnostics, unknownOptionErrorText) {
+        var _a;
+        if ((_a = diagnostics.alternateMode) === null || _a === void 0 ? void 0 : _a.getOptionsNameMap().optionsNameMap.has(unknownOption.toLowerCase())) {
+            return createDiagnostics(diagnostics.alternateMode.diagnostic, unknownOption);
+        }
         var possibleOption = ts.getSpellingSuggestion(unknownOption, diagnostics.optionDeclarations, getOptionName);
         return possibleOption ?
             createDiagnostics(diagnostics.unknownDidYouMeanDiagnostic, unknownOptionErrorText || unknownOption, possibleOption.name) :
@@ -37260,6 +39561,7 @@ var ts;
     }
     /*@internal*/
     ts.compilerOptionsDidYouMeanDiagnostics = {
+        alternateMode: compilerOptionsAlternateMode,
         getOptionsNameMap: getOptionsNameMap,
         optionDeclarations: ts.optionDeclarations,
         unknownOptionDiagnostic: ts.Diagnostics.Unknown_compiler_option_0,
@@ -37292,7 +39594,12 @@ var ts;
     function getBuildOptionsNameMap() {
         return buildOptionsNameMapCache || (buildOptionsNameMapCache = createOptionNameMap(ts.buildOpts));
     }
+    var buildOptionsAlternateMode = {
+        diagnostic: ts.Diagnostics.Compiler_option_0_may_not_be_used_with_build,
+        getOptionsNameMap: getOptionsNameMap
+    };
     var buildOptionsDidYouMeanDiagnostics = {
+        alternateMode: buildOptionsAlternateMode,
         getOptionsNameMap: getBuildOptionsNameMap,
         optionDeclarations: ts.buildOpts,
         unknownOptionDiagnostic: ts.Diagnostics.Unknown_build_option_0,
@@ -37368,7 +39675,7 @@ var ts;
     function parseConfigFileTextToJson(fileName, jsonText) {
         var jsonSourceFile = ts.parseJsonText(fileName, jsonText);
         return {
-            config: convertToObject(jsonSourceFile, jsonSourceFile.parseDiagnostics),
+            config: convertConfigFileToObject(jsonSourceFile, jsonSourceFile.parseDiagnostics, /*reportOptionsErrors*/ false, /*optionsIterator*/ undefined),
             error: jsonSourceFile.parseDiagnostics.length ? jsonSourceFile.parseDiagnostics[0] : undefined
         };
     }
@@ -37458,7 +39765,8 @@ var ts;
                     },
                     {
                         name: "extends",
-                        type: "string"
+                        type: "string",
+                        category: ts.Diagnostics.File_Management,
                     },
                     {
                         name: "references",
@@ -37466,7 +39774,8 @@ var ts;
                         element: {
                             name: "references",
                             type: "object"
-                        }
+                        },
+                        category: ts.Diagnostics.Projects,
                     },
                     {
                         name: "files",
@@ -37474,7 +39783,8 @@ var ts;
                         element: {
                             name: "files",
                             type: "string"
-                        }
+                        },
+                        category: ts.Diagnostics.File_Management,
                     },
                     {
                         name: "include",
@@ -37482,7 +39792,9 @@ var ts;
                         element: {
                             name: "include",
                             type: "string"
-                        }
+                        },
+                        category: ts.Diagnostics.File_Management,
+                        defaultValueDescription: ts.Diagnostics.if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk
                     },
                     {
                         name: "exclude",
@@ -37490,7 +39802,9 @@ var ts;
                         element: {
                             name: "exclude",
                             type: "string"
-                        }
+                        },
+                        category: ts.Diagnostics.File_Management,
+                        defaultValueDescription: ts.Diagnostics.node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified
                     },
                     ts.compileOnSaveCommandLineOption
                 ])
@@ -37498,11 +39812,31 @@ var ts;
         }
         return _tsconfigRootOptions;
     }
+    function convertConfigFileToObject(sourceFile, errors, reportOptionsErrors, optionsIterator) {
+        var _a;
+        var rootExpression = (_a = sourceFile.statements[0]) === null || _a === void 0 ? void 0 : _a.expression;
+        var knownRootOptions = reportOptionsErrors ? getTsconfigRootOptionsMap() : undefined;
+        if (rootExpression && rootExpression.kind !== 204 /* ObjectLiteralExpression */) {
+            errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, rootExpression, ts.Diagnostics.The_root_value_of_a_0_file_must_be_an_object, ts.getBaseFileName(sourceFile.fileName) === "jsconfig.json" ? "jsconfig.json" : "tsconfig.json"));
+            // Last-ditch error recovery. Somewhat useful because the JSON parser will recover from some parse errors by
+            // synthesizing a top-level array literal expression. There's a reasonable chance the first element of that
+            // array is a well-formed configuration object, made into an array element by stray characters.
+            if (ts.isArrayLiteralExpression(rootExpression)) {
+                var firstObject = ts.find(rootExpression.elements, ts.isObjectLiteralExpression);
+                if (firstObject) {
+                    return convertToObjectWorker(sourceFile, firstObject, errors, /*returnValue*/ true, knownRootOptions, optionsIterator);
+                }
+            }
+            return {};
+        }
+        return convertToObjectWorker(sourceFile, rootExpression, errors, /*returnValue*/ true, knownRootOptions, optionsIterator);
+    }
     /**
      * Convert the json syntax tree into the json value
      */
     function convertToObject(sourceFile, errors) {
-        return convertToObjectWorker(sourceFile, errors, /*returnValue*/ true, /*knownRootOptions*/ undefined, /*jsonConversionNotifier*/ undefined);
+        var _a;
+        return convertToObjectWorker(sourceFile, (_a = sourceFile.statements[0]) === null || _a === void 0 ? void 0 : _a.expression, errors, /*returnValue*/ true, /*knownRootOptions*/ undefined, /*jsonConversionNotifier*/ undefined);
     }
     ts.convertToObject = convertToObject;
     /**
@@ -37511,18 +39845,18 @@ var ts;
      * Otherwise it just checks the errors and returns undefined
      */
     /*@internal*/
-    function convertToObjectWorker(sourceFile, errors, returnValue, knownRootOptions, jsonConversionNotifier) {
-        if (!sourceFile.statements.length) {
+    function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue, knownRootOptions, jsonConversionNotifier) {
+        if (!rootExpression) {
             return returnValue ? {} : undefined;
         }
-        return convertPropertyValueToJson(sourceFile.statements[0].expression, knownRootOptions);
+        return convertPropertyValueToJson(rootExpression, knownRootOptions);
         function isRootOptionMap(knownOptions) {
             return knownRootOptions && knownRootOptions.elementOptions === knownOptions;
         }
         function convertObjectLiteralExpressionToJson(node, knownOptions, extraKeyDiagnostics, parentOption) {
             var result = returnValue ? {} : undefined;
             var _loop_4 = function (element) {
-                if (element.kind !== 288 /* PropertyAssignment */) {
+                if (element.kind !== 294 /* PropertyAssignment */) {
                     errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, element, ts.Diagnostics.Property_assignment_expected));
                     return "continue";
                 }
@@ -37589,13 +39923,13 @@ var ts;
         function convertPropertyValueToJson(valueExpression, option) {
             var invalidReported;
             switch (valueExpression.kind) {
-                case 109 /* TrueKeyword */:
+                case 110 /* TrueKeyword */:
                     reportInvalidOptionValue(option && option.type !== "boolean");
                     return validateValue(/*value*/ true);
-                case 94 /* FalseKeyword */:
+                case 95 /* FalseKeyword */:
                     reportInvalidOptionValue(option && option.type !== "boolean");
                     return validateValue(/*value*/ false);
-                case 103 /* NullKeyword */:
+                case 104 /* NullKeyword */:
                     reportInvalidOptionValue(option && option.name === "extends"); // "extends" is the only option we don't allow null/undefined for
                     return validateValue(/*value*/ null); // eslint-disable-line no-null/no-null
                 case 10 /* StringLiteral */:
@@ -37616,13 +39950,13 @@ var ts;
                 case 8 /* NumericLiteral */:
                     reportInvalidOptionValue(option && option.type !== "number");
                     return validateValue(Number(valueExpression.text));
-                case 214 /* PrefixUnaryExpression */:
+                case 218 /* PrefixUnaryExpression */:
                     if (valueExpression.operator !== 40 /* MinusToken */ || valueExpression.operand.kind !== 8 /* NumericLiteral */) {
                         break; // not valid JSON syntax
                     }
                     reportInvalidOptionValue(option && option.type !== "number");
                     return validateValue(-Number(valueExpression.operand.text));
-                case 200 /* ObjectLiteralExpression */:
+                case 204 /* ObjectLiteralExpression */:
                     reportInvalidOptionValue(option && option.type !== "object");
                     var objectLiteralExpression = valueExpression;
                     // Currently having element option declaration in the tsconfig with type "object"
@@ -37639,7 +39973,7 @@ var ts;
                         return validateValue(convertObjectLiteralExpressionToJson(objectLiteralExpression, /* knownOptions*/ undefined, 
                         /*extraKeyDiagnosticMessage */ undefined, /*parentOption*/ undefined));
                     }
-                case 199 /* ArrayLiteralExpression */:
+                case 203 /* ArrayLiteralExpression */:
                     reportInvalidOptionValue(option && option.type !== "list");
                     return validateValue(convertArrayLiteralExpressionToJson(valueExpression.elements, option && option.element));
             }
@@ -37656,7 +39990,7 @@ var ts;
                 if (!invalidReported) {
                     var diagnostic = (_a = option === null || option === void 0 ? void 0 : option.extraValidation) === null || _a === void 0 ? void 0 : _a.call(option, value);
                     if (diagnostic) {
-                        errors.push(ts.createDiagnosticForNodeInSourceFile.apply(void 0, __spreadArray([sourceFile, valueExpression], diagnostic)));
+                        errors.push(ts.createDiagnosticForNodeInSourceFile.apply(void 0, __spreadArray([sourceFile, valueExpression], diagnostic, false)));
                         return undefined;
                     }
                 }
@@ -37777,7 +40111,7 @@ var ts;
             if (ts.hasProperty(options, name)) {
                 // tsconfig only options cannot be specified via command line,
                 // so we can assume that only types that can appear here string | number | boolean
-                if (optionsNameMap.has(name) && optionsNameMap.get(name).category === ts.Diagnostics.Command_line_Options) {
+                if (optionsNameMap.has(name) && (optionsNameMap.get(name).category === ts.Diagnostics.Command_line_Options || optionsNameMap.get(name).category === ts.Diagnostics.Output_Formatting)) {
                     return "continue";
                 }
                 var value = options[name];
@@ -37811,6 +40145,44 @@ var ts;
         }
         return result;
     }
+    /**
+     * Generate a list of the compiler options whose value is not the default.
+     * @param options compilerOptions to be evaluated.
+    /** @internal */
+    function getCompilerOptionsDiffValue(options, newLine) {
+        var compilerOptionsMap = getSerializedCompilerOption(options);
+        return getOverwrittenDefaultOptions();
+        function makePadding(paddingLength) {
+            return Array(paddingLength + 1).join(" ");
+        }
+        function getOverwrittenDefaultOptions() {
+            var result = [];
+            var tab = makePadding(2);
+            commandOptionsWithoutBuild.forEach(function (cmd) {
+                if (!compilerOptionsMap.has(cmd.name)) {
+                    return;
+                }
+                var newValue = compilerOptionsMap.get(cmd.name);
+                var defaultValue = getDefaultValueForOption(cmd);
+                if (newValue !== defaultValue) {
+                    result.push("".concat(tab).concat(cmd.name, ": ").concat(newValue));
+                }
+                else if (ts.hasProperty(ts.defaultInitCompilerOptions, cmd.name)) {
+                    result.push("".concat(tab).concat(cmd.name, ": ").concat(defaultValue));
+                }
+            });
+            return result.join(newLine) + newLine;
+        }
+    }
+    ts.getCompilerOptionsDiffValue = getCompilerOptionsDiffValue;
+    /**
+     * Get the compiler options to be written into the tsconfig.json.
+     * @param options commandlineOptions to be included in the compileOptions.
+     */
+    function getSerializedCompilerOption(options) {
+        var compilerOptions = ts.extend(options, ts.defaultInitCompilerOptions);
+        return serializeCompilerOptions(compilerOptions);
+    }
     /**
      * Generate tsconfig configuration when running command line "--init"
      * @param options commandlineOptions to be generated into tsconfig.json
@@ -37818,38 +40190,16 @@ var ts;
      */
     /* @internal */
     function generateTSConfig(options, fileNames, newLine) {
-        var compilerOptions = ts.extend(options, ts.defaultInitCompilerOptions);
-        var compilerOptionsMap = serializeCompilerOptions(compilerOptions);
+        var compilerOptionsMap = getSerializedCompilerOption(options);
         return writeConfigurations();
-        function getDefaultValueForOption(option) {
-            switch (option.type) {
-                case "number":
-                    return 1;
-                case "boolean":
-                    return true;
-                case "string":
-                    return option.isFilePath ? "./" : "";
-                case "list":
-                    return [];
-                case "object":
-                    return {};
-                default:
-                    var iterResult = option.type.keys().next();
-                    if (!iterResult.done)
-                        return iterResult.value;
-                    return ts.Debug.fail("Expected 'option.type' to have entries.");
-            }
-        }
         function makePadding(paddingLength) {
             return Array(paddingLength + 1).join(" ");
         }
-        function isAllowedOption(_a) {
-            var category = _a.category, name = _a.name;
-            // Skip options which do not have a category or have category `Command_line_Options`
-            // Exclude all possible `Advanced_Options` in tsconfig.json which were NOT defined in command line
-            return category !== undefined
-                && category !== ts.Diagnostics.Command_line_Options
-                && (category !== ts.Diagnostics.Advanced_Options || compilerOptionsMap.has(name));
+        function isAllowedOptionForOutput(_a) {
+            var category = _a.category, name = _a.name, isCommandLineOnly = _a.isCommandLineOnly;
+            // Skip options which do not have a category or have categories which are more niche
+            var categoriesToSkip = [ts.Diagnostics.Command_line_Options, ts.Diagnostics.Editor_Support, ts.Diagnostics.Compiler_Diagnostics, ts.Diagnostics.Backwards_Compatibility, ts.Diagnostics.Watch_and_Build_Modes, ts.Diagnostics.Output_Formatting];
+            return !isCommandLineOnly && category !== undefined && (!categoriesToSkip.includes(category) || compilerOptionsMap.has(name));
         }
         function writeConfigurations() {
             // Filter applicable options to place in the file
@@ -37857,7 +40207,7 @@ var ts;
             for (var _i = 0, optionDeclarations_1 = ts.optionDeclarations; _i < optionDeclarations_1.length; _i++) {
                 var option = optionDeclarations_1[_i];
                 var category = option.category;
-                if (isAllowedOption(option)) {
+                if (isAllowedOptionForOutput(option)) {
                     categorizedOptions.add(ts.getLocaleSpecificMessage(category), option);
                 }
             }
@@ -37869,19 +40219,19 @@ var ts;
                 if (entries.length !== 0) {
                     entries.push({ value: "" });
                 }
-                entries.push({ value: "/* " + category + " */" });
+                entries.push({ value: "/* ".concat(category, " */") });
                 for (var _i = 0, options_1 = options; _i < options_1.length; _i++) {
                     var option = options_1[_i];
                     var optionName = void 0;
                     if (compilerOptionsMap.has(option.name)) {
-                        optionName = "\"" + option.name + "\": " + JSON.stringify(compilerOptionsMap.get(option.name)) + ((seenKnownKeys += 1) === compilerOptionsMap.size ? "" : ",");
+                        optionName = "\"".concat(option.name, "\": ").concat(JSON.stringify(compilerOptionsMap.get(option.name))).concat((seenKnownKeys += 1) === compilerOptionsMap.size ? "" : ",");
                     }
                     else {
-                        optionName = "// \"" + option.name + "\": " + JSON.stringify(getDefaultValueForOption(option)) + ",";
+                        optionName = "// \"".concat(option.name, "\": ").concat(JSON.stringify(getDefaultValueForOption(option)), ",");
                     }
                     entries.push({
                         value: optionName,
-                        description: "/* " + (option.description && ts.getLocaleSpecificMessage(option.description) || option.name) + " */"
+                        description: "/* ".concat(option.description && ts.getLocaleSpecificMessage(option.description) || option.name, " */")
                     });
                     marginLength = Math.max(optionName.length, marginLength);
                 }
@@ -37890,25 +40240,25 @@ var ts;
             var tab = makePadding(2);
             var result = [];
             result.push("{");
-            result.push(tab + "\"compilerOptions\": {");
-            result.push("" + tab + tab + "/* " + ts.getLocaleSpecificMessage(ts.Diagnostics.Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_json_to_read_more_about_this_file) + " */");
+            result.push("".concat(tab, "\"compilerOptions\": {"));
+            result.push("".concat(tab).concat(tab, "/* ").concat(ts.getLocaleSpecificMessage(ts.Diagnostics.Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_json_to_read_more_about_this_file), " */"));
             result.push("");
             // Print out each row, aligning all the descriptions on the same column.
             for (var _a = 0, entries_2 = entries; _a < entries_2.length; _a++) {
                 var entry = entries_2[_a];
                 var value = entry.value, _b = entry.description, description = _b === void 0 ? "" : _b;
-                result.push(value && "" + tab + tab + value + (description && (makePadding(marginLength - value.length + 2) + description)));
+                result.push(value && "".concat(tab).concat(tab).concat(value).concat(description && (makePadding(marginLength - value.length + 2) + description)));
             }
             if (fileNames.length) {
-                result.push(tab + "},");
-                result.push(tab + "\"files\": [");
+                result.push("".concat(tab, "},"));
+                result.push("".concat(tab, "\"files\": ["));
                 for (var i = 0; i < fileNames.length; i++) {
-                    result.push("" + tab + tab + JSON.stringify(fileNames[i]) + (i === fileNames.length - 1 ? "" : ","));
+                    result.push("".concat(tab).concat(tab).concat(JSON.stringify(fileNames[i])).concat(i === fileNames.length - 1 ? "" : ","));
                 }
-                result.push(tab + "]");
+                result.push("".concat(tab, "]"));
             }
             else {
-                result.push(tab + "}");
+                result.push("".concat(tab, "}"));
             }
             result.push("}");
             return result.join(newLine) + newLine;
@@ -38074,6 +40424,7 @@ var ts;
                 validatedFilesSpec: ts.filter(filesSpecs, ts.isString),
                 validatedIncludeSpecs: validatedIncludeSpecs,
                 validatedExcludeSpecs: validatedExcludeSpecs,
+                pathPatterns: undefined, // Initialized on first use
             };
         }
         function getFileNames(basePath) {
@@ -38171,7 +40522,7 @@ var ts;
         basePath = ts.normalizeSlashes(basePath);
         var resolvedPath = ts.getNormalizedAbsolutePath(configFileName || "", basePath);
         if (resolutionStack.indexOf(resolvedPath) >= 0) {
-            errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0, __spreadArray(__spreadArray([], resolutionStack), [resolvedPath]).join(" -> ")));
+            errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0, __spreadArray(__spreadArray([], resolutionStack, true), [resolvedPath], false).join(" -> ")));
             return { raw: json || convertToObject(sourceFile, errors) };
         }
         var ownConfig = json ?
@@ -38239,6 +40590,7 @@ var ts;
         var typeAcquisition, typingOptionstypeAcquisition;
         var watchOptions;
         var extendedConfigPath;
+        var rootCompilerOptions;
         var optionsIterator = {
             onSetValidOptionKeyValueInParent: function (parentOption, option, value) {
                 var currentOption;
@@ -38274,9 +40626,12 @@ var ts;
                 if (key === "excludes") {
                     errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, keyNode, ts.Diagnostics.Unknown_option_excludes_Did_you_mean_exclude));
                 }
+                if (ts.find(commandOptionsWithoutBuild, function (opt) { return opt.name === key; })) {
+                    rootCompilerOptions = ts.append(rootCompilerOptions, keyNode);
+                }
             }
         };
-        var json = convertToObjectWorker(sourceFile, errors, /*returnValue*/ true, getTsconfigRootOptionsMap(), optionsIterator);
+        var json = convertConfigFileToObject(sourceFile, errors, /*reportOptionsErrors*/ true, optionsIterator);
         if (!typeAcquisition) {
             if (typingOptionstypeAcquisition) {
                 typeAcquisition = (typingOptionstypeAcquisition.enableAutoDiscovery !== undefined) ?
@@ -38291,6 +40646,9 @@ var ts;
                 typeAcquisition = getDefaultTypeAcquisition(configFileName);
             }
         }
+        if (rootCompilerOptions && json && json.compilerOptions === undefined) {
+            errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, rootCompilerOptions[0], ts.Diagnostics._0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file, ts.getTextOfPropertyName(rootCompilerOptions[0])));
+        }
         return { raw: json, options: options, watchOptions: watchOptions, typeAcquisition: typeAcquisition, extendedConfigPath: extendedConfigPath };
     }
     function getExtendsConfigPath(extendedConfig, host, basePath, errors, createDiagnostic) {
@@ -38298,7 +40656,7 @@ var ts;
         if (ts.isRootedDiskPath(extendedConfig) || ts.startsWith(extendedConfig, "./") || ts.startsWith(extendedConfig, "../")) {
             var extendedConfigPath = ts.getNormalizedAbsolutePath(extendedConfig, basePath);
             if (!host.fileExists(extendedConfigPath) && !ts.endsWith(extendedConfigPath, ".json" /* Json */)) {
-                extendedConfigPath = extendedConfigPath + ".json";
+                extendedConfigPath = "".concat(extendedConfigPath, ".json");
                 if (!host.fileExists(extendedConfigPath)) {
                     errors.push(createDiagnostic(ts.Diagnostics.File_0_not_found, extendedConfig));
                     return undefined;
@@ -38471,9 +40829,6 @@ var ts;
     function convertJsonOptionOfListType(option, values, basePath, errors) {
         return ts.filter(ts.map(values, function (v) { return convertJsonOption(option.element, v, basePath, errors); }), function (v) { return !!v; });
     }
-    function trimString(s) {
-        return typeof s.trim === "function" ? s.trim() : s.replace(/^[\s]+|[\s]+$/g, "");
-    }
     /**
      * Tests for a path that ends in a recursive directory wildcard.
      * Matches **, \**, **\, and \**\, but not a**b.
@@ -38486,34 +40841,6 @@ var ts;
      *  \/?$        # matches an optional trailing directory separator at the end of the string.
      */
     var invalidTrailingRecursionPattern = /(^|\/)\*\*\/?$/;
-    /**
-     * Tests for a path where .. appears after a recursive directory wildcard.
-     * Matches **\..\*, **\a\..\*, and **\.., but not ..\**\*
-     *
-     * NOTE: used \ in place of / above to avoid issues with multiline comments.
-     *
-     * Breakdown:
-     *  (^|\/)      # matches either the beginning of the string or a directory separator.
-     *  \*\*\/      # matches a recursive directory wildcard "**" followed by a directory separator.
-     *  (.*\/)?     # optionally matches any number of characters followed by a directory separator.
-     *  \.\.        # matches a parent directory path component ".."
-     *  ($|\/)      # matches either the end of the string or a directory separator.
-     */
-    var invalidDotDotAfterRecursiveWildcardPattern = /(^|\/)\*\*\/(.*\/)?\.\.($|\/)/;
-    /**
-     * Tests for a path containing a wildcard character in a directory component of the path.
-     * Matches \*\, \?\, and \a*b\, but not \a\ or \a\*.
-     *
-     * NOTE: used \ in place of / above to avoid issues with multiline comments.
-     *
-     * Breakdown:
-     *  \/          # matches a directory separator.
-     *  [^/]*?      # matches any number of characters excluding directory separators (non-greedy).
-     *  [*?]        # matches either a wildcard character (* or ?)
-     *  [^/]*       # matches any number of characters excluding directory separators (greedy).
-     *  \/          # matches a directory separator.
-     */
-    var watchRecursivePattern = /\/[^/]*?[*?][^/]*\//;
     /**
      * Matches the portion of a wildcard path that does not contain wildcards.
      * Matches \a of \a\*, or \a\b\c of \a\b\c\?\d.
@@ -38554,10 +40881,10 @@ var ts;
         // via wildcard of *.json kind
         var wildCardJsonFileMap = new ts.Map();
         var validatedFilesSpec = configFileSpecs.validatedFilesSpec, validatedIncludeSpecs = configFileSpecs.validatedIncludeSpecs, validatedExcludeSpecs = configFileSpecs.validatedExcludeSpecs;
-        // Rather than requery this for each file and filespec, we query the supported extensions
+        // Rather than re-query this for each file and filespec, we query the supported extensions
         // once and store it on the expansion context.
         var supportedExtensions = ts.getSupportedExtensions(options, extraFileExtensions);
-        var supportedExtensionsWithJsonIfResolveJsonModule = ts.getSuppoertedExtensionsWithJsonIfResolveJsonModule(options, supportedExtensions);
+        var supportedExtensionsWithJsonIfResolveJsonModule = ts.getSupportedExtensionsWithJsonIfResolveJsonModule(options, supportedExtensions);
         // Literal files are always included verbatim. An "include" or "exclude" specification cannot
         // remove a literal file.
         if (validatedFilesSpec) {
@@ -38574,7 +40901,7 @@ var ts;
                     // Valid only if *.json specified
                     if (!jsonOnlyIncludeRegexes) {
                         var includes = validatedIncludeSpecs.filter(function (s) { return ts.endsWith(s, ".json" /* Json */); });
-                        var includeFilePatterns = ts.map(ts.getRegularExpressionsForWildcards(includes, basePath, "files"), function (pattern) { return "^" + pattern + "$"; });
+                        var includeFilePatterns = ts.map(ts.getRegularExpressionsForWildcards(includes, basePath, "files"), function (pattern) { return "^".concat(pattern, "$"); });
                         jsonOnlyIncludeRegexes = includeFilePatterns ? includeFilePatterns.map(function (pattern) { return ts.getRegexFromPattern(pattern, host.useCaseSensitiveFileNames); }) : ts.emptyArray;
                     }
                     var includeIndex = ts.findIndex(jsonOnlyIncludeRegexes, function (re) { return re.test(file); });
@@ -38605,7 +40932,7 @@ var ts;
                     wildcardFileMap.set(key, file);
                 }
             };
-            for (var _a = 0, _b = host.readDirectory(basePath, supportedExtensionsWithJsonIfResolveJsonModule, validatedExcludeSpecs, validatedIncludeSpecs, /*depth*/ undefined); _a < _b.length; _a++) {
+            for (var _a = 0, _b = host.readDirectory(basePath, ts.flatten(supportedExtensionsWithJsonIfResolveJsonModule), validatedExcludeSpecs, validatedIncludeSpecs, /*depth*/ undefined); _a < _b.length; _a++) {
                 var file = _b[_a];
                 _loop_6(file);
             }
@@ -38632,9 +40959,22 @@ var ts;
         return matchesExcludeWorker(pathToCheck, validatedExcludeSpecs, useCaseSensitiveFileNames, currentDirectory, basePath);
     }
     ts.isExcludedFile = isExcludedFile;
+    function invalidDotDotAfterRecursiveWildcard(s) {
+        // We used to use the regex /(^|\/)\*\*\/(.*\/)?\.\.($|\/)/ to check for this case, but
+        // in v8, that has polynomial performance because the recursive wildcard match - **/ -
+        // can be matched in many arbitrary positions when multiple are present, resulting
+        // in bad backtracking (and we don't care which is matched - just that some /.. segment
+        // comes after some **/ segment).
+        var wildcardIndex = ts.startsWith(s, "**/") ? 0 : s.indexOf("/**/");
+        if (wildcardIndex === -1) {
+            return false;
+        }
+        var lastDotIndex = ts.endsWith(s, "/..") ? s.length : s.lastIndexOf("/../");
+        return lastDotIndex > wildcardIndex;
+    }
     /* @internal */
     function matchesExclude(pathToCheck, excludeSpecs, useCaseSensitiveFileNames, currentDirectory) {
-        return matchesExcludeWorker(pathToCheck, ts.filter(excludeSpecs, function (spec) { return !invalidDotDotAfterRecursiveWildcardPattern.test(spec); }), useCaseSensitiveFileNames, currentDirectory);
+        return matchesExcludeWorker(pathToCheck, ts.filter(excludeSpecs, function (spec) { return !invalidDotDotAfterRecursiveWildcard(spec); }), useCaseSensitiveFileNames, currentDirectory);
     }
     ts.matchesExclude = matchesExclude;
     function matchesExcludeWorker(pathToCheck, excludeSpecs, useCaseSensitiveFileNames, currentDirectory, basePath) {
@@ -38667,7 +41007,7 @@ var ts;
         if (disallowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) {
             return [ts.Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec];
         }
-        else if (invalidDotDotAfterRecursiveWildcardPattern.test(spec)) {
+        else if (invalidDotDotAfterRecursiveWildcard(spec)) {
             return [ts.Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec];
         }
     }
@@ -38728,9 +41068,18 @@ var ts;
     function getWildcardDirectoryFromSpec(spec, useCaseSensitiveFileNames) {
         var match = wildcardDirectoryPattern.exec(spec);
         if (match) {
+            // We check this with a few `indexOf` calls because 3 `indexOf`/`lastIndexOf` calls is
+            // less algorithmically complex (roughly O(3n) worst-case) than the regex we used to use,
+            // \/[^/]*?[*?][^/]*\/ which was polynominal in v8, since arbitrary sequences of wildcard
+            // characters could match any of the central patterns, resulting in bad backtracking.
+            var questionWildcardIndex = spec.indexOf("?");
+            var starWildcardIndex = spec.indexOf("*");
+            var lastDirectorySeperatorIndex = spec.lastIndexOf(ts.directorySeparator);
             return {
                 key: useCaseSensitiveFileNames ? match[0] : ts.toFileNameLowerCase(match[0]),
-                flags: watchRecursivePattern.test(spec) ? 1 /* Recursive */ : 0 /* None */
+                flags: (questionWildcardIndex !== -1 && questionWildcardIndex < lastDirectorySeperatorIndex)
+                    || (starWildcardIndex !== -1 && starWildcardIndex < lastDirectorySeperatorIndex)
+                    ? 1 /* Recursive */ : 0 /* None */
             };
         }
         if (ts.isImplicitGlob(spec)) {
@@ -38746,16 +41095,25 @@ var ts;
      * extension priority.
      *
      * @param file The path to the file.
-     * @param extensionPriority The priority of the extension.
-     * @param context The expansion context.
      */
     function hasFileWithHigherPriorityExtension(file, literalFiles, wildcardFiles, extensions, keyMapper) {
-        var extensionPriority = ts.getExtensionPriority(file, extensions);
-        var adjustedExtensionPriority = ts.adjustExtensionPriority(extensionPriority, extensions);
-        for (var i = 0 /* Highest */; i < adjustedExtensionPriority; i++) {
-            var higherPriorityExtension = extensions[i];
-            var higherPriorityPath = keyMapper(ts.changeExtension(file, higherPriorityExtension));
+        var extensionGroup = ts.forEach(extensions, function (group) { return ts.fileExtensionIsOneOf(file, group) ? group : undefined; });
+        if (!extensionGroup) {
+            return false;
+        }
+        for (var _i = 0, extensionGroup_1 = extensionGroup; _i < extensionGroup_1.length; _i++) {
+            var ext = extensionGroup_1[_i];
+            if (ts.fileExtensionIs(file, ext)) {
+                return false;
+            }
+            var higherPriorityPath = keyMapper(ts.changeExtension(file, ext));
             if (literalFiles.has(higherPriorityPath) || wildcardFiles.has(higherPriorityPath)) {
+                if (ext === ".d.ts" /* Dts */ && (ts.fileExtensionIs(file, ".js" /* Js */) || ts.fileExtensionIs(file, ".jsx" /* Jsx */))) {
+                    // LEGACY BEHAVIOR: An off-by-one bug somewhere in the extension priority system for wildcard module loading allowed declaration
+                    // files to be loaded alongside their js(x) counterparts. We regard this as generally undesirable, but retain the behavior to
+                    // prevent breakage.
+                    continue;
+                }
                 return true;
             }
         }
@@ -38766,15 +41124,18 @@ var ts;
      * already been included.
      *
      * @param file The path to the file.
-     * @param extensionPriority The priority of the extension.
-     * @param context The expansion context.
      */
     function removeWildcardFilesWithLowerPriorityExtension(file, wildcardFiles, extensions, keyMapper) {
-        var extensionPriority = ts.getExtensionPriority(file, extensions);
-        var nextExtensionPriority = ts.getNextLowestExtensionPriority(extensionPriority, extensions);
-        for (var i = nextExtensionPriority; i < extensions.length; i++) {
-            var lowerPriorityExtension = extensions[i];
-            var lowerPriorityPath = keyMapper(ts.changeExtension(file, lowerPriorityExtension));
+        var extensionGroup = ts.forEach(extensions, function (group) { return ts.fileExtensionIsOneOf(file, group) ? group : undefined; });
+        if (!extensionGroup) {
+            return;
+        }
+        for (var i = extensionGroup.length - 1; i >= 0; i--) {
+            var ext = extensionGroup[i];
+            if (ts.fileExtensionIs(file, ext)) {
+                return;
+            }
+            var lowerPriorityPath = keyMapper(ts.changeExtension(file, ext));
             wildcardFiles.delete(lowerPriorityPath);
         }
     }
@@ -38817,6 +41178,25 @@ var ts;
                 }); // TODO: GH#18217
         }
     }
+    function getDefaultValueForOption(option) {
+        switch (option.type) {
+            case "number":
+                return 1;
+            case "boolean":
+                return true;
+            case "string":
+                return option.isFilePath ? "./" : "";
+            case "list":
+                return [];
+            case "object":
+                return {};
+            default:
+                var iterResult = option.type.keys().next();
+                if (!iterResult.done)
+                    return iterResult.value;
+                return ts.Debug.fail("Expected 'option.type' to have entries.");
+        }
+    }
 })(ts || (ts = {}));
 var ts;
 (function (ts) {
@@ -38957,7 +41337,7 @@ var ts;
         var bestVersionKey = result.version, bestVersionPaths = result.paths;
         if (typeof bestVersionPaths !== "object") {
             if (state.traceEnabled) {
-                trace(state.host, ts.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2, "typesVersions['" + bestVersionKey + "']", "object", typeof bestVersionPaths);
+                trace(state.host, ts.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2, "typesVersions['".concat(bestVersionKey, "']"), "object", typeof bestVersionPaths);
             }
             return;
         }
@@ -39018,18 +41398,33 @@ var ts;
         return typeRoots;
     }
     var nodeModulesAtTypes = ts.combinePaths("node_modules", "@types");
+    function arePathsEqual(path1, path2, host) {
+        var useCaseSensitiveFileNames = typeof host.useCaseSensitiveFileNames === "function" ? host.useCaseSensitiveFileNames() : host.useCaseSensitiveFileNames;
+        return ts.comparePaths(path1, path2, !useCaseSensitiveFileNames) === 0 /* EqualTo */;
+    }
     /**
      * @param {string | undefined} containingFile - file that contains type reference directive, can be undefined if containing file is unknown.
      * This is possible in case if resolution is performed for directives specified via 'types' parameter. In this case initial path for secondary lookups
      * is assumed to be the same as root directory of the project.
      */
-    function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host, redirectedReference) {
+    function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host, redirectedReference, cache) {
         var traceEnabled = isTraceEnabled(options, host);
         if (redirectedReference) {
             options = redirectedReference.commandLine.options;
         }
-        var failedLookupLocations = [];
-        var moduleResolutionState = { compilerOptions: options, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations };
+        var containingDirectory = containingFile ? ts.getDirectoryPath(containingFile) : undefined;
+        var perFolderCache = containingDirectory ? cache && cache.getOrCreateCacheForDirectory(containingDirectory, redirectedReference) : undefined;
+        var result = perFolderCache && perFolderCache.get(typeReferenceDirectiveName, /*mode*/ undefined);
+        if (result) {
+            if (traceEnabled) {
+                trace(host, ts.Diagnostics.Resolving_type_reference_directive_0_containing_file_1, typeReferenceDirectiveName, containingFile);
+                if (redirectedReference)
+                    trace(host, ts.Diagnostics.Using_compiler_options_of_project_reference_redirect_0, redirectedReference.sourceFile.fileName);
+                trace(host, ts.Diagnostics.Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1, typeReferenceDirectiveName, containingDirectory);
+                traceResult(result);
+            }
+            return result;
+        }
         var typeRoots = getEffectiveTypeRoots(options, host);
         if (traceEnabled) {
             if (containingFile === undefined) {
@@ -39052,6 +41447,8 @@ var ts;
                 trace(host, ts.Diagnostics.Using_compiler_options_of_project_reference_redirect_0, redirectedReference.sourceFile.fileName);
             }
         }
+        var failedLookupLocations = [];
+        var moduleResolutionState = { compilerOptions: options, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations, packageJsonInfoCache: cache, features: NodeResolutionFeatures.AllFeatures, conditions: ["node", "require", "types"] };
         var resolved = primaryLookup();
         var primary = true;
         if (!resolved) {
@@ -39062,17 +41459,31 @@ var ts;
         if (resolved) {
             var fileName = resolved.fileName, packageId = resolved.packageId;
             var resolvedFileName = options.preserveSymlinks ? fileName : realPath(fileName, host, traceEnabled);
-            if (traceEnabled) {
-                if (packageId) {
-                    trace(host, ts.Diagnostics.Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3, typeReferenceDirectiveName, resolvedFileName, ts.packageIdToString(packageId), primary);
-                }
-                else {
-                    trace(host, ts.Diagnostics.Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2, typeReferenceDirectiveName, resolvedFileName, primary);
-                }
+            resolvedTypeReferenceDirective = {
+                primary: primary,
+                resolvedFileName: resolvedFileName,
+                originalPath: arePathsEqual(fileName, resolvedFileName, host) ? undefined : fileName,
+                packageId: packageId,
+                isExternalLibraryImport: pathContainsNodeModules(fileName),
+            };
+        }
+        result = { resolvedTypeReferenceDirective: resolvedTypeReferenceDirective, failedLookupLocations: failedLookupLocations };
+        perFolderCache === null || perFolderCache === void 0 ? void 0 : perFolderCache.set(typeReferenceDirectiveName, /*mode*/ undefined, result);
+        if (traceEnabled)
+            traceResult(result);
+        return result;
+        function traceResult(result) {
+            var _a;
+            if (!((_a = result.resolvedTypeReferenceDirective) === null || _a === void 0 ? void 0 : _a.resolvedFileName)) {
+                trace(host, ts.Diagnostics.Type_reference_directive_0_was_not_resolved, typeReferenceDirectiveName);
+            }
+            else if (result.resolvedTypeReferenceDirective.packageId) {
+                trace(host, ts.Diagnostics.Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3, typeReferenceDirectiveName, result.resolvedTypeReferenceDirective.resolvedFileName, ts.packageIdToString(result.resolvedTypeReferenceDirective.packageId), result.resolvedTypeReferenceDirective.primary);
+            }
+            else {
+                trace(host, ts.Diagnostics.Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2, typeReferenceDirectiveName, result.resolvedTypeReferenceDirective.resolvedFileName, result.resolvedTypeReferenceDirective.primary);
             }
-            resolvedTypeReferenceDirective = { primary: primary, resolvedFileName: resolvedFileName, packageId: packageId, isExternalLibraryImport: pathContainsNodeModules(fileName) };
         }
-        return { resolvedTypeReferenceDirective: resolvedTypeReferenceDirective, failedLookupLocations: failedLookupLocations };
         function primaryLookup() {
             // Check primary library paths
             if (typeRoots && typeRoots.length) {
@@ -39102,20 +41513,16 @@ var ts;
                 if (traceEnabled) {
                     trace(host, ts.Diagnostics.Looking_up_in_node_modules_folder_initial_location_0, initialLocationForSecondaryLookup);
                 }
-                var result = void 0;
+                var result_4;
                 if (!ts.isExternalModuleNameRelative(typeReferenceDirectiveName)) {
                     var searchResult = loadModuleFromNearestNodeModulesDirectory(Extensions.DtsOnly, typeReferenceDirectiveName, initialLocationForSecondaryLookup, moduleResolutionState, /*cache*/ undefined, /*redirectedReference*/ undefined);
-                    result = searchResult && searchResult.value;
+                    result_4 = searchResult && searchResult.value;
                 }
                 else {
                     var candidate = ts.normalizePathAndParts(ts.combinePaths(initialLocationForSecondaryLookup, typeReferenceDirectiveName)).path;
-                    result = nodeLoadModuleByRelativeName(Extensions.DtsOnly, candidate, /*onlyRecordFailures*/ false, moduleResolutionState, /*considerPackageJson*/ true);
+                    result_4 = nodeLoadModuleByRelativeName(Extensions.DtsOnly, candidate, /*onlyRecordFailures*/ false, moduleResolutionState, /*considerPackageJson*/ true);
                 }
-                var resolvedFile = resolvedTypeScriptOnly(result);
-                if (!resolvedFile && traceEnabled) {
-                    trace(host, ts.Diagnostics.Type_reference_directive_0_was_not_resolved, typeReferenceDirectiveName);
-                }
-                return resolvedFile;
+                return resolvedTypeScriptOnly(result_4);
             }
             else {
                 if (traceEnabled) {
@@ -39170,22 +41577,21 @@ var ts;
         return result;
     }
     ts.getAutomaticTypeDirectiveNames = getAutomaticTypeDirectiveNames;
-    function createModuleResolutionCache(currentDirectory, getCanonicalFileName, options) {
-        return createModuleResolutionCacheWithMaps(createCacheWithRedirects(options), createCacheWithRedirects(options), currentDirectory, getCanonicalFileName);
-    }
-    ts.createModuleResolutionCache = createModuleResolutionCache;
     /*@internal*/
     function createCacheWithRedirects(options) {
         var ownMap = new ts.Map();
         var redirectsMap = new ts.Map();
         return {
-            ownMap: ownMap,
+            getOwnMap: getOwnMap,
             redirectsMap: redirectsMap,
             getOrCreateMapOfCacheRedirects: getOrCreateMapOfCacheRedirects,
             clear: clear,
             setOwnOptions: setOwnOptions,
             setOwnMap: setOwnMap
         };
+        function getOwnMap() {
+            return ownMap;
+        }
         function setOwnOptions(newOptions) {
             options = newOptions;
         }
@@ -39211,26 +41617,137 @@ var ts;
         }
     }
     ts.createCacheWithRedirects = createCacheWithRedirects;
-    /*@internal*/
-    function createModuleResolutionCacheWithMaps(directoryToModuleNameMap, moduleNameToDirectoryMap, currentDirectory, getCanonicalFileName) {
-        return { getOrCreateCacheForDirectory: getOrCreateCacheForDirectory, getOrCreateCacheForModuleName: getOrCreateCacheForModuleName, directoryToModuleNameMap: directoryToModuleNameMap, moduleNameToDirectoryMap: moduleNameToDirectoryMap };
+    function createPackageJsonInfoCache(currentDirectory, getCanonicalFileName) {
+        var cache;
+        return { getPackageJsonInfo: getPackageJsonInfo, setPackageJsonInfo: setPackageJsonInfo, clear: clear, entries: entries };
+        function getPackageJsonInfo(packageJsonPath) {
+            return cache === null || cache === void 0 ? void 0 : cache.get(ts.toPath(packageJsonPath, currentDirectory, getCanonicalFileName));
+        }
+        function setPackageJsonInfo(packageJsonPath, info) {
+            (cache || (cache = new ts.Map())).set(ts.toPath(packageJsonPath, currentDirectory, getCanonicalFileName), info);
+        }
+        function clear() {
+            cache = undefined;
+        }
+        function entries() {
+            var iter = cache === null || cache === void 0 ? void 0 : cache.entries();
+            return iter ? ts.arrayFrom(iter) : [];
+        }
+    }
+    function getOrCreateCache(cacheWithRedirects, redirectedReference, key, create) {
+        var cache = cacheWithRedirects.getOrCreateMapOfCacheRedirects(redirectedReference);
+        var result = cache.get(key);
+        if (!result) {
+            result = create();
+            cache.set(key, result);
+        }
+        return result;
+    }
+    function updateRedirectsMap(options, directoryToModuleNameMap, moduleNameToDirectoryMap) {
+        if (!options.configFile)
+            return;
+        if (directoryToModuleNameMap.redirectsMap.size === 0) {
+            // The own map will be for projectCompilerOptions
+            ts.Debug.assert(!moduleNameToDirectoryMap || moduleNameToDirectoryMap.redirectsMap.size === 0);
+            ts.Debug.assert(directoryToModuleNameMap.getOwnMap().size === 0);
+            ts.Debug.assert(!moduleNameToDirectoryMap || moduleNameToDirectoryMap.getOwnMap().size === 0);
+            directoryToModuleNameMap.redirectsMap.set(options.configFile.path, directoryToModuleNameMap.getOwnMap());
+            moduleNameToDirectoryMap === null || moduleNameToDirectoryMap === void 0 ? void 0 : moduleNameToDirectoryMap.redirectsMap.set(options.configFile.path, moduleNameToDirectoryMap.getOwnMap());
+        }
+        else {
+            // Set correct own map
+            ts.Debug.assert(!moduleNameToDirectoryMap || moduleNameToDirectoryMap.redirectsMap.size > 0);
+            var ref = {
+                sourceFile: options.configFile,
+                commandLine: { options: options }
+            };
+            directoryToModuleNameMap.setOwnMap(directoryToModuleNameMap.getOrCreateMapOfCacheRedirects(ref));
+            moduleNameToDirectoryMap === null || moduleNameToDirectoryMap === void 0 ? void 0 : moduleNameToDirectoryMap.setOwnMap(moduleNameToDirectoryMap.getOrCreateMapOfCacheRedirects(ref));
+        }
+        directoryToModuleNameMap.setOwnOptions(options);
+        moduleNameToDirectoryMap === null || moduleNameToDirectoryMap === void 0 ? void 0 : moduleNameToDirectoryMap.setOwnOptions(options);
+    }
+    function createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, directoryToModuleNameMap) {
+        return {
+            getOrCreateCacheForDirectory: getOrCreateCacheForDirectory,
+            clear: clear,
+            update: update,
+        };
+        function clear() {
+            directoryToModuleNameMap.clear();
+        }
+        function update(options) {
+            updateRedirectsMap(options, directoryToModuleNameMap);
+        }
         function getOrCreateCacheForDirectory(directoryName, redirectedReference) {
             var path = ts.toPath(directoryName, currentDirectory, getCanonicalFileName);
-            return getOrCreateCache(directoryToModuleNameMap, redirectedReference, path, function () { return new ts.Map(); });
-        }
-        function getOrCreateCacheForModuleName(nonRelativeModuleName, redirectedReference) {
-            ts.Debug.assert(!ts.isExternalModuleNameRelative(nonRelativeModuleName));
-            return getOrCreateCache(moduleNameToDirectoryMap, redirectedReference, nonRelativeModuleName, createPerModuleNameCache);
+            return getOrCreateCache(directoryToModuleNameMap, redirectedReference, path, function () { return createModeAwareCache(); });
         }
-        function getOrCreateCache(cacheWithRedirects, redirectedReference, key, create) {
-            var cache = cacheWithRedirects.getOrCreateMapOfCacheRedirects(redirectedReference);
-            var result = cache.get(key);
-            if (!result) {
-                result = create();
-                cache.set(key, result);
+    }
+    /* @internal */
+    function createModeAwareCache() {
+        var underlying = new ts.Map();
+        var memoizedReverseKeys = new ts.Map();
+        var cache = {
+            get: function (specifier, mode) {
+                return underlying.get(getUnderlyingCacheKey(specifier, mode));
+            },
+            set: function (specifier, mode, value) {
+                underlying.set(getUnderlyingCacheKey(specifier, mode), value);
+                return cache;
+            },
+            delete: function (specifier, mode) {
+                underlying.delete(getUnderlyingCacheKey(specifier, mode));
+                return cache;
+            },
+            has: function (specifier, mode) {
+                return underlying.has(getUnderlyingCacheKey(specifier, mode));
+            },
+            forEach: function (cb) {
+                return underlying.forEach(function (elem, key) {
+                    var _a = memoizedReverseKeys.get(key), specifier = _a[0], mode = _a[1];
+                    return cb(elem, specifier, mode);
+                });
+            },
+            size: function () {
+                return underlying.size;
             }
+        };
+        return cache;
+        function getUnderlyingCacheKey(specifier, mode) {
+            var result = mode === undefined ? specifier : "".concat(mode, "|").concat(specifier);
+            memoizedReverseKeys.set(result, [specifier, mode]);
             return result;
         }
+    }
+    ts.createModeAwareCache = createModeAwareCache;
+    /* @internal */
+    function zipToModeAwareCache(file, keys, values) {
+        ts.Debug.assert(keys.length === values.length);
+        var map = createModeAwareCache();
+        for (var i = 0; i < keys.length; ++i) {
+            map.set(keys[i], ts.getModeForResolutionAtIndex(file, i), values[i]);
+        }
+        return map;
+    }
+    ts.zipToModeAwareCache = zipToModeAwareCache;
+    function createModuleResolutionCache(currentDirectory, getCanonicalFileName, options, directoryToModuleNameMap, moduleNameToDirectoryMap) {
+        var preDirectoryResolutionCache = createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, directoryToModuleNameMap || (directoryToModuleNameMap = createCacheWithRedirects(options)));
+        moduleNameToDirectoryMap || (moduleNameToDirectoryMap = createCacheWithRedirects(options));
+        var packageJsonInfoCache = createPackageJsonInfoCache(currentDirectory, getCanonicalFileName);
+        return __assign(__assign(__assign({}, packageJsonInfoCache), preDirectoryResolutionCache), { getOrCreateCacheForModuleName: getOrCreateCacheForModuleName, clear: clear, update: update, getPackageJsonInfoCache: function () { return packageJsonInfoCache; } });
+        function clear() {
+            preDirectoryResolutionCache.clear();
+            moduleNameToDirectoryMap.clear();
+            packageJsonInfoCache.clear();
+        }
+        function update(options) {
+            updateRedirectsMap(options, directoryToModuleNameMap, moduleNameToDirectoryMap);
+        }
+        function getOrCreateCacheForModuleName(nonRelativeModuleName, mode, redirectedReference) {
+            ts.Debug.assert(!ts.isExternalModuleNameRelative(nonRelativeModuleName));
+            return getOrCreateCache(moduleNameToDirectoryMap, redirectedReference, mode === undefined ? nonRelativeModuleName : "".concat(mode, "|").concat(nonRelativeModuleName), createPerModuleNameCache);
+        }
         function createPerModuleNameCache() {
             var directoryPathMap = new ts.Map();
             return { get: get, set: set };
@@ -39297,14 +41814,26 @@ var ts;
             }
         }
     }
-    ts.createModuleResolutionCacheWithMaps = createModuleResolutionCacheWithMaps;
-    function resolveModuleNameFromCache(moduleName, containingFile, cache) {
+    ts.createModuleResolutionCache = createModuleResolutionCache;
+    function createTypeReferenceDirectiveResolutionCache(currentDirectory, getCanonicalFileName, options, packageJsonInfoCache, directoryToModuleNameMap) {
+        var preDirectoryResolutionCache = createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, directoryToModuleNameMap || (directoryToModuleNameMap = createCacheWithRedirects(options)));
+        packageJsonInfoCache || (packageJsonInfoCache = createPackageJsonInfoCache(currentDirectory, getCanonicalFileName));
+        return __assign(__assign(__assign({}, packageJsonInfoCache), preDirectoryResolutionCache), { clear: clear });
+        function clear() {
+            preDirectoryResolutionCache.clear();
+            packageJsonInfoCache.clear();
+        }
+    }
+    ts.createTypeReferenceDirectiveResolutionCache = createTypeReferenceDirectiveResolutionCache;
+    function resolveModuleNameFromCache(moduleName, containingFile, cache, mode) {
         var containingDirectory = ts.getDirectoryPath(containingFile);
         var perFolderCache = cache && cache.getOrCreateCacheForDirectory(containingDirectory);
-        return perFolderCache && perFolderCache.get(moduleName);
+        if (!perFolderCache)
+            return undefined;
+        return perFolderCache.get(moduleName, mode);
     }
     ts.resolveModuleNameFromCache = resolveModuleNameFromCache;
-    function resolveModuleName(moduleName, containingFile, compilerOptions, host, cache, redirectedReference) {
+    function resolveModuleName(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
         var traceEnabled = isTraceEnabled(compilerOptions, host);
         if (redirectedReference) {
             compilerOptions = redirectedReference.commandLine.options;
@@ -39317,7 +41846,7 @@ var ts;
         }
         var containingDirectory = ts.getDirectoryPath(containingFile);
         var perFolderCache = cache && cache.getOrCreateCacheForDirectory(containingDirectory, redirectedReference);
-        var result = perFolderCache && perFolderCache.get(moduleName);
+        var result = perFolderCache && perFolderCache.get(moduleName, resolutionMode);
         if (result) {
             if (traceEnabled) {
                 trace(host, ts.Diagnostics.Resolution_for_module_0_was_found_in_cache_from_location_1, moduleName, containingDirectory);
@@ -39326,7 +41855,20 @@ var ts;
         else {
             var moduleResolution = compilerOptions.moduleResolution;
             if (moduleResolution === undefined) {
-                moduleResolution = ts.getEmitModuleKind(compilerOptions) === ts.ModuleKind.CommonJS ? ts.ModuleResolutionKind.NodeJs : ts.ModuleResolutionKind.Classic;
+                switch (ts.getEmitModuleKind(compilerOptions)) {
+                    case ts.ModuleKind.CommonJS:
+                        moduleResolution = ts.ModuleResolutionKind.NodeJs;
+                        break;
+                    case ts.ModuleKind.Node12:
+                        moduleResolution = ts.ModuleResolutionKind.Node12;
+                        break;
+                    case ts.ModuleKind.NodeNext:
+                        moduleResolution = ts.ModuleResolutionKind.NodeNext;
+                        break;
+                    default:
+                        moduleResolution = ts.ModuleResolutionKind.Classic;
+                        break;
+                }
                 if (traceEnabled) {
                     trace(host, ts.Diagnostics.Module_resolution_kind_is_not_specified_using_0, ts.ModuleResolutionKind[moduleResolution]);
                 }
@@ -39338,6 +41880,12 @@ var ts;
             }
             ts.perfLogger.logStartResolveModule(moduleName /* , containingFile, ModuleResolutionKind[moduleResolution]*/);
             switch (moduleResolution) {
+                case ts.ModuleResolutionKind.Node12:
+                    result = node12ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
+                    break;
+                case ts.ModuleResolutionKind.NodeNext:
+                    result = nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
+                    break;
                 case ts.ModuleResolutionKind.NodeJs:
                     result = nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
                     break;
@@ -39345,16 +41893,16 @@ var ts;
                     result = classicNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
                     break;
                 default:
-                    return ts.Debug.fail("Unexpected moduleResolution: " + moduleResolution);
+                    return ts.Debug.fail("Unexpected moduleResolution: ".concat(moduleResolution));
             }
             if (result && result.resolvedModule)
-                ts.perfLogger.logInfoEvent("Module \"" + moduleName + "\" resolved to \"" + result.resolvedModule.resolvedFileName + "\"");
+                ts.perfLogger.logInfoEvent("Module \"".concat(moduleName, "\" resolved to \"").concat(result.resolvedModule.resolvedFileName, "\""));
             ts.perfLogger.logStopResolveModule((result && result.resolvedModule) ? "" + result.resolvedModule.resolvedFileName : "null");
             if (perFolderCache) {
-                perFolderCache.set(moduleName, result);
+                perFolderCache.set(moduleName, resolutionMode, result);
                 if (!ts.isExternalModuleNameRelative(moduleName)) {
                     // put result in per-module name cache
-                    cache.getOrCreateCacheForModuleName(moduleName, redirectedReference).set(containingDirectory, result);
+                    cache.getOrCreateCacheForModuleName(moduleName, resolutionMode, redirectedReference).set(containingDirectory, result);
                 }
             }
         }
@@ -39446,7 +41994,8 @@ var ts;
         }
     }
     function tryLoadModuleUsingPathsIfEligible(extensions, moduleName, loader, state) {
-        var _a = state.compilerOptions, baseUrl = _a.baseUrl, paths = _a.paths;
+        var _a;
+        var _b = state.compilerOptions, baseUrl = _b.baseUrl, paths = _b.paths, configFile = _b.configFile;
         if (paths && !ts.pathIsRelative(moduleName)) {
             if (state.traceEnabled) {
                 if (baseUrl) {
@@ -39455,7 +42004,8 @@ var ts;
                 trace(state.host, ts.Diagnostics.paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0, moduleName);
             }
             var baseDirectory = ts.getPathsBasePath(state.compilerOptions, state.host); // Always defined when 'paths' is defined
-            return tryLoadModuleUsingPaths(extensions, moduleName, baseDirectory, paths, loader, /*onlyRecordFailures*/ false, state);
+            var pathPatterns = (configFile === null || configFile === void 0 ? void 0 : configFile.configFileSpecs) ? (_a = configFile.configFileSpecs).pathPatterns || (_a.pathPatterns = ts.tryParsePatterns(paths)) : undefined;
+            return tryLoadModuleUsingPaths(extensions, moduleName, baseDirectory, paths, pathPatterns, loader, /*onlyRecordFailures*/ false, state);
         }
     }
     function tryLoadModuleUsingRootDirs(extensions, moduleName, containingDirectory, loader, state) {
@@ -39549,33 +42099,70 @@ var ts;
     function resolveJSModule(moduleName, initialDir, host) {
         var _a = tryResolveJSModuleWorker(moduleName, initialDir, host), resolvedModule = _a.resolvedModule, failedLookupLocations = _a.failedLookupLocations;
         if (!resolvedModule) {
-            throw new Error("Could not resolve JS module '" + moduleName + "' starting at '" + initialDir + "'. Looked in: " + failedLookupLocations.join(", "));
+            throw new Error("Could not resolve JS module '".concat(moduleName, "' starting at '").concat(initialDir, "'. Looked in: ").concat(failedLookupLocations.join(", ")));
         }
         return resolvedModule.resolvedFileName;
     }
     ts.resolveJSModule = resolveJSModule;
     /* @internal */
     function tryResolveJSModule(moduleName, initialDir, host) {
-        var resolvedModule = tryResolveJSModuleWorker(moduleName, initialDir, host).resolvedModule;
-        return resolvedModule && resolvedModule.resolvedFileName;
+        return tryResolveJSModuleWorker(moduleName, initialDir, host).resolvedModule;
     }
     ts.tryResolveJSModule = tryResolveJSModule;
+    /* @internal */
+    var NodeResolutionFeatures;
+    (function (NodeResolutionFeatures) {
+        NodeResolutionFeatures[NodeResolutionFeatures["None"] = 0] = "None";
+        // resolving `#local` names in your own package.json
+        NodeResolutionFeatures[NodeResolutionFeatures["Imports"] = 2] = "Imports";
+        // resolving `your-own-name` from your own package.json
+        NodeResolutionFeatures[NodeResolutionFeatures["SelfName"] = 4] = "SelfName";
+        // respecting the `.exports` member of packages' package.json files and its (conditional) mappings of export names
+        NodeResolutionFeatures[NodeResolutionFeatures["Exports"] = 8] = "Exports";
+        // allowing `*` in the LHS of an export to be followed by more content, eg `"./whatever/*.js"`
+        // not currently backported to node 12 - https://github.com/nodejs/Release/issues/690
+        NodeResolutionFeatures[NodeResolutionFeatures["ExportsPatternTrailers"] = 16] = "ExportsPatternTrailers";
+        NodeResolutionFeatures[NodeResolutionFeatures["AllFeatures"] = 30] = "AllFeatures";
+        NodeResolutionFeatures[NodeResolutionFeatures["EsmMode"] = 32] = "EsmMode";
+    })(NodeResolutionFeatures || (NodeResolutionFeatures = {}));
+    function node12ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
+        return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.Imports | NodeResolutionFeatures.SelfName | NodeResolutionFeatures.Exports, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
+    }
+    function nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
+        return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.AllFeatures, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
+    }
+    function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
+        var containingDirectory = ts.getDirectoryPath(containingFile);
+        // es module file or cjs-like input file, use a variant of the legacy cjs resolver that supports the selected modern features
+        var esmMode = resolutionMode === ts.ModuleKind.ESNext ? NodeResolutionFeatures.EsmMode : 0;
+        return nodeModuleNameResolverWorker(features | esmMode, moduleName, containingDirectory, compilerOptions, host, cache, compilerOptions.resolveJsonModule ? tsPlusJsonExtensions : tsExtensions, redirectedReference);
+    }
     var jsOnlyExtensions = [Extensions.JavaScript];
     var tsExtensions = [Extensions.TypeScript, Extensions.JavaScript];
-    var tsPlusJsonExtensions = __spreadArray(__spreadArray([], tsExtensions), [Extensions.Json]);
+    var tsPlusJsonExtensions = __spreadArray(__spreadArray([], tsExtensions, true), [Extensions.Json], false);
     var tsconfigExtensions = [Extensions.TSConfig];
     function tryResolveJSModuleWorker(moduleName, initialDir, host) {
-        return nodeModuleNameResolverWorker(moduleName, initialDir, { moduleResolution: ts.ModuleResolutionKind.NodeJs, allowJs: true }, host, /*cache*/ undefined, jsOnlyExtensions, /*redirectedReferences*/ undefined);
+        return nodeModuleNameResolverWorker(NodeResolutionFeatures.None, moduleName, initialDir, { moduleResolution: ts.ModuleResolutionKind.NodeJs, allowJs: true }, host, /*cache*/ undefined, jsOnlyExtensions, /*redirectedReferences*/ undefined);
     }
     function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, lookupConfig) {
-        return nodeModuleNameResolverWorker(moduleName, ts.getDirectoryPath(containingFile), compilerOptions, host, cache, lookupConfig ? tsconfigExtensions : (compilerOptions.resolveJsonModule ? tsPlusJsonExtensions : tsExtensions), redirectedReference);
+        return nodeModuleNameResolverWorker(NodeResolutionFeatures.None, moduleName, ts.getDirectoryPath(containingFile), compilerOptions, host, cache, lookupConfig ? tsconfigExtensions : (compilerOptions.resolveJsonModule ? tsPlusJsonExtensions : tsExtensions), redirectedReference);
     }
     ts.nodeModuleNameResolver = nodeModuleNameResolver;
-    function nodeModuleNameResolverWorker(moduleName, containingDirectory, compilerOptions, host, cache, extensions, redirectedReference) {
+    function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, compilerOptions, host, cache, extensions, redirectedReference) {
         var _a, _b;
         var traceEnabled = isTraceEnabled(compilerOptions, host);
         var failedLookupLocations = [];
-        var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations };
+        // conditions are only used by the node12/nodenext resolver - there's no priority order in the list,
+        //it's essentially a set (priority is determined by object insertion order in the object we look at).
+        var state = {
+            compilerOptions: compilerOptions,
+            host: host,
+            traceEnabled: traceEnabled,
+            failedLookupLocations: failedLookupLocations,
+            packageJsonInfoCache: cache,
+            features: features,
+            conditions: features & NodeResolutionFeatures.EsmMode ? ["node", "import", "types"] : ["node", "require", "types"]
+        };
         var result = ts.forEach(extensions, function (ext) { return tryResolve(ext); });
         return createResolvedModuleWithFailedLookupLocations((_a = result === null || result === void 0 ? void 0 : result.value) === null || _a === void 0 ? void 0 : _a.resolved, (_b = result === null || result === void 0 ? void 0 : result.value) === null || _b === void 0 ? void 0 : _b.isExternalLibraryImport, failedLookupLocations, state.resultFromCache);
         function tryResolve(extensions) {
@@ -39585,16 +42172,25 @@ var ts;
                 return toSearchResult({ resolved: resolved, isExternalLibraryImport: pathContainsNodeModules(resolved.path) });
             }
             if (!ts.isExternalModuleNameRelative(moduleName)) {
-                if (traceEnabled) {
-                    trace(host, ts.Diagnostics.Loading_module_0_from_node_modules_folder_target_file_type_1, moduleName, Extensions[extensions]);
+                var resolved_1;
+                if (features & NodeResolutionFeatures.Imports && ts.startsWith(moduleName, "#")) {
+                    resolved_1 = loadModuleFromImports(extensions, moduleName, containingDirectory, state, cache, redirectedReference);
+                }
+                if (!resolved_1 && features & NodeResolutionFeatures.SelfName) {
+                    resolved_1 = loadModuleFromSelfNameReference(extensions, moduleName, containingDirectory, state, cache, redirectedReference);
+                }
+                if (!resolved_1) {
+                    if (traceEnabled) {
+                        trace(host, ts.Diagnostics.Loading_module_0_from_node_modules_folder_target_file_type_1, moduleName, Extensions[extensions]);
+                    }
+                    resolved_1 = loadModuleFromNearestNodeModulesDirectory(extensions, moduleName, containingDirectory, state, cache, redirectedReference);
                 }
-                var resolved_1 = loadModuleFromNearestNodeModulesDirectory(extensions, moduleName, containingDirectory, state, cache, redirectedReference);
                 if (!resolved_1)
                     return undefined;
                 var resolvedValue = resolved_1.value;
                 if (!compilerOptions.preserveSymlinks && resolvedValue && !resolvedValue.originalPath) {
                     var path = realPath(resolvedValue.path, host, traceEnabled);
-                    var originalPath = path === resolvedValue.path ? undefined : resolvedValue.path;
+                    var originalPath = arePathsEqual(path, resolvedValue.path, host) ? undefined : resolvedValue.path;
                     resolvedValue = __assign(__assign({}, resolvedValue), { path: path, originalPath: originalPath });
                 }
                 // For node_modules lookups, get the real path so that multiple accesses to an `npm link`-ed module do not create duplicate files.
@@ -39616,7 +42212,7 @@ var ts;
         if (traceEnabled) {
             trace(host, ts.Diagnostics.Resolving_real_path_for_0_result_1, path, real);
         }
-        ts.Debug.assert(host.fileExists(real), path + " linked to nonexistent file " + real);
+        ts.Debug.assert(host.fileExists(real), "".concat(path, " linked to nonexistent file ").concat(real));
         return real;
     }
     function nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures, state, considerPackageJson) {
@@ -39635,7 +42231,7 @@ var ts;
             }
             var resolvedFromFile = loadModuleFromFile(extensions, candidate, onlyRecordFailures, state);
             if (resolvedFromFile) {
-                var packageDirectory = considerPackageJson ? parseNodeModuleFromPath(resolvedFromFile) : undefined;
+                var packageDirectory = considerPackageJson ? parseNodeModuleFromPath(resolvedFromFile.path) : undefined;
                 var packageInfo = packageDirectory ? getPackageJsonInfo(packageDirectory, /*onlyRecordFailures*/ false, state) : undefined;
                 return withPackageId(packageInfo, resolvedFromFile);
             }
@@ -39668,8 +42264,9 @@ var ts;
      *   For `/node_modules/@types/foo/bar/index.d.ts` this is packageDirectory: "@types/foo"
      *   For `/node_modules/foo/bar/index.d.ts` this is packageDirectory: "foo"
      */
+    /* @internal */
     function parseNodeModuleFromPath(resolved) {
-        var path = ts.normalizePath(resolved.path);
+        var path = ts.normalizePath(resolved);
         var idx = path.lastIndexOf(ts.nodeModulesPathPart);
         if (idx === -1) {
             return undefined;
@@ -39681,6 +42278,7 @@ var ts;
         }
         return path.slice(0, indexAfterPackageName);
     }
+    ts.parseNodeModuleFromPath = parseNodeModuleFromPath;
     function moveToNextDirectorySeparatorIfAvailable(path, prevSeparatorIndex) {
         var nextSeparatorIndex = path.indexOf(ts.directorySeparator, prevSeparatorIndex + 1);
         return nextSeparatorIndex === -1 ? prevSeparatorIndex : nextSeparatorIndex;
@@ -39695,26 +42293,40 @@ var ts;
     function loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) {
         if (extensions === Extensions.Json || extensions === Extensions.TSConfig) {
             var extensionLess = ts.tryRemoveExtension(candidate, ".json" /* Json */);
-            return (extensionLess === undefined && extensions === Extensions.Json) ? undefined : tryAddingExtensions(extensionLess || candidate, extensions, onlyRecordFailures, state);
+            var extension = extensionLess ? candidate.substring(extensionLess.length) : "";
+            return (extensionLess === undefined && extensions === Extensions.Json) ? undefined : tryAddingExtensions(extensionLess || candidate, extensions, extension, onlyRecordFailures, state);
         }
-        // First, try adding an extension. An import of "foo" could be matched by a file "foo.ts", or "foo.js" by "foo.js.ts"
-        var resolvedByAddingExtension = tryAddingExtensions(candidate, extensions, onlyRecordFailures, state);
-        if (resolvedByAddingExtension) {
-            return resolvedByAddingExtension;
+        // esm mode resolutions don't include automatic extension lookup (without additional flags, at least)
+        if (!(state.features & NodeResolutionFeatures.EsmMode)) {
+            // First, try adding an extension. An import of "foo" could be matched by a file "foo.ts", or "foo.js" by "foo.js.ts"
+            var resolvedByAddingExtension = tryAddingExtensions(candidate, extensions, "", onlyRecordFailures, state);
+            if (resolvedByAddingExtension) {
+                return resolvedByAddingExtension;
+            }
         }
+        return loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state);
+    }
+    function loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state) {
         // If that didn't work, try stripping a ".js" or ".jsx" extension and replacing it with a TypeScript one;
         // e.g. "./foo.js" can be matched by "./foo.ts" or "./foo.d.ts"
-        if (ts.hasJSFileExtension(candidate)) {
+        if (ts.hasJSFileExtension(candidate) || (ts.fileExtensionIs(candidate, ".json" /* Json */) && state.compilerOptions.resolveJsonModule)) {
             var extensionless = ts.removeFileExtension(candidate);
+            var extension = candidate.substring(extensionless.length);
             if (state.traceEnabled) {
-                var extension = candidate.substring(extensionless.length);
                 trace(state.host, ts.Diagnostics.File_name_0_has_a_1_extension_stripping_it, candidate, extension);
             }
-            return tryAddingExtensions(extensionless, extensions, onlyRecordFailures, state);
+            return tryAddingExtensions(extensionless, extensions, extension, onlyRecordFailures, state);
         }
     }
+    function loadJSOrExactTSFileName(extensions, candidate, onlyRecordFailures, state) {
+        if ((extensions === Extensions.TypeScript || extensions === Extensions.DtsOnly) && ts.fileExtensionIsOneOf(candidate, [".d.ts" /* Dts */, ".d.cts" /* Dcts */, ".d.mts" /* Dmts */])) {
+            var result = tryFile(candidate, onlyRecordFailures, state);
+            return result !== undefined ? { path: candidate, ext: ts.forEach([".d.ts" /* Dts */, ".d.cts" /* Dcts */, ".d.mts" /* Dmts */], function (e) { return ts.fileExtensionIs(candidate, e) ? e : undefined; }) } : undefined;
+        }
+        return loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state);
+    }
     /** Try to return an existing file that adds one of the `extensions` to `candidate`. */
-    function tryAddingExtensions(candidate, extensions, onlyRecordFailures, state) {
+    function tryAddingExtensions(candidate, extensions, originalExtension, onlyRecordFailures, state) {
         if (!onlyRecordFailures) {
             // check if containing folder exists - if it doesn't then just record failures for all supported extensions without disk probing
             var directory = ts.getDirectoryPath(candidate);
@@ -39724,11 +42336,51 @@ var ts;
         }
         switch (extensions) {
             case Extensions.DtsOnly:
-                return tryExtension(".d.ts" /* Dts */);
+                switch (originalExtension) {
+                    case ".mjs" /* Mjs */:
+                    case ".mts" /* Mts */:
+                    case ".d.mts" /* Dmts */:
+                        return tryExtension(".d.mts" /* Dmts */);
+                    case ".cjs" /* Cjs */:
+                    case ".cts" /* Cts */:
+                    case ".d.cts" /* Dcts */:
+                        return tryExtension(".d.cts" /* Dcts */);
+                    case ".json" /* Json */:
+                        candidate += ".json" /* Json */;
+                        return tryExtension(".d.ts" /* Dts */);
+                    default: return tryExtension(".d.ts" /* Dts */);
+                }
             case Extensions.TypeScript:
-                return tryExtension(".ts" /* Ts */) || tryExtension(".tsx" /* Tsx */) || tryExtension(".d.ts" /* Dts */);
+                switch (originalExtension) {
+                    case ".mjs" /* Mjs */:
+                    case ".mts" /* Mts */:
+                    case ".d.mts" /* Dmts */:
+                        return tryExtension(".mts" /* Mts */) || tryExtension(".d.mts" /* Dmts */);
+                    case ".cjs" /* Cjs */:
+                    case ".cts" /* Cts */:
+                    case ".d.cts" /* Dcts */:
+                        return tryExtension(".cts" /* Cts */) || tryExtension(".d.cts" /* Dcts */);
+                    case ".json" /* Json */:
+                        candidate += ".json" /* Json */;
+                        return tryExtension(".d.ts" /* Dts */);
+                    default:
+                        return tryExtension(".ts" /* Ts */) || tryExtension(".tsx" /* Tsx */) || tryExtension(".d.ts" /* Dts */);
+                }
             case Extensions.JavaScript:
-                return tryExtension(".js" /* Js */) || tryExtension(".jsx" /* Jsx */);
+                switch (originalExtension) {
+                    case ".mjs" /* Mjs */:
+                    case ".mts" /* Mts */:
+                    case ".d.mts" /* Dmts */:
+                        return tryExtension(".mjs" /* Mjs */);
+                    case ".cjs" /* Cjs */:
+                    case ".cts" /* Cts */:
+                    case ".d.cts" /* Dcts */:
+                        return tryExtension(".cjs" /* Cjs */);
+                    case ".json" /* Json */:
+                        return tryExtension(".json" /* Json */);
+                    default:
+                        return tryExtension(".js" /* Js */) || tryExtension(".jsx" /* Jsx */);
+                }
             case Extensions.TSConfig:
             case Extensions.Json:
                 return tryExtension(".json" /* Json */);
@@ -39763,26 +42415,76 @@ var ts;
         var versionPaths = packageInfo && packageInfo.versionPaths;
         return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJsonContent, versionPaths));
     }
+    /**
+     * A function for locating the package.json scope for a given path
+     */
+    /*@internal*/
+    function getPackageScopeForPath(fileName, packageJsonInfoCache, host, options) {
+        var state = {
+            host: host,
+            compilerOptions: options,
+            traceEnabled: isTraceEnabled(options, host),
+            failedLookupLocations: [],
+            packageJsonInfoCache: packageJsonInfoCache,
+            features: 0,
+            conditions: [],
+        };
+        var parts = ts.getPathComponents(fileName);
+        parts.pop();
+        while (parts.length > 0) {
+            var pkg = getPackageJsonInfo(ts.getPathFromPathComponents(parts), /*onlyRecordFailures*/ false, state);
+            if (pkg) {
+                return pkg;
+            }
+            parts.pop();
+        }
+        return undefined;
+    }
+    ts.getPackageScopeForPath = getPackageScopeForPath;
+    /*@internal*/
     function getPackageJsonInfo(packageDirectory, onlyRecordFailures, state) {
+        var _a, _b, _c;
         var host = state.host, traceEnabled = state.traceEnabled;
-        var directoryExists = !onlyRecordFailures && ts.directoryProbablyExists(packageDirectory, host);
         var packageJsonPath = ts.combinePaths(packageDirectory, "package.json");
+        if (onlyRecordFailures) {
+            state.failedLookupLocations.push(packageJsonPath);
+            return undefined;
+        }
+        var existing = (_a = state.packageJsonInfoCache) === null || _a === void 0 ? void 0 : _a.getPackageJsonInfo(packageJsonPath);
+        if (existing !== undefined) {
+            if (typeof existing !== "boolean") {
+                if (traceEnabled)
+                    trace(host, ts.Diagnostics.File_0_exists_according_to_earlier_cached_lookups, packageJsonPath);
+                return existing;
+            }
+            else {
+                if (existing && traceEnabled)
+                    trace(host, ts.Diagnostics.File_0_does_not_exist_according_to_earlier_cached_lookups, packageJsonPath);
+                state.failedLookupLocations.push(packageJsonPath);
+                return undefined;
+            }
+        }
+        var directoryExists = ts.directoryProbablyExists(packageDirectory, host);
         if (directoryExists && host.fileExists(packageJsonPath)) {
             var packageJsonContent = ts.readJson(packageJsonPath, host);
             if (traceEnabled) {
                 trace(host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath);
             }
             var versionPaths = readPackageJsonTypesVersionPaths(packageJsonContent, state);
-            return { packageDirectory: packageDirectory, packageJsonContent: packageJsonContent, versionPaths: versionPaths };
+            var result = { packageDirectory: packageDirectory, packageJsonContent: packageJsonContent, versionPaths: versionPaths };
+            (_b = state.packageJsonInfoCache) === null || _b === void 0 ? void 0 : _b.setPackageJsonInfo(packageJsonPath, result);
+            return result;
         }
         else {
             if (directoryExists && traceEnabled) {
                 trace(host, ts.Diagnostics.File_0_does_not_exist, packageJsonPath);
             }
+            (_c = state.packageJsonInfoCache) === null || _c === void 0 ? void 0 : _c.setPackageJsonInfo(packageJsonPath, directoryExists);
             // record package json as one of failed lookup locations - in the future if this file will appear it will invalidate resolution results
             state.failedLookupLocations.push(packageJsonPath);
         }
     }
+    ts.getPackageJsonInfo = getPackageJsonInfo;
     function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, jsonContent, versionPaths) {
         var packageFile;
         if (jsonContent) {
@@ -39829,7 +42531,7 @@ var ts;
             if (state.traceEnabled) {
                 trace(state.host, ts.Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, versionPaths.version, ts.version, moduleName);
             }
-            var result = tryLoadModuleUsingPaths(extensions, moduleName, candidate, versionPaths.paths, loader, onlyRecordFailuresForPackageFile || onlyRecordFailuresForIndex, state);
+            var result = tryLoadModuleUsingPaths(extensions, moduleName, candidate, versionPaths.paths, /*pathPatterns*/ undefined, loader, onlyRecordFailuresForPackageFile || onlyRecordFailuresForIndex, state);
             if (result) {
                 return removeIgnoredPackageId(result.value);
             }
@@ -39838,7 +42540,10 @@ var ts;
         var packageFileResult = packageFile && removeIgnoredPackageId(loader(extensions, packageFile, onlyRecordFailuresForPackageFile, state));
         if (packageFileResult)
             return packageFileResult;
-        return loadModuleFromFile(extensions, indexPath, onlyRecordFailuresForIndex, state);
+        // esm mode resolutions don't do package `index` lookups
+        if (!(state.features & NodeResolutionFeatures.EsmMode)) {
+            return loadModuleFromFile(extensions, indexPath, onlyRecordFailuresForIndex, state);
+        }
     }
     /** Resolve from an arbitrarily specified file. Return `undefined` if it has an unsupported extension. */
     function resolvedIfExtensionMatches(extensions, path) {
@@ -39868,6 +42573,234 @@ var ts;
         return idx === -1 ? { packageName: moduleName, rest: "" } : { packageName: moduleName.slice(0, idx), rest: moduleName.slice(idx + 1) };
     }
     ts.parsePackageName = parsePackageName;
+    /* @internal */
+    function allKeysStartWithDot(obj) {
+        return ts.every(ts.getOwnKeys(obj), function (k) { return ts.startsWith(k, "."); });
+    }
+    ts.allKeysStartWithDot = allKeysStartWithDot;
+    function noKeyStartsWithDot(obj) {
+        return !ts.some(ts.getOwnKeys(obj), function (k) { return ts.startsWith(k, "."); });
+    }
+    function loadModuleFromSelfNameReference(extensions, moduleName, directory, state, cache, redirectedReference) {
+        var _a, _b;
+        var useCaseSensitiveFileNames = typeof state.host.useCaseSensitiveFileNames === "function" ? state.host.useCaseSensitiveFileNames() : state.host.useCaseSensitiveFileNames;
+        var directoryPath = ts.toPath(ts.combinePaths(directory, "dummy"), (_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a), ts.createGetCanonicalFileName(useCaseSensitiveFileNames === undefined ? true : useCaseSensitiveFileNames));
+        var scope = getPackageScopeForPath(directoryPath, state.packageJsonInfoCache, state.host, state.compilerOptions);
+        if (!scope || !scope.packageJsonContent.exports) {
+            return undefined;
+        }
+        if (typeof scope.packageJsonContent.name !== "string") {
+            return undefined;
+        }
+        var parts = ts.getPathComponents(moduleName); // unrooted paths should have `""` as their 0th entry
+        var nameParts = ts.getPathComponents(scope.packageJsonContent.name);
+        if (!ts.every(nameParts, function (p, i) { return parts[i] === p; })) {
+            return undefined;
+        }
+        var trailingParts = parts.slice(nameParts.length);
+        return loadModuleFromExports(scope, extensions, !ts.length(trailingParts) ? "." : ".".concat(ts.directorySeparator).concat(trailingParts.join(ts.directorySeparator)), state, cache, redirectedReference);
+    }
+    function loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference) {
+        if (!scope.packageJsonContent.exports) {
+            return undefined;
+        }
+        if (subpath === ".") {
+            var mainExport = void 0;
+            if (typeof scope.packageJsonContent.exports === "string" || Array.isArray(scope.packageJsonContent.exports) || (typeof scope.packageJsonContent.exports === "object" && noKeyStartsWithDot(scope.packageJsonContent.exports))) {
+                mainExport = scope.packageJsonContent.exports;
+            }
+            else if (ts.hasProperty(scope.packageJsonContent.exports, ".")) {
+                mainExport = scope.packageJsonContent.exports["."];
+            }
+            if (mainExport) {
+                var loadModuleFromTargetImportOrExport = getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirectedReference, subpath, scope, /*isImports*/ false);
+                return loadModuleFromTargetImportOrExport(mainExport, "", /*pattern*/ false);
+            }
+        }
+        else if (allKeysStartWithDot(scope.packageJsonContent.exports)) {
+            if (typeof scope.packageJsonContent.exports !== "object") {
+                if (state.traceEnabled) {
+                    trace(state.host, ts.Diagnostics.Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1, subpath, scope.packageDirectory);
+                }
+                return toSearchResult(/*value*/ undefined);
+            }
+            var result = loadModuleFromImportsOrExports(extensions, state, cache, redirectedReference, subpath, scope.packageJsonContent.exports, scope, /*isImports*/ false);
+            if (result) {
+                return result;
+            }
+        }
+        if (state.traceEnabled) {
+            trace(state.host, ts.Diagnostics.Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1, subpath, scope.packageDirectory);
+        }
+        return toSearchResult(/*value*/ undefined);
+    }
+    function loadModuleFromImports(extensions, moduleName, directory, state, cache, redirectedReference) {
+        var _a, _b;
+        if (moduleName === "#" || ts.startsWith(moduleName, "#/")) {
+            if (state.traceEnabled) {
+                trace(state.host, ts.Diagnostics.Invalid_import_specifier_0_has_no_possible_resolutions, moduleName);
+            }
+            return toSearchResult(/*value*/ undefined);
+        }
+        var useCaseSensitiveFileNames = typeof state.host.useCaseSensitiveFileNames === "function" ? state.host.useCaseSensitiveFileNames() : state.host.useCaseSensitiveFileNames;
+        var directoryPath = ts.toPath(ts.combinePaths(directory, "dummy"), (_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a), ts.createGetCanonicalFileName(useCaseSensitiveFileNames === undefined ? true : useCaseSensitiveFileNames));
+        var scope = getPackageScopeForPath(directoryPath, state.packageJsonInfoCache, state.host, state.compilerOptions);
+        if (!scope) {
+            if (state.traceEnabled) {
+                trace(state.host, ts.Diagnostics.Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve, directoryPath);
+            }
+            return toSearchResult(/*value*/ undefined);
+        }
+        if (!scope.packageJsonContent.imports) {
+            if (state.traceEnabled) {
+                trace(state.host, ts.Diagnostics.package_json_scope_0_has_no_imports_defined, scope.packageDirectory);
+            }
+            return toSearchResult(/*value*/ undefined);
+        }
+        var result = loadModuleFromImportsOrExports(extensions, state, cache, redirectedReference, moduleName, scope.packageJsonContent.imports, scope, /*isImports*/ true);
+        if (result) {
+            return result;
+        }
+        if (state.traceEnabled) {
+            trace(state.host, ts.Diagnostics.Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1, moduleName, scope.packageDirectory);
+        }
+        return toSearchResult(/*value*/ undefined);
+    }
+    function loadModuleFromImportsOrExports(extensions, state, cache, redirectedReference, moduleName, lookupTable, scope, isImports) {
+        var loadModuleFromTargetImportOrExport = getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirectedReference, moduleName, scope, isImports);
+        if (!ts.endsWith(moduleName, ts.directorySeparator) && moduleName.indexOf("*") === -1 && ts.hasProperty(lookupTable, moduleName)) {
+            var target = lookupTable[moduleName];
+            return loadModuleFromTargetImportOrExport(target, /*subpath*/ "", /*pattern*/ false);
+        }
+        var expandingKeys = ts.sort(ts.filter(ts.getOwnKeys(lookupTable), function (k) { return k.indexOf("*") !== -1 || ts.endsWith(k, "/"); }), function (a, b) { return a.length - b.length; });
+        for (var _i = 0, expandingKeys_1 = expandingKeys; _i < expandingKeys_1.length; _i++) {
+            var potentialTarget = expandingKeys_1[_i];
+            if (state.features & NodeResolutionFeatures.ExportsPatternTrailers && matchesPatternWithTrailer(potentialTarget, moduleName)) {
+                var target = lookupTable[potentialTarget];
+                var starPos = potentialTarget.indexOf("*");
+                var subpath = moduleName.substring(potentialTarget.substring(0, starPos).length, moduleName.length - (potentialTarget.length - 1 - starPos));
+                return loadModuleFromTargetImportOrExport(target, subpath, /*pattern*/ true);
+            }
+            else if (ts.endsWith(potentialTarget, "*") && ts.startsWith(moduleName, potentialTarget.substring(0, potentialTarget.length - 1))) {
+                var target = lookupTable[potentialTarget];
+                var subpath = moduleName.substring(potentialTarget.length - 1);
+                return loadModuleFromTargetImportOrExport(target, subpath, /*pattern*/ true);
+            }
+            else if (ts.startsWith(moduleName, potentialTarget)) {
+                var target = lookupTable[potentialTarget];
+                var subpath = moduleName.substring(potentialTarget.length);
+                return loadModuleFromTargetImportOrExport(target, subpath, /*pattern*/ false);
+            }
+        }
+        function matchesPatternWithTrailer(target, name) {
+            if (ts.endsWith(target, "*"))
+                return false; // handled by next case in loop
+            var starPos = target.indexOf("*");
+            if (starPos === -1)
+                return false; // handled by last case in loop
+            return ts.startsWith(name, target.substring(0, starPos)) && ts.endsWith(name, target.substring(starPos + 1));
+        }
+    }
+    /**
+     * Gets the self-recursive function specialized to retrieving the targeted import/export element for the given resolution configuration
+     */
+    function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirectedReference, moduleName, scope, isImports) {
+        return loadModuleFromTargetImportOrExport;
+        function loadModuleFromTargetImportOrExport(target, subpath, pattern) {
+            var _a, _b;
+            if (typeof target === "string") {
+                if (!pattern && subpath.length > 0 && !ts.endsWith(target, "/")) {
+                    if (state.traceEnabled) {
+                        trace(state.host, ts.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName);
+                    }
+                    return toSearchResult(/*value*/ undefined);
+                }
+                if (!ts.startsWith(target, "./")) {
+                    if (isImports && !ts.startsWith(target, "../") && !ts.startsWith(target, "/") && !ts.isRootedDiskPath(target)) {
+                        var combinedLookup = pattern ? target.replace(/\*/g, subpath) : target + subpath;
+                        var result = nodeModuleNameResolverWorker(state.features, combinedLookup, scope.packageDirectory + "/", state.compilerOptions, state.host, cache, [extensions], redirectedReference);
+                        return toSearchResult(result.resolvedModule ? { path: result.resolvedModule.resolvedFileName, extension: result.resolvedModule.extension, packageId: result.resolvedModule.packageId, originalPath: result.resolvedModule.originalPath } : undefined);
+                    }
+                    if (state.traceEnabled) {
+                        trace(state.host, ts.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName);
+                    }
+                    return toSearchResult(/*value*/ undefined);
+                }
+                var parts = ts.pathIsRelative(target) ? ts.getPathComponents(target).slice(1) : ts.getPathComponents(target);
+                var partsAfterFirst = parts.slice(1);
+                if (partsAfterFirst.indexOf("..") >= 0 || partsAfterFirst.indexOf(".") >= 0 || partsAfterFirst.indexOf("node_modules") >= 0) {
+                    if (state.traceEnabled) {
+                        trace(state.host, ts.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName);
+                    }
+                    return toSearchResult(/*value*/ undefined);
+                }
+                var resolvedTarget = ts.combinePaths(scope.packageDirectory, target);
+                // TODO: Assert that `resolvedTarget` is actually within the package directory? That's what the spec says.... but I'm not sure we need
+                // to be in the business of validating everyone's import and export map correctness.
+                var subpathParts = ts.getPathComponents(subpath);
+                if (subpathParts.indexOf("..") >= 0 || subpathParts.indexOf(".") >= 0 || subpathParts.indexOf("node_modules") >= 0) {
+                    if (state.traceEnabled) {
+                        trace(state.host, ts.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName);
+                    }
+                    return toSearchResult(/*value*/ undefined);
+                }
+                var finalPath = ts.getNormalizedAbsolutePath(pattern ? resolvedTarget.replace(/\*/g, subpath) : resolvedTarget + subpath, (_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a));
+                return toSearchResult(withPackageId(scope, loadJSOrExactTSFileName(extensions, finalPath, /*onlyRecordFailures*/ false, state)));
+            }
+            else if (typeof target === "object" && target !== null) { // eslint-disable-line no-null/no-null
+                if (!Array.isArray(target)) {
+                    for (var _i = 0, _c = ts.getOwnKeys(target); _i < _c.length; _i++) {
+                        var key = _c[_i];
+                        if (key === "default" || state.conditions.indexOf(key) >= 0 || isApplicableVersionedTypesKey(state.conditions, key)) {
+                            var subTarget = target[key];
+                            var result = loadModuleFromTargetImportOrExport(subTarget, subpath, pattern);
+                            if (result) {
+                                return result;
+                            }
+                        }
+                    }
+                    return undefined;
+                }
+                else {
+                    if (!ts.length(target)) {
+                        if (state.traceEnabled) {
+                            trace(state.host, ts.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName);
+                        }
+                        return toSearchResult(/*value*/ undefined);
+                    }
+                    for (var _d = 0, target_1 = target; _d < target_1.length; _d++) {
+                        var elem = target_1[_d];
+                        var result = loadModuleFromTargetImportOrExport(elem, subpath, pattern);
+                        if (result) {
+                            return result;
+                        }
+                    }
+                }
+            }
+            else if (target === null) { // eslint-disable-line no-null/no-null
+                if (state.traceEnabled) {
+                    trace(state.host, ts.Diagnostics.package_json_scope_0_explicitly_maps_specifier_1_to_null, scope.packageDirectory, moduleName);
+                }
+                return toSearchResult(/*value*/ undefined);
+            }
+            if (state.traceEnabled) {
+                trace(state.host, ts.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName);
+            }
+            return toSearchResult(/*value*/ undefined);
+        }
+    }
+    /* @internal */
+    function isApplicableVersionedTypesKey(conditions, key) {
+        if (conditions.indexOf("types") === -1)
+            return false; // only apply versioned types conditions if the types condition is applied
+        if (!ts.startsWith(key, "types@"))
+            return false;
+        var range = ts.VersionRange.tryParse(key.substring("types@".length));
+        if (!range)
+            return false;
+        return range.test(ts.version);
+    }
+    ts.isApplicableVersionedTypesKey = isApplicableVersionedTypesKey;
     function loadModuleFromNearestNodeModulesDirectory(extensions, moduleName, directory, state, cache, redirectedReference) {
         return loadModuleFromNearestNodeModulesDirectoryWorker(extensions, moduleName, directory, state, /*typesScopeOnly*/ false, cache, redirectedReference);
     }
@@ -39876,24 +42809,24 @@ var ts;
         return loadModuleFromNearestNodeModulesDirectoryWorker(Extensions.DtsOnly, moduleName, directory, state, /*typesScopeOnly*/ true, /*cache*/ undefined, /*redirectedReference*/ undefined);
     }
     function loadModuleFromNearestNodeModulesDirectoryWorker(extensions, moduleName, directory, state, typesScopeOnly, cache, redirectedReference) {
-        var perModuleNameCache = cache && cache.getOrCreateCacheForModuleName(moduleName, redirectedReference);
+        var perModuleNameCache = cache && cache.getOrCreateCacheForModuleName(moduleName, state.features === 0 ? undefined : state.features & NodeResolutionFeatures.EsmMode ? ts.ModuleKind.ESNext : ts.ModuleKind.CommonJS, redirectedReference);
         return ts.forEachAncestorDirectory(ts.normalizeSlashes(directory), function (ancestorDirectory) {
             if (ts.getBaseFileName(ancestorDirectory) !== "node_modules") {
                 var resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache, moduleName, ancestorDirectory, state);
                 if (resolutionFromCache) {
                     return resolutionFromCache;
                 }
-                return toSearchResult(loadModuleFromImmediateNodeModulesDirectory(extensions, moduleName, ancestorDirectory, state, typesScopeOnly));
+                return toSearchResult(loadModuleFromImmediateNodeModulesDirectory(extensions, moduleName, ancestorDirectory, state, typesScopeOnly, cache, redirectedReference));
             }
         });
     }
-    function loadModuleFromImmediateNodeModulesDirectory(extensions, moduleName, directory, state, typesScopeOnly) {
+    function loadModuleFromImmediateNodeModulesDirectory(extensions, moduleName, directory, state, typesScopeOnly, cache, redirectedReference) {
         var nodeModulesFolder = ts.combinePaths(directory, "node_modules");
         var nodeModulesFolderExists = ts.directoryProbablyExists(nodeModulesFolder, state.host);
         if (!nodeModulesFolderExists && state.traceEnabled) {
             trace(state.host, ts.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, nodeModulesFolder);
         }
-        var packageResult = typesScopeOnly ? undefined : loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, nodeModulesFolder, nodeModulesFolderExists, state);
+        var packageResult = typesScopeOnly ? undefined : loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, nodeModulesFolder, nodeModulesFolderExists, state, cache, redirectedReference);
         if (packageResult) {
             return packageResult;
         }
@@ -39906,27 +42839,35 @@ var ts;
                 }
                 nodeModulesAtTypesExists = false;
             }
-            return loadModuleFromSpecificNodeModulesDirectory(Extensions.DtsOnly, mangleScopedPackageNameWithTrace(moduleName, state), nodeModulesAtTypes_1, nodeModulesAtTypesExists, state);
+            return loadModuleFromSpecificNodeModulesDirectory(Extensions.DtsOnly, mangleScopedPackageNameWithTrace(moduleName, state), nodeModulesAtTypes_1, nodeModulesAtTypesExists, state, cache, redirectedReference);
         }
     }
-    function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, nodeModulesDirectory, nodeModulesDirectoryExists, state) {
+    function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, nodeModulesDirectory, nodeModulesDirectoryExists, state, cache, redirectedReference) {
         var candidate = ts.normalizePath(ts.combinePaths(nodeModulesDirectory, moduleName));
         // First look for a nested package.json, as in `node_modules/foo/bar/package.json`.
         var packageInfo = getPackageJsonInfo(candidate, !nodeModulesDirectoryExists, state);
-        if (packageInfo) {
-            var fromFile = loadModuleFromFile(extensions, candidate, !nodeModulesDirectoryExists, state);
-            if (fromFile) {
-                return noPackageId(fromFile);
+        // But only if we're not respecting export maps (if we are, we might redirect around this location)
+        if (!(state.features & NodeResolutionFeatures.Exports)) {
+            if (packageInfo) {
+                var fromFile = loadModuleFromFile(extensions, candidate, !nodeModulesDirectoryExists, state);
+                if (fromFile) {
+                    return noPackageId(fromFile);
+                }
+                var fromDirectory = loadNodeModuleFromDirectoryWorker(extensions, candidate, !nodeModulesDirectoryExists, state, packageInfo.packageJsonContent, packageInfo.versionPaths);
+                return withPackageId(packageInfo, fromDirectory);
             }
-            var fromDirectory = loadNodeModuleFromDirectoryWorker(extensions, candidate, !nodeModulesDirectoryExists, state, packageInfo.packageJsonContent, packageInfo.versionPaths);
-            return withPackageId(packageInfo, fromDirectory);
         }
+        var _a = parsePackageName(moduleName), packageName = _a.packageName, rest = _a.rest;
         var loader = function (extensions, candidate, onlyRecordFailures, state) {
+            var _a;
+            // package exports are higher priority than file/directory lookups (and, if there's exports present, blocks them)
+            if (packageInfo && packageInfo.packageJsonContent.exports && state.features & NodeResolutionFeatures.Exports) {
+                return (_a = loadModuleFromExports(packageInfo, extensions, ts.combinePaths(".", rest), state, cache, redirectedReference)) === null || _a === void 0 ? void 0 : _a.value;
+            }
             var pathAndExtension = loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) ||
                 loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageInfo && packageInfo.packageJsonContent, packageInfo && packageInfo.versionPaths);
             return withPackageId(packageInfo, pathAndExtension);
         };
-        var _a = parsePackageName(moduleName), packageName = _a.packageName, rest = _a.rest;
         if (rest !== "") { // If "rest" is empty, we just did this search above.
             var packageDirectory = ts.combinePaths(nodeModulesDirectory, packageName);
             // Don't use a "types" or "main" from here because we're not loading the root, but a subdirectory -- just here for the packageId and path mappings.
@@ -39936,7 +42877,7 @@ var ts;
                     trace(state.host, ts.Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, packageInfo.versionPaths.version, ts.version, rest);
                 }
                 var packageDirectoryExists = nodeModulesDirectoryExists && ts.directoryProbablyExists(packageDirectory, state.host);
-                var fromPaths = tryLoadModuleUsingPaths(extensions, rest, packageDirectory, packageInfo.versionPaths.paths, loader, !packageDirectoryExists, state);
+                var fromPaths = tryLoadModuleUsingPaths(extensions, rest, packageDirectory, packageInfo.versionPaths.paths, /*pathPatterns*/ undefined, loader, !packageDirectoryExists, state);
                 if (fromPaths) {
                     return fromPaths.value;
                 }
@@ -39944,8 +42885,9 @@ var ts;
         }
         return loader(extensions, candidate, !nodeModulesDirectoryExists, state);
     }
-    function tryLoadModuleUsingPaths(extensions, moduleName, baseDirectory, paths, loader, onlyRecordFailures, state) {
-        var matchedPattern = ts.matchPatternOrExact(ts.getOwnKeys(paths), moduleName);
+    function tryLoadModuleUsingPaths(extensions, moduleName, baseDirectory, paths, pathPatterns, loader, onlyRecordFailures, state) {
+        pathPatterns || (pathPatterns = ts.tryParsePatterns(paths));
+        var matchedPattern = ts.matchPatternOrExact(pathPatterns, moduleName);
         if (matchedPattern) {
             var matchedStar_1 = ts.isString(matchedPattern) ? undefined : ts.matchedText(matchedPattern, moduleName);
             var matchedPatternText = ts.isString(matchedPattern) ? matchedPattern : ts.patternText(matchedPattern);
@@ -39984,7 +42926,7 @@ var ts;
     }
     /* @internal */
     function getTypesPackageName(packageName) {
-        return "@types/" + mangleScopedPackageName(packageName);
+        return "@types/".concat(mangleScopedPackageName(packageName));
     }
     ts.getTypesPackageName = getTypesPackageName;
     /* @internal */
@@ -40027,7 +42969,7 @@ var ts;
     function classicNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference) {
         var traceEnabled = isTraceEnabled(compilerOptions, host);
         var failedLookupLocations = [];
-        var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations };
+        var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations, packageJsonInfoCache: cache, features: NodeResolutionFeatures.None, conditions: [] };
         var containingDirectory = ts.getDirectoryPath(containingFile);
         var resolved = tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript);
         // No originalPath because classic resolution doesn't resolve realPath
@@ -40038,7 +42980,7 @@ var ts;
                 return { value: resolvedUsingSettings };
             }
             if (!ts.isExternalModuleNameRelative(moduleName)) {
-                var perModuleNameCache_1 = cache && cache.getOrCreateCacheForModuleName(moduleName, redirectedReference);
+                var perModuleNameCache_1 = cache && cache.getOrCreateCacheForModuleName(moduleName, /*mode*/ undefined, redirectedReference);
                 // Climb up parent directories looking for a module.
                 var resolved_3 = ts.forEachAncestorDirectory(containingDirectory, function (directory) {
                     var resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache_1, moduleName, directory, state);
@@ -40068,14 +43010,14 @@ var ts;
      * This is the minumum code needed to expose that functionality; the rest is in the host.
      */
     /* @internal */
-    function loadModuleFromGlobalCache(moduleName, projectName, compilerOptions, host, globalCache) {
+    function loadModuleFromGlobalCache(moduleName, projectName, compilerOptions, host, globalCache, packageJsonInfoCache) {
         var traceEnabled = isTraceEnabled(compilerOptions, host);
         if (traceEnabled) {
             trace(host, ts.Diagnostics.Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2, projectName, moduleName, globalCache);
         }
         var failedLookupLocations = [];
-        var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations };
-        var resolved = loadModuleFromImmediateNodeModulesDirectory(Extensions.DtsOnly, moduleName, globalCache, state, /*typesScopeOnly*/ false);
+        var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations, packageJsonInfoCache: packageJsonInfoCache, features: NodeResolutionFeatures.None, conditions: [] };
+        var resolved = loadModuleFromImmediateNodeModulesDirectory(Extensions.DtsOnly, moduleName, globalCache, state, /*typesScopeOnly*/ false, /*cache*/ undefined, /*redirectedReference*/ undefined);
         return createResolvedModuleWithFailedLookupLocations(resolved, /*isExternalLibraryImport*/ true, failedLookupLocations, state.resultFromCache);
     }
     ts.loadModuleFromGlobalCache = loadModuleFromGlobalCache;
@@ -40120,26 +43062,26 @@ var ts;
         // A module is uninstantiated if it contains only
         switch (node.kind) {
             // 1. interface declarations, type alias declarations
-            case 253 /* InterfaceDeclaration */:
-            case 254 /* TypeAliasDeclaration */:
+            case 257 /* InterfaceDeclaration */:
+            case 258 /* TypeAliasDeclaration */:
                 return 0 /* NonInstantiated */;
             // 2. const enum declarations
-            case 255 /* EnumDeclaration */:
+            case 259 /* EnumDeclaration */:
                 if (ts.isEnumConst(node)) {
                     return 2 /* ConstEnumOnly */;
                 }
                 break;
             // 3. non-exported import declarations
-            case 261 /* ImportDeclaration */:
-            case 260 /* ImportEqualsDeclaration */:
+            case 265 /* ImportDeclaration */:
+            case 264 /* ImportEqualsDeclaration */:
                 if (!(ts.hasSyntacticModifier(node, 1 /* Export */))) {
                     return 0 /* NonInstantiated */;
                 }
                 break;
             // 4. Export alias declarations pointing at only uninstantiated modules or things uninstantiated modules contain
-            case 267 /* ExportDeclaration */:
+            case 271 /* ExportDeclaration */:
                 var exportDeclaration = node;
-                if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 268 /* NamedExports */) {
+                if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 272 /* NamedExports */) {
                     var state = 0 /* NonInstantiated */;
                     for (var _i = 0, _a = exportDeclaration.exportClause.elements; _i < _a.length; _i++) {
                         var specifier = _a[_i];
@@ -40155,7 +43097,7 @@ var ts;
                 }
                 break;
             // 5. other uninstantiated module declarations.
-            case 257 /* ModuleBlock */: {
+            case 261 /* ModuleBlock */: {
                 var state_1 = 0 /* NonInstantiated */;
                 ts.forEachChild(node, function (n) {
                     var childState = getModuleInstanceStateCached(n, visited);
@@ -40177,9 +43119,9 @@ var ts;
                 });
                 return state_1;
             }
-            case 256 /* ModuleDeclaration */:
+            case 260 /* ModuleDeclaration */:
                 return getModuleInstanceState(node, visited);
-            case 78 /* Identifier */:
+            case 79 /* Identifier */:
                 // Only jsdoc typedef definition can exist in jsdoc namespace, and it should
                 // be considered the same as type alias
                 if (node.isInJSDocNamespace) {
@@ -40241,7 +43183,7 @@ var ts;
         ContainerFlags[ContainerFlags["IsFunctionExpression"] = 16] = "IsFunctionExpression";
         ContainerFlags[ContainerFlags["HasLocals"] = 32] = "HasLocals";
         ContainerFlags[ContainerFlags["IsInterface"] = 64] = "IsInterface";
-        ContainerFlags[ContainerFlags["IsObjectLiteralOrClassExpressionMethod"] = 128] = "IsObjectLiteralOrClassExpressionMethod";
+        ContainerFlags[ContainerFlags["IsObjectLiteralOrClassExpressionMethodOrAccessor"] = 128] = "IsObjectLiteralOrClassExpressionMethodOrAccessor";
     })(ContainerFlags || (ContainerFlags = {}));
     function initFlowNode(node) {
         ts.Debug.attachFlowNodeDebugInfo(node);
@@ -40295,6 +43237,7 @@ var ts;
         var classifiableNames;
         var unreachableFlow = { flags: 1 /* Unreachable */ };
         var reportedUnreachableFlow = { flags: 1 /* Unreachable */ };
+        var bindBinaryExpressionFlow = createBindBinaryExpressionFlow();
         /**
          * Inside the binder, we may create a diagnostic for an as-yet unbound node (with potentially no parent pointers, implying no accessible source file)
          * If so, the node _must_ be in the current file (as that's the only way anything could have traversed to it to yield it as the error node)
@@ -40377,16 +43320,16 @@ var ts;
         // Should not be called on a declaration with a computed property name,
         // unless it is a well known Symbol.
         function getDeclarationName(node) {
-            if (node.kind === 266 /* ExportAssignment */) {
+            if (node.kind === 270 /* ExportAssignment */) {
                 return node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */;
             }
             var name = ts.getNameOfDeclaration(node);
             if (name) {
                 if (ts.isAmbientModule(node)) {
                     var moduleName = ts.getTextOfIdentifierOrLiteral(name);
-                    return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + moduleName + "\"");
+                    return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"".concat(moduleName, "\""));
                 }
-                if (name.kind === 158 /* ComputedPropertyName */) {
+                if (name.kind === 161 /* ComputedPropertyName */) {
                     var nameExpression = name.expression;
                     // treat computed property names where expression is string/numeric literal as just string/numeric literal
                     if (ts.isStringOrNumericLiteralLike(nameExpression)) {
@@ -40395,11 +43338,9 @@ var ts;
                     if (ts.isSignedNumericLiteral(nameExpression)) {
                         return ts.tokenToString(nameExpression.operator) + nameExpression.operand.text;
                     }
-                    ts.Debug.assert(ts.isWellKnownSymbolSyntactically(nameExpression));
-                    return ts.getPropertyNameForKnownSymbolName(ts.idText(nameExpression.name));
-                }
-                if (ts.isWellKnownSymbolSyntactically(name)) {
-                    return ts.getPropertyNameForKnownSymbolName(ts.idText(name.name));
+                    else {
+                        ts.Debug.fail("Only computed properties with literal names have declaration names");
+                    }
                 }
                 if (ts.isPrivateIdentifier(name)) {
                     // containingClass exists because private names only allowed inside classes
@@ -40414,36 +43355,36 @@ var ts;
                 return ts.isPropertyNameLiteral(name) ? ts.getEscapedTextOfIdentifierOrLiteral(name) : undefined;
             }
             switch (node.kind) {
-                case 166 /* Constructor */:
+                case 170 /* Constructor */:
                     return "__constructor" /* Constructor */;
-                case 174 /* FunctionType */:
-                case 169 /* CallSignature */:
-                case 313 /* JSDocSignature */:
+                case 178 /* FunctionType */:
+                case 173 /* CallSignature */:
+                case 321 /* JSDocSignature */:
                     return "__call" /* Call */;
-                case 175 /* ConstructorType */:
-                case 170 /* ConstructSignature */:
+                case 179 /* ConstructorType */:
+                case 174 /* ConstructSignature */:
                     return "__new" /* New */;
-                case 171 /* IndexSignature */:
+                case 175 /* IndexSignature */:
                     return "__index" /* Index */;
-                case 267 /* ExportDeclaration */:
+                case 271 /* ExportDeclaration */:
                     return "__export" /* ExportStar */;
-                case 297 /* SourceFile */:
+                case 303 /* SourceFile */:
                     // json file should behave as
                     // module.exports = ...
                     return "export=" /* ExportEquals */;
-                case 216 /* BinaryExpression */:
+                case 220 /* BinaryExpression */:
                     if (ts.getAssignmentDeclarationKind(node) === 2 /* ModuleExports */) {
                         // module.exports = ...
                         return "export=" /* ExportEquals */;
                     }
                     ts.Debug.fail("Unknown binary declaration kind");
                     break;
-                case 308 /* JSDocFunctionType */:
+                case 315 /* JSDocFunctionType */:
                     return (ts.isJSDocConstructSignature(node) ? "__new" /* New */ : "__call" /* Call */);
-                case 160 /* Parameter */:
+                case 163 /* Parameter */:
                     // Parameters with names are handled at the top of this function.  Parameters
                     // without names can only come from JSDocFunctionTypes.
-                    ts.Debug.assert(node.parent.kind === 308 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; });
+                    ts.Debug.assert(node.parent.kind === 315 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: ".concat(ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind, ", expected JSDocFunctionType"); });
                     var functionType = node.parent;
                     var index = functionType.parameters.indexOf(node);
                     return "arg" + index;
@@ -40460,11 +43401,13 @@ var ts;
          * @param includes - The SymbolFlags that node has in addition to its declaration type (eg: export, ambient, etc.)
          * @param excludes - The flags which node cannot be declared alongside in a symbol table. Used to report forbidden declarations.
          */
-        function declareSymbol(symbolTable, parent, node, includes, excludes, isReplaceableByMethod) {
-            ts.Debug.assert(!ts.hasDynamicName(node));
+        function declareSymbol(symbolTable, parent, node, includes, excludes, isReplaceableByMethod, isComputedName) {
+            ts.Debug.assert(isComputedName || !ts.hasDynamicName(node));
             var isDefaultExport = ts.hasSyntacticModifier(node, 512 /* Default */) || ts.isExportSpecifier(node) && node.name.escapedText === "default";
             // The exported symbol for an export default function/class node is always named "default"
-            var name = isDefaultExport && parent ? "default" /* Default */ : getDeclarationName(node);
+            var name = isComputedName ? "__computed" /* Computed */
+                : isDefaultExport && parent ? "default" /* Default */
+                    : getDeclarationName(node);
             var symbol;
             if (name === undefined) {
                 symbol = createSymbol(0 /* None */, "__missing" /* Missing */);
@@ -40543,7 +43486,7 @@ var ts;
                                 // 1. multiple export default of class declaration or function declaration by checking NodeFlags.Default
                                 // 2. multiple export default of export assignment. This one doesn't have NodeFlags.Default on (as export default doesn't considered as modifiers)
                                 if (symbol.declarations && symbol.declarations.length &&
-                                    (node.kind === 266 /* ExportAssignment */ && !node.isExportEquals)) {
+                                    (node.kind === 270 /* ExportAssignment */ && !node.isExportEquals)) {
                                     message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports;
                                     messageNeedsName_1 = false;
                                     multipleDefaultExports_1 = true;
@@ -40553,7 +43496,7 @@ var ts;
                         var relatedInformation_1 = [];
                         if (ts.isTypeAliasDeclaration(node) && ts.nodeIsMissing(node.type) && ts.hasSyntacticModifier(node, 1 /* Export */) && symbol.flags & (2097152 /* Alias */ | 788968 /* Type */ | 1920 /* Namespace */)) {
                             // export type T; - may have meant export type { T }?
-                            relatedInformation_1.push(createDiagnosticForNode(node, ts.Diagnostics.Did_you_mean_0, "export type { " + ts.unescapeLeadingUnderscores(node.name.escapedText) + " }"));
+                            relatedInformation_1.push(createDiagnosticForNode(node, ts.Diagnostics.Did_you_mean_0, "export type { ".concat(ts.unescapeLeadingUnderscores(node.name.escapedText), " }")));
                         }
                         var declarationName_1 = ts.getNameOfDeclaration(node) || node;
                         ts.forEach(symbol.declarations, function (declaration, index) {
@@ -40565,7 +43508,7 @@ var ts;
                             }
                         });
                         var diag = createDiagnosticForNode(declarationName_1, message_1, messageNeedsName_1 ? getDisplayName(node) : undefined);
-                        file.bindDiagnostics.push(ts.addRelatedInfo.apply(void 0, __spreadArray([diag], relatedInformation_1)));
+                        file.bindDiagnostics.push(ts.addRelatedInfo.apply(void 0, __spreadArray([diag], relatedInformation_1, false)));
                         symbol = createSymbol(0 /* None */, name);
                     }
                 }
@@ -40582,7 +43525,7 @@ var ts;
         function declareModuleMember(node, symbolFlags, symbolExcludes) {
             var hasExportModifier = !!(ts.getCombinedModifierFlags(node) & 1 /* Export */) || jsdocTreatAsExported(node);
             if (symbolFlags & 2097152 /* Alias */) {
-                if (node.kind === 270 /* ExportSpecifier */ || (node.kind === 260 /* ImportEqualsDeclaration */ && hasExportModifier)) {
+                if (node.kind === 274 /* ExportSpecifier */ || (node.kind === 264 /* ImportEqualsDeclaration */ && hasExportModifier)) {
                     return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
                 }
                 else {
@@ -40671,7 +43614,7 @@ var ts;
             // for it.  We must clear this so we don't accidentally move any stale data forward from
             // a previous compilation.
             if (containerFlags & 1 /* IsContainer */) {
-                if (node.kind !== 209 /* ArrowFunction */) {
+                if (node.kind !== 213 /* ArrowFunction */) {
                     thisParentContainer = container;
                 }
                 container = blockScopeContainer = node;
@@ -40698,13 +43641,13 @@ var ts;
                 // similarly to break statements that exit to a label just past the statement body.
                 if (!isIIFE) {
                     currentFlow = initFlowNode({ flags: 2 /* Start */ });
-                    if (containerFlags & (16 /* IsFunctionExpression */ | 128 /* IsObjectLiteralOrClassExpressionMethod */)) {
+                    if (containerFlags & (16 /* IsFunctionExpression */ | 128 /* IsObjectLiteralOrClassExpressionMethodOrAccessor */)) {
                         currentFlow.node = node;
                     }
                 }
                 // We create a return control flow graph for IIFEs and constructors. For constructors
                 // we use the return control flow graph in strict property initialization checks.
-                currentReturnTarget = isIIFE || node.kind === 166 /* Constructor */ || (ts.isInJSFile(node) && (node.kind === 251 /* FunctionDeclaration */ || node.kind === 208 /* FunctionExpression */)) ? createBranchLabel() : undefined;
+                currentReturnTarget = isIIFE || node.kind === 170 /* Constructor */ || node.kind === 169 /* ClassStaticBlockDeclaration */ || (ts.isInJSFile(node) && (node.kind === 255 /* FunctionDeclaration */ || node.kind === 212 /* FunctionExpression */)) ? createBranchLabel() : undefined;
                 currentExceptionTarget = undefined;
                 currentBreakTarget = undefined;
                 currentContinueTarget = undefined;
@@ -40719,13 +43662,14 @@ var ts;
                         node.flags |= 512 /* HasExplicitReturn */;
                     node.endFlowNode = currentFlow;
                 }
-                if (node.kind === 297 /* SourceFile */) {
+                if (node.kind === 303 /* SourceFile */) {
                     node.flags |= emitFlags;
+                    node.endFlowNode = currentFlow;
                 }
                 if (currentReturnTarget) {
                     addAntecedent(currentReturnTarget, currentFlow);
                     currentFlow = finishFlowLabel(currentReturnTarget);
-                    if (node.kind === 166 /* Constructor */ || (ts.isInJSFile(node) && (node.kind === 251 /* FunctionDeclaration */ || node.kind === 208 /* FunctionExpression */))) {
+                    if (node.kind === 170 /* Constructor */ || node.kind === 169 /* ClassStaticBlockDeclaration */ || (ts.isInJSFile(node) && (node.kind === 255 /* FunctionDeclaration */ || node.kind === 212 /* FunctionExpression */))) {
                         node.returnFlowNode = currentFlow;
                     }
                 }
@@ -40752,8 +43696,8 @@ var ts;
             blockScopeContainer = savedBlockScopeContainer;
         }
         function bindEachFunctionsFirst(nodes) {
-            bindEach(nodes, function (n) { return n.kind === 251 /* FunctionDeclaration */ ? bind(n) : undefined; });
-            bindEach(nodes, function (n) { return n.kind !== 251 /* FunctionDeclaration */ ? bind(n) : undefined; });
+            bindEach(nodes, function (n) { return n.kind === 255 /* FunctionDeclaration */ ? bind(n) : undefined; });
+            bindEach(nodes, function (n) { return n.kind !== 255 /* FunctionDeclaration */ ? bind(n) : undefined; });
         }
         function bindEach(nodes, bindFunction) {
             if (bindFunction === void 0) { bindFunction = bind; }
@@ -40776,59 +43720,59 @@ var ts;
                 inAssignmentPattern = saveInAssignmentPattern;
                 return;
             }
-            if (node.kind >= 232 /* FirstStatement */ && node.kind <= 248 /* LastStatement */ && !options.allowUnreachableCode) {
+            if (node.kind >= 236 /* FirstStatement */ && node.kind <= 252 /* LastStatement */ && !options.allowUnreachableCode) {
                 node.flowNode = currentFlow;
             }
             switch (node.kind) {
-                case 236 /* WhileStatement */:
+                case 240 /* WhileStatement */:
                     bindWhileStatement(node);
                     break;
-                case 235 /* DoStatement */:
+                case 239 /* DoStatement */:
                     bindDoStatement(node);
                     break;
-                case 237 /* ForStatement */:
+                case 241 /* ForStatement */:
                     bindForStatement(node);
                     break;
-                case 238 /* ForInStatement */:
-                case 239 /* ForOfStatement */:
+                case 242 /* ForInStatement */:
+                case 243 /* ForOfStatement */:
                     bindForInOrForOfStatement(node);
                     break;
-                case 234 /* IfStatement */:
+                case 238 /* IfStatement */:
                     bindIfStatement(node);
                     break;
-                case 242 /* ReturnStatement */:
-                case 246 /* ThrowStatement */:
+                case 246 /* ReturnStatement */:
+                case 250 /* ThrowStatement */:
                     bindReturnOrThrow(node);
                     break;
-                case 241 /* BreakStatement */:
-                case 240 /* ContinueStatement */:
+                case 245 /* BreakStatement */:
+                case 244 /* ContinueStatement */:
                     bindBreakOrContinueStatement(node);
                     break;
-                case 247 /* TryStatement */:
+                case 251 /* TryStatement */:
                     bindTryStatement(node);
                     break;
-                case 244 /* SwitchStatement */:
+                case 248 /* SwitchStatement */:
                     bindSwitchStatement(node);
                     break;
-                case 258 /* CaseBlock */:
+                case 262 /* CaseBlock */:
                     bindCaseBlock(node);
                     break;
-                case 284 /* CaseClause */:
+                case 288 /* CaseClause */:
                     bindCaseClause(node);
                     break;
-                case 233 /* ExpressionStatement */:
+                case 237 /* ExpressionStatement */:
                     bindExpressionStatement(node);
                     break;
-                case 245 /* LabeledStatement */:
+                case 249 /* LabeledStatement */:
                     bindLabeledStatement(node);
                     break;
-                case 214 /* PrefixUnaryExpression */:
+                case 218 /* PrefixUnaryExpression */:
                     bindPrefixUnaryExpressionFlow(node);
                     break;
-                case 215 /* PostfixUnaryExpression */:
+                case 219 /* PostfixUnaryExpression */:
                     bindPostfixUnaryExpressionFlow(node);
                     break;
-                case 216 /* BinaryExpression */:
+                case 220 /* BinaryExpression */:
                     if (ts.isDestructuringAssignment(node)) {
                         // Carry over whether we are in an assignment pattern to
                         // binary expressions that could actually be an initializer
@@ -40838,47 +43782,47 @@ var ts;
                     }
                     bindBinaryExpressionFlow(node);
                     break;
-                case 210 /* DeleteExpression */:
+                case 214 /* DeleteExpression */:
                     bindDeleteExpressionFlow(node);
                     break;
-                case 217 /* ConditionalExpression */:
+                case 221 /* ConditionalExpression */:
                     bindConditionalExpressionFlow(node);
                     break;
-                case 249 /* VariableDeclaration */:
+                case 253 /* VariableDeclaration */:
                     bindVariableDeclarationFlow(node);
                     break;
-                case 201 /* PropertyAccessExpression */:
-                case 202 /* ElementAccessExpression */:
+                case 205 /* PropertyAccessExpression */:
+                case 206 /* ElementAccessExpression */:
                     bindAccessExpressionFlow(node);
                     break;
-                case 203 /* CallExpression */:
+                case 207 /* CallExpression */:
                     bindCallExpressionFlow(node);
                     break;
-                case 225 /* NonNullExpression */:
+                case 229 /* NonNullExpression */:
                     bindNonNullExpressionFlow(node);
                     break;
-                case 331 /* JSDocTypedefTag */:
-                case 324 /* JSDocCallbackTag */:
-                case 325 /* JSDocEnumTag */:
+                case 343 /* JSDocTypedefTag */:
+                case 336 /* JSDocCallbackTag */:
+                case 337 /* JSDocEnumTag */:
                     bindJSDocTypeAlias(node);
                     break;
                 // In source files and blocks, bind functions first to match hoisting that occurs at runtime
-                case 297 /* SourceFile */: {
+                case 303 /* SourceFile */: {
                     bindEachFunctionsFirst(node.statements);
                     bind(node.endOfFileToken);
                     break;
                 }
-                case 230 /* Block */:
-                case 257 /* ModuleBlock */:
+                case 234 /* Block */:
+                case 261 /* ModuleBlock */:
                     bindEachFunctionsFirst(node.statements);
                     break;
-                case 198 /* BindingElement */:
+                case 202 /* BindingElement */:
                     bindBindingElementFlow(node);
                     break;
-                case 200 /* ObjectLiteralExpression */:
-                case 199 /* ArrayLiteralExpression */:
-                case 288 /* PropertyAssignment */:
-                case 220 /* SpreadElement */:
+                case 204 /* ObjectLiteralExpression */:
+                case 203 /* ArrayLiteralExpression */:
+                case 294 /* PropertyAssignment */:
+                case 224 /* SpreadElement */:
                     // Carry over whether we are in an assignment pattern of Object and Array literals
                     // as well as their children that are valid assignment targets.
                     inAssignmentPattern = saveInAssignmentPattern;
@@ -40892,32 +43836,32 @@ var ts;
         }
         function isNarrowingExpression(expr) {
             switch (expr.kind) {
-                case 78 /* Identifier */:
-                case 79 /* PrivateIdentifier */:
-                case 107 /* ThisKeyword */:
-                case 201 /* PropertyAccessExpression */:
-                case 202 /* ElementAccessExpression */:
+                case 79 /* Identifier */:
+                case 80 /* PrivateIdentifier */:
+                case 108 /* ThisKeyword */:
+                case 205 /* PropertyAccessExpression */:
+                case 206 /* ElementAccessExpression */:
                     return containsNarrowableReference(expr);
-                case 203 /* CallExpression */:
+                case 207 /* CallExpression */:
                     return hasNarrowableArgument(expr);
-                case 207 /* ParenthesizedExpression */:
-                case 225 /* NonNullExpression */:
+                case 211 /* ParenthesizedExpression */:
+                case 229 /* NonNullExpression */:
                     return isNarrowingExpression(expr.expression);
-                case 216 /* BinaryExpression */:
+                case 220 /* BinaryExpression */:
                     return isNarrowingBinaryExpression(expr);
-                case 214 /* PrefixUnaryExpression */:
+                case 218 /* PrefixUnaryExpression */:
                     return expr.operator === 53 /* ExclamationToken */ && isNarrowingExpression(expr.operand);
-                case 211 /* TypeOfExpression */:
+                case 215 /* TypeOfExpression */:
                     return isNarrowingExpression(expr.expression);
             }
             return false;
         }
         function isNarrowableReference(expr) {
-            return expr.kind === 78 /* Identifier */ || expr.kind === 79 /* PrivateIdentifier */ || expr.kind === 107 /* ThisKeyword */ || expr.kind === 105 /* SuperKeyword */ ||
-                (ts.isPropertyAccessExpression(expr) || ts.isNonNullExpression(expr) || ts.isParenthesizedExpression(expr)) && isNarrowableReference(expr.expression) ||
-                ts.isBinaryExpression(expr) && expr.operatorToken.kind === 27 /* CommaToken */ && isNarrowableReference(expr.right) ||
-                ts.isElementAccessExpression(expr) && ts.isStringOrNumericLiteralLike(expr.argumentExpression) && isNarrowableReference(expr.expression) ||
-                ts.isAssignmentExpression(expr) && isNarrowableReference(expr.left);
+            return ts.isDottedName(expr)
+                || (ts.isPropertyAccessExpression(expr) || ts.isNonNullExpression(expr) || ts.isParenthesizedExpression(expr)) && isNarrowableReference(expr.expression)
+                || ts.isBinaryExpression(expr) && expr.operatorToken.kind === 27 /* CommaToken */ && isNarrowableReference(expr.right)
+                || ts.isElementAccessExpression(expr) && ts.isStringOrNumericLiteralLike(expr.argumentExpression) && isNarrowableReference(expr.expression)
+                || ts.isAssignmentExpression(expr) && isNarrowableReference(expr.left);
         }
         function containsNarrowableReference(expr) {
             return isNarrowableReference(expr) || ts.isOptionalChain(expr) && containsNarrowableReference(expr.expression);
@@ -40931,7 +43875,7 @@ var ts;
                     }
                 }
             }
-            if (expr.expression.kind === 201 /* PropertyAccessExpression */ &&
+            if (expr.expression.kind === 205 /* PropertyAccessExpression */ &&
                 containsNarrowableReference(expr.expression.expression)) {
                 return true;
             }
@@ -40940,15 +43884,12 @@ var ts;
         function isNarrowingTypeofOperands(expr1, expr2) {
             return ts.isTypeOfExpression(expr1) && isNarrowableOperand(expr1.expression) && ts.isStringLiteralLike(expr2);
         }
-        function isNarrowableInOperands(left, right) {
-            return ts.isStringLiteralLike(left) && isNarrowingExpression(right);
-        }
         function isNarrowingBinaryExpression(expr) {
             switch (expr.operatorToken.kind) {
-                case 62 /* EqualsToken */:
-                case 74 /* BarBarEqualsToken */:
-                case 75 /* AmpersandAmpersandEqualsToken */:
-                case 76 /* QuestionQuestionEqualsToken */:
+                case 63 /* EqualsToken */:
+                case 75 /* BarBarEqualsToken */:
+                case 76 /* AmpersandAmpersandEqualsToken */:
+                case 77 /* QuestionQuestionEqualsToken */:
                     return containsNarrowableReference(expr.left);
                 case 34 /* EqualsEqualsToken */:
                 case 35 /* ExclamationEqualsToken */:
@@ -40956,10 +43897,10 @@ var ts;
                 case 37 /* ExclamationEqualsEqualsToken */:
                     return isNarrowableOperand(expr.left) || isNarrowableOperand(expr.right) ||
                         isNarrowingTypeofOperands(expr.right, expr.left) || isNarrowingTypeofOperands(expr.left, expr.right);
-                case 101 /* InstanceOfKeyword */:
+                case 102 /* InstanceOfKeyword */:
                     return isNarrowableOperand(expr.left);
-                case 100 /* InKeyword */:
-                    return isNarrowableInOperands(expr.left, expr.right);
+                case 101 /* InKeyword */:
+                    return isNarrowingExpression(expr.right);
                 case 27 /* CommaToken */:
                     return isNarrowingExpression(expr.right);
             }
@@ -40967,11 +43908,11 @@ var ts;
         }
         function isNarrowableOperand(expr) {
             switch (expr.kind) {
-                case 207 /* ParenthesizedExpression */:
+                case 211 /* ParenthesizedExpression */:
                     return isNarrowableOperand(expr.expression);
-                case 216 /* BinaryExpression */:
+                case 220 /* BinaryExpression */:
                     switch (expr.operatorToken.kind) {
-                        case 62 /* EqualsToken */:
+                        case 63 /* EqualsToken */:
                             return isNarrowableOperand(expr.left);
                         case 27 /* CommaToken */:
                             return isNarrowableOperand(expr.right);
@@ -41005,8 +43946,8 @@ var ts;
             if (!expression) {
                 return flags & 32 /* TrueCondition */ ? antecedent : unreachableFlow;
             }
-            if ((expression.kind === 109 /* TrueKeyword */ && flags & 64 /* FalseCondition */ ||
-                expression.kind === 94 /* FalseKeyword */ && flags & 32 /* TrueCondition */) &&
+            if ((expression.kind === 110 /* TrueKeyword */ && flags & 64 /* FalseCondition */ ||
+                expression.kind === 95 /* FalseKeyword */ && flags & 32 /* TrueCondition */) &&
                 !ts.isExpressionOfOptionalChainRoot(expression) && !ts.isNullishCoalesce(expression.parent)) {
                 return unreachableFlow;
             }
@@ -41045,26 +43986,26 @@ var ts;
         function isStatementCondition(node) {
             var parent = node.parent;
             switch (parent.kind) {
-                case 234 /* IfStatement */:
-                case 236 /* WhileStatement */:
-                case 235 /* DoStatement */:
+                case 238 /* IfStatement */:
+                case 240 /* WhileStatement */:
+                case 239 /* DoStatement */:
                     return parent.expression === node;
-                case 237 /* ForStatement */:
-                case 217 /* ConditionalExpression */:
+                case 241 /* ForStatement */:
+                case 221 /* ConditionalExpression */:
                     return parent.condition === node;
             }
             return false;
         }
         function isLogicalExpression(node) {
             while (true) {
-                if (node.kind === 207 /* ParenthesizedExpression */) {
+                if (node.kind === 211 /* ParenthesizedExpression */) {
                     node = node.expression;
                 }
-                else if (node.kind === 214 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) {
+                else if (node.kind === 218 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) {
                     node = node.operand;
                 }
                 else {
-                    return node.kind === 216 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ ||
+                    return node.kind === 220 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ ||
                         node.operatorToken.kind === 56 /* BarBarToken */ ||
                         node.operatorToken.kind === 60 /* QuestionQuestionToken */);
                 }
@@ -41111,7 +44052,7 @@ var ts;
         }
         function setContinueTarget(node, target) {
             var label = activeLabelList;
-            while (label && node.parent.kind === 245 /* LabeledStatement */) {
+            while (label && node.parent.kind === 249 /* LabeledStatement */) {
                 label.continueTarget = target;
                 label = label.next;
                 node = node.parent;
@@ -41162,12 +44103,12 @@ var ts;
             bind(node.expression);
             addAntecedent(preLoopLabel, currentFlow);
             currentFlow = preLoopLabel;
-            if (node.kind === 239 /* ForOfStatement */) {
+            if (node.kind === 243 /* ForOfStatement */) {
                 bind(node.awaitModifier);
             }
             addAntecedent(postLoopLabel, currentFlow);
             bind(node.initializer);
-            if (node.initializer.kind !== 250 /* VariableDeclarationList */) {
+            if (node.initializer.kind !== 254 /* VariableDeclarationList */) {
                 bindAssignmentTargetFlow(node.initializer);
             }
             bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel);
@@ -41189,7 +44130,7 @@ var ts;
         }
         function bindReturnOrThrow(node) {
             bind(node.expression);
-            if (node.kind === 242 /* ReturnStatement */) {
+            if (node.kind === 246 /* ReturnStatement */) {
                 hasExplicitReturn = true;
                 if (currentReturnTarget) {
                     addAntecedent(currentReturnTarget, currentFlow);
@@ -41206,7 +44147,7 @@ var ts;
             return undefined;
         }
         function bindBreakOrContinueFlow(node, breakTarget, continueTarget) {
-            var flowLabel = node.kind === 241 /* BreakStatement */ ? breakTarget : continueTarget;
+            var flowLabel = node.kind === 245 /* BreakStatement */ ? breakTarget : continueTarget;
             if (flowLabel) {
                 addAntecedent(flowLabel, currentFlow);
                 currentFlow = unreachableFlow;
@@ -41311,7 +44252,7 @@ var ts;
             preSwitchCaseFlow = currentFlow;
             bind(node.caseBlock);
             addAntecedent(postSwitchLabel, currentFlow);
-            var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 285 /* DefaultClause */; });
+            var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 289 /* DefaultClause */; });
             // We mark a switch statement as possibly exhaustive if it has no default clause and if all
             // case clauses have unreachable end points (e.g. they all return). Note, we no longer need
             // this property in control flow analysis, it's there only for backwards compatibility.
@@ -41359,9 +44300,9 @@ var ts;
         function maybeBindExpressionFlowIfCall(node) {
             // A top level or LHS of comma expression call expression with a dotted function name and at least one argument
             // is potentially an assertion and is therefore included in the control flow.
-            if (node.kind === 203 /* CallExpression */) {
+            if (node.kind === 207 /* CallExpression */) {
                 var call = node;
-                if (ts.isDottedName(call.expression) && call.expression.kind !== 105 /* SuperKeyword */) {
+                if (call.expression.kind !== 106 /* SuperKeyword */ && ts.isDottedName(call.expression)) {
                     currentFlow = createFlowCall(currentFlow, call);
                 }
             }
@@ -41385,7 +44326,7 @@ var ts;
             currentFlow = finishFlowLabel(postStatementLabel);
         }
         function bindDestructuringTargetFlow(node) {
-            if (node.kind === 216 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */) {
+            if (node.kind === 220 /* BinaryExpression */ && node.operatorToken.kind === 63 /* EqualsToken */) {
                 bindAssignmentTargetFlow(node.left);
             }
             else {
@@ -41396,10 +44337,10 @@ var ts;
             if (isNarrowableReference(node)) {
                 currentFlow = createFlowMutation(16 /* Assignment */, currentFlow, node);
             }
-            else if (node.kind === 199 /* ArrayLiteralExpression */) {
+            else if (node.kind === 203 /* ArrayLiteralExpression */) {
                 for (var _i = 0, _a = node.elements; _i < _a.length; _i++) {
                     var e = _a[_i];
-                    if (e.kind === 220 /* SpreadElement */) {
+                    if (e.kind === 224 /* SpreadElement */) {
                         bindAssignmentTargetFlow(e.expression);
                     }
                     else {
@@ -41407,16 +44348,16 @@ var ts;
                     }
                 }
             }
-            else if (node.kind === 200 /* ObjectLiteralExpression */) {
+            else if (node.kind === 204 /* ObjectLiteralExpression */) {
                 for (var _b = 0, _c = node.properties; _b < _c.length; _b++) {
                     var p = _c[_b];
-                    if (p.kind === 288 /* PropertyAssignment */) {
+                    if (p.kind === 294 /* PropertyAssignment */) {
                         bindDestructuringTargetFlow(p.initializer);
                     }
-                    else if (p.kind === 289 /* ShorthandPropertyAssignment */) {
+                    else if (p.kind === 295 /* ShorthandPropertyAssignment */) {
                         bindAssignmentTargetFlow(p.name);
                     }
-                    else if (p.kind === 290 /* SpreadAssignment */) {
+                    else if (p.kind === 296 /* SpreadAssignment */) {
                         bindAssignmentTargetFlow(p.expression);
                     }
                 }
@@ -41424,7 +44365,7 @@ var ts;
         }
         function bindLogicalLikeExpression(node, trueTarget, falseTarget) {
             var preRightLabel = createBranchLabel();
-            if (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || node.operatorToken.kind === 75 /* AmpersandAmpersandEqualsToken */) {
+            if (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || node.operatorToken.kind === 76 /* AmpersandAmpersandEqualsToken */) {
                 bindCondition(node.left, preRightLabel, falseTarget);
             }
             else {
@@ -41481,128 +44422,102 @@ var ts;
             }
             bindAssignmentTargetFlow(node.left);
         }
-        var BindBinaryExpressionFlowState;
-        (function (BindBinaryExpressionFlowState) {
-            BindBinaryExpressionFlowState[BindBinaryExpressionFlowState["BindThenBindChildren"] = 0] = "BindThenBindChildren";
-            BindBinaryExpressionFlowState[BindBinaryExpressionFlowState["MaybeBindLeft"] = 1] = "MaybeBindLeft";
-            BindBinaryExpressionFlowState[BindBinaryExpressionFlowState["BindToken"] = 2] = "BindToken";
-            BindBinaryExpressionFlowState[BindBinaryExpressionFlowState["BindRight"] = 3] = "BindRight";
-            BindBinaryExpressionFlowState[BindBinaryExpressionFlowState["FinishBind"] = 4] = "FinishBind";
-        })(BindBinaryExpressionFlowState || (BindBinaryExpressionFlowState = {}));
-        function bindBinaryExpressionFlow(node) {
-            var workStacks = {
-                expr: [node],
-                state: [1 /* MaybeBindLeft */],
-                inStrictMode: [undefined],
-                parent: [undefined],
-            };
-            var stackIndex = 0;
-            while (stackIndex >= 0) {
-                node = workStacks.expr[stackIndex];
-                switch (workStacks.state[stackIndex]) {
-                    case 0 /* BindThenBindChildren */: {
-                        // This state is used only when recuring, to emulate the work that `bind` does before
-                        // reaching `bindChildren`. A normal call to `bindBinaryExpressionFlow` will already have done this work.
-                        ts.setParent(node, parent);
-                        var saveInStrictMode = inStrictMode;
-                        bindWorker(node);
-                        var saveParent = parent;
-                        parent = node;
-                        advanceState(1 /* MaybeBindLeft */, saveInStrictMode, saveParent);
-                        break;
-                    }
-                    case 1 /* MaybeBindLeft */: {
-                        var operator = node.operatorToken.kind;
-                        // TODO: bindLogicalExpression is recursive - if we want to handle deeply nested `&&` expressions
-                        // we'll need to handle the `bindLogicalExpression` scenarios in this state machine, too
-                        // For now, though, since the common cases are chained `+`, leaving it recursive is fine
-                        if (operator === 55 /* AmpersandAmpersandToken */ || operator === 56 /* BarBarToken */ || operator === 60 /* QuestionQuestionToken */ ||
-                            ts.isLogicalOrCoalescingAssignmentOperator(operator)) {
-                            if (isTopLevelLogicalExpression(node)) {
-                                var postExpressionLabel = createBranchLabel();
-                                bindLogicalLikeExpression(node, postExpressionLabel, postExpressionLabel);
-                                currentFlow = finishFlowLabel(postExpressionLabel);
-                            }
-                            else {
-                                bindLogicalLikeExpression(node, currentTrueTarget, currentFalseTarget);
-                            }
-                            completeNode();
-                        }
-                        else {
-                            advanceState(2 /* BindToken */);
-                            maybeBind(node.left);
-                        }
-                        break;
+        function createBindBinaryExpressionFlow() {
+            return ts.createBinaryExpressionTrampoline(onEnter, onLeft, onOperator, onRight, onExit, /*foldState*/ undefined);
+            function onEnter(node, state) {
+                if (state) {
+                    state.stackIndex++;
+                    // Emulate the work that `bind` does before reaching `bindChildren`. A normal call to
+                    // `bindBinaryExpressionFlow` will already have done this work.
+                    ts.setParent(node, parent);
+                    var saveInStrictMode = inStrictMode;
+                    bindWorker(node);
+                    var saveParent = parent;
+                    parent = node;
+                    state.skip = false;
+                    state.inStrictModeStack[state.stackIndex] = saveInStrictMode;
+                    state.parentStack[state.stackIndex] = saveParent;
+                }
+                else {
+                    state = {
+                        stackIndex: 0,
+                        skip: false,
+                        inStrictModeStack: [undefined],
+                        parentStack: [undefined]
+                    };
+                }
+                // TODO: bindLogicalExpression is recursive - if we want to handle deeply nested `&&` expressions
+                // we'll need to handle the `bindLogicalExpression` scenarios in this state machine, too
+                // For now, though, since the common cases are chained `+`, leaving it recursive is fine
+                var operator = node.operatorToken.kind;
+                if (operator === 55 /* AmpersandAmpersandToken */ ||
+                    operator === 56 /* BarBarToken */ ||
+                    operator === 60 /* QuestionQuestionToken */ ||
+                    ts.isLogicalOrCoalescingAssignmentOperator(operator)) {
+                    if (isTopLevelLogicalExpression(node)) {
+                        var postExpressionLabel = createBranchLabel();
+                        bindLogicalLikeExpression(node, postExpressionLabel, postExpressionLabel);
+                        currentFlow = finishFlowLabel(postExpressionLabel);
                     }
-                    case 2 /* BindToken */: {
-                        if (node.operatorToken.kind === 27 /* CommaToken */) {
-                            maybeBindExpressionFlowIfCall(node.left);
-                        }
-                        advanceState(3 /* BindRight */);
-                        maybeBind(node.operatorToken);
-                        break;
+                    else {
+                        bindLogicalLikeExpression(node, currentTrueTarget, currentFalseTarget);
                     }
-                    case 3 /* BindRight */: {
-                        advanceState(4 /* FinishBind */);
-                        maybeBind(node.right);
-                        break;
+                    state.skip = true;
+                }
+                return state;
+            }
+            function onLeft(left, state, _node) {
+                if (!state.skip) {
+                    return maybeBind(left);
+                }
+            }
+            function onOperator(operatorToken, state, node) {
+                if (!state.skip) {
+                    if (operatorToken.kind === 27 /* CommaToken */) {
+                        maybeBindExpressionFlowIfCall(node.left);
                     }
-                    case 4 /* FinishBind */: {
-                        var operator = node.operatorToken.kind;
-                        if (ts.isAssignmentOperator(operator) && !ts.isAssignmentTarget(node)) {
-                            bindAssignmentTargetFlow(node.left);
-                            if (operator === 62 /* EqualsToken */ && node.left.kind === 202 /* ElementAccessExpression */) {
-                                var elementAccess = node.left;
-                                if (isNarrowableOperand(elementAccess.expression)) {
-                                    currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node);
-                                }
+                    bind(operatorToken);
+                }
+            }
+            function onRight(right, state, _node) {
+                if (!state.skip) {
+                    return maybeBind(right);
+                }
+            }
+            function onExit(node, state) {
+                if (!state.skip) {
+                    var operator = node.operatorToken.kind;
+                    if (ts.isAssignmentOperator(operator) && !ts.isAssignmentTarget(node)) {
+                        bindAssignmentTargetFlow(node.left);
+                        if (operator === 63 /* EqualsToken */ && node.left.kind === 206 /* ElementAccessExpression */) {
+                            var elementAccess = node.left;
+                            if (isNarrowableOperand(elementAccess.expression)) {
+                                currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node);
                             }
                         }
-                        completeNode();
-                        break;
                     }
-                    default: return ts.Debug.fail("Invalid state " + workStacks.state[stackIndex] + " for bindBinaryExpressionFlow");
-                }
-            }
-            /**
-             * Note that `advanceState` sets the _current_ head state, and that `maybeBind` potentially pushes on a new
-             * head state; so `advanceState` must be called before any `maybeBind` during a state's execution.
-             */
-            function advanceState(state, isInStrictMode, parent) {
-                workStacks.state[stackIndex] = state;
-                if (isInStrictMode !== undefined) {
-                    workStacks.inStrictMode[stackIndex] = isInStrictMode;
                 }
-                if (parent !== undefined) {
-                    workStacks.parent[stackIndex] = parent;
+                var savedInStrictMode = state.inStrictModeStack[state.stackIndex];
+                var savedParent = state.parentStack[state.stackIndex];
+                if (savedInStrictMode !== undefined) {
+                    inStrictMode = savedInStrictMode;
                 }
-            }
-            function completeNode() {
-                if (workStacks.inStrictMode[stackIndex] !== undefined) {
-                    inStrictMode = workStacks.inStrictMode[stackIndex];
-                    parent = workStacks.parent[stackIndex];
+                if (savedParent !== undefined) {
+                    parent = savedParent;
                 }
-                stackIndex--;
+                state.skip = false;
+                state.stackIndex--;
             }
-            /**
-             * If `node` is a BinaryExpression, adds it to the local work stack, otherwise recursively binds it
-             */
             function maybeBind(node) {
                 if (node && ts.isBinaryExpression(node) && !ts.isDestructuringAssignment(node)) {
-                    stackIndex++;
-                    workStacks.expr[stackIndex] = node;
-                    workStacks.state[stackIndex] = 0 /* BindThenBindChildren */;
-                    workStacks.inStrictMode[stackIndex] = undefined;
-                    workStacks.parent[stackIndex] = undefined;
-                }
-                else {
-                    bind(node);
+                    return node;
                 }
+                bind(node);
             }
         }
         function bindDeleteExpressionFlow(node) {
             bindEachChild(node);
-            if (node.expression.kind === 201 /* PropertyAccessExpression */) {
+            if (node.expression.kind === 205 /* PropertyAccessExpression */) {
                 bindAssignmentTargetFlow(node.expression);
             }
         }
@@ -41658,16 +44573,20 @@ var ts;
             }
         }
         function bindJSDocTypeAlias(node) {
-            ts.setParent(node.tagName, node);
-            if (node.kind !== 325 /* JSDocEnumTag */ && node.fullName) {
+            bind(node.tagName);
+            if (node.kind !== 337 /* JSDocEnumTag */ && node.fullName) {
+                // don't bind the type name yet; that's delayed until delayedBindJSDocTypedefTag
                 ts.setParent(node.fullName, node);
                 ts.setParentRecursive(node.fullName, /*incremental*/ false);
             }
+            if (typeof node.comment !== "string") {
+                bindEach(node.comment);
+            }
         }
         function bindJSDocClassTag(node) {
             bindEachChild(node);
             var host = ts.getHostSignatureFromJSDoc(node);
-            if (host && host.kind !== 165 /* MethodDeclaration */) {
+            if (host && host.kind !== 168 /* MethodDeclaration */) {
                 addDeclarationToSymbol(host.symbol, host, 32 /* Class */);
             }
         }
@@ -41680,15 +44599,15 @@ var ts;
         }
         function bindOptionalChainRest(node) {
             switch (node.kind) {
-                case 201 /* PropertyAccessExpression */:
+                case 205 /* PropertyAccessExpression */:
                     bind(node.questionDotToken);
                     bind(node.name);
                     break;
-                case 202 /* ElementAccessExpression */:
+                case 206 /* ElementAccessExpression */:
                     bind(node.questionDotToken);
                     bind(node.argumentExpression);
                     break;
-                case 203 /* CallExpression */:
+                case 207 /* CallExpression */:
                     bind(node.questionDotToken);
                     bindEach(node.typeArguments);
                     bindEach(node.arguments);
@@ -41753,19 +44672,19 @@ var ts;
                 // an immediately invoked function expression (IIFE). Initialize the flowNode property to
                 // the current control flow (which includes evaluation of the IIFE arguments).
                 var expr = ts.skipParentheses(node.expression);
-                if (expr.kind === 208 /* FunctionExpression */ || expr.kind === 209 /* ArrowFunction */) {
+                if (expr.kind === 212 /* FunctionExpression */ || expr.kind === 213 /* ArrowFunction */) {
                     bindEach(node.typeArguments);
                     bindEach(node.arguments);
                     bind(node.expression);
                 }
                 else {
                     bindEachChild(node);
-                    if (node.expression.kind === 105 /* SuperKeyword */) {
+                    if (node.expression.kind === 106 /* SuperKeyword */) {
                         currentFlow = createFlowCall(currentFlow, node);
                     }
                 }
             }
-            if (node.expression.kind === 201 /* PropertyAccessExpression */) {
+            if (node.expression.kind === 205 /* PropertyAccessExpression */) {
                 var propertyAccess = node.expression;
                 if (ts.isIdentifier(propertyAccess.name) && isNarrowableOperand(propertyAccess.expression) && ts.isPushOrUnshiftIdentifier(propertyAccess.name)) {
                     currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node);
@@ -41774,54 +44693,55 @@ var ts;
         }
         function getContainerFlags(node) {
             switch (node.kind) {
-                case 221 /* ClassExpression */:
-                case 252 /* ClassDeclaration */:
-                case 255 /* EnumDeclaration */:
-                case 200 /* ObjectLiteralExpression */:
-                case 177 /* TypeLiteral */:
-                case 312 /* JSDocTypeLiteral */:
-                case 281 /* JsxAttributes */:
+                case 225 /* ClassExpression */:
+                case 256 /* ClassDeclaration */:
+                case 259 /* EnumDeclaration */:
+                case 204 /* ObjectLiteralExpression */:
+                case 181 /* TypeLiteral */:
+                case 320 /* JSDocTypeLiteral */:
+                case 285 /* JsxAttributes */:
                     return 1 /* IsContainer */;
-                case 253 /* InterfaceDeclaration */:
+                case 257 /* InterfaceDeclaration */:
                     return 1 /* IsContainer */ | 64 /* IsInterface */;
-                case 256 /* ModuleDeclaration */:
-                case 254 /* TypeAliasDeclaration */:
-                case 190 /* MappedType */:
+                case 260 /* ModuleDeclaration */:
+                case 258 /* TypeAliasDeclaration */:
+                case 194 /* MappedType */:
                     return 1 /* IsContainer */ | 32 /* HasLocals */;
-                case 297 /* SourceFile */:
+                case 303 /* SourceFile */:
                     return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */;
-                case 165 /* MethodDeclaration */:
-                    if (ts.isObjectLiteralOrClassExpressionMethod(node)) {
-                        return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 128 /* IsObjectLiteralOrClassExpressionMethod */;
+                case 171 /* GetAccessor */:
+                case 172 /* SetAccessor */:
+                case 168 /* MethodDeclaration */:
+                    if (ts.isObjectLiteralOrClassExpressionMethodOrAccessor(node)) {
+                        return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 128 /* IsObjectLiteralOrClassExpressionMethodOrAccessor */;
                     }
                 // falls through
-                case 166 /* Constructor */:
-                case 251 /* FunctionDeclaration */:
-                case 164 /* MethodSignature */:
-                case 167 /* GetAccessor */:
-                case 168 /* SetAccessor */:
-                case 169 /* CallSignature */:
-                case 313 /* JSDocSignature */:
-                case 308 /* JSDocFunctionType */:
-                case 174 /* FunctionType */:
-                case 170 /* ConstructSignature */:
-                case 171 /* IndexSignature */:
-                case 175 /* ConstructorType */:
+                case 170 /* Constructor */:
+                case 255 /* FunctionDeclaration */:
+                case 167 /* MethodSignature */:
+                case 173 /* CallSignature */:
+                case 321 /* JSDocSignature */:
+                case 315 /* JSDocFunctionType */:
+                case 178 /* FunctionType */:
+                case 174 /* ConstructSignature */:
+                case 175 /* IndexSignature */:
+                case 179 /* ConstructorType */:
+                case 169 /* ClassStaticBlockDeclaration */:
                     return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */;
-                case 208 /* FunctionExpression */:
-                case 209 /* ArrowFunction */:
+                case 212 /* FunctionExpression */:
+                case 213 /* ArrowFunction */:
                     return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */;
-                case 257 /* ModuleBlock */:
+                case 261 /* ModuleBlock */:
                     return 4 /* IsControlFlowContainer */;
-                case 163 /* PropertyDeclaration */:
+                case 166 /* PropertyDeclaration */:
                     return node.initializer ? 4 /* IsControlFlowContainer */ : 0;
-                case 287 /* CatchClause */:
-                case 237 /* ForStatement */:
-                case 238 /* ForInStatement */:
-                case 239 /* ForOfStatement */:
-                case 258 /* CaseBlock */:
+                case 291 /* CatchClause */:
+                case 241 /* ForStatement */:
+                case 242 /* ForInStatement */:
+                case 243 /* ForOfStatement */:
+                case 262 /* CaseBlock */:
                     return 2 /* IsBlockScopedContainer */;
-                case 230 /* Block */:
+                case 234 /* Block */:
                     // do not treat blocks directly inside a function as a block-scoped-container.
                     // Locals that reside in this block should go to the function locals. Otherwise 'x'
                     // would not appear to be a redeclaration of a block scoped local in the following
@@ -41838,7 +44758,7 @@ var ts;
                     // By not creating a new block-scoped-container here, we ensure that both 'var x'
                     // and 'let x' go into the Function-container's locals, and we do get a collision
                     // conflict.
-                    return ts.isFunctionLike(node.parent) ? 0 /* None */ : 2 /* IsBlockScopedContainer */;
+                    return ts.isFunctionLike(node.parent) || ts.isClassStaticBlockDeclaration(node.parent) ? 0 /* None */ : 2 /* IsBlockScopedContainer */;
             }
             return 0 /* None */;
         }
@@ -41854,45 +44774,46 @@ var ts;
                 // members are declared (for example, a member of a class will go into a specific
                 // symbol table depending on if it is static or not). We defer to specialized
                 // handlers to take care of declaring these child members.
-                case 256 /* ModuleDeclaration */:
+                case 260 /* ModuleDeclaration */:
                     return declareModuleMember(node, symbolFlags, symbolExcludes);
-                case 297 /* SourceFile */:
+                case 303 /* SourceFile */:
                     return declareSourceFileMember(node, symbolFlags, symbolExcludes);
-                case 221 /* ClassExpression */:
-                case 252 /* ClassDeclaration */:
+                case 225 /* ClassExpression */:
+                case 256 /* ClassDeclaration */:
                     return declareClassMember(node, symbolFlags, symbolExcludes);
-                case 255 /* EnumDeclaration */:
+                case 259 /* EnumDeclaration */:
                     return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
-                case 177 /* TypeLiteral */:
-                case 312 /* JSDocTypeLiteral */:
-                case 200 /* ObjectLiteralExpression */:
-                case 253 /* InterfaceDeclaration */:
-                case 281 /* JsxAttributes */:
+                case 181 /* TypeLiteral */:
+                case 320 /* JSDocTypeLiteral */:
+                case 204 /* ObjectLiteralExpression */:
+                case 257 /* InterfaceDeclaration */:
+                case 285 /* JsxAttributes */:
                     // Interface/Object-types always have their children added to the 'members' of
                     // their container. They are only accessible through an instance of their
                     // container, and are never in scope otherwise (even inside the body of the
                     // object / type / interface declaring them). An exception is type parameters,
                     // which are in scope without qualification (similar to 'locals').
                     return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes);
-                case 174 /* FunctionType */:
-                case 175 /* ConstructorType */:
-                case 169 /* CallSignature */:
-                case 170 /* ConstructSignature */:
-                case 313 /* JSDocSignature */:
-                case 171 /* IndexSignature */:
-                case 165 /* MethodDeclaration */:
-                case 164 /* MethodSignature */:
-                case 166 /* Constructor */:
-                case 167 /* GetAccessor */:
-                case 168 /* SetAccessor */:
-                case 251 /* FunctionDeclaration */:
-                case 208 /* FunctionExpression */:
-                case 209 /* ArrowFunction */:
-                case 308 /* JSDocFunctionType */:
-                case 331 /* JSDocTypedefTag */:
-                case 324 /* JSDocCallbackTag */:
-                case 254 /* TypeAliasDeclaration */:
-                case 190 /* MappedType */:
+                case 178 /* FunctionType */:
+                case 179 /* ConstructorType */:
+                case 173 /* CallSignature */:
+                case 174 /* ConstructSignature */:
+                case 321 /* JSDocSignature */:
+                case 175 /* IndexSignature */:
+                case 168 /* MethodDeclaration */:
+                case 167 /* MethodSignature */:
+                case 170 /* Constructor */:
+                case 171 /* GetAccessor */:
+                case 172 /* SetAccessor */:
+                case 255 /* FunctionDeclaration */:
+                case 212 /* FunctionExpression */:
+                case 213 /* ArrowFunction */:
+                case 315 /* JSDocFunctionType */:
+                case 343 /* JSDocTypedefTag */:
+                case 336 /* JSDocCallbackTag */:
+                case 169 /* ClassStaticBlockDeclaration */:
+                case 258 /* TypeAliasDeclaration */:
+                case 194 /* MappedType */:
                     // All the children of these container types are never visible through another
                     // symbol (i.e. through another symbol's 'exports' or 'members').  Instead,
                     // they're only accessed 'lexically' (i.e. from code that exists underneath
@@ -41903,7 +44824,7 @@ var ts;
             }
         }
         function declareClassMember(node, symbolFlags, symbolExcludes) {
-            return ts.hasSyntacticModifier(node, 32 /* Static */)
+            return ts.isStatic(node)
                 ? declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes)
                 : declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes);
         }
@@ -41939,15 +44860,13 @@ var ts;
                     var pattern = void 0;
                     if (node.name.kind === 10 /* StringLiteral */) {
                         var text = node.name.text;
-                        if (ts.hasZeroOrOneAsteriskCharacter(text)) {
-                            pattern = ts.tryParsePattern(text);
-                        }
-                        else {
+                        pattern = ts.tryParsePattern(text);
+                        if (pattern === undefined) {
                             errorOnFirstToken(node.name, ts.Diagnostics.Pattern_0_can_have_at_most_one_Asterisk_character, text);
                         }
                     }
                     var symbol = declareSymbolAndAddToSymbolTable(node, 512 /* ValueModule */, 110735 /* ValueModuleExcludes */);
-                    file.patternAmbientModules = ts.append(file.patternAmbientModules, pattern && { pattern: pattern, symbol: symbol });
+                    file.patternAmbientModules = ts.append(file.patternAmbientModules, pattern && !ts.isString(pattern) ? { pattern: pattern, symbol: symbol } : undefined);
                 }
             }
             else {
@@ -41993,7 +44912,7 @@ var ts;
                 var seen = new ts.Map();
                 for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {
                     var prop = _a[_i];
-                    if (prop.kind === 290 /* SpreadAssignment */ || prop.name.kind !== 78 /* Identifier */) {
+                    if (prop.kind === 296 /* SpreadAssignment */ || prop.name.kind !== 79 /* Identifier */) {
                         continue;
                     }
                     var identifier = prop.name;
@@ -42005,7 +44924,7 @@ var ts;
                     //    c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true.
                     //    d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true
                     // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields
-                    var currentKind = prop.kind === 288 /* PropertyAssignment */ || prop.kind === 289 /* ShorthandPropertyAssignment */ || prop.kind === 165 /* MethodDeclaration */
+                    var currentKind = prop.kind === 294 /* PropertyAssignment */ || prop.kind === 295 /* ShorthandPropertyAssignment */ || prop.kind === 168 /* MethodDeclaration */
                         ? 1 /* Property */
                         : 2 /* Accessor */;
                     var existingKind = seen.get(identifier.escapedText);
@@ -42037,10 +44956,10 @@ var ts;
         }
         function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) {
             switch (blockScopeContainer.kind) {
-                case 256 /* ModuleDeclaration */:
+                case 260 /* ModuleDeclaration */:
                     declareModuleMember(node, symbolFlags, symbolExcludes);
                     break;
-                case 297 /* SourceFile */:
+                case 303 /* SourceFile */:
                     if (ts.isExternalOrCommonJsModule(container)) {
                         declareModuleMember(node, symbolFlags, symbolExcludes);
                         break;
@@ -42065,9 +44984,9 @@ var ts;
             var saveCurrentFlow = currentFlow;
             for (var _i = 0, delayedTypeAliases_1 = delayedTypeAliases; _i < delayedTypeAliases_1.length; _i++) {
                 var typeAlias = delayedTypeAliases_1[_i];
-                var host = ts.getJSDocHost(typeAlias);
-                container = (host && ts.findAncestor(host.parent, function (n) { return !!(getContainerFlags(n) & 1 /* IsContainer */); })) || file;
-                blockScopeContainer = (host && ts.getEnclosingBlockScopeContainer(host)) || file;
+                var host = typeAlias.parent.parent;
+                container = ts.findAncestor(host.parent, function (n) { return !!(getContainerFlags(n) & 1 /* IsContainer */); }) || file;
+                blockScopeContainer = ts.getEnclosingBlockScopeContainer(host) || file;
                 currentFlow = initFlowNode({ flags: 2 /* Start */ });
                 parent = typeAlias;
                 bind(typeAlias.typeExpression);
@@ -42108,7 +45027,7 @@ var ts;
                         container = oldContainer;
                     }
                 }
-                else if (ts.isJSDocEnumTag(typeAlias) || !typeAlias.fullName || typeAlias.fullName.kind === 78 /* Identifier */) {
+                else if (ts.isJSDocEnumTag(typeAlias) || !typeAlias.fullName || typeAlias.fullName.kind === 79 /* Identifier */) {
                     parent = typeAlias.parent;
                     bindBlockScopedDeclaration(typeAlias, 524288 /* TypeAlias */, 788968 /* TypeAliasExcludes */);
                 }
@@ -42133,11 +45052,11 @@ var ts;
                 !ts.isIdentifierName(node)) {
                 // strict mode identifiers
                 if (inStrictMode &&
-                    node.originalKeywordKind >= 116 /* FirstFutureReservedWord */ &&
-                    node.originalKeywordKind <= 124 /* LastFutureReservedWord */) {
+                    node.originalKeywordKind >= 117 /* FirstFutureReservedWord */ &&
+                    node.originalKeywordKind <= 125 /* LastFutureReservedWord */) {
                     file.bindDiagnostics.push(createDiagnosticForNode(node, getStrictModeIdentifierMessage(node), ts.declarationNameToString(node)));
                 }
-                else if (node.originalKeywordKind === 130 /* AwaitKeyword */) {
+                else if (node.originalKeywordKind === 132 /* AwaitKeyword */) {
                     if (ts.isExternalModule(file) && ts.isInTopLevelContext(node)) {
                         file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module, ts.declarationNameToString(node)));
                     }
@@ -42145,7 +45064,7 @@ var ts;
                         file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here, ts.declarationNameToString(node)));
                     }
                 }
-                else if (node.originalKeywordKind === 124 /* YieldKeyword */ && node.flags & 8192 /* YieldContext */) {
+                else if (node.originalKeywordKind === 125 /* YieldKeyword */ && node.flags & 8192 /* YieldContext */) {
                     file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here, ts.declarationNameToString(node)));
                 }
             }
@@ -42187,7 +45106,7 @@ var ts;
         }
         function checkStrictModeDeleteExpression(node) {
             // Grammar checking
-            if (inStrictMode && node.expression.kind === 78 /* Identifier */) {
+            if (inStrictMode && node.expression.kind === 79 /* Identifier */) {
                 // When a delete operator occurs within strict mode code, a SyntaxError is thrown if its
                 // UnaryExpression is a direct reference to a variable, function argument, or function name
                 var span = ts.getErrorSpanForNode(file, node.expression);
@@ -42198,7 +45117,7 @@ var ts;
             return ts.isIdentifier(node) && (node.escapedText === "eval" || node.escapedText === "arguments");
         }
         function checkStrictModeEvalOrArguments(contextNode, name) {
-            if (name && name.kind === 78 /* Identifier */) {
+            if (name && name.kind === 79 /* Identifier */) {
                 var identifier = name;
                 if (isEvalOrArgumentsIdentifier(identifier)) {
                     // We check first if the name is inside class declaration or class expression; if so give explicit message
@@ -42212,7 +45131,7 @@ var ts;
             // Provide specialized messages to help the user understand why we think they're in
             // strict mode.
             if (ts.getContainingClass(node)) {
-                return ts.Diagnostics.Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode;
+                return ts.Diagnostics.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;
             }
             if (file.externalModuleIndicator) {
                 return ts.Diagnostics.Invalid_use_of_0_Modules_are_automatically_in_strict_mode;
@@ -42239,9 +45158,9 @@ var ts;
         function checkStrictModeFunctionDeclaration(node) {
             if (languageVersion < 2 /* ES2015 */) {
                 // Report error if function is not top level function declaration
-                if (blockScopeContainer.kind !== 297 /* SourceFile */ &&
-                    blockScopeContainer.kind !== 256 /* ModuleDeclaration */ &&
-                    !ts.isFunctionLike(blockScopeContainer)) {
+                if (blockScopeContainer.kind !== 303 /* SourceFile */ &&
+                    blockScopeContainer.kind !== 260 /* ModuleDeclaration */ &&
+                    !ts.isFunctionLikeOrClassStaticBlockDeclaration(blockScopeContainer)) {
                     // We check first if the name is inside class declaration or class expression; if so give explicit message
                     // otherwise report generic error message.
                     var errorSpan = ts.getErrorSpanForNode(file, node);
@@ -42279,7 +45198,7 @@ var ts;
         }
         function checkStrictModeLabeledStatement(node) {
             // Grammar checking for labeledStatement
-            if (inStrictMode && options.target >= 2 /* ES2015 */) {
+            if (inStrictMode && ts.getEmitScriptTarget(options) >= 2 /* ES2015 */) {
                 if (ts.isDeclarationStatement(node.statement) || ts.isVariableStatement(node.statement)) {
                     errorOnFirstToken(node.label, ts.Diagnostics.A_label_is_not_allowed_here);
                 }
@@ -42335,7 +45254,7 @@ var ts;
             // the current 'container' node when it changes. This helps us know which symbol table
             // a local should go into for example. Since terminal nodes are known not to have
             // children, as an optimization we don't process those.
-            if (node.kind > 156 /* LastToken */) {
+            if (node.kind > 159 /* LastToken */) {
                 var saveParent = parent;
                 parent = node;
                 var containerFlags = getContainerFlags(node);
@@ -42397,7 +45316,7 @@ var ts;
         function bindWorker(node) {
             switch (node.kind) {
                 /* Strict mode checks */
-                case 78 /* Identifier */:
+                case 79 /* Identifier */:
                     // for typedef type names with namespaces, bind the new jsdoc type symbol here
                     // because it requires all containing namespaces to be in effect, namely the
                     // current "blockScopeContainer" needs to be set to its immediate namespace parent.
@@ -42410,23 +45329,24 @@ var ts;
                         break;
                     }
                 // falls through
-                case 107 /* ThisKeyword */:
-                    if (currentFlow && (ts.isExpression(node) || parent.kind === 289 /* ShorthandPropertyAssignment */)) {
+                case 108 /* ThisKeyword */:
+                    if (currentFlow && (ts.isExpression(node) || parent.kind === 295 /* ShorthandPropertyAssignment */)) {
                         node.flowNode = currentFlow;
                     }
                     return checkContextualIdentifier(node);
-                case 157 /* QualifiedName */:
-                    if (currentFlow && parent.kind === 176 /* TypeQuery */) {
+                case 160 /* QualifiedName */:
+                    if (currentFlow && ts.isPartOfTypeQuery(node)) {
                         node.flowNode = currentFlow;
                     }
                     break;
-                case 105 /* SuperKeyword */:
+                case 230 /* MetaProperty */:
+                case 106 /* SuperKeyword */:
                     node.flowNode = currentFlow;
                     break;
-                case 79 /* PrivateIdentifier */:
+                case 80 /* PrivateIdentifier */:
                     return checkPrivateIdentifier(node);
-                case 201 /* PropertyAccessExpression */:
-                case 202 /* ElementAccessExpression */:
+                case 205 /* PropertyAccessExpression */:
+                case 206 /* ElementAccessExpression */:
                     var expr = node;
                     if (currentFlow && isNarrowableReference(expr)) {
                         expr.flowNode = currentFlow;
@@ -42441,7 +45361,7 @@ var ts;
                         declareSymbol(file.locals, /*parent*/ undefined, expr.expression, 1 /* FunctionScopedVariable */ | 134217728 /* ModuleExports */, 111550 /* FunctionScopedVariableExcludes */);
                     }
                     break;
-                case 216 /* BinaryExpression */:
+                case 220 /* BinaryExpression */:
                     var specialKind = ts.getAssignmentDeclarationKind(node);
                     switch (specialKind) {
                         case 1 /* ExportsProperty */:
@@ -42477,78 +45397,78 @@ var ts;
                             ts.Debug.fail("Unknown binary expression special property assignment kind");
                     }
                     return checkStrictModeBinaryExpression(node);
-                case 287 /* CatchClause */:
+                case 291 /* CatchClause */:
                     return checkStrictModeCatchClause(node);
-                case 210 /* DeleteExpression */:
+                case 214 /* DeleteExpression */:
                     return checkStrictModeDeleteExpression(node);
                 case 8 /* NumericLiteral */:
                     return checkStrictModeNumericLiteral(node);
-                case 215 /* PostfixUnaryExpression */:
+                case 219 /* PostfixUnaryExpression */:
                     return checkStrictModePostfixUnaryExpression(node);
-                case 214 /* PrefixUnaryExpression */:
+                case 218 /* PrefixUnaryExpression */:
                     return checkStrictModePrefixUnaryExpression(node);
-                case 243 /* WithStatement */:
+                case 247 /* WithStatement */:
                     return checkStrictModeWithStatement(node);
-                case 245 /* LabeledStatement */:
+                case 249 /* LabeledStatement */:
                     return checkStrictModeLabeledStatement(node);
-                case 187 /* ThisType */:
+                case 191 /* ThisType */:
                     seenThisKeyword = true;
                     return;
-                case 172 /* TypePredicate */:
+                case 176 /* TypePredicate */:
                     break; // Binding the children will handle everything
-                case 159 /* TypeParameter */:
+                case 162 /* TypeParameter */:
                     return bindTypeParameter(node);
-                case 160 /* Parameter */:
+                case 163 /* Parameter */:
                     return bindParameter(node);
-                case 249 /* VariableDeclaration */:
+                case 253 /* VariableDeclaration */:
                     return bindVariableDeclarationOrBindingElement(node);
-                case 198 /* BindingElement */:
+                case 202 /* BindingElement */:
                     node.flowNode = currentFlow;
                     return bindVariableDeclarationOrBindingElement(node);
-                case 163 /* PropertyDeclaration */:
-                case 162 /* PropertySignature */:
+                case 166 /* PropertyDeclaration */:
+                case 165 /* PropertySignature */:
                     return bindPropertyWorker(node);
-                case 288 /* PropertyAssignment */:
-                case 289 /* ShorthandPropertyAssignment */:
+                case 294 /* PropertyAssignment */:
+                case 295 /* ShorthandPropertyAssignment */:
                     return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 0 /* PropertyExcludes */);
-                case 291 /* EnumMember */:
+                case 297 /* EnumMember */:
                     return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 900095 /* EnumMemberExcludes */);
-                case 169 /* CallSignature */:
-                case 170 /* ConstructSignature */:
-                case 171 /* IndexSignature */:
+                case 173 /* CallSignature */:
+                case 174 /* ConstructSignature */:
+                case 175 /* IndexSignature */:
                     return declareSymbolAndAddToSymbolTable(node, 131072 /* Signature */, 0 /* None */);
-                case 165 /* MethodDeclaration */:
-                case 164 /* MethodSignature */:
+                case 168 /* MethodDeclaration */:
+                case 167 /* MethodSignature */:
                     // If this is an ObjectLiteralExpression method, then it sits in the same space
                     // as other properties in the object literal.  So we use SymbolFlags.PropertyExcludes
                     // so that it will conflict with any other object literal members with the same
                     // name.
                     return bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 16777216 /* Optional */ : 0 /* None */), ts.isObjectLiteralMethod(node) ? 0 /* PropertyExcludes */ : 103359 /* MethodExcludes */);
-                case 251 /* FunctionDeclaration */:
+                case 255 /* FunctionDeclaration */:
                     return bindFunctionDeclaration(node);
-                case 166 /* Constructor */:
+                case 170 /* Constructor */:
                     return declareSymbolAndAddToSymbolTable(node, 16384 /* Constructor */, /*symbolExcludes:*/ 0 /* None */);
-                case 167 /* GetAccessor */:
+                case 171 /* GetAccessor */:
                     return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 46015 /* GetAccessorExcludes */);
-                case 168 /* SetAccessor */:
+                case 172 /* SetAccessor */:
                     return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 78783 /* SetAccessorExcludes */);
-                case 174 /* FunctionType */:
-                case 308 /* JSDocFunctionType */:
-                case 313 /* JSDocSignature */:
-                case 175 /* ConstructorType */:
+                case 178 /* FunctionType */:
+                case 315 /* JSDocFunctionType */:
+                case 321 /* JSDocSignature */:
+                case 179 /* ConstructorType */:
                     return bindFunctionOrConstructorType(node);
-                case 177 /* TypeLiteral */:
-                case 312 /* JSDocTypeLiteral */:
-                case 190 /* MappedType */:
+                case 181 /* TypeLiteral */:
+                case 320 /* JSDocTypeLiteral */:
+                case 194 /* MappedType */:
                     return bindAnonymousTypeWorker(node);
-                case 319 /* JSDocClassTag */:
+                case 330 /* JSDocClassTag */:
                     return bindJSDocClassTag(node);
-                case 200 /* ObjectLiteralExpression */:
+                case 204 /* ObjectLiteralExpression */:
                     return bindObjectLiteralExpression(node);
-                case 208 /* FunctionExpression */:
-                case 209 /* ArrowFunction */:
+                case 212 /* FunctionExpression */:
+                case 213 /* ArrowFunction */:
                     return bindFunctionExpression(node);
-                case 203 /* CallExpression */:
+                case 207 /* CallExpression */:
                     var assignmentKind = ts.getAssignmentDeclarationKind(node);
                     switch (assignmentKind) {
                         case 7 /* ObjectDefinePropertyValue */:
@@ -42567,65 +45487,65 @@ var ts;
                     }
                     break;
                 // Members of classes, interfaces, and modules
-                case 221 /* ClassExpression */:
-                case 252 /* ClassDeclaration */:
+                case 225 /* ClassExpression */:
+                case 256 /* ClassDeclaration */:
                     // All classes are automatically in strict mode in ES6.
                     inStrictMode = true;
                     return bindClassLikeDeclaration(node);
-                case 253 /* InterfaceDeclaration */:
+                case 257 /* InterfaceDeclaration */:
                     return bindBlockScopedDeclaration(node, 64 /* Interface */, 788872 /* InterfaceExcludes */);
-                case 254 /* TypeAliasDeclaration */:
+                case 258 /* TypeAliasDeclaration */:
                     return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 788968 /* TypeAliasExcludes */);
-                case 255 /* EnumDeclaration */:
+                case 259 /* EnumDeclaration */:
                     return bindEnumDeclaration(node);
-                case 256 /* ModuleDeclaration */:
+                case 260 /* ModuleDeclaration */:
                     return bindModuleDeclaration(node);
                 // Jsx-attributes
-                case 281 /* JsxAttributes */:
+                case 285 /* JsxAttributes */:
                     return bindJsxAttributes(node);
-                case 280 /* JsxAttribute */:
+                case 284 /* JsxAttribute */:
                     return bindJsxAttribute(node, 4 /* Property */, 0 /* PropertyExcludes */);
                 // Imports and exports
-                case 260 /* ImportEqualsDeclaration */:
-                case 263 /* NamespaceImport */:
-                case 265 /* ImportSpecifier */:
-                case 270 /* ExportSpecifier */:
+                case 264 /* ImportEqualsDeclaration */:
+                case 267 /* NamespaceImport */:
+                case 269 /* ImportSpecifier */:
+                case 274 /* ExportSpecifier */:
                     return declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */);
-                case 259 /* NamespaceExportDeclaration */:
+                case 263 /* NamespaceExportDeclaration */:
                     return bindNamespaceExportDeclaration(node);
-                case 262 /* ImportClause */:
+                case 266 /* ImportClause */:
                     return bindImportClause(node);
-                case 267 /* ExportDeclaration */:
+                case 271 /* ExportDeclaration */:
                     return bindExportDeclaration(node);
-                case 266 /* ExportAssignment */:
+                case 270 /* ExportAssignment */:
                     return bindExportAssignment(node);
-                case 297 /* SourceFile */:
+                case 303 /* SourceFile */:
                     updateStrictModeStatementList(node.statements);
                     return bindSourceFileIfExternalModule();
-                case 230 /* Block */:
-                    if (!ts.isFunctionLike(node.parent)) {
+                case 234 /* Block */:
+                    if (!ts.isFunctionLikeOrClassStaticBlockDeclaration(node.parent)) {
                         return;
                     }
                 // falls through
-                case 257 /* ModuleBlock */:
+                case 261 /* ModuleBlock */:
                     return updateStrictModeStatementList(node.statements);
-                case 326 /* JSDocParameterTag */:
-                    if (node.parent.kind === 313 /* JSDocSignature */) {
+                case 338 /* JSDocParameterTag */:
+                    if (node.parent.kind === 321 /* JSDocSignature */) {
                         return bindParameter(node);
                     }
-                    if (node.parent.kind !== 312 /* JSDocTypeLiteral */) {
+                    if (node.parent.kind !== 320 /* JSDocTypeLiteral */) {
                         break;
                     }
                 // falls through
-                case 333 /* JSDocPropertyTag */:
+                case 345 /* JSDocPropertyTag */:
                     var propTag = node;
-                    var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 307 /* JSDocOptionalType */ ?
+                    var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 314 /* JSDocOptionalType */ ?
                         4 /* Property */ | 16777216 /* Optional */ :
                         4 /* Property */;
                     return declareSymbolAndAddToSymbolTable(propTag, flags, 0 /* PropertyExcludes */);
-                case 331 /* JSDocTypedefTag */:
-                case 324 /* JSDocCallbackTag */:
-                case 325 /* JSDocEnumTag */:
+                case 343 /* JSDocTypedefTag */:
+                case 336 /* JSDocCallbackTag */:
+                case 337 /* JSDocEnumTag */:
                     return (delayedTypeAliases || (delayedTypeAliases = [])).push(node);
             }
         }
@@ -42649,12 +45569,12 @@ var ts;
             }
         }
         function bindSourceFileAsExternalModule() {
-            bindAnonymousDeclaration(file, 512 /* ValueModule */, "\"" + ts.removeFileExtension(file.fileName) + "\"");
+            bindAnonymousDeclaration(file, 512 /* ValueModule */, "\"".concat(ts.removeFileExtension(file.fileName), "\""));
         }
         function bindExportAssignment(node) {
             if (!container.symbol || !container.symbol.exports) {
-                // Export assignment in some sort of block construct
-                bindAnonymousDeclaration(node, 2097152 /* Alias */, getDeclarationName(node));
+                // Incorrect export assignment in some sort of block construct
+                bindAnonymousDeclaration(node, 111551 /* Value */, getDeclarationName(node));
             }
             else {
                 var flags = ts.exportAssignmentIsAlias(node)
@@ -42788,11 +45708,11 @@ var ts;
             }
             var thisContainer = ts.getThisContainer(node, /*includeArrowFunctions*/ false);
             switch (thisContainer.kind) {
-                case 251 /* FunctionDeclaration */:
-                case 208 /* FunctionExpression */:
+                case 255 /* FunctionDeclaration */:
+                case 212 /* FunctionExpression */:
                     var constructorSymbol = thisContainer.symbol;
                     // For `f.prototype.m = function() { this.x = 0; }`, `this.x = 0` should modify `f`'s members, not the function expression.
-                    if (ts.isBinaryExpression(thisContainer.parent) && thisContainer.parent.operatorToken.kind === 62 /* EqualsToken */) {
+                    if (ts.isBinaryExpression(thisContainer.parent) && thisContainer.parent.operatorToken.kind === 63 /* EqualsToken */) {
                         var l = thisContainer.parent.left;
                         if (ts.isBindableStaticAccessExpression(l) && ts.isPrototypeAccess(l.expression)) {
                             constructorSymbol = lookupSymbolForPropertyAccess(l.expression.expression, thisParentContainer);
@@ -42803,7 +45723,7 @@ var ts;
                         constructorSymbol.members = constructorSymbol.members || ts.createSymbolTable();
                         // It's acceptable for multiple 'this' assignments of the same identifier to occur
                         if (ts.hasDynamicName(node)) {
-                            bindDynamicallyNamedThisPropertyAssignment(node, constructorSymbol);
+                            bindDynamicallyNamedThisPropertyAssignment(node, constructorSymbol, constructorSymbol.members);
                         }
                         else {
                             declareSymbol(constructorSymbol.members, constructorSymbol, node, 4 /* Property */ | 67108864 /* Assignment */, 0 /* PropertyExcludes */ & ~4 /* Property */);
@@ -42811,23 +45731,24 @@ var ts;
                         addDeclarationToSymbol(constructorSymbol, constructorSymbol.valueDeclaration, 32 /* Class */);
                     }
                     break;
-                case 166 /* Constructor */:
-                case 163 /* PropertyDeclaration */:
-                case 165 /* MethodDeclaration */:
-                case 167 /* GetAccessor */:
-                case 168 /* SetAccessor */:
+                case 170 /* Constructor */:
+                case 166 /* PropertyDeclaration */:
+                case 168 /* MethodDeclaration */:
+                case 171 /* GetAccessor */:
+                case 172 /* SetAccessor */:
+                case 169 /* ClassStaticBlockDeclaration */:
                     // this.foo assignment in a JavaScript class
                     // Bind this property to the containing class
                     var containingClass = thisContainer.parent;
-                    var symbolTable = ts.hasSyntacticModifier(thisContainer, 32 /* Static */) ? containingClass.symbol.exports : containingClass.symbol.members;
+                    var symbolTable = ts.isStatic(thisContainer) ? containingClass.symbol.exports : containingClass.symbol.members;
                     if (ts.hasDynamicName(node)) {
-                        bindDynamicallyNamedThisPropertyAssignment(node, containingClass.symbol);
+                        bindDynamicallyNamedThisPropertyAssignment(node, containingClass.symbol, symbolTable);
                     }
                     else {
                         declareSymbol(symbolTable, containingClass.symbol, node, 4 /* Property */ | 67108864 /* Assignment */, 0 /* None */, /*isReplaceableByMethod*/ true);
                     }
                     break;
-                case 297 /* SourceFile */:
+                case 303 /* SourceFile */:
                     // this.property = assignment in a source file -- declare symbol in exports for a module, in locals for a script
                     if (ts.hasDynamicName(node)) {
                         break;
@@ -42843,8 +45764,8 @@ var ts;
                     ts.Debug.failBadSyntaxKind(thisContainer);
             }
         }
-        function bindDynamicallyNamedThisPropertyAssignment(node, symbol) {
-            bindAnonymousDeclaration(node, 4 /* Property */, "__computed" /* Computed */);
+        function bindDynamicallyNamedThisPropertyAssignment(node, symbol, symbolTable) {
+            declareSymbol(symbolTable, symbol, node, 4 /* Property */, 0 /* None */, /*isReplaceableByMethod*/ true, /*isComputedName*/ true);
             addLateBoundAssignmentDeclarationToSymbol(node, symbol);
         }
         function addLateBoundAssignmentDeclarationToSymbol(node, symbol) {
@@ -42853,10 +45774,10 @@ var ts;
             }
         }
         function bindSpecialPropertyDeclaration(node) {
-            if (node.expression.kind === 107 /* ThisKeyword */) {
+            if (node.expression.kind === 108 /* ThisKeyword */) {
                 bindThisPropertyAssignment(node);
             }
-            else if (ts.isBindableStaticAccessExpression(node) && node.parent.parent.kind === 297 /* SourceFile */) {
+            else if (ts.isBindableStaticAccessExpression(node) && node.parent.parent.kind === 303 /* SourceFile */) {
                 if (ts.isPrototypeAccess(node.expression)) {
                     bindPrototypePropertyAssignment(node, node.parent);
                 }
@@ -42896,7 +45817,7 @@ var ts;
         }
         function bindObjectDefinePropertyAssignment(node) {
             var namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0]);
-            var isToplevel = node.parent.parent.kind === 297 /* SourceFile */;
+            var isToplevel = node.parent.parent.kind === 303 /* SourceFile */;
             namespaceSymbol = bindPotentiallyMissingNamespaces(namespaceSymbol, node.arguments[0], isToplevel, /*isPrototypeProperty*/ false, /*containerIsClass*/ false);
             bindPotentiallyNewExpandoMemberToNamespace(node, namespaceSymbol, /*isPrototypeProperty*/ false);
         }
@@ -43005,8 +45926,8 @@ var ts;
         }
         function isTopLevelNamespaceAssignment(propertyAccess) {
             return ts.isBinaryExpression(propertyAccess.parent)
-                ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 297 /* SourceFile */
-                : propertyAccess.parent.parent.kind === 297 /* SourceFile */;
+                ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 303 /* SourceFile */
+                : propertyAccess.parent.parent.kind === 303 /* SourceFile */;
         }
         function bindPropertyAssignment(name, propertyAccess, isPrototypeProperty, containerIsClass) {
             var namespaceSymbol = lookupSymbolForPropertyAccess(name, container) || lookupSymbolForPropertyAccess(name, blockScopeContainer);
@@ -43085,7 +46006,7 @@ var ts;
             }
         }
         function bindClassLikeDeclaration(node) {
-            if (node.kind === 252 /* ClassDeclaration */) {
+            if (node.kind === 256 /* ClassDeclaration */) {
                 bindBlockScopedDeclaration(node, 32 /* Class */, 899503 /* ClassExcludes */);
             }
             else {
@@ -43127,7 +46048,7 @@ var ts;
                 checkStrictModeEvalOrArguments(node, node.name);
             }
             if (!ts.isBindingPattern(node.name)) {
-                if (ts.isInJSFile(node) && ts.isRequireVariableDeclaration(node, /*requireStringLiteralLikeArgument*/ true) && !ts.getJSDocTypeTag(node)) {
+                if (ts.isInJSFile(node) && ts.isRequireVariableDeclaration(node) && !ts.getJSDocTypeTag(node)) {
                     declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */);
                 }
                 else if (ts.isBlockOrCatchScoped(node)) {
@@ -43151,7 +46072,7 @@ var ts;
             }
         }
         function bindParameter(node) {
-            if (node.kind === 326 /* JSDocParameterTag */ && container.kind !== 313 /* JSDocSignature */) {
+            if (node.kind === 338 /* JSDocParameterTag */ && container.kind !== 321 /* JSDocSignature */) {
                 return;
             }
             if (inStrictMode && !(node.flags & 8388608 /* Ambient */)) {
@@ -43204,7 +46125,7 @@ var ts;
             if (!file.isDeclarationFile && !(node.flags & 8388608 /* Ambient */) && ts.isAsyncFunction(node)) {
                 emitFlags |= 2048 /* HasAsyncFunctions */;
             }
-            if (currentFlow && ts.isObjectLiteralOrClassExpressionMethod(node)) {
+            if (currentFlow && ts.isObjectLiteralOrClassExpressionMethodOrAccessor(node)) {
                 node.flowNode = currentFlow;
             }
             return ts.hasDynamicName(node)
@@ -43217,7 +46138,7 @@ var ts;
         }
         function bindTypeParameter(node) {
             if (ts.isJSDocTemplateTag(node.parent)) {
-                var container_1 = ts.find(node.parent.parent.tags, ts.isJSDocTypeAlias) || ts.getHostSignatureFromJSDoc(node.parent); // TODO: GH#18217
+                var container_1 = ts.getEffectiveContainerForJSDocTemplateTag(node.parent);
                 if (container_1) {
                     if (!container_1.locals) {
                         container_1.locals = ts.createSymbolTable();
@@ -43228,7 +46149,7 @@ var ts;
                     declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 526824 /* TypeParameterExcludes */);
                 }
             }
-            else if (node.parent.kind === 185 /* InferType */) {
+            else if (node.parent.kind === 189 /* InferType */) {
                 var container_2 = getInferTypeContainer(node.parent);
                 if (container_2) {
                     if (!container_2.locals) {
@@ -43256,11 +46177,11 @@ var ts;
             if (currentFlow === unreachableFlow) {
                 var reportError = 
                 // report error on all statements except empty ones
-                (ts.isStatementButNotDeclaration(node) && node.kind !== 231 /* EmptyStatement */) ||
+                (ts.isStatementButNotDeclaration(node) && node.kind !== 235 /* EmptyStatement */) ||
                     // report error on class declarations
-                    node.kind === 252 /* ClassDeclaration */ ||
+                    node.kind === 256 /* ClassDeclaration */ ||
                     // report error on instantiated modules or const-enums only modules if preserveConstEnums is set
-                    (node.kind === 256 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node));
+                    (node.kind === 260 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node));
                 if (reportError) {
                     currentFlow = reportedUnreachableFlow;
                     if (!options.allowUnreachableCode) {
@@ -43304,12 +46225,12 @@ var ts;
     }
     function isPurelyTypeDeclaration(s) {
         switch (s.kind) {
-            case 253 /* InterfaceDeclaration */:
-            case 254 /* TypeAliasDeclaration */:
+            case 257 /* InterfaceDeclaration */:
+            case 258 /* TypeAliasDeclaration */:
                 return true;
-            case 256 /* ModuleDeclaration */:
+            case 260 /* ModuleDeclaration */:
                 return getModuleInstanceState(s) !== 1 /* Instantiated */;
-            case 255 /* EnumDeclaration */:
+            case 259 /* EnumDeclaration */:
                 return ts.hasSyntacticModifier(s, 2048 /* Const */);
             default:
                 return false;
@@ -43353,7 +46274,7 @@ var ts;
 /** @internal */
 var ts;
 (function (ts) {
-    function createGetSymbolWalker(getRestTypeOfSignature, getTypePredicateOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getIndexTypeOfStructuredType, getConstraintOfTypeParameter, getFirstIdentifier, getTypeArguments) {
+    function createGetSymbolWalker(getRestTypeOfSignature, getTypePredicateOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getConstraintOfTypeParameter, getFirstIdentifier, getTypeArguments) {
         return getSymbolWalker;
         function getSymbolWalker(accept) {
             if (accept === void 0) { accept = function () { return true; }; }
@@ -43468,22 +46389,22 @@ var ts;
                 visitType(interfaceT.thisType);
             }
             function visitObjectType(type) {
-                var stringIndexType = getIndexTypeOfStructuredType(type, 0 /* String */);
-                visitType(stringIndexType);
-                var numberIndexType = getIndexTypeOfStructuredType(type, 1 /* Number */);
-                visitType(numberIndexType);
-                // The two checks above *should* have already resolved the type (if needed), so this should be cached
                 var resolved = resolveStructuredTypeMembers(type);
-                for (var _i = 0, _a = resolved.callSignatures; _i < _a.length; _i++) {
-                    var signature = _a[_i];
-                    visitSignature(signature);
+                for (var _i = 0, _a = resolved.indexInfos; _i < _a.length; _i++) {
+                    var info = _a[_i];
+                    visitType(info.keyType);
+                    visitType(info.type);
                 }
-                for (var _b = 0, _c = resolved.constructSignatures; _b < _c.length; _b++) {
+                for (var _b = 0, _c = resolved.callSignatures; _b < _c.length; _b++) {
                     var signature = _c[_b];
                     visitSignature(signature);
                 }
-                for (var _d = 0, _e = resolved.properties; _d < _e.length; _d++) {
-                    var p = _e[_d];
+                for (var _d = 0, _e = resolved.constructSignatures; _d < _e.length; _d++) {
+                    var signature = _e[_d];
+                    visitSignature(signature);
+                }
+                for (var _f = 0, _g = resolved.properties; _f < _g.length; _f++) {
+                    var p = _g[_f];
                     visitSymbol(p);
                 }
             }
@@ -43509,7 +46430,7 @@ var ts;
                     //  (their type resolved directly to the member deeply referenced)
                     // So to get the intervening symbols, we need to check if there's a type
                     // query node on any of the symbol's declarations and get symbols there
-                    if (d.type && d.type.kind === 176 /* TypeQuery */) {
+                    if (d.type && d.type.kind === 180 /* TypeQuery */) {
                         var query = d.type;
                         var entity = getResolvedSymbol(getFirstIdentifier(query.exprName));
                         visitSymbol(entity);
@@ -43679,15 +46600,6 @@ var ts;
         CheckMode[CheckMode["SkipGenericFunctions"] = 8] = "SkipGenericFunctions";
         CheckMode[CheckMode["IsForSignatureHelp"] = 16] = "IsForSignatureHelp";
     })(CheckMode || (CheckMode = {}));
-    var AccessFlags;
-    (function (AccessFlags) {
-        AccessFlags[AccessFlags["None"] = 0] = "None";
-        AccessFlags[AccessFlags["NoIndexSignatures"] = 1] = "NoIndexSignatures";
-        AccessFlags[AccessFlags["Writing"] = 2] = "Writing";
-        AccessFlags[AccessFlags["CacheSymbol"] = 4] = "CacheSymbol";
-        AccessFlags[AccessFlags["NoTupleBoundsCheck"] = 8] = "NoTupleBoundsCheck";
-        AccessFlags[AccessFlags["ExpressionPosition"] = 16] = "ExpressionPosition";
-    })(AccessFlags || (AccessFlags = {}));
     var SignatureCheckMode;
     (function (SignatureCheckMode) {
         SignatureCheckMode[SignatureCheckMode["BivariantCallback"] = 1] = "BivariantCallback";
@@ -43705,6 +46617,13 @@ var ts;
         IntersectionState[IntersectionState["UnionIntersectionCheck"] = 8] = "UnionIntersectionCheck";
         IntersectionState[IntersectionState["InPropertyCheck"] = 16] = "InPropertyCheck";
     })(IntersectionState || (IntersectionState = {}));
+    var RecursionFlags;
+    (function (RecursionFlags) {
+        RecursionFlags[RecursionFlags["None"] = 0] = "None";
+        RecursionFlags[RecursionFlags["Source"] = 1] = "Source";
+        RecursionFlags[RecursionFlags["Target"] = 2] = "Target";
+        RecursionFlags[RecursionFlags["Both"] = 3] = "Both";
+    })(RecursionFlags || (RecursionFlags = {}));
     var MappedTypeModifiers;
     (function (MappedTypeModifiers) {
         MappedTypeModifiers[MappedTypeModifiers["IncludeReadonly"] = 1] = "IncludeReadonly";
@@ -43736,6 +46655,7 @@ var ts;
         DeclarationMeaning[DeclarationMeaning["SetAccessor"] = 2] = "SetAccessor";
         DeclarationMeaning[DeclarationMeaning["PropertyAssignment"] = 4] = "PropertyAssignment";
         DeclarationMeaning[DeclarationMeaning["Method"] = 8] = "Method";
+        DeclarationMeaning[DeclarationMeaning["PrivateStatic"] = 16] = "PrivateStatic";
         DeclarationMeaning[DeclarationMeaning["GetOrSetAccessor"] = 3] = "GetOrSetAccessor";
         DeclarationMeaning[DeclarationMeaning["PropertyAssignmentOrMethod"] = 12] = "PropertyAssignmentOrMethod";
     })(DeclarationMeaning || (DeclarationMeaning = {}));
@@ -43793,17 +46713,21 @@ var ts;
     }
     ts.isInstantiatedModule = isInstantiatedModule;
     function createTypeChecker(host, produceDiagnostics) {
-        var getPackagesSet = ts.memoize(function () {
-            var set = new ts.Set();
+        var getPackagesMap = ts.memoize(function () {
+            // A package name maps to true when we detect it has .d.ts files.
+            // This is useful as an approximation of whether a package bundles its own types.
+            // Note: we only look at files already found by module resolution,
+            // so there may be files we did not consider.
+            var map = new ts.Map();
             host.getSourceFiles().forEach(function (sf) {
                 if (!sf.resolvedModules)
                     return;
-                ts.forEachEntry(sf.resolvedModules, function (r) {
+                sf.resolvedModules.forEach(function (r) {
                     if (r && r.packageId)
-                        set.add(r.packageId.name);
+                        map.set(r.packageId.name, r.extension === ".d.ts" /* Dts */ || !!map.get(r.packageId.name));
                 });
             });
-            return set;
+            return map;
         });
         // Cancellation that controls whether or not we can cancel in the middle of type checking.
         // In general cancelling is *not* safe for the type checker.  We might be in the middle of
@@ -43826,13 +46750,14 @@ var ts;
         var totalInstantiationCount = 0;
         var instantiationCount = 0;
         var instantiationDepth = 0;
+        var inlineLevel = 0;
         var currentNode;
-        var typeCatalog = []; // NB: id is index + 1
         var emptySymbols = ts.createSymbolTable();
         var arrayVariances = [1 /* Covariant */];
         var compilerOptions = host.getCompilerOptions();
         var languageVersion = ts.getEmitScriptTarget(compilerOptions);
         var moduleKind = ts.getEmitModuleKind(compilerOptions);
+        var useDefineForClassFields = ts.getUseDefineForClassFields(compilerOptions);
         var allowSyntheticDefaultImports = ts.getAllowSyntheticDefaultImports(compilerOptions);
         var strictNullChecks = ts.getStrictOptionValue(compilerOptions, "strictNullChecks");
         var strictFunctionTypes = ts.getStrictOptionValue(compilerOptions, "strictFunctionTypes");
@@ -43840,8 +46765,11 @@ var ts;
         var strictPropertyInitialization = ts.getStrictOptionValue(compilerOptions, "strictPropertyInitialization");
         var noImplicitAny = ts.getStrictOptionValue(compilerOptions, "noImplicitAny");
         var noImplicitThis = ts.getStrictOptionValue(compilerOptions, "noImplicitThis");
+        var useUnknownInCatchVariables = ts.getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables");
         var keyofStringsOnly = !!compilerOptions.keyofStringsOnly;
-        var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 32768 /* FreshLiteral */;
+        var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 16384 /* FreshLiteral */;
+        var exactOptionalPropertyTypes = compilerOptions.exactOptionalPropertyTypes;
+        var checkBinaryExpression = createCheckBinaryExpression();
         var emitResolver = createResolver();
         var nodeBuilder = createNodeBuilder();
         var globals = ts.createSymbolTable();
@@ -43864,7 +46792,6 @@ var ts;
             getNodeCount: function () { return ts.sum(host.getSourceFiles(), "nodeCount"); },
             getIdentifierCount: function () { return ts.sum(host.getSourceFiles(), "identifierCount"); },
             getSymbolCount: function () { return ts.sum(host.getSourceFiles(), "symbolCount") + symbolCount; },
-            getTypeCatalog: function () { return typeCatalog; },
             getTypeCount: function () { return typeCount; },
             getInstantiationCount: function () { return totalInstantiationCount; },
             getRelationCacheSizes: function () { return ({
@@ -43880,6 +46807,7 @@ var ts;
             getDiagnostics: getDiagnostics,
             getGlobalDiagnostics: getGlobalDiagnostics,
             getRecursionIdentity: getRecursionIdentity,
+            getUnmatchedProperties: getUnmatchedProperties,
             getTypeOfSymbolAtLocation: function (symbol, locationIn) {
                 var location = ts.getParseTreeNode(locationIn);
                 return location ? getTypeOfSymbolAtLocation(symbol, location) : errorType;
@@ -43903,9 +46831,10 @@ var ts;
                 return lexicallyScopedIdentifier ? getPrivateIdentifierPropertyOfType(leftType, lexicallyScopedIdentifier) : undefined;
             },
             getTypeOfPropertyOfType: function (type, name) { return getTypeOfPropertyOfType(type, ts.escapeLeadingUnderscores(name)); },
-            getIndexInfoOfType: getIndexInfoOfType,
+            getIndexInfoOfType: function (type, kind) { return getIndexInfoOfType(type, kind === 0 /* String */ ? stringType : numberType); },
+            getIndexInfosOfType: getIndexInfosOfType,
             getSignaturesOfType: getSignaturesOfType,
-            getIndexTypeOfType: getIndexTypeOfType,
+            getIndexTypeOfType: function (type, kind) { return getIndexTypeOfType(type, kind === 0 /* String */ ? stringType : numberType); },
             getBaseTypes: getBaseTypes,
             getBaseTypeOfLiteralType: getBaseTypeOfLiteralType,
             getWidenedType: getWidenedType,
@@ -43914,6 +46843,7 @@ var ts;
                 return node ? getTypeFromTypeNode(node) : errorType;
             },
             getParameterType: getTypeAtPosition,
+            getParameterIdentifierNameAtPosition: getParameterIdentifierNameAtPosition,
             getPromisedTypeOfPromise: getPromisedTypeOfPromise,
             getAwaitedType: function (type) { return getAwaitedType(type); },
             getReturnTypeOfSignature: getReturnTypeOfSignature,
@@ -43939,6 +46869,10 @@ var ts;
                 // set ignoreErrors: true because any lookups invoked by the API shouldn't cause any new errors
                 return node ? getSymbolAtLocation(node, /*ignoreErrors*/ true) : undefined;
             },
+            getIndexInfosAtLocation: function (nodeIn) {
+                var node = ts.getParseTreeNode(nodeIn);
+                return node ? getIndexInfosAtLocation(node) : undefined;
+            },
             getShorthandAssignmentValueSymbol: function (nodeIn) {
                 var node = ts.getParseTreeNode(nodeIn);
                 return node ? getShorthandAssignmentValueSymbol(node) : undefined;
@@ -44028,6 +46962,7 @@ var ts;
                 return node && getContextualTypeForJsxAttribute(node);
             },
             isContextSensitive: isContextSensitive,
+            getTypeOfPropertyOfContextualType: getTypeOfPropertyOfContextualType,
             getFullyQualifiedName: getFullyQualifiedName,
             getResolvedSignature: function (node, candidatesOutArray, argumentCount) {
                 return getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 0 /* Normal */);
@@ -44037,6 +46972,7 @@ var ts;
             },
             getExpandedParameters: getExpandedParameters,
             hasEffectiveRestParameter: hasEffectiveRestParameter,
+            containsArgumentsReference: containsArgumentsReference,
             getConstantValue: function (nodeIn) {
                 var node = ts.getParseTreeNode(nodeIn, canHaveConstantValue);
                 return node ? getConstantValue(node) : undefined;
@@ -44062,7 +46998,8 @@ var ts;
             getEmitResolver: getEmitResolver,
             getExportsOfModule: getExportsOfModuleAsArray,
             getExportsAndPropertiesOfModule: getExportsAndPropertiesOfModule,
-            getSymbolWalker: ts.createGetSymbolWalker(getRestTypeOfSignature, getTypePredicateOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getIndexTypeOfStructuredType, getConstraintOfTypeParameter, ts.getFirstIdentifier, getTypeArguments),
+            forEachExportAndPropertyOfModule: forEachExportAndPropertyOfModule,
+            getSymbolWalker: ts.createGetSymbolWalker(getRestTypeOfSignature, getTypePredicateOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getConstraintOfTypeParameter, ts.getFirstIdentifier, getTypeArguments),
             getAmbientModules: getAmbientModules,
             getJsxIntrinsicTagNamesAt: getJsxIntrinsicTagNamesAt,
             isOptionalParameter: function (nodeIn) {
@@ -44071,6 +47008,7 @@ var ts;
             },
             tryGetMemberInModuleExports: function (name, symbol) { return tryGetMemberInModuleExports(ts.escapeLeadingUnderscores(name), symbol); },
             tryGetMemberInModuleExportsAndProperties: function (name, symbol) { return tryGetMemberInModuleExportsAndProperties(ts.escapeLeadingUnderscores(name), symbol); },
+            tryFindAmbientModule: function (moduleName) { return tryFindAmbientModule(moduleName, /*withAugmentations*/ true); },
             tryFindAmbientModuleWithoutAugmentations: function (moduleName) {
                 // we deliberately exclude augmentations
                 // since we are only interested in declarations of the module itself
@@ -44098,11 +47036,14 @@ var ts;
             getESSymbolType: function () { return esSymbolType; },
             getNeverType: function () { return neverType; },
             getOptionalType: function () { return optionalType; },
+            getPromiseType: function () { return getGlobalPromiseType(/*reportErrors*/ false); },
+            getPromiseLikeType: function () { return getGlobalPromiseLikeType(/*reportErrors*/ false); },
             isSymbolAccessible: isSymbolAccessible,
             isArrayType: isArrayType,
             isTupleType: isTupleType,
             isArrayLikeType: isArrayLikeType,
             isTypeInvalidDueToUnionDiscriminant: isTypeInvalidDueToUnionDiscriminant,
+            getExactOptionalProperties: getExactOptionalProperties,
             getAllPossiblePropertiesOfTypes: getAllPossiblePropertiesOfTypes,
             getSuggestedSymbolForNonexistentProperty: getSuggestedSymbolForNonexistentProperty,
             getSuggestionForNonexistentProperty: getSuggestionForNonexistentProperty,
@@ -44111,6 +47052,7 @@ var ts;
             getSuggestionForNonexistentSymbol: function (location, name, meaning) { return getSuggestionForNonexistentSymbol(location, ts.escapeLeadingUnderscores(name), meaning); },
             getSuggestedSymbolForNonexistentModule: getSuggestedSymbolForNonexistentModule,
             getSuggestionForNonexistentExport: getSuggestionForNonexistentExport,
+            getSuggestedSymbolForNonexistentClassMember: getSuggestedSymbolForNonexistentClassMember,
             getBaseConstraintOfType: getBaseConstraintOfType,
             getDefaultFromTypeParameter: function (type) { return type && type.flags & 262144 /* TypeParameter */ ? getDefaultFromTypeParameter(type) : undefined; },
             resolveName: function (name, location, meaning, excludeGlobals) {
@@ -44173,6 +47115,9 @@ var ts;
             },
             getLocalTypeParametersOfClassOrInterfaceOrTypeAlias: getLocalTypeParametersOfClassOrInterfaceOrTypeAlias,
             isDeclarationVisible: isDeclarationVisible,
+            isPropertyAccessible: isPropertyAccessible,
+            getTypeOnlyAliasDeclaration: getTypeOnlyAliasDeclaration,
+            getMemberOverrideModifierStatus: getMemberOverrideModifierStatus,
         };
         function getResolvedSignatureWorker(nodeIn, candidatesOutArray, argumentCount, checkMode) {
             var node = ts.getParseTreeNode(nodeIn, ts.isCallLikeExpression);
@@ -44184,27 +47129,36 @@ var ts;
         var tupleTypes = new ts.Map();
         var unionTypes = new ts.Map();
         var intersectionTypes = new ts.Map();
-        var literalTypes = new ts.Map();
+        var stringLiteralTypes = new ts.Map();
+        var numberLiteralTypes = new ts.Map();
+        var bigIntLiteralTypes = new ts.Map();
+        var enumLiteralTypes = new ts.Map();
         var indexedAccessTypes = new ts.Map();
         var templateLiteralTypes = new ts.Map();
         var stringMappingTypes = new ts.Map();
         var substitutionTypes = new ts.Map();
+        var subtypeReductionCache = new ts.Map();
         var evolvingArrayTypes = [];
         var undefinedProperties = new ts.Map();
         var unknownSymbol = createSymbol(4 /* Property */, "unknown");
         var resolvingSymbol = createSymbol(0, "__resolving__" /* Resolving */);
+        var unresolvedSymbols = new ts.Map();
+        var errorTypes = new ts.Map();
         var anyType = createIntrinsicType(1 /* Any */, "any");
         var autoType = createIntrinsicType(1 /* Any */, "any");
         var wildcardType = createIntrinsicType(1 /* Any */, "any");
         var errorType = createIntrinsicType(1 /* Any */, "error");
-        var nonInferrableAnyType = createIntrinsicType(1 /* Any */, "any", 524288 /* ContainsWideningType */);
+        var unresolvedType = createIntrinsicType(1 /* Any */, "unresolved");
+        var nonInferrableAnyType = createIntrinsicType(1 /* Any */, "any", 131072 /* ContainsWideningType */);
         var intrinsicMarkerType = createIntrinsicType(1 /* Any */, "intrinsic");
         var unknownType = createIntrinsicType(2 /* Unknown */, "unknown");
+        var nonNullUnknownType = createIntrinsicType(2 /* Unknown */, "unknown");
         var undefinedType = createIntrinsicType(32768 /* Undefined */, "undefined");
-        var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, "undefined", 524288 /* ContainsWideningType */);
+        var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, "undefined", 131072 /* ContainsWideningType */);
         var optionalType = createIntrinsicType(32768 /* Undefined */, "undefined");
+        var missingType = exactOptionalPropertyTypes ? createIntrinsicType(32768 /* Undefined */, "undefined") : undefinedType;
         var nullType = createIntrinsicType(65536 /* Null */, "null");
-        var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(65536 /* Null */, "null", 524288 /* ContainsWideningType */);
+        var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(65536 /* Null */, "null", 131072 /* ContainsWideningType */);
         var stringType = createIntrinsicType(4 /* String */, "string");
         var numberType = createIntrinsicType(8 /* Number */, "number");
         var bigintType = createIntrinsicType(64 /* BigInt */, "bigint");
@@ -44220,41 +47174,37 @@ var ts;
         falseType.freshType = falseType;
         regularFalseType.regularType = regularFalseType;
         regularFalseType.freshType = falseType;
-        var booleanType = createBooleanType([regularFalseType, regularTrueType]);
-        // Also mark all combinations of fresh/regular booleans as "Boolean" so they print as `boolean` instead of `true | false`
-        // (The union is cached, so simply doing the marking here is sufficient)
-        createBooleanType([regularFalseType, trueType]);
-        createBooleanType([falseType, regularTrueType]);
-        createBooleanType([falseType, trueType]);
+        var booleanType = getUnionType([regularFalseType, regularTrueType]);
         var esSymbolType = createIntrinsicType(4096 /* ESSymbol */, "symbol");
         var voidType = createIntrinsicType(16384 /* Void */, "void");
         var neverType = createIntrinsicType(131072 /* Never */, "never");
         var silentNeverType = createIntrinsicType(131072 /* Never */, "never");
-        var nonInferrableType = createIntrinsicType(131072 /* Never */, "never", 2097152 /* NonInferrableType */);
+        var nonInferrableType = createIntrinsicType(131072 /* Never */, "never", 524288 /* NonInferrableType */);
         var implicitNeverType = createIntrinsicType(131072 /* Never */, "never");
         var unreachableNeverType = createIntrinsicType(131072 /* Never */, "never");
         var nonPrimitiveType = createIntrinsicType(67108864 /* NonPrimitive */, "object");
+        var stringOrNumberType = getUnionType([stringType, numberType]);
         var stringNumberSymbolType = getUnionType([stringType, numberType, esSymbolType]);
         var keyofConstraintType = keyofStringsOnly ? stringType : stringNumberSymbolType;
         var numberOrBigIntType = getUnionType([numberType, bigintType]);
         var templateConstraintType = getUnionType([stringType, numberType, booleanType, bigintType, nullType, undefinedType]);
         var restrictiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 /* TypeParameter */ ? getRestrictiveTypeParameter(t) : t; });
         var permissiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 /* TypeParameter */ ? wildcardType : t; });
-        var emptyObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);
-        var emptyJsxObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);
-        emptyJsxObjectType.objectFlags |= 4096 /* JsxAttributes */;
+        var emptyObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
+        var emptyJsxObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
+        emptyJsxObjectType.objectFlags |= 2048 /* JsxAttributes */;
         var emptyTypeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, "__type" /* Type */);
         emptyTypeLiteralSymbol.members = ts.createSymbolTable();
-        var emptyTypeLiteralType = createAnonymousType(emptyTypeLiteralSymbol, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);
-        var emptyGenericType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);
+        var emptyTypeLiteralType = createAnonymousType(emptyTypeLiteralSymbol, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
+        var emptyGenericType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
         emptyGenericType.instantiations = new ts.Map();
-        var anyFunctionType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);
+        var anyFunctionType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
         // The anyFunctionType contains the anyFunctionType by definition. The flag is further propagated
         // in getPropagatingFlagsOfTypes, and it is checked in inferFromTypes.
-        anyFunctionType.objectFlags |= 2097152 /* NonInferrableType */;
-        var noConstraintType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);
-        var circularConstraintType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);
-        var resolvingDefaultType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);
+        anyFunctionType.objectFlags |= 524288 /* NonInferrableType */;
+        var noConstraintType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
+        var circularConstraintType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
+        var resolvingDefaultType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
         var markerSuperType = createTypeParameter();
         var markerSubType = createTypeParameter();
         markerSubType.constraint = markerSuperType;
@@ -44264,7 +47214,7 @@ var ts;
         var unknownSignature = createSignature(undefined, undefined, undefined, ts.emptyArray, errorType, /*resolvedTypePredicate*/ undefined, 0, 0 /* None */);
         var resolvingSignature = createSignature(undefined, undefined, undefined, ts.emptyArray, anyType, /*resolvedTypePredicate*/ undefined, 0, 0 /* None */);
         var silentNeverSignature = createSignature(undefined, undefined, undefined, ts.emptyArray, silentNeverType, /*resolvedTypePredicate*/ undefined, 0, 0 /* None */);
-        var enumNumberIndexInfo = createIndexInfo(stringType, /*isReadonly*/ true);
+        var enumNumberIndexInfo = createIndexInfo(numberType, stringType, /*isReadonly*/ true);
         var iterationTypesCache = new ts.Map(); // cache for common IterationTypes instances
         var noIterationTypes = {
             get yieldType() { return ts.Debug.fail("Not supported"); },
@@ -44331,6 +47281,7 @@ var ts;
         // This allows users to just specify library files they want to used through --lib
         // and they will not get an error from not having unrelated library files
         var deferredGlobalESSymbolConstructorSymbol;
+        var deferredGlobalESSymbolConstructorTypeSymbol;
         var deferredGlobalESSymbolType;
         var deferredGlobalTypedPropertyDescriptorType;
         var deferredGlobalPromiseType;
@@ -44349,8 +47300,11 @@ var ts;
         var deferredGlobalAsyncGeneratorType;
         var deferredGlobalTemplateStringsArrayType;
         var deferredGlobalImportMetaType;
+        var deferredGlobalImportMetaExpressionType;
+        var deferredGlobalImportCallOptionsType;
         var deferredGlobalExtractSymbol;
         var deferredGlobalOmitSymbol;
+        var deferredGlobalAwaitedSymbol;
         var deferredGlobalBigIntType;
         var allPotentiallyUnusedIdentifiers = new ts.Map(); // key is file name
         var flowLoopStart = 0;
@@ -44361,9 +47315,9 @@ var ts;
         var lastFlowNode;
         var lastFlowNodeReachable;
         var flowTypeCache;
-        var emptyStringType = getLiteralType("");
-        var zeroType = getLiteralType(0);
-        var zeroBigIntType = getLiteralType({ negative: false, base10Value: "0" });
+        var emptyStringType = getStringLiteralType("");
+        var zeroType = getNumberLiteralType(0);
+        var zeroBigIntType = getBigIntLiteralType({ negative: false, base10Value: "0" });
         var resolutionTargets = [];
         var resolutionResults = [];
         var resolutionPropertyNames = [];
@@ -44382,7 +47336,8 @@ var ts;
         var flowNodePostSuper = [];
         var potentialThisCollisions = [];
         var potentialNewTargetCollisions = [];
-        var potentialWeakMapCollisions = [];
+        var potentialWeakMapSetCollisions = [];
+        var potentialReflectCollisions = [];
         var awaitedTypeStack = [];
         var diagnostics = ts.createDiagnosticCollection();
         var suggestionDiagnostics = ts.createDiagnosticCollection();
@@ -44406,6 +47361,21 @@ var ts;
         var enumRelation = new ts.Map();
         var builtinGlobals = ts.createSymbolTable();
         builtinGlobals.set(undefinedSymbol.escapedName, undefinedSymbol);
+        // Extensions suggested for path imports when module resolution is node12 or higher.
+        // The first element of each tuple is the extension a file has.
+        // The second element of each tuple is the extension that should be used in a path import.
+        // e.g. if we want to import file `foo.mts`, we should write `import {} from "./foo.mjs".
+        var suggestedExtensions = [
+            [".mts", ".mjs"],
+            [".ts", ".js"],
+            [".cts", ".cjs"],
+            [".mjs", ".mjs"],
+            [".js", ".js"],
+            [".cjs", ".cjs"],
+            [".tsx", compilerOptions.jsx === 1 /* Preserve */ ? ".jsx" : ".js"],
+            [".jsx", ".jsx"],
+            [".json", ".json"],
+        ];
         initializeTypeChecker();
         return checker;
         function getJsxNamespace(location) {
@@ -44432,17 +47402,9 @@ var ts;
                         }
                     }
                     else {
-                        if (file.localJsxNamespace) {
-                            return file.localJsxNamespace;
-                        }
-                        var jsxPragma = file.pragmas.get("jsx");
-                        if (jsxPragma) {
-                            var chosenPragma = ts.isArray(jsxPragma) ? jsxPragma[0] : jsxPragma;
-                            file.localJsxFactory = ts.parseIsolatedEntityName(chosenPragma.arguments.factory, languageVersion);
-                            ts.visitNode(file.localJsxFactory, markAsSynthetic);
-                            if (file.localJsxFactory) {
-                                return file.localJsxNamespace = ts.getFirstIdentifier(file.localJsxFactory).escapedText;
-                            }
+                        var localJsxNamespace = getLocalJsxNamespace(file);
+                        if (localJsxNamespace) {
+                            return file.localJsxNamespace = localJsxNamespace;
                         }
                     }
                 }
@@ -44464,10 +47426,24 @@ var ts;
                 _jsxFactoryEntity = ts.factory.createQualifiedName(ts.factory.createIdentifier(ts.unescapeLeadingUnderscores(_jsxNamespace)), "createElement");
             }
             return _jsxNamespace;
-            function markAsSynthetic(node) {
-                ts.setTextRangePosEnd(node, -1, -1);
-                return ts.visitEachChild(node, markAsSynthetic, ts.nullTransformationContext);
+        }
+        function getLocalJsxNamespace(file) {
+            if (file.localJsxNamespace) {
+                return file.localJsxNamespace;
             }
+            var jsxPragma = file.pragmas.get("jsx");
+            if (jsxPragma) {
+                var chosenPragma = ts.isArray(jsxPragma) ? jsxPragma[0] : jsxPragma;
+                file.localJsxFactory = ts.parseIsolatedEntityName(chosenPragma.arguments.factory, languageVersion);
+                ts.visitNode(file.localJsxFactory, markAsSynthetic);
+                if (file.localJsxFactory) {
+                    return file.localJsxNamespace = ts.getFirstIdentifier(file.localJsxFactory).escapedText;
+                }
+            }
+        }
+        function markAsSynthetic(node) {
+            ts.setTextRangePosEnd(node, -1, -1);
+            return ts.visitEachChild(node, markAsSynthetic, ts.nullTransformationContext);
         }
         function getEmitResolver(sourceFile, cancellationToken) {
             // Ensure we have all the type information in place for this file so that all the
@@ -44493,10 +47469,13 @@ var ts;
             diagnostic.skippedOn = key;
             return diagnostic;
         }
-        function error(location, message, arg0, arg1, arg2, arg3) {
-            var diagnostic = location
+        function createError(location, message, arg0, arg1, arg2, arg3) {
+            return location
                 ? ts.createDiagnosticForNode(location, message, arg0, arg1, arg2, arg3)
                 : ts.createCompilerDiagnostic(message, arg0, arg1, arg2, arg3);
+        }
+        function error(location, message, arg0, arg1, arg2, arg3) {
+            var diagnostic = createError(location, message, arg0, arg1, arg2, arg3);
             diagnostics.add(diagnostic);
             return diagnostic;
         }
@@ -44550,7 +47529,7 @@ var ts;
         }
         function createSymbol(flags, name, checkFlags) {
             symbolCount++;
-            var symbol = (new Symbol(flags | 33554432 /* Transient */, name));
+            var symbol = new Symbol(flags | 33554432 /* Transient */, name);
             symbol.checkFlags = checkFlags || 0;
             return symbol;
         }
@@ -44661,7 +47640,7 @@ var ts;
                 // as we will already report a "Declaration name conflicts..." error, and this error
                 // won't make much sense.
                 if (target !== globalThisSymbol) {
-                    error(ts.getNameOfDeclaration(source.declarations[0]), ts.Diagnostics.Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity, symbolToString(target));
+                    error(source.declarations && ts.getNameOfDeclaration(source.declarations[0]), ts.Diagnostics.Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity, symbolToString(target));
                 }
             }
             else { // error
@@ -44679,7 +47658,7 @@ var ts;
                 if (sourceSymbolFile && targetSymbolFile && amalgamatedDuplicates && !isEitherEnum && sourceSymbolFile !== targetSymbolFile) {
                     var firstFile_1 = ts.comparePaths(sourceSymbolFile.path, targetSymbolFile.path) === -1 /* LessThan */ ? sourceSymbolFile : targetSymbolFile;
                     var secondFile_1 = firstFile_1 === sourceSymbolFile ? targetSymbolFile : sourceSymbolFile;
-                    var filesDuplicates = ts.getOrUpdate(amalgamatedDuplicates, firstFile_1.path + "|" + secondFile_1.path, function () {
+                    var filesDuplicates = ts.getOrUpdate(amalgamatedDuplicates, "".concat(firstFile_1.path, "|").concat(secondFile_1.path), function () {
                         return ({ firstFile: firstFile_1, secondFile: secondFile_1, conflictingSymbols: new ts.Map() });
                     });
                     var conflictingSymbolInfo = ts.getOrUpdate(filesDuplicates.conflictingSymbols, symbolName_1, function () {
@@ -44695,9 +47674,11 @@ var ts;
             }
             return target;
             function addDuplicateLocations(locs, symbol) {
-                for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
-                    var decl = _a[_i];
-                    ts.pushIfUnique(locs, decl);
+                if (symbol.declarations) {
+                    for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
+                        var decl = _a[_i];
+                        ts.pushIfUnique(locs, decl);
+                    }
                 }
             }
         }
@@ -44743,9 +47724,9 @@ var ts;
             });
         }
         function mergeModuleAugmentation(moduleName) {
-            var _a, _b;
+            var _a, _b, _c;
             var moduleAugmentation = moduleName.parent;
-            if (moduleAugmentation.symbol.declarations[0] !== moduleAugmentation) {
+            if (((_a = moduleAugmentation.symbol.declarations) === null || _a === void 0 ? void 0 : _a[0]) !== moduleAugmentation) {
                 // this is a combined symbol for multiple augmentations within the same file.
                 // its symbol already has accumulated information for all declarations
                 // so we need to add it just once - do the work only for first declaration
@@ -44782,11 +47763,11 @@ var ts;
                         patternAmbientModuleAugmentations.set(moduleName.text, merged);
                     }
                     else {
-                        if (((_a = mainModule_1.exports) === null || _a === void 0 ? void 0 : _a.get("__export" /* ExportStar */)) && ((_b = moduleAugmentation.symbol.exports) === null || _b === void 0 ? void 0 : _b.size)) {
+                        if (((_b = mainModule_1.exports) === null || _b === void 0 ? void 0 : _b.get("__export" /* ExportStar */)) && ((_c = moduleAugmentation.symbol.exports) === null || _c === void 0 ? void 0 : _c.size)) {
                             // We may need to merge the module augmentation's exports into the target symbols of the resolved exports
                             var resolvedExports = getResolvedMembersOrExportsOfSymbol(mainModule_1, "resolvedExports" /* resolvedExports */);
-                            for (var _i = 0, _c = ts.arrayFrom(moduleAugmentation.symbol.exports.entries()); _i < _c.length; _i++) {
-                                var _d = _c[_i], key = _d[0], value = _d[1];
+                            for (var _i = 0, _d = ts.arrayFrom(moduleAugmentation.symbol.exports.entries()); _i < _d.length; _i++) {
+                                var _e = _d[_i], key = _e[0], value = _e[1];
                                 if (resolvedExports.has(key) && !mainModule_1.exports.has(key)) {
                                     mergeSymbol(resolvedExports.get(key), value);
                                 }
@@ -44827,7 +47808,7 @@ var ts;
             return nodeLinks[nodeId] || (nodeLinks[nodeId] = new NodeLinks());
         }
         function isGlobalSourceFile(node) {
-            return node.kind === 297 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node);
+            return node.kind === 303 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node);
         }
         function getSymbol(symbols, name, meaning) {
             if (meaning) {
@@ -44886,17 +47867,17 @@ var ts;
             }
             if (declaration.pos <= usage.pos && !(ts.isPropertyDeclaration(declaration) && ts.isThisProperty(usage.parent) && !declaration.initializer && !declaration.exclamationToken)) {
                 // declaration is before usage
-                if (declaration.kind === 198 /* BindingElement */) {
+                if (declaration.kind === 202 /* BindingElement */) {
                     // still might be illegal if declaration and usage are both binding elements (eg var [a = b, b = b] = [1, 2])
-                    var errorBindingElement = ts.getAncestor(usage, 198 /* BindingElement */);
+                    var errorBindingElement = ts.getAncestor(usage, 202 /* BindingElement */);
                     if (errorBindingElement) {
                         return ts.findAncestor(errorBindingElement, ts.isBindingElement) !== ts.findAncestor(declaration, ts.isBindingElement) ||
                             declaration.pos < errorBindingElement.pos;
                     }
                     // or it might be illegal if usage happens before parent variable is declared (eg var [a] = a)
-                    return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 249 /* VariableDeclaration */), usage);
+                    return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 253 /* VariableDeclaration */), usage);
                 }
-                else if (declaration.kind === 249 /* VariableDeclaration */) {
+                else if (declaration.kind === 253 /* VariableDeclaration */) {
                     // still might be illegal if usage is in the initializer of the variable declaration (eg var a = a)
                     return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage);
                 }
@@ -44910,7 +47891,7 @@ var ts;
                 }
                 else if (ts.isParameterPropertyDeclaration(declaration, declaration.parent)) {
                     // foo = this.bar is illegal in esnext+useDefineForClassFields when bar is a parameter property
-                    return !(compilerOptions.target === 99 /* ESNext */ && !!compilerOptions.useDefineForClassFields
+                    return !(ts.getEmitScriptTarget(compilerOptions) === 99 /* ESNext */ && useDefineForClassFields
                         && ts.getContainingClass(declaration) === ts.getContainingClass(usage)
                         && isUsedInFunctionOrInstanceProperty(usage, declaration));
                 }
@@ -44926,19 +47907,19 @@ var ts;
             // or if usage is in a type context:
             // 1. inside a type query (typeof in type position)
             // 2. inside a jsdoc comment
-            if (usage.parent.kind === 270 /* ExportSpecifier */ || (usage.parent.kind === 266 /* ExportAssignment */ && usage.parent.isExportEquals)) {
+            if (usage.parent.kind === 274 /* ExportSpecifier */ || (usage.parent.kind === 270 /* ExportAssignment */ && usage.parent.isExportEquals)) {
                 // export specifiers do not use the variable, they only make it available for use
                 return true;
             }
             // When resolving symbols for exports, the `usage` location passed in can be the export site directly
-            if (usage.kind === 266 /* ExportAssignment */ && usage.isExportEquals) {
+            if (usage.kind === 270 /* ExportAssignment */ && usage.isExportEquals) {
                 return true;
             }
             if (!!(usage.flags & 4194304 /* JSDoc */) || isInTypeQuery(usage) || usageInTypeDeclaration()) {
                 return true;
             }
             if (isUsedInFunctionOrInstanceProperty(usage, declaration)) {
-                if (compilerOptions.target === 99 /* ESNext */ && !!compilerOptions.useDefineForClassFields
+                if (ts.getEmitScriptTarget(compilerOptions) === 99 /* ESNext */ && useDefineForClassFields
                     && ts.getContainingClass(declaration)
                     && (ts.isPropertyDeclaration(declaration) || ts.isParameterPropertyDeclaration(declaration, declaration.parent))) {
                     return !isPropertyImmediatelyReferencedWithinDeclaration(declaration, usage, /*stopAtAnyPropertyDeclaration*/ true);
@@ -44953,9 +47934,9 @@ var ts;
             }
             function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) {
                 switch (declaration.parent.parent.kind) {
-                    case 232 /* VariableStatement */:
-                    case 237 /* ForStatement */:
-                    case 239 /* ForOfStatement */:
+                    case 236 /* VariableStatement */:
+                    case 241 /* ForStatement */:
+                    case 243 /* ForOfStatement */:
                         // variable statement/for/for-of statement case,
                         // use site should not be inside variable declaration (initializer of declaration or binding element)
                         if (isSameScopeDescendentOf(usage, declaration, declContainer)) {
@@ -44975,19 +47956,33 @@ var ts;
                     if (ts.isFunctionLike(current)) {
                         return true;
                     }
-                    var initializerOfProperty = current.parent &&
-                        current.parent.kind === 163 /* PropertyDeclaration */ &&
-                        current.parent.initializer === current;
-                    if (initializerOfProperty) {
-                        if (ts.hasSyntacticModifier(current.parent, 32 /* Static */)) {
-                            if (declaration.kind === 165 /* MethodDeclaration */) {
-                                return true;
+                    if (ts.isClassStaticBlockDeclaration(current)) {
+                        return declaration.pos < usage.pos;
+                    }
+                    var propertyDeclaration = ts.tryCast(current.parent, ts.isPropertyDeclaration);
+                    if (propertyDeclaration) {
+                        var initializerOfProperty = propertyDeclaration.initializer === current;
+                        if (initializerOfProperty) {
+                            if (ts.isStatic(current.parent)) {
+                                if (declaration.kind === 168 /* MethodDeclaration */) {
+                                    return true;
+                                }
+                                if (ts.isPropertyDeclaration(declaration) && ts.getContainingClass(usage) === ts.getContainingClass(declaration)) {
+                                    var propName = declaration.name;
+                                    if (ts.isIdentifier(propName) || ts.isPrivateIdentifier(propName)) {
+                                        var type = getTypeOfSymbol(getSymbolOfNode(declaration));
+                                        var staticBlocks = ts.filter(declaration.parent.members, ts.isClassStaticBlockDeclaration);
+                                        if (isPropertyInitializedInStaticBlocks(propName, type, staticBlocks, declaration.parent.pos, current.pos)) {
+                                            return true;
+                                        }
+                                    }
+                                }
                             }
-                        }
-                        else {
-                            var isDeclarationInstanceProperty = declaration.kind === 163 /* PropertyDeclaration */ && !ts.hasSyntacticModifier(declaration, 32 /* Static */);
-                            if (!isDeclarationInstanceProperty || ts.getContainingClass(usage) !== ts.getContainingClass(declaration)) {
-                                return true;
+                            else {
+                                var isDeclarationInstanceProperty = declaration.kind === 166 /* PropertyDeclaration */ && !ts.isStatic(declaration);
+                                if (!isDeclarationInstanceProperty || ts.getContainingClass(usage) !== ts.getContainingClass(declaration)) {
+                                    return true;
+                                }
                             }
                         }
                     }
@@ -45007,19 +48002,19 @@ var ts;
                         return "quit";
                     }
                     switch (node.kind) {
-                        case 209 /* ArrowFunction */:
+                        case 213 /* ArrowFunction */:
                             return true;
-                        case 163 /* PropertyDeclaration */:
+                        case 166 /* PropertyDeclaration */:
                             // even when stopping at any property declaration, they need to come from the same class
                             return stopAtAnyPropertyDeclaration &&
                                 (ts.isPropertyDeclaration(declaration) && node.parent === declaration.parent
                                     || ts.isParameterPropertyDeclaration(declaration, declaration.parent) && node.parent === declaration.parent.parent)
                                 ? "quit" : true;
-                        case 230 /* Block */:
+                        case 234 /* Block */:
                             switch (node.parent.kind) {
-                                case 167 /* GetAccessor */:
-                                case 165 /* MethodDeclaration */:
-                                case 168 /* SetAccessor */:
+                                case 171 /* GetAccessor */:
+                                case 168 /* MethodDeclaration */:
+                                case 172 /* SetAccessor */:
                                     return true;
                                 default:
                                     return false;
@@ -45034,7 +48029,11 @@ var ts;
         function useOuterVariableScopeInParameter(result, location, lastLocation) {
             var target = ts.getEmitScriptTarget(compilerOptions);
             var functionLocation = location;
-            if (ts.isParameter(lastLocation) && functionLocation.body && result.valueDeclaration.pos >= functionLocation.body.pos && result.valueDeclaration.end <= functionLocation.body.end) {
+            if (ts.isParameter(lastLocation)
+                && functionLocation.body
+                && result.valueDeclaration
+                && result.valueDeclaration.pos >= functionLocation.body.pos
+                && result.valueDeclaration.end <= functionLocation.body.end) {
                 // check for several cases where we introduce temporaries that require moving the name/initializer of the parameter to the body
                 // - static field in a class expression
                 // - optional chaining pre-es2020
@@ -45055,21 +48054,21 @@ var ts;
             }
             function requiresScopeChangeWorker(node) {
                 switch (node.kind) {
-                    case 209 /* ArrowFunction */:
-                    case 208 /* FunctionExpression */:
-                    case 251 /* FunctionDeclaration */:
-                    case 166 /* Constructor */:
+                    case 213 /* ArrowFunction */:
+                    case 212 /* FunctionExpression */:
+                    case 255 /* FunctionDeclaration */:
+                    case 170 /* Constructor */:
                         // do not descend into these
                         return false;
-                    case 165 /* MethodDeclaration */:
-                    case 167 /* GetAccessor */:
-                    case 168 /* SetAccessor */:
-                    case 288 /* PropertyAssignment */:
+                    case 168 /* MethodDeclaration */:
+                    case 171 /* GetAccessor */:
+                    case 172 /* SetAccessor */:
+                    case 294 /* PropertyAssignment */:
                         return requiresScopeChangeWorker(node.name);
-                    case 163 /* PropertyDeclaration */:
+                    case 166 /* PropertyDeclaration */:
                         // static properties in classes introduce temporary variables
                         if (ts.hasStaticModifier(node)) {
-                            return target < 99 /* ESNext */ || !compilerOptions.useDefineForClassFields;
+                            return target < 99 /* ESNext */ || !useDefineForClassFields;
                         }
                         return requiresScopeChangeWorker(node.name);
                     default:
@@ -45093,11 +48092,12 @@ var ts;
          *
          * @param isUse If true, this will count towards --noUnusedLocals / --noUnusedParameters.
          */
-        function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, suggestedNameNotFoundMessage) {
+        function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals) {
             if (excludeGlobals === void 0) { excludeGlobals = false; }
-            return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSymbol, suggestedNameNotFoundMessage);
+            return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSymbol);
         }
-        function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, lookup, suggestedNameNotFoundMessage) {
+        function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, lookup) {
+            var _a, _b, _c;
             var originalLocation = location; // needed for did-you-mean error reporting, which gathers candidates starting from the original location
             var result;
             var lastLocation;
@@ -45120,12 +48120,12 @@ var ts;
                             // - parameters are only in the scope of function body
                             // This restriction does not apply to JSDoc comment types because they are parented
                             // at a higher level than type parameters would normally be
-                            if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 311 /* JSDocComment */) {
+                            if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 318 /* JSDocComment */) {
                                 useResult = result.flags & 262144 /* TypeParameter */
                                     // type parameters are visible in parameter list, return type and type parameter list
                                     ? lastLocation === location.type ||
-                                        lastLocation.kind === 160 /* Parameter */ ||
-                                        lastLocation.kind === 159 /* TypeParameter */
+                                        lastLocation.kind === 163 /* Parameter */ ||
+                                        lastLocation.kind === 162 /* TypeParameter */
                                     // local types not visible outside the function body
                                     : false;
                             }
@@ -45140,13 +48140,13 @@ var ts;
                                     // however it is detected separately when checking initializers of parameters
                                     // to make sure that they reference no variables declared after them.
                                     useResult =
-                                        lastLocation.kind === 160 /* Parameter */ ||
+                                        lastLocation.kind === 163 /* Parameter */ ||
                                             (lastLocation === location.type &&
                                                 !!ts.findAncestor(result.valueDeclaration, ts.isParameter));
                                 }
                             }
                         }
-                        else if (location.kind === 184 /* ConditionalType */) {
+                        else if (location.kind === 188 /* ConditionalType */) {
                             // A type parameter declared using 'infer T' in a conditional type is visible only in
                             // the true branch of the conditional type.
                             useResult = lastLocation === location.trueType;
@@ -45161,14 +48161,14 @@ var ts;
                 }
                 withinDeferredContext = withinDeferredContext || getIsDeferredContext(location, lastLocation);
                 switch (location.kind) {
-                    case 297 /* SourceFile */:
+                    case 303 /* SourceFile */:
                         if (!ts.isExternalOrCommonJsModule(location))
                             break;
                         isInExternalModule = true;
                     // falls through
-                    case 256 /* ModuleDeclaration */:
-                        var moduleExports = getSymbolOfNode(location).exports || emptySymbols;
-                        if (location.kind === 297 /* SourceFile */ || (ts.isModuleDeclaration(location) && location.flags & 8388608 /* Ambient */ && !ts.isGlobalScopeAugmentation(location))) {
+                    case 260 /* ModuleDeclaration */:
+                        var moduleExports = ((_a = getSymbolOfNode(location)) === null || _a === void 0 ? void 0 : _a.exports) || emptySymbols;
+                        if (location.kind === 303 /* SourceFile */ || (ts.isModuleDeclaration(location) && location.flags & 8388608 /* Ambient */ && !ts.isGlobalScopeAugmentation(location))) {
                             // It's an external module. First see if the module has an export default and if the local
                             // name of that export default matches.
                             if (result = moduleExports.get("default" /* Default */)) {
@@ -45192,13 +48192,13 @@ var ts;
                             var moduleExport = moduleExports.get(name);
                             if (moduleExport &&
                                 moduleExport.flags === 2097152 /* Alias */ &&
-                                (ts.getDeclarationOfKind(moduleExport, 270 /* ExportSpecifier */) || ts.getDeclarationOfKind(moduleExport, 269 /* NamespaceExport */))) {
+                                (ts.getDeclarationOfKind(moduleExport, 274 /* ExportSpecifier */) || ts.getDeclarationOfKind(moduleExport, 273 /* NamespaceExport */))) {
                                 break;
                             }
                         }
                         // ES6 exports are also visible locally (except for 'default'), but commonjs exports are not (except typedefs)
                         if (name !== "default" /* Default */ && (result = lookup(moduleExports, name, meaning & 2623475 /* ModuleMember */))) {
-                            if (ts.isSourceFile(location) && location.commonJsModuleIndicator && !result.declarations.some(ts.isJSDocTypeAlias)) {
+                            if (ts.isSourceFile(location) && location.commonJsModuleIndicator && !((_b = result.declarations) === null || _b === void 0 ? void 0 : _b.some(ts.isJSDocTypeAlias))) {
                                 result = undefined;
                             }
                             else {
@@ -45206,19 +48206,19 @@ var ts;
                             }
                         }
                         break;
-                    case 255 /* EnumDeclaration */:
-                        if (result = lookup(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) {
+                    case 259 /* EnumDeclaration */:
+                        if (result = lookup(((_c = getSymbolOfNode(location)) === null || _c === void 0 ? void 0 : _c.exports) || emptySymbols, name, meaning & 8 /* EnumMember */)) {
                             break loop;
                         }
                         break;
-                    case 163 /* PropertyDeclaration */:
+                    case 166 /* PropertyDeclaration */:
                         // TypeScript 1.0 spec (April 2014): 8.4.1
                         // Initializer expressions for instance member variables are evaluated in the scope
                         // of the class constructor body but are not permitted to reference parameters or
                         // local variables of the constructor. This effectively means that entities from outer scopes
                         // by the same name as a constructor parameter or local variable are inaccessible
                         // in initializer expressions for instance member variables.
-                        if (!ts.hasSyntacticModifier(location, 32 /* Static */)) {
+                        if (!ts.isStatic(location)) {
                             var ctor = findConstructorDeclaration(location.parent);
                             if (ctor && ctor.locals) {
                                 if (lookup(ctor.locals, name, meaning & 111551 /* Value */)) {
@@ -45228,9 +48228,9 @@ var ts;
                             }
                         }
                         break;
-                    case 252 /* ClassDeclaration */:
-                    case 221 /* ClassExpression */:
-                    case 253 /* InterfaceDeclaration */:
+                    case 256 /* ClassDeclaration */:
+                    case 225 /* ClassExpression */:
+                    case 257 /* InterfaceDeclaration */:
                         // The below is used to lookup type parameters within a class or interface, as they are added to the class/interface locals
                         // These can never be latebound, so the symbol's raw members are sufficient. `getMembersOfNode` cannot be used, as it would
                         // trigger resolving late-bound names, which we may already be in the process of doing while we're here!
@@ -45240,7 +48240,7 @@ var ts;
                                 result = undefined;
                                 break;
                             }
-                            if (lastLocation && ts.hasSyntacticModifier(lastLocation, 32 /* Static */)) {
+                            if (lastLocation && ts.isStatic(lastLocation)) {
                                 // TypeScript 1.0 spec (April 2014): 3.4.1
                                 // The scope of a type parameter extends over the entire declaration with which the type
                                 // parameter list is associated, with the exception of static member declarations in classes.
@@ -45249,7 +48249,7 @@ var ts;
                             }
                             break loop;
                         }
-                        if (location.kind === 221 /* ClassExpression */ && meaning & 32 /* Class */) {
+                        if (location.kind === 225 /* ClassExpression */ && meaning & 32 /* Class */) {
                             var className = location.name;
                             if (className && name === className.escapedText) {
                                 result = location.symbol;
@@ -45257,9 +48257,9 @@ var ts;
                             }
                         }
                         break;
-                    case 223 /* ExpressionWithTypeArguments */:
+                    case 227 /* ExpressionWithTypeArguments */:
                         // The type parameters of a class are not in scope in the base class expression.
-                        if (lastLocation === location.expression && location.parent.token === 93 /* ExtendsKeyword */) {
+                        if (lastLocation === location.expression && location.parent.token === 94 /* ExtendsKeyword */) {
                             var container = location.parent.parent;
                             if (ts.isClassLike(container) && (result = lookup(getSymbolOfNode(container).members, name, meaning & 788968 /* Type */))) {
                                 if (nameNotFoundMessage) {
@@ -45277,9 +48277,9 @@ var ts;
                     //       [foo<T>()]() { } // <-- Reference to T from class's own computed property
                     //   }
                     //
-                    case 158 /* ComputedPropertyName */:
+                    case 161 /* ComputedPropertyName */:
                         grandparent = location.parent.parent;
-                        if (ts.isClassLike(grandparent) || grandparent.kind === 253 /* InterfaceDeclaration */) {
+                        if (ts.isClassLike(grandparent) || grandparent.kind === 257 /* InterfaceDeclaration */) {
                             // A reference to this grandparent's type parameters would be an error
                             if (result = lookup(getSymbolOfNode(grandparent).members, name, meaning & 788968 /* Type */)) {
                                 error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type);
@@ -45287,24 +48287,24 @@ var ts;
                             }
                         }
                         break;
-                    case 209 /* ArrowFunction */:
+                    case 213 /* ArrowFunction */:
                         // when targeting ES6 or higher there is no 'arguments' in an arrow function
                         // for lower compile targets the resolved symbol is used to emit an error
-                        if (compilerOptions.target >= 2 /* ES2015 */) {
+                        if (ts.getEmitScriptTarget(compilerOptions) >= 2 /* ES2015 */) {
                             break;
                         }
                     // falls through
-                    case 165 /* MethodDeclaration */:
-                    case 166 /* Constructor */:
-                    case 167 /* GetAccessor */:
-                    case 168 /* SetAccessor */:
-                    case 251 /* FunctionDeclaration */:
+                    case 168 /* MethodDeclaration */:
+                    case 170 /* Constructor */:
+                    case 171 /* GetAccessor */:
+                    case 172 /* SetAccessor */:
+                    case 255 /* FunctionDeclaration */:
                         if (meaning & 3 /* Variable */ && name === "arguments") {
                             result = argumentsSymbol;
                             break loop;
                         }
                         break;
-                    case 208 /* FunctionExpression */:
+                    case 212 /* FunctionExpression */:
                         if (meaning & 3 /* Variable */ && name === "arguments") {
                             result = argumentsSymbol;
                             break loop;
@@ -45317,7 +48317,7 @@ var ts;
                             }
                         }
                         break;
-                    case 161 /* Decorator */:
+                    case 164 /* Decorator */:
                         // Decorators are resolved at the class declaration. Resolving at the parameter
                         // or member would result in looking up locals in the method.
                         //
@@ -45326,7 +48326,7 @@ var ts;
                         //       method(@y x, y) {} // <-- decorator y should be resolved at the class declaration, not the parameter.
                         //   }
                         //
-                        if (location.parent && location.parent.kind === 160 /* Parameter */) {
+                        if (location.parent && location.parent.kind === 163 /* Parameter */) {
                             location = location.parent;
                         }
                         //
@@ -45341,20 +48341,20 @@ var ts;
                         //   declare function y(x: T): any;
                         //   @param(1 as T) // <-- T should resolve to the type alias outside of class C
                         //   class C<T> {}
-                        if (location.parent && (ts.isClassElement(location.parent) || location.parent.kind === 252 /* ClassDeclaration */)) {
+                        if (location.parent && (ts.isClassElement(location.parent) || location.parent.kind === 256 /* ClassDeclaration */)) {
                             location = location.parent;
                         }
                         break;
-                    case 331 /* JSDocTypedefTag */:
-                    case 324 /* JSDocCallbackTag */:
-                    case 325 /* JSDocEnumTag */:
+                    case 343 /* JSDocTypedefTag */:
+                    case 336 /* JSDocCallbackTag */:
+                    case 337 /* JSDocEnumTag */:
                         // js type aliases do not resolve names from their host, so skip past it
                         var root = ts.getJSDocRoot(location);
                         if (root) {
                             location = root.parent;
                         }
                         break;
-                    case 160 /* Parameter */:
+                    case 163 /* Parameter */:
                         if (lastLocation && (lastLocation === location.initializer ||
                             lastLocation === location.name && ts.isBindingPattern(lastLocation))) {
                             if (!associatedDeclarationForContainingInitializerOrBindingName) {
@@ -45362,7 +48362,7 @@ var ts;
                             }
                         }
                         break;
-                    case 198 /* BindingElement */:
+                    case 202 /* BindingElement */:
                         if (lastLocation && (lastLocation === location.initializer ||
                             lastLocation === location.name && ts.isBindingPattern(lastLocation))) {
                             if (ts.isParameterDeclaration(location) && !associatedDeclarationForContainingInitializerOrBindingName) {
@@ -45370,7 +48370,7 @@ var ts;
                             }
                         }
                         break;
-                    case 185 /* InferType */:
+                    case 189 /* InferType */:
                         if (meaning & 262144 /* TypeParameter */) {
                             var parameterName = location.typeParameter.name;
                             if (parameterName && name === parameterName.escapedText) {
@@ -45384,7 +48384,9 @@ var ts;
                     lastSelfReferenceLocation = location;
                 }
                 lastLocation = location;
-                location = location.parent;
+                location = ts.isJSDocTemplateTag(location) ?
+                    ts.getEffectiveContainerForJSDocTemplateTag(location) || location.parent :
+                    location.parent;
             }
             // We just climbed up parents looking for the name, meaning that we started in a descendant node of `lastLocation`.
             // If `result === lastSelfReferenceLocation.symbol`, that means that we are somewhere inside `lastSelfReferenceLocation` looking up a name, and resolving to `lastLocation` itself.
@@ -45394,7 +48396,7 @@ var ts;
             }
             if (!result) {
                 if (lastLocation) {
-                    ts.Debug.assert(lastLocation.kind === 297 /* SourceFile */);
+                    ts.Debug.assert(lastLocation.kind === 303 /* SourceFile */);
                     if (lastLocation.commonJsModuleIndicator && name === "exports" && meaning & lastLocation.symbol.flags) {
                         return lastLocation.symbol;
                     }
@@ -45421,15 +48423,20 @@ var ts;
                             !checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning) &&
                             !checkAndReportErrorForUsingValueAsType(errorLocation, name, meaning)) {
                         var suggestion = void 0;
-                        if (suggestedNameNotFoundMessage && suggestionCount < maximumSuggestionCount) {
+                        if (suggestionCount < maximumSuggestionCount) {
                             suggestion = getSuggestedSymbolForNonexistentSymbol(originalLocation, name, meaning);
-                            var isGlobalScopeAugmentationDeclaration = suggestion && suggestion.valueDeclaration && ts.isAmbientModule(suggestion.valueDeclaration) && ts.isGlobalScopeAugmentation(suggestion.valueDeclaration);
+                            var isGlobalScopeAugmentationDeclaration = (suggestion === null || suggestion === void 0 ? void 0 : suggestion.valueDeclaration) && ts.isAmbientModule(suggestion.valueDeclaration) && ts.isGlobalScopeAugmentation(suggestion.valueDeclaration);
                             if (isGlobalScopeAugmentationDeclaration) {
                                 suggestion = undefined;
                             }
                             if (suggestion) {
                                 var suggestionName = symbolToString(suggestion);
-                                var diagnostic = error(errorLocation, suggestedNameNotFoundMessage, diagnosticName(nameArg), suggestionName);
+                                var isUncheckedJS = isUncheckedJSSuggestion(originalLocation, suggestion, /*excludeClasses*/ false);
+                                var message = meaning === 1920 /* Namespace */ || nameArg && typeof nameArg !== "string" && ts.nodeIsSynthesized(nameArg) ? ts.Diagnostics.Cannot_find_namespace_0_Did_you_mean_1
+                                    : isUncheckedJS ? ts.Diagnostics.Could_not_find_name_0_Did_you_mean_1
+                                        : ts.Diagnostics.Cannot_find_name_0_Did_you_mean_1;
+                                var diagnostic = createError(errorLocation, message, diagnosticName(nameArg), suggestionName);
+                                addErrorOrSuggestion(!isUncheckedJS, diagnostic);
                                 if (suggestion.valueDeclaration) {
                                     ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestionName));
                                 }
@@ -45453,7 +48460,7 @@ var ts;
             }
             // Perform extra checks only if error reporting was requested
             if (nameNotFoundMessage) {
-                if (propertyWithInvalidInitializer && !(compilerOptions.target === 99 /* ESNext */ && compilerOptions.useDefineForClassFields)) {
+                if (propertyWithInvalidInitializer && !(ts.getEmitScriptTarget(compilerOptions) === 99 /* ESNext */ && useDefineForClassFields)) {
                     // We have a match, but the reference occurred within a property initializer and the identifier also binds
                     // to a local variable in the constructor where the code will be emitted. Note that this is actually allowed
                     // with ESNext+useDefineForClassFields because the scope semantics are different.
@@ -45510,23 +48517,24 @@ var ts;
             if (!ts.isValidTypeOnlyAliasUseSite(useSite)) {
                 var typeOnlyDeclaration = getTypeOnlyAliasDeclaration(symbol);
                 if (typeOnlyDeclaration) {
-                    var isExport = ts.typeOnlyDeclarationIsExport(typeOnlyDeclaration);
-                    var message = isExport
+                    var message = typeOnlyDeclaration.kind === 274 /* ExportSpecifier */
                         ? ts.Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type
                         : ts.Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type;
-                    var relatedMessage = isExport
-                        ? ts.Diagnostics._0_was_exported_here
-                        : ts.Diagnostics._0_was_imported_here;
                     var unescapedName = ts.unescapeLeadingUnderscores(name);
-                    ts.addRelatedInfo(error(useSite, message, unescapedName), ts.createDiagnosticForNode(typeOnlyDeclaration, relatedMessage, unescapedName));
+                    addTypeOnlyDeclarationRelatedInfo(error(useSite, message, unescapedName), typeOnlyDeclaration, unescapedName);
                 }
             }
         }
+        function addTypeOnlyDeclarationRelatedInfo(diagnostic, typeOnlyDeclaration, unescapedName) {
+            if (!typeOnlyDeclaration)
+                return diagnostic;
+            return ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(typeOnlyDeclaration, typeOnlyDeclaration.kind === 274 /* ExportSpecifier */ ? ts.Diagnostics._0_was_exported_here : ts.Diagnostics._0_was_imported_here, unescapedName));
+        }
         function getIsDeferredContext(location, lastLocation) {
-            if (location.kind !== 209 /* ArrowFunction */ && location.kind !== 208 /* FunctionExpression */) {
+            if (location.kind !== 213 /* ArrowFunction */ && location.kind !== 212 /* FunctionExpression */) {
                 // initializers in instance property declaration of class like entities are executed in constructor and thus deferred
                 return ts.isTypeQueryNode(location) || ((ts.isFunctionLikeDeclaration(location) ||
-                    (location.kind === 163 /* PropertyDeclaration */ && !ts.hasSyntacticModifier(location, 32 /* Static */))) && (!lastLocation || lastLocation !== location.name)); // A name is evaluated within the enclosing scope - so it shouldn't count as deferred
+                    (location.kind === 166 /* PropertyDeclaration */ && !ts.isStatic(location))) && (!lastLocation || lastLocation !== location.name)); // A name is evaluated within the enclosing scope - so it shouldn't count as deferred
             }
             if (lastLocation && lastLocation === location.name) {
                 return false;
@@ -45539,12 +48547,12 @@ var ts;
         }
         function isSelfReferenceLocation(node) {
             switch (node.kind) {
-                case 251 /* FunctionDeclaration */:
-                case 252 /* ClassDeclaration */:
-                case 253 /* InterfaceDeclaration */:
-                case 255 /* EnumDeclaration */:
-                case 254 /* TypeAliasDeclaration */:
-                case 256 /* ModuleDeclaration */: // For `namespace N { N; }`
+                case 255 /* FunctionDeclaration */:
+                case 256 /* ClassDeclaration */:
+                case 257 /* InterfaceDeclaration */:
+                case 259 /* EnumDeclaration */:
+                case 258 /* TypeAliasDeclaration */:
+                case 260 /* ModuleDeclaration */: // For `namespace N { N; }`
                     return true;
                 default:
                     return false;
@@ -45554,12 +48562,14 @@ var ts;
             return ts.isString(nameArg) ? ts.unescapeLeadingUnderscores(nameArg) : ts.declarationNameToString(nameArg);
         }
         function isTypeParameterSymbolDeclaredInContainer(symbol, container) {
-            for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
-                var decl = _a[_i];
-                if (decl.kind === 159 /* TypeParameter */) {
-                    var parent = ts.isJSDocTemplateTag(decl.parent) ? ts.getJSDocHost(decl.parent) : decl.parent;
-                    if (parent === container) {
-                        return !(ts.isJSDocTemplateTag(decl.parent) && ts.find(decl.parent.parent.tags, ts.isJSDocTypeAlias)); // TODO: GH#18217
+            if (symbol.declarations) {
+                for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
+                    var decl = _a[_i];
+                    if (decl.kind === 162 /* TypeParameter */) {
+                        var parent = ts.isJSDocTemplateTag(decl.parent) ? ts.getJSDocHost(decl.parent) : decl.parent;
+                        if (parent === container) {
+                            return !(ts.isJSDocTemplateTag(decl.parent) && ts.find(decl.parent.parent.tags, ts.isJSDocTypeAlias)); // TODO: GH#18217
+                        }
                     }
                 }
             }
@@ -45585,7 +48595,7 @@ var ts;
                     }
                     // No static member is present.
                     // Check if we're in an instance method and look for a relevant instance member.
-                    if (location === container && !ts.hasSyntacticModifier(location, 32 /* Static */)) {
+                    if (location === container && !ts.isStatic(location)) {
                         var instanceType = getDeclaredTypeOfSymbol(classSymbol).thisType; // TODO: GH#18217
                         if (getPropertyOfType(instanceType, name)) {
                             error(errorLocation, ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0, diagnosticName(nameArg));
@@ -45611,10 +48621,10 @@ var ts;
          */
         function getEntityNameForExtendingInterface(node) {
             switch (node.kind) {
-                case 78 /* Identifier */:
-                case 201 /* PropertyAccessExpression */:
+                case 79 /* Identifier */:
+                case 205 /* PropertyAccessExpression */:
                     return node.parent ? getEntityNameForExtendingInterface(node.parent) : undefined;
-                case 223 /* ExpressionWithTypeArguments */:
+                case 227 /* ExpressionWithTypeArguments */:
                     if (ts.isEntityNameExpression(node.expression)) {
                         return node.expression;
                     }
@@ -45658,7 +48668,7 @@ var ts;
             return name === "any" || name === "string" || name === "number" || name === "boolean" || name === "never" || name === "unknown";
         }
         function checkAndReportErrorForExportingPrimitiveType(errorLocation, name) {
-            if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 270 /* ExportSpecifier */) {
+            if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 274 /* ExportSpecifier */) {
                 error(errorLocation, ts.Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module, name);
                 return true;
             }
@@ -45727,13 +48737,14 @@ var ts;
             return false;
         }
         function checkResolvedBlockScopedVariable(result, errorLocation) {
+            var _a;
             ts.Debug.assert(!!(result.flags & 2 /* BlockScopedVariable */ || result.flags & 32 /* Class */ || result.flags & 384 /* Enum */));
             if (result.flags & (16 /* Function */ | 1 /* FunctionScopedVariable */ | 67108864 /* Assignment */) && result.flags & 32 /* Class */) {
                 // constructor functions aren't block scoped
                 return;
             }
             // Block-scoped variables cannot be used before their definition
-            var declaration = ts.find(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 255 /* EnumDeclaration */); });
+            var declaration = (_a = result.declarations) === null || _a === void 0 ? void 0 : _a.find(function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 259 /* EnumDeclaration */); });
             if (declaration === undefined)
                 return ts.Debug.fail("checkResolvedBlockScopedVariable could not find block-scoped declaration");
             if (!(declaration.flags & 8388608 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) {
@@ -45768,20 +48779,20 @@ var ts;
         }
         function getAnyImportSyntax(node) {
             switch (node.kind) {
-                case 260 /* ImportEqualsDeclaration */:
+                case 264 /* ImportEqualsDeclaration */:
                     return node;
-                case 262 /* ImportClause */:
+                case 266 /* ImportClause */:
                     return node.parent;
-                case 263 /* NamespaceImport */:
+                case 267 /* NamespaceImport */:
                     return node.parent.parent;
-                case 265 /* ImportSpecifier */:
+                case 269 /* ImportSpecifier */:
                     return node.parent.parent.parent;
                 default:
                     return undefined;
             }
         }
         function getDeclarationOfAliasSymbol(symbol) {
-            return ts.find(symbol.declarations, isAliasSymbolDeclaration);
+            return symbol.declarations && ts.findLast(symbol.declarations, isAliasSymbolDeclaration);
         }
         /**
          * An alias symbol is created by one of the following declarations:
@@ -45796,25 +48807,26 @@ var ts;
          * module.exports = <EntityNameExpression>
          * {<Identifier>}
          * {name: <EntityNameExpression>}
+         * const { x } = require ...
          */
         function isAliasSymbolDeclaration(node) {
-            return node.kind === 260 /* ImportEqualsDeclaration */
-                || node.kind === 259 /* NamespaceExportDeclaration */
-                || node.kind === 262 /* ImportClause */ && !!node.name
-                || node.kind === 263 /* NamespaceImport */
-                || node.kind === 269 /* NamespaceExport */
-                || node.kind === 265 /* ImportSpecifier */
-                || node.kind === 270 /* ExportSpecifier */
-                || node.kind === 266 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node)
+            return node.kind === 264 /* ImportEqualsDeclaration */
+                || node.kind === 263 /* NamespaceExportDeclaration */
+                || node.kind === 266 /* ImportClause */ && !!node.name
+                || node.kind === 267 /* NamespaceImport */
+                || node.kind === 273 /* NamespaceExport */
+                || node.kind === 269 /* ImportSpecifier */
+                || node.kind === 274 /* ExportSpecifier */
+                || node.kind === 270 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node)
                 || ts.isBinaryExpression(node) && ts.getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && ts.exportAssignmentIsAlias(node)
                 || ts.isAccessExpression(node)
                     && ts.isBinaryExpression(node.parent)
                     && node.parent.left === node
-                    && node.parent.operatorToken.kind === 62 /* EqualsToken */
+                    && node.parent.operatorToken.kind === 63 /* EqualsToken */
                     && isAliasableOrJsExpression(node.parent.right)
-                || node.kind === 289 /* ShorthandPropertyAssignment */
-                || node.kind === 288 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer)
-                || ts.isRequireVariableDeclaration(node, /*requireStringLiteralLikeArgument*/ true);
+                || node.kind === 295 /* ShorthandPropertyAssignment */
+                || node.kind === 294 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer)
+                || ts.isRequireVariableDeclaration(node);
         }
         function isAliasableOrJsExpression(e) {
             return ts.isAliasableExpression(e) || ts.isFunctionExpression(e) && isJSConstructor(e);
@@ -45827,7 +48839,7 @@ var ts;
                     ? resolveSymbol(getPropertyOfType(resolveExternalModuleTypeByLiteral(name), commonJSPropertyAccess.name.escapedText))
                     : undefined;
             }
-            if (ts.isVariableDeclaration(node) || node.moduleReference.kind === 272 /* ExternalModuleReference */) {
+            if (ts.isVariableDeclaration(node) || node.moduleReference.kind === 276 /* ExternalModuleReference */) {
                 var immediate = resolveExternalModuleName(node, ts.getExternalModuleRequireArgument(node) || ts.getExternalModuleImportEqualsDeclarationExpression(node));
                 var resolved_4 = resolveExternalModuleSymbol(immediate);
                 markSymbolOfAliasDeclarationIfTypeOnly(node, immediate, resolved_4, /*overwriteEmpty*/ false);
@@ -45840,15 +48852,13 @@ var ts;
         function checkAndReportErrorForResolvingImportAliasToTypeOnlySymbol(node, resolved) {
             if (markSymbolOfAliasDeclarationIfTypeOnly(node, /*immediateTarget*/ undefined, resolved, /*overwriteEmpty*/ false) && !node.isTypeOnly) {
                 var typeOnlyDeclaration = getTypeOnlyAliasDeclaration(getSymbolOfNode(node));
-                var isExport = ts.typeOnlyDeclarationIsExport(typeOnlyDeclaration);
+                var isExport = typeOnlyDeclaration.kind === 274 /* ExportSpecifier */;
                 var message = isExport
                     ? ts.Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type
                     : ts.Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type;
                 var relatedMessage = isExport
                     ? ts.Diagnostics._0_was_exported_here
                     : ts.Diagnostics._0_was_imported_here;
-                // Non-null assertion is safe because the optionality comes from ImportClause,
-                // but if an ImportClause was the typeOnlyDeclaration, it had to have a `name`.
                 var name = ts.unescapeLeadingUnderscores(typeOnlyDeclaration.name.escapedText);
                 ts.addRelatedInfo(error(node.moduleReference, message), ts.createDiagnosticForNode(typeOnlyDeclaration, relatedMessage, name));
             }
@@ -45863,7 +48873,25 @@ var ts;
         function isSyntacticDefault(node) {
             return ((ts.isExportAssignment(node) && !node.isExportEquals) || ts.hasSyntacticModifier(node, 512 /* Default */) || ts.isExportSpecifier(node));
         }
-        function canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias) {
+        function getUsageModeForExpression(usage) {
+            return ts.isStringLiteralLike(usage) ? ts.getModeForUsageLocation(ts.getSourceFileOfNode(usage), usage) : undefined;
+        }
+        function isESMFormatImportImportingCommonjsFormatFile(usageMode, targetMode) {
+            return usageMode === ts.ModuleKind.ESNext && targetMode === ts.ModuleKind.CommonJS;
+        }
+        function isOnlyImportedAsDefault(usage) {
+            var usageMode = getUsageModeForExpression(usage);
+            return usageMode === ts.ModuleKind.ESNext && ts.endsWith(usage.text, ".json" /* Json */);
+        }
+        function canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, usage) {
+            var usageMode = file && getUsageModeForExpression(usage);
+            if (file && usageMode !== undefined) {
+                var result = isESMFormatImportImportingCommonjsFormatFile(usageMode, file.impliedNodeFormat);
+                if (usageMode === ts.ModuleKind.ESNext || result) {
+                    return result;
+                }
+                // fallthrough on cjs usages so we imply defaults for interop'd imports, too
+            }
             if (!allowSyntheticDefaultImports) {
                 return false;
             }
@@ -45894,6 +48922,7 @@ var ts;
             return !file.externalModuleIndicator && !resolveExportByName(moduleSymbol, ts.escapeLeadingUnderscores("__esModule"), /*sourceNode*/ undefined, dontResolveAlias);
         }
         function getTargetOfImportClause(node, dontResolveAlias) {
+            var _a;
             var moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier);
             if (moduleSymbol) {
                 var exportDefaultSymbol = void 0;
@@ -45903,21 +48932,24 @@ var ts;
                 else {
                     exportDefaultSymbol = resolveExportByName(moduleSymbol, "default" /* Default */, node, dontResolveAlias);
                 }
-                var file = ts.find(moduleSymbol.declarations, ts.isSourceFile);
-                var hasSyntheticDefault = canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias);
-                if (!exportDefaultSymbol && !hasSyntheticDefault) {
+                var file = (_a = moduleSymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(ts.isSourceFile);
+                var hasDefaultOnly = isOnlyImportedAsDefault(node.parent.moduleSpecifier);
+                var hasSyntheticDefault = canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, node.parent.moduleSpecifier);
+                if (!exportDefaultSymbol && !hasSyntheticDefault && !hasDefaultOnly) {
                     if (hasExportAssignmentSymbol(moduleSymbol)) {
                         var compilerOptionName = moduleKind >= ts.ModuleKind.ES2015 ? "allowSyntheticDefaultImports" : "esModuleInterop";
                         var exportEqualsSymbol = moduleSymbol.exports.get("export=" /* ExportEquals */);
                         var exportAssignment = exportEqualsSymbol.valueDeclaration;
                         var err = error(node.name, ts.Diagnostics.Module_0_can_only_be_default_imported_using_the_1_flag, symbolToString(moduleSymbol), compilerOptionName);
-                        ts.addRelatedInfo(err, ts.createDiagnosticForNode(exportAssignment, ts.Diagnostics.This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag, compilerOptionName));
+                        if (exportAssignment) {
+                            ts.addRelatedInfo(err, ts.createDiagnosticForNode(exportAssignment, ts.Diagnostics.This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag, compilerOptionName));
+                        }
                     }
                     else {
                         reportNonDefaultExport(moduleSymbol, node);
                     }
                 }
-                else if (hasSyntheticDefault) {
+                else if (hasSyntheticDefault || hasDefaultOnly) {
                     // per emit behavior, a synthetic default overrides a "real" .default member if `__esModule` is not present
                     var resolved = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias);
                     markSymbolOfAliasDeclarationIfTypeOnly(node, moduleSymbol, resolved, /*overwriteTypeOnly*/ false);
@@ -45928,7 +48960,7 @@ var ts;
             }
         }
         function reportNonDefaultExport(moduleSymbol, node) {
-            var _a, _b;
+            var _a, _b, _c;
             if ((_a = moduleSymbol.exports) === null || _a === void 0 ? void 0 : _a.has(node.symbol.escapedName)) {
                 error(node.name, ts.Diagnostics.Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead, symbolToString(moduleSymbol), symbolToString(node.symbol));
             }
@@ -45936,7 +48968,7 @@ var ts;
                 var diagnostic = error(node.name, ts.Diagnostics.Module_0_has_no_default_export, symbolToString(moduleSymbol));
                 var exportStar = (_b = moduleSymbol.exports) === null || _b === void 0 ? void 0 : _b.get("__export" /* ExportStar */);
                 if (exportStar) {
-                    var defaultExport = ts.find(exportStar.declarations, function (decl) {
+                    var defaultExport = (_c = exportStar.declarations) === null || _c === void 0 ? void 0 : _c.find(function (decl) {
                         var _a, _b;
                         return !!(ts.isExportDeclaration(decl) && decl.moduleSpecifier &&
                             ((_b = (_a = resolveExternalModuleName(decl, decl.moduleSpecifier)) === null || _a === void 0 ? void 0 : _a.exports) === null || _b === void 0 ? void 0 : _b.has("default" /* Default */)));
@@ -46014,7 +49046,7 @@ var ts;
             }
         }
         function getExternalModuleMember(node, specifier, dontResolveAlias) {
-            var _a;
+            var _a, _b;
             if (dontResolveAlias === void 0) { dontResolveAlias = false; }
             var moduleSpecifier = ts.getExternalModuleRequireArgument(node) || node.moduleSpecifier;
             var moduleSymbol = resolveExternalModuleName(node, moduleSpecifier); // TODO: GH#18217
@@ -46022,8 +49054,8 @@ var ts;
             if (!ts.isIdentifier(name)) {
                 return undefined;
             }
-            var suppressInteropError = name.escapedText === "default" /* Default */ && !!(compilerOptions.allowSyntheticDefaultImports || compilerOptions.esModuleInterop);
-            var targetSymbol = resolveESModuleSymbol(moduleSymbol, moduleSpecifier, dontResolveAlias, suppressInteropError);
+            var suppressInteropError = name.escapedText === "default" /* Default */ && !!(compilerOptions.allowSyntheticDefaultImports || ts.getESModuleInterop(compilerOptions));
+            var targetSymbol = resolveESModuleSymbol(moduleSymbol, moduleSpecifier, /*dontResolveAlias*/ false, suppressInteropError);
             if (targetSymbol) {
                 if (name.escapedText) {
                     if (ts.isShorthandAmbientModuleSymbol(moduleSymbol)) {
@@ -46041,8 +49073,8 @@ var ts;
                     symbolFromVariable = resolveSymbol(symbolFromVariable, dontResolveAlias);
                     var symbolFromModule = getExportOfModule(targetSymbol, name, specifier, dontResolveAlias);
                     if (symbolFromModule === undefined && name.escapedText === "default" /* Default */) {
-                        var file = ts.find(moduleSymbol.declarations, ts.isSourceFile);
-                        if (canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias)) {
+                        var file = (_a = moduleSymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(ts.isSourceFile);
+                        if (isOnlyImportedAsDefault(moduleSpecifier) || canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, moduleSpecifier)) {
                             symbolFromModule = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias);
                         }
                     }
@@ -46061,7 +49093,7 @@ var ts;
                             }
                         }
                         else {
-                            if ((_a = moduleSymbol.exports) === null || _a === void 0 ? void 0 : _a.has("default" /* Default */)) {
+                            if ((_b = moduleSymbol.exports) === null || _b === void 0 ? void 0 : _b.has("default" /* Default */)) {
                                 error(name, ts.Diagnostics.Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead, moduleName, declarationName);
                             }
                             else {
@@ -46074,8 +49106,8 @@ var ts;
             }
         }
         function reportNonExportedMember(node, name, declarationName, moduleSymbol, moduleName) {
-            var _a;
-            var localSymbol = (_a = moduleSymbol.valueDeclaration.locals) === null || _a === void 0 ? void 0 : _a.get(name.escapedText);
+            var _a, _b;
+            var localSymbol = (_b = (_a = moduleSymbol.valueDeclaration) === null || _a === void 0 ? void 0 : _a.locals) === null || _b === void 0 ? void 0 : _b.get(name.escapedText);
             var exports = moduleSymbol.exports;
             if (localSymbol) {
                 var exportedEqualsSymbol = exports === null || exports === void 0 ? void 0 : exports.get("export=" /* ExportEquals */);
@@ -46087,9 +49119,11 @@ var ts;
                     var exportedSymbol = exports ? ts.find(symbolsToArray(exports), function (symbol) { return !!getSymbolIfSameReference(symbol, localSymbol); }) : undefined;
                     var diagnostic = exportedSymbol ? error(name, ts.Diagnostics.Module_0_declares_1_locally_but_it_is_exported_as_2, moduleName, declarationName, symbolToString(exportedSymbol)) :
                         error(name, ts.Diagnostics.Module_0_declares_1_locally_but_it_is_not_exported, moduleName, declarationName);
-                    ts.addRelatedInfo.apply(void 0, __spreadArray([diagnostic], ts.map(localSymbol.declarations, function (decl, index) {
-                        return ts.createDiagnosticForNode(decl, index === 0 ? ts.Diagnostics._0_is_declared_here : ts.Diagnostics.and_here, declarationName);
-                    })));
+                    if (localSymbol.declarations) {
+                        ts.addRelatedInfo.apply(void 0, __spreadArray([diagnostic], ts.map(localSymbol.declarations, function (decl, index) {
+                            return ts.createDiagnosticForNode(decl, index === 0 ? ts.Diagnostics._0_is_declared_here : ts.Diagnostics.and_here, declarationName);
+                        }), false));
+                    }
                 }
             }
             else {
@@ -46098,18 +49132,18 @@ var ts;
         }
         function reportInvalidImportEqualsExportMember(node, name, declarationName, moduleName) {
             if (moduleKind >= ts.ModuleKind.ES2015) {
-                var message = compilerOptions.esModuleInterop ? ts.Diagnostics._0_can_only_be_imported_by_using_a_default_import :
+                var message = ts.getESModuleInterop(compilerOptions) ? ts.Diagnostics._0_can_only_be_imported_by_using_a_default_import :
                     ts.Diagnostics._0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import;
                 error(name, message, declarationName);
             }
             else {
                 if (ts.isInJSFile(node)) {
-                    var message = compilerOptions.esModuleInterop ? ts.Diagnostics._0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import :
+                    var message = ts.getESModuleInterop(compilerOptions) ? ts.Diagnostics._0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import :
                         ts.Diagnostics._0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import;
                     error(name, message, declarationName);
                 }
                 else {
-                    var message = compilerOptions.esModuleInterop ? ts.Diagnostics._0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import :
+                    var message = ts.getESModuleInterop(compilerOptions) ? ts.Diagnostics._0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import :
                         ts.Diagnostics._0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import;
                     error(name, message, declarationName, declarationName, moduleName);
                 }
@@ -46168,7 +49202,7 @@ var ts;
             return getTargetOfAliasLikeExpression(expression, dontRecursivelyResolve);
         }
         function getTargetOfAccessExpression(node, dontRecursivelyResolve) {
-            if (!(ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */)) {
+            if (!(ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 63 /* EqualsToken */)) {
                 return undefined;
             }
             return getTargetOfAliasLikeExpression(node.parent.right, dontRecursivelyResolve);
@@ -46176,31 +49210,31 @@ var ts;
         function getTargetOfAliasDeclaration(node, dontRecursivelyResolve) {
             if (dontRecursivelyResolve === void 0) { dontRecursivelyResolve = false; }
             switch (node.kind) {
-                case 260 /* ImportEqualsDeclaration */:
-                case 249 /* VariableDeclaration */:
+                case 264 /* ImportEqualsDeclaration */:
+                case 253 /* VariableDeclaration */:
                     return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve);
-                case 262 /* ImportClause */:
+                case 266 /* ImportClause */:
                     return getTargetOfImportClause(node, dontRecursivelyResolve);
-                case 263 /* NamespaceImport */:
+                case 267 /* NamespaceImport */:
                     return getTargetOfNamespaceImport(node, dontRecursivelyResolve);
-                case 269 /* NamespaceExport */:
+                case 273 /* NamespaceExport */:
                     return getTargetOfNamespaceExport(node, dontRecursivelyResolve);
-                case 265 /* ImportSpecifier */:
-                case 198 /* BindingElement */:
+                case 269 /* ImportSpecifier */:
+                case 202 /* BindingElement */:
                     return getTargetOfImportSpecifier(node, dontRecursivelyResolve);
-                case 270 /* ExportSpecifier */:
+                case 274 /* ExportSpecifier */:
                     return getTargetOfExportSpecifier(node, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, dontRecursivelyResolve);
-                case 266 /* ExportAssignment */:
-                case 216 /* BinaryExpression */:
+                case 270 /* ExportAssignment */:
+                case 220 /* BinaryExpression */:
                     return getTargetOfExportAssignment(node, dontRecursivelyResolve);
-                case 259 /* NamespaceExportDeclaration */:
+                case 263 /* NamespaceExportDeclaration */:
                     return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve);
-                case 289 /* ShorthandPropertyAssignment */:
+                case 295 /* ShorthandPropertyAssignment */:
                     return resolveEntityName(node.name, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ true, dontRecursivelyResolve);
-                case 288 /* PropertyAssignment */:
+                case 294 /* PropertyAssignment */:
                     return getTargetOfPropertyAssignment(node, dontRecursivelyResolve);
-                case 202 /* ElementAccessExpression */:
-                case 201 /* PropertyAccessExpression */:
+                case 206 /* ElementAccessExpression */:
+                case 205 /* PropertyAccessExpression */:
                     return getTargetOfAccessExpression(node, dontRecursivelyResolve);
                 default:
                     return ts.Debug.fail();
@@ -46259,13 +49293,13 @@ var ts;
          * and issue an error if so.
          *
          * @param aliasDeclaration The alias declaration not marked as type-only
+         * @param immediateTarget The symbol to which the alias declaration immediately resolves
+         * @param finalTarget The symbol to which the alias declaration ultimately resolves
+         * @param overwriteEmpty Checks `resolvesToSymbol` for type-only declarations even if `aliasDeclaration`
          * has already been marked as not resolving to a type-only alias. Used when recursively resolving qualified
          * names of import aliases, e.g. `import C = a.b.C`. If namespace `a` is not found to be type-only, the
          * import declaration will initially be marked as not resolving to a type-only symbol. But, namespace `b`
          * must still be checked for a type-only marker, overwriting the previous negative result if found.
-         * @param immediateTarget The symbol to which the alias declaration immediately resolves
-         * @param finalTarget The symbol to which the alias declaration ultimately resolves
-         * @param overwriteEmpty Checks `resolvesToSymbol` for type-only declarations even if `aliasDeclaration`
          */
         function markSymbolOfAliasDeclarationIfTypeOnly(aliasDeclaration, immediateTarget, finalTarget, overwriteEmpty) {
             if (!aliasDeclaration || ts.isPropertyAccessExpression(aliasDeclaration))
@@ -46348,23 +49382,45 @@ var ts;
             //     import a = |b|; // Namespace
             //     import a = |b.c|; // Value, type, namespace
             //     import a = |b.c|.d; // Namespace
-            if (entityName.kind === 78 /* Identifier */ && ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) {
+            if (entityName.kind === 79 /* Identifier */ && ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) {
                 entityName = entityName.parent;
             }
             // Check for case 1 and 3 in the above example
-            if (entityName.kind === 78 /* Identifier */ || entityName.parent.kind === 157 /* QualifiedName */) {
+            if (entityName.kind === 79 /* Identifier */ || entityName.parent.kind === 160 /* QualifiedName */) {
                 return resolveEntityName(entityName, 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias);
             }
             else {
                 // Case 2 in above example
                 // entityName.kind could be a QualifiedName or a Missing identifier
-                ts.Debug.assert(entityName.parent.kind === 260 /* ImportEqualsDeclaration */);
+                ts.Debug.assert(entityName.parent.kind === 264 /* ImportEqualsDeclaration */);
                 return resolveEntityName(entityName, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias);
             }
         }
         function getFullyQualifiedName(symbol, containingLocation) {
             return symbol.parent ? getFullyQualifiedName(symbol.parent, containingLocation) + "." + symbolToString(symbol) : symbolToString(symbol, containingLocation, /*meaning*/ undefined, 16 /* DoNotIncludeSymbolChain */ | 4 /* AllowAnyNodeKind */);
         }
+        function getContainingQualifiedNameNode(node) {
+            while (ts.isQualifiedName(node.parent)) {
+                node = node.parent;
+            }
+            return node;
+        }
+        function tryGetQualifiedNameAsValue(node) {
+            var left = ts.getFirstIdentifier(node);
+            var symbol = resolveName(left, left.escapedText, 111551 /* Value */, undefined, left, /*isUse*/ true);
+            if (!symbol) {
+                return undefined;
+            }
+            while (ts.isQualifiedName(left.parent)) {
+                var type = getTypeOfSymbol(symbol);
+                symbol = getPropertyOfType(type, left.parent.right.escapedText);
+                if (!symbol) {
+                    return undefined;
+                }
+                left = left.parent;
+            }
+            return symbol;
+        }
         /**
          * Resolves a qualified name and any involved aliases.
          */
@@ -46374,17 +49430,17 @@ var ts;
             }
             var namespaceMeaning = 1920 /* Namespace */ | (ts.isInJSFile(name) ? meaning & 111551 /* Value */ : 0);
             var symbol;
-            if (name.kind === 78 /* Identifier */) {
+            if (name.kind === 79 /* Identifier */) {
                 var message = meaning === namespaceMeaning || ts.nodeIsSynthesized(name) ? ts.Diagnostics.Cannot_find_namespace_0 : getCannotFindNameDiagnosticForName(ts.getFirstIdentifier(name));
                 var symbolFromJSPrototype = ts.isInJSFile(name) && !ts.nodeIsSynthesized(name) ? resolveEntityNameFromAssignmentDeclaration(name, meaning) : undefined;
-                symbol = getMergedSymbol(resolveName(location || name, name.escapedText, meaning, ignoreErrors || symbolFromJSPrototype ? undefined : message, name, /*isUse*/ true));
+                symbol = getMergedSymbol(resolveName(location || name, name.escapedText, meaning, ignoreErrors || symbolFromJSPrototype ? undefined : message, name, /*isUse*/ true, false));
                 if (!symbol) {
                     return getMergedSymbol(symbolFromJSPrototype);
                 }
             }
-            else if (name.kind === 157 /* QualifiedName */ || name.kind === 201 /* PropertyAccessExpression */) {
-                var left = name.kind === 157 /* QualifiedName */ ? name.left : name.expression;
-                var right = name.kind === 157 /* QualifiedName */ ? name.right : name.name;
+            else if (name.kind === 160 /* QualifiedName */ || name.kind === 205 /* PropertyAccessExpression */) {
+                var left = name.kind === 160 /* QualifiedName */ ? name.left : name.expression;
+                var right = name.kind === 160 /* QualifiedName */ ? name.right : name.name;
                 var namespace = resolveEntityName(left, namespaceMeaning, ignoreErrors, /*dontResolveAlias*/ false, location);
                 if (!namespace || ts.nodeIsMissing(right)) {
                     return undefined;
@@ -46392,18 +49448,17 @@ var ts;
                 else if (namespace === unknownSymbol) {
                     return namespace;
                 }
-                if (ts.isInJSFile(name)) {
-                    if (namespace.valueDeclaration &&
-                        ts.isVariableDeclaration(namespace.valueDeclaration) &&
-                        namespace.valueDeclaration.initializer &&
-                        isCommonJsRequire(namespace.valueDeclaration.initializer)) {
-                        var moduleName = namespace.valueDeclaration.initializer.arguments[0];
-                        var moduleSym = resolveExternalModuleName(moduleName, moduleName);
-                        if (moduleSym) {
-                            var resolvedModuleSymbol = resolveExternalModuleSymbol(moduleSym);
-                            if (resolvedModuleSymbol) {
-                                namespace = resolvedModuleSymbol;
-                            }
+                if (namespace.valueDeclaration &&
+                    ts.isInJSFile(namespace.valueDeclaration) &&
+                    ts.isVariableDeclaration(namespace.valueDeclaration) &&
+                    namespace.valueDeclaration.initializer &&
+                    isCommonJsRequire(namespace.valueDeclaration.initializer)) {
+                    var moduleName = namespace.valueDeclaration.initializer.arguments[0];
+                    var moduleSym = resolveExternalModuleName(moduleName, moduleName);
+                    if (moduleSym) {
+                        var resolvedModuleSymbol = resolveExternalModuleSymbol(moduleSym);
+                        if (resolvedModuleSymbol) {
+                            namespace = resolvedModuleSymbol;
                         }
                     }
                 }
@@ -46412,10 +49467,29 @@ var ts;
                     if (!ignoreErrors) {
                         var namespaceName = getFullyQualifiedName(namespace);
                         var declarationName = ts.declarationNameToString(right);
-                        var suggestion = getSuggestedSymbolForNonexistentModule(right, namespace);
-                        suggestion ?
-                            error(right, ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, namespaceName, declarationName, symbolToString(suggestion)) :
-                            error(right, ts.Diagnostics.Namespace_0_has_no_exported_member_1, namespaceName, declarationName);
+                        var suggestionForNonexistentModule = getSuggestedSymbolForNonexistentModule(right, namespace);
+                        if (suggestionForNonexistentModule) {
+                            error(right, ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, namespaceName, declarationName, symbolToString(suggestionForNonexistentModule));
+                            return undefined;
+                        }
+                        var containingQualifiedName = ts.isQualifiedName(name) && getContainingQualifiedNameNode(name);
+                        var canSuggestTypeof = globalObjectType // <-- can't pull on types if global types aren't initialized yet
+                            && (meaning & 788968 /* Type */)
+                            && containingQualifiedName
+                            && !ts.isTypeOfExpression(containingQualifiedName.parent)
+                            && tryGetQualifiedNameAsValue(containingQualifiedName);
+                        if (canSuggestTypeof) {
+                            error(containingQualifiedName, ts.Diagnostics._0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0, ts.entityNameToString(containingQualifiedName));
+                            return undefined;
+                        }
+                        if (meaning & 1920 /* Namespace */ && ts.isQualifiedName(name.parent)) {
+                            var exportedTypeSymbol = getMergedSymbol(getSymbol(getExportsOfSymbol(namespace), right.escapedText, 788968 /* Type */));
+                            if (exportedTypeSymbol) {
+                                error(name.parent.right, ts.Diagnostics.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, symbolToString(exportedTypeSymbol), ts.unescapeLeadingUnderscores(name.parent.right.escapedText));
+                                return undefined;
+                            }
+                        }
+                        error(right, ts.Diagnostics.Namespace_0_has_no_exported_member_1, namespaceName, declarationName);
                     }
                     return undefined;
                 }
@@ -46424,7 +49498,7 @@ var ts;
                 throw ts.Debug.assertNever(name, "Unknown entity name kind.");
             }
             ts.Debug.assert((ts.getCheckFlags(symbol) & 1 /* Instantiated */) === 0, "Should never get an instantiated symbol here.");
-            if (!ts.nodeIsSynthesized(name) && ts.isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 266 /* ExportAssignment */)) {
+            if (!ts.nodeIsSynthesized(name) && ts.isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 270 /* ExportAssignment */)) {
                 markSymbolOfAliasDeclarationIfTypeOnly(ts.getAliasDeclarationFromName(name), symbol, /*finalTarget*/ undefined, /*overwriteEmpty*/ true);
             }
             return (symbol.flags & meaning) || dontResolveAlias ? symbol : resolveAlias(symbol);
@@ -46517,6 +49591,7 @@ var ts;
                 : undefined;
         }
         function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation) {
+            var _a, _b, _c, _d, _e, _f, _g;
             if (isForAugmentation === void 0) { isForAugmentation = false; }
             if (ts.startsWith(moduleReference, "@types/")) {
                 var diag = ts.Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1;
@@ -46528,7 +49603,16 @@ var ts;
                 return ambientModule;
             }
             var currentSourceFile = ts.getSourceFileOfNode(location);
-            var resolvedModule = ts.getResolvedModule(currentSourceFile, moduleReference); // TODO: GH#18217
+            var contextSpecifier = ts.isStringLiteralLike(location)
+                ? location
+                : ((_a = ts.findAncestor(location, ts.isImportCall)) === null || _a === void 0 ? void 0 : _a.arguments[0]) ||
+                    ((_b = ts.findAncestor(location, ts.isImportDeclaration)) === null || _b === void 0 ? void 0 : _b.moduleSpecifier) ||
+                    ((_c = ts.findAncestor(location, ts.isExternalModuleImportEqualsDeclaration)) === null || _c === void 0 ? void 0 : _c.moduleReference.expression) ||
+                    ((_d = ts.findAncestor(location, ts.isExportDeclaration)) === null || _d === void 0 ? void 0 : _d.moduleSpecifier) ||
+                    ((_e = (ts.isModuleDeclaration(location) ? location : location.parent && ts.isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : undefined)) === null || _e === void 0 ? void 0 : _e.name) ||
+                    ((_f = (ts.isLiteralImportTypeNode(location) ? location : undefined)) === null || _f === void 0 ? void 0 : _f.argument.literal);
+            var mode = contextSpecifier && ts.isStringLiteralLike(contextSpecifier) ? ts.getModeForUsageLocation(currentSourceFile, contextSpecifier) : currentSourceFile.impliedNodeFormat;
+            var resolvedModule = ts.getResolvedModule(currentSourceFile, moduleReference, mode);
             var resolutionDiagnostic = resolvedModule && ts.getResolutionDiagnostic(compilerOptions, resolvedModule);
             var sourceFile = resolvedModule && !resolutionDiagnostic && host.getSourceFile(resolvedModule.resolvedFileName);
             if (sourceFile) {
@@ -46536,6 +49620,15 @@ var ts;
                     if (resolvedModule.isExternalLibraryImport && !ts.resolutionExtensionIsTSOrJson(resolvedModule.extension)) {
                         errorOnImplicitAnyModule(/*isError*/ false, errorNode, resolvedModule, moduleReference);
                     }
+                    if (ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.Node12 || ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeNext) {
+                        var isSyncImport = (currentSourceFile.impliedNodeFormat === ts.ModuleKind.CommonJS && !ts.findAncestor(location, ts.isImportCall)) || !!ts.findAncestor(location, ts.isImportEqualsDeclaration);
+                        if (isSyncImport && sourceFile.impliedNodeFormat === ts.ModuleKind.ESNext) {
+                            error(errorNode, ts.Diagnostics.Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_synchronously_Use_dynamic_import_instead, moduleReference);
+                        }
+                        if (mode === ts.ModuleKind.ESNext && compilerOptions.resolveJsonModule && resolvedModule.extension === ".json" /* Json */) {
+                            error(errorNode, ts.Diagnostics.JSON_imports_are_experimental_in_ES_module_mode_imports);
+                        }
+                    }
                     // merged symbol is module declaration symbol combined with all augmentations
                     return getMergedSymbol(sourceFile.symbol);
                 }
@@ -46585,6 +49678,10 @@ var ts;
                 }
                 else {
                     var tsExtension = ts.tryExtractTSExtension(moduleReference);
+                    var isExtensionlessRelativePathImport = ts.pathIsRelative(moduleReference) && !ts.hasExtension(moduleReference);
+                    var moduleResolutionKind = ts.getEmitModuleResolutionKind(compilerOptions);
+                    var resolutionIsNode12OrNext = moduleResolutionKind === ts.ModuleResolutionKind.Node12 ||
+                        moduleResolutionKind === ts.ModuleResolutionKind.NodeNext;
                     if (tsExtension) {
                         var diag = ts.Diagnostics.An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead;
                         var importSourceWithoutExtension = ts.removeExtension(moduleReference, tsExtension);
@@ -46593,18 +49690,30 @@ var ts;
                          * Direct users to import source with .js extension if outputting an ES module.
                          * @see https://github.com/microsoft/TypeScript/issues/42151
                          */
-                        var moduleKind_1 = ts.getEmitModuleKind(compilerOptions);
-                        if (moduleKind_1 >= ts.ModuleKind.ES2015) {
-                            replacedImportSource += ".js";
+                        if (moduleKind >= ts.ModuleKind.ES2015) {
+                            replacedImportSource += tsExtension === ".mts" /* Mts */ ? ".mjs" : tsExtension === ".cts" /* Cts */ ? ".cjs" : ".js";
                         }
                         error(errorNode, diag, tsExtension, replacedImportSource);
                     }
                     else if (!compilerOptions.resolveJsonModule &&
                         ts.fileExtensionIs(moduleReference, ".json" /* Json */) &&
-                        ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeJs &&
+                        ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.Classic &&
                         ts.hasJsonModuleEmitEnabled(compilerOptions)) {
                         error(errorNode, ts.Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference);
                     }
+                    else if (mode === ts.ModuleKind.ESNext && resolutionIsNode12OrNext && isExtensionlessRelativePathImport) {
+                        var absoluteRef_1 = ts.getNormalizedAbsolutePath(moduleReference, ts.getDirectoryPath(currentSourceFile.path));
+                        var suggestedExt = (_g = suggestedExtensions.find(function (_a) {
+                            var actualExt = _a[0], _importExt = _a[1];
+                            return host.fileExists(absoluteRef_1 + actualExt);
+                        })) === null || _g === void 0 ? void 0 : _g[1];
+                        if (suggestedExt) {
+                            error(errorNode, ts.Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node12_or_nodenext_Did_you_mean_0, moduleReference + suggestedExt);
+                        }
+                        else {
+                            error(errorNode, ts.Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node12_or_nodenext_Consider_adding_an_extension_to_the_import_path);
+                        }
+                    }
                     else {
                         error(errorNode, moduleNotFoundError, moduleReference);
                     }
@@ -46618,13 +49727,19 @@ var ts;
                 ? typesPackageExists(packageId.name)
                     ? ts.chainDiagnosticMessages(
                     /*details*/ undefined, ts.Diagnostics.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, packageId.name, ts.mangleScopedPackageName(packageId.name))
-                    : ts.chainDiagnosticMessages(
-                    /*details*/ undefined, ts.Diagnostics.Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0, moduleReference, ts.mangleScopedPackageName(packageId.name))
+                    : packageBundlesTypes(packageId.name)
+                        ? ts.chainDiagnosticMessages(
+                        /*details*/ undefined, ts.Diagnostics.If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1, packageId.name, moduleReference)
+                        : ts.chainDiagnosticMessages(
+                        /*details*/ undefined, ts.Diagnostics.Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0, moduleReference, ts.mangleScopedPackageName(packageId.name))
                 : undefined;
             errorOrSuggestion(isError, errorNode, ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type, moduleReference, resolvedFileName));
         }
         function typesPackageExists(packageName) {
-            return getPackagesSet().has(ts.getTypesPackageName(packageName));
+            return getPackagesMap().has(ts.getTypesPackageName(packageName));
+        }
+        function packageBundlesTypes(packageName) {
+            return !!getPackagesMap().get(packageName);
         }
         function resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) {
             if (moduleSymbol === null || moduleSymbol === void 0 ? void 0 : moduleSymbol.exports) {
@@ -46661,47 +49776,57 @@ var ts;
         function resolveESModuleSymbol(moduleSymbol, referencingLocation, dontResolveAlias, suppressInteropError) {
             var symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias);
             if (!dontResolveAlias && symbol) {
-                if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !ts.getDeclarationOfKind(symbol, 297 /* SourceFile */)) {
+                if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !ts.getDeclarationOfKind(symbol, 303 /* SourceFile */)) {
                     var compilerOptionName = moduleKind >= ts.ModuleKind.ES2015
                         ? "allowSyntheticDefaultImports"
                         : "esModuleInterop";
                     error(referencingLocation, ts.Diagnostics.This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export, compilerOptionName);
                     return symbol;
                 }
-                if (compilerOptions.esModuleInterop) {
-                    var referenceParent = referencingLocation.parent;
-                    if ((ts.isImportDeclaration(referenceParent) && ts.getNamespaceDeclarationNode(referenceParent)) ||
-                        ts.isImportCall(referenceParent)) {
-                        var type = getTypeOfSymbol(symbol);
+                var referenceParent = referencingLocation.parent;
+                if ((ts.isImportDeclaration(referenceParent) && ts.getNamespaceDeclarationNode(referenceParent)) ||
+                    ts.isImportCall(referenceParent)) {
+                    var reference = ts.isImportCall(referenceParent) ? referenceParent.arguments[0] : referenceParent.moduleSpecifier;
+                    var type = getTypeOfSymbol(symbol);
+                    var defaultOnlyType = getTypeWithSyntheticDefaultOnly(type, symbol, moduleSymbol, reference);
+                    if (defaultOnlyType) {
+                        return cloneTypeAsModuleType(symbol, defaultOnlyType, referenceParent);
+                    }
+                    if (ts.getESModuleInterop(compilerOptions)) {
                         var sigs = getSignaturesOfStructuredType(type, 0 /* Call */);
                         if (!sigs || !sigs.length) {
                             sigs = getSignaturesOfStructuredType(type, 1 /* Construct */);
                         }
-                        if (sigs && sigs.length) {
-                            var moduleType = getTypeWithSyntheticDefaultImportType(type, symbol, moduleSymbol);
-                            // Create a new symbol which has the module's type less the call and construct signatures
-                            var result = createSymbol(symbol.flags, symbol.escapedName);
-                            result.declarations = symbol.declarations ? symbol.declarations.slice() : [];
-                            result.parent = symbol.parent;
-                            result.target = symbol;
-                            result.originatingImport = referenceParent;
-                            if (symbol.valueDeclaration)
-                                result.valueDeclaration = symbol.valueDeclaration;
-                            if (symbol.constEnumOnlyModule)
-                                result.constEnumOnlyModule = true;
-                            if (symbol.members)
-                                result.members = new ts.Map(symbol.members);
-                            if (symbol.exports)
-                                result.exports = new ts.Map(symbol.exports);
-                            var resolvedModuleType = resolveStructuredTypeMembers(moduleType); // Should already be resolved from the signature checks above
-                            result.type = createAnonymousType(result, resolvedModuleType.members, ts.emptyArray, ts.emptyArray, resolvedModuleType.stringIndexInfo, resolvedModuleType.numberIndexInfo);
-                            return result;
+                        if ((sigs && sigs.length) || getPropertyOfType(type, "default" /* Default */)) {
+                            var moduleType = getTypeWithSyntheticDefaultImportType(type, symbol, moduleSymbol, reference);
+                            return cloneTypeAsModuleType(symbol, moduleType, referenceParent);
                         }
                     }
                 }
             }
             return symbol;
         }
+        /**
+         * Create a new symbol which has the module's type less the call and construct signatures
+         */
+        function cloneTypeAsModuleType(symbol, moduleType, referenceParent) {
+            var result = createSymbol(symbol.flags, symbol.escapedName);
+            result.declarations = symbol.declarations ? symbol.declarations.slice() : [];
+            result.parent = symbol.parent;
+            result.target = symbol;
+            result.originatingImport = referenceParent;
+            if (symbol.valueDeclaration)
+                result.valueDeclaration = symbol.valueDeclaration;
+            if (symbol.constEnumOnlyModule)
+                result.constEnumOnlyModule = true;
+            if (symbol.members)
+                result.members = new ts.Map(symbol.members);
+            if (symbol.exports)
+                result.exports = new ts.Map(symbol.exports);
+            var resolvedModuleType = resolveStructuredTypeMembers(moduleType); // Should already be resolved from the signature checks above
+            result.type = createAnonymousType(result, resolvedModuleType.members, ts.emptyArray, ts.emptyArray, resolvedModuleType.indexInfos);
+            return result;
+        }
         function hasExportAssignmentSymbol(moduleSymbol) {
             return moduleSymbol.exports.get("export=" /* ExportEquals */) !== undefined;
         }
@@ -46712,10 +49837,30 @@ var ts;
             var exports = getExportsOfModuleAsArray(moduleSymbol);
             var exportEquals = resolveExternalModuleSymbol(moduleSymbol);
             if (exportEquals !== moduleSymbol) {
-                ts.addRange(exports, getPropertiesOfType(getTypeOfSymbol(exportEquals)));
+                var type = getTypeOfSymbol(exportEquals);
+                if (shouldTreatPropertiesOfExternalModuleAsExports(type)) {
+                    ts.addRange(exports, getPropertiesOfType(type));
+                }
             }
             return exports;
         }
+        function forEachExportAndPropertyOfModule(moduleSymbol, cb) {
+            var exports = getExportsOfModule(moduleSymbol);
+            exports.forEach(function (symbol, key) {
+                if (!isReservedMemberName(key)) {
+                    cb(symbol, key);
+                }
+            });
+            var exportEquals = resolveExternalModuleSymbol(moduleSymbol);
+            if (exportEquals !== moduleSymbol) {
+                var type = getTypeOfSymbol(exportEquals);
+                if (shouldTreatPropertiesOfExternalModuleAsExports(type)) {
+                    forEachPropertyOfType(type, function (symbol, escapedName) {
+                        cb(symbol, escapedName);
+                    });
+                }
+            }
+        }
         function tryGetMemberInModuleExports(memberName, moduleSymbol) {
             var symbolTable = getExportsOfModule(moduleSymbol);
             if (symbolTable) {
@@ -46732,11 +49877,14 @@ var ts;
                 return undefined;
             }
             var type = getTypeOfSymbol(exportEquals);
-            return type.flags & 131068 /* Primitive */ ||
-                ts.getObjectFlags(type) & 1 /* Class */ ||
-                isArrayOrTupleLikeType(type)
-                ? undefined
-                : getPropertyOfType(type, memberName);
+            return shouldTreatPropertiesOfExternalModuleAsExports(type) ? getPropertyOfType(type, memberName) : undefined;
+        }
+        function shouldTreatPropertiesOfExternalModuleAsExports(resolvedExternalModuleType) {
+            return !(resolvedExternalModuleType.flags & 131068 /* Primitive */ ||
+                ts.getObjectFlags(resolvedExternalModuleType) & 1 /* Class */ ||
+                // `isArrayOrTupleLikeType` is too expensive to use in this auto-imports hot path
+                isArrayType(resolvedExternalModuleType) ||
+                isTupleType(resolvedExternalModuleType));
         }
         function getExportsOfSymbol(symbol) {
             return symbol.flags & 6256 /* LateBindingContainer */ ? getResolvedMembersOrExportsOfSymbol(symbol, "resolvedExports" /* resolvedExports */) :
@@ -46794,11 +49942,13 @@ var ts;
                 if (exportStars) {
                     var nestedSymbols = ts.createSymbolTable();
                     var lookupTable_1 = new ts.Map();
-                    for (var _i = 0, _a = exportStars.declarations; _i < _a.length; _i++) {
-                        var node = _a[_i];
-                        var resolvedModule = resolveExternalModuleName(node, node.moduleSpecifier);
-                        var exportedSymbols = visit(resolvedModule);
-                        extendExportSymbols(nestedSymbols, exportedSymbols, lookupTable_1, node);
+                    if (exportStars.declarations) {
+                        for (var _i = 0, _a = exportStars.declarations; _i < _a.length; _i++) {
+                            var node = _a[_i];
+                            var resolvedModule = resolveExternalModuleName(node, node.moduleSpecifier);
+                            var exportedSymbols = visit(resolvedModule);
+                            extendExportSymbols(nestedSymbols, exportedSymbols, lookupTable_1, node);
+                        }
                     }
                     lookupTable_1.forEach(function (_a, id) {
                         var exportsWithDuplicate = _a.exportsWithDuplicate;
@@ -46881,17 +50031,34 @@ var ts;
                 var additionalContainers = ts.mapDefined(container.declarations, fileSymbolIfFileSymbolExportEqualsContainer);
                 var reexportContainers = enclosingDeclaration && getAlternativeContainingModules(symbol, enclosingDeclaration);
                 var objectLiteralContainer = getVariableDeclarationOfObjectLiteral(container, meaning);
-                if (enclosingDeclaration && getAccessibleSymbolChain(container, enclosingDeclaration, 1920 /* Namespace */, /*externalOnly*/ false)) {
+                if (enclosingDeclaration &&
+                    container.flags & getQualifiedLeftMeaning(meaning) &&
+                    getAccessibleSymbolChain(container, enclosingDeclaration, 1920 /* Namespace */, /*externalOnly*/ false)) {
                     return ts.append(ts.concatenate(ts.concatenate([container], additionalContainers), reexportContainers), objectLiteralContainer); // This order expresses a preference for the real container if it is in scope
                 }
-                var res = ts.append(ts.append(additionalContainers, container), objectLiteralContainer);
-                return ts.concatenate(res, reexportContainers);
+                // we potentially have a symbol which is a member of the instance side of something - look for a variable in scope with the container's type
+                // which may be acting like a namespace (eg, `Symbol` acts like a namespace when looking up `Symbol.toStringTag`)
+                var firstVariableMatch = !(container.flags & getQualifiedLeftMeaning(meaning))
+                    && container.flags & 788968 /* Type */
+                    && getDeclaredTypeOfSymbol(container).flags & 524288 /* Object */
+                    && meaning === 111551 /* Value */
+                    ? forEachSymbolTableInScope(enclosingDeclaration, function (t) {
+                        return ts.forEachEntry(t, function (s) {
+                            if (s.flags & getQualifiedLeftMeaning(meaning) && getTypeOfSymbol(s) === getDeclaredTypeOfSymbol(container)) {
+                                return s;
+                            }
+                        });
+                    }) : undefined;
+                var res = firstVariableMatch ? __spreadArray(__spreadArray([firstVariableMatch], additionalContainers, true), [container], false) : __spreadArray(__spreadArray([], additionalContainers, true), [container], false);
+                res = ts.append(res, objectLiteralContainer);
+                res = ts.addRange(res, reexportContainers);
+                return res;
             }
             var candidates = ts.mapDefined(symbol.declarations, function (d) {
                 if (!ts.isAmbientModule(d) && d.parent && hasNonGlobalAugmentationExternalModuleSymbol(d.parent)) {
                     return getSymbolOfNode(d.parent);
                 }
-                if (ts.isClassExpression(d) && ts.isBinaryExpression(d.parent) && d.parent.operatorToken.kind === 62 /* EqualsToken */ && ts.isAccessExpression(d.parent.left) && ts.isEntityNameExpression(d.parent.left.expression)) {
+                if (ts.isClassExpression(d) && ts.isBinaryExpression(d.parent) && d.parent.operatorToken.kind === 63 /* EqualsToken */ && ts.isAccessExpression(d.parent.left) && ts.isEntityNameExpression(d.parent.left.expression)) {
                     if (ts.isModuleExportsAccessExpression(d.parent.left) || ts.isExportsIdentifier(d.parent.left.expression)) {
                         return getSymbolOfNode(ts.getSourceFileOfNode(d));
                     }
@@ -46963,7 +50130,7 @@ var ts;
             var members = node.members;
             for (var _i = 0, members_3 = members; _i < members_3.length; _i++) {
                 var member = members_3[_i];
-                if (member.kind === 166 /* Constructor */ && ts.nodeIsPresent(member.body)) {
+                if (member.kind === 170 /* Constructor */ && ts.nodeIsPresent(member.body)) {
                     return member;
                 }
             }
@@ -46972,7 +50139,9 @@ var ts;
             var result = new Type(checker, flags);
             typeCount++;
             result.id = typeCount;
-            typeCatalog.push(result);
+            if (produceDiagnostics) { // Only record types from one checker
+                ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.recordType(result);
+            }
             return result;
         }
         function createOriginType(flags) {
@@ -46985,12 +50154,6 @@ var ts;
             type.objectFlags = objectFlags;
             return type;
         }
-        function createBooleanType(trueFalseTypes) {
-            var type = getUnionType(trueFalseTypes);
-            type.flags |= 16 /* Boolean */;
-            type.intrinsicName = "boolean";
-            return type;
-        }
         function createObjectType(objectFlags, symbol) {
             var type = createType(524288 /* Object */);
             type.objectFlags = objectFlags;
@@ -46999,12 +50162,11 @@ var ts;
             type.properties = undefined;
             type.callSignatures = undefined;
             type.constructSignatures = undefined;
-            type.stringIndexInfo = undefined;
-            type.numberIndexInfo = undefined;
+            type.indexInfos = undefined;
             return type;
         }
         function createTypeofType() {
-            return getUnionType(ts.arrayFrom(typeofEQFacts.keys(), getLiteralType));
+            return getUnionType(ts.arrayFrom(typeofEQFacts.keys(), getStringLiteralType));
         }
         function createTypeParameter(symbol) {
             var type = createType(262144 /* TypeParameter */);
@@ -47026,27 +50188,34 @@ var ts;
         function getNamedMembers(members) {
             var result;
             members.forEach(function (symbol, id) {
-                if (!isReservedMemberName(id) && symbolIsValue(symbol)) {
+                if (isNamedMember(symbol, id)) {
                     (result || (result = [])).push(symbol);
                 }
             });
             return result || ts.emptyArray;
         }
-        function setStructuredTypeMembers(type, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo) {
+        function isNamedMember(member, escapedName) {
+            return !isReservedMemberName(escapedName) && symbolIsValue(member);
+        }
+        function getNamedOrIndexSignatureMembers(members) {
+            var result = getNamedMembers(members);
+            var index = getIndexSymbolFromSymbolTable(members);
+            return index ? ts.concatenate(result, [index]) : result;
+        }
+        function setStructuredTypeMembers(type, members, callSignatures, constructSignatures, indexInfos) {
             var resolved = type;
             resolved.members = members;
             resolved.properties = ts.emptyArray;
             resolved.callSignatures = callSignatures;
             resolved.constructSignatures = constructSignatures;
-            resolved.stringIndexInfo = stringIndexInfo;
-            resolved.numberIndexInfo = numberIndexInfo;
+            resolved.indexInfos = indexInfos;
             // This can loop back to getPropertyOfType() which would crash if `callSignatures` & `constructSignatures` are not initialized.
             if (members !== emptySymbols)
                 resolved.properties = getNamedMembers(members);
             return resolved;
         }
-        function createAnonymousType(symbol, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo) {
-            return setStructuredTypeMembers(createObjectType(16 /* Anonymous */, symbol), members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo);
+        function createAnonymousType(symbol, members, callSignatures, constructSignatures, indexInfos) {
+            return setStructuredTypeMembers(createObjectType(16 /* Anonymous */, symbol), members, callSignatures, constructSignatures, indexInfos);
         }
         function getResolvedTypeWithoutAbstractConstructSignatures(type) {
             if (type.constructSignatures.length === 0)
@@ -47056,7 +50225,7 @@ var ts;
             var constructSignatures = ts.filter(type.constructSignatures, function (signature) { return !(signature.flags & 4 /* Abstract */); });
             if (type.constructSignatures === constructSignatures)
                 return type;
-            var typeCopy = createAnonymousType(type.symbol, type.members, type.callSignatures, ts.some(constructSignatures) ? constructSignatures : ts.emptyArray, type.stringIndexInfo, type.numberIndexInfo);
+            var typeCopy = createAnonymousType(type.symbol, type.members, type.callSignatures, ts.some(constructSignatures) ? constructSignatures : ts.emptyArray, type.indexInfos);
             type.objectTypeWithoutAbstractConstructSignatures = typeCopy;
             typeCopy.objectTypeWithoutAbstractConstructSignatures = typeCopy;
             return typeCopy;
@@ -47066,28 +50235,28 @@ var ts;
             var _loop_8 = function (location) {
                 // Locals of a source file are not in scope (because they get merged into the global symbol table)
                 if (location.locals && !isGlobalSourceFile(location)) {
-                    if (result = callback(location.locals)) {
+                    if (result = callback(location.locals, /*ignoreQualification*/ undefined, /*isLocalNameLookup*/ true, location)) {
                         return { value: result };
                     }
                 }
                 switch (location.kind) {
-                    case 297 /* SourceFile */:
+                    case 303 /* SourceFile */:
                         if (!ts.isExternalOrCommonJsModule(location)) {
                             break;
                         }
                     // falls through
-                    case 256 /* ModuleDeclaration */:
+                    case 260 /* ModuleDeclaration */:
                         var sym = getSymbolOfNode(location);
                         // `sym` may not have exports if this module declaration is backed by the symbol for a `const` that's being rewritten
                         // into a namespace - in such cases, it's best to just let the namespace appear empty (the const members couldn't have referred
                         // to one another anyway)
-                        if (result = callback((sym === null || sym === void 0 ? void 0 : sym.exports) || emptySymbols)) {
+                        if (result = callback((sym === null || sym === void 0 ? void 0 : sym.exports) || emptySymbols, /*ignoreQualification*/ undefined, /*isLocalNameLookup*/ true, location)) {
                             return { value: result };
                         }
                         break;
-                    case 252 /* ClassDeclaration */:
-                    case 221 /* ClassExpression */:
-                    case 253 /* InterfaceDeclaration */:
+                    case 256 /* ClassDeclaration */:
+                    case 225 /* ClassExpression */:
+                    case 257 /* InterfaceDeclaration */:
                         // Type parameters are bound into `members` lists so they can merge across declarations
                         // This is troublesome, since in all other respects, they behave like locals :cries:
                         // TODO: the below is shared with similar code in `resolveName` - in fact, rephrasing all this symbol
@@ -47102,7 +50271,7 @@ var ts;
                                 (table_1 || (table_1 = ts.createSymbolTable())).set(key, memberSymbol);
                             }
                         });
-                        if (table_1 && (result = callback(table_1))) {
+                        if (table_1 && (result = callback(table_1, /*ignoreQualification*/ undefined, /*isLocalNameLookup*/ false, location))) {
                             return { value: result };
                         }
                         break;
@@ -47113,7 +50282,7 @@ var ts;
                 if (typeof state_2 === "object")
                     return state_2.value;
             }
-            return callback(globals);
+            return callback(globals, /*ignoreQualification*/ undefined, /*isLocalNameLookup*/ true);
         }
         function getQualifiedLeftMeaning(rightMeaning) {
             // If we are looking in value space, the parent meaning is value, other wise it is namespace
@@ -47124,20 +50293,30 @@ var ts;
             if (!(symbol && !isPropertyOrMethodDeclarationSymbol(symbol))) {
                 return undefined;
             }
+            var links = getSymbolLinks(symbol);
+            var cache = (links.accessibleChainCache || (links.accessibleChainCache = new ts.Map()));
+            // Go from enclosingDeclaration to the first scope we check, so the cache is keyed off the scope and thus shared more
+            var firstRelevantLocation = forEachSymbolTableInScope(enclosingDeclaration, function (_, __, ___, node) { return node; });
+            var key = "".concat(useOnlyExternalAliasing ? 0 : 1, "|").concat(firstRelevantLocation && getNodeId(firstRelevantLocation), "|").concat(meaning);
+            if (cache.has(key)) {
+                return cache.get(key);
+            }
             var id = getSymbolId(symbol);
             var visitedSymbolTables = visitedSymbolTablesMap.get(id);
             if (!visitedSymbolTables) {
                 visitedSymbolTablesMap.set(id, visitedSymbolTables = []);
             }
-            return forEachSymbolTableInScope(enclosingDeclaration, getAccessibleSymbolChainFromSymbolTable);
+            var result = forEachSymbolTableInScope(enclosingDeclaration, getAccessibleSymbolChainFromSymbolTable);
+            cache.set(key, result);
+            return result;
             /**
              * @param {ignoreQualification} boolean Set when a symbol is being looked for through the exports of another symbol (meaning we have a route to qualify it already)
              */
-            function getAccessibleSymbolChainFromSymbolTable(symbols, ignoreQualification) {
+            function getAccessibleSymbolChainFromSymbolTable(symbols, ignoreQualification, isLocalNameLookup) {
                 if (!ts.pushIfUnique(visitedSymbolTables, symbols)) {
                     return undefined;
                 }
-                var result = trySymbolTable(symbols, ignoreQualification);
+                var result = trySymbolTable(symbols, ignoreQualification, isLocalNameLookup);
                 visitedSymbolTables.pop();
                 return result;
             }
@@ -47155,7 +50334,7 @@ var ts;
                     !ts.some(symbolFromSymbolTable.declarations, hasNonGlobalAugmentationExternalModuleSymbol) &&
                     (ignoreQualification || canQualifySymbol(getMergedSymbol(symbolFromSymbolTable), meaning));
             }
-            function trySymbolTable(symbols, ignoreQualification) {
+            function trySymbolTable(symbols, ignoreQualification, isLocalNameLookup) {
                 // If symbol is directly available by its name in the symbol table
                 if (isAccessible(symbols.get(symbol.escapedName), /*resolvedAliasSymbol*/ undefined, ignoreQualification)) {
                     return [symbol];
@@ -47168,9 +50347,11 @@ var ts;
                         && !(ts.isUMDExportSymbol(symbolFromSymbolTable) && enclosingDeclaration && ts.isExternalModule(ts.getSourceFileOfNode(enclosingDeclaration)))
                         // If `!useOnlyExternalAliasing`, we can use any type of alias to get the name
                         && (!useOnlyExternalAliasing || ts.some(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration))
+                        // If we're looking up a local name to reference directly, omit namespace reexports, otherwise when we're trawling through an export list to make a dotted name, we can keep it
+                        && (isLocalNameLookup ? !ts.some(symbolFromSymbolTable.declarations, ts.isNamespaceReexportDeclaration) : true)
                         // While exports are generally considered to be in scope, export-specifier declared symbols are _not_
                         // See similar comment in `resolveName` for details
-                        && (ignoreQualification || !ts.getDeclarationOfKind(symbolFromSymbolTable, 270 /* ExportSpecifier */))) {
+                        && (ignoreQualification || !ts.getDeclarationOfKind(symbolFromSymbolTable, 274 /* ExportSpecifier */))) {
                         var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable);
                         var candidate = getCandidateListForSymbol(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification);
                         if (candidate) {
@@ -47214,7 +50395,7 @@ var ts;
                     return true;
                 }
                 // Qualify if the symbol from symbol table has same meaning as expected
-                symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 270 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable;
+                symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 274 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable;
                 if (symbolFromSymbolTable.flags & meaning) {
                     qualify = true;
                     return true;
@@ -47229,10 +50410,10 @@ var ts;
                 for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
                     var declaration = _a[_i];
                     switch (declaration.kind) {
-                        case 163 /* PropertyDeclaration */:
-                        case 165 /* MethodDeclaration */:
-                        case 167 /* GetAccessor */:
-                        case 168 /* SetAccessor */:
+                        case 166 /* PropertyDeclaration */:
+                        case 168 /* MethodDeclaration */:
+                        case 171 /* GetAccessor */:
+                        case 172 /* SetAccessor */:
                             continue;
                         default:
                             return false;
@@ -47270,7 +50451,7 @@ var ts;
                         return hasAccessibleDeclarations;
                     }
                 }
-                else if (allowModules) {
+                if (allowModules) {
                     if (ts.some(symbol.declarations, hasNonGlobalAugmentationExternalModuleSymbol)) {
                         if (shouldComputeAliasesToMakeVisible) {
                             earlyModuleBail = true;
@@ -47362,14 +50543,14 @@ var ts;
             return node && getSymbolOfNode(node);
         }
         function hasExternalModuleSymbol(declaration) {
-            return ts.isAmbientModule(declaration) || (declaration.kind === 297 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration));
+            return ts.isAmbientModule(declaration) || (declaration.kind === 303 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration));
         }
         function hasNonGlobalAugmentationExternalModuleSymbol(declaration) {
-            return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 297 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration));
+            return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 303 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration));
         }
         function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) {
             var aliasesToMakeVisible;
-            if (!ts.every(ts.filter(symbol.declarations, function (d) { return d.kind !== 78 /* Identifier */; }), getIsDeclarationVisible)) {
+            if (!ts.every(ts.filter(symbol.declarations, function (d) { return d.kind !== 79 /* Identifier */; }), getIsDeclarationVisible)) {
                 return undefined;
             }
             return { accessibility: 0 /* Accessible */, aliasesToMakeVisible: aliasesToMakeVisible };
@@ -47421,14 +50602,14 @@ var ts;
         function isEntityNameVisible(entityName, enclosingDeclaration) {
             // get symbol of the first identifier of the entityName
             var meaning;
-            if (entityName.parent.kind === 176 /* TypeQuery */ ||
+            if (entityName.parent.kind === 180 /* TypeQuery */ ||
                 ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent) ||
-                entityName.parent.kind === 158 /* ComputedPropertyName */) {
+                entityName.parent.kind === 161 /* ComputedPropertyName */) {
                 // Typeof value
                 meaning = 111551 /* Value */ | 1048576 /* ExportValue */;
             }
-            else if (entityName.kind === 157 /* QualifiedName */ || entityName.kind === 201 /* PropertyAccessExpression */ ||
-                entityName.parent.kind === 260 /* ImportEqualsDeclaration */) {
+            else if (entityName.kind === 160 /* QualifiedName */ || entityName.kind === 205 /* PropertyAccessExpression */ ||
+                entityName.parent.kind === 264 /* ImportEqualsDeclaration */) {
                 // Left identifier from type reference or TypeAlias
                 // Entity name of the import declaration
                 meaning = 1920 /* Namespace */;
@@ -47469,7 +50650,7 @@ var ts;
             function symbolToStringWorker(writer) {
                 var entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags); // TODO: GH#18217
                 // add neverAsciiEscape for GH#39027
-                var printer = (enclosingDeclaration === null || enclosingDeclaration === void 0 ? void 0 : enclosingDeclaration.kind) === 297 /* SourceFile */ ? ts.createPrinter({ removeComments: true, neverAsciiEscape: true }) : ts.createPrinter({ removeComments: true });
+                var printer = (enclosingDeclaration === null || enclosingDeclaration === void 0 ? void 0 : enclosingDeclaration.kind) === 303 /* SourceFile */ ? ts.createPrinter({ removeComments: true, neverAsciiEscape: true }) : ts.createPrinter({ removeComments: true });
                 var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration);
                 printer.writeNode(4 /* Unspecified */, entity, /*sourceFile*/ sourceFile, writer);
                 return writer;
@@ -47481,10 +50662,10 @@ var ts;
             function signatureToStringWorker(writer) {
                 var sigOutput;
                 if (flags & 262144 /* WriteArrowStyleSignature */) {
-                    sigOutput = kind === 1 /* Construct */ ? 175 /* ConstructorType */ : 174 /* FunctionType */;
+                    sigOutput = kind === 1 /* Construct */ ? 179 /* ConstructorType */ : 178 /* FunctionType */;
                 }
                 else {
-                    sigOutput = kind === 1 /* Construct */ ? 170 /* ConstructSignature */ : 169 /* CallSignature */;
+                    sigOutput = kind === 1 /* Construct */ ? 174 /* ConstructSignature */ : 173 /* CallSignature */;
                 }
                 var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */);
                 var printer = ts.createPrinter({ removeComments: true, omitTrailingSemicolon: true });
@@ -47500,7 +50681,9 @@ var ts;
             var typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | (noTruncation ? 1 /* NoTruncation */ : 0), writer);
             if (typeNode === undefined)
                 return ts.Debug.fail("should always get typenode");
-            var options = { removeComments: true };
+            // The unresolved type gets a synthesized comment on `any` to hint to users that it's not a plain `any`.
+            // Otherwise, we always strip comments out.
+            var options = { removeComments: type !== unresolvedType };
             var printer = ts.createPrinter(options);
             var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration);
             printer.writeNode(4 /* Unspecified */, typeNode, /*sourceFile*/ sourceFile, writer);
@@ -47524,22 +50707,22 @@ var ts;
             return typeToString(type, /*enclosingDeclaration*/ undefined, 64 /* UseFullyQualifiedType */);
         }
         function symbolValueDeclarationIsContextSensitive(symbol) {
-            return symbol && symbol.valueDeclaration && ts.isExpression(symbol.valueDeclaration) && !isContextSensitive(symbol.valueDeclaration);
+            return symbol && !!symbol.valueDeclaration && ts.isExpression(symbol.valueDeclaration) && !isContextSensitive(symbol.valueDeclaration);
         }
         function toNodeBuilderFlags(flags) {
             if (flags === void 0) { flags = 0 /* None */; }
             return flags & 814775659 /* NodeBuilderFlagsMask */;
         }
         function isClassInstanceSide(type) {
-            return !!type.symbol && !!(type.symbol.flags & 32 /* Class */) && (type === getDeclaredTypeOfClassOrInterface(type.symbol) || !!(ts.getObjectFlags(type) & 1073741824 /* IsClassInstanceClone */));
+            return !!type.symbol && !!(type.symbol.flags & 32 /* Class */) && (type === getDeclaredTypeOfClassOrInterface(type.symbol) || (!!(type.flags & 524288 /* Object */) && !!(ts.getObjectFlags(type) & 16777216 /* IsClassInstanceClone */)));
         }
         function createNodeBuilder() {
             return {
                 typeToTypeNode: function (type, enclosingDeclaration, flags, tracker) {
                     return withContext(enclosingDeclaration, flags, tracker, function (context) { return typeToTypeNodeHelper(type, context); });
                 },
-                indexInfoToIndexSignatureDeclaration: function (indexInfo, kind, enclosingDeclaration, flags, tracker) {
-                    return withContext(enclosingDeclaration, flags, tracker, function (context) { return indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind, context, /*typeNode*/ undefined); });
+                indexInfoToIndexSignatureDeclaration: function (indexInfo, enclosingDeclaration, flags, tracker) {
+                    return withContext(enclosingDeclaration, flags, tracker, function (context) { return indexInfoToIndexSignatureDeclarationHelper(indexInfo, context, /*typeNode*/ undefined); });
                 },
                 signatureToSignatureDeclaration: function (signature, kind, enclosingDeclaration, flags, tracker) {
                     return withContext(enclosingDeclaration, flags, tracker, function (context) { return signatureToSignatureDeclarationHelper(signature, kind, context); });
@@ -47570,9 +50753,8 @@ var ts;
                     enclosingDeclaration: enclosingDeclaration,
                     flags: flags || 0 /* None */,
                     // If no full tracker is provided, fake up a dummy one with a basic limited-functionality moduleResolverHost
-                    tracker: tracker && tracker.trackSymbol ? tracker : { trackSymbol: ts.noop, moduleResolverHost: flags & 134217728 /* DoNotIncludeSymbolChain */ ? {
+                    tracker: tracker && tracker.trackSymbol ? tracker : { trackSymbol: function () { return false; }, moduleResolverHost: flags & 134217728 /* DoNotIncludeSymbolChain */ ? {
                             getCommonSourceDirectory: !!host.getCommonSourceDirectory ? function () { return host.getCommonSourceDirectory(); } : function () { return ""; },
-                            getSourceFiles: function () { return host.getSourceFiles(); },
                             getCurrentDirectory: function () { return host.getCurrentDirectory(); },
                             getSymlinkCache: ts.maybeBind(host, host.getSymlinkCache),
                             useCaseSensitiveFileNames: ts.maybeBind(host, host.useCaseSensitiveFileNames),
@@ -47581,19 +50763,49 @@ var ts;
                             isSourceOfProjectReferenceRedirect: function (fileName) { return host.isSourceOfProjectReferenceRedirect(fileName); },
                             fileExists: function (fileName) { return host.fileExists(fileName); },
                             getFileIncludeReasons: function () { return host.getFileIncludeReasons(); },
+                            readFile: host.readFile ? (function (fileName) { return host.readFile(fileName); }) : undefined,
                         } : undefined },
                     encounteredError: false,
+                    reportedDiagnostic: false,
                     visitedTypes: undefined,
                     symbolDepth: undefined,
                     inferTypeParameters: undefined,
                     approximateLength: 0
                 };
+                context.tracker = wrapSymbolTrackerToReportForContext(context, context.tracker);
                 var resultingNode = cb(context);
                 if (context.truncating && context.flags & 1 /* NoTruncation */) {
                     (_b = (_a = context.tracker) === null || _a === void 0 ? void 0 : _a.reportTruncationError) === null || _b === void 0 ? void 0 : _b.call(_a);
                 }
                 return context.encounteredError ? undefined : resultingNode;
             }
+            function wrapSymbolTrackerToReportForContext(context, tracker) {
+                var oldTrackSymbol = tracker.trackSymbol;
+                return __assign(__assign({}, tracker), { reportCyclicStructureError: wrapReportedDiagnostic(tracker.reportCyclicStructureError), reportInaccessibleThisError: wrapReportedDiagnostic(tracker.reportInaccessibleThisError), reportInaccessibleUniqueSymbolError: wrapReportedDiagnostic(tracker.reportInaccessibleUniqueSymbolError), reportLikelyUnsafeImportRequiredError: wrapReportedDiagnostic(tracker.reportLikelyUnsafeImportRequiredError), reportNonlocalAugmentation: wrapReportedDiagnostic(tracker.reportNonlocalAugmentation), reportPrivateInBaseOfClassExpression: wrapReportedDiagnostic(tracker.reportPrivateInBaseOfClassExpression), reportNonSerializableProperty: wrapReportedDiagnostic(tracker.reportNonSerializableProperty), trackSymbol: oldTrackSymbol && (function () {
+                        var args = [];
+                        for (var _i = 0; _i < arguments.length; _i++) {
+                            args[_i] = arguments[_i];
+                        }
+                        var result = oldTrackSymbol.apply(void 0, args);
+                        if (result) {
+                            context.reportedDiagnostic = true;
+                        }
+                        return result;
+                    }) });
+                function wrapReportedDiagnostic(method) {
+                    if (!method) {
+                        return method;
+                    }
+                    return (function () {
+                        var args = [];
+                        for (var _i = 0; _i < arguments.length; _i++) {
+                            args[_i] = arguments[_i];
+                        }
+                        context.reportedDiagnostic = true;
+                        return method.apply(void 0, args);
+                    });
+                }
+            }
             function checkTruncationLength(context) {
                 if (context.truncating)
                     return context.truncating;
@@ -47611,33 +50823,39 @@ var ts;
                         return undefined; // TODO: GH#18217
                     }
                     context.approximateLength += 3;
-                    return ts.factory.createKeywordTypeNode(128 /* AnyKeyword */);
+                    return ts.factory.createKeywordTypeNode(130 /* AnyKeyword */);
                 }
                 if (!(context.flags & 536870912 /* NoTypeReduction */)) {
                     type = getReducedType(type);
                 }
                 if (type.flags & 1 /* Any */) {
+                    if (type.aliasSymbol) {
+                        return ts.factory.createTypeReferenceNode(symbolToEntityNameNode(type.aliasSymbol), mapToTypeNodes(type.aliasTypeArguments, context));
+                    }
+                    if (type === unresolvedType) {
+                        return ts.addSyntheticLeadingComment(ts.factory.createKeywordTypeNode(130 /* AnyKeyword */), 3 /* MultiLineCommentTrivia */, "unresolved");
+                    }
                     context.approximateLength += 3;
-                    return ts.factory.createKeywordTypeNode(type === intrinsicMarkerType ? 136 /* IntrinsicKeyword */ : 128 /* AnyKeyword */);
+                    return ts.factory.createKeywordTypeNode(type === intrinsicMarkerType ? 138 /* IntrinsicKeyword */ : 130 /* AnyKeyword */);
                 }
                 if (type.flags & 2 /* Unknown */) {
-                    return ts.factory.createKeywordTypeNode(152 /* UnknownKeyword */);
+                    return ts.factory.createKeywordTypeNode(154 /* UnknownKeyword */);
                 }
                 if (type.flags & 4 /* String */) {
                     context.approximateLength += 6;
-                    return ts.factory.createKeywordTypeNode(147 /* StringKeyword */);
+                    return ts.factory.createKeywordTypeNode(149 /* StringKeyword */);
                 }
                 if (type.flags & 8 /* Number */) {
                     context.approximateLength += 6;
-                    return ts.factory.createKeywordTypeNode(144 /* NumberKeyword */);
+                    return ts.factory.createKeywordTypeNode(146 /* NumberKeyword */);
                 }
                 if (type.flags & 64 /* BigInt */) {
                     context.approximateLength += 6;
-                    return ts.factory.createKeywordTypeNode(155 /* BigIntKeyword */);
+                    return ts.factory.createKeywordTypeNode(157 /* BigIntKeyword */);
                 }
-                if (type.flags & 16 /* Boolean */) {
+                if (type.flags & 16 /* Boolean */ && !type.aliasSymbol) {
                     context.approximateLength += 7;
-                    return ts.factory.createKeywordTypeNode(131 /* BooleanKeyword */);
+                    return ts.factory.createKeywordTypeNode(133 /* BooleanKeyword */);
                 }
                 if (type.flags & 1024 /* EnumLiteral */ && !(type.flags & 1048576 /* Union */)) {
                     var parentSymbol = getParentOfSymbol(type.symbol);
@@ -47691,15 +50909,15 @@ var ts;
                         }
                     }
                     context.approximateLength += 13;
-                    return ts.factory.createTypeOperatorNode(151 /* UniqueKeyword */, ts.factory.createKeywordTypeNode(148 /* SymbolKeyword */));
+                    return ts.factory.createTypeOperatorNode(153 /* UniqueKeyword */, ts.factory.createKeywordTypeNode(150 /* SymbolKeyword */));
                 }
                 if (type.flags & 16384 /* Void */) {
                     context.approximateLength += 4;
-                    return ts.factory.createKeywordTypeNode(113 /* VoidKeyword */);
+                    return ts.factory.createKeywordTypeNode(114 /* VoidKeyword */);
                 }
                 if (type.flags & 32768 /* Undefined */) {
                     context.approximateLength += 9;
-                    return ts.factory.createKeywordTypeNode(150 /* UndefinedKeyword */);
+                    return ts.factory.createKeywordTypeNode(152 /* UndefinedKeyword */);
                 }
                 if (type.flags & 65536 /* Null */) {
                     context.approximateLength += 4;
@@ -47707,15 +50925,15 @@ var ts;
                 }
                 if (type.flags & 131072 /* Never */) {
                     context.approximateLength += 5;
-                    return ts.factory.createKeywordTypeNode(141 /* NeverKeyword */);
+                    return ts.factory.createKeywordTypeNode(143 /* NeverKeyword */);
                 }
                 if (type.flags & 4096 /* ESSymbol */) {
                     context.approximateLength += 6;
-                    return ts.factory.createKeywordTypeNode(148 /* SymbolKeyword */);
+                    return ts.factory.createKeywordTypeNode(150 /* SymbolKeyword */);
                 }
                 if (type.flags & 67108864 /* NonPrimitive */) {
                     context.approximateLength += 6;
-                    return ts.factory.createKeywordTypeNode(145 /* ObjectKeyword */);
+                    return ts.factory.createKeywordTypeNode(147 /* ObjectKeyword */);
                 }
                 if (isThisTypeParameter(type)) {
                     if (context.flags & 4194304 /* InObjectTypeLiteral */) {
@@ -47785,7 +51003,7 @@ var ts;
                     var indexedType = type.type;
                     context.approximateLength += 6;
                     var indexTypeNode = typeToTypeNodeHelper(indexedType, context);
-                    return ts.factory.createTypeOperatorNode(138 /* KeyOfKeyword */, indexTypeNode);
+                    return ts.factory.createTypeOperatorNode(140 /* KeyOfKeyword */, indexTypeNode);
                 }
                 if (type.flags & 134217728 /* TemplateLiteral */) {
                     var texts_1 = type.texts;
@@ -47806,6 +51024,13 @@ var ts;
                     return ts.factory.createIndexedAccessTypeNode(objectTypeNode, indexTypeNode);
                 }
                 if (type.flags & 16777216 /* Conditional */) {
+                    return visitAndTransformType(type, function (type) { return conditionalTypeToTypeNode(type); });
+                }
+                if (type.flags & 33554432 /* Substitution */) {
+                    return typeToTypeNodeHelper(type.baseType, context);
+                }
+                return ts.Debug.fail("Should be unreachable.");
+                function conditionalTypeToTypeNode(type) {
                     var checkTypeNode = typeToTypeNodeHelper(type.checkType, context);
                     var saveInferTypeParameters = context.inferTypeParameters;
                     context.inferTypeParameters = type.root.inferTypeParameters;
@@ -47816,10 +51041,6 @@ var ts;
                     context.approximateLength += 15;
                     return ts.factory.createConditionalTypeNode(checkTypeNode, extendsTypeNode, trueTypeNode, falseTypeNode);
                 }
-                if (type.flags & 33554432 /* Substitution */) {
-                    return typeToTypeNodeHelper(type.baseType, context);
-                }
-                return ts.Debug.fail("Should be unreachable.");
                 function typeToTypeNodeOrCircularityElision(type) {
                     var _a, _b, _c;
                     if (type.flags & 1048576 /* Union */) {
@@ -47842,15 +51063,15 @@ var ts;
                     if (isMappedTypeWithKeyofConstraintDeclaration(type)) {
                         // We have a { [P in keyof T]: X }
                         // We do this to ensure we retain the toplevel keyof-ness of the type which may be lost due to keyof distribution during `getConstraintTypeFromMappedType`
-                        appropriateConstraintTypeNode = ts.factory.createTypeOperatorNode(138 /* KeyOfKeyword */, typeToTypeNodeHelper(getModifiersTypeFromMappedType(type), context));
+                        appropriateConstraintTypeNode = ts.factory.createTypeOperatorNode(140 /* KeyOfKeyword */, typeToTypeNodeHelper(getModifiersTypeFromMappedType(type), context));
                     }
                     else {
                         appropriateConstraintTypeNode = typeToTypeNodeHelper(getConstraintTypeFromMappedType(type), context);
                     }
                     var typeParameterNode = typeParameterToDeclarationWithConstraint(getTypeParameterFromMappedType(type), context, appropriateConstraintTypeNode);
                     var nameTypeNode = type.declaration.nameType ? typeToTypeNodeHelper(getNameTypeFromMappedType(type), context) : undefined;
-                    var templateTypeNode = typeToTypeNodeHelper(getTemplateTypeFromMappedType(type), context);
-                    var mappedTypeNode = ts.factory.createMappedTypeNode(readonlyToken, typeParameterNode, nameTypeNode, questionToken, templateTypeNode);
+                    var templateTypeNode = typeToTypeNodeHelper(removeMissingType(getTemplateTypeFromMappedType(type), !!(getMappedTypeModifiers(type) & 4 /* IncludeOptional */)), context);
+                    var mappedTypeNode = ts.factory.createMappedTypeNode(readonlyToken, typeParameterNode, nameTypeNode, questionToken, templateTypeNode, /*members*/ undefined);
                     context.approximateLength += 10;
                     return ts.setEmitFlags(mappedTypeNode, 1 /* SingleLine */);
                 }
@@ -47865,7 +51086,9 @@ var ts;
                             return symbolToTypeNode(symbol, context, isInstanceType);
                         }
                         // Always use 'typeof T' for type of class, enum, and module objects
-                        else if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 221 /* ClassExpression */ && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) ||
+                        else if (symbol.flags & 32 /* Class */
+                            && !getBaseTypeVariableOfClass(symbol)
+                            && !(symbol.valueDeclaration && symbol.valueDeclaration.kind === 225 /* ClassExpression */ && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) ||
                             symbol.flags & (384 /* Enum */ | 512 /* ValueModule */) ||
                             shouldWriteTypeOfFunctionSymbol()) {
                             return symbolToTypeNode(symbol, context, isInstanceType);
@@ -47892,11 +51115,11 @@ var ts;
                     function shouldWriteTypeOfFunctionSymbol() {
                         var _a;
                         var isStaticMethodSymbol = !!(symbol.flags & 8192 /* Method */) && // typeof static method
-                            ts.some(symbol.declarations, function (declaration) { return ts.hasSyntacticModifier(declaration, 32 /* Static */); });
+                            ts.some(symbol.declarations, function (declaration) { return ts.isStatic(declaration); });
                         var isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) &&
                             (symbol.parent || // is exported function symbol
                                 ts.forEach(symbol.declarations, function (declaration) {
-                                    return declaration.parent.kind === 297 /* SourceFile */ || declaration.parent.kind === 257 /* ModuleBlock */;
+                                    return declaration.parent.kind === 303 /* SourceFile */ || declaration.parent.kind === 261 /* ModuleBlock */;
                                 }));
                         if (isStaticMethodSymbol || isNonLocalFunctionSymbol) {
                             // typeof is allowed only for static/non local functions
@@ -47906,11 +51129,13 @@ var ts;
                     }
                 }
                 function visitAndTransformType(type, transform) {
+                    var _a, _b;
                     var typeId = type.id;
                     var isConstructorObject = ts.getObjectFlags(type) & 16 /* Anonymous */ && type.symbol && type.symbol.flags & 32 /* Class */;
                     var id = ts.getObjectFlags(type) & 4 /* Reference */ && type.node ? "N" + getNodeId(type.node) :
-                        type.symbol ? (isConstructorObject ? "+" : "") + getSymbolId(type.symbol) :
-                            undefined;
+                        type.flags & 16777216 /* Conditional */ ? "N" + getNodeId(type.root.node) :
+                            type.symbol ? (isConstructorObject ? "+" : "") + getSymbolId(type.symbol) :
+                                undefined;
                     // Since instantiations of the same anonymous type have the same symbol, tracking symbols instead
                     // of types allows us to catch circular references to instantiations of the same anonymous type
                     if (!context.visitedTypes) {
@@ -47919,6 +51144,19 @@ var ts;
                     if (id && !context.symbolDepth) {
                         context.symbolDepth = new ts.Map();
                     }
+                    var links = context.enclosingDeclaration && getNodeLinks(context.enclosingDeclaration);
+                    var key = "".concat(getTypeId(type), "|").concat(context.flags);
+                    if (links) {
+                        links.serializedTypes || (links.serializedTypes = new ts.Map());
+                    }
+                    var cachedResult = (_a = links === null || links === void 0 ? void 0 : links.serializedTypes) === null || _a === void 0 ? void 0 : _a.get(key);
+                    if (cachedResult) {
+                        if (cachedResult.truncating) {
+                            context.truncating = true;
+                        }
+                        context.approximateLength += cachedResult.addedLength;
+                        return deepCloneOrReuseNode(cachedResult);
+                    }
                     var depth;
                     if (id) {
                         depth = context.symbolDepth.get(id) || 0;
@@ -47928,31 +51166,46 @@ var ts;
                         context.symbolDepth.set(id, depth + 1);
                     }
                     context.visitedTypes.add(typeId);
+                    var startLength = context.approximateLength;
                     var result = transform(type);
+                    var addedLength = context.approximateLength - startLength;
+                    if (!context.reportedDiagnostic && !context.encounteredError) {
+                        if (context.truncating) {
+                            result.truncating = true;
+                        }
+                        result.addedLength = addedLength;
+                        (_b = links === null || links === void 0 ? void 0 : links.serializedTypes) === null || _b === void 0 ? void 0 : _b.set(key, result);
+                    }
                     context.visitedTypes.delete(typeId);
                     if (id) {
                         context.symbolDepth.set(id, depth);
                     }
                     return result;
+                    function deepCloneOrReuseNode(node) {
+                        if (!ts.nodeIsSynthesized(node) && ts.getParseTreeNode(node) === node) {
+                            return node;
+                        }
+                        return ts.setTextRange(ts.factory.cloneNode(ts.visitEachChild(node, deepCloneOrReuseNode, ts.nullTransformationContext)), node);
+                    }
                 }
                 function createTypeNodeFromObjectType(type) {
                     if (isGenericMappedType(type) || type.containsError) {
                         return createMappedTypeNodeFromType(type);
                     }
                     var resolved = resolveStructuredTypeMembers(type);
-                    if (!resolved.properties.length && !resolved.stringIndexInfo && !resolved.numberIndexInfo) {
+                    if (!resolved.properties.length && !resolved.indexInfos.length) {
                         if (!resolved.callSignatures.length && !resolved.constructSignatures.length) {
                             context.approximateLength += 2;
                             return ts.setEmitFlags(ts.factory.createTypeLiteralNode(/*members*/ undefined), 1 /* SingleLine */);
                         }
                         if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) {
                             var signature = resolved.callSignatures[0];
-                            var signatureNode = signatureToSignatureDeclarationHelper(signature, 174 /* FunctionType */, context);
+                            var signatureNode = signatureToSignatureDeclarationHelper(signature, 178 /* FunctionType */, context);
                             return signatureNode;
                         }
                         if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) {
                             var signature = resolved.constructSignatures[0];
-                            var signatureNode = signatureToSignatureDeclarationHelper(signature, 175 /* ConstructorType */, context);
+                            var signatureNode = signatureToSignatureDeclarationHelper(signature, 179 /* ConstructorType */, context);
                             return signatureNode;
                         }
                     }
@@ -47962,8 +51215,7 @@ var ts;
                         // count the number of type elements excluding abstract constructors
                         var typeElementCount = resolved.callSignatures.length +
                             (resolved.constructSignatures.length - abstractSignatures.length) +
-                            (resolved.stringIndexInfo ? 1 : 0) +
-                            (resolved.numberIndexInfo ? 1 : 0) +
+                            resolved.indexInfos.length +
                             // exclude `prototype` when writing a class expression as a type literal, as per
                             // the logic in `createTypeNodesFromResolvedType`.
                             (context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */ ?
@@ -47996,9 +51248,10 @@ var ts;
                         }
                         var elementType = typeToTypeNodeHelper(typeArguments[0], context);
                         var arrayType = ts.factory.createArrayTypeNode(elementType);
-                        return type.target === globalArrayType ? arrayType : ts.factory.createTypeOperatorNode(142 /* ReadonlyKeyword */, arrayType);
+                        return type.target === globalArrayType ? arrayType : ts.factory.createTypeOperatorNode(144 /* ReadonlyKeyword */, arrayType);
                     }
                     else if (type.target.objectFlags & 8 /* Tuple */) {
+                        typeArguments = ts.sameMap(typeArguments, function (t, i) { return removeMissingType(t, !!(type.target.elementFlags[i] & 2 /* Optional */)); });
                         if (typeArguments.length > 0) {
                             var arity = getTypeReferenceArity(type);
                             var tupleConstituentNodes = mapToTypeNodes(typeArguments.slice(0, arity), context);
@@ -48020,12 +51273,12 @@ var ts;
                                     }
                                 }
                                 var tupleTypeNode = ts.setEmitFlags(ts.factory.createTupleTypeNode(tupleConstituentNodes), 1 /* SingleLine */);
-                                return type.target.readonly ? ts.factory.createTypeOperatorNode(142 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode;
+                                return type.target.readonly ? ts.factory.createTypeOperatorNode(144 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode;
                             }
                         }
                         if (context.encounteredError || (context.flags & 524288 /* AllowEmptyTuple */)) {
                             var tupleTypeNode = ts.setEmitFlags(ts.factory.createTupleTypeNode([]), 1 /* SingleLine */);
-                            return type.target.readonly ? ts.factory.createTypeOperatorNode(142 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode;
+                            return type.target.readonly ? ts.factory.createTypeOperatorNode(144 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode;
                         }
                         context.encounteredError = true;
                         return undefined; // TODO: GH#18217
@@ -48132,34 +51385,25 @@ var ts;
                     var typeElements = [];
                     for (var _i = 0, _a = resolvedType.callSignatures; _i < _a.length; _i++) {
                         var signature = _a[_i];
-                        typeElements.push(signatureToSignatureDeclarationHelper(signature, 169 /* CallSignature */, context));
+                        typeElements.push(signatureToSignatureDeclarationHelper(signature, 173 /* CallSignature */, context));
                     }
                     for (var _b = 0, _c = resolvedType.constructSignatures; _b < _c.length; _b++) {
                         var signature = _c[_b];
                         if (signature.flags & 4 /* Abstract */)
                             continue;
-                        typeElements.push(signatureToSignatureDeclarationHelper(signature, 170 /* ConstructSignature */, context));
+                        typeElements.push(signatureToSignatureDeclarationHelper(signature, 174 /* ConstructSignature */, context));
                     }
-                    if (resolvedType.stringIndexInfo) {
-                        var indexSignature = void 0;
-                        if (resolvedType.objectFlags & 2048 /* ReverseMapped */) {
-                            indexSignature = indexInfoToIndexSignatureDeclarationHelper(createIndexInfo(anyType, resolvedType.stringIndexInfo.isReadonly, resolvedType.stringIndexInfo.declaration), 0 /* String */, context, createElidedInformationPlaceholder(context));
-                        }
-                        else {
-                            indexSignature = indexInfoToIndexSignatureDeclarationHelper(resolvedType.stringIndexInfo, 0 /* String */, context, /*typeNode*/ undefined);
-                        }
-                        typeElements.push(indexSignature);
-                    }
-                    if (resolvedType.numberIndexInfo) {
-                        typeElements.push(indexInfoToIndexSignatureDeclarationHelper(resolvedType.numberIndexInfo, 1 /* Number */, context, /*typeNode*/ undefined));
+                    for (var _d = 0, _e = resolvedType.indexInfos; _d < _e.length; _d++) {
+                        var info = _e[_d];
+                        typeElements.push(indexInfoToIndexSignatureDeclarationHelper(info, context, resolvedType.objectFlags & 1024 /* ReverseMapped */ ? createElidedInformationPlaceholder(context) : undefined));
                     }
                     var properties = resolvedType.properties;
                     if (!properties) {
                         return typeElements;
                     }
                     var i = 0;
-                    for (var _d = 0, properties_1 = properties; _d < properties_1.length; _d++) {
-                        var propertySymbol = properties_1[_d];
+                    for (var _f = 0, properties_1 = properties; _f < properties_1.length; _f++) {
+                        var propertySymbol = properties_1[_f];
                         i++;
                         if (context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) {
                             if (propertySymbol.flags & 4194304 /* Prototype */) {
@@ -48170,7 +51414,7 @@ var ts;
                             }
                         }
                         if (checkTruncationLength(context) && (i + 2 < properties.length - 1)) {
-                            typeElements.push(ts.factory.createPropertySignature(/*modifiers*/ undefined, "... " + (properties.length - i) + " more ...", /*questionToken*/ undefined, /*type*/ undefined));
+                            typeElements.push(ts.factory.createPropertySignature(/*modifiers*/ undefined, "... ".concat(properties.length - i, " more ..."), /*questionToken*/ undefined, /*type*/ undefined));
                             addPropertyToElementList(properties[properties.length - 1], context, typeElements);
                             break;
                         }
@@ -48184,52 +51428,76 @@ var ts;
                 if (!(context.flags & 1 /* NoTruncation */)) {
                     return ts.factory.createTypeReferenceNode(ts.factory.createIdentifier("..."), /*typeArguments*/ undefined);
                 }
-                return ts.factory.createKeywordTypeNode(128 /* AnyKeyword */);
+                return ts.factory.createKeywordTypeNode(130 /* AnyKeyword */);
+            }
+            function shouldUsePlaceholderForProperty(propertySymbol, context) {
+                var _a;
+                // Use placeholders for reverse mapped types we've either already descended into, or which
+                // are nested reverse mappings within a mapping over a non-anonymous type. The later is a restriction mostly just to
+                // reduce the blowup in printback size from doing, eg, a deep reverse mapping over `Window`.
+                // Since anonymous types usually come from expressions, this allows us to preserve the output
+                // for deep mappings which likely come from expressions, while truncating those parts which
+                // come from mappings over library functions.
+                return !!(ts.getCheckFlags(propertySymbol) & 8192 /* ReverseMapped */)
+                    && (ts.contains(context.reverseMappedStack, propertySymbol)
+                        || (((_a = context.reverseMappedStack) === null || _a === void 0 ? void 0 : _a[0])
+                            && !(ts.getObjectFlags(ts.last(context.reverseMappedStack).propertyType) & 16 /* Anonymous */)));
             }
             function addPropertyToElementList(propertySymbol, context, typeElements) {
+                var _a, _b;
                 var propertyIsReverseMapped = !!(ts.getCheckFlags(propertySymbol) & 8192 /* ReverseMapped */);
-                var propertyType = propertyIsReverseMapped && context.flags & 33554432 /* InReverseMappedType */ ?
-                    anyType : getTypeOfSymbol(propertySymbol);
+                var propertyType = shouldUsePlaceholderForProperty(propertySymbol, context) ?
+                    anyType : getNonMissingTypeOfSymbol(propertySymbol);
                 var saveEnclosingDeclaration = context.enclosingDeclaration;
                 context.enclosingDeclaration = undefined;
                 if (context.tracker.trackSymbol && ts.getCheckFlags(propertySymbol) & 4096 /* Late */ && isLateBoundName(propertySymbol.escapedName)) {
-                    var decl = ts.first(propertySymbol.declarations);
-                    if (hasLateBindableName(decl)) {
-                        if (ts.isBinaryExpression(decl)) {
-                            var name = ts.getNameOfDeclaration(decl);
-                            if (name && ts.isElementAccessExpression(name) && ts.isPropertyAccessEntityNameExpression(name.argumentExpression)) {
-                                trackComputedName(name.argumentExpression, saveEnclosingDeclaration, context);
+                    if (propertySymbol.declarations) {
+                        var decl = ts.first(propertySymbol.declarations);
+                        if (hasLateBindableName(decl)) {
+                            if (ts.isBinaryExpression(decl)) {
+                                var name = ts.getNameOfDeclaration(decl);
+                                if (name && ts.isElementAccessExpression(name) && ts.isPropertyAccessEntityNameExpression(name.argumentExpression)) {
+                                    trackComputedName(name.argumentExpression, saveEnclosingDeclaration, context);
+                                }
+                            }
+                            else {
+                                trackComputedName(decl.name.expression, saveEnclosingDeclaration, context);
                             }
-                        }
-                        else {
-                            trackComputedName(decl.name.expression, saveEnclosingDeclaration, context);
                         }
                     }
+                    else if ((_a = context.tracker) === null || _a === void 0 ? void 0 : _a.reportNonSerializableProperty) {
+                        context.tracker.reportNonSerializableProperty(symbolToString(propertySymbol));
+                    }
                 }
-                context.enclosingDeclaration = saveEnclosingDeclaration;
+                context.enclosingDeclaration = propertySymbol.valueDeclaration || ((_b = propertySymbol.declarations) === null || _b === void 0 ? void 0 : _b[0]) || saveEnclosingDeclaration;
                 var propertyName = getPropertyNameNodeForSymbol(propertySymbol, context);
+                context.enclosingDeclaration = saveEnclosingDeclaration;
                 context.approximateLength += (ts.symbolName(propertySymbol).length + 1);
                 var optionalToken = propertySymbol.flags & 16777216 /* Optional */ ? ts.factory.createToken(57 /* QuestionToken */) : undefined;
                 if (propertySymbol.flags & (16 /* Function */ | 8192 /* Method */) && !getPropertiesOfObjectType(propertyType).length && !isReadonlySymbol(propertySymbol)) {
                     var signatures = getSignaturesOfType(filterType(propertyType, function (t) { return !(t.flags & 32768 /* Undefined */); }), 0 /* Call */);
                     for (var _i = 0, signatures_1 = signatures; _i < signatures_1.length; _i++) {
                         var signature = signatures_1[_i];
-                        var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 164 /* MethodSignature */, context, { name: propertyName, questionToken: optionalToken });
+                        var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 167 /* MethodSignature */, context, { name: propertyName, questionToken: optionalToken });
                         typeElements.push(preserveCommentsOn(methodDeclaration));
                     }
                 }
                 else {
-                    var savedFlags = context.flags;
-                    context.flags |= propertyIsReverseMapped ? 33554432 /* InReverseMappedType */ : 0;
                     var propertyTypeNode = void 0;
-                    if (propertyIsReverseMapped && !!(savedFlags & 33554432 /* InReverseMappedType */)) {
+                    if (shouldUsePlaceholderForProperty(propertySymbol, context)) {
                         propertyTypeNode = createElidedInformationPlaceholder(context);
                     }
                     else {
-                        propertyTypeNode = propertyType ? serializeTypeForDeclaration(context, propertyType, propertySymbol, saveEnclosingDeclaration) : ts.factory.createKeywordTypeNode(128 /* AnyKeyword */);
+                        if (propertyIsReverseMapped) {
+                            context.reverseMappedStack || (context.reverseMappedStack = []);
+                            context.reverseMappedStack.push(propertySymbol);
+                        }
+                        propertyTypeNode = propertyType ? serializeTypeForDeclaration(context, propertyType, propertySymbol, saveEnclosingDeclaration) : ts.factory.createKeywordTypeNode(130 /* AnyKeyword */);
+                        if (propertyIsReverseMapped) {
+                            context.reverseMappedStack.pop();
+                        }
                     }
-                    context.flags = savedFlags;
-                    var modifiers = isReadonlySymbol(propertySymbol) ? [ts.factory.createToken(142 /* ReadonlyKeyword */)] : undefined;
+                    var modifiers = isReadonlySymbol(propertySymbol) ? [ts.factory.createToken(144 /* ReadonlyKeyword */)] : undefined;
                     if (modifiers) {
                         context.approximateLength += 9;
                     }
@@ -48237,9 +51505,10 @@ var ts;
                     typeElements.push(preserveCommentsOn(propertySignature));
                 }
                 function preserveCommentsOn(node) {
-                    if (ts.some(propertySymbol.declarations, function (d) { return d.kind === 333 /* JSDocPropertyTag */; })) {
-                        var d = ts.find(propertySymbol.declarations, function (d) { return d.kind === 333 /* JSDocPropertyTag */; });
-                        var commentText = d.comment;
+                    var _a;
+                    if (ts.some(propertySymbol.declarations, function (d) { return d.kind === 345 /* JSDocPropertyTag */; })) {
+                        var d = (_a = propertySymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(function (d) { return d.kind === 345 /* JSDocPropertyTag */; });
+                        var commentText = ts.getTextOfJSDocComment(d.comment);
                         if (commentText) {
                             ts.setSyntheticLeadingComments(node, [{ kind: 3 /* MultiLineCommentTrivia */, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]);
                         }
@@ -48260,7 +51529,7 @@ var ts;
                         else if (types.length > 2) {
                             return [
                                 typeToTypeNodeHelper(types[0], context),
-                                ts.factory.createTypeReferenceNode("... " + (types.length - 2) + " more ...", /*typeArguments*/ undefined),
+                                ts.factory.createTypeReferenceNode("... ".concat(types.length - 2, " more ..."), /*typeArguments*/ undefined),
                                 typeToTypeNodeHelper(types[types.length - 1], context)
                             ];
                         }
@@ -48268,25 +51537,25 @@ var ts;
                     var mayHaveNameCollisions = !(context.flags & 64 /* UseFullyQualifiedType */);
                     /** Map from type reference identifier text to [type, index in `result` where the type node is] */
                     var seenNames = mayHaveNameCollisions ? ts.createUnderscoreEscapedMultiMap() : undefined;
-                    var result_4 = [];
+                    var result_5 = [];
                     var i = 0;
                     for (var _i = 0, types_2 = types; _i < types_2.length; _i++) {
                         var type = types_2[_i];
                         i++;
                         if (checkTruncationLength(context) && (i + 2 < types.length - 1)) {
-                            result_4.push(ts.factory.createTypeReferenceNode("... " + (types.length - i) + " more ...", /*typeArguments*/ undefined));
+                            result_5.push(ts.factory.createTypeReferenceNode("... ".concat(types.length - i, " more ..."), /*typeArguments*/ undefined));
                             var typeNode_1 = typeToTypeNodeHelper(types[types.length - 1], context);
                             if (typeNode_1) {
-                                result_4.push(typeNode_1);
+                                result_5.push(typeNode_1);
                             }
                             break;
                         }
                         context.approximateLength += 2; // Account for whitespace + separator
                         var typeNode = typeToTypeNodeHelper(type, context);
                         if (typeNode) {
-                            result_4.push(typeNode);
+                            result_5.push(typeNode);
                             if (seenNames && ts.isIdentifierTypeReference(typeNode)) {
-                                seenNames.add(typeNode.typeName.escapedText, [type, result_4.length - 1]);
+                                seenNames.add(typeNode.typeName.escapedText, [type, result_5.length - 1]);
                             }
                         }
                     }
@@ -48308,13 +51577,13 @@ var ts;
                             })) {
                                 for (var _i = 0, types_3 = types; _i < types_3.length; _i++) {
                                     var _a = types_3[_i], type = _a[0], resultIndex = _a[1];
-                                    result_4[resultIndex] = typeToTypeNodeHelper(type, context);
+                                    result_5[resultIndex] = typeToTypeNodeHelper(type, context);
                                 }
                             }
                         });
                         context.flags = saveContextFlags;
                     }
-                    return result_4;
+                    return result_5;
                 }
             }
             function typesAreSameReference(a, b) {
@@ -48322,9 +51591,9 @@ var ts;
                     || !!a.symbol && a.symbol === b.symbol
                     || !!a.aliasSymbol && a.aliasSymbol === b.aliasSymbol;
             }
-            function indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind, context, typeNode) {
+            function indexInfoToIndexSignatureDeclarationHelper(indexInfo, context, typeNode) {
                 var name = ts.getNameFromIndexInfo(indexInfo) || "x";
-                var indexerTypeNode = ts.factory.createKeywordTypeNode(kind === 0 /* String */ ? 147 /* StringKeyword */ : 144 /* NumberKeyword */);
+                var indexerTypeNode = typeToTypeNodeHelper(indexInfo.keyType, context);
                 var indexingParameter = ts.factory.createParameterDeclaration(
                 /*decorators*/ undefined, 
                 /*modifiers*/ undefined, 
@@ -48339,13 +51608,14 @@ var ts;
                 }
                 context.approximateLength += (name.length + 4);
                 return ts.factory.createIndexSignature(
-                /*decorators*/ undefined, indexInfo.isReadonly ? [ts.factory.createToken(142 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode);
+                /*decorators*/ undefined, indexInfo.isReadonly ? [ts.factory.createToken(144 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode);
             }
             function signatureToSignatureDeclarationHelper(signature, kind, context, options) {
                 var _a, _b, _c, _d;
                 var suppressAny = context.flags & 256 /* SuppressAnyReturnType */;
                 if (suppressAny)
                     context.flags &= ~256 /* SuppressAnyReturnType */; // suppress only toplevel `any`s
+                context.approximateLength += 3; // Usually a signature contributes a few more characters than this, but 3 is the minimum
                 var typeParameters;
                 var typeArguments;
                 if (context.flags & 32 /* WriteTypeArgumentsOfSignature */ && signature.target && signature.mapper && signature.target.typeParameters) {
@@ -48356,7 +51626,7 @@ var ts;
                 }
                 var expandedParams = getExpandedParameters(signature, /*skipUnionExpanding*/ true)[0];
                 // If the expanded parameter list had a variadic in a non-trailing position, don't expand it
-                var parameters = (ts.some(expandedParams, function (p) { return p !== expandedParams[expandedParams.length - 1] && !!(ts.getCheckFlags(p) & 32768 /* RestParameter */); }) ? signature.parameters : expandedParams).map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 166 /* Constructor */, options === null || options === void 0 ? void 0 : options.privateSymbolVisitor, options === null || options === void 0 ? void 0 : options.bundledImports); });
+                var parameters = (ts.some(expandedParams, function (p) { return p !== expandedParams[expandedParams.length - 1] && !!(ts.getCheckFlags(p) & 32768 /* RestParameter */); }) ? signature.parameters : expandedParams).map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 170 /* Constructor */, options === null || options === void 0 ? void 0 : options.privateSymbolVisitor, options === null || options === void 0 ? void 0 : options.bundledImports); });
                 if (signature.thisParameter) {
                     var thisParameter = symbolToParameterDeclaration(signature.thisParameter, context);
                     parameters.unshift(thisParameter);
@@ -48365,7 +51635,7 @@ var ts;
                 var typePredicate = getTypePredicateOfSignature(signature);
                 if (typePredicate) {
                     var assertsModifier = typePredicate.kind === 2 /* AssertsThis */ || typePredicate.kind === 3 /* AssertsIdentifier */ ?
-                        ts.factory.createToken(127 /* AssertsKeyword */) :
+                        ts.factory.createToken(128 /* AssertsKeyword */) :
                         undefined;
                     var parameterName = typePredicate.kind === 1 /* Identifier */ || typePredicate.kind === 3 /* AssertsIdentifier */ ?
                         ts.setEmitFlags(ts.factory.createIdentifier(typePredicate.parameterName), 16777216 /* NoAsciiEscaping */) :
@@ -48379,29 +51649,28 @@ var ts;
                         returnTypeNode = serializeReturnTypeForSignature(context, returnType, signature, options === null || options === void 0 ? void 0 : options.privateSymbolVisitor, options === null || options === void 0 ? void 0 : options.bundledImports);
                     }
                     else if (!suppressAny) {
-                        returnTypeNode = ts.factory.createKeywordTypeNode(128 /* AnyKeyword */);
+                        returnTypeNode = ts.factory.createKeywordTypeNode(130 /* AnyKeyword */);
                     }
                 }
                 var modifiers = options === null || options === void 0 ? void 0 : options.modifiers;
-                if ((kind === 175 /* ConstructorType */) && signature.flags & 4 /* Abstract */) {
+                if ((kind === 179 /* ConstructorType */) && signature.flags & 4 /* Abstract */) {
                     var flags = ts.modifiersToFlags(modifiers);
                     modifiers = ts.factory.createModifiersFromModifierFlags(flags | 128 /* Abstract */);
                 }
-                context.approximateLength += 3; // Usually a signature contributes a few more characters than this, but 3 is the minimum
-                var node = kind === 169 /* CallSignature */ ? ts.factory.createCallSignature(typeParameters, parameters, returnTypeNode) :
-                    kind === 170 /* ConstructSignature */ ? ts.factory.createConstructSignature(typeParameters, parameters, returnTypeNode) :
-                        kind === 164 /* MethodSignature */ ? ts.factory.createMethodSignature(modifiers, (_a = options === null || options === void 0 ? void 0 : options.name) !== null && _a !== void 0 ? _a : ts.factory.createIdentifier(""), options === null || options === void 0 ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) :
-                            kind === 165 /* MethodDeclaration */ ? ts.factory.createMethodDeclaration(/*decorators*/ undefined, modifiers, /*asteriskToken*/ undefined, (_b = options === null || options === void 0 ? void 0 : options.name) !== null && _b !== void 0 ? _b : ts.factory.createIdentifier(""), /*questionToken*/ undefined, typeParameters, parameters, returnTypeNode, /*body*/ undefined) :
-                                kind === 166 /* Constructor */ ? ts.factory.createConstructorDeclaration(/*decorators*/ undefined, modifiers, parameters, /*body*/ undefined) :
-                                    kind === 167 /* GetAccessor */ ? ts.factory.createGetAccessorDeclaration(/*decorators*/ undefined, modifiers, (_c = options === null || options === void 0 ? void 0 : options.name) !== null && _c !== void 0 ? _c : ts.factory.createIdentifier(""), parameters, returnTypeNode, /*body*/ undefined) :
-                                        kind === 168 /* SetAccessor */ ? ts.factory.createSetAccessorDeclaration(/*decorators*/ undefined, modifiers, (_d = options === null || options === void 0 ? void 0 : options.name) !== null && _d !== void 0 ? _d : ts.factory.createIdentifier(""), parameters, /*body*/ undefined) :
-                                            kind === 171 /* IndexSignature */ ? ts.factory.createIndexSignature(/*decorators*/ undefined, modifiers, parameters, returnTypeNode) :
-                                                kind === 308 /* JSDocFunctionType */ ? ts.factory.createJSDocFunctionType(parameters, returnTypeNode) :
-                                                    kind === 174 /* FunctionType */ ? ts.factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode !== null && returnTypeNode !== void 0 ? returnTypeNode : ts.factory.createTypeReferenceNode(ts.factory.createIdentifier(""))) :
-                                                        kind === 175 /* ConstructorType */ ? ts.factory.createConstructorTypeNode(modifiers, typeParameters, parameters, returnTypeNode !== null && returnTypeNode !== void 0 ? returnTypeNode : ts.factory.createTypeReferenceNode(ts.factory.createIdentifier(""))) :
-                                                            kind === 251 /* FunctionDeclaration */ ? ts.factory.createFunctionDeclaration(/*decorators*/ undefined, modifiers, /*asteriskToken*/ undefined, (options === null || options === void 0 ? void 0 : options.name) ? ts.cast(options.name, ts.isIdentifier) : ts.factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, /*body*/ undefined) :
-                                                                kind === 208 /* FunctionExpression */ ? ts.factory.createFunctionExpression(modifiers, /*asteriskToken*/ undefined, (options === null || options === void 0 ? void 0 : options.name) ? ts.cast(options.name, ts.isIdentifier) : ts.factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, ts.factory.createBlock([])) :
-                                                                    kind === 209 /* ArrowFunction */ ? ts.factory.createArrowFunction(modifiers, typeParameters, parameters, returnTypeNode, /*equalsGreaterThanToken*/ undefined, ts.factory.createBlock([])) :
+                var node = kind === 173 /* CallSignature */ ? ts.factory.createCallSignature(typeParameters, parameters, returnTypeNode) :
+                    kind === 174 /* ConstructSignature */ ? ts.factory.createConstructSignature(typeParameters, parameters, returnTypeNode) :
+                        kind === 167 /* MethodSignature */ ? ts.factory.createMethodSignature(modifiers, (_a = options === null || options === void 0 ? void 0 : options.name) !== null && _a !== void 0 ? _a : ts.factory.createIdentifier(""), options === null || options === void 0 ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) :
+                            kind === 168 /* MethodDeclaration */ ? ts.factory.createMethodDeclaration(/*decorators*/ undefined, modifiers, /*asteriskToken*/ undefined, (_b = options === null || options === void 0 ? void 0 : options.name) !== null && _b !== void 0 ? _b : ts.factory.createIdentifier(""), /*questionToken*/ undefined, typeParameters, parameters, returnTypeNode, /*body*/ undefined) :
+                                kind === 170 /* Constructor */ ? ts.factory.createConstructorDeclaration(/*decorators*/ undefined, modifiers, parameters, /*body*/ undefined) :
+                                    kind === 171 /* GetAccessor */ ? ts.factory.createGetAccessorDeclaration(/*decorators*/ undefined, modifiers, (_c = options === null || options === void 0 ? void 0 : options.name) !== null && _c !== void 0 ? _c : ts.factory.createIdentifier(""), parameters, returnTypeNode, /*body*/ undefined) :
+                                        kind === 172 /* SetAccessor */ ? ts.factory.createSetAccessorDeclaration(/*decorators*/ undefined, modifiers, (_d = options === null || options === void 0 ? void 0 : options.name) !== null && _d !== void 0 ? _d : ts.factory.createIdentifier(""), parameters, /*body*/ undefined) :
+                                            kind === 175 /* IndexSignature */ ? ts.factory.createIndexSignature(/*decorators*/ undefined, modifiers, parameters, returnTypeNode) :
+                                                kind === 315 /* JSDocFunctionType */ ? ts.factory.createJSDocFunctionType(parameters, returnTypeNode) :
+                                                    kind === 178 /* FunctionType */ ? ts.factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode !== null && returnTypeNode !== void 0 ? returnTypeNode : ts.factory.createTypeReferenceNode(ts.factory.createIdentifier(""))) :
+                                                        kind === 179 /* ConstructorType */ ? ts.factory.createConstructorTypeNode(modifiers, typeParameters, parameters, returnTypeNode !== null && returnTypeNode !== void 0 ? returnTypeNode : ts.factory.createTypeReferenceNode(ts.factory.createIdentifier(""))) :
+                                                            kind === 255 /* FunctionDeclaration */ ? ts.factory.createFunctionDeclaration(/*decorators*/ undefined, modifiers, /*asteriskToken*/ undefined, (options === null || options === void 0 ? void 0 : options.name) ? ts.cast(options.name, ts.isIdentifier) : ts.factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, /*body*/ undefined) :
+                                                                kind === 212 /* FunctionExpression */ ? ts.factory.createFunctionExpression(modifiers, /*asteriskToken*/ undefined, (options === null || options === void 0 ? void 0 : options.name) ? ts.cast(options.name, ts.isIdentifier) : ts.factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, ts.factory.createBlock([])) :
+                                                                    kind === 213 /* ArrowFunction */ ? ts.factory.createArrowFunction(modifiers, typeParameters, parameters, returnTypeNode, /*equalsGreaterThanToken*/ undefined, ts.factory.createBlock([])) :
                                                                         ts.Debug.assertNever(kind);
                 if (typeArguments) {
                     node.typeArguments = ts.factory.createNodeArray(typeArguments);
@@ -48423,9 +51692,9 @@ var ts;
                 return typeParameterToDeclarationWithConstraint(type, context, constraintNode);
             }
             function symbolToParameterDeclaration(parameterSymbol, context, preserveModifierFlags, privateSymbolVisitor, bundledImports) {
-                var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 160 /* Parameter */);
+                var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 163 /* Parameter */);
                 if (!parameterDeclaration && !ts.isTransientSymbol(parameterSymbol)) {
-                    parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 326 /* JSDocParameterTag */);
+                    parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 338 /* JSDocParameterTag */);
                 }
                 var parameterType = getTypeOfSymbol(parameterSymbol);
                 if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) {
@@ -48439,8 +51708,8 @@ var ts;
                 var isRest = parameterDeclaration && ts.isRestParameter(parameterDeclaration) || ts.getCheckFlags(parameterSymbol) & 32768 /* RestParameter */;
                 var dotDotDotToken = isRest ? ts.factory.createToken(25 /* DotDotDotToken */) : undefined;
                 var name = parameterDeclaration ? parameterDeclaration.name ?
-                    parameterDeclaration.name.kind === 78 /* Identifier */ ? ts.setEmitFlags(ts.factory.cloneNode(parameterDeclaration.name), 16777216 /* NoAsciiEscaping */) :
-                        parameterDeclaration.name.kind === 157 /* QualifiedName */ ? ts.setEmitFlags(ts.factory.cloneNode(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) :
+                    parameterDeclaration.name.kind === 79 /* Identifier */ ? ts.setEmitFlags(ts.factory.cloneNode(parameterDeclaration.name), 16777216 /* NoAsciiEscaping */) :
+                        parameterDeclaration.name.kind === 160 /* QualifiedName */ ? ts.setEmitFlags(ts.factory.cloneNode(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) :
                             cloneBindingName(parameterDeclaration.name) :
                     ts.symbolName(parameterSymbol) :
                     ts.symbolName(parameterSymbol);
@@ -48605,11 +51874,11 @@ var ts;
             }
             function getSpecifierForModuleSymbol(symbol, context) {
                 var _a;
-                var file = ts.getDeclarationOfKind(symbol, 297 /* SourceFile */);
+                var file = ts.getDeclarationOfKind(symbol, 303 /* SourceFile */);
                 if (!file) {
                     var equivalentFileSymbol = ts.firstDefined(symbol.declarations, function (d) { return getFileSymbolIfFileSymbolExportEqualsContainer(d, symbol); });
                     if (equivalentFileSymbol) {
-                        file = ts.getDeclarationOfKind(equivalentFileSymbol, 297 /* SourceFile */);
+                        file = ts.getDeclarationOfKind(equivalentFileSymbol, 303 /* SourceFile */);
                     }
                 }
                 if (file && file.moduleName !== undefined) {
@@ -48620,8 +51889,8 @@ var ts;
                     if (context.tracker.trackReferencedAmbientModule) {
                         var ambientDecls = ts.filter(symbol.declarations, ts.isAmbientModule);
                         if (ts.length(ambientDecls)) {
-                            for (var _i = 0, ambientDecls_1 = ambientDecls; _i < ambientDecls_1.length; _i++) {
-                                var decl = ambientDecls_1[_i];
+                            for (var _i = 0, _b = ambientDecls; _i < _b.length; _i++) {
+                                var decl = _b[_i];
                                 context.tracker.trackReferencedAmbientModule(decl, symbol);
                             }
                         }
@@ -48648,12 +51917,16 @@ var ts;
                     // specifier preference
                     var moduleResolverHost = context.tracker.moduleResolverHost;
                     var specifierCompilerOptions = isBundle_1 ? __assign(__assign({}, compilerOptions), { baseUrl: moduleResolverHost.getCommonSourceDirectory() }) : compilerOptions;
-                    specifier = ts.first(ts.moduleSpecifiers.getModuleSpecifiers(symbol, checker, specifierCompilerOptions, contextFile, moduleResolverHost, { importModuleSpecifierPreference: isBundle_1 ? "non-relative" : "relative", importModuleSpecifierEnding: isBundle_1 ? "minimal" : undefined }));
+                    specifier = ts.first(ts.moduleSpecifiers.getModuleSpecifiers(symbol, checker, specifierCompilerOptions, contextFile, moduleResolverHost, { importModuleSpecifierPreference: isBundle_1 ? "non-relative" : "project-relative", importModuleSpecifierEnding: isBundle_1 ? "minimal" : undefined }));
                     (_a = links.specifierCache) !== null && _a !== void 0 ? _a : (links.specifierCache = new ts.Map());
                     links.specifierCache.set(contextFile.path, specifier);
                 }
                 return specifier;
             }
+            function symbolToEntityNameNode(symbol) {
+                var identifier = ts.factory.createIdentifier(ts.unescapeLeadingUnderscores(symbol.escapedName));
+                return symbol.parent ? ts.factory.createQualifiedName(symbolToEntityNameNode(symbol.parent), identifier) : identifier;
+            }
             function symbolToTypeNode(symbol, context, meaning, overrideTypeArguments) {
                 var chain = lookupSymbolChain(symbol, context, meaning, !(context.flags & 16384 /* UseAliasDefinedOutsideCurrentScope */)); // If we're using aliases outside the current scope, dont bother with the module
                 var isTypeOf = meaning === 111551 /* Value */;
@@ -48662,7 +51935,7 @@ var ts;
                     var nonRootParts = chain.length > 1 ? createAccessFromSymbolChain(chain, chain.length - 1, 1) : undefined;
                     var typeParameterNodes = overrideTypeArguments || lookupTypeParameterNodes(chain, 0, context);
                     var specifier = getSpecifierForModuleSymbol(chain[0], context);
-                    if (!(context.flags & 67108864 /* AllowNodeModulesRelativePaths */) && ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeJs && specifier.indexOf("/node_modules/") >= 0) {
+                    if (!(context.flags & 67108864 /* AllowNodeModulesRelativePaths */) && ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.Classic && specifier.indexOf("/node_modules/") >= 0) {
                         // If ultimately we can only name the symbol with a reference that dives into a `node_modules` folder, we should error
                         // since declaration files with these kinds of references are liable to fail when published :(
                         context.encounteredError = true;
@@ -48761,7 +52034,7 @@ var ts;
                 return false;
             }
             function typeParameterToName(type, context) {
-                var _a;
+                var _a, _b;
                 if (context.flags & 4 /* GenerateNamesForShadowedTypeParams */ && context.typeParameterNames) {
                     var cached = context.typeParameterNames.get(getTypeId(type));
                     if (cached) {
@@ -48769,22 +52042,25 @@ var ts;
                     }
                 }
                 var result = symbolToName(type.symbol, context, 788968 /* Type */, /*expectsIdentifier*/ true);
-                if (!(result.kind & 78 /* Identifier */)) {
+                if (!(result.kind & 79 /* Identifier */)) {
                     return ts.factory.createIdentifier("(Missing type parameter)");
                 }
                 if (context.flags & 4 /* GenerateNamesForShadowedTypeParams */) {
                     var rawtext = result.escapedText;
-                    var i = 0;
+                    var i = ((_a = context.typeParameterNamesByTextNextNameCount) === null || _a === void 0 ? void 0 : _a.get(rawtext)) || 0;
                     var text = rawtext;
-                    while (((_a = context.typeParameterNamesByText) === null || _a === void 0 ? void 0 : _a.has(text)) || typeParameterShadowsNameInScope(text, context, type)) {
+                    while (((_b = context.typeParameterNamesByText) === null || _b === void 0 ? void 0 : _b.has(text)) || typeParameterShadowsNameInScope(text, context, type)) {
                         i++;
-                        text = rawtext + "_" + i;
+                        text = "".concat(rawtext, "_").concat(i);
                     }
                     if (text !== rawtext) {
                         result = ts.factory.createIdentifier(text, result.typeArguments);
                     }
+                    // avoiding iterations of the above loop turns out to be worth it when `i` starts to get large, so we cache the max
+                    // `i` we've used thus far, to save work later
+                    (context.typeParameterNamesByTextNextNameCount || (context.typeParameterNamesByTextNextNameCount = new ts.Map())).set(rawtext, i);
                     (context.typeParameterNames || (context.typeParameterNames = new ts.Map())).set(getTypeId(type), result);
-                    (context.typeParameterNamesByText || (context.typeParameterNamesByText = new ts.Set())).add(result.escapedText);
+                    (context.typeParameterNamesByText || (context.typeParameterNamesByText = new ts.Set())).add(rawtext);
                 }
                 return result;
             }
@@ -48792,7 +52068,7 @@ var ts;
                 var chain = lookupSymbolChain(symbol, context, meaning);
                 if (expectsIdentifier && chain.length !== 1
                     && !context.encounteredError
-                    && !(context.flags & 65536 /* AllowQualifedNameInPlaceOfIdentifier */)) {
+                    && !(context.flags & 65536 /* AllowQualifiedNameInPlaceOfIdentifier */)) {
                     context.encounteredError = true;
                 }
                 return createEntityNameFromSymbolChain(chain, chain.length - 1);
@@ -48872,9 +52148,6 @@ var ts;
                 if (fromNameType) {
                     return fromNameType;
                 }
-                if (ts.isKnownSymbol(symbol)) {
-                    return ts.factory.createComputedPropertyName(ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier("Symbol"), symbol.escapedName.substr(3)));
-                }
                 var rawName = ts.unescapeLeadingUnderscores(symbol.escapedName);
                 var stringNamed = !!ts.length(symbol.declarations) && ts.every(symbol.declarations, isStringNamed);
                 return createPropertyNameNodeForIdentifierOrLiteral(rawName, stringNamed, singleQuote);
@@ -48885,7 +52158,7 @@ var ts;
                 if (nameType) {
                     if (nameType.flags & 384 /* StringOrNumberLiteral */) {
                         var name = "" + nameType.value;
-                        if (!ts.isIdentifierText(name, compilerOptions.target) && !isNumericLiteralName(name)) {
+                        if (!ts.isIdentifierText(name, ts.getEmitScriptTarget(compilerOptions)) && !isNumericLiteralName(name)) {
                             return ts.factory.createStringLiteral(name, !!singleQuote);
                         }
                         if (isNumericLiteralName(name) && ts.startsWith(name, "-")) {
@@ -48899,7 +52172,7 @@ var ts;
                 }
             }
             function createPropertyNameNodeForIdentifierOrLiteral(name, stringNamed, singleQuote) {
-                return ts.isIdentifierText(name, compilerOptions.target) ? ts.factory.createIdentifier(name) :
+                return ts.isIdentifierText(name, ts.getEmitScriptTarget(compilerOptions)) ? ts.factory.createIdentifier(name) :
                     !stringNamed && isNumericLiteralName(name) && +name >= 0 ? ts.factory.createNumericLiteral(+name) :
                         ts.factory.createStringLiteral(name, !!singleQuote);
             }
@@ -48926,6 +52199,7 @@ var ts;
                 if (initial.typeParameterSymbolList) {
                     initial.typeParameterSymbolList = new ts.Set(initial.typeParameterSymbolList);
                 }
+                initial.tracker = wrapSymbolTrackerToReportForContext(initial, initial.tracker);
                 return initial;
             }
             function getDeclarationWithTypeAnnotation(symbol, enclosingDeclaration) {
@@ -48939,15 +52213,15 @@ var ts;
              * so a `unique symbol` is returned when appropriate for the input symbol, rather than `typeof sym`
              */
             function serializeTypeForDeclaration(context, type, symbol, enclosingDeclaration, includePrivateSymbol, bundled) {
-                if (type !== errorType && enclosingDeclaration) {
+                if (!isErrorType(type) && enclosingDeclaration) {
                     var declWithExistingAnnotation = getDeclarationWithTypeAnnotation(symbol, enclosingDeclaration);
-                    if (declWithExistingAnnotation && !ts.isFunctionLikeDeclaration(declWithExistingAnnotation)) {
+                    if (declWithExistingAnnotation && !ts.isFunctionLikeDeclaration(declWithExistingAnnotation) && !ts.isGetAccessorDeclaration(declWithExistingAnnotation)) {
                         // try to reuse the existing annotation
                         var existing = ts.getEffectiveTypeAnnotationNode(declWithExistingAnnotation);
                         if (getTypeFromTypeNode(existing) === type && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type)) {
-                            var result_5 = serializeExistingTypeNode(context, existing, includePrivateSymbol, bundled);
-                            if (result_5) {
-                                return result_5;
+                            var result_6 = serializeExistingTypeNode(context, existing, includePrivateSymbol, bundled);
+                            if (result_6) {
+                                return result_6;
                             }
                         }
                     }
@@ -48962,12 +52236,16 @@ var ts;
                 return result;
             }
             function serializeReturnTypeForSignature(context, type, signature, includePrivateSymbol, bundled) {
-                if (type !== errorType && context.enclosingDeclaration) {
+                if (!isErrorType(type) && context.enclosingDeclaration) {
                     var annotation = signature.declaration && ts.getEffectiveReturnTypeNode(signature.declaration);
-                    if (!!ts.findAncestor(annotation, function (n) { return n === context.enclosingDeclaration; }) && annotation && instantiateType(getTypeFromTypeNode(annotation), signature.mapper) === type && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(annotation, type)) {
-                        var result = serializeExistingTypeNode(context, annotation, includePrivateSymbol, bundled);
-                        if (result) {
-                            return result;
+                    if (!!ts.findAncestor(annotation, function (n) { return n === context.enclosingDeclaration; }) && annotation) {
+                        var annotated = getTypeFromTypeNode(annotation);
+                        var thisInstantiated = annotated.flags & 262144 /* TypeParameter */ && annotated.isThisType ? instantiateType(annotated, signature.mapper) : annotated;
+                        if (thisInstantiated === type && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(annotation, type)) {
+                            var result = serializeExistingTypeNode(context, annotation, includePrivateSymbol, bundled);
+                            if (result) {
+                                return result;
+                            }
                         }
                     }
                 }
@@ -49011,17 +52289,17 @@ var ts;
                 return transformed === existing ? ts.setTextRange(ts.factory.cloneNode(existing), existing) : transformed;
                 function visitExistingNodeTreeSymbols(node) {
                     // We don't _actually_ support jsdoc namepath types, emit `any` instead
-                    if (ts.isJSDocAllType(node) || node.kind === 310 /* JSDocNamepathType */) {
-                        return ts.factory.createKeywordTypeNode(128 /* AnyKeyword */);
+                    if (ts.isJSDocAllType(node) || node.kind === 317 /* JSDocNamepathType */) {
+                        return ts.factory.createKeywordTypeNode(130 /* AnyKeyword */);
                     }
                     if (ts.isJSDocUnknownType(node)) {
-                        return ts.factory.createKeywordTypeNode(152 /* UnknownKeyword */);
+                        return ts.factory.createKeywordTypeNode(154 /* UnknownKeyword */);
                     }
                     if (ts.isJSDocNullableType(node)) {
                         return ts.factory.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.factory.createLiteralTypeNode(ts.factory.createNull())]);
                     }
                     if (ts.isJSDocOptionalType(node)) {
-                        return ts.factory.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.factory.createKeywordTypeNode(150 /* UndefinedKeyword */)]);
+                        return ts.factory.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.factory.createKeywordTypeNode(152 /* UndefinedKeyword */)]);
                     }
                     if (ts.isJSDocNonNullableType(node)) {
                         return ts.visitNode(node.type, visitExistingNodeTreeSymbols);
@@ -49035,11 +52313,11 @@ var ts;
                             var typeViaParent = getTypeOfPropertyOfType(getTypeFromTypeNode(node), name.escapedText);
                             var overrideTypeNode = typeViaParent && t.typeExpression && getTypeFromTypeNode(t.typeExpression.type) !== typeViaParent ? typeToTypeNodeHelper(typeViaParent, context) : undefined;
                             return ts.factory.createPropertySignature(
-                            /*modifiers*/ undefined, name, t.isBracketed || t.typeExpression && ts.isJSDocOptionalType(t.typeExpression.type) ? ts.factory.createToken(57 /* QuestionToken */) : undefined, overrideTypeNode || (t.typeExpression && ts.visitNode(t.typeExpression.type, visitExistingNodeTreeSymbols)) || ts.factory.createKeywordTypeNode(128 /* AnyKeyword */));
+                            /*modifiers*/ undefined, name, t.isBracketed || t.typeExpression && ts.isJSDocOptionalType(t.typeExpression.type) ? ts.factory.createToken(57 /* QuestionToken */) : undefined, overrideTypeNode || (t.typeExpression && ts.visitNode(t.typeExpression.type, visitExistingNodeTreeSymbols)) || ts.factory.createKeywordTypeNode(130 /* AnyKeyword */));
                         }));
                     }
                     if (ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName) && node.typeName.escapedText === "") {
-                        return ts.setOriginalNode(ts.factory.createKeywordTypeNode(128 /* AnyKeyword */), node);
+                        return ts.setOriginalNode(ts.factory.createKeywordTypeNode(130 /* AnyKeyword */), node);
                     }
                     if ((ts.isExpressionWithTypeArguments(node) || ts.isTypeReferenceNode(node)) && ts.isJSDocIndexSignature(node)) {
                         return ts.factory.createTypeLiteralNode([ts.factory.createIndexSignature(
@@ -49056,16 +52334,16 @@ var ts;
                             return ts.factory.createConstructorTypeNode(node.modifiers, ts.visitNodes(node.typeParameters, visitExistingNodeTreeSymbols), ts.mapDefined(node.parameters, function (p, i) { return p.name && ts.isIdentifier(p.name) && p.name.escapedText === "new" ? (newTypeNode_1 = p.type, undefined) : ts.factory.createParameterDeclaration(
                             /*decorators*/ undefined, 
                             /*modifiers*/ undefined, getEffectiveDotDotDotForParameter(p), getNameForJSDocFunctionParameter(p, i), p.questionToken, ts.visitNode(p.type, visitExistingNodeTreeSymbols), 
-                            /*initializer*/ undefined); }), ts.visitNode(newTypeNode_1 || node.type, visitExistingNodeTreeSymbols) || ts.factory.createKeywordTypeNode(128 /* AnyKeyword */));
+                            /*initializer*/ undefined); }), ts.visitNode(newTypeNode_1 || node.type, visitExistingNodeTreeSymbols) || ts.factory.createKeywordTypeNode(130 /* AnyKeyword */));
                         }
                         else {
                             return ts.factory.createFunctionTypeNode(ts.visitNodes(node.typeParameters, visitExistingNodeTreeSymbols), ts.map(node.parameters, function (p, i) { return ts.factory.createParameterDeclaration(
                             /*decorators*/ undefined, 
                             /*modifiers*/ undefined, getEffectiveDotDotDotForParameter(p), getNameForJSDocFunctionParameter(p, i), p.questionToken, ts.visitNode(p.type, visitExistingNodeTreeSymbols), 
-                            /*initializer*/ undefined); }), ts.visitNode(node.type, visitExistingNodeTreeSymbols) || ts.factory.createKeywordTypeNode(128 /* AnyKeyword */));
+                            /*initializer*/ undefined); }), ts.visitNode(node.type, visitExistingNodeTreeSymbols) || ts.factory.createKeywordTypeNode(130 /* AnyKeyword */));
                         }
                     }
-                    if (ts.isTypeReferenceNode(node) && ts.isInJSDoc(node) && (!existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(node, getTypeFromTypeNode(node)) || getIntendedTypeFromJSDocTypeReference(node) || unknownSymbol === resolveTypeReferenceName(getTypeReferenceName(node), 788968 /* Type */, /*ignoreErrors*/ true))) {
+                    if (ts.isTypeReferenceNode(node) && ts.isInJSDoc(node) && (!existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(node, getTypeFromTypeNode(node)) || getIntendedTypeFromJSDocTypeReference(node) || unknownSymbol === resolveTypeReferenceName(node, 788968 /* Type */, /*ignoreErrors*/ true))) {
                         return ts.setOriginalNode(typeToTypeNodeHelper(getTypeFromTypeNode(node), context), node);
                     }
                     if (ts.isLiteralImportTypeNode(node)) {
@@ -49099,7 +52377,7 @@ var ts;
                     function getNameForJSDocFunctionParameter(p, index) {
                         return p.name && ts.isIdentifier(p.name) && p.name.escapedText === "this" ? "this"
                             : getEffectiveDotDotDotForParameter(p) ? "args"
-                                : "arg" + index;
+                                : "arg".concat(index);
                     }
                     function rewriteModuleSpecifier(parent, lit) {
                         if (bundled) {
@@ -49130,8 +52408,8 @@ var ts;
                 }
             }
             function symbolTableToDeclarationStatements(symbolTable, context, bundled) {
-                var serializePropertySymbolForClass = makeSerializePropertySymbol(ts.factory.createPropertyDeclaration, 165 /* MethodDeclaration */, /*useAcessors*/ true);
-                var serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol(function (_decorators, mods, name, question, type) { return ts.factory.createPropertySignature(mods, name, question, type); }, 164 /* MethodSignature */, /*useAcessors*/ false);
+                var serializePropertySymbolForClass = makeSerializePropertySymbol(ts.factory.createPropertyDeclaration, 168 /* MethodDeclaration */, /*useAcessors*/ true);
+                var serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol(function (_decorators, mods, name, question, type) { return ts.factory.createPropertySignature(mods, name, question, type); }, 167 /* MethodSignature */, /*useAcessors*/ false);
                 // TODO: Use `setOriginalNode` on original declaration names where possible so these declarations see some kind of
                 // declaration mapping
                 // We save the enclosing declaration off here so it's not adjusted by well-meaning declaration
@@ -49152,9 +52430,11 @@ var ts;
                                 }
                             }
                             else if (oldcontext.tracker && oldcontext.tracker.trackSymbol) {
-                                oldcontext.tracker.trackSymbol(sym, decl, meaning);
+                                return oldcontext.tracker.trackSymbol(sym, decl, meaning);
                             }
+                            return false;
                         } }) });
+                context.tracker = wrapSymbolTrackerToReportForContext(context, context.tracker);
                 ts.forEachEntry(symbolTable, function (symbol, name) {
                     var baseName = ts.unescapeLeadingUnderscores(name);
                     void getInternalSymbolName(symbol, baseName); // Called to cache values into `usedSymbolNames` and `remappedSymbolNames`
@@ -49169,7 +52449,7 @@ var ts;
                 visitSymbolTable(symbolTable);
                 return mergeRedundantStatements(results);
                 function isIdentifierAndNotUndefined(node) {
-                    return !!node && node.kind === 78 /* Identifier */;
+                    return !!node && node.kind === 79 /* Identifier */;
                 }
                 function getNamesOfDeclaration(statement) {
                     if (ts.isVariableStatement(statement)) {
@@ -49190,12 +52470,12 @@ var ts;
                         var name_2 = ns.name;
                         var body = ns.body;
                         if (ts.length(excessExports)) {
-                            ns = ts.factory.updateModuleDeclaration(ns, ns.decorators, ns.modifiers, ns.name, body = ts.factory.updateModuleBlock(body, ts.factory.createNodeArray(__spreadArray(__spreadArray([], ns.body.statements), [ts.factory.createExportDeclaration(
+                            ns = ts.factory.updateModuleDeclaration(ns, ns.decorators, ns.modifiers, ns.name, body = ts.factory.updateModuleBlock(body, ts.factory.createNodeArray(__spreadArray(__spreadArray([], ns.body.statements, true), [ts.factory.createExportDeclaration(
                                 /*decorators*/ undefined, 
                                 /*modifiers*/ undefined, 
-                                /*isTypeOnly*/ false, ts.factory.createNamedExports(ts.map(ts.flatMap(excessExports, function (e) { return getNamesOfDeclaration(e); }), function (id) { return ts.factory.createExportSpecifier(/*alias*/ undefined, id); })), 
-                                /*moduleSpecifier*/ undefined)]))));
-                            statements = __spreadArray(__spreadArray(__spreadArray([], statements.slice(0, nsIndex)), [ns]), statements.slice(nsIndex + 1));
+                                /*isTypeOnly*/ false, ts.factory.createNamedExports(ts.map(ts.flatMap(excessExports, function (e) { return getNamesOfDeclaration(e); }), function (id) { return ts.factory.createExportSpecifier(/*isTypeOnly*/ false, /*alias*/ undefined, id); })), 
+                                /*moduleSpecifier*/ undefined)], false))));
+                            statements = __spreadArray(__spreadArray(__spreadArray([], statements.slice(0, nsIndex), true), [ns], false), statements.slice(nsIndex + 1), true);
                         }
                         // Pass 1: Flatten `export namespace _exports {} export = _exports;` so long as the `export=` only points at a single namespace declaration
                         if (!ts.find(statements, function (s) { return s !== ns && ts.nodeHasName(s, name_2); })) {
@@ -49206,7 +52486,7 @@ var ts;
                             ts.forEach(body.statements, function (s) {
                                 addResult(s, mixinExportFlag_1 ? 1 /* Export */ : 0 /* None */); // Recalculates the ambient (and export, if applicable from above) flag
                             });
-                            statements = __spreadArray(__spreadArray([], ts.filter(statements, function (s) { return s !== ns && s !== exportAssignment; })), results);
+                            statements = __spreadArray(__spreadArray([], ts.filter(statements, function (s) { return s !== ns && s !== exportAssignment; }), true), results, true);
                         }
                     }
                     return statements;
@@ -49216,11 +52496,11 @@ var ts;
                     var exports = ts.filter(statements, function (d) { return ts.isExportDeclaration(d) && !d.moduleSpecifier && !!d.exportClause && ts.isNamedExports(d.exportClause); });
                     if (ts.length(exports) > 1) {
                         var nonExports = ts.filter(statements, function (d) { return !ts.isExportDeclaration(d) || !!d.moduleSpecifier || !d.exportClause; });
-                        statements = __spreadArray(__spreadArray([], nonExports), [ts.factory.createExportDeclaration(
+                        statements = __spreadArray(__spreadArray([], nonExports, true), [ts.factory.createExportDeclaration(
                             /*decorators*/ undefined, 
                             /*modifiers*/ undefined, 
                             /*isTypeOnly*/ false, ts.factory.createNamedExports(ts.flatMap(exports, function (e) { return ts.cast(e.exportClause, ts.isNamedExports).elements; })), 
-                            /*moduleSpecifier*/ undefined)]);
+                            /*moduleSpecifier*/ undefined)], false);
                     }
                     // Pass 2b: Also combine all `export {} from "..."` declarations as needed
                     var reexports = ts.filter(statements, function (d) { return ts.isExportDeclaration(d) && !!d.moduleSpecifier && !!d.exportClause && ts.isNamedExports(d.exportClause); });
@@ -49230,12 +52510,12 @@ var ts;
                             var _loop_9 = function (group_1) {
                                 if (group_1.length > 1) {
                                     // remove group members from statements and then merge group members and add back to statements
-                                    statements = __spreadArray(__spreadArray([], ts.filter(statements, function (s) { return group_1.indexOf(s) === -1; })), [
+                                    statements = __spreadArray(__spreadArray([], ts.filter(statements, function (s) { return group_1.indexOf(s) === -1; }), true), [
                                         ts.factory.createExportDeclaration(
                                         /*decorators*/ undefined, 
                                         /*modifiers*/ undefined, 
                                         /*isTypeOnly*/ false, ts.factory.createNamedExports(ts.flatMap(group_1, function (e) { return ts.cast(e.exportClause, ts.isNamedExports).elements; })), group_1[0].moduleSpecifier)
-                                    ]);
+                                    ], false);
                                 }
                             };
                             for (var _i = 0, groups_1 = groups; _i < groups_1.length; _i++) {
@@ -49248,7 +52528,7 @@ var ts;
                 }
                 function inlineExportModifiers(statements) {
                     // Pass 3: Move all `export {}`'s to `export` modifiers where possible
-                    var index = ts.findIndex(statements, function (d) { return ts.isExportDeclaration(d) && !d.moduleSpecifier && !!d.exportClause && ts.isNamedExports(d.exportClause); });
+                    var index = ts.findIndex(statements, function (d) { return ts.isExportDeclaration(d) && !d.moduleSpecifier && !d.assertClause && !!d.exportClause && ts.isNamedExports(d.exportClause); });
                     if (index >= 0) {
                         var exportDecl = statements[index];
                         var replacements = ts.mapDefined(exportDecl.exportClause.elements, function (e) {
@@ -49272,7 +52552,7 @@ var ts;
                         }
                         else {
                             // some items filtered, others not - update the export declaration
-                            statements[index] = ts.factory.updateExportDeclaration(exportDecl, exportDecl.decorators, exportDecl.modifiers, exportDecl.isTypeOnly, ts.factory.updateNamedExports(exportDecl.exportClause, replacements), exportDecl.moduleSpecifier);
+                            statements[index] = ts.factory.updateExportDeclaration(exportDecl, exportDecl.decorators, exportDecl.modifiers, exportDecl.isTypeOnly, ts.factory.updateNamedExports(exportDecl.exportClause, replacements), exportDecl.moduleSpecifier, exportDecl.assertClause);
                         }
                     }
                     return statements;
@@ -49338,6 +52618,9 @@ var ts;
                         var oldContext = context;
                         context = cloneNodeBuilderContext(context);
                         var result = serializeSymbolWorker(symbol, isPrivate, propertyAsAlias);
+                        if (context.reportedDiagnostic) {
+                            oldcontext.reportedDiagnostic = context.reportedDiagnostic; // hoist diagnostic result into outer context
+                        }
                         context = oldContext;
                         return result;
                     }
@@ -49352,6 +52635,7 @@ var ts;
                 // If it's a class/interface/function: emit a class/interface/function with a `default` modifier
                 // These forms can merge, eg (`export default 12; export default interface A {}`)
                 function serializeSymbolWorker(symbol, isPrivate, propertyAsAlias) {
+                    var _a, _b;
                     var symbolName = ts.unescapeLeadingUnderscores(symbol.escapedName);
                     var isDefault = symbol.escapedName === "default" /* Default */;
                     if (isPrivate && !(context.flags & 131072 /* AllowAnonymousIdentifier */) && ts.isStringANonContextualKeyword(symbolName) && !isDefault) {
@@ -49410,14 +52694,14 @@ var ts;
                                 if (textRange && ts.isVariableDeclarationList(textRange.parent) && textRange.parent.declarations.length === 1) {
                                     textRange = textRange.parent.parent;
                                 }
-                                var propertyAccessRequire = ts.find(symbol.declarations, ts.isPropertyAccessExpression);
+                                var propertyAccessRequire = (_a = symbol.declarations) === null || _a === void 0 ? void 0 : _a.find(ts.isPropertyAccessExpression);
                                 if (propertyAccessRequire && ts.isBinaryExpression(propertyAccessRequire.parent) && ts.isIdentifier(propertyAccessRequire.parent.right)
-                                    && type.symbol && ts.isSourceFile(type.symbol.valueDeclaration)) {
+                                    && ((_b = type.symbol) === null || _b === void 0 ? void 0 : _b.valueDeclaration) && ts.isSourceFile(type.symbol.valueDeclaration)) {
                                     var alias = localName === propertyAccessRequire.parent.right.escapedText ? undefined : propertyAccessRequire.parent.right;
                                     addResult(ts.factory.createExportDeclaration(
                                     /*decorators*/ undefined, 
                                     /*modifiers*/ undefined, 
-                                    /*isTypeOnly*/ false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(alias, localName)])), 0 /* None */);
+                                    /*isTypeOnly*/ false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(/*isTypeOnly*/ false, alias, localName)])), 0 /* None */);
                                     context.tracker.trackSymbol(type.symbol, context.enclosingDeclaration, 111551 /* Value */);
                                 }
                                 else {
@@ -49450,7 +52734,7 @@ var ts;
                                         addResult(ts.factory.createExportDeclaration(
                                         /*decorators*/ undefined, 
                                         /*modifiers*/ undefined, 
-                                        /*isTypeOnly*/ false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(name, localName)])), 0 /* None */);
+                                        /*isTypeOnly*/ false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(/*isTypeOnly*/ false, name, localName)])), 0 /* None */);
                                         needsExportDeclaration = false;
                                         needsPostExportDefault = false;
                                     }
@@ -49462,7 +52746,10 @@ var ts;
                         serializeEnum(symbol, symbolName, modifierFlags);
                     }
                     if (symbol.flags & 32 /* Class */) {
-                        if (symbol.flags & 4 /* Property */ && ts.isBinaryExpression(symbol.valueDeclaration.parent) && ts.isClassExpression(symbol.valueDeclaration.parent.right)) {
+                        if (symbol.flags & 4 /* Property */
+                            && symbol.valueDeclaration
+                            && ts.isBinaryExpression(symbol.valueDeclaration.parent)
+                            && ts.isClassExpression(symbol.valueDeclaration.parent.right)) {
                             // Looks like a `module.exports.Sub = class {}` - if we serialize `symbol` as a class, the result will have no members,
                             // since the classiness is actually from the target of the effective alias the symbol is. yes. A BlockScopedVariable|Class|Property
                             // _really_ acts like an Alias, and none of a BlockScopedVariable, Class, or Property. This is the travesty of JS binding today.
@@ -49488,12 +52775,14 @@ var ts;
                     if (symbol.flags & 8388608 /* ExportStar */) {
                         // synthesize export * from "moduleReference"
                         // Straightforward - only one thing to do - make an export declaration
-                        for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
-                            var node = _a[_i];
-                            var resolvedModule = resolveExternalModuleName(node, node.moduleSpecifier);
-                            if (!resolvedModule)
-                                continue;
-                            addResult(ts.factory.createExportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*isTypeOnly*/ false, /*exportClause*/ undefined, ts.factory.createStringLiteral(getSpecifierForModuleSymbol(resolvedModule, context))), 0 /* None */);
+                        if (symbol.declarations) {
+                            for (var _i = 0, _c = symbol.declarations; _i < _c.length; _i++) {
+                                var node = _c[_i];
+                                var resolvedModule = resolveExternalModuleName(node, node.moduleSpecifier);
+                                if (!resolvedModule)
+                                    continue;
+                                addResult(ts.factory.createExportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*isTypeOnly*/ false, /*exportClause*/ undefined, ts.factory.createStringLiteral(getSpecifierForModuleSymbol(resolvedModule, context))), 0 /* None */);
+                            }
                         }
                     }
                     if (needsPostExportDefault) {
@@ -49503,7 +52792,7 @@ var ts;
                         addResult(ts.factory.createExportDeclaration(
                         /*decorators*/ undefined, 
                         /*modifiers*/ undefined, 
-                        /*isTypeOnly*/ false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(getInternalSymbolName(symbol, symbolName), symbolName)])), 0 /* None */);
+                        /*isTypeOnly*/ false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(/*isTypeOnly*/ false, getInternalSymbolName(symbol, symbolName), symbolName)])), 0 /* None */);
                     }
                 }
                 function includePrivateSymbol(symbol) {
@@ -49555,11 +52844,12 @@ var ts;
                     results.push(node);
                 }
                 function serializeTypeAlias(symbol, symbolName, modifierFlags) {
+                    var _a;
                     var aliasType = getDeclaredTypeOfTypeAlias(symbol);
                     var typeParams = getSymbolLinks(symbol).typeParameters;
                     var typeParamDecls = ts.map(typeParams, function (p) { return typeParameterToDeclaration(p, context); });
-                    var jsdocAliasDecl = ts.find(symbol.declarations, ts.isJSDocTypeAlias);
-                    var commentText = jsdocAliasDecl ? jsdocAliasDecl.comment || jsdocAliasDecl.parent.comment : undefined;
+                    var jsdocAliasDecl = (_a = symbol.declarations) === null || _a === void 0 ? void 0 : _a.find(ts.isJSDocTypeAlias);
+                    var commentText = ts.getTextOfJSDocComment(jsdocAliasDecl ? jsdocAliasDecl.comment || jsdocAliasDecl.parent.comment : undefined);
                     var oldFlags = context.flags;
                     context.flags |= 8388608 /* InTypeAlias */;
                     var oldEnclosingDecl = context.enclosingDeclaration;
@@ -49579,13 +52869,13 @@ var ts;
                     var baseTypes = getBaseTypes(interfaceType);
                     var baseType = ts.length(baseTypes) ? getIntersectionType(baseTypes) : undefined;
                     var members = ts.flatMap(getPropertiesOfType(interfaceType), function (p) { return serializePropertySymbolForInterface(p, baseType); });
-                    var callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 169 /* CallSignature */);
-                    var constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 170 /* ConstructSignature */);
+                    var callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 173 /* CallSignature */);
+                    var constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 174 /* ConstructSignature */);
                     var indexSignatures = serializeIndexSignatures(interfaceType, baseType);
-                    var heritageClauses = !ts.length(baseTypes) ? undefined : [ts.factory.createHeritageClause(93 /* ExtendsKeyword */, ts.mapDefined(baseTypes, function (b) { return trySerializeAsTypeReference(b, 111551 /* Value */); }))];
+                    var heritageClauses = !ts.length(baseTypes) ? undefined : [ts.factory.createHeritageClause(94 /* ExtendsKeyword */, ts.mapDefined(baseTypes, function (b) { return trySerializeAsTypeReference(b, 111551 /* Value */); }))];
                     addResult(ts.factory.createInterfaceDeclaration(
                     /*decorators*/ undefined, 
-                    /*modifiers*/ undefined, getInternalSymbolName(symbol, symbolName), typeParamDecls, heritageClauses, __spreadArray(__spreadArray(__spreadArray(__spreadArray([], indexSignatures), constructSignatures), callSignatures), members)), modifierFlags);
+                    /*modifiers*/ undefined, getInternalSymbolName(symbol, symbolName), typeParamDecls, heritageClauses, __spreadArray(__spreadArray(__spreadArray(__spreadArray([], indexSignatures, true), constructSignatures, true), callSignatures, true), members, true)), modifierFlags);
                 }
                 function getNamespaceMembersForSerialization(symbol) {
                     return !symbol.exports ? [] : ts.filter(ts.arrayFrom(symbol.exports.values()), isNamespaceMember);
@@ -49624,7 +52914,7 @@ var ts;
                                 var target = aliasDecl && getTargetOfAliasDeclaration(aliasDecl, /*dontRecursivelyResolve*/ true);
                                 includePrivateSymbol(target || s);
                                 var targetName = target ? getInternalSymbolName(target, ts.unescapeLeadingUnderscores(target.escapedName)) : localName;
-                                return ts.factory.createExportSpecifier(name === targetName ? undefined : targetName, name);
+                                return ts.factory.createExportSpecifier(/*isTypeOnly*/ false, name === targetName ? undefined : targetName, name);
                             })))]);
                         addResult(ts.factory.createModuleDeclaration(
                         /*decorators*/ undefined, 
@@ -49649,9 +52939,8 @@ var ts;
                     for (var _i = 0, signatures_2 = signatures; _i < signatures_2.length; _i++) {
                         var sig = signatures_2[_i];
                         // Each overload becomes a separate function declaration, in order
-                        var decl = signatureToSignatureDeclarationHelper(sig, 251 /* FunctionDeclaration */, context, { name: ts.factory.createIdentifier(localName), privateSymbolVisitor: includePrivateSymbol, bundledImports: bundled });
-                        // for expressions assigned to `var`s, use the `var` as the text range
-                        addResult(ts.setTextRange(decl, sig.declaration && ts.isVariableDeclaration(sig.declaration.parent) && sig.declaration.parent.parent || sig.declaration), modifierFlags);
+                        var decl = signatureToSignatureDeclarationHelper(sig, 255 /* FunctionDeclaration */, context, { name: ts.factory.createIdentifier(localName), privateSymbolVisitor: includePrivateSymbol, bundledImports: bundled });
+                        addResult(ts.setTextRange(decl, getSignatureTextRangeLocation(sig)), modifierFlags);
                     }
                     // Module symbol emit will take care of module-y members, provided it has exports
                     if (!(symbol.flags & (512 /* ValueModule */ | 1024 /* NamespaceModule */) && !!symbol.exports && !!symbol.exports.size)) {
@@ -49659,6 +52948,18 @@ var ts;
                         serializeAsNamespaceDeclaration(props, localName, modifierFlags, /*suppressNewPrivateContext*/ true);
                     }
                 }
+                function getSignatureTextRangeLocation(signature) {
+                    if (signature.declaration && signature.declaration.parent) {
+                        if (ts.isBinaryExpression(signature.declaration.parent) && ts.getAssignmentDeclarationKind(signature.declaration.parent) === 5 /* Property */) {
+                            return signature.declaration.parent;
+                        }
+                        // for expressions assigned to `var`s, use the `var` as the text range
+                        if (ts.isVariableDeclaration(signature.declaration.parent) && signature.declaration.parent.parent) {
+                            return signature.declaration.parent.parent;
+                        }
+                    }
+                    return signature.declaration;
+                }
                 function serializeAsNamespaceDeclaration(props, localName, modifierFlags, suppressNewPrivateContext) {
                     if (ts.length(props)) {
                         var localVsRemoteMap = ts.arrayToMultiMap(props, function (p) {
@@ -49704,7 +53005,7 @@ var ts;
                         var defaultReplaced = ts.map(declarations, function (d) { return ts.isExportAssignment(d) && !d.isExportEquals && ts.isIdentifier(d.expression) ? ts.factory.createExportDeclaration(
                         /*decorators*/ undefined, 
                         /*modifiers*/ undefined, 
-                        /*isTypeOnly*/ false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(d.expression, ts.factory.createIdentifier("default" /* Default */))])) : d; });
+                        /*isTypeOnly*/ false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(/*isTypeOnly*/ false, d.expression, ts.factory.createIdentifier("default" /* Default */))])) : d; });
                         var exportModifierStripped = ts.every(defaultReplaced, function (d) { return ts.hasSyntacticModifier(d, 1 /* Export */); }) ? ts.map(defaultReplaced, removeExportModifier) : defaultReplaced;
                         fakespace = ts.factory.updateModuleDeclaration(fakespace, fakespace.decorators, fakespace.modifiers, fakespace.name, ts.factory.createModuleBlock(exportModifierStripped));
                         addResult(fakespace, modifierFlags); // namespaces can never be default exported
@@ -49712,7 +53013,7 @@ var ts;
                 }
                 function isNamespaceMember(p) {
                     return !!(p.flags & (788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */)) ||
-                        !(p.flags & 4194304 /* Prototype */ || p.escapedName === "prototype" || p.valueDeclaration && ts.getEffectiveModifierFlags(p.valueDeclaration) & 32 /* Static */ && ts.isClassLike(p.valueDeclaration.parent));
+                        !(p.flags & 4194304 /* Prototype */ || p.escapedName === "prototype" || p.valueDeclaration && ts.isStatic(p.valueDeclaration) && ts.isClassLike(p.valueDeclaration.parent));
                 }
                 function sanitizeJSDocImplements(clauses) {
                     var result = ts.mapDefined(clauses, function (e) {
@@ -49745,8 +53046,8 @@ var ts;
                     return undefined;
                 }
                 function serializeAsClass(symbol, localName, modifierFlags) {
-                    var _a;
-                    var originalDecl = ts.find(symbol.declarations, ts.isClassLike);
+                    var _a, _b;
+                    var originalDecl = (_a = symbol.declarations) === null || _a === void 0 ? void 0 : _a.find(ts.isClassLike);
                     var oldEnclosing = context.enclosingDeclaration;
                     context.enclosingDeclaration = originalDecl || oldEnclosing;
                     var localParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol);
@@ -49757,25 +53058,25 @@ var ts;
                     var implementsExpressions = originalImplements && sanitizeJSDocImplements(originalImplements)
                         || ts.mapDefined(getImplementsTypes(classType), serializeImplementedType);
                     var staticType = getTypeOfSymbol(symbol);
-                    var isClass = !!((_a = staticType.symbol) === null || _a === void 0 ? void 0 : _a.valueDeclaration) && ts.isClassLike(staticType.symbol.valueDeclaration);
+                    var isClass = !!((_b = staticType.symbol) === null || _b === void 0 ? void 0 : _b.valueDeclaration) && ts.isClassLike(staticType.symbol.valueDeclaration);
                     var staticBaseType = isClass
                         ? getBaseConstructorTypeOfClass(staticType)
                         : anyType;
-                    var heritageClauses = __spreadArray(__spreadArray([], !ts.length(baseTypes) ? [] : [ts.factory.createHeritageClause(93 /* ExtendsKeyword */, ts.map(baseTypes, function (b) { return serializeBaseType(b, staticBaseType, localName); }))]), !ts.length(implementsExpressions) ? [] : [ts.factory.createHeritageClause(116 /* ImplementsKeyword */, implementsExpressions)]);
+                    var heritageClauses = __spreadArray(__spreadArray([], !ts.length(baseTypes) ? [] : [ts.factory.createHeritageClause(94 /* ExtendsKeyword */, ts.map(baseTypes, function (b) { return serializeBaseType(b, staticBaseType, localName); }))], true), !ts.length(implementsExpressions) ? [] : [ts.factory.createHeritageClause(117 /* ImplementsKeyword */, implementsExpressions)], true);
                     var symbolProps = getNonInterhitedProperties(classType, baseTypes, getPropertiesOfType(classType));
                     var publicSymbolProps = ts.filter(symbolProps, function (s) {
                         // `valueDeclaration` could be undefined if inherited from
                         // a union/intersection base type, but inherited properties
                         // don't matter here.
                         var valueDecl = s.valueDeclaration;
-                        return valueDecl && !(ts.isNamedDeclaration(valueDecl) && ts.isPrivateIdentifier(valueDecl.name));
+                        return !!valueDecl && !(ts.isNamedDeclaration(valueDecl) && ts.isPrivateIdentifier(valueDecl.name));
                     });
                     var hasPrivateIdentifier = ts.some(symbolProps, function (s) {
                         // `valueDeclaration` could be undefined if inherited from
                         // a union/intersection base type, but inherited properties
                         // don't matter here.
                         var valueDecl = s.valueDeclaration;
-                        return valueDecl && ts.isNamedDeclaration(valueDecl) && ts.isPrivateIdentifier(valueDecl.name);
+                        return !!valueDecl && ts.isNamedDeclaration(valueDecl) && ts.isPrivateIdentifier(valueDecl.name);
                     });
                     // Boil down all private properties into a single one.
                     var privateProperties = hasPrivateIdentifier ?
@@ -49798,12 +53099,33 @@ var ts;
                         !ts.some(getSignaturesOfType(staticType, 1 /* Construct */));
                     var constructors = isNonConstructableClassLikeInJsFile ?
                         [ts.factory.createConstructorDeclaration(/*decorators*/ undefined, ts.factory.createModifiersFromModifierFlags(8 /* Private */), [], /*body*/ undefined)] :
-                        serializeSignatures(1 /* Construct */, staticType, staticBaseType, 166 /* Constructor */);
+                        serializeSignatures(1 /* Construct */, staticType, staticBaseType, 170 /* Constructor */);
                     var indexSignatures = serializeIndexSignatures(classType, baseTypes[0]);
                     context.enclosingDeclaration = oldEnclosing;
                     addResult(ts.setTextRange(ts.factory.createClassDeclaration(
                     /*decorators*/ undefined, 
-                    /*modifiers*/ undefined, localName, typeParamDecls, heritageClauses, __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], indexSignatures), staticMembers), constructors), publicProperties), privateProperties)), symbol.declarations && ts.filter(symbol.declarations, function (d) { return ts.isClassDeclaration(d) || ts.isClassExpression(d); })[0]), modifierFlags);
+                    /*modifiers*/ undefined, localName, typeParamDecls, heritageClauses, __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], indexSignatures, true), staticMembers, true), constructors, true), publicProperties, true), privateProperties, true)), symbol.declarations && ts.filter(symbol.declarations, function (d) { return ts.isClassDeclaration(d) || ts.isClassExpression(d); })[0]), modifierFlags);
+                }
+                function getSomeTargetNameFromDeclarations(declarations) {
+                    return ts.firstDefined(declarations, function (d) {
+                        if (ts.isImportSpecifier(d) || ts.isExportSpecifier(d)) {
+                            return ts.idText(d.propertyName || d.name);
+                        }
+                        if (ts.isBinaryExpression(d) || ts.isExportAssignment(d)) {
+                            var expression = ts.isExportAssignment(d) ? d.expression : d.right;
+                            if (ts.isPropertyAccessExpression(expression)) {
+                                return ts.idText(expression.name);
+                            }
+                        }
+                        if (isAliasSymbolDeclaration(d)) {
+                            // This is... heuristic, at best. But it's probably better than always printing the name of the shorthand ambient module.
+                            var name = ts.getNameOfDeclaration(d);
+                            if (name && ts.isIdentifier(name)) {
+                                return ts.idText(name);
+                            }
+                        }
+                        return undefined;
+                    });
                 }
                 function serializeAsAlias(symbol, localName, modifierFlags) {
                     var _a, _b, _c, _d, _e;
@@ -49817,34 +53139,38 @@ var ts;
                     if (!target) {
                         return;
                     }
-                    var verbatimTargetName = ts.unescapeLeadingUnderscores(target.escapedName);
-                    if (verbatimTargetName === "export=" /* ExportEquals */ && (compilerOptions.esModuleInterop || compilerOptions.allowSyntheticDefaultImports)) {
+                    // If `target` refers to a shorthand module symbol, the name we're trying to pull out isn;t recoverable from the target symbol
+                    // In such a scenario, we must fall back to looking for an alias declaration on `symbol` and pulling the target name from that
+                    var verbatimTargetName = ts.isShorthandAmbientModuleSymbol(target) && getSomeTargetNameFromDeclarations(symbol.declarations) || ts.unescapeLeadingUnderscores(target.escapedName);
+                    if (verbatimTargetName === "export=" /* ExportEquals */ && (ts.getESModuleInterop(compilerOptions) || compilerOptions.allowSyntheticDefaultImports)) {
                         // target refers to an `export=` symbol that was hoisted into a synthetic default - rename here to match
                         verbatimTargetName = "default" /* Default */;
                     }
                     var targetName = getInternalSymbolName(target, verbatimTargetName);
                     includePrivateSymbol(target); // the target may be within the same scope - attempt to serialize it first
                     switch (node.kind) {
-                        case 198 /* BindingElement */:
-                            if (((_b = (_a = node.parent) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.kind) === 249 /* VariableDeclaration */) {
+                        case 202 /* BindingElement */:
+                            if (((_b = (_a = node.parent) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.kind) === 253 /* VariableDeclaration */) {
                                 // const { SomeClass } = require('./lib');
                                 var specifier_1 = getSpecifierForModuleSymbol(target.parent || target, context); // './lib'
                                 var propertyName = node.propertyName;
                                 addResult(ts.factory.createImportDeclaration(
                                 /*decorators*/ undefined, 
-                                /*modifiers*/ undefined, ts.factory.createImportClause(/*isTypeOnly*/ false, /*name*/ undefined, ts.factory.createNamedImports([ts.factory.createImportSpecifier(propertyName && ts.isIdentifier(propertyName) ? ts.factory.createIdentifier(ts.idText(propertyName)) : undefined, ts.factory.createIdentifier(localName))])), ts.factory.createStringLiteral(specifier_1)), 0 /* None */);
+                                /*modifiers*/ undefined, ts.factory.createImportClause(/*isTypeOnly*/ false, /*name*/ undefined, ts.factory.createNamedImports([ts.factory.createImportSpecifier(
+                                    /*isTypeOnly*/ false, propertyName && ts.isIdentifier(propertyName) ? ts.factory.createIdentifier(ts.idText(propertyName)) : undefined, ts.factory.createIdentifier(localName))])), ts.factory.createStringLiteral(specifier_1), 
+                                /*importClause*/ undefined), 0 /* None */);
                                 break;
                             }
                             // We don't know how to serialize this (nested?) binding element
                             ts.Debug.failBadSyntaxKind(((_c = node.parent) === null || _c === void 0 ? void 0 : _c.parent) || node, "Unhandled binding element grandparent kind in declaration serialization");
                             break;
-                        case 289 /* ShorthandPropertyAssignment */:
-                            if (((_e = (_d = node.parent) === null || _d === void 0 ? void 0 : _d.parent) === null || _e === void 0 ? void 0 : _e.kind) === 216 /* BinaryExpression */) {
+                        case 295 /* ShorthandPropertyAssignment */:
+                            if (((_e = (_d = node.parent) === null || _d === void 0 ? void 0 : _d.parent) === null || _e === void 0 ? void 0 : _e.kind) === 220 /* BinaryExpression */) {
                                 // module.exports = { SomeClass }
                                 serializeExportSpecifier(ts.unescapeLeadingUnderscores(symbol.escapedName), targetName);
                             }
                             break;
-                        case 249 /* VariableDeclaration */:
+                        case 253 /* VariableDeclaration */:
                             // commonjs require: const x = require('y')
                             if (ts.isPropertyAccessExpression(node.initializer)) {
                                 // const x = require('y').z
@@ -49864,7 +53190,7 @@ var ts;
                                 break;
                             }
                         // else fall through and treat commonjs require just like import=
-                        case 260 /* ImportEqualsDeclaration */:
+                        case 264 /* ImportEqualsDeclaration */:
                             // This _specifically_ only exists to handle json declarations - where we make aliases, but since
                             // we emit no declarations for the json document, must not refer to it in the declarations
                             if (target.escapedName === "export=" /* ExportEquals */ && ts.some(target.declarations, ts.isJsonSourceFile)) {
@@ -49881,42 +53207,46 @@ var ts;
                                 ? symbolToName(target, context, 67108863 /* All */, /*expectsIdentifier*/ false)
                                 : ts.factory.createExternalModuleReference(ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target, context)))), isLocalImport ? modifierFlags : 0 /* None */);
                             break;
-                        case 259 /* NamespaceExportDeclaration */:
+                        case 263 /* NamespaceExportDeclaration */:
                             // export as namespace foo
                             // TODO: Not part of a file's local or export symbol tables
                             // Is bound into file.symbol.globalExports instead, which we don't currently traverse
                             addResult(ts.factory.createNamespaceExportDeclaration(ts.idText(node.name)), 0 /* None */);
                             break;
-                        case 262 /* ImportClause */:
+                        case 266 /* ImportClause */:
                             addResult(ts.factory.createImportDeclaration(
                             /*decorators*/ undefined, 
                             /*modifiers*/ undefined, ts.factory.createImportClause(/*isTypeOnly*/ false, ts.factory.createIdentifier(localName), /*namedBindings*/ undefined), 
                             // We use `target.parent || target` below as `target.parent` is unset when the target is a module which has been export assigned
                             // And then made into a default by the `esModuleInterop` or `allowSyntheticDefaultImports` flag
                             // In such cases, the `target` refers to the module itself already
-                            ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target.parent || target, context))), 0 /* None */);
+                            ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target.parent || target, context)), 
+                            /*assertClause*/ undefined), 0 /* None */);
                             break;
-                        case 263 /* NamespaceImport */:
+                        case 267 /* NamespaceImport */:
                             addResult(ts.factory.createImportDeclaration(
                             /*decorators*/ undefined, 
-                            /*modifiers*/ undefined, ts.factory.createImportClause(/*isTypeOnly*/ false, /*importClause*/ undefined, ts.factory.createNamespaceImport(ts.factory.createIdentifier(localName))), ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target, context))), 0 /* None */);
+                            /*modifiers*/ undefined, ts.factory.createImportClause(/*isTypeOnly*/ false, /*importClause*/ undefined, ts.factory.createNamespaceImport(ts.factory.createIdentifier(localName))), ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target, context)), 
+                            /*assertClause*/ undefined), 0 /* None */);
                             break;
-                        case 269 /* NamespaceExport */:
+                        case 273 /* NamespaceExport */:
                             addResult(ts.factory.createExportDeclaration(
                             /*decorators*/ undefined, 
                             /*modifiers*/ undefined, 
                             /*isTypeOnly*/ false, ts.factory.createNamespaceExport(ts.factory.createIdentifier(localName)), ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target, context))), 0 /* None */);
                             break;
-                        case 265 /* ImportSpecifier */:
+                        case 269 /* ImportSpecifier */:
                             addResult(ts.factory.createImportDeclaration(
                             /*decorators*/ undefined, 
                             /*modifiers*/ undefined, ts.factory.createImportClause(
                             /*isTypeOnly*/ false, 
                             /*importClause*/ undefined, ts.factory.createNamedImports([
-                                ts.factory.createImportSpecifier(localName !== verbatimTargetName ? ts.factory.createIdentifier(verbatimTargetName) : undefined, ts.factory.createIdentifier(localName))
-                            ])), ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target.parent || target, context))), 0 /* None */);
+                                ts.factory.createImportSpecifier(
+                                /*isTypeOnly*/ false, localName !== verbatimTargetName ? ts.factory.createIdentifier(verbatimTargetName) : undefined, ts.factory.createIdentifier(localName))
+                            ])), ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target.parent || target, context)), 
+                            /*assertClause*/ undefined), 0 /* None */);
                             break;
-                        case 270 /* ExportSpecifier */:
+                        case 274 /* ExportSpecifier */:
                             // does not use localName because the symbol name in this case refers to the name in the exports table,
                             // which we must exactly preserve
                             var specifier = node.parent.parent.moduleSpecifier;
@@ -49924,12 +53254,12 @@ var ts;
                             // another file
                             serializeExportSpecifier(ts.unescapeLeadingUnderscores(symbol.escapedName), specifier ? verbatimTargetName : targetName, specifier && ts.isStringLiteralLike(specifier) ? ts.factory.createStringLiteral(specifier.text) : undefined);
                             break;
-                        case 266 /* ExportAssignment */:
+                        case 270 /* ExportAssignment */:
                             serializeMaybeAliasAssignment(symbol);
                             break;
-                        case 216 /* BinaryExpression */:
-                        case 201 /* PropertyAccessExpression */:
-                        case 202 /* ElementAccessExpression */:
+                        case 220 /* BinaryExpression */:
+                        case 205 /* PropertyAccessExpression */:
+                        case 206 /* ElementAccessExpression */:
                             // Could be best encoded as though an export specifier or as though an export assignment
                             // If name is default or export=, do an export assignment
                             // Otherwise do an export specifier
@@ -49948,7 +53278,7 @@ var ts;
                     addResult(ts.factory.createExportDeclaration(
                     /*decorators*/ undefined, 
                     /*modifiers*/ undefined, 
-                    /*isTypeOnly*/ false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(localName !== targetName ? targetName : undefined, localName)]), specifier), 0 /* None */);
+                    /*isTypeOnly*/ false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(/*isTypeOnly*/ false, localName !== targetName ? targetName : undefined, localName)]), specifier), 0 /* None */);
                 }
                 /**
                  * Returns `true` if an export assignment or declaration was produced for the symbol
@@ -49984,7 +53314,7 @@ var ts;
                         // a visibility error here (as they're not visible within any scope), but we want to hoist them
                         // into the containing scope anyway, so we want to skip the visibility checks.
                         var oldTrack = context.tracker.trackSymbol;
-                        context.tracker.trackSymbol = ts.noop;
+                        context.tracker.trackSymbol = function () { return false; };
                         if (isExportAssignmentCompatibleSymbolName) {
                             results.push(ts.factory.createExportAssignment(
                             /*decorators*/ undefined, 
@@ -50050,8 +53380,7 @@ var ts;
                     // whose input is not type annotated (if the input symbol has an annotation we can reuse, we should prefer it)
                     var ctxSrc = ts.getSourceFileOfNode(context.enclosingDeclaration);
                     return ts.getObjectFlags(typeToSerialize) & (16 /* Anonymous */ | 32 /* Mapped */) &&
-                        !getIndexInfoOfType(typeToSerialize, 0 /* String */) &&
-                        !getIndexInfoOfType(typeToSerialize, 1 /* Number */) &&
+                        !ts.length(getIndexInfosOfType(typeToSerialize)) &&
                         !isClassInstanceSide(typeToSerialize) && // While a class instance is potentially representable as a NS, prefer printing a reference to the instance type and serializing the class
                         !!(ts.length(ts.filter(getPropertiesOfType(typeToSerialize), isNamespaceMember)) || ts.length(getSignaturesOfType(typeToSerialize, 0 /* Call */))) &&
                         !ts.length(getSignaturesOfType(typeToSerialize, 1 /* Construct */)) && // TODO: could probably serialize as function + ns + class, now that that's OK
@@ -50063,6 +53392,7 @@ var ts;
                 }
                 function makeSerializePropertySymbol(createProperty, methodKind, useAccessors) {
                     return function serializePropertySymbol(p, isStatic, baseType) {
+                        var _a, _b, _c, _d, _e;
                         var modifierFlags = ts.getDeclarationModifierFlagsFromSymbol(p);
                         var isPrivate = !!(modifierFlags & 8 /* Private */);
                         if (isStatic && (p.flags & (788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */))) {
@@ -50079,7 +53409,7 @@ var ts;
                         }
                         var flag = (modifierFlags & ~256 /* Async */) | (isStatic ? 32 /* Static */ : 0);
                         var name = getPropertyNameNodeForSymbol(p, context);
-                        var firstPropertyLikeDecl = ts.find(p.declarations, ts.or(ts.isPropertyDeclaration, ts.isAccessor, ts.isVariableDeclaration, ts.isPropertySignature, ts.isBinaryExpression, ts.isPropertyAccessExpression));
+                        var firstPropertyLikeDecl = (_a = p.declarations) === null || _a === void 0 ? void 0 : _a.find(ts.or(ts.isPropertyDeclaration, ts.isAccessor, ts.isVariableDeclaration, ts.isPropertySignature, ts.isBinaryExpression, ts.isPropertyAccessExpression));
                         if (p.flags & 98304 /* Accessor */ && useAccessors) {
                             var result = [];
                             if (p.flags & 65536 /* SetAccessor */) {
@@ -50089,13 +53419,13 @@ var ts;
                                     /*modifiers*/ undefined, 
                                     /*dotDotDotToken*/ undefined, "arg", 
                                     /*questionToken*/ undefined, isPrivate ? undefined : serializeTypeForDeclaration(context, getTypeOfSymbol(p), p, enclosingDeclaration, includePrivateSymbol, bundled))], 
-                                /*body*/ undefined), ts.find(p.declarations, ts.isSetAccessor) || firstPropertyLikeDecl));
+                                /*body*/ undefined), ((_b = p.declarations) === null || _b === void 0 ? void 0 : _b.find(ts.isSetAccessor)) || firstPropertyLikeDecl));
                             }
                             if (p.flags & 32768 /* GetAccessor */) {
                                 var isPrivate_1 = modifierFlags & 8 /* Private */;
                                 result.push(ts.setTextRange(ts.factory.createGetAccessorDeclaration(
                                 /*decorators*/ undefined, ts.factory.createModifiersFromModifierFlags(flag), name, [], isPrivate_1 ? undefined : serializeTypeForDeclaration(context, getTypeOfSymbol(p), p, enclosingDeclaration, includePrivateSymbol, bundled), 
-                                /*body*/ undefined), ts.find(p.declarations, ts.isGetAccessor) || firstPropertyLikeDecl));
+                                /*body*/ undefined), ((_c = p.declarations) === null || _c === void 0 ? void 0 : _c.find(ts.isGetAccessor)) || firstPropertyLikeDecl));
                             }
                             return result;
                         }
@@ -50106,7 +53436,7 @@ var ts;
                             /*decorators*/ undefined, ts.factory.createModifiersFromModifierFlags((isReadonlySymbol(p) ? 64 /* Readonly */ : 0) | flag), name, p.flags & 16777216 /* Optional */ ? ts.factory.createToken(57 /* QuestionToken */) : undefined, isPrivate ? undefined : serializeTypeForDeclaration(context, getTypeOfSymbol(p), p, enclosingDeclaration, includePrivateSymbol, bundled), 
                             // TODO: https://github.com/microsoft/TypeScript/pull/32372#discussion_r328386357
                             // interface members can't have initializers, however class members _can_
-                            /*initializer*/ undefined), ts.find(p.declarations, ts.or(ts.isPropertyDeclaration, ts.isVariableDeclaration)) || firstPropertyLikeDecl);
+                            /*initializer*/ undefined), ((_d = p.declarations) === null || _d === void 0 ? void 0 : _d.find(ts.or(ts.isPropertyDeclaration, ts.isVariableDeclaration))) || firstPropertyLikeDecl);
                         }
                         if (p.flags & (8192 /* Method */ | 16 /* Function */)) {
                             var type = getTypeOfSymbol(p);
@@ -50115,7 +53445,7 @@ var ts;
                                 return ts.setTextRange(createProperty(
                                 /*decorators*/ undefined, ts.factory.createModifiersFromModifierFlags((isReadonlySymbol(p) ? 64 /* Readonly */ : 0) | flag), name, p.flags & 16777216 /* Optional */ ? ts.factory.createToken(57 /* QuestionToken */) : undefined, 
                                 /*type*/ undefined, 
-                                /*initializer*/ undefined), ts.find(p.declarations, ts.isFunctionLikeDeclaration) || signatures[0] && signatures[0].declaration || p.declarations[0]);
+                                /*initializer*/ undefined), ((_e = p.declarations) === null || _e === void 0 ? void 0 : _e.find(ts.isFunctionLikeDeclaration)) || signatures[0] && signatures[0].declaration || p.declarations && p.declarations[0]);
                             }
                             var results_1 = [];
                             for (var _i = 0, signatures_3 = signatures; _i < signatures_3.length; _i++) {
@@ -50126,12 +53456,13 @@ var ts;
                                     questionToken: p.flags & 16777216 /* Optional */ ? ts.factory.createToken(57 /* QuestionToken */) : undefined,
                                     modifiers: flag ? ts.factory.createModifiersFromModifierFlags(flag) : undefined
                                 });
-                                results_1.push(ts.setTextRange(decl, sig.declaration));
+                                var location = sig.declaration && ts.isPrototypePropertyAssignment(sig.declaration.parent) ? sig.declaration.parent : sig.declaration;
+                                results_1.push(ts.setTextRange(decl, location));
                             }
                             return results_1;
                         }
                         // The `Constructor`'s symbol isn't in the class's properties lists, obviously, since it's a signature on the static
-                        return ts.Debug.fail("Unhandled class member kind! " + (p.__debugFlags || p.flags));
+                        return ts.Debug.fail("Unhandled class member kind! ".concat(p.__debugFlags || p.flags));
                     };
                 }
                 function serializePropertySymbolForInterface(p, baseType) {
@@ -50187,20 +53518,17 @@ var ts;
                 }
                 function serializeIndexSignatures(input, baseType) {
                     var results = [];
-                    for (var _i = 0, _a = [0 /* String */, 1 /* Number */]; _i < _a.length; _i++) {
-                        var type = _a[_i];
-                        var info = getIndexInfoOfType(input, type);
-                        if (info) {
-                            if (baseType) {
-                                var baseInfo = getIndexInfoOfType(baseType, type);
-                                if (baseInfo) {
-                                    if (isTypeIdenticalTo(info.type, baseInfo.type)) {
-                                        continue; // elide identical index signatures
-                                    }
+                    for (var _i = 0, _a = getIndexInfosOfType(input); _i < _a.length; _i++) {
+                        var info = _a[_i];
+                        if (baseType) {
+                            var baseInfo = getIndexInfoOfType(baseType, info.keyType);
+                            if (baseInfo) {
+                                if (isTypeIdenticalTo(info.type, baseInfo.type)) {
+                                    continue; // elide identical index signatures
                                 }
                             }
-                            results.push(indexInfoToIndexSignatureDeclarationHelper(info, type, context, /*typeNode*/ undefined));
                         }
+                        results.push(indexInfoToIndexSignatureDeclarationHelper(info, context, /*typeNode*/ undefined));
                     }
                     return results;
                 }
@@ -50209,7 +53537,7 @@ var ts;
                     if (ref) {
                         return ref;
                     }
-                    var tempName = getUnusedName(rootName + "_base");
+                    var tempName = getUnusedName("".concat(rootName, "_base"));
                     var statement = ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([
                         ts.factory.createVariableDeclaration(tempName, /*exclamationToken*/ undefined, typeToTypeNodeHelper(staticType, context))
                     ], 2 /* Const */));
@@ -50256,7 +53584,7 @@ var ts;
                     var original = input;
                     while ((_a = context.usedSymbolNames) === null || _a === void 0 ? void 0 : _a.has(input)) {
                         i++;
-                        input = original + "_" + i;
+                        input = "".concat(original, "_").concat(i);
                     }
                     (_b = context.usedSymbolNames) === null || _b === void 0 ? void 0 : _b.add(input);
                     if (id) {
@@ -50297,7 +53625,7 @@ var ts;
             if (flags === void 0) { flags = 16384 /* UseAliasDefinedOutsideCurrentScope */; }
             return writer ? typePredicateToStringWorker(writer).getText() : ts.usingSingleLineStringWriter(typePredicateToStringWorker);
             function typePredicateToStringWorker(writer) {
-                var predicate = ts.factory.createTypePredicateNode(typePredicate.kind === 2 /* AssertsThis */ || typePredicate.kind === 3 /* AssertsIdentifier */ ? ts.factory.createToken(127 /* AssertsKeyword */) : undefined, typePredicate.kind === 1 /* Identifier */ || typePredicate.kind === 3 /* AssertsIdentifier */ ? ts.factory.createIdentifier(typePredicate.parameterName) : ts.factory.createThisTypeNode(), typePredicate.type && nodeBuilder.typeToTypeNode(typePredicate.type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */) // TODO: GH#18217
+                var predicate = ts.factory.createTypePredicateNode(typePredicate.kind === 2 /* AssertsThis */ || typePredicate.kind === 3 /* AssertsIdentifier */ ? ts.factory.createToken(128 /* AssertsKeyword */) : undefined, typePredicate.kind === 1 /* Identifier */ || typePredicate.kind === 3 /* AssertsIdentifier */ ? ts.factory.createIdentifier(typePredicate.parameterName) : ts.factory.createThisTypeNode(), typePredicate.type && nodeBuilder.typeToTypeNode(typePredicate.type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */) // TODO: GH#18217
                 );
                 var printer = ts.createPrinter({ removeComments: true });
                 var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration);
@@ -50342,9 +53670,9 @@ var ts;
             return "public";
         }
         function getTypeAliasForTypeLiteral(type) {
-            if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */) {
+            if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */ && type.symbol.declarations) {
                 var node = ts.walkUpParenthesizedTypes(type.symbol.declarations[0].parent);
-                if (node.kind === 254 /* TypeAliasDeclaration */) {
+                if (node.kind === 258 /* TypeAliasDeclaration */) {
                     return getSymbolOfNode(node);
                 }
             }
@@ -50352,27 +53680,27 @@ var ts;
         }
         function isTopLevelInExternalModuleAugmentation(node) {
             return node && node.parent &&
-                node.parent.kind === 257 /* ModuleBlock */ &&
+                node.parent.kind === 261 /* ModuleBlock */ &&
                 ts.isExternalModuleAugmentation(node.parent.parent);
         }
         function isDefaultBindingContext(location) {
-            return location.kind === 297 /* SourceFile */ || ts.isAmbientModule(location);
+            return location.kind === 303 /* SourceFile */ || ts.isAmbientModule(location);
         }
         function getNameOfSymbolFromNameType(symbol, context) {
             var nameType = getSymbolLinks(symbol).nameType;
             if (nameType) {
                 if (nameType.flags & 384 /* StringOrNumberLiteral */) {
                     var name = "" + nameType.value;
-                    if (!ts.isIdentifierText(name, compilerOptions.target) && !isNumericLiteralName(name)) {
-                        return "\"" + ts.escapeString(name, 34 /* doubleQuote */) + "\"";
+                    if (!ts.isIdentifierText(name, ts.getEmitScriptTarget(compilerOptions)) && !isNumericLiteralName(name)) {
+                        return "\"".concat(ts.escapeString(name, 34 /* doubleQuote */), "\"");
                     }
                     if (isNumericLiteralName(name) && ts.startsWith(name, "-")) {
-                        return "[" + name + "]";
+                        return "[".concat(name, "]");
                     }
                     return name;
                 }
                 if (nameType.flags & 8192 /* UniqueESSymbol */) {
-                    return "[" + getNameOfSymbolAsWritten(nameType.symbol, context) + "]";
+                    return "[".concat(getNameOfSymbolAsWritten(nameType.symbol, context), "]");
                 }
             }
         }
@@ -50415,17 +53743,17 @@ var ts;
                 if (!declaration) {
                     declaration = symbol.declarations[0]; // Declaration may be nameless, but we'll try anyway
                 }
-                if (declaration.parent && declaration.parent.kind === 249 /* VariableDeclaration */) {
+                if (declaration.parent && declaration.parent.kind === 253 /* VariableDeclaration */) {
                     return ts.declarationNameToString(declaration.parent.name);
                 }
                 switch (declaration.kind) {
-                    case 221 /* ClassExpression */:
-                    case 208 /* FunctionExpression */:
-                    case 209 /* ArrowFunction */:
+                    case 225 /* ClassExpression */:
+                    case 212 /* FunctionExpression */:
+                    case 213 /* ArrowFunction */:
                         if (context && !context.encounteredError && !(context.flags & 131072 /* AllowAnonymousIdentifier */)) {
                             context.encounteredError = true;
                         }
-                        return declaration.kind === 221 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)";
+                        return declaration.kind === 225 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)";
                 }
             }
             var name = getNameOfSymbolFromNameType(symbol, context);
@@ -50442,28 +53770,28 @@ var ts;
             return false;
             function determineIfDeclarationIsVisible() {
                 switch (node.kind) {
-                    case 324 /* JSDocCallbackTag */:
-                    case 331 /* JSDocTypedefTag */:
-                    case 325 /* JSDocEnumTag */:
+                    case 336 /* JSDocCallbackTag */:
+                    case 343 /* JSDocTypedefTag */:
+                    case 337 /* JSDocEnumTag */:
                         // Top-level jsdoc type aliases are considered exported
                         // First parent is comment node, second is hosting declaration or token; we only care about those tokens or declarations whose parent is a source file
                         return !!(node.parent && node.parent.parent && node.parent.parent.parent && ts.isSourceFile(node.parent.parent.parent));
-                    case 198 /* BindingElement */:
+                    case 202 /* BindingElement */:
                         return isDeclarationVisible(node.parent.parent);
-                    case 249 /* VariableDeclaration */:
+                    case 253 /* VariableDeclaration */:
                         if (ts.isBindingPattern(node.name) &&
                             !node.name.elements.length) {
                             // If the binding pattern is empty, this variable declaration is not visible
                             return false;
                         }
                     // falls through
-                    case 256 /* ModuleDeclaration */:
-                    case 252 /* ClassDeclaration */:
-                    case 253 /* InterfaceDeclaration */:
-                    case 254 /* TypeAliasDeclaration */:
-                    case 251 /* FunctionDeclaration */:
-                    case 255 /* EnumDeclaration */:
-                    case 260 /* ImportEqualsDeclaration */:
+                    case 260 /* ModuleDeclaration */:
+                    case 256 /* ClassDeclaration */:
+                    case 257 /* InterfaceDeclaration */:
+                    case 258 /* TypeAliasDeclaration */:
+                    case 255 /* FunctionDeclaration */:
+                    case 259 /* EnumDeclaration */:
+                    case 264 /* ImportEqualsDeclaration */:
                         // external module augmentation is always visible
                         if (ts.isExternalModuleAugmentation(node)) {
                             return true;
@@ -50471,55 +53799,55 @@ var ts;
                         var parent = getDeclarationContainer(node);
                         // If the node is not exported or it is not ambient module element (except import declaration)
                         if (!(ts.getCombinedModifierFlags(node) & 1 /* Export */) &&
-                            !(node.kind !== 260 /* ImportEqualsDeclaration */ && parent.kind !== 297 /* SourceFile */ && parent.flags & 8388608 /* Ambient */)) {
+                            !(node.kind !== 264 /* ImportEqualsDeclaration */ && parent.kind !== 303 /* SourceFile */ && parent.flags & 8388608 /* Ambient */)) {
                             return isGlobalSourceFile(parent);
                         }
                         // Exported members/ambient module elements (exception import declaration) are visible if parent is visible
                         return isDeclarationVisible(parent);
-                    case 163 /* PropertyDeclaration */:
-                    case 162 /* PropertySignature */:
-                    case 167 /* GetAccessor */:
-                    case 168 /* SetAccessor */:
-                    case 165 /* MethodDeclaration */:
-                    case 164 /* MethodSignature */:
+                    case 166 /* PropertyDeclaration */:
+                    case 165 /* PropertySignature */:
+                    case 171 /* GetAccessor */:
+                    case 172 /* SetAccessor */:
+                    case 168 /* MethodDeclaration */:
+                    case 167 /* MethodSignature */:
                         if (ts.hasEffectiveModifier(node, 8 /* Private */ | 16 /* Protected */)) {
                             // Private/protected properties/methods are not visible
                             return false;
                         }
                     // Public properties/methods are visible if its parents are visible, so:
                     // falls through
-                    case 166 /* Constructor */:
-                    case 170 /* ConstructSignature */:
-                    case 169 /* CallSignature */:
-                    case 171 /* IndexSignature */:
-                    case 160 /* Parameter */:
-                    case 257 /* ModuleBlock */:
-                    case 174 /* FunctionType */:
-                    case 175 /* ConstructorType */:
-                    case 177 /* TypeLiteral */:
-                    case 173 /* TypeReference */:
-                    case 178 /* ArrayType */:
-                    case 179 /* TupleType */:
-                    case 182 /* UnionType */:
-                    case 183 /* IntersectionType */:
-                    case 186 /* ParenthesizedType */:
-                    case 192 /* NamedTupleMember */:
+                    case 170 /* Constructor */:
+                    case 174 /* ConstructSignature */:
+                    case 173 /* CallSignature */:
+                    case 175 /* IndexSignature */:
+                    case 163 /* Parameter */:
+                    case 261 /* ModuleBlock */:
+                    case 178 /* FunctionType */:
+                    case 179 /* ConstructorType */:
+                    case 181 /* TypeLiteral */:
+                    case 177 /* TypeReference */:
+                    case 182 /* ArrayType */:
+                    case 183 /* TupleType */:
+                    case 186 /* UnionType */:
+                    case 187 /* IntersectionType */:
+                    case 190 /* ParenthesizedType */:
+                    case 196 /* NamedTupleMember */:
                         return isDeclarationVisible(node.parent);
                     // Default binding, import specifier and namespace import is visible
                     // only on demand so by default it is not visible
-                    case 262 /* ImportClause */:
-                    case 263 /* NamespaceImport */:
-                    case 265 /* ImportSpecifier */:
+                    case 266 /* ImportClause */:
+                    case 267 /* NamespaceImport */:
+                    case 269 /* ImportSpecifier */:
                         return false;
                     // Type parameters are always visible
-                    case 159 /* TypeParameter */:
+                    case 162 /* TypeParameter */:
                     // Source file and namespace export are always visible
                     // falls through
-                    case 297 /* SourceFile */:
-                    case 259 /* NamespaceExportDeclaration */:
+                    case 303 /* SourceFile */:
+                    case 263 /* NamespaceExportDeclaration */:
                         return true;
                     // Export assignments do not create name bindings outside the module
-                    case 266 /* ExportAssignment */:
+                    case 270 /* ExportAssignment */:
                         return false;
                     default:
                         return false;
@@ -50528,10 +53856,10 @@ var ts;
         }
         function collectLinkedAliases(node, setVisibility) {
             var exportSymbol;
-            if (node.parent && node.parent.kind === 266 /* ExportAssignment */) {
+            if (node.parent && node.parent.kind === 270 /* ExportAssignment */) {
                 exportSymbol = resolveName(node, node.escapedText, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*nameNotFoundMessage*/ undefined, node, /*isUse*/ false);
             }
-            else if (node.parent.kind === 270 /* ExportSpecifier */) {
+            else if (node.parent.kind === 274 /* ExportSpecifier */) {
                 exportSymbol = getTargetOfExportSpecifier(node.parent, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */);
             }
             var result;
@@ -50636,12 +53964,12 @@ var ts;
         function getDeclarationContainer(node) {
             return ts.findAncestor(ts.getRootDeclaration(node), function (node) {
                 switch (node.kind) {
-                    case 249 /* VariableDeclaration */:
-                    case 250 /* VariableDeclarationList */:
-                    case 265 /* ImportSpecifier */:
-                    case 264 /* NamedImports */:
-                    case 263 /* NamespaceImport */:
-                    case 262 /* ImportClause */:
+                    case 253 /* VariableDeclaration */:
+                    case 254 /* VariableDeclarationList */:
+                    case 269 /* ImportSpecifier */:
+                    case 268 /* NamedImports */:
+                    case 267 /* NamespaceImport */:
+                    case 266 /* ImportClause */:
                         return false;
                     default:
                         return true;
@@ -50662,11 +53990,17 @@ var ts;
             return prop ? getTypeOfSymbol(prop) : undefined;
         }
         function getTypeOfPropertyOrIndexSignature(type, name) {
-            return getTypeOfPropertyOfType(type, name) || isNumericLiteralName(name) && getIndexTypeOfType(type, 1 /* Number */) || getIndexTypeOfType(type, 0 /* String */) || unknownType;
+            var _a;
+            return getTypeOfPropertyOfType(type, name) || ((_a = getApplicableIndexInfoForName(type, name)) === null || _a === void 0 ? void 0 : _a.type) || unknownType;
         }
         function isTypeAny(type) {
             return type && (type.flags & 1 /* Any */) !== 0;
         }
+        function isErrorType(type) {
+            // The only 'any' types that have alias symbols are those manufactured by getTypeFromTypeAliasReference for
+            // a reference to an unresolved symbol. We want those to behave like the errorType.
+            return type === errorType || !!(type.flags & 1 /* Any */ && type.aliasSymbol);
+        }
         // Return the type of a binding element parent. We check SymbolLinks first to see if a type has been
         // assigned by contextual typing.
         function getTypeForBindingElementParent(node) {
@@ -50701,12 +54035,17 @@ var ts;
                     members.set(prop.escapedName, getSpreadSymbol(prop, /*readonly*/ false));
                 }
             }
-            var stringIndexInfo = getIndexInfoOfType(source, 0 /* String */);
-            var numberIndexInfo = getIndexInfoOfType(source, 1 /* Number */);
-            var result = createAnonymousType(symbol, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, numberIndexInfo);
-            result.objectFlags |= 131072 /* ObjectRestType */;
+            var result = createAnonymousType(symbol, members, ts.emptyArray, ts.emptyArray, getIndexInfosOfType(source));
+            result.objectFlags |= 8388608 /* ObjectRestType */;
             return result;
         }
+        function isGenericTypeWithUndefinedConstraint(type) {
+            return !!(type.flags & 465829888 /* Instantiable */) && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 32768 /* Undefined */);
+        }
+        function getNonUndefinedType(type) {
+            var typeOrConstraint = someType(type, isGenericTypeWithUndefinedConstraint) ? mapType(type, function (t) { return t.flags & 465829888 /* Instantiable */ ? getBaseConstraintOrType(t) : t; }) : type;
+            return getTypeWithFacts(typeOrConstraint, 524288 /* NEUndefined */);
+        }
         // Determine the control flow type associated with a destructuring declaration or assignment. The following
         // forms of destructuring are possible:
         //   let { x } = obj;  // BindingElement
@@ -50741,23 +54080,23 @@ var ts;
         function getParentElementAccess(node) {
             var ancestor = node.parent.parent;
             switch (ancestor.kind) {
-                case 198 /* BindingElement */:
-                case 288 /* PropertyAssignment */:
+                case 202 /* BindingElement */:
+                case 294 /* PropertyAssignment */:
                     return getSyntheticElementAccess(ancestor);
-                case 199 /* ArrayLiteralExpression */:
+                case 203 /* ArrayLiteralExpression */:
                     return getSyntheticElementAccess(node.parent);
-                case 249 /* VariableDeclaration */:
+                case 253 /* VariableDeclaration */:
                     return ancestor.initializer;
-                case 216 /* BinaryExpression */:
+                case 220 /* BinaryExpression */:
                     return ancestor.right;
             }
         }
         function getDestructuringPropertyName(node) {
             var parent = node.parent;
-            if (node.kind === 198 /* BindingElement */ && parent.kind === 196 /* ObjectBindingPattern */) {
+            if (node.kind === 202 /* BindingElement */ && parent.kind === 200 /* ObjectBindingPattern */) {
                 return getLiteralPropertyNameText(node.propertyName || node.name);
             }
-            if (node.kind === 288 /* PropertyAssignment */ || node.kind === 289 /* ShorthandPropertyAssignment */) {
+            if (node.kind === 294 /* PropertyAssignment */ || node.kind === 295 /* ShorthandPropertyAssignment */) {
                 return getLiteralPropertyNameText(node.name);
             }
             return "" + parent.elements.indexOf(node);
@@ -50783,7 +54122,7 @@ var ts;
                 parentType = getTypeWithFacts(parentType, 524288 /* NEUndefined */);
             }
             var type;
-            if (pattern.kind === 196 /* ObjectBindingPattern */) {
+            if (pattern.kind === 200 /* ObjectBindingPattern */) {
                 if (declaration.dotDotDotToken) {
                     parentType = getReducedType(parentType);
                     if (parentType.flags & 2 /* Unknown */ || !isValidSpreadType(parentType)) {
@@ -50803,7 +54142,7 @@ var ts;
                     // Use explicitly specified property name ({ p: xxx } form), or otherwise the implied name ({ p } form)
                     var name = declaration.propertyName || declaration.name;
                     var indexType = getLiteralTypeFromPropertyName(name);
-                    var declaredType = getConstraintForLocation(getIndexedAccessType(parentType, indexType, /*noUncheckedIndexedAccessCandidate*/ undefined, name, /*aliasSymbol*/ undefined, /*aliasTypeArguments*/ undefined, 16 /* ExpressionPosition */), declaration.name);
+                    var declaredType = getIndexedAccessType(parentType, indexType, 32 /* ExpressionPosition */, name);
                     type = getFlowTypeOfDestructuring(declaration, declaredType);
                 }
             }
@@ -50822,9 +54161,9 @@ var ts;
                         createArrayType(elementType);
                 }
                 else if (isArrayLikeType(parentType)) {
-                    var indexType = getLiteralType(index_2);
-                    var accessFlags = hasDefaultValue(declaration) ? 8 /* NoTupleBoundsCheck */ : 0;
-                    var declaredType = getConstraintForLocation(getIndexedAccessTypeOrUndefined(parentType, indexType, /*noUncheckedIndexedAccessCandidate*/ undefined, declaration.name, accessFlags | 16 /* ExpressionPosition */) || errorType, declaration.name);
+                    var indexType = getNumberLiteralType(index_2);
+                    var accessFlags = 32 /* ExpressionPosition */ | (hasDefaultValue(declaration) ? 16 /* NoTupleBoundsCheck */ : 0);
+                    var declaredType = getIndexedAccessTypeOrUndefined(parentType, indexType, accessFlags, declaration.name) || errorType;
                     type = getFlowTypeOfDestructuring(declaration, declaredType);
                 }
                 else {
@@ -50837,11 +54176,9 @@ var ts;
             if (ts.getEffectiveTypeAnnotationNode(ts.walkUpBindingElementsAndPatterns(declaration))) {
                 // In strict null checking mode, if a default value of a non-undefined type is specified, remove
                 // undefined from the final type.
-                return strictNullChecks && !(getFalsyFlags(checkDeclarationInitializer(declaration)) & 32768 /* Undefined */) ?
-                    getTypeWithFacts(type, 524288 /* NEUndefined */) :
-                    type;
+                return strictNullChecks && !(getFalsyFlags(checkDeclarationInitializer(declaration)) & 32768 /* Undefined */) ? getNonUndefinedType(type) : type;
             }
-            return widenTypeInferredFromInitializer(declaration, getUnionType([getTypeWithFacts(type, 524288 /* NEUndefined */), checkDeclarationInitializer(declaration)], 2 /* Subtype */));
+            return widenTypeInferredFromInitializer(declaration, getUnionType([getNonUndefinedType(type), checkDeclarationInitializer(declaration)], 2 /* Subtype */));
         }
         function getTypeForDeclarationFromJSDocComment(declaration) {
             var jsdocType = ts.getJSDocType(declaration);
@@ -50851,26 +54188,27 @@ var ts;
             return undefined;
         }
         function isNullOrUndefined(node) {
-            var expr = ts.skipParentheses(node);
-            return expr.kind === 103 /* NullKeyword */ || expr.kind === 78 /* Identifier */ && getResolvedSymbol(expr) === undefinedSymbol;
+            var expr = ts.skipParentheses(node, /*excludeJSDocTypeAssertions*/ true);
+            return expr.kind === 104 /* NullKeyword */ || expr.kind === 79 /* Identifier */ && getResolvedSymbol(expr) === undefinedSymbol;
         }
         function isEmptyArrayLiteral(node) {
-            var expr = ts.skipParentheses(node);
-            return expr.kind === 199 /* ArrayLiteralExpression */ && expr.elements.length === 0;
+            var expr = ts.skipParentheses(node, /*excludeJSDocTypeAssertions*/ true);
+            return expr.kind === 203 /* ArrayLiteralExpression */ && expr.elements.length === 0;
         }
-        function addOptionality(type, optional) {
-            if (optional === void 0) { optional = true; }
-            return strictNullChecks && optional ? getOptionalType(type) : type;
+        function addOptionality(type, isProperty, isOptional) {
+            if (isProperty === void 0) { isProperty = false; }
+            if (isOptional === void 0) { isOptional = true; }
+            return strictNullChecks && isOptional ? getOptionalType(type, isProperty) : type;
         }
         // Return the inferred type for a variable, parameter, or property declaration
         function getTypeForVariableLikeDeclaration(declaration, includeOptionality) {
             // A variable declared in a for..in statement is of type string, or of type keyof T when the
             // right hand expression is of a type parameter type.
-            if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 238 /* ForInStatement */) {
+            if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 242 /* ForInStatement */) {
                 var indexType = getIndexType(getNonNullableTypeIfNeeded(checkExpression(declaration.parent.parent.expression)));
                 return indexType.flags & (262144 /* TypeParameter */ | 4194304 /* Index */) ? getExtractStringType(indexType) : stringType;
             }
-            if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 239 /* ForOfStatement */) {
+            if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 243 /* ForOfStatement */) {
                 // checkRightHandSideOfForOf will return undefined if the for-of expression type was
                 // missing properties/signatures required to get its iteratedType (like
                 // [Symbol.iterator] or next). This may be because we accessed properties from anyType,
@@ -50881,13 +54219,14 @@ var ts;
             if (ts.isBindingPattern(declaration.parent)) {
                 return getTypeForBindingElement(declaration);
             }
-            var isOptional = includeOptionality && (ts.isParameter(declaration) && isJSDocOptionalParameter(declaration)
-                || isOptionalJSDocPropertyLikeTag(declaration)
-                || !ts.isBindingElement(declaration) && !ts.isVariableDeclaration(declaration) && !!declaration.questionToken);
+            var isProperty = ts.isPropertyDeclaration(declaration) || ts.isPropertySignature(declaration);
+            var isOptional = includeOptionality && (isProperty && !!declaration.questionToken ||
+                ts.isParameter(declaration) && (!!declaration.questionToken || isJSDocOptionalParameter(declaration)) ||
+                isOptionalJSDocPropertyLikeTag(declaration));
             // Use type from type annotation if one is present
             var declaredType = tryGetTypeFromEffectiveTypeNode(declaration);
             if (declaredType) {
-                return addOptionality(declaredType, isOptional);
+                return addOptionality(declaredType, isProperty, isOptional);
             }
             if ((noImplicitAny || ts.isInJSFile(declaration)) &&
                 ts.isVariableDeclaration(declaration) && !ts.isBindingPattern(declaration.name) &&
@@ -50907,8 +54246,8 @@ var ts;
             if (ts.isParameter(declaration)) {
                 var func = declaration.parent;
                 // For a parameter of a set accessor, use the type of the get accessor if one is present
-                if (func.kind === 168 /* SetAccessor */ && hasBindableName(func)) {
-                    var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 167 /* GetAccessor */);
+                if (func.kind === 172 /* SetAccessor */ && hasBindableName(func)) {
+                    var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 171 /* GetAccessor */);
                     if (getter) {
                         var getterSignature = getSignatureFromDeclaration(getter);
                         var thisParameter = getAccessorThisParameter(func);
@@ -50931,7 +54270,7 @@ var ts;
                 // Use contextual parameter type if one is available
                 var type = declaration.symbol.escapedName === "this" /* This */ ? getContextualThisParameterType(func) : getContextuallyTypedParameterType(declaration);
                 if (type) {
-                    return addOptionality(type, isOptional);
+                    return addOptionality(type, /*isProperty*/ false, isOptional);
                 }
             }
             // Use the type of the initializer expression if one is present and the declaration is
@@ -50944,16 +54283,25 @@ var ts;
                     }
                 }
                 var type = widenTypeInferredFromInitializer(declaration, checkDeclarationInitializer(declaration));
-                return addOptionality(type, isOptional);
+                return addOptionality(type, isProperty, isOptional);
             }
-            if (ts.isPropertyDeclaration(declaration) && !ts.hasStaticModifier(declaration) && (noImplicitAny || ts.isInJSFile(declaration))) {
+            if (ts.isPropertyDeclaration(declaration) && (noImplicitAny || ts.isInJSFile(declaration))) {
                 // We have a property declaration with no type annotation or initializer, in noImplicitAny mode or a .js file.
-                // Use control flow analysis of this.xxx assignments in the constructor to determine the type of the property.
-                var constructor = findConstructorDeclaration(declaration.parent);
-                var type = constructor ? getFlowTypeInConstructor(declaration.symbol, constructor) :
-                    ts.getEffectiveModifierFlags(declaration) & 2 /* Ambient */ ? getTypeOfPropertyInBaseClass(declaration.symbol) :
-                        undefined;
-                return type && addOptionality(type, isOptional);
+                // Use control flow analysis of this.xxx assignments in the constructor or static block to determine the type of the property.
+                if (!ts.hasStaticModifier(declaration)) {
+                    var constructor = findConstructorDeclaration(declaration.parent);
+                    var type = constructor ? getFlowTypeInConstructor(declaration.symbol, constructor) :
+                        ts.getEffectiveModifierFlags(declaration) & 2 /* Ambient */ ? getTypeOfPropertyInBaseClass(declaration.symbol) :
+                            undefined;
+                    return type && addOptionality(type, /*isProperty*/ true, isOptional);
+                }
+                else {
+                    var staticBlocks = ts.filter(declaration.parent.members, ts.isClassStaticBlockDeclaration);
+                    var type = staticBlocks.length ? getFlowTypeInStaticBlocks(declaration.symbol, staticBlocks) :
+                        ts.getEffectiveModifierFlags(declaration) & 2 /* Ambient */ ? getTypeOfPropertyInBaseClass(declaration.symbol) :
+                            undefined;
+                    return type && addOptionality(type, /*isProperty*/ true, isOptional);
+                }
             }
             if (ts.isJsxAttribute(declaration)) {
                 // if JSX attribute doesn't have initializer, by default the attribute will have boolean value of true.
@@ -50979,7 +54327,7 @@ var ts;
                     links.isConstructorDeclaredProperty = !!getDeclaringConstructor(symbol) && ts.every(symbol.declarations, function (declaration) {
                         return ts.isBinaryExpression(declaration) &&
                             isPossiblyAliasedThisProperty(declaration) &&
-                            (declaration.left.kind !== 202 /* ElementAccessExpression */ || ts.isStringOrNumericLiteralLike(declaration.left.argumentExpression)) &&
+                            (declaration.left.kind !== 206 /* ElementAccessExpression */ || ts.isStringOrNumericLiteralLike(declaration.left.argumentExpression)) &&
                             !getAnnotatedTypeForAssignmentDeclaration(/*declaredType*/ undefined, declaration, symbol, declaration);
                     });
                 }
@@ -50995,13 +54343,54 @@ var ts;
                 !declaration.initializer && (noImplicitAny || ts.isInJSFile(declaration));
         }
         function getDeclaringConstructor(symbol) {
+            if (!symbol.declarations) {
+                return;
+            }
             for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
                 var declaration = _a[_i];
                 var container = ts.getThisContainer(declaration, /*includeArrowFunctions*/ false);
-                if (container && (container.kind === 166 /* Constructor */ || isJSConstructor(container))) {
+                if (container && (container.kind === 170 /* Constructor */ || isJSConstructor(container))) {
                     return container;
                 }
             }
+            ;
+        }
+        /** Create a synthetic property access flow node after the last statement of the file */
+        function getFlowTypeFromCommonJSExport(symbol) {
+            var file = ts.getSourceFileOfNode(symbol.declarations[0]);
+            var accessName = ts.unescapeLeadingUnderscores(symbol.escapedName);
+            var areAllModuleExports = symbol.declarations.every(function (d) { return ts.isInJSFile(d) && ts.isAccessExpression(d) && ts.isModuleExportsAccessExpression(d.expression); });
+            var reference = areAllModuleExports
+                ? ts.factory.createPropertyAccessExpression(ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier("module"), ts.factory.createIdentifier("exports")), accessName)
+                : ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier("exports"), accessName);
+            if (areAllModuleExports) {
+                ts.setParent(reference.expression.expression, reference.expression);
+            }
+            ts.setParent(reference.expression, reference);
+            ts.setParent(reference, file);
+            reference.flowNode = file.endFlowNode;
+            return getFlowTypeOfReference(reference, autoType, undefinedType);
+        }
+        function getFlowTypeInStaticBlocks(symbol, staticBlocks) {
+            var accessName = ts.startsWith(symbol.escapedName, "__#")
+                ? ts.factory.createPrivateIdentifier(symbol.escapedName.split("@")[1])
+                : ts.unescapeLeadingUnderscores(symbol.escapedName);
+            for (var _i = 0, staticBlocks_1 = staticBlocks; _i < staticBlocks_1.length; _i++) {
+                var staticBlock = staticBlocks_1[_i];
+                var reference = ts.factory.createPropertyAccessExpression(ts.factory.createThis(), accessName);
+                ts.setParent(reference.expression, reference);
+                ts.setParent(reference, staticBlock);
+                reference.flowNode = staticBlock.returnFlowNode;
+                var flowType = getFlowTypeOfProperty(reference, symbol);
+                if (noImplicitAny && (flowType === autoType || flowType === autoArrayType)) {
+                    error(symbol.valueDeclaration, ts.Diagnostics.Member_0_implicitly_has_an_1_type, symbolToString(symbol), typeToString(flowType));
+                }
+                // We don't infer a type if assignments are only null or undefined.
+                if (everyType(flowType, isNullableType)) {
+                    continue;
+                }
+                return convertAutoToAny(flowType);
+            }
         }
         function getFlowTypeInConstructor(symbol, constructor) {
             var accessName = ts.startsWith(symbol.escapedName, "__#")
@@ -51019,7 +54408,10 @@ var ts;
             return everyType(flowType, isNullableType) ? undefined : convertAutoToAny(flowType);
         }
         function getFlowTypeOfProperty(reference, prop) {
-            var initialType = prop && (!isAutoTypedProperty(prop) || ts.getEffectiveModifierFlags(prop.valueDeclaration) & 2 /* Ambient */) && getTypeOfPropertyInBaseClass(prop) || undefinedType;
+            var initialType = (prop === null || prop === void 0 ? void 0 : prop.valueDeclaration)
+                && (!isAutoTypedProperty(prop) || ts.getEffectiveModifierFlags(prop.valueDeclaration) & 2 /* Ambient */)
+                && getTypeOfPropertyInBaseClass(prop)
+                || undefinedType;
             return getFlowTypeOfReference(reference, autoType, initialType);
         }
         function getWidenedTypeForAssignmentDeclaration(symbol, resolvedSymbol) {
@@ -51030,7 +54422,7 @@ var ts;
                 if (tag && tag.typeExpression) {
                     return getTypeFromTypeNode(tag.typeExpression);
                 }
-                var containerObjectType = getJSContainerObjectType(symbol.valueDeclaration, symbol, container);
+                var containerObjectType = symbol.valueDeclaration && getJSContainerObjectType(symbol.valueDeclaration, symbol, container);
                 return containerObjectType || getWidenedLiteralType(checkExpressionCached(container));
             }
             var type;
@@ -51042,40 +54434,42 @@ var ts;
                 type = getFlowTypeInConstructor(symbol, getDeclaringConstructor(symbol));
             }
             if (!type) {
-                var jsdocType = void 0;
                 var types = void 0;
-                for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
-                    var declaration = _a[_i];
-                    var expression = (ts.isBinaryExpression(declaration) || ts.isCallExpression(declaration)) ? declaration :
-                        ts.isAccessExpression(declaration) ? ts.isBinaryExpression(declaration.parent) ? declaration.parent : declaration :
-                            undefined;
-                    if (!expression) {
-                        continue; // Non-assignment declaration merged in (eg, an Identifier to mark the thing as a namespace) - skip over it and pull type info from elsewhere
-                    }
-                    var kind = ts.isAccessExpression(expression)
-                        ? ts.getAssignmentDeclarationPropertyAccessKind(expression)
-                        : ts.getAssignmentDeclarationKind(expression);
-                    if (kind === 4 /* ThisProperty */ || ts.isBinaryExpression(expression) && isPossiblyAliasedThisProperty(expression, kind)) {
-                        if (isDeclarationInConstructor(expression)) {
-                            definedInConstructor = true;
+                if (symbol.declarations) {
+                    var jsdocType = void 0;
+                    for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
+                        var declaration = _a[_i];
+                        var expression = (ts.isBinaryExpression(declaration) || ts.isCallExpression(declaration)) ? declaration :
+                            ts.isAccessExpression(declaration) ? ts.isBinaryExpression(declaration.parent) ? declaration.parent : declaration :
+                                undefined;
+                        if (!expression) {
+                            continue; // Non-assignment declaration merged in (eg, an Identifier to mark the thing as a namespace) - skip over it and pull type info from elsewhere
+                        }
+                        var kind = ts.isAccessExpression(expression)
+                            ? ts.getAssignmentDeclarationPropertyAccessKind(expression)
+                            : ts.getAssignmentDeclarationKind(expression);
+                        if (kind === 4 /* ThisProperty */ || ts.isBinaryExpression(expression) && isPossiblyAliasedThisProperty(expression, kind)) {
+                            if (isDeclarationInConstructor(expression)) {
+                                definedInConstructor = true;
+                            }
+                            else {
+                                definedInMethod = true;
+                            }
                         }
-                        else {
-                            definedInMethod = true;
+                        if (!ts.isCallExpression(expression)) {
+                            jsdocType = getAnnotatedTypeForAssignmentDeclaration(jsdocType, expression, symbol, declaration);
+                        }
+                        if (!jsdocType) {
+                            (types || (types = [])).push((ts.isBinaryExpression(expression) || ts.isCallExpression(expression)) ? getInitializerTypeFromAssignmentDeclaration(symbol, resolvedSymbol, expression, kind) : neverType);
                         }
                     }
-                    if (!ts.isCallExpression(expression)) {
-                        jsdocType = getAnnotatedTypeForAssignmentDeclaration(jsdocType, expression, symbol, declaration);
-                    }
-                    if (!jsdocType) {
-                        (types || (types = [])).push((ts.isBinaryExpression(expression) || ts.isCallExpression(expression)) ? getInitializerTypeFromAssignmentDeclaration(symbol, resolvedSymbol, expression, kind) : neverType);
-                    }
+                    type = jsdocType;
                 }
-                type = jsdocType;
                 if (!type) {
                     if (!ts.length(types)) {
                         return errorType; // No types from any declarations :(
                     }
-                    var constructorTypes = definedInConstructor ? getConstructorDefinedThisAssignmentTypes(types, symbol.declarations) : undefined;
+                    var constructorTypes = definedInConstructor && symbol.declarations ? getConstructorDefinedThisAssignmentTypes(types, symbol.declarations) : undefined;
                     // use only the constructor types unless they were only assigned null | undefined (including widening variants)
                     if (definedInMethod) {
                         var propType = getTypeOfPropertyInBaseClass(symbol);
@@ -51088,8 +54482,8 @@ var ts;
                     type = getUnionType(sourceTypes, 2 /* Subtype */);
                 }
             }
-            var widened = getWidenedType(addOptionality(type, definedInMethod && !definedInConstructor));
-            if (filterType(widened, function (t) { return !!(t.flags & ~98304 /* Nullable */); }) === neverType) {
+            var widened = getWidenedType(addOptionality(type, /*isProperty*/ false, definedInMethod && !definedInConstructor));
+            if (symbol.valueDeclaration && filterType(widened, function (t) { return !!(t.flags & ~98304 /* Nullable */); }) === neverType) {
                 reportImplicitAny(symbol.valueDeclaration, anyType);
                 return anyType;
             }
@@ -51112,25 +54506,29 @@ var ts;
             if ((_b = s === null || s === void 0 ? void 0 : s.exports) === null || _b === void 0 ? void 0 : _b.size) {
                 mergeSymbolTable(exports, s.exports);
             }
-            var type = createAnonymousType(symbol, exports, ts.emptyArray, ts.emptyArray, undefined, undefined);
-            type.objectFlags |= 16384 /* JSLiteral */;
+            var type = createAnonymousType(symbol, exports, ts.emptyArray, ts.emptyArray, ts.emptyArray);
+            type.objectFlags |= 8192 /* JSLiteral */;
             return type;
         }
         function getAnnotatedTypeForAssignmentDeclaration(declaredType, expression, symbol, declaration) {
+            var _a;
             var typeNode = ts.getEffectiveTypeAnnotationNode(expression.parent);
             if (typeNode) {
                 var type = getWidenedType(getTypeFromTypeNode(typeNode));
                 if (!declaredType) {
                     return type;
                 }
-                else if (declaredType !== errorType && type !== errorType && !isTypeIdenticalTo(declaredType, type)) {
+                else if (!isErrorType(declaredType) && !isErrorType(type) && !isTypeIdenticalTo(declaredType, type)) {
                     errorNextVariableOrPropertyDeclarationMustHaveSameType(/*firstDeclaration*/ undefined, declaredType, declaration, type);
                 }
             }
-            if (symbol.parent) {
+            if ((_a = symbol.parent) === null || _a === void 0 ? void 0 : _a.valueDeclaration) {
                 var typeNode_2 = ts.getEffectiveTypeAnnotationNode(symbol.parent.valueDeclaration);
                 if (typeNode_2) {
-                    return getTypeOfPropertyOfType(getTypeFromTypeNode(typeNode_2), symbol.escapedName);
+                    var annotationSymbol = getPropertyOfType(getTypeFromTypeNode(typeNode_2), symbol.escapedName);
+                    if (annotationSymbol) {
+                        return getNonMissingTypeOfSymbol(annotationSymbol);
+                    }
                 }
             }
             return declaredType;
@@ -51191,7 +54589,7 @@ var ts;
                             // but we may have a JS file with `module.exports = { a: true }` along with a TypeScript module augmentation
                             // declaring an `export const a: number`. In that case, we issue a duplicate identifier error, because
                             // it's unclear what that's supposed to mean, so it's probably a mistake.
-                            if (ts.getSourceFileOfNode(s.valueDeclaration) !== ts.getSourceFileOfNode(exportedMember.valueDeclaration)) {
+                            if (s.valueDeclaration && exportedMember.valueDeclaration && ts.getSourceFileOfNode(s.valueDeclaration) !== ts.getSourceFileOfNode(exportedMember.valueDeclaration)) {
                                 var unescapedName = ts.unescapeLeadingUnderscores(s.escapedName);
                                 var exportedMemberName = ((_a = ts.tryCast(exportedMember.valueDeclaration, ts.isNamedDeclaration)) === null || _a === void 0 ? void 0 : _a.name) || exportedMember.valueDeclaration;
                                 ts.addRelatedInfo(error(s.valueDeclaration, ts.Diagnostics.Duplicate_identifier_0, unescapedName), ts.createDiagnosticForNode(exportedMemberName, ts.Diagnostics._0_was_also_declared_here, unescapedName));
@@ -51212,10 +54610,10 @@ var ts;
                     }
                 });
                 var result = createAnonymousType(initialSize !== members_4.size ? undefined : exportedType.symbol, // Only set the type's symbol if it looks to be the same as the original type
-                members_4, exportedType.callSignatures, exportedType.constructSignatures, exportedType.stringIndexInfo, exportedType.numberIndexInfo);
-                result.objectFlags |= (ts.getObjectFlags(type) & 16384 /* JSLiteral */); // Propagate JSLiteral flag
+                members_4, exportedType.callSignatures, exportedType.constructSignatures, exportedType.indexInfos);
+                result.objectFlags |= (ts.getObjectFlags(type) & 8192 /* JSLiteral */); // Propagate JSLiteral flag
                 if (result.symbol && result.symbol.flags & 32 /* Class */ && type === getDeclaredTypeOfClassOrInterface(result.symbol)) {
-                    result.objectFlags |= 1073741824 /* IsClassInstanceClone */; // Propagate the knowledge that this type is equivalent to the symbol's class instance type
+                    result.objectFlags |= 16777216 /* IsClassInstanceClone */; // Propagate the knowledge that this type is equivalent to the symbol's class instance type
                 }
                 return result;
             }
@@ -51227,16 +54625,16 @@ var ts;
         }
         function containsSameNamedThisProperty(thisProperty, expression) {
             return ts.isPropertyAccessExpression(thisProperty)
-                && thisProperty.expression.kind === 107 /* ThisKeyword */
+                && thisProperty.expression.kind === 108 /* ThisKeyword */
                 && ts.forEachChildRecursively(expression, function (n) { return isMatchingReference(thisProperty, n); });
         }
         function isDeclarationInConstructor(expression) {
             var thisContainer = ts.getThisContainer(expression, /*includeArrowFunctions*/ false);
             // Properties defined in a constructor (or base constructor, or javascript constructor function) don't get undefined added.
             // Function expressions that are assigned to the prototype count as methods.
-            return thisContainer.kind === 166 /* Constructor */ ||
-                thisContainer.kind === 251 /* FunctionDeclaration */ ||
-                (thisContainer.kind === 208 /* FunctionExpression */ && !ts.isPrototypePropertyAssignment(thisContainer.parent));
+            return thisContainer.kind === 170 /* Constructor */ ||
+                thisContainer.kind === 255 /* FunctionDeclaration */ ||
+                (thisContainer.kind === 212 /* FunctionExpression */ && !ts.isPrototypePropertyAssignment(thisContainer.parent));
         }
         function getConstructorDefinedThisAssignmentTypes(types, declarations) {
             ts.Debug.assert(types.length === declarations.length);
@@ -51274,11 +54672,11 @@ var ts;
         function getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) {
             var members = ts.createSymbolTable();
             var stringIndexInfo;
-            var objectFlags = 128 /* ObjectLiteral */ | 1048576 /* ContainsObjectOrArrayLiteral */;
+            var objectFlags = 128 /* ObjectLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */;
             ts.forEach(pattern.elements, function (e) {
                 var name = e.propertyName || e.name;
                 if (e.dotDotDotToken) {
-                    stringIndexInfo = createIndexInfo(anyType, /*isReadonly*/ false);
+                    stringIndexInfo = createIndexInfo(stringType, anyType, /*isReadonly*/ false);
                     return;
                 }
                 var exprType = getLiteralTypeFromPropertyName(name);
@@ -51294,11 +54692,11 @@ var ts;
                 symbol.bindingElement = e;
                 members.set(symbol.escapedName, symbol);
             });
-            var result = createAnonymousType(undefined, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, undefined);
+            var result = createAnonymousType(undefined, members, ts.emptyArray, ts.emptyArray, stringIndexInfo ? [stringIndexInfo] : ts.emptyArray);
             result.objectFlags |= objectFlags;
             if (includePatternInType) {
                 result.pattern = pattern;
-                result.objectFlags |= 1048576 /* ContainsObjectOrArrayLiteral */;
+                result.objectFlags |= 262144 /* ContainsObjectOrArrayLiteral */;
             }
             return result;
         }
@@ -51306,7 +54704,7 @@ var ts;
         function getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors) {
             var elements = pattern.elements;
             var lastElement = ts.lastOrUndefined(elements);
-            var restElement = lastElement && lastElement.kind === 198 /* BindingElement */ && lastElement.dotDotDotToken ? lastElement : undefined;
+            var restElement = lastElement && lastElement.kind === 202 /* BindingElement */ && lastElement.dotDotDotToken ? lastElement : undefined;
             if (elements.length === 0 || elements.length === 1 && restElement) {
                 return languageVersion >= 2 /* ES2015 */ ? createIterableType(anyType) : anyArrayType;
             }
@@ -51317,7 +54715,7 @@ var ts;
             if (includePatternInType) {
                 result = cloneTypeReference(result);
                 result.pattern = pattern;
-                result.objectFlags |= 1048576 /* ContainsObjectOrArrayLiteral */;
+                result.objectFlags |= 262144 /* ContainsObjectOrArrayLiteral */;
             }
             return result;
         }
@@ -51331,7 +54729,7 @@ var ts;
         function getTypeFromBindingPattern(pattern, includePatternInType, reportErrors) {
             if (includePatternInType === void 0) { includePatternInType = false; }
             if (reportErrors === void 0) { reportErrors = false; }
-            return pattern.kind === 196 /* ObjectBindingPattern */
+            return pattern.kind === 200 /* ObjectBindingPattern */
                 ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors)
                 : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors);
         }
@@ -51347,8 +54745,17 @@ var ts;
         function getWidenedTypeForVariableLikeDeclaration(declaration, reportErrors) {
             return widenTypeForVariableLikeDeclaration(getTypeForVariableLikeDeclaration(declaration, /*includeOptionality*/ true), declaration, reportErrors);
         }
+        function isGlobalSymbolConstructor(node) {
+            var symbol = getSymbolOfNode(node);
+            var globalSymbol = getGlobalESSymbolConstructorTypeSymbol(/*reportErrors*/ false);
+            return globalSymbol && symbol && symbol === globalSymbol;
+        }
         function widenTypeForVariableLikeDeclaration(type, declaration, reportErrors) {
             if (type) {
+                // TODO: If back compat with pre-3.0/4.0 libs isn't required, remove the following SymbolConstructor special case transforming `symbol` into `unique symbol`
+                if (type.flags & 4096 /* ESSymbol */ && isGlobalSymbolConstructor(declaration.parent)) {
+                    type = getESSymbolLikeTypeForNode(declaration);
+                }
                 if (reportErrors) {
                     reportErrorsFromWidening(declaration, type);
                 }
@@ -51370,7 +54777,7 @@ var ts;
         }
         function declarationBelongsToPrivateAmbientMember(declaration) {
             var root = ts.getRootDeclaration(declaration);
-            var memberDeclaration = root.kind === 160 /* Parameter */ ? root.parent : root;
+            var memberDeclaration = root.kind === 163 /* Parameter */ ? root.parent : root;
             return isPrivateWithinAmbient(memberDeclaration);
         }
         function tryGetTypeFromEffectiveTypeNode(declaration) {
@@ -51401,7 +54808,7 @@ var ts;
             if (symbol === requireSymbol) {
                 return anyType;
             }
-            if (symbol.flags & 134217728 /* ModuleExports */) {
+            if (symbol.flags & 134217728 /* ModuleExports */ && symbol.valueDeclaration) {
                 var fileSymbol = getSymbolOfNode(ts.getSourceFileOfNode(symbol.valueDeclaration));
                 var result = createSymbol(fileSymbol.flags, "exports");
                 result.declarations = fileSymbol.declarations ? fileSymbol.declarations.slice() : [];
@@ -51415,15 +54822,17 @@ var ts;
                     result.exports = new ts.Map(fileSymbol.exports);
                 var members = ts.createSymbolTable();
                 members.set("exports", result);
-                return createAnonymousType(symbol, members, ts.emptyArray, ts.emptyArray, undefined, undefined);
+                return createAnonymousType(symbol, members, ts.emptyArray, ts.emptyArray, ts.emptyArray);
             }
             // Handle catch clause variables
+            ts.Debug.assertIsDefined(symbol.valueDeclaration);
             var declaration = symbol.valueDeclaration;
             if (ts.isCatchClauseVariableDeclarationOrBindingElement(declaration)) {
-                var decl = declaration;
-                if (!decl.type)
-                    return anyType;
-                var type_1 = getTypeOfNode(decl.type);
+                var typeNode = ts.getEffectiveTypeAnnotationNode(declaration);
+                if (typeNode === undefined) {
+                    return useUnknownInCatchVariables ? unknownType : anyType;
+                }
+                var type_1 = getTypeOfNode(typeNode);
                 // an errorType will make `checkTryStatement` issue an error
                 return isTypeAny(type_1) || type_1 === unknownType ? type_1 : errorType;
             }
@@ -51443,8 +54852,8 @@ var ts;
                 return reportCircularityError(symbol);
             }
             var type;
-            if (declaration.kind === 266 /* ExportAssignment */) {
-                type = widenTypeForVariableLikeDeclaration(checkExpressionCached(declaration.expression), declaration);
+            if (declaration.kind === 270 /* ExportAssignment */) {
+                type = widenTypeForVariableLikeDeclaration(tryGetTypeFromEffectiveTypeNode(declaration) || checkExpressionCached(declaration.expression), declaration);
             }
             else if (ts.isBinaryExpression(declaration) ||
                 (ts.isInJSFile(declaration) &&
@@ -51498,7 +54907,7 @@ var ts;
                 type = getTypeOfEnumMember(symbol);
             }
             else if (ts.isAccessor(declaration)) {
-                type = resolveTypeOfAccessors(symbol);
+                type = resolveTypeOfAccessors(symbol) || ts.Debug.fail("Non-write accessor resolution must always produce a type");
             }
             else {
                 return ts.Debug.fail("Unhandled declaration kind! " + ts.Debug.formatSyntaxKind(declaration.kind) + " for " + ts.Debug.formatSymbol(symbol));
@@ -51514,7 +54923,7 @@ var ts;
         }
         function getAnnotatedAccessorTypeNode(accessor) {
             if (accessor) {
-                if (accessor.kind === 167 /* GetAccessor */) {
+                if (accessor.kind === 171 /* GetAccessor */) {
                     var getterTypeAnnotation = ts.getEffectiveReturnTypeNode(accessor);
                     return getterTypeAnnotation;
                 }
@@ -51538,63 +54947,78 @@ var ts;
         }
         function getTypeOfAccessors(symbol) {
             var links = getSymbolLinks(symbol);
-            return links.type || (links.type = getTypeOfAccessorsWorker(symbol));
+            return links.type || (links.type = getTypeOfAccessorsWorker(symbol) || ts.Debug.fail("Read type of accessor must always produce a type"));
+        }
+        function getTypeOfSetAccessor(symbol) {
+            var links = getSymbolLinks(symbol);
+            return links.writeType || (links.writeType = getTypeOfAccessorsWorker(symbol, /*writing*/ true));
         }
-        function getTypeOfAccessorsWorker(symbol) {
+        function getTypeOfAccessorsWorker(symbol, writing) {
+            if (writing === void 0) { writing = false; }
             if (!pushTypeResolution(symbol, 0 /* Type */)) {
                 return errorType;
             }
-            var type = resolveTypeOfAccessors(symbol);
+            var type = resolveTypeOfAccessors(symbol, writing);
             if (!popTypeResolution()) {
                 type = anyType;
                 if (noImplicitAny) {
-                    var getter = ts.getDeclarationOfKind(symbol, 167 /* GetAccessor */);
+                    var getter = ts.getDeclarationOfKind(symbol, 171 /* GetAccessor */);
                     error(getter, ts.Diagnostics._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, symbolToString(symbol));
                 }
             }
             return type;
         }
-        function resolveTypeOfAccessors(symbol) {
-            var getter = ts.getDeclarationOfKind(symbol, 167 /* GetAccessor */);
-            var setter = ts.getDeclarationOfKind(symbol, 168 /* SetAccessor */);
+        function resolveTypeOfAccessors(symbol, writing) {
+            if (writing === void 0) { writing = false; }
+            var getter = ts.getDeclarationOfKind(symbol, 171 /* GetAccessor */);
+            var setter = ts.getDeclarationOfKind(symbol, 172 /* SetAccessor */);
+            var setterType = getAnnotatedAccessorType(setter);
+            // For write operations, prioritize type annotations on the setter
+            if (writing && setterType) {
+                return instantiateTypeIfNeeded(setterType, symbol);
+            }
+            // Else defer to the getter type
             if (getter && ts.isInJSFile(getter)) {
                 var jsDocType = getTypeForDeclarationFromJSDocComment(getter);
                 if (jsDocType) {
-                    return jsDocType;
+                    return instantiateTypeIfNeeded(jsDocType, symbol);
                 }
             }
-            // First try to see if the user specified a return type on the get-accessor.
-            var getterReturnType = getAnnotatedAccessorType(getter);
-            if (getterReturnType) {
-                return getterReturnType;
+            // Try to see if the user specified a return type on the get-accessor.
+            var getterType = getAnnotatedAccessorType(getter);
+            if (getterType) {
+                return instantiateTypeIfNeeded(getterType, symbol);
             }
-            else {
-                // If the user didn't specify a return type, try to use the set-accessor's parameter type.
-                var setterParameterType = getAnnotatedAccessorType(setter);
-                if (setterParameterType) {
-                    return setterParameterType;
+            // If the user didn't specify a return type, try to use the set-accessor's parameter type.
+            if (setterType) {
+                return setterType;
+            }
+            // If there are no specified types, try to infer it from the body of the get accessor if it exists.
+            if (getter && getter.body) {
+                var returnTypeFromBody = getReturnTypeFromBody(getter);
+                return instantiateTypeIfNeeded(returnTypeFromBody, symbol);
+            }
+            // Otherwise, fall back to 'any'.
+            if (setter) {
+                if (!isPrivateWithinAmbient(setter)) {
+                    errorOrSuggestion(noImplicitAny, setter, ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation, symbolToString(symbol));
                 }
-                else {
-                    // If there are no specified types, try to infer it from the body of the get accessor if it exists.
-                    if (getter && getter.body) {
-                        return getReturnTypeFromBody(getter);
-                    }
-                    // Otherwise, fall back to 'any'.
-                    else {
-                        if (setter) {
-                            if (!isPrivateWithinAmbient(setter)) {
-                                errorOrSuggestion(noImplicitAny, setter, ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation, symbolToString(symbol));
-                            }
-                        }
-                        else {
-                            ts.Debug.assert(!!getter, "there must exist a getter as we are current checking either setter or getter in this function");
-                            if (!isPrivateWithinAmbient(getter)) {
-                                errorOrSuggestion(noImplicitAny, getter, ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation, symbolToString(symbol));
-                            }
-                        }
-                        return anyType;
-                    }
+                return anyType;
+            }
+            else if (getter) {
+                ts.Debug.assert(!!getter, "there must exist a getter as we are current checking either setter or getter in this function");
+                if (!isPrivateWithinAmbient(getter)) {
+                    errorOrSuggestion(noImplicitAny, getter, ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation, symbolToString(symbol));
+                }
+                return anyType;
+            }
+            return undefined;
+            function instantiateTypeIfNeeded(type, symbol) {
+                if (ts.getCheckFlags(symbol) & 1 /* Instantiated */) {
+                    var links = getSymbolLinks(symbol);
+                    return instantiateType(type, links.mapper);
                 }
+                return type;
             }
         }
         function getBaseTypeVariableOfClass(symbol) {
@@ -51624,9 +55048,9 @@ var ts;
             if (symbol.flags & 1536 /* Module */ && ts.isShorthandAmbientModuleSymbol(symbol)) {
                 return anyType;
             }
-            else if (declaration && (declaration.kind === 216 /* BinaryExpression */ ||
+            else if (declaration && (declaration.kind === 220 /* BinaryExpression */ ||
                 ts.isAccessExpression(declaration) &&
-                    declaration.parent.kind === 216 /* BinaryExpression */)) {
+                    declaration.parent.kind === 220 /* BinaryExpression */)) {
                 return getWidenedTypeForAssignmentDeclaration(symbol);
             }
             else if (symbol.flags & 512 /* ValueModule */ && declaration && ts.isSourceFile(declaration) && declaration.commonJsModuleIndicator) {
@@ -51660,14 +55084,18 @@ var ts;
             var links = getSymbolLinks(symbol);
             if (!links.type) {
                 var targetSymbol = resolveAlias(symbol);
+                var exportSymbol = symbol.declarations && getTargetOfAliasDeclaration(getDeclarationOfAliasSymbol(symbol), /*dontResolveAlias*/ true);
+                var declaredType = ts.firstDefined(exportSymbol === null || exportSymbol === void 0 ? void 0 : exportSymbol.declarations, function (d) { return ts.isExportAssignment(d) ? tryGetTypeFromEffectiveTypeNode(d) : undefined; });
                 // It only makes sense to get the type of a value symbol. If the result of resolving
                 // the alias is not a value, then it has no type. To get the type associated with a
                 // type symbol, call getDeclaredTypeOfSymbol.
                 // This check is important because without it, a call to getTypeOfSymbol could end
                 // up recursively calling getTypeOfAlias, causing a stack overflow.
-                links.type = targetSymbol.flags & 111551 /* Value */
-                    ? getTypeOfSymbol(targetSymbol)
-                    : errorType;
+                links.type = (exportSymbol === null || exportSymbol === void 0 ? void 0 : exportSymbol.declarations) && isDuplicatedCommonJSExport(exportSymbol.declarations) && symbol.declarations.length ? getFlowTypeFromCommonJSExport(exportSymbol)
+                    : isDuplicatedCommonJSExport(symbol.declarations) ? autoType
+                        : declaredType ? declaredType
+                            : targetSymbol.flags & 111551 /* Value */ ? getTypeOfSymbol(targetSymbol)
+                                : errorType;
             }
             return links.type;
         }
@@ -51693,7 +55121,7 @@ var ts;
                 return errorType;
             }
             // Check if variable has initializer that circularly references the variable itself
-            if (noImplicitAny && (declaration.kind !== 160 /* Parameter */ || declaration.initializer)) {
+            if (noImplicitAny && (declaration.kind !== 163 /* Parameter */ || declaration.initializer)) {
                 error(symbol.valueDeclaration, ts.Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString(symbol));
             }
             // Circularities could also result from parameters in function expressions that end up
@@ -51710,6 +55138,15 @@ var ts;
             }
             return links.type;
         }
+        function getSetAccessorTypeOfSymbol(symbol) {
+            if (symbol.flags & 98304 /* Accessor */) {
+                var type = getTypeOfSetAccessor(symbol);
+                if (type) {
+                    return type;
+                }
+            }
+            return getTypeOfSymbol(symbol);
+        }
         function getTypeOfSymbol(symbol) {
             var checkFlags = ts.getCheckFlags(symbol);
             if (checkFlags & 65536 /* DeferredType */) {
@@ -51741,6 +55178,9 @@ var ts;
             }
             return errorType;
         }
+        function getNonMissingTypeOfSymbol(symbol) {
+            return removeMissingType(getTypeOfSymbol(symbol), !!(symbol.flags & 16777216 /* Optional */));
+        }
         function isReferenceToType(type, target) {
             return type !== undefined
                 && target !== undefined
@@ -51792,66 +55232,72 @@ var ts;
                     return undefined;
                 }
                 switch (node.kind) {
-                    case 232 /* VariableStatement */:
-                    case 252 /* ClassDeclaration */:
-                    case 221 /* ClassExpression */:
-                    case 253 /* InterfaceDeclaration */:
-                    case 169 /* CallSignature */:
-                    case 170 /* ConstructSignature */:
-                    case 164 /* MethodSignature */:
-                    case 174 /* FunctionType */:
-                    case 175 /* ConstructorType */:
-                    case 308 /* JSDocFunctionType */:
-                    case 251 /* FunctionDeclaration */:
-                    case 165 /* MethodDeclaration */:
-                    case 208 /* FunctionExpression */:
-                    case 209 /* ArrowFunction */:
-                    case 254 /* TypeAliasDeclaration */:
-                    case 330 /* JSDocTemplateTag */:
-                    case 331 /* JSDocTypedefTag */:
-                    case 325 /* JSDocEnumTag */:
-                    case 324 /* JSDocCallbackTag */:
-                    case 190 /* MappedType */:
-                    case 184 /* ConditionalType */:
+                    case 256 /* ClassDeclaration */:
+                    case 225 /* ClassExpression */:
+                    case 257 /* InterfaceDeclaration */:
+                    case 173 /* CallSignature */:
+                    case 174 /* ConstructSignature */:
+                    case 167 /* MethodSignature */:
+                    case 178 /* FunctionType */:
+                    case 179 /* ConstructorType */:
+                    case 315 /* JSDocFunctionType */:
+                    case 255 /* FunctionDeclaration */:
+                    case 168 /* MethodDeclaration */:
+                    case 212 /* FunctionExpression */:
+                    case 213 /* ArrowFunction */:
+                    case 258 /* TypeAliasDeclaration */:
+                    case 342 /* JSDocTemplateTag */:
+                    case 343 /* JSDocTypedefTag */:
+                    case 337 /* JSDocEnumTag */:
+                    case 336 /* JSDocCallbackTag */:
+                    case 194 /* MappedType */:
+                    case 188 /* ConditionalType */: {
                         var outerTypeParameters = getOuterTypeParameters(node, includeThisTypes);
-                        if (node.kind === 190 /* MappedType */) {
+                        if (node.kind === 194 /* MappedType */) {
                             return ts.append(outerTypeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter)));
                         }
-                        else if (node.kind === 184 /* ConditionalType */) {
+                        else if (node.kind === 188 /* ConditionalType */) {
                             return ts.concatenate(outerTypeParameters, getInferTypeParameters(node));
                         }
-                        else if (node.kind === 232 /* VariableStatement */ && !ts.isInJSFile(node)) {
-                            break;
-                        }
                         var outerAndOwnTypeParameters = appendTypeParameters(outerTypeParameters, ts.getEffectiveTypeParameterDeclarations(node));
                         var thisType = includeThisTypes &&
-                            (node.kind === 252 /* ClassDeclaration */ || node.kind === 221 /* ClassExpression */ || node.kind === 253 /* InterfaceDeclaration */ || isJSConstructor(node)) &&
+                            (node.kind === 256 /* ClassDeclaration */ || node.kind === 225 /* ClassExpression */ || node.kind === 257 /* InterfaceDeclaration */ || isJSConstructor(node)) &&
                             getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType;
                         return thisType ? ts.append(outerAndOwnTypeParameters, thisType) : outerAndOwnTypeParameters;
-                    case 326 /* JSDocParameterTag */:
+                    }
+                    case 338 /* JSDocParameterTag */:
                         var paramSymbol = ts.getParameterSymbolFromJSDoc(node);
                         if (paramSymbol) {
                             node = paramSymbol.valueDeclaration;
                         }
                         break;
+                    case 318 /* JSDocComment */: {
+                        var outerTypeParameters = getOuterTypeParameters(node, includeThisTypes);
+                        return node.tags
+                            ? appendTypeParameters(outerTypeParameters, ts.flatMap(node.tags, function (t) { return ts.isJSDocTemplateTag(t) ? t.typeParameters : undefined; }))
+                            : outerTypeParameters;
+                    }
                 }
             }
         }
         // The outer type parameters are those defined by enclosing generic classes, methods, or functions.
         function getOuterTypeParametersOfClassOrInterface(symbol) {
-            var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 253 /* InterfaceDeclaration */);
+            var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 257 /* InterfaceDeclaration */);
             ts.Debug.assert(!!declaration, "Class was missing valueDeclaration -OR- non-class had no interface declarations");
             return getOuterTypeParameters(declaration);
         }
         // The local type parameters are the combined set of type parameters from all declarations of the class,
         // interface, or type alias.
         function getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol) {
+            if (!symbol.declarations) {
+                return;
+            }
             var result;
             for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
                 var node = _a[_i];
-                if (node.kind === 253 /* InterfaceDeclaration */ ||
-                    node.kind === 252 /* ClassDeclaration */ ||
-                    node.kind === 221 /* ClassExpression */ ||
+                if (node.kind === 257 /* InterfaceDeclaration */ ||
+                    node.kind === 256 /* ClassDeclaration */ ||
+                    node.kind === 225 /* ClassExpression */ ||
                     isJSConstructor(node) ||
                     ts.isTypeAlias(node)) {
                     var declaration = node;
@@ -51945,7 +55391,9 @@ var ts;
                                 ctorReturn = getReturnTypeOfSignature(ctorSig[0]);
                             }
                         }
-                        ts.addRelatedInfo(err, ts.createDiagnosticForNode(baseConstructorType.symbol.declarations[0], ts.Diagnostics.Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1, symbolToString(baseConstructorType.symbol), typeToString(ctorReturn)));
+                        if (baseConstructorType.symbol.declarations) {
+                            ts.addRelatedInfo(err, ts.createDiagnosticForNode(baseConstructorType.symbol.declarations[0], ts.Diagnostics.Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1, symbolToString(baseConstructorType.symbol), typeToString(ctorReturn)));
+                        }
                     }
                     return type.resolvedBaseConstructorType = errorType;
                 }
@@ -51955,20 +55403,22 @@ var ts;
         }
         function getImplementsTypes(type) {
             var resolvedImplementsTypes = ts.emptyArray;
-            for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) {
-                var declaration = _a[_i];
-                var implementsTypeNodes = ts.getEffectiveImplementsTypeNodes(declaration);
-                if (!implementsTypeNodes)
-                    continue;
-                for (var _b = 0, implementsTypeNodes_1 = implementsTypeNodes; _b < implementsTypeNodes_1.length; _b++) {
-                    var node = implementsTypeNodes_1[_b];
-                    var implementsType = getTypeFromTypeNode(node);
-                    if (implementsType !== errorType) {
-                        if (resolvedImplementsTypes === ts.emptyArray) {
-                            resolvedImplementsTypes = [implementsType];
-                        }
-                        else {
-                            resolvedImplementsTypes.push(implementsType);
+            if (type.symbol.declarations) {
+                for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) {
+                    var declaration = _a[_i];
+                    var implementsTypeNodes = ts.getEffectiveImplementsTypeNodes(declaration);
+                    if (!implementsTypeNodes)
+                        continue;
+                    for (var _b = 0, implementsTypeNodes_1 = implementsTypeNodes; _b < implementsTypeNodes_1.length; _b++) {
+                        var node = implementsTypeNodes_1[_b];
+                        var implementsType = getTypeFromTypeNode(node);
+                        if (!isErrorType(implementsType)) {
+                            if (resolvedImplementsTypes === ts.emptyArray) {
+                                resolvedImplementsTypes = [implementsType];
+                            }
+                            else {
+                                resolvedImplementsTypes.push(implementsType);
+                            }
                         }
                     }
                 }
@@ -51995,10 +55445,10 @@ var ts;
                     else {
                         ts.Debug.fail("type must be class or interface");
                     }
-                    if (!popTypeResolution()) {
+                    if (!popTypeResolution() && type.symbol.declarations) {
                         for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) {
                             var declaration = _a[_i];
-                            if (declaration.kind === 252 /* ClassDeclaration */ || declaration.kind === 253 /* InterfaceDeclaration */) {
+                            if (declaration.kind === 256 /* ClassDeclaration */ || declaration.kind === 257 /* InterfaceDeclaration */) {
                                 reportCircularBaseType(declaration, type);
                             }
                         }
@@ -52042,7 +55492,7 @@ var ts;
                 }
                 baseType = getReturnTypeOfSignature(constructors[0]);
             }
-            if (baseType === errorType) {
+            if (isErrorType(baseType)) {
                 return type.resolvedBaseTypes = ts.emptyArray;
             }
             var reducedBaseType = getReducedType(baseType);
@@ -52091,29 +55541,31 @@ var ts;
         }
         function resolveBaseTypesOfInterface(type) {
             type.resolvedBaseTypes = type.resolvedBaseTypes || ts.emptyArray;
-            for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) {
-                var declaration = _a[_i];
-                if (declaration.kind === 253 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) {
-                    for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) {
-                        var node = _c[_b];
-                        var baseType = getReducedType(getTypeFromTypeNode(node));
-                        if (baseType !== errorType) {
-                            if (isValidBaseType(baseType)) {
-                                if (type !== baseType && !hasBaseType(baseType, type)) {
-                                    if (type.resolvedBaseTypes === ts.emptyArray) {
-                                        type.resolvedBaseTypes = [baseType];
+            if (type.symbol.declarations) {
+                for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) {
+                    var declaration = _a[_i];
+                    if (declaration.kind === 257 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) {
+                        for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) {
+                            var node = _c[_b];
+                            var baseType = getReducedType(getTypeFromTypeNode(node));
+                            if (!isErrorType(baseType)) {
+                                if (isValidBaseType(baseType)) {
+                                    if (type !== baseType && !hasBaseType(baseType, type)) {
+                                        if (type.resolvedBaseTypes === ts.emptyArray) {
+                                            type.resolvedBaseTypes = [baseType];
+                                        }
+                                        else {
+                                            type.resolvedBaseTypes.push(baseType);
+                                        }
                                     }
                                     else {
-                                        type.resolvedBaseTypes.push(baseType);
+                                        reportCircularBaseType(declaration, type);
                                     }
                                 }
                                 else {
-                                    reportCircularBaseType(declaration, type);
+                                    error(node, ts.Diagnostics.An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members);
                                 }
                             }
-                            else {
-                                error(node, ts.Diagnostics.An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members);
-                            }
                         }
                     }
                 }
@@ -52127,9 +55579,12 @@ var ts;
          * and if none of the base interfaces have a "this" type.
          */
         function isThislessInterface(symbol) {
+            if (!symbol.declarations) {
+                return true;
+            }
             for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
                 var declaration = _a[_i];
-                if (declaration.kind === 253 /* InterfaceDeclaration */) {
+                if (declaration.kind === 257 /* InterfaceDeclaration */) {
                     if (declaration.flags & 128 /* ContainsThis */) {
                         return false;
                     }
@@ -52154,7 +55609,7 @@ var ts;
             var originalLinks = links;
             if (!links.declaredType) {
                 var kind = symbol.flags & 32 /* Class */ ? 1 /* Class */ : 2 /* Interface */;
-                var merged = mergeJSSymbols(symbol, getAssignedClassSymbol(symbol.valueDeclaration));
+                var merged = mergeJSSymbols(symbol, symbol.valueDeclaration && getAssignedClassSymbol(symbol.valueDeclaration));
                 if (merged) {
                     // note:we overwrite links because we just cloned the symbol
                     symbol = links = merged;
@@ -52184,6 +55639,7 @@ var ts;
             return links.declaredType;
         }
         function getDeclaredTypeOfTypeAlias(symbol) {
+            var _a;
             var links = getSymbolLinks(symbol);
             if (!links.declaredType) {
                 // Note that we use the links object as the target here because the symbol object is used as the unique
@@ -52191,7 +55647,7 @@ var ts;
                 if (!pushTypeResolution(symbol, 2 /* DeclaredType */)) {
                     return errorType;
                 }
-                var declaration = ts.Debug.checkDefined(ts.find(symbol.declarations, ts.isTypeAlias), "Type alias symbol with no valid declaration found");
+                var declaration = ts.Debug.checkDefined((_a = symbol.declarations) === null || _a === void 0 ? void 0 : _a.find(ts.isTypeAlias), "Type alias symbol with no valid declaration found");
                 var typeNode = ts.isJSDocTypeAlias(declaration) ? declaration.typeExpression : declaration.type;
                 // If typeNode is missing, we will error in checkJSDocTypedefTag.
                 var type = typeNode ? getTypeFromTypeNode(typeNode) : errorType;
@@ -52207,7 +55663,12 @@ var ts;
                 }
                 else {
                     type = errorType;
-                    error(ts.isNamedDeclaration(declaration) ? declaration.name : declaration || declaration, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol));
+                    if (declaration.kind === 337 /* JSDocEnumTag */) {
+                        error(declaration.typeExpression.type, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol));
+                    }
+                    else {
+                        error(ts.isNamedDeclaration(declaration) ? declaration.name : declaration || declaration, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol));
+                    }
                 }
                 links.declaredType = type;
             }
@@ -52217,7 +55678,7 @@ var ts;
             if (ts.isStringLiteralLike(expr)) {
                 return true;
             }
-            else if (expr.kind === 216 /* BinaryExpression */) {
+            else if (expr.kind === 220 /* BinaryExpression */) {
                 return isStringConcatExpression(expr.left) && isStringConcatExpression(expr.right);
             }
             return false;
@@ -52232,12 +55693,12 @@ var ts;
                 case 8 /* NumericLiteral */:
                 case 14 /* NoSubstitutionTemplateLiteral */:
                     return true;
-                case 214 /* PrefixUnaryExpression */:
+                case 218 /* PrefixUnaryExpression */:
                     return expr.operator === 40 /* MinusToken */ &&
                         expr.operand.kind === 8 /* NumericLiteral */;
-                case 78 /* Identifier */:
+                case 79 /* Identifier */:
                     return ts.nodeIsMissing(expr) || !!getSymbolOfNode(member.parent).exports.get(expr.escapedText);
-                case 216 /* BinaryExpression */:
+                case 220 /* BinaryExpression */:
                     return isStringConcatExpression(expr);
                 default:
                     return false;
@@ -52249,16 +55710,18 @@ var ts;
                 return links.enumKind;
             }
             var hasNonLiteralMember = false;
-            for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
-                var declaration = _a[_i];
-                if (declaration.kind === 255 /* EnumDeclaration */) {
-                    for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) {
-                        var member = _c[_b];
-                        if (member.initializer && ts.isStringLiteralLike(member.initializer)) {
-                            return links.enumKind = 1 /* Literal */;
-                        }
-                        if (!isLiteralEnumMember(member)) {
-                            hasNonLiteralMember = true;
+            if (symbol.declarations) {
+                for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
+                    var declaration = _a[_i];
+                    if (declaration.kind === 259 /* EnumDeclaration */) {
+                        for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) {
+                            var member = _c[_b];
+                            if (member.initializer && ts.isStringLiteralLike(member.initializer)) {
+                                return links.enumKind = 1 /* Literal */;
+                            }
+                            if (!isLiteralEnumMember(member)) {
+                                hasNonLiteralMember = true;
+                            }
                         }
                     }
                 }
@@ -52276,15 +55739,17 @@ var ts;
             if (getEnumKind(symbol) === 1 /* Literal */) {
                 enumCount++;
                 var memberTypeList = [];
-                for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
-                    var declaration = _a[_i];
-                    if (declaration.kind === 255 /* EnumDeclaration */) {
-                        for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) {
-                            var member = _c[_b];
-                            var value = getEnumMemberValue(member);
-                            var memberType = getFreshTypeOfLiteralType(getLiteralType(value !== undefined ? value : 0, enumCount, getSymbolOfNode(member)));
-                            getSymbolLinks(getSymbolOfNode(member)).declaredType = memberType;
-                            memberTypeList.push(getRegularTypeOfLiteralType(memberType));
+                if (symbol.declarations) {
+                    for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
+                        var declaration = _a[_i];
+                        if (declaration.kind === 259 /* EnumDeclaration */) {
+                            for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) {
+                                var member = _c[_b];
+                                var value = getEnumMemberValue(member);
+                                var memberType = getFreshTypeOfLiteralType(getEnumLiteralType(value !== undefined ? value : 0, enumCount, getSymbolOfNode(member)));
+                                getSymbolLinks(getSymbolOfNode(member)).declaredType = memberType;
+                                memberTypeList.push(getRegularTypeOfLiteralType(memberType));
+                            }
                         }
                     }
                 }
@@ -52350,22 +55815,22 @@ var ts;
          */
         function isThislessType(node) {
             switch (node.kind) {
-                case 128 /* AnyKeyword */:
-                case 152 /* UnknownKeyword */:
-                case 147 /* StringKeyword */:
-                case 144 /* NumberKeyword */:
-                case 155 /* BigIntKeyword */:
-                case 131 /* BooleanKeyword */:
-                case 148 /* SymbolKeyword */:
-                case 145 /* ObjectKeyword */:
-                case 113 /* VoidKeyword */:
-                case 150 /* UndefinedKeyword */:
-                case 141 /* NeverKeyword */:
-                case 191 /* LiteralType */:
+                case 130 /* AnyKeyword */:
+                case 154 /* UnknownKeyword */:
+                case 149 /* StringKeyword */:
+                case 146 /* NumberKeyword */:
+                case 157 /* BigIntKeyword */:
+                case 133 /* BooleanKeyword */:
+                case 150 /* SymbolKeyword */:
+                case 147 /* ObjectKeyword */:
+                case 114 /* VoidKeyword */:
+                case 152 /* UndefinedKeyword */:
+                case 143 /* NeverKeyword */:
+                case 195 /* LiteralType */:
                     return true;
-                case 178 /* ArrayType */:
+                case 182 /* ArrayType */:
                     return isThislessType(node.elementType);
-                case 173 /* TypeReference */:
+                case 177 /* TypeReference */:
                     return !node.typeArguments || node.typeArguments.every(isThislessType);
             }
             return false;
@@ -52391,7 +55856,7 @@ var ts;
         function isThislessFunctionLikeDeclaration(node) {
             var returnType = ts.getEffectiveReturnTypeNode(node);
             var typeParameters = ts.getEffectiveTypeParameterDeclarations(node);
-            return (node.kind === 166 /* Constructor */ || (!!returnType && isThislessType(returnType))) &&
+            return (node.kind === 170 /* Constructor */ || (!!returnType && isThislessType(returnType))) &&
                 node.parameters.every(isThislessVariableLikeDeclaration) &&
                 typeParameters.every(isThislessTypeParameter);
         }
@@ -52407,14 +55872,14 @@ var ts;
                 var declaration = symbol.declarations[0];
                 if (declaration) {
                     switch (declaration.kind) {
-                        case 163 /* PropertyDeclaration */:
-                        case 162 /* PropertySignature */:
+                        case 166 /* PropertyDeclaration */:
+                        case 165 /* PropertySignature */:
                             return isThislessVariableLikeDeclaration(declaration);
-                        case 165 /* MethodDeclaration */:
-                        case 164 /* MethodSignature */:
-                        case 166 /* Constructor */:
-                        case 167 /* GetAccessor */:
-                        case 168 /* SetAccessor */:
+                        case 168 /* MethodDeclaration */:
+                        case 167 /* MethodSignature */:
+                        case 170 /* Constructor */:
+                        case 171 /* GetAccessor */:
+                        case 172 /* SetAccessor */:
                             return isThislessFunctionLikeDeclaration(declaration);
                     }
                 }
@@ -52440,7 +55905,7 @@ var ts;
             }
         }
         function isStaticPrivateIdentifierProperty(s) {
-            return !!s.valueDeclaration && ts.isPrivateIdentifierPropertyDeclaration(s.valueDeclaration) && ts.hasSyntacticModifier(s.valueDeclaration, 32 /* Static */);
+            return !!s.valueDeclaration && ts.isPrivateIdentifierClassElementDeclaration(s.valueDeclaration) && ts.isStatic(s.valueDeclaration);
         }
         function resolveDeclaredMembers(type) {
             if (!type.declaredProperties) {
@@ -52450,10 +55915,10 @@ var ts;
                 // Start with signatures at empty array in case of recursive types
                 type.declaredCallSignatures = ts.emptyArray;
                 type.declaredConstructSignatures = ts.emptyArray;
+                type.declaredIndexInfos = ts.emptyArray;
                 type.declaredCallSignatures = getSignaturesOfSymbol(members.get("__call" /* Call */));
                 type.declaredConstructSignatures = getSignaturesOfSymbol(members.get("__new" /* New */));
-                type.declaredStringIndexInfo = getIndexInfoOfSymbol(symbol, 0 /* String */);
-                type.declaredNumberIndexInfo = getIndexInfoOfSymbol(symbol, 1 /* Number */);
+                type.declaredIndexInfos = getIndexInfosOfSymbol(symbol);
             }
             return type;
         }
@@ -52527,7 +55992,7 @@ var ts;
             if (!symbol.declarations) {
                 symbol.declarations = [member];
             }
-            else {
+            else if (!member.symbol.isReplaceableByMethod) {
                 symbol.declarations.push(member);
             }
             if (symbolFlags & 111551 /* Value */) {
@@ -52609,8 +56074,8 @@ var ts;
         function getResolvedMembersOrExportsOfSymbol(symbol, resolutionKind) {
             var links = getSymbolLinks(symbol);
             if (!links[resolutionKind]) {
-                var isStatic = resolutionKind === "resolvedExports" /* resolvedExports */;
-                var earlySymbols = !isStatic ? symbol.members :
+                var isStatic_1 = resolutionKind === "resolvedExports" /* resolvedExports */;
+                var earlySymbols = !isStatic_1 ? symbol.members :
                     symbol.flags & 1536 /* Module */ ? getExportsOfModuleWorker(symbol) :
                         symbol.exports;
                 // In the event we recursively resolve the members/exports of the symbol, we
@@ -52625,7 +56090,7 @@ var ts;
                     if (members) {
                         for (var _b = 0, members_5 = members; _b < members_5.length; _b++) {
                             var member = members_5[_b];
-                            if (isStatic === ts.hasStaticModifier(member) && hasLateBindableName(member)) {
+                            if (isStatic_1 === ts.hasStaticModifier(member) && hasLateBindableName(member)) {
                                 lateBindMember(symbol, earlySymbols, lateSymbols, member);
                             }
                         }
@@ -52641,7 +56106,7 @@ var ts;
                             || ts.isBinaryExpression(member) && isPossiblyAliasedThisProperty(member, assignmentKind)
                             || assignmentKind === 9 /* ObjectDefinePrototypeProperty */
                             || assignmentKind === 6 /* Prototype */; // A straight `Prototype` assignment probably can never have a computed name
-                        if (isStatic === !isInstanceMember && hasLateBindableName(member)) {
+                        if (isStatic_1 === !isInstanceMember && hasLateBindableName(member)) {
                             lateBindMember(symbol, earlySymbols, lateSymbols, member);
                         }
                     }
@@ -52703,29 +56168,26 @@ var ts;
             var members;
             var callSignatures;
             var constructSignatures;
-            var stringIndexInfo;
-            var numberIndexInfo;
+            var indexInfos;
             if (ts.rangeEquals(typeParameters, typeArguments, 0, typeParameters.length)) {
                 members = source.symbol ? getMembersOfSymbol(source.symbol) : ts.createSymbolTable(source.declaredProperties);
                 callSignatures = source.declaredCallSignatures;
                 constructSignatures = source.declaredConstructSignatures;
-                stringIndexInfo = source.declaredStringIndexInfo;
-                numberIndexInfo = source.declaredNumberIndexInfo;
+                indexInfos = source.declaredIndexInfos;
             }
             else {
                 mapper = createTypeMapper(typeParameters, typeArguments);
                 members = createInstantiatedSymbolTable(source.declaredProperties, mapper, /*mappingThisOnly*/ typeParameters.length === 1);
                 callSignatures = instantiateSignatures(source.declaredCallSignatures, mapper);
                 constructSignatures = instantiateSignatures(source.declaredConstructSignatures, mapper);
-                stringIndexInfo = instantiateIndexInfo(source.declaredStringIndexInfo, mapper);
-                numberIndexInfo = instantiateIndexInfo(source.declaredNumberIndexInfo, mapper);
+                indexInfos = instantiateIndexInfos(source.declaredIndexInfos, mapper);
             }
             var baseTypes = getBaseTypes(source);
             if (baseTypes.length) {
                 if (source.symbol && members === getMembersOfSymbol(source.symbol)) {
                     members = ts.createSymbolTable(source.declaredProperties);
                 }
-                setStructuredTypeMembers(type, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo);
+                setStructuredTypeMembers(type, members, callSignatures, constructSignatures, indexInfos);
                 var thisArgument = ts.lastOrUndefined(typeArguments);
                 for (var _i = 0, baseTypes_1 = baseTypes; _i < baseTypes_1.length; _i++) {
                     var baseType = baseTypes_1[_i];
@@ -52733,15 +56195,11 @@ var ts;
                     addInheritedMembers(members, getPropertiesOfType(instantiatedBaseType));
                     callSignatures = ts.concatenate(callSignatures, getSignaturesOfType(instantiatedBaseType, 0 /* Call */));
                     constructSignatures = ts.concatenate(constructSignatures, getSignaturesOfType(instantiatedBaseType, 1 /* Construct */));
-                    if (!stringIndexInfo) {
-                        stringIndexInfo = instantiatedBaseType === anyType ?
-                            createIndexInfo(anyType, /*isReadonly*/ false) :
-                            getIndexInfoOfType(instantiatedBaseType, 0 /* String */);
-                    }
-                    numberIndexInfo = numberIndexInfo || getIndexInfoOfType(instantiatedBaseType, 1 /* Number */);
+                    var inheritedIndexInfos = instantiatedBaseType !== anyType ? getIndexInfosOfType(instantiatedBaseType) : [createIndexInfo(stringType, anyType, /*isReadonly*/ false)];
+                    indexInfos = ts.concatenate(indexInfos, ts.filter(inheritedIndexInfos, function (info) { return !findIndexInfo(indexInfos, info.keyType); }));
                 }
             }
-            setStructuredTypeMembers(type, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo);
+            setStructuredTypeMembers(type, members, callSignatures, constructSignatures, indexInfos);
         }
         function resolveClassOrInterfaceMembers(type) {
             resolveObjectTypeMembers(type, resolveDeclaredMembers(type), ts.emptyArray, ts.emptyArray);
@@ -52765,7 +56223,8 @@ var ts;
             sig.resolvedMinArgumentCount = undefined;
             sig.target = undefined;
             sig.mapper = undefined;
-            sig.unionSignatures = undefined;
+            sig.compositeSignatures = undefined;
+            sig.compositeKind = undefined;
             return sig;
         }
         function cloneSignature(sig) {
@@ -52773,12 +56232,14 @@ var ts;
             /*resolvedTypePredicate*/ undefined, sig.minArgumentCount, sig.flags & 39 /* PropagatingFlags */);
             result.target = sig.target;
             result.mapper = sig.mapper;
-            result.unionSignatures = sig.unionSignatures;
+            result.compositeSignatures = sig.compositeSignatures;
+            result.compositeKind = sig.compositeKind;
             return result;
         }
         function createUnionSignature(signature, unionSignatures) {
             var result = cloneSignature(signature);
-            result.unionSignatures = unionSignatures;
+            result.compositeSignatures = unionSignatures;
+            result.compositeKind = 1048576 /* Union */;
             result.target = undefined;
             result.mapper = undefined;
             return result;
@@ -52937,7 +56398,7 @@ var ts;
                     if (signatures !== masterList) {
                         var signature_1 = signatures[0];
                         ts.Debug.assert(!!signature_1, "getUnionSignatures bails early on empty signature lists and should not have empty lists on second pass");
-                        results = signature_1.typeParameters && ts.some(results, function (s) { return !!s.typeParameters && !compareTypeParametersIdentical(signature_1.typeParameters, s.typeParameters); }) ? undefined : ts.map(results, function (sig) { return combineSignaturesOfUnionMembers(sig, signature_1); });
+                        results = !!signature_1.typeParameters && ts.some(results, function (s) { return !!s.typeParameters && !compareTypeParametersIdentical(signature_1.typeParameters, s.typeParameters); }) ? undefined : ts.map(results, function (sig) { return combineSignaturesOfUnionMembers(sig, signature_1); });
                         if (!results) {
                             return "break";
                         }
@@ -52954,9 +56415,12 @@ var ts;
             return result || ts.emptyArray;
         }
         function compareTypeParametersIdentical(sourceParams, targetParams) {
-            if (sourceParams.length !== targetParams.length) {
+            if (ts.length(sourceParams) !== ts.length(targetParams)) {
                 return false;
             }
+            if (!sourceParams || !targetParams) {
+                return true;
+            }
             var mapper = createTypeMapper(targetParams, sourceParams);
             for (var i = 0; i < sourceParams.length; i++) {
                 var source = sourceParams[i];
@@ -53010,7 +56474,7 @@ var ts;
                     !leftName ? rightName :
                         !rightName ? leftName :
                             undefined;
-                var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), paramName || "arg" + i);
+                var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), paramName || "arg".concat(i));
                 paramSymbol.type = isRestParam ? createArrayType(unionParamType) : unionParamType;
                 params[i] = paramSymbol;
             }
@@ -53038,44 +56502,42 @@ var ts;
             var result = createSignature(declaration, typeParams, thisParam, params, 
             /*resolvedReturnType*/ undefined, 
             /*resolvedTypePredicate*/ undefined, minArgCount, (left.flags | right.flags) & 39 /* PropagatingFlags */);
-            result.unionSignatures = ts.concatenate(left.unionSignatures || [left], [right]);
+            result.compositeKind = 1048576 /* Union */;
+            result.compositeSignatures = ts.concatenate(left.compositeKind !== 2097152 /* Intersection */ && left.compositeSignatures || [left], [right]);
             if (paramMapper) {
-                result.mapper = left.mapper && left.unionSignatures ? combineTypeMappers(left.mapper, paramMapper) : paramMapper;
+                result.mapper = left.compositeKind !== 2097152 /* Intersection */ && left.mapper && left.compositeSignatures ? combineTypeMappers(left.mapper, paramMapper) : paramMapper;
             }
             return result;
         }
-        function getUnionIndexInfo(types, kind) {
-            var indexTypes = [];
-            var isAnyReadonly = false;
-            for (var _i = 0, types_4 = types; _i < types_4.length; _i++) {
-                var type = types_4[_i];
-                var indexInfo = getIndexInfoOfType(getApparentType(type), kind);
-                if (!indexInfo) {
-                    return undefined;
+        function getUnionIndexInfos(types) {
+            var sourceInfos = getIndexInfosOfType(types[0]);
+            if (sourceInfos) {
+                var result = [];
+                var _loop_11 = function (info) {
+                    var indexType = info.keyType;
+                    if (ts.every(types, function (t) { return !!getIndexInfoOfType(t, indexType); })) {
+                        result.push(createIndexInfo(indexType, getUnionType(ts.map(types, function (t) { return getIndexTypeOfType(t, indexType); })), ts.some(types, function (t) { return getIndexInfoOfType(t, indexType).isReadonly; })));
+                    }
+                };
+                for (var _i = 0, sourceInfos_1 = sourceInfos; _i < sourceInfos_1.length; _i++) {
+                    var info = sourceInfos_1[_i];
+                    _loop_11(info);
                 }
-                indexTypes.push(indexInfo.type);
-                isAnyReadonly = isAnyReadonly || indexInfo.isReadonly;
+                return result;
             }
-            return createIndexInfo(getUnionType(indexTypes, 2 /* Subtype */), isAnyReadonly);
+            return ts.emptyArray;
         }
         function resolveUnionTypeMembers(type) {
             // The members and properties collections are empty for union types. To get all properties of a union
             // type use getPropertiesOfType (only the language service uses this).
             var callSignatures = getUnionSignatures(ts.map(type.types, function (t) { return t === globalFunctionType ? [unknownSignature] : getSignaturesOfType(t, 0 /* Call */); }));
             var constructSignatures = getUnionSignatures(ts.map(type.types, function (t) { return getSignaturesOfType(t, 1 /* Construct */); }));
-            var stringIndexInfo = getUnionIndexInfo(type.types, 0 /* String */);
-            var numberIndexInfo = getUnionIndexInfo(type.types, 1 /* Number */);
-            setStructuredTypeMembers(type, emptySymbols, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo);
+            var indexInfos = getUnionIndexInfos(type.types);
+            setStructuredTypeMembers(type, emptySymbols, callSignatures, constructSignatures, indexInfos);
         }
         function intersectTypes(type1, type2) {
             return !type1 ? type2 : !type2 ? type1 : getIntersectionType([type1, type2]);
         }
-        function intersectIndexInfos(info1, info2) {
-            return !info1 ? info2 : !info2 ? info1 : createIndexInfo(getIntersectionType([info1.type, info2.type]), info1.isReadonly && info2.isReadonly);
-        }
-        function unionSpreadIndexInfos(info1, info2) {
-            return info1 && info2 && createIndexInfo(getUnionType([info1.type, info2.type]), info1.isReadonly || info2.isReadonly);
-        }
         function findMixins(types) {
             var constructorTypeCount = ts.countWhere(types, function (t) { return getSignaturesOfType(t, 1 /* Construct */).length > 0; });
             var mixinFlags = ts.map(types, isMixinConstructorType);
@@ -53102,12 +56564,11 @@ var ts;
             // intersection type use getPropertiesOfType (only the language service uses this).
             var callSignatures;
             var constructSignatures;
-            var stringIndexInfo;
-            var numberIndexInfo;
+            var indexInfos;
             var types = type.types;
             var mixinFlags = findMixins(types);
             var mixinCount = ts.countWhere(mixinFlags, function (b) { return b; });
-            var _loop_11 = function (i) {
+            var _loop_12 = function (i) {
                 var t = type.types[i];
                 // When an intersection type contains mixin constructor types, the construct signatures from
                 // those types are discarded and their return types are mixed into the return types of all
@@ -53126,53 +56587,62 @@ var ts;
                     constructSignatures = appendSignatures(constructSignatures, signatures);
                 }
                 callSignatures = appendSignatures(callSignatures, getSignaturesOfType(t, 0 /* Call */));
-                stringIndexInfo = intersectIndexInfos(stringIndexInfo, getIndexInfoOfType(t, 0 /* String */));
-                numberIndexInfo = intersectIndexInfos(numberIndexInfo, getIndexInfoOfType(t, 1 /* Number */));
+                indexInfos = ts.reduceLeft(getIndexInfosOfType(t), function (infos, newInfo) { return appendIndexInfo(infos, newInfo, /*union*/ false); }, indexInfos);
             };
             for (var i = 0; i < types.length; i++) {
-                _loop_11(i);
+                _loop_12(i);
             }
-            setStructuredTypeMembers(type, emptySymbols, callSignatures || ts.emptyArray, constructSignatures || ts.emptyArray, stringIndexInfo, numberIndexInfo);
+            setStructuredTypeMembers(type, emptySymbols, callSignatures || ts.emptyArray, constructSignatures || ts.emptyArray, indexInfos || ts.emptyArray);
         }
         function appendSignatures(signatures, newSignatures) {
-            var _loop_12 = function (sig) {
+            var _loop_13 = function (sig) {
                 if (!signatures || ts.every(signatures, function (s) { return !compareSignaturesIdentical(s, sig, /*partialMatch*/ false, /*ignoreThisTypes*/ false, /*ignoreReturnTypes*/ false, compareTypesIdentical); })) {
                     signatures = ts.append(signatures, sig);
                 }
             };
             for (var _i = 0, newSignatures_1 = newSignatures; _i < newSignatures_1.length; _i++) {
                 var sig = newSignatures_1[_i];
-                _loop_12(sig);
+                _loop_13(sig);
             }
             return signatures;
         }
+        function appendIndexInfo(indexInfos, newInfo, union) {
+            if (indexInfos) {
+                for (var i = 0; i < indexInfos.length; i++) {
+                    var info = indexInfos[i];
+                    if (info.keyType === newInfo.keyType) {
+                        indexInfos[i] = createIndexInfo(info.keyType, union ? getUnionType([info.type, newInfo.type]) : getIntersectionType([info.type, newInfo.type]), union ? info.isReadonly || newInfo.isReadonly : info.isReadonly && newInfo.isReadonly);
+                        return indexInfos;
+                    }
+                }
+            }
+            return ts.append(indexInfos, newInfo);
+        }
         /**
          * Converts an AnonymousType to a ResolvedType.
          */
         function resolveAnonymousTypeMembers(type) {
             var symbol = getMergedSymbol(type.symbol);
             if (type.target) {
-                setStructuredTypeMembers(type, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);
+                setStructuredTypeMembers(type, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
                 var members = createInstantiatedSymbolTable(getPropertiesOfObjectType(type.target), type.mapper, /*mappingThisOnly*/ false);
                 var callSignatures = instantiateSignatures(getSignaturesOfType(type.target, 0 /* Call */), type.mapper);
                 var constructSignatures = instantiateSignatures(getSignaturesOfType(type.target, 1 /* Construct */), type.mapper);
-                var stringIndexInfo = instantiateIndexInfo(getIndexInfoOfType(type.target, 0 /* String */), type.mapper);
-                var numberIndexInfo = instantiateIndexInfo(getIndexInfoOfType(type.target, 1 /* Number */), type.mapper);
-                setStructuredTypeMembers(type, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo);
+                var indexInfos = instantiateIndexInfos(getIndexInfosOfType(type.target), type.mapper);
+                setStructuredTypeMembers(type, members, callSignatures, constructSignatures, indexInfos);
             }
             else if (symbol.flags & 2048 /* TypeLiteral */) {
-                setStructuredTypeMembers(type, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);
+                setStructuredTypeMembers(type, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
                 var members = getMembersOfSymbol(symbol);
                 var callSignatures = getSignaturesOfSymbol(members.get("__call" /* Call */));
                 var constructSignatures = getSignaturesOfSymbol(members.get("__new" /* New */));
-                var stringIndexInfo = getIndexInfoOfSymbol(symbol, 0 /* String */);
-                var numberIndexInfo = getIndexInfoOfSymbol(symbol, 1 /* Number */);
-                setStructuredTypeMembers(type, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo);
+                var indexInfos = getIndexInfosOfSymbol(symbol);
+                setStructuredTypeMembers(type, members, callSignatures, constructSignatures, indexInfos);
             }
             else {
                 // Combinations of function, class, enum and module
                 var members = emptySymbols;
-                var stringIndexInfo = void 0;
+                var indexInfos = void 0;
                 if (symbol.exports) {
                     members = getExportsOfSymbol(symbol);
                     if (symbol === globalThisSymbol) {
@@ -53185,21 +56655,33 @@ var ts;
                         members = varsOnly_1;
                     }
                 }
-                setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, undefined, undefined);
+                var baseConstructorIndexInfo = void 0;
+                setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, ts.emptyArray);
                 if (symbol.flags & 32 /* Class */) {
                     var classType = getDeclaredTypeOfClassOrInterface(symbol);
                     var baseConstructorType = getBaseConstructorTypeOfClass(classType);
                     if (baseConstructorType.flags & (524288 /* Object */ | 2097152 /* Intersection */ | 8650752 /* TypeVariable */)) {
-                        members = ts.createSymbolTable(getNamedMembers(members));
+                        members = ts.createSymbolTable(getNamedOrIndexSignatureMembers(members));
                         addInheritedMembers(members, getPropertiesOfType(baseConstructorType));
                     }
                     else if (baseConstructorType === anyType) {
-                        stringIndexInfo = createIndexInfo(anyType, /*isReadonly*/ false);
+                        baseConstructorIndexInfo = createIndexInfo(stringType, anyType, /*isReadonly*/ false);
+                    }
+                }
+                var indexSymbol = getIndexSymbolFromSymbolTable(members);
+                if (indexSymbol) {
+                    indexInfos = getIndexInfosOfIndexSymbol(indexSymbol);
+                }
+                else {
+                    if (baseConstructorIndexInfo) {
+                        indexInfos = ts.append(indexInfos, baseConstructorIndexInfo);
+                    }
+                    if (symbol.flags & 384 /* Enum */ && (getDeclaredTypeOfSymbol(symbol).flags & 32 /* Enum */ ||
+                        ts.some(type.properties, function (prop) { return !!(getTypeOfSymbol(prop).flags & 296 /* NumberLike */); }))) {
+                        indexInfos = ts.append(indexInfos, enumNumberIndexInfo);
                     }
                 }
-                var numberIndexInfo = symbol.flags & 384 /* Enum */ && (getDeclaredTypeOfSymbol(symbol).flags & 32 /* Enum */ ||
-                    ts.some(type.properties, function (prop) { return !!(getTypeOfSymbol(prop).flags & 296 /* NumberLike */); })) ? enumNumberIndexInfo : undefined;
-                setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, numberIndexInfo);
+                setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, indexInfos || ts.emptyArray);
                 // We resolve the members before computing the signatures because a signature may use
                 // typeof with a qualified name expression that circularly references the type we are
                 // in the process of resolving (see issue #6072). The temporarily empty signature list
@@ -53223,12 +56705,18 @@ var ts;
                 }
             }
         }
+        function replaceIndexedAccess(instantiable, type, replacement) {
+            // map type.indexType to 0
+            // map type.objectType to `[TReplacement]`
+            // thus making the indexed access `[TReplacement][0]` or `TReplacement`
+            return instantiateType(instantiable, createTypeMapper([type.indexType, type.objectType], [getNumberLiteralType(0), createTupleType([replacement])]));
+        }
         function resolveReverseMappedTypeMembers(type) {
-            var indexInfo = getIndexInfoOfType(type.source, 0 /* String */);
+            var indexInfo = getIndexInfoOfType(type.source, stringType);
             var modifiers = getMappedTypeModifiers(type.mappedType);
             var readonlyMask = modifiers & 1 /* IncludeReadonly */ ? false : true;
             var optionalMask = modifiers & 4 /* IncludeOptional */ ? 0 : 16777216 /* Optional */;
-            var stringIndexInfo = indexInfo && createIndexInfo(inferReverseMappedType(indexInfo.type, type.mappedType, type.constraintType), readonlyMask && indexInfo.isReadonly);
+            var indexInfos = indexInfo ? [createIndexInfo(stringType, inferReverseMappedType(indexInfo.type, type.mappedType, type.constraintType), readonlyMask && indexInfo.isReadonly)] : ts.emptyArray;
             var members = ts.createSymbolTable();
             for (var _i = 0, _a = getPropertiesOfType(type.source); _i < _a.length; _i++) {
                 var prop = _a[_i];
@@ -53237,11 +56725,24 @@ var ts;
                 inferredProp.declarations = prop.declarations;
                 inferredProp.nameType = getSymbolLinks(prop).nameType;
                 inferredProp.propertyType = getTypeOfSymbol(prop);
-                inferredProp.mappedType = type.mappedType;
-                inferredProp.constraintType = type.constraintType;
+                if (type.constraintType.type.flags & 8388608 /* IndexedAccess */
+                    && type.constraintType.type.objectType.flags & 262144 /* TypeParameter */
+                    && type.constraintType.type.indexType.flags & 262144 /* TypeParameter */) {
+                    // A reverse mapping of `{[K in keyof T[K_1]]: T[K_1]}` is the same as that of `{[K in keyof T]: T}`, since all we care about is
+                    // inferring to the "type parameter" (or indexed access) shared by the constraint and template. So, to reduce the number of
+                    // type identities produced, we simplify such indexed access occurences
+                    var newTypeParam = type.constraintType.type.objectType;
+                    var newMappedType = replaceIndexedAccess(type.mappedType, type.constraintType.type, newTypeParam);
+                    inferredProp.mappedType = newMappedType;
+                    inferredProp.constraintType = getIndexType(newTypeParam);
+                }
+                else {
+                    inferredProp.mappedType = type.mappedType;
+                    inferredProp.constraintType = type.constraintType;
+                }
                 members.set(prop.escapedName, inferredProp);
             }
-            setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, undefined);
+            setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, indexInfos);
         }
         // Return the lower bound of the key type in a mapped type. Intuitively, the lower
         // bound includes those keys that are known to always be present, for example because
@@ -53272,13 +56773,29 @@ var ts;
         function getIsLateCheckFlag(s) {
             return ts.getCheckFlags(s) & 4096 /* Late */;
         }
+        function forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(type, include, stringsOnly, cb) {
+            for (var _i = 0, _a = getPropertiesOfType(type); _i < _a.length; _i++) {
+                var prop = _a[_i];
+                cb(getLiteralTypeFromProperty(prop, include));
+            }
+            if (type.flags & 1 /* Any */) {
+                cb(stringType);
+            }
+            else {
+                for (var _b = 0, _c = getIndexInfosOfType(type); _b < _c.length; _b++) {
+                    var info = _c[_b];
+                    if (!stringsOnly || info.keyType.flags & (4 /* String */ | 134217728 /* TemplateLiteral */)) {
+                        cb(info.keyType);
+                    }
+                }
+            }
+        }
         /** Resolve the members of a mapped type { [P in K]: T } */
         function resolveMappedTypeMembers(type) {
             var members = ts.createSymbolTable();
-            var stringIndexInfo;
-            var numberIndexInfo;
+            var indexInfos;
             // Resolve upfront such that recursive references see an empty object type.
-            setStructuredTypeMembers(type, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);
+            setStructuredTypeMembers(type, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
             // In { [P in K]: T }, we refer to P as the type parameter type, K as the constraint type,
             // and T as the template type.
             var typeParameter = getTypeParameterFromMappedType(type);
@@ -53290,21 +56807,12 @@ var ts;
             var include = keyofStringsOnly ? 128 /* StringLiteral */ : 8576 /* StringOrNumberLiteralOrUnique */;
             if (isMappedTypeWithKeyofConstraintDeclaration(type)) {
                 // We have a { [P in keyof T]: X }
-                for (var _i = 0, _a = getPropertiesOfType(modifiersType); _i < _a.length; _i++) {
-                    var prop = _a[_i];
-                    addMemberForKeyType(getLiteralTypeFromProperty(prop, include));
-                }
-                if (modifiersType.flags & 1 /* Any */ || getIndexInfoOfType(modifiersType, 0 /* String */)) {
-                    addMemberForKeyType(stringType);
-                }
-                if (!keyofStringsOnly && getIndexInfoOfType(modifiersType, 1 /* Number */)) {
-                    addMemberForKeyType(numberType);
-                }
+                forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(modifiersType, include, keyofStringsOnly, addMemberForKeyType);
             }
             else {
                 forEachType(getLowerBoundOfKeyType(constraintType), addMemberForKeyType);
             }
-            setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, numberIndexInfo);
+            setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, indexInfos || ts.emptyArray);
             function addMemberForKeyType(keyType) {
                 var propNameType = nameType ? instantiateType(nameType, appendTypeMapping(type.mapper, typeParameter, keyType)) : keyType;
                 forEachType(propNameType, function (t) { return addMemberForKeyTypeWorker(keyType, t); });
@@ -53336,19 +56844,20 @@ var ts;
                         prop.keyType = keyType;
                         if (modifiersProp) {
                             prop.syntheticOrigin = modifiersProp;
-                            prop.declarations = modifiersProp.declarations;
+                            // If the mapped type has an `as XXX` clause, the property name likely won't match the declaration name and
+                            // multiple properties may map to the same name. Thus, we attach no declarations to the symbol.
+                            prop.declarations = nameType ? undefined : modifiersProp.declarations;
                         }
                         members.set(propName, prop);
                     }
                 }
-                else if (propNameType.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 32 /* Enum */)) {
+                else if (isValidIndexKeyType(propNameType) || propNameType.flags & (1 /* Any */ | 32 /* Enum */)) {
+                    var indexKeyType = propNameType.flags & (1 /* Any */ | 4 /* String */) ? stringType :
+                        propNameType.flags & (8 /* Number */ | 32 /* Enum */) ? numberType :
+                            propNameType;
                     var propType = instantiateType(templateType, appendTypeMapping(type.mapper, typeParameter, keyType));
-                    if (propNameType.flags & (1 /* Any */ | 4 /* String */)) {
-                        stringIndexInfo = createIndexInfo(stringIndexInfo ? getUnionType([stringIndexInfo.type, propType]) : propType, !!(templateModifiers & 1 /* IncludeReadonly */));
-                    }
-                    else {
-                        numberIndexInfo = createIndexInfo(numberIndexInfo ? getUnionType([numberIndexInfo.type, propType]) : propType, !!(templateModifiers & 1 /* IncludeReadonly */));
-                    }
+                    var indexInfo = createIndexInfo(indexKeyType, propType, !!(templateModifiers & 1 /* IncludeReadonly */));
+                    indexInfos = appendIndexInfo(indexInfos, indexInfo, /*union*/ true);
                 }
             }
         }
@@ -53365,8 +56874,8 @@ var ts;
                 // When creating an optional property in strictNullChecks mode, if 'undefined' isn't assignable to the
                 // type, we include 'undefined' in the type. Similarly, when creating a non-optional property in strictNullChecks
                 // mode, if the underlying property is optional we remove 'undefined' from the type.
-                var type = strictNullChecks && symbol.flags & 16777216 /* Optional */ && !maybeTypeOfKind(propType, 32768 /* Undefined */ | 16384 /* Void */) ? getOptionalType(propType) :
-                    symbol.checkFlags & 524288 /* StripOptional */ ? getTypeWithFacts(propType, 524288 /* NEUndefined */) :
+                var type = strictNullChecks && symbol.flags & 16777216 /* Optional */ && !maybeTypeOfKind(propType, 32768 /* Undefined */ | 16384 /* Void */) ? getOptionalType(propType, /*isProperty*/ true) :
+                    symbol.checkFlags & 524288 /* StripOptional */ ? removeMissingOrUndefinedType(propType) :
                         propType;
                 if (!popTypeResolution()) {
                     error(currentNode, ts.Diagnostics.Type_of_property_0_circularly_references_itself_in_mapped_type_1, symbolToString(symbol), typeToString(mappedType));
@@ -53392,7 +56901,7 @@ var ts;
         function getTemplateTypeFromMappedType(type) {
             return type.templateType ||
                 (type.templateType = type.declaration.type ?
-                    instantiateType(addOptionality(getTypeFromTypeNode(type.declaration.type), !!(getMappedTypeModifiers(type) & 4 /* IncludeOptional */)), type.mapper) :
+                    instantiateType(addOptionality(getTypeFromTypeNode(type.declaration.type), /*isProperty*/ true, !!(getMappedTypeModifiers(type) & 4 /* IncludeOptional */)), type.mapper) :
                     errorType);
         }
         function getConstraintDeclarationForMappedType(type) {
@@ -53400,8 +56909,8 @@ var ts;
         }
         function isMappedTypeWithKeyofConstraintDeclaration(type) {
             var constraintDeclaration = getConstraintDeclarationForMappedType(type); // TODO: GH#18217
-            return constraintDeclaration.kind === 188 /* TypeOperator */ &&
-                constraintDeclaration.operator === 138 /* KeyOfKeyword */;
+            return constraintDeclaration.kind === 192 /* TypeOperator */ &&
+                constraintDeclaration.operator === 140 /* KeyOfKeyword */;
         }
         function getModifiersTypeFromMappedType(type) {
             if (!type.modifiersType) {
@@ -53452,7 +56961,7 @@ var ts;
                     else if (type.objectFlags & 3 /* ClassOrInterface */) {
                         resolveClassOrInterfaceMembers(type);
                     }
-                    else if (type.objectFlags & 2048 /* ReverseMapped */) {
+                    else if (type.objectFlags & 1024 /* ReverseMapped */) {
                         resolveReverseMappedTypeMembers(type);
                     }
                     else if (type.objectFlags & 16 /* Anonymous */) {
@@ -53506,7 +57015,7 @@ var ts;
                     }
                     // The properties of a union type are those that are present in all constituent types, so
                     // we only need to check the properties of the first type without index signature
-                    if (type.flags & 1048576 /* Union */ && !getIndexInfoOfType(current, 0 /* String */) && !getIndexInfoOfType(current, 1 /* Number */)) {
+                    if (type.flags & 1048576 /* Union */ && getIndexInfosOfType(current).length === 0) {
                         break;
                     }
                 }
@@ -53520,6 +57029,16 @@ var ts;
                 getPropertiesOfUnionOrIntersectionType(type) :
                 getPropertiesOfObjectType(type);
         }
+        function forEachPropertyOfType(type, action) {
+            type = getReducedApparentType(type);
+            if (type.flags & 3670016 /* StructuredType */) {
+                resolveStructuredTypeMembers(type).members.forEach(function (symbol, escapedName) {
+                    if (isNamedMember(symbol, escapedName)) {
+                        action(symbol, escapedName);
+                    }
+                });
+            }
+        }
         function isTypeInvalidDueToUnionDiscriminant(contextualType, obj) {
             var list = obj.properties;
             return list.some(function (property) {
@@ -53535,8 +57054,8 @@ var ts;
                 return getAugmentedPropertiesOfType(unionType);
             }
             var props = ts.createSymbolTable();
-            for (var _i = 0, types_5 = types; _i < types_5.length; _i++) {
-                var memberType = types_5[_i];
+            for (var _i = 0, types_4 = types; _i < types_4.length; _i++) {
+                var memberType = types_4[_i];
                 for (var _a = 0, _b = getAugmentedPropertiesOfType(memberType); _a < _b.length; _a++) {
                     var escapedName = _b[_a].escapedName;
                     if (!props.has(escapedName)) {
@@ -53568,14 +57087,14 @@ var ts;
         function getConstraintFromIndexedAccess(type) {
             var indexConstraint = getSimplifiedTypeOrConstraint(type.indexType);
             if (indexConstraint && indexConstraint !== type.indexType) {
-                var indexedAccess = getIndexedAccessTypeOrUndefined(type.objectType, indexConstraint, type.noUncheckedIndexedAccessCandidate);
+                var indexedAccess = getIndexedAccessTypeOrUndefined(type.objectType, indexConstraint, type.accessFlags);
                 if (indexedAccess) {
                     return indexedAccess;
                 }
             }
             var objectConstraint = getSimplifiedTypeOrConstraint(type.objectType);
             if (objectConstraint && objectConstraint !== type.objectType) {
-                return getIndexedAccessTypeOrUndefined(objectConstraint, type.indexType, type.noUncheckedIndexedAccessCandidate);
+                return getIndexedAccessTypeOrUndefined(objectConstraint, type.indexType, type.accessFlags);
             }
             return undefined;
         }
@@ -53624,8 +57143,8 @@ var ts;
         function getEffectiveConstraintOfIntersection(types, targetIsUnion) {
             var constraints;
             var hasDisjointDomainType = false;
-            for (var _i = 0, types_6 = types; _i < types_6.length; _i++) {
-                var t = types_6[_i];
+            for (var _i = 0, types_5 = types; _i < types_5.length; _i++) {
+                var t = types_5[_i];
                 if (t.flags & 465829888 /* Instantiable */) {
                     // We keep following constraints as long as we have an instantiable type that is known
                     // not to be circular or infinite (hence we stop on index access types).
@@ -53650,8 +57169,8 @@ var ts;
                 if (hasDisjointDomainType) {
                     // We add any types belong to one of the disjoint domains because they might cause the final
                     // intersection operation to reduce the union constraints.
-                    for (var _a = 0, types_7 = types; _a < types_7.length; _a++) {
-                        var t = types_7[_a];
+                    for (var _a = 0, types_6 = types; _a < types_6.length; _a++) {
+                        var t = types_6[_a];
                         if (t.flags & 469892092 /* DisjointDomains */) {
                             constraints = ts.append(constraints, t);
                         }
@@ -53737,8 +57256,8 @@ var ts;
                     var types = t.types;
                     var baseTypes = [];
                     var different = false;
-                    for (var _i = 0, types_8 = types; _i < types_8.length; _i++) {
-                        var type_3 = types_8[_i];
+                    for (var _i = 0, types_7 = types; _i < types_7.length; _i++) {
+                        var type_3 = types_7[_i];
                         var baseType = getBaseConstraint(type_3);
                         if (baseType) {
                             if (baseType !== type_3) {
@@ -53772,7 +57291,7 @@ var ts;
                 if (t.flags & 8388608 /* IndexedAccess */) {
                     var baseObjectType = getBaseConstraint(t.objectType);
                     var baseIndexType = getBaseConstraint(t.indexType);
-                    var baseIndexedAccess = baseObjectType && baseIndexType && getIndexedAccessTypeOrUndefined(baseObjectType, baseIndexType, t.noUncheckedIndexedAccessCandidate);
+                    var baseIndexedAccess = baseObjectType && baseIndexType && getIndexedAccessTypeOrUndefined(baseObjectType, baseIndexType, t.accessFlags);
                     return baseIndexedAccess && getBaseConstraint(baseIndexedAccess);
                 }
                 if (t.flags & 16777216 /* Conditional */) {
@@ -53871,6 +57390,7 @@ var ts;
             return getReducedType(getApparentType(getReducedType(type)));
         }
         function createUnionOrIntersectionProperty(containingType, name, skipObjectFunctionPropertyAugment) {
+            var _a, _b;
             var singleProp;
             var propSet;
             var indexTypes;
@@ -53878,11 +57398,12 @@ var ts;
             // Flags we want to propagate to the result if they exist in all source symbols
             var optionalFlag = isUnion ? 0 /* None */ : 16777216 /* Optional */;
             var syntheticFlag = 4 /* SyntheticMethod */;
-            var checkFlags = 0;
-            for (var _i = 0, _a = containingType.types; _i < _a.length; _i++) {
-                var current = _a[_i];
+            var checkFlags = isUnion ? 0 : 8 /* Readonly */;
+            var mergedInstantiations = false;
+            for (var _i = 0, _c = containingType.types; _i < _c.length; _i++) {
+                var current = _c[_i];
                 var type = getApparentType(current);
-                if (!(type === errorType || type.flags & 131072 /* Never */)) {
+                if (!(isErrorType(type) || type.flags & 131072 /* Never */)) {
                     var prop = getPropertyOfType(type, name, skipObjectFunctionPropertyAugment);
                     var modifiers = prop ? ts.getDeclarationModifierFlagsFromSymbol(prop) : 0;
                     if (prop) {
@@ -53896,17 +57417,34 @@ var ts;
                             singleProp = prop;
                         }
                         else if (prop !== singleProp) {
-                            if (!propSet) {
-                                propSet = new ts.Map();
-                                propSet.set(getSymbolId(singleProp), singleProp);
+                            var isInstantiation = (getTargetSymbol(prop) || prop) === (getTargetSymbol(singleProp) || singleProp);
+                            // If the symbols are instances of one another with identical types - consider the symbols
+                            // equivalent and just use the first one, which thus allows us to avoid eliding private
+                            // members when intersecting a (this-)instantiations of a class with it's raw base or another instance
+                            if (isInstantiation && compareProperties(singleProp, prop, function (a, b) { return a === b ? -1 /* True */ : 0 /* False */; }) === -1 /* True */) {
+                                // If we merged instantiations of a generic type, we replicate the symbol parent resetting behavior we used
+                                // to do when we recorded multiple distinct symbols so that we still get, eg, `Array<T>.length` printed
+                                // back and not `Array<string>.length` when we're looking at a `.length` access on a `string[] | number[]`
+                                mergedInstantiations = !!singleProp.parent && !!ts.length(getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(singleProp.parent));
                             }
-                            var id = getSymbolId(prop);
-                            if (!propSet.has(id)) {
-                                propSet.set(id, prop);
+                            else {
+                                if (!propSet) {
+                                    propSet = new ts.Map();
+                                    propSet.set(getSymbolId(singleProp), singleProp);
+                                }
+                                var id = getSymbolId(prop);
+                                if (!propSet.has(id)) {
+                                    propSet.set(id, prop);
+                                }
                             }
                         }
-                        checkFlags |= (isReadonlySymbol(prop) ? 8 /* Readonly */ : 0) |
-                            (!(modifiers & 24 /* NonPublicAccessibilityModifier */) ? 256 /* ContainsPublic */ : 0) |
+                        if (isUnion && isReadonlySymbol(prop)) {
+                            checkFlags |= 8 /* Readonly */;
+                        }
+                        else if (!isUnion && !isReadonlySymbol(prop)) {
+                            checkFlags &= ~8 /* Readonly */;
+                        }
+                        checkFlags |= (!(modifiers & 24 /* NonPublicAccessibilityModifier */) ? 256 /* ContainsPublic */ : 0) |
                             (modifiers & 16 /* Protected */ ? 512 /* ContainsProtected */ : 0) |
                             (modifiers & 8 /* Private */ ? 1024 /* ContainsPrivate */ : 0) |
                             (modifiers & 32 /* Static */ ? 2048 /* ContainsStatic */ : 0);
@@ -53915,12 +57453,12 @@ var ts;
                         }
                     }
                     else if (isUnion) {
-                        var indexInfo = !isLateBoundName(name) && (isNumericLiteralName(name) && getIndexInfoOfType(type, 1 /* Number */) || getIndexInfoOfType(type, 0 /* String */));
+                        var indexInfo = !isLateBoundName(name) && getApplicableIndexInfoForName(type, name);
                         if (indexInfo) {
                             checkFlags |= 32 /* WritePartial */ | (indexInfo.isReadonly ? 8 /* Readonly */ : 0);
                             indexTypes = ts.append(indexTypes, isTupleType(type) ? getRestTypeOfTupleType(type) || undefinedType : indexInfo.type);
                         }
-                        else if (isObjectLiteralType(type)) {
+                        else if (isObjectLiteralType(type) && !(ts.getObjectFlags(type) & 4194304 /* ContainsSpread */)) {
                             checkFlags |= 32 /* WritePartial */;
                             indexTypes = ts.append(indexTypes, undefinedType);
                         }
@@ -53936,7 +57474,19 @@ var ts;
                 return undefined;
             }
             if (!propSet && !(checkFlags & 16 /* ReadPartial */) && !indexTypes) {
-                return singleProp;
+                if (mergedInstantiations) {
+                    // No symbol from a union/intersection should have a `.parent` set (since unions/intersections don't act as symbol parents)
+                    // Unless that parent is "reconstituted" from the "first value declaration" on the symbol (which is likely different than its instantiated parent!)
+                    // They also have a `.containingType` set, which affects some services endpoints behavior, like `getRootSymbol`
+                    var clone_1 = createSymbolWithType(singleProp, singleProp.type);
+                    clone_1.parent = (_b = (_a = singleProp.valueDeclaration) === null || _a === void 0 ? void 0 : _a.symbol) === null || _b === void 0 ? void 0 : _b.parent;
+                    clone_1.containingType = containingType;
+                    clone_1.mapper = singleProp.mapper;
+                    return clone_1;
+                }
+                else {
+                    return singleProp;
+                }
             }
             var props = propSet ? ts.arrayFrom(propSet.values()) : [singleProp];
             var declarations;
@@ -53945,8 +57495,8 @@ var ts;
             var propTypes = [];
             var firstValueDeclaration;
             var hasNonUniformValueDeclaration = false;
-            for (var _b = 0, props_1 = props; _b < props_1.length; _b++) {
-                var prop = props_1[_b];
+            for (var _d = 0, props_1 = props; _d < props_1.length; _d++) {
+                var prop = props_1[_d];
                 if (!firstValueDeclaration) {
                     firstValueDeclaration = prop.valueDeclaration;
                 }
@@ -53962,7 +57512,7 @@ var ts;
                 else if (type !== firstType) {
                     checkFlags |= 64 /* HasNonUniformType */;
                 }
-                if (isLiteralType(type)) {
+                if (isLiteralType(type) || isPatternLiteralType(type)) {
                     checkFlags |= 128 /* HasLiteralType */;
                 }
                 if (type.flags & 131072 /* Never */) {
@@ -54023,15 +57573,15 @@ var ts;
          * no constituent property has type 'never', but the intersection of the constituent property types is 'never'.
          */
         function getReducedType(type) {
-            if (type.flags & 1048576 /* Union */ && type.objectFlags & 268435456 /* ContainsIntersections */) {
+            if (type.flags & 1048576 /* Union */ && type.objectFlags & 33554432 /* ContainsIntersections */) {
                 return type.resolvedReducedType || (type.resolvedReducedType = getReducedUnionType(type));
             }
             else if (type.flags & 2097152 /* Intersection */) {
-                if (!(type.objectFlags & 268435456 /* IsNeverIntersectionComputed */)) {
-                    type.objectFlags |= 268435456 /* IsNeverIntersectionComputed */ |
-                        (ts.some(getPropertiesOfUnionOrIntersectionType(type), isNeverReducedProperty) ? 536870912 /* IsNeverIntersection */ : 0);
+                if (!(type.objectFlags & 33554432 /* IsNeverIntersectionComputed */)) {
+                    type.objectFlags |= 33554432 /* IsNeverIntersectionComputed */ |
+                        (ts.some(getPropertiesOfUnionOrIntersectionType(type), isNeverReducedProperty) ? 67108864 /* IsNeverIntersection */ : 0);
                 }
-                return type.objectFlags & 536870912 /* IsNeverIntersection */ ? neverType : type;
+                return type.objectFlags & 67108864 /* IsNeverIntersection */ ? neverType : type;
             }
             return type;
         }
@@ -54061,7 +57611,7 @@ var ts;
             return !prop.valueDeclaration && !!(ts.getCheckFlags(prop) & 1024 /* ContainsPrivate */);
         }
         function elaborateNeverIntersection(errorInfo, type) {
-            if (ts.getObjectFlags(type) & 536870912 /* IsNeverIntersection */) {
+            if (type.flags & 2097152 /* Intersection */ && ts.getObjectFlags(type) & 67108864 /* IsNeverIntersection */) {
                 var neverProp = ts.find(getPropertiesOfUnionOrIntersectionType(type), isDiscriminantWithNeverType);
                 if (neverProp) {
                     return ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents, typeToString(type, /*enclosingDeclaration*/ undefined, 536870912 /* NoTypeReduction */), symbolToString(neverProp));
@@ -54122,43 +57672,72 @@ var ts;
         function getSignaturesOfType(type, kind) {
             return getSignaturesOfStructuredType(getReducedApparentType(type), kind);
         }
-        function getIndexInfoOfStructuredType(type, kind) {
+        function findIndexInfo(indexInfos, keyType) {
+            return ts.find(indexInfos, function (info) { return info.keyType === keyType; });
+        }
+        function findApplicableIndexInfo(indexInfos, keyType) {
+            // Index signatures for type 'string' are considered only when no other index signatures apply.
+            var stringIndexInfo;
+            var applicableInfo;
+            var applicableInfos;
+            for (var _i = 0, indexInfos_1 = indexInfos; _i < indexInfos_1.length; _i++) {
+                var info = indexInfos_1[_i];
+                if (info.keyType === stringType) {
+                    stringIndexInfo = info;
+                }
+                else if (isApplicableIndexType(keyType, info.keyType)) {
+                    if (!applicableInfo) {
+                        applicableInfo = info;
+                    }
+                    else {
+                        (applicableInfos || (applicableInfos = [applicableInfo])).push(info);
+                    }
+                }
+            }
+            // When more than one index signature is applicable we create a synthetic IndexInfo. Instead of computing
+            // the intersected key type, we just use unknownType for the key type as nothing actually depends on the
+            // keyType property of the returned IndexInfo.
+            return applicableInfos ? createIndexInfo(unknownType, getIntersectionType(ts.map(applicableInfos, function (info) { return info.type; })), ts.reduceLeft(applicableInfos, function (isReadonly, info) { return isReadonly && info.isReadonly; }, /*initial*/ true)) :
+                applicableInfo ? applicableInfo :
+                    stringIndexInfo && isApplicableIndexType(keyType, stringType) ? stringIndexInfo :
+                        undefined;
+        }
+        function isApplicableIndexType(source, target) {
+            // A 'string' index signature applies to types assignable to 'string' or 'number', and a 'number' index
+            // signature applies to types assignable to 'number' and numeric string literal types.
+            return isTypeAssignableTo(source, target) ||
+                target === stringType && isTypeAssignableTo(source, numberType) ||
+                target === numberType && !!(source.flags & 128 /* StringLiteral */) && isNumericLiteralName(source.value);
+        }
+        function getIndexInfosOfStructuredType(type) {
             if (type.flags & 3670016 /* StructuredType */) {
                 var resolved = resolveStructuredTypeMembers(type);
-                return kind === 0 /* String */ ? resolved.stringIndexInfo : resolved.numberIndexInfo;
+                return resolved.indexInfos;
             }
+            return ts.emptyArray;
         }
-        function getIndexTypeOfStructuredType(type, kind) {
-            var info = getIndexInfoOfStructuredType(type, kind);
-            return info && info.type;
+        function getIndexInfosOfType(type) {
+            return getIndexInfosOfStructuredType(getReducedApparentType(type));
         }
         // Return the indexing info of the given kind in the given type. Creates synthetic union index types when necessary and
         // maps primitive types and type parameters are to their apparent types.
-        function getIndexInfoOfType(type, kind) {
-            return getIndexInfoOfStructuredType(getReducedApparentType(type), kind);
+        function getIndexInfoOfType(type, keyType) {
+            return findIndexInfo(getIndexInfosOfType(type), keyType);
         }
         // Return the index type of the given kind in the given type. Creates synthetic union index types when necessary and
         // maps primitive types and type parameters are to their apparent types.
-        function getIndexTypeOfType(type, kind) {
-            return getIndexTypeOfStructuredType(getReducedApparentType(type), kind);
+        function getIndexTypeOfType(type, keyType) {
+            var _a;
+            return (_a = getIndexInfoOfType(type, keyType)) === null || _a === void 0 ? void 0 : _a.type;
         }
-        function getImplicitIndexTypeOfType(type, kind) {
-            if (isObjectTypeWithInferableIndex(type)) {
-                var propTypes = [];
-                for (var _i = 0, _a = getPropertiesOfType(type); _i < _a.length; _i++) {
-                    var prop = _a[_i];
-                    if (kind === 0 /* String */ || isNumericLiteralName(prop.escapedName)) {
-                        propTypes.push(getTypeOfSymbol(prop));
-                    }
-                }
-                if (kind === 0 /* String */) {
-                    ts.append(propTypes, getIndexTypeOfType(type, 1 /* Number */));
-                }
-                if (propTypes.length) {
-                    return getUnionType(propTypes);
-                }
-            }
-            return undefined;
+        function getApplicableIndexInfos(type, keyType) {
+            return getIndexInfosOfType(type).filter(function (info) { return isApplicableIndexType(keyType, info.keyType); });
+        }
+        function getApplicableIndexInfo(type, keyType) {
+            return findApplicableIndexInfo(getIndexInfosOfType(type), keyType);
+        }
+        function getApplicableIndexInfoForName(type, name) {
+            return getApplicableIndexInfo(type, isLateBoundName(name) ? esSymbolType : getStringLiteralType(ts.unescapeLeadingUnderscores(name)));
         }
         // Return list of type parameters with duplicates removed (duplicate identifier errors are generated in the actual
         // type checking functions).
@@ -54182,10 +57761,10 @@ var ts;
         function isJSDocOptionalParameter(node) {
             return ts.isInJSFile(node) && (
             // node.type should only be a JSDocOptionalType when node is a parameter of a JSDocFunctionType
-            node.type && node.type.kind === 307 /* JSDocOptionalType */
+            node.type && node.type.kind === 314 /* JSDocOptionalType */
                 || ts.getJSDocParameterTags(node).some(function (_a) {
                     var isBracketed = _a.isBracketed, typeExpression = _a.typeExpression;
-                    return isBracketed || !!typeExpression && typeExpression.type.kind === 307 /* JSDocOptionalType */;
+                    return isBracketed || !!typeExpression && typeExpression.type.kind === 314 /* JSDocOptionalType */;
                 }));
         }
         function tryFindAmbientModule(moduleName, withAugmentations) {
@@ -54217,12 +57796,15 @@ var ts;
             }
             return false;
         }
+        function isOptionalPropertyDeclaration(node) {
+            return ts.isPropertyDeclaration(node) && node.questionToken;
+        }
         function isOptionalJSDocPropertyLikeTag(node) {
             if (!ts.isJSDocPropertyLikeTag(node)) {
                 return false;
             }
             var isBracketed = node.isBracketed, typeExpression = node.typeExpression;
-            return isBracketed || !!typeExpression && typeExpression.type.kind === 307 /* JSDocOptionalType */;
+            return isBracketed || !!typeExpression && typeExpression.type.kind === 314 /* JSDocOptionalType */;
         }
         function createTypePredicate(kind, parameterName, parameterIndex, type) {
             return { kind: kind, parameterName: parameterName, parameterIndex: parameterIndex, type: type };
@@ -54304,12 +57886,12 @@ var ts;
                     else {
                         parameters.push(paramSymbol);
                     }
-                    if (type && type.kind === 191 /* LiteralType */) {
+                    if (type && type.kind === 195 /* LiteralType */) {
                         flags |= 2 /* HasLiteralTypes */;
                     }
                     // Record a new minimum argument count if this is not an optional parameter
                     var isOptionalParameter_1 = isOptionalJSDocPropertyLikeTag(param) ||
-                        param.initializer || param.questionToken || param.dotDotDotToken ||
+                        param.initializer || param.questionToken || ts.isRestParameter(param) ||
                         iife && parameters.length > iife.arguments.length && !type ||
                         isJSDocOptionalParameter(param);
                     if (!isOptionalParameter_1) {
@@ -54317,16 +57899,16 @@ var ts;
                     }
                 }
                 // If only one accessor includes a this-type annotation, the other behaves as if it had the same type annotation
-                if ((declaration.kind === 167 /* GetAccessor */ || declaration.kind === 168 /* SetAccessor */) &&
+                if ((declaration.kind === 171 /* GetAccessor */ || declaration.kind === 172 /* SetAccessor */) &&
                     hasBindableName(declaration) &&
                     (!hasThisParameter || !thisParameter)) {
-                    var otherKind = declaration.kind === 167 /* GetAccessor */ ? 168 /* SetAccessor */ : 167 /* GetAccessor */;
+                    var otherKind = declaration.kind === 171 /* GetAccessor */ ? 172 /* SetAccessor */ : 171 /* GetAccessor */;
                     var other = ts.getDeclarationOfKind(getSymbolOfNode(declaration), otherKind);
                     if (other) {
                         thisParameter = getAnnotatedAccessorThisParameter(other);
                     }
                 }
-                var classType = declaration.kind === 166 /* Constructor */ ?
+                var classType = declaration.kind === 170 /* Constructor */ ?
                     getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol))
                     : undefined;
                 var typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration);
@@ -54371,8 +57953,7 @@ var ts;
             if (!(ts.isInJSFile(node) && ts.isFunctionLikeDeclaration(node)))
                 return undefined;
             var typeTag = ts.getJSDocTypeTag(node);
-            var signature = typeTag && typeTag.typeExpression && getSingleCallSignature(getTypeFromTypeNode(typeTag.typeExpression));
-            return signature && getErasedSignature(signature);
+            return (typeTag === null || typeTag === void 0 ? void 0 : typeTag.typeExpression) && getSingleCallSignature(getTypeFromTypeNode(typeTag.typeExpression));
         }
         function getReturnTypeOfTypeTag(node) {
             var signature = getSignatureOfTypeTag(node);
@@ -54393,16 +57974,16 @@ var ts;
                 if (!node)
                     return false;
                 switch (node.kind) {
-                    case 78 /* Identifier */:
-                        return node.escapedText === argumentsSymbol.escapedName && getResolvedSymbol(node) === argumentsSymbol;
-                    case 163 /* PropertyDeclaration */:
-                    case 165 /* MethodDeclaration */:
-                    case 167 /* GetAccessor */:
-                    case 168 /* SetAccessor */:
-                        return node.name.kind === 158 /* ComputedPropertyName */
+                    case 79 /* Identifier */:
+                        return node.escapedText === argumentsSymbol.escapedName && getReferencedValueSymbol(node) === argumentsSymbol;
+                    case 166 /* PropertyDeclaration */:
+                    case 168 /* MethodDeclaration */:
+                    case 171 /* GetAccessor */:
+                    case 172 /* SetAccessor */:
+                        return node.name.kind === 161 /* ComputedPropertyName */
                             && traverse(node.name);
-                    case 201 /* PropertyAccessExpression */:
-                    case 202 /* ElementAccessExpression */:
+                    case 205 /* PropertyAccessExpression */:
+                    case 206 /* ElementAccessExpression */:
                         return traverse(node.expression);
                     default:
                         return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && !!ts.forEachChild(node, traverse);
@@ -54410,7 +57991,7 @@ var ts;
             }
         }
         function getSignaturesOfSymbol(symbol) {
-            if (!symbol)
+            if (!symbol || !symbol.declarations)
                 return ts.emptyArray;
             var result = [];
             for (var i = 0; i < symbol.declarations.length; i++) {
@@ -54451,8 +58032,8 @@ var ts;
                     var targetTypePredicate = getTypePredicateOfSignature(signature.target);
                     signature.resolvedTypePredicate = targetTypePredicate ? instantiateTypePredicate(targetTypePredicate, signature.mapper) : noTypePredicate;
                 }
-                else if (signature.unionSignatures) {
-                    signature.resolvedTypePredicate = getUnionTypePredicate(signature.unionSignatures) || noTypePredicate;
+                else if (signature.compositeSignatures) {
+                    signature.resolvedTypePredicate = getUnionOrIntersectionTypePredicate(signature.compositeSignatures, signature.compositeKind) || noTypePredicate;
                 }
                 else {
                     var type = signature.declaration && ts.getEffectiveReturnTypeNode(signature.declaration);
@@ -54474,17 +58055,20 @@ var ts;
         function createTypePredicateFromTypePredicateNode(node, signature) {
             var parameterName = node.parameterName;
             var type = node.type && getTypeFromTypeNode(node.type);
-            return parameterName.kind === 187 /* ThisType */ ?
+            return parameterName.kind === 191 /* ThisType */ ?
                 createTypePredicate(node.assertsModifier ? 2 /* AssertsThis */ : 0 /* This */, /*parameterName*/ undefined, /*parameterIndex*/ undefined, type) :
                 createTypePredicate(node.assertsModifier ? 3 /* AssertsIdentifier */ : 1 /* Identifier */, parameterName.escapedText, ts.findIndex(signature.parameters, function (p) { return p.escapedName === parameterName.escapedText; }), type);
         }
+        function getUnionOrIntersectionType(types, kind, unionReduction) {
+            return kind !== 2097152 /* Intersection */ ? getUnionType(types, unionReduction) : getIntersectionType(types);
+        }
         function getReturnTypeOfSignature(signature) {
             if (!signature.resolvedReturnType) {
                 if (!pushTypeResolution(signature, 3 /* ResolvedReturnType */)) {
                     return errorType;
                 }
                 var type = signature.target ? instantiateType(getReturnTypeOfSignature(signature.target), signature.mapper) :
-                    signature.unionSignatures ? instantiateType(getUnionType(ts.map(signature.unionSignatures, getReturnTypeOfSignature), 2 /* Subtype */), signature.mapper) :
+                    signature.compositeSignatures ? instantiateType(getUnionOrIntersectionType(ts.map(signature.compositeSignatures, getReturnTypeOfSignature), signature.compositeKind, 2 /* Subtype */), signature.mapper) :
                         getReturnTypeFromAnnotation(signature.declaration) ||
                             (ts.nodeIsMissing(signature.declaration.body) ? anyType : getReturnTypeFromBody(signature.declaration));
                 if (signature.flags & 8 /* IsInnerCallChain */) {
@@ -54517,7 +58101,7 @@ var ts;
             return signature.resolvedReturnType;
         }
         function getReturnTypeFromAnnotation(declaration) {
-            if (declaration.kind === 166 /* Constructor */) {
+            if (declaration.kind === 170 /* Constructor */) {
                 return getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol));
             }
             if (ts.isJSDocConstructSignature(declaration)) {
@@ -54527,12 +58111,12 @@ var ts;
             if (typeNode) {
                 return getTypeFromTypeNode(typeNode);
             }
-            if (declaration.kind === 167 /* GetAccessor */ && hasBindableName(declaration)) {
+            if (declaration.kind === 171 /* GetAccessor */ && hasBindableName(declaration)) {
                 var jsDocType = ts.isInJSFile(declaration) && getTypeForDeclarationFromJSDocComment(declaration);
                 if (jsDocType) {
                     return jsDocType;
                 }
-                var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 168 /* SetAccessor */);
+                var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 172 /* SetAccessor */);
                 var setterType = getAnnotatedAccessorType(setter);
                 if (setterType) {
                     return setterType;
@@ -54550,7 +58134,7 @@ var ts;
             if (signatureHasRestParameter(signature)) {
                 var sigRestType = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]);
                 var restType = isTupleType(sigRestType) ? getRestTypeOfTupleType(sigRestType) : sigRestType;
-                return restType && getIndexTypeOfType(restType, 1 /* Number */);
+                return restType && getIndexTypeOfType(restType, numberType);
             }
             return undefined;
         }
@@ -54609,9 +58193,20 @@ var ts;
         function getBaseSignature(signature) {
             var typeParameters = signature.typeParameters;
             if (typeParameters) {
-                var typeEraser_1 = createTypeEraser(typeParameters);
-                var baseConstraints = ts.map(typeParameters, function (tp) { return instantiateType(getBaseConstraintOfType(tp), typeEraser_1) || unknownType; });
-                return instantiateSignature(signature, createTypeMapper(typeParameters, baseConstraints), /*eraseTypeParameters*/ true);
+                if (signature.baseSignatureCache) {
+                    return signature.baseSignatureCache;
+                }
+                var typeEraser = createTypeEraser(typeParameters);
+                var baseConstraintMapper_1 = createTypeMapper(typeParameters, ts.map(typeParameters, function (tp) { return getConstraintOfTypeParameter(tp) || unknownType; }));
+                var baseConstraints = ts.map(typeParameters, function (tp) { return instantiateType(tp, baseConstraintMapper_1) || unknownType; });
+                // Run N type params thru the immediate constraint mapper up to N times
+                // This way any noncircular interdependent type parameters are definitely resolved to their external dependencies
+                for (var i = 0; i < typeParameters.length - 1; i++) {
+                    baseConstraints = instantiateTypes(baseConstraints, baseConstraintMapper_1);
+                }
+                // and then apply a type eraser to remove any remaining circularly dependent type parameters
+                baseConstraints = instantiateTypes(baseConstraints, typeEraser);
+                return signature.baseSignatureCache = instantiateSignature(signature, createTypeMapper(typeParameters, baseConstraints), /*eraseTypeParameters*/ true);
             }
             return signature;
         }
@@ -54622,61 +58217,73 @@ var ts;
             // will result in a different declaration kind.
             if (!signature.isolatedSignatureType) {
                 var kind = signature.declaration ? signature.declaration.kind : 0 /* Unknown */;
-                var isConstructor = kind === 166 /* Constructor */ || kind === 170 /* ConstructSignature */ || kind === 175 /* ConstructorType */;
+                var isConstructor = kind === 170 /* Constructor */ || kind === 174 /* ConstructSignature */ || kind === 179 /* ConstructorType */;
                 var type = createObjectType(16 /* Anonymous */);
                 type.members = emptySymbols;
                 type.properties = ts.emptyArray;
                 type.callSignatures = !isConstructor ? [signature] : ts.emptyArray;
                 type.constructSignatures = isConstructor ? [signature] : ts.emptyArray;
+                type.indexInfos = ts.emptyArray;
                 signature.isolatedSignatureType = type;
             }
             return signature.isolatedSignatureType;
         }
         function getIndexSymbol(symbol) {
-            return symbol.members.get("__index" /* Index */);
+            return symbol.members ? getIndexSymbolFromSymbolTable(symbol.members) : undefined;
+        }
+        function getIndexSymbolFromSymbolTable(symbolTable) {
+            return symbolTable.get("__index" /* Index */);
         }
-        function getIndexDeclarationOfSymbol(symbol, kind) {
-            var syntaxKind = kind === 1 /* Number */ ? 144 /* NumberKeyword */ : 147 /* StringKeyword */;
+        function createIndexInfo(keyType, type, isReadonly, declaration) {
+            return { keyType: keyType, type: type, isReadonly: isReadonly, declaration: declaration };
+        }
+        function getIndexInfosOfSymbol(symbol) {
             var indexSymbol = getIndexSymbol(symbol);
-            if (indexSymbol) {
-                for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) {
-                    var decl = _a[_i];
-                    var node = ts.cast(decl, ts.isIndexSignatureDeclaration);
-                    if (node.parameters.length === 1) {
-                        var parameter = node.parameters[0];
-                        if (parameter.type && parameter.type.kind === syntaxKind) {
-                            return node;
+            return indexSymbol ? getIndexInfosOfIndexSymbol(indexSymbol) : ts.emptyArray;
+        }
+        function getIndexInfosOfIndexSymbol(indexSymbol) {
+            if (indexSymbol.declarations) {
+                var indexInfos_2 = [];
+                var _loop_14 = function (declaration) {
+                    if (declaration.parameters.length === 1) {
+                        var parameter = declaration.parameters[0];
+                        if (parameter.type) {
+                            forEachType(getTypeFromTypeNode(parameter.type), function (keyType) {
+                                if (isValidIndexKeyType(keyType) && !findIndexInfo(indexInfos_2, keyType)) {
+                                    indexInfos_2.push(createIndexInfo(keyType, declaration.type ? getTypeFromTypeNode(declaration.type) : anyType, ts.hasEffectiveModifier(declaration, 64 /* Readonly */), declaration));
+                                }
+                            });
                         }
                     }
+                };
+                for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) {
+                    var declaration = _a[_i];
+                    _loop_14(declaration);
                 }
+                return indexInfos_2;
             }
-            return undefined;
-        }
-        function createIndexInfo(type, isReadonly, declaration) {
-            return { type: type, isReadonly: isReadonly, declaration: declaration };
+            return ts.emptyArray;
         }
-        function getIndexInfoOfSymbol(symbol, kind) {
-            var declaration = getIndexDeclarationOfSymbol(symbol, kind);
-            if (declaration) {
-                return createIndexInfo(declaration.type ? getTypeFromTypeNode(declaration.type) : anyType, ts.hasEffectiveModifier(declaration, 64 /* Readonly */), declaration);
-            }
-            return undefined;
+        function isValidIndexKeyType(type) {
+            return !!(type.flags & (4 /* String */ | 8 /* Number */ | 4096 /* ESSymbol */)) || isPatternLiteralType(type) ||
+                !!(type.flags & 2097152 /* Intersection */) && !isGenericType(type) && ts.some(type.types, isValidIndexKeyType);
         }
         function getConstraintDeclaration(type) {
             return ts.mapDefined(ts.filter(type.symbol && type.symbol.declarations, ts.isTypeParameterDeclaration), ts.getEffectiveConstraintOfTypeParameter)[0];
         }
         function getInferredTypeParameterConstraint(typeParameter) {
+            var _a;
             var inferences;
-            if (typeParameter.symbol) {
-                for (var _i = 0, _a = typeParameter.symbol.declarations; _i < _a.length; _i++) {
-                    var declaration = _a[_i];
-                    if (declaration.parent.kind === 185 /* InferType */) {
+            if ((_a = typeParameter.symbol) === null || _a === void 0 ? void 0 : _a.declarations) {
+                for (var _i = 0, _b = typeParameter.symbol.declarations; _i < _b.length; _i++) {
+                    var declaration = _b[_i];
+                    if (declaration.parent.kind === 189 /* InferType */) {
                         // When an 'infer T' declaration is immediately contained in a type reference node
                         // (such as 'Foo<infer T>'), T's constraint is inferred from the constraint of the
                         // corresponding type parameter in 'Foo'. When multiple 'infer T' declarations are
                         // present, we form an intersection of the inferred constraint types.
-                        var _b = ts.walkUpParenthesizedTypesAndGetParentAndChild(declaration.parent.parent), _c = _b[0], childTypeParameter = _c === void 0 ? declaration.parent : _c, grandParent = _b[1];
-                        if (grandParent.kind === 173 /* TypeReference */) {
+                        var _c = ts.walkUpParenthesizedTypesAndGetParentAndChild(declaration.parent.parent), _d = _c[0], childTypeParameter = _d === void 0 ? declaration.parent : _d, grandParent = _c[1];
+                        if (grandParent.kind === 177 /* TypeReference */) {
                             var typeReference = grandParent;
                             var typeParameters = getTypeParametersForTypeReference(typeReference);
                             if (typeParameters) {
@@ -54701,21 +58308,32 @@ var ts;
                         }
                         // When an 'infer T' declaration is immediately contained in a rest parameter declaration, a rest type
                         // or a named rest tuple element, we infer an 'unknown[]' constraint.
-                        else if (grandParent.kind === 160 /* Parameter */ && grandParent.dotDotDotToken ||
-                            grandParent.kind === 181 /* RestType */ ||
-                            grandParent.kind === 192 /* NamedTupleMember */ && grandParent.dotDotDotToken) {
+                        else if (grandParent.kind === 163 /* Parameter */ && grandParent.dotDotDotToken ||
+                            grandParent.kind === 185 /* RestType */ ||
+                            grandParent.kind === 196 /* NamedTupleMember */ && grandParent.dotDotDotToken) {
                             inferences = ts.append(inferences, createArrayType(unknownType));
                         }
                         // When an 'infer T' declaration is immediately contained in a string template type, we infer a 'string'
                         // constraint.
-                        else if (grandParent.kind === 194 /* TemplateLiteralTypeSpan */) {
+                        else if (grandParent.kind === 198 /* TemplateLiteralTypeSpan */) {
                             inferences = ts.append(inferences, stringType);
                         }
                         // When an 'infer T' declaration is in the constraint position of a mapped type, we infer a 'keyof any'
                         // constraint.
-                        else if (grandParent.kind === 159 /* TypeParameter */ && grandParent.parent.kind === 190 /* MappedType */) {
+                        else if (grandParent.kind === 162 /* TypeParameter */ && grandParent.parent.kind === 194 /* MappedType */) {
                             inferences = ts.append(inferences, keyofConstraintType);
                         }
+                        // When an 'infer T' declaration is the template of a mapped type, and that mapped type is the extends
+                        // clause of a conditional whose check type is also a mapped type, give it a constraint equal to the template
+                        // of the check type's mapped type
+                        else if (grandParent.kind === 194 /* MappedType */ && grandParent.type &&
+                            ts.skipParentheses(grandParent.type) === declaration.parent && grandParent.parent.kind === 188 /* ConditionalType */ &&
+                            grandParent.parent.extendsType === grandParent && grandParent.parent.checkType.kind === 194 /* MappedType */ &&
+                            grandParent.parent.checkType.type) {
+                            var checkMappedType_1 = grandParent.parent.checkType;
+                            var nodeType = getTypeFromTypeNode(checkMappedType_1.type);
+                            inferences = ts.append(inferences, instantiateType(nodeType, makeUnaryTypeMapper(getDeclaredTypeOfTypeParameter(getSymbolOfNode(checkMappedType_1.typeParameter)), checkMappedType_1.typeParameter.constraint ? getTypeFromTypeNode(checkMappedType_1.typeParameter.constraint) : keyofConstraintType)));
+                        }
                     }
                 }
             }
@@ -54735,10 +58353,10 @@ var ts;
                     }
                     else {
                         var type = getTypeFromTypeNode(constraintDeclaration);
-                        if (type.flags & 1 /* Any */ && type !== errorType) { // Allow errorType to propegate to keep downstream errors suppressed
+                        if (type.flags & 1 /* Any */ && !isErrorType(type)) { // Allow errorType to propegate to keep downstream errors suppressed
                             // use keyofConstraintType as the base constraint for mapped type key constraints (unknown isn;t assignable to that, but `any` was),
                             // use unknown otherwise
-                            type = constraintDeclaration.parent.parent.kind === 190 /* MappedType */ ? keyofConstraintType : unknownType;
+                            type = constraintDeclaration.parent.parent.kind === 194 /* MappedType */ ? keyofConstraintType : unknownType;
                         }
                         typeParameter.constraint = type;
                     }
@@ -54747,8 +58365,8 @@ var ts;
             return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint;
         }
         function getParentSymbolOfTypeParameter(typeParameter) {
-            var tp = ts.getDeclarationOfKind(typeParameter.symbol, 159 /* TypeParameter */);
-            var host = ts.isJSDocTemplateTag(tp.parent) ? ts.getHostSignatureFromJSDoc(tp.parent) : tp.parent;
+            var tp = ts.getDeclarationOfKind(typeParameter.symbol, 162 /* TypeParameter */);
+            var host = ts.isJSDocTemplateTag(tp.parent) ? ts.getEffectiveContainerForJSDocTemplateTag(tp.parent) : tp.parent;
             return host && getSymbolOfNode(host);
         }
         function getTypeListId(types) {
@@ -54775,7 +58393,7 @@ var ts;
             return result;
         }
         function getAliasId(aliasSymbol, aliasTypeArguments) {
-            return aliasSymbol ? "@" + getSymbolId(aliasSymbol) + (aliasTypeArguments ? ":" + getTypeListId(aliasTypeArguments) : "") : "";
+            return aliasSymbol ? "@".concat(getSymbolId(aliasSymbol)) + (aliasTypeArguments ? ":".concat(getTypeListId(aliasTypeArguments)) : "") : "";
         }
         // This function is used to propagate certain flags when creating new object type references and union types.
         // It is only necessary to do so if a constituent type might be the undefined type, the null type, the type
@@ -54783,13 +58401,13 @@ var ts;
         // that care about the presence of such types at arbitrary depth in a containing type.
         function getPropagatingFlagsOfTypes(types, excludeKinds) {
             var result = 0;
-            for (var _i = 0, types_9 = types; _i < types_9.length; _i++) {
-                var type = types_9[_i];
+            for (var _i = 0, types_8 = types; _i < types_8.length; _i++) {
+                var type = types_8[_i];
                 if (!(type.flags & excludeKinds)) {
                     result |= ts.getObjectFlags(type);
                 }
             }
-            return result & 3670016 /* PropagatingFlags */;
+            return result & 917504 /* PropagatingFlags */;
         }
         function createTypeReference(target, typeArguments) {
             var id = getTypeListId(typeArguments);
@@ -54833,8 +58451,8 @@ var ts;
                 }
                 var node = type.node;
                 var typeArguments = !node ? ts.emptyArray :
-                    node.kind === 173 /* TypeReference */ ? ts.concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) :
-                        node.kind === 178 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] :
+                    node.kind === 177 /* TypeReference */ ? ts.concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) :
+                        node.kind === 182 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] :
                             ts.map(node.elements, getTypeFromTypeNode);
                 if (popTypeResolution()) {
                     type.resolvedTypeArguments = type.mapper ? instantiateTypes(typeArguments, type.mapper) : typeArguments;
@@ -54876,7 +58494,7 @@ var ts;
                         return errorType;
                     }
                 }
-                if (node.kind === 173 /* TypeReference */ && isDeferredTypeReferenceNode(node, ts.length(node.typeArguments) !== typeParameters.length)) {
+                if (node.kind === 177 /* TypeReference */ && isDeferredTypeReferenceNode(node, ts.length(node.typeArguments) !== typeParameters.length)) {
                     return createDeferredTypeReference(type, node, /*mapper*/ undefined);
                 }
                 // In a type reference, the outer type parameters of the referenced class or interface are automatically
@@ -54907,6 +58525,18 @@ var ts;
          * declared type. Instantiations are cached using the type identities of the type arguments as the key.
          */
         function getTypeFromTypeAliasReference(node, symbol) {
+            if (ts.getCheckFlags(symbol) & 1048576 /* Unresolved */) {
+                var typeArguments = typeArgumentsFromTypeReferenceNode(node);
+                var id = getAliasId(symbol, typeArguments);
+                var errorType_1 = errorTypes.get(id);
+                if (!errorType_1) {
+                    errorType_1 = createIntrinsicType(1 /* Any */, "error");
+                    errorType_1.aliasSymbol = symbol;
+                    errorType_1.aliasTypeArguments = typeArguments;
+                    errorTypes.set(id, errorType_1);
+                }
+                return errorType_1;
+            }
             var type = getDeclaredTypeOfSymbol(symbol);
             var typeParameters = getSymbolLinks(symbol).typeParameters;
             if (typeParameters) {
@@ -54918,16 +58548,26 @@ var ts;
                         ts.Diagnostics.Generic_type_0_requires_between_1_and_2_type_arguments, symbolToString(symbol), minTypeArgumentCount, typeParameters.length);
                     return errorType;
                 }
+                // We refrain from associating a local type alias with an instantiation of a top-level type alias
+                // because the local alias may end up being referenced in an inferred return type where it is not
+                // accessible--which in turn may lead to a large structural expansion of the type when generating
+                // a .d.ts file. See #43622 for an example.
                 var aliasSymbol = getAliasSymbolForTypeNode(node);
-                return getTypeAliasInstantiation(symbol, typeArgumentsFromTypeReferenceNode(node), aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol));
+                var newAliasSymbol = aliasSymbol && (isLocalTypeAlias(symbol) || !isLocalTypeAlias(aliasSymbol)) ? aliasSymbol : undefined;
+                return getTypeAliasInstantiation(symbol, typeArgumentsFromTypeReferenceNode(node), newAliasSymbol, getTypeArgumentsForAliasSymbol(newAliasSymbol));
             }
             return checkNoTypeArguments(node, symbol) ? type : errorType;
         }
+        function isLocalTypeAlias(symbol) {
+            var _a;
+            var declaration = (_a = symbol.declarations) === null || _a === void 0 ? void 0 : _a.find(ts.isTypeAlias);
+            return !!(declaration && ts.getContainingFunction(declaration));
+        }
         function getTypeReferenceName(node) {
             switch (node.kind) {
-                case 173 /* TypeReference */:
+                case 177 /* TypeReference */:
                     return node.typeName;
-                case 223 /* ExpressionWithTypeArguments */:
+                case 227 /* ExpressionWithTypeArguments */:
                     // We only support expressions that are simple qualified names. For other
                     // expressions this produces undefined.
                     var expr = node.expression;
@@ -54938,11 +58578,37 @@ var ts;
             }
             return undefined;
         }
-        function resolveTypeReferenceName(typeReferenceName, meaning, ignoreErrors) {
-            if (!typeReferenceName) {
+        function getSymbolPath(symbol) {
+            return symbol.parent ? "".concat(getSymbolPath(symbol.parent), ".").concat(symbol.escapedName) : symbol.escapedName;
+        }
+        function getUnresolvedSymbolForEntityName(name) {
+            var identifier = name.kind === 160 /* QualifiedName */ ? name.right :
+                name.kind === 205 /* PropertyAccessExpression */ ? name.name :
+                    name;
+            var text = identifier.escapedText;
+            if (text) {
+                var parentSymbol = name.kind === 160 /* QualifiedName */ ? getUnresolvedSymbolForEntityName(name.left) :
+                    name.kind === 205 /* PropertyAccessExpression */ ? getUnresolvedSymbolForEntityName(name.expression) :
+                        undefined;
+                var path = parentSymbol ? "".concat(getSymbolPath(parentSymbol), ".").concat(text) : text;
+                var result = unresolvedSymbols.get(path);
+                if (!result) {
+                    unresolvedSymbols.set(path, result = createSymbol(524288 /* TypeAlias */, text, 1048576 /* Unresolved */));
+                    result.parent = parentSymbol;
+                    result.declaredType = unresolvedType;
+                }
+                return result;
+            }
+            return unknownSymbol;
+        }
+        function resolveTypeReferenceName(typeReference, meaning, ignoreErrors) {
+            var name = getTypeReferenceName(typeReference);
+            if (!name) {
                 return unknownSymbol;
             }
-            return resolveEntityName(typeReferenceName, meaning, ignoreErrors) || unknownSymbol;
+            var symbol = resolveEntityName(name, meaning, ignoreErrors);
+            return symbol && symbol !== unknownSymbol ? symbol :
+                ignoreErrors ? unknownSymbol : getUnresolvedSymbolForEntityName(name);
         }
         function getTypeReferenceType(node, symbol) {
             if (symbol === unknownSymbol) {
@@ -54967,7 +58633,7 @@ var ts;
                 }
                 else {
                     // Resolve the type reference as a Type for the purpose of reporting errors.
-                    resolveTypeReferenceName(getTypeReferenceName(node), 788968 /* Type */);
+                    resolveTypeReferenceName(node, 788968 /* Type */);
                     return getTypeOfSymbol(symbol);
                 }
             }
@@ -54983,7 +58649,7 @@ var ts;
                 var valueType = getTypeOfSymbol(symbol);
                 var typeType = valueType;
                 if (symbol.valueDeclaration) {
-                    var isImportTypeWithQualifier = node.kind === 195 /* ImportType */ && node.qualifier;
+                    var isImportTypeWithQualifier = node.kind === 199 /* ImportType */ && node.qualifier;
                     // valueType might not have a symbol, eg, {import('./b').STRING_LITERAL}
                     if (valueType.symbol && valueType.symbol !== symbol && isImportTypeWithQualifier) {
                         typeType = getTypeReferenceType(node, valueType.symbol);
@@ -54997,7 +58663,7 @@ var ts;
             if (substitute.flags & 3 /* AnyOrUnknown */ || substitute === baseType) {
                 return baseType;
             }
-            var id = getTypeId(baseType) + ">" + getTypeId(substitute);
+            var id = "".concat(getTypeId(baseType), ">").concat(getTypeId(substitute));
             var cached = substitutionTypes.get(id);
             if (cached) {
                 return cached;
@@ -55009,7 +58675,7 @@ var ts;
             return result;
         }
         function isUnaryTupleTypeNode(node) {
-            return node.kind === 179 /* TupleType */ && node.elements.length === 1;
+            return node.kind === 183 /* TupleType */ && node.elements.length === 1;
         }
         function getImpliedConstraint(type, checkNode, extendsNode) {
             return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(type, checkNode.elements[0], extendsNode.elements[0]) :
@@ -55018,9 +58684,17 @@ var ts;
         }
         function getConditionalFlowTypeOfType(type, node) {
             var constraints;
-            while (node && !ts.isStatement(node) && node.kind !== 311 /* JSDocComment */) {
+            var covariant = true;
+            while (node && !ts.isStatement(node) && node.kind !== 318 /* JSDocComment */) {
                 var parent = node.parent;
-                if (parent.kind === 184 /* ConditionalType */ && node === parent.trueType) {
+                // only consider variance flipped by parameter locations - `keyof` types would usually be considered variance inverting, but
+                // often get used in indexed accesses where they behave sortof invariantly, but our checking is lax
+                if (parent.kind === 163 /* Parameter */) {
+                    covariant = !covariant;
+                }
+                // Always substitute on type parameters, regardless of variance, since even
+                // in contravariant positions, they may rely on substituted constraints to be valid
+                if ((covariant || type.flags & 8650752 /* TypeVariable */) && parent.kind === 188 /* ConditionalType */ && node === parent.trueType) {
                     var constraint = getImpliedConstraint(type, parent.checkType, parent.extendsType);
                     if (constraint) {
                         constraints = ts.append(constraints, constraint);
@@ -55031,7 +58705,7 @@ var ts;
             return constraints ? getSubstitutionType(type, getIntersectionType(ts.append(constraints, type))) : type;
         }
         function isJSDocTypeReference(node) {
-            return !!(node.flags & 4194304 /* JSDoc */) && (node.kind === 173 /* TypeReference */ || node.kind === 195 /* ImportType */);
+            return !!(node.flags & 4194304 /* JSDoc */) && (node.kind === 177 /* TypeReference */ || node.kind === 199 /* ImportType */);
         }
         function checkNoTypeArguments(node, symbol) {
             if (node.typeArguments) {
@@ -55075,8 +58749,8 @@ var ts;
                             if (ts.isJSDocIndexSignature(node)) {
                                 var indexed = getTypeFromTypeNode(typeArgs[0]);
                                 var target = getTypeFromTypeNode(typeArgs[1]);
-                                var index = createIndexInfo(target, /*isReadonly*/ false);
-                                return createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, indexed === stringType ? index : undefined, indexed === numberType ? index : undefined);
+                                var indexInfo = indexed === stringType || indexed === numberType ? [createIndexInfo(indexed, target, /*isReadonly*/ false)] : ts.emptyArray;
+                                return createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, indexInfo);
                             }
                             return anyType;
                         }
@@ -55103,18 +58777,18 @@ var ts;
                 if (isJSDocTypeReference(node)) {
                     type = getIntendedTypeFromJSDocTypeReference(node);
                     if (!type) {
-                        symbol = resolveTypeReferenceName(getTypeReferenceName(node), meaning, /*ignoreErrors*/ true);
+                        symbol = resolveTypeReferenceName(node, meaning, /*ignoreErrors*/ true);
                         if (symbol === unknownSymbol) {
-                            symbol = resolveTypeReferenceName(getTypeReferenceName(node), meaning | 111551 /* Value */);
+                            symbol = resolveTypeReferenceName(node, meaning | 111551 /* Value */);
                         }
                         else {
-                            resolveTypeReferenceName(getTypeReferenceName(node), meaning); // Resolve again to mark errors, if any
+                            resolveTypeReferenceName(node, meaning); // Resolve again to mark errors, if any
                         }
                         type = getTypeReferenceType(node, symbol);
                     }
                 }
                 if (!type) {
-                    symbol = resolveTypeReferenceName(getTypeReferenceName(node), meaning);
+                    symbol = resolveTypeReferenceName(node, meaning);
                     type = getTypeReferenceType(node, symbol);
                 }
                 // Cache both the resolved symbol and the resolved type. The resolved symbol is needed when we check the
@@ -55134,20 +58808,23 @@ var ts;
                 // The expression is processed as an identifier expression (section 4.3)
                 // or property access expression(section 4.10),
                 // the widened type(section 3.9) of which becomes the result.
-                links.resolvedType = getRegularTypeOfLiteralType(getWidenedType(checkExpression(node.exprName)));
+                var type = ts.isThisIdentifier(node.exprName) ? checkThisExpression(node.exprName) : checkExpression(node.exprName);
+                links.resolvedType = getRegularTypeOfLiteralType(getWidenedType(type));
             }
             return links.resolvedType;
         }
         function getTypeOfGlobalSymbol(symbol, arity) {
             function getTypeDeclaration(symbol) {
                 var declarations = symbol.declarations;
-                for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) {
-                    var declaration = declarations_3[_i];
-                    switch (declaration.kind) {
-                        case 252 /* ClassDeclaration */:
-                        case 253 /* InterfaceDeclaration */:
-                        case 255 /* EnumDeclaration */:
-                            return declaration;
+                if (declarations) {
+                    for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) {
+                        var declaration = declarations_3[_i];
+                        switch (declaration.kind) {
+                            case 256 /* ClassDeclaration */:
+                            case 257 /* InterfaceDeclaration */:
+                            case 259 /* EnumDeclaration */:
+                                return declaration;
+                        }
                     }
                 }
             }
@@ -55171,6 +58848,20 @@ var ts;
         function getGlobalTypeSymbol(name, reportErrors) {
             return getGlobalSymbol(name, 788968 /* Type */, reportErrors ? ts.Diagnostics.Cannot_find_global_type_0 : undefined);
         }
+        function getGlobalTypeAliasSymbol(name, arity, reportErrors) {
+            var symbol = getGlobalSymbol(name, 788968 /* Type */, reportErrors ? ts.Diagnostics.Cannot_find_global_type_0 : undefined);
+            if (symbol) {
+                // Resolve the declared type of the symbol. This resolves type parameters for the type
+                // alias so that we can check arity.
+                getDeclaredTypeOfSymbol(symbol);
+                if (ts.length(getSymbolLinks(symbol).typeParameters) !== arity) {
+                    var decl = symbol.declarations && ts.find(symbol.declarations, ts.isTypeAliasDeclaration);
+                    error(decl, ts.Diagnostics.Global_type_0_must_have_1_type_parameter_s, ts.symbolName(symbol), arity);
+                    return undefined;
+                }
+            }
+            return symbol;
+        }
         function getGlobalSymbol(name, meaning, diagnostic) {
             // Don't track references for global symbols anyway, so value if `isReference` is arbitrary
             return resolveName(undefined, name, meaning, diagnostic, name, /*isUse*/ false);
@@ -55180,61 +58871,84 @@ var ts;
             return symbol || reportErrors ? getTypeOfGlobalSymbol(symbol, arity) : undefined;
         }
         function getGlobalTypedPropertyDescriptorType() {
-            return deferredGlobalTypedPropertyDescriptorType || (deferredGlobalTypedPropertyDescriptorType = getGlobalType("TypedPropertyDescriptor", /*arity*/ 1, /*reportErrors*/ true)) || emptyGenericType;
+            // We always report an error, so store a result in the event we could not resolve the symbol to prevent reporting it multiple times
+            return deferredGlobalTypedPropertyDescriptorType || (deferredGlobalTypedPropertyDescriptorType = getGlobalType("TypedPropertyDescriptor", /*arity*/ 1, /*reportErrors*/ true) || emptyGenericType);
         }
         function getGlobalTemplateStringsArrayType() {
-            return deferredGlobalTemplateStringsArrayType || (deferredGlobalTemplateStringsArrayType = getGlobalType("TemplateStringsArray", /*arity*/ 0, /*reportErrors*/ true)) || emptyObjectType;
+            // We always report an error, so store a result in the event we could not resolve the symbol to prevent reporting it multiple times
+            return deferredGlobalTemplateStringsArrayType || (deferredGlobalTemplateStringsArrayType = getGlobalType("TemplateStringsArray", /*arity*/ 0, /*reportErrors*/ true) || emptyObjectType);
         }
         function getGlobalImportMetaType() {
-            return deferredGlobalImportMetaType || (deferredGlobalImportMetaType = getGlobalType("ImportMeta", /*arity*/ 0, /*reportErrors*/ true)) || emptyObjectType;
+            // We always report an error, so store a result in the event we could not resolve the symbol to prevent reporting it multiple times
+            return deferredGlobalImportMetaType || (deferredGlobalImportMetaType = getGlobalType("ImportMeta", /*arity*/ 0, /*reportErrors*/ true) || emptyObjectType);
+        }
+        function getGlobalImportMetaExpressionType() {
+            if (!deferredGlobalImportMetaExpressionType) {
+                // Create a synthetic type `ImportMetaExpression { meta: MetaProperty }`
+                var symbol = createSymbol(0 /* None */, "ImportMetaExpression");
+                var importMetaType = getGlobalImportMetaType();
+                var metaPropertySymbol = createSymbol(4 /* Property */, "meta", 8 /* Readonly */);
+                metaPropertySymbol.parent = symbol;
+                metaPropertySymbol.type = importMetaType;
+                var members = ts.createSymbolTable([metaPropertySymbol]);
+                symbol.members = members;
+                deferredGlobalImportMetaExpressionType = createAnonymousType(symbol, members, ts.emptyArray, ts.emptyArray, ts.emptyArray);
+            }
+            return deferredGlobalImportMetaExpressionType;
+        }
+        function getGlobalImportCallOptionsType(reportErrors) {
+            return (deferredGlobalImportCallOptionsType || (deferredGlobalImportCallOptionsType = getGlobalType("ImportCallOptions", /*arity*/ 0, reportErrors))) || emptyObjectType;
         }
         function getGlobalESSymbolConstructorSymbol(reportErrors) {
             return deferredGlobalESSymbolConstructorSymbol || (deferredGlobalESSymbolConstructorSymbol = getGlobalValueSymbol("Symbol", reportErrors));
         }
+        function getGlobalESSymbolConstructorTypeSymbol(reportErrors) {
+            return deferredGlobalESSymbolConstructorTypeSymbol || (deferredGlobalESSymbolConstructorTypeSymbol = getGlobalTypeSymbol("SymbolConstructor", reportErrors));
+        }
         function getGlobalESSymbolType(reportErrors) {
-            return deferredGlobalESSymbolType || (deferredGlobalESSymbolType = getGlobalType("Symbol", /*arity*/ 0, reportErrors)) || emptyObjectType;
+            return (deferredGlobalESSymbolType || (deferredGlobalESSymbolType = getGlobalType("Symbol", /*arity*/ 0, reportErrors))) || emptyObjectType;
         }
         function getGlobalPromiseType(reportErrors) {
-            return deferredGlobalPromiseType || (deferredGlobalPromiseType = getGlobalType("Promise", /*arity*/ 1, reportErrors)) || emptyGenericType;
+            return (deferredGlobalPromiseType || (deferredGlobalPromiseType = getGlobalType("Promise", /*arity*/ 1, reportErrors))) || emptyGenericType;
         }
         function getGlobalPromiseLikeType(reportErrors) {
-            return deferredGlobalPromiseLikeType || (deferredGlobalPromiseLikeType = getGlobalType("PromiseLike", /*arity*/ 1, reportErrors)) || emptyGenericType;
+            return (deferredGlobalPromiseLikeType || (deferredGlobalPromiseLikeType = getGlobalType("PromiseLike", /*arity*/ 1, reportErrors))) || emptyGenericType;
         }
         function getGlobalPromiseConstructorSymbol(reportErrors) {
             return deferredGlobalPromiseConstructorSymbol || (deferredGlobalPromiseConstructorSymbol = getGlobalValueSymbol("Promise", reportErrors));
         }
         function getGlobalPromiseConstructorLikeType(reportErrors) {
-            return deferredGlobalPromiseConstructorLikeType || (deferredGlobalPromiseConstructorLikeType = getGlobalType("PromiseConstructorLike", /*arity*/ 0, reportErrors)) || emptyObjectType;
+            return (deferredGlobalPromiseConstructorLikeType || (deferredGlobalPromiseConstructorLikeType = getGlobalType("PromiseConstructorLike", /*arity*/ 0, reportErrors))) || emptyObjectType;
         }
         function getGlobalAsyncIterableType(reportErrors) {
-            return deferredGlobalAsyncIterableType || (deferredGlobalAsyncIterableType = getGlobalType("AsyncIterable", /*arity*/ 1, reportErrors)) || emptyGenericType;
+            return (deferredGlobalAsyncIterableType || (deferredGlobalAsyncIterableType = getGlobalType("AsyncIterable", /*arity*/ 1, reportErrors))) || emptyGenericType;
         }
         function getGlobalAsyncIteratorType(reportErrors) {
-            return deferredGlobalAsyncIteratorType || (deferredGlobalAsyncIteratorType = getGlobalType("AsyncIterator", /*arity*/ 3, reportErrors)) || emptyGenericType;
+            return (deferredGlobalAsyncIteratorType || (deferredGlobalAsyncIteratorType = getGlobalType("AsyncIterator", /*arity*/ 3, reportErrors))) || emptyGenericType;
         }
         function getGlobalAsyncIterableIteratorType(reportErrors) {
-            return deferredGlobalAsyncIterableIteratorType || (deferredGlobalAsyncIterableIteratorType = getGlobalType("AsyncIterableIterator", /*arity*/ 1, reportErrors)) || emptyGenericType;
+            return (deferredGlobalAsyncIterableIteratorType || (deferredGlobalAsyncIterableIteratorType = getGlobalType("AsyncIterableIterator", /*arity*/ 1, reportErrors))) || emptyGenericType;
         }
         function getGlobalAsyncGeneratorType(reportErrors) {
-            return deferredGlobalAsyncGeneratorType || (deferredGlobalAsyncGeneratorType = getGlobalType("AsyncGenerator", /*arity*/ 3, reportErrors)) || emptyGenericType;
+            return (deferredGlobalAsyncGeneratorType || (deferredGlobalAsyncGeneratorType = getGlobalType("AsyncGenerator", /*arity*/ 3, reportErrors))) || emptyGenericType;
         }
         function getGlobalIterableType(reportErrors) {
-            return deferredGlobalIterableType || (deferredGlobalIterableType = getGlobalType("Iterable", /*arity*/ 1, reportErrors)) || emptyGenericType;
+            return (deferredGlobalIterableType || (deferredGlobalIterableType = getGlobalType("Iterable", /*arity*/ 1, reportErrors))) || emptyGenericType;
         }
         function getGlobalIteratorType(reportErrors) {
-            return deferredGlobalIteratorType || (deferredGlobalIteratorType = getGlobalType("Iterator", /*arity*/ 3, reportErrors)) || emptyGenericType;
+            return (deferredGlobalIteratorType || (deferredGlobalIteratorType = getGlobalType("Iterator", /*arity*/ 3, reportErrors))) || emptyGenericType;
         }
         function getGlobalIterableIteratorType(reportErrors) {
-            return deferredGlobalIterableIteratorType || (deferredGlobalIterableIteratorType = getGlobalType("IterableIterator", /*arity*/ 1, reportErrors)) || emptyGenericType;
+            return (deferredGlobalIterableIteratorType || (deferredGlobalIterableIteratorType = getGlobalType("IterableIterator", /*arity*/ 1, reportErrors))) || emptyGenericType;
         }
         function getGlobalGeneratorType(reportErrors) {
-            return deferredGlobalGeneratorType || (deferredGlobalGeneratorType = getGlobalType("Generator", /*arity*/ 3, reportErrors)) || emptyGenericType;
+            return (deferredGlobalGeneratorType || (deferredGlobalGeneratorType = getGlobalType("Generator", /*arity*/ 3, reportErrors))) || emptyGenericType;
         }
         function getGlobalIteratorYieldResultType(reportErrors) {
-            return deferredGlobalIteratorYieldResultType || (deferredGlobalIteratorYieldResultType = getGlobalType("IteratorYieldResult", /*arity*/ 1, reportErrors)) || emptyGenericType;
+            return (deferredGlobalIteratorYieldResultType || (deferredGlobalIteratorYieldResultType = getGlobalType("IteratorYieldResult", /*arity*/ 1, reportErrors))) || emptyGenericType;
         }
         function getGlobalIteratorReturnResultType(reportErrors) {
-            return deferredGlobalIteratorReturnResultType || (deferredGlobalIteratorReturnResultType = getGlobalType("IteratorReturnResult", /*arity*/ 1, reportErrors)) || emptyGenericType;
+            return (deferredGlobalIteratorReturnResultType || (deferredGlobalIteratorReturnResultType = getGlobalType("IteratorReturnResult", /*arity*/ 1, reportErrors))) || emptyGenericType;
         }
         function getGlobalTypeOrUndefined(name, arity) {
             if (arity === void 0) { arity = 0; }
@@ -55242,13 +58956,22 @@ var ts;
             return symbol && getTypeOfGlobalSymbol(symbol, arity);
         }
         function getGlobalExtractSymbol() {
-            return deferredGlobalExtractSymbol || (deferredGlobalExtractSymbol = getGlobalSymbol("Extract", 524288 /* TypeAlias */, ts.Diagnostics.Cannot_find_global_type_0)); // TODO: GH#18217
+            // We always report an error, so cache a result in the event we could not resolve the symbol to prevent reporting it multiple times
+            deferredGlobalExtractSymbol || (deferredGlobalExtractSymbol = getGlobalTypeAliasSymbol("Extract", /*arity*/ 2, /*reportErrors*/ true) || unknownSymbol);
+            return deferredGlobalExtractSymbol === unknownSymbol ? undefined : deferredGlobalExtractSymbol;
         }
         function getGlobalOmitSymbol() {
-            return deferredGlobalOmitSymbol || (deferredGlobalOmitSymbol = getGlobalSymbol("Omit", 524288 /* TypeAlias */, ts.Diagnostics.Cannot_find_global_type_0)); // TODO: GH#18217
+            // We always report an error, so cache a result in the event we could not resolve the symbol to prevent reporting it multiple times
+            deferredGlobalOmitSymbol || (deferredGlobalOmitSymbol = getGlobalTypeAliasSymbol("Omit", /*arity*/ 2, /*reportErrors*/ true) || unknownSymbol);
+            return deferredGlobalOmitSymbol === unknownSymbol ? undefined : deferredGlobalOmitSymbol;
+        }
+        function getGlobalAwaitedSymbol(reportErrors) {
+            // Only cache `unknownSymbol` if we are reporting errors so that we don't report the error more than once.
+            deferredGlobalAwaitedSymbol || (deferredGlobalAwaitedSymbol = getGlobalTypeAliasSymbol("Awaited", /*arity*/ 1, reportErrors) || (reportErrors ? unknownSymbol : undefined));
+            return deferredGlobalAwaitedSymbol === unknownSymbol ? undefined : deferredGlobalAwaitedSymbol;
         }
         function getGlobalBigIntType(reportErrors) {
-            return deferredGlobalBigIntType || (deferredGlobalBigIntType = getGlobalType("BigInt", /*arity*/ 0, reportErrors)) || emptyObjectType;
+            return (deferredGlobalBigIntType || (deferredGlobalBigIntType = getGlobalType("BigInt", /*arity*/ 0, reportErrors))) || emptyObjectType;
         }
         /**
          * Instantiates a global type that is generic with some element type, and returns that instantiation.
@@ -55267,11 +58990,11 @@ var ts;
         }
         function getTupleElementFlags(node) {
             switch (node.kind) {
-                case 180 /* OptionalType */:
+                case 184 /* OptionalType */:
                     return 2 /* Optional */;
-                case 181 /* RestType */:
+                case 185 /* RestType */:
                     return getRestTypeElementFlags(node);
-                case 192 /* NamedTupleMember */:
+                case 196 /* NamedTupleMember */:
                     return node.questionToken ? 2 /* Optional */ :
                         node.dotDotDotToken ? getRestTypeElementFlags(node) :
                             1 /* Required */;
@@ -55289,14 +59012,14 @@ var ts;
                 return readonly ? globalReadonlyArrayType : globalArrayType;
             }
             var elementFlags = ts.map(node.elements, getTupleElementFlags);
-            var missingName = ts.some(node.elements, function (e) { return e.kind !== 192 /* NamedTupleMember */; });
+            var missingName = ts.some(node.elements, function (e) { return e.kind !== 196 /* NamedTupleMember */; });
             return getTupleTargetType(elementFlags, readonly, /*associatedNames*/ missingName ? undefined : node.elements);
         }
         // Return true if the given type reference node is directly aliased or if it needs to be deferred
         // because it is possibly contained in a circular chain of eagerly resolved types.
         function isDeferredTypeReferenceNode(node, hasDefaultTypeArguments) {
-            return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 178 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) :
-                node.kind === 179 /* TupleType */ ? ts.some(node.elements, mayResolveTypeAlias) :
+            return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 182 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) :
+                node.kind === 183 /* TupleType */ ? ts.some(node.elements, mayResolveTypeAlias) :
                     hasDefaultTypeArguments || ts.some(node.typeArguments, mayResolveTypeAlias));
         }
         // Return true when the given node is transitively contained in type constructs that eagerly
@@ -55305,18 +59028,18 @@ var ts;
         function isResolvedByTypeAlias(node) {
             var parent = node.parent;
             switch (parent.kind) {
-                case 186 /* ParenthesizedType */:
-                case 192 /* NamedTupleMember */:
-                case 173 /* TypeReference */:
-                case 182 /* UnionType */:
-                case 183 /* IntersectionType */:
-                case 189 /* IndexedAccessType */:
-                case 184 /* ConditionalType */:
-                case 188 /* TypeOperator */:
-                case 178 /* ArrayType */:
-                case 179 /* TupleType */:
+                case 190 /* ParenthesizedType */:
+                case 196 /* NamedTupleMember */:
+                case 177 /* TypeReference */:
+                case 186 /* UnionType */:
+                case 187 /* IntersectionType */:
+                case 193 /* IndexedAccessType */:
+                case 188 /* ConditionalType */:
+                case 192 /* TypeOperator */:
+                case 182 /* ArrayType */:
+                case 183 /* TupleType */:
                     return isResolvedByTypeAlias(parent);
-                case 254 /* TypeAliasDeclaration */:
+                case 258 /* TypeAliasDeclaration */:
                     return true;
             }
             return false;
@@ -55325,28 +59048,28 @@ var ts;
         // of a type alias.
         function mayResolveTypeAlias(node) {
             switch (node.kind) {
-                case 173 /* TypeReference */:
-                    return isJSDocTypeReference(node) || !!(resolveTypeReferenceName(node.typeName, 788968 /* Type */).flags & 524288 /* TypeAlias */);
-                case 176 /* TypeQuery */:
+                case 177 /* TypeReference */:
+                    return isJSDocTypeReference(node) || !!(resolveTypeReferenceName(node, 788968 /* Type */).flags & 524288 /* TypeAlias */);
+                case 180 /* TypeQuery */:
                     return true;
-                case 188 /* TypeOperator */:
-                    return node.operator !== 151 /* UniqueKeyword */ && mayResolveTypeAlias(node.type);
-                case 186 /* ParenthesizedType */:
-                case 180 /* OptionalType */:
-                case 192 /* NamedTupleMember */:
-                case 307 /* JSDocOptionalType */:
-                case 305 /* JSDocNullableType */:
-                case 306 /* JSDocNonNullableType */:
-                case 301 /* JSDocTypeExpression */:
+                case 192 /* TypeOperator */:
+                    return node.operator !== 153 /* UniqueKeyword */ && mayResolveTypeAlias(node.type);
+                case 190 /* ParenthesizedType */:
+                case 184 /* OptionalType */:
+                case 196 /* NamedTupleMember */:
+                case 314 /* JSDocOptionalType */:
+                case 312 /* JSDocNullableType */:
+                case 313 /* JSDocNonNullableType */:
+                case 307 /* JSDocTypeExpression */:
                     return mayResolveTypeAlias(node.type);
-                case 181 /* RestType */:
-                    return node.type.kind !== 178 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType);
-                case 182 /* UnionType */:
-                case 183 /* IntersectionType */:
+                case 185 /* RestType */:
+                    return node.type.kind !== 182 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType);
+                case 186 /* UnionType */:
+                case 187 /* IntersectionType */:
                     return ts.some(node.types, mayResolveTypeAlias);
-                case 189 /* IndexedAccessType */:
+                case 193 /* IndexedAccessType */:
                     return mayResolveTypeAlias(node.objectType) || mayResolveTypeAlias(node.indexType);
-                case 184 /* ConditionalType */:
+                case 188 /* ConditionalType */:
                     return mayResolveTypeAlias(node.checkType) || mayResolveTypeAlias(node.extendsType) ||
                         mayResolveTypeAlias(node.trueType) || mayResolveTypeAlias(node.falseType);
             }
@@ -55359,19 +59082,19 @@ var ts;
                 if (target === emptyGenericType) {
                     links.resolvedType = emptyObjectType;
                 }
-                else if (!(node.kind === 179 /* TupleType */ && ts.some(node.elements, function (e) { return !!(getTupleElementFlags(e) & 8 /* Variadic */); })) && isDeferredTypeReferenceNode(node)) {
-                    links.resolvedType = node.kind === 179 /* TupleType */ && node.elements.length === 0 ? target :
+                else if (!(node.kind === 183 /* TupleType */ && ts.some(node.elements, function (e) { return !!(getTupleElementFlags(e) & 8 /* Variadic */); })) && isDeferredTypeReferenceNode(node)) {
+                    links.resolvedType = node.kind === 183 /* TupleType */ && node.elements.length === 0 ? target :
                         createDeferredTypeReference(target, node, /*mapper*/ undefined);
                 }
                 else {
-                    var elementTypes = node.kind === 178 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elements, getTypeFromTypeNode);
+                    var elementTypes = node.kind === 182 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elements, getTypeFromTypeNode);
                     links.resolvedType = createNormalizedTypeReference(target, elementTypes);
                 }
             }
             return links.resolvedType;
         }
         function isReadonlyTypeOperator(node) {
-            return ts.isTypeOperatorNode(node) && node.operator === 142 /* ReadonlyKeyword */;
+            return ts.isTypeOperatorNode(node) && node.operator === 144 /* ReadonlyKeyword */;
         }
         function createTupleType(elementTypes, elementFlags, readonly, namedMemberDeclarations) {
             if (readonly === void 0) { readonly = false; }
@@ -55427,10 +59150,10 @@ var ts;
                 lengthSymbol.type = numberType;
             }
             else {
-                var literalTypes_1 = [];
+                var literalTypes = [];
                 for (var i = minLength; i <= arity; i++)
-                    literalTypes_1.push(getLiteralType(i));
-                lengthSymbol.type = getUnionType(literalTypes_1);
+                    literalTypes.push(getNumberLiteralType(i));
+                lengthSymbol.type = getUnionType(literalTypes);
             }
             properties.push(lengthSymbol);
             var type = createObjectType(8 /* Tuple */ | 4 /* Reference */);
@@ -55447,8 +59170,7 @@ var ts;
             type.declaredProperties = properties;
             type.declaredCallSignatures = ts.emptyArray;
             type.declaredConstructSignatures = ts.emptyArray;
-            type.declaredStringIndexInfo = undefined;
-            type.declaredNumberIndexInfo = undefined;
+            type.declaredIndexInfos = ts.emptyArray;
             type.elementFlags = elementFlags;
             type.minLength = minLength;
             type.fixedLength = fixedLength;
@@ -55487,7 +59209,7 @@ var ts;
             var lastRequiredIndex = -1;
             var firstRestIndex = -1;
             var lastOptionalOrRestIndex = -1;
-            var _loop_13 = function (i) {
+            var _loop_15 = function (i) {
                 var type = elementTypes[i];
                 var flags = target.elementFlags[i];
                 if (flags & 8 /* Variadic */) {
@@ -55508,7 +59230,7 @@ var ts;
                     }
                     else {
                         // Treat everything else as an array type and create a rest element.
-                        addElement(isArrayLikeType(type) && getIndexTypeOfType(type, 1 /* Number */) || errorType, 4 /* Rest */, (_b = target.labeledElementDeclarations) === null || _b === void 0 ? void 0 : _b[i]);
+                        addElement(isArrayLikeType(type) && getIndexTypeOfType(type, numberType) || errorType, 4 /* Rest */, (_b = target.labeledElementDeclarations) === null || _b === void 0 ? void 0 : _b[i]);
                     }
                 }
                 else {
@@ -55517,7 +59239,7 @@ var ts;
                 }
             };
             for (var i = 0; i < elementTypes.length; i++) {
-                var state_4 = _loop_13(i);
+                var state_4 = _loop_15(i);
                 if (typeof state_4 === "object")
                     return state_4.value;
             }
@@ -55566,7 +59288,7 @@ var ts;
                 /*readonly*/ false, target.labeledElementDeclarations && target.labeledElementDeclarations.slice(index, endIndex));
         }
         function getKnownKeysOfTupleType(type) {
-            return getUnionType(ts.append(ts.arrayOf(type.target.fixedLength, function (i) { return getLiteralType("" + i); }), getIndexType(type.target.readonly ? globalReadonlyArrayType : globalArrayType)));
+            return getUnionType(ts.append(ts.arrayOf(type.target.fixedLength, function (i) { return getStringLiteralType("" + i); }), getIndexType(type.target.readonly ? globalReadonlyArrayType : globalArrayType)));
         }
         // Return count of starting consecutive tuple elements of the given kind(s)
         function getStartElementCount(type, flags) {
@@ -55578,8 +59300,7 @@ var ts;
             return type.elementFlags.length - ts.findLastIndex(type.elementFlags, function (f) { return !(f & flags); }) - 1;
         }
         function getTypeFromOptionalTypeNode(node) {
-            var type = getTypeFromTypeNode(node.type);
-            return strictNullChecks ? getOptionalType(type) : type;
+            return addOptionality(getTypeFromTypeNode(node.type), /*isProperty*/ true);
         }
         function getTypeId(type) {
             return type.id;
@@ -55603,12 +59324,12 @@ var ts;
             // We ignore 'never' types in unions
             if (!(flags & 131072 /* Never */)) {
                 includes |= flags & 205258751 /* IncludesMask */;
-                if (flags & 469499904 /* StructuredOrInstantiable */)
-                    includes |= 262144 /* IncludesStructuredOrInstantiable */;
+                if (flags & 465829888 /* Instantiable */)
+                    includes |= 33554432 /* IncludesInstantiable */;
                 if (type === wildcardType)
                     includes |= 8388608 /* IncludesWildcard */;
                 if (!strictNullChecks && flags & 98304 /* Nullable */) {
-                    if (!(ts.getObjectFlags(type) & 524288 /* ContainsWideningType */))
+                    if (!(ts.getObjectFlags(type) & 131072 /* ContainsWideningType */))
                         includes |= 4194304 /* IncludesNonWideningType */;
                 }
                 else {
@@ -55624,13 +59345,18 @@ var ts;
         // Add the given types to the given type set. Order is preserved, duplicates are removed,
         // and nested types of the given kind are flattened into the set.
         function addTypesToUnion(typeSet, includes, types) {
-            for (var _i = 0, types_10 = types; _i < types_10.length; _i++) {
-                var type = types_10[_i];
+            for (var _i = 0, types_9 = types; _i < types_9.length; _i++) {
+                var type = types_9[_i];
                 includes = addTypeToUnion(typeSet, includes, type);
             }
             return includes;
         }
         function removeSubtypes(types, hasObjectTypes) {
+            var id = getTypeListId(types);
+            var match = subtypeReductionCache.get(id);
+            if (match) {
+                return match;
+            }
             // We assume that redundant primitive types have already been removed from the types array and that there
             // are no any and unknown types in the array. Thus, the only possible supertypes for primitive types are empty
             // object types, and if none of those are present we can exclude primitive types from the subtype check.
@@ -55642,8 +59368,15 @@ var ts;
                 i--;
                 var source = types[i];
                 if (hasEmptyObject || source.flags & 469499904 /* StructuredOrInstantiable */) {
-                    for (var _i = 0, types_11 = types; _i < types_11.length; _i++) {
-                        var target = types_11[_i];
+                    // Find the first property with a unit type, if any. When constituents have a property by the same name
+                    // but of a different unit type, we can quickly disqualify them from subtype checks. This helps subtype
+                    // reduction of large discriminated union types.
+                    var keyProperty = source.flags & (524288 /* Object */ | 2097152 /* Intersection */ | 58982400 /* InstantiableNonPrimitive */) ?
+                        ts.find(getPropertiesOfType(source), function (p) { return isUnitType(getTypeOfSymbol(p)); }) :
+                        undefined;
+                    var keyPropertyType = keyProperty && getRegularTypeOfLiteralType(getTypeOfSymbol(keyProperty));
+                    for (var _i = 0, types_10 = types; _i < types_10.length; _i++) {
+                        var target = types_10[_i];
                         if (source !== target) {
                             if (count === 100000) {
                                 // After 100000 subtype checks we estimate the remaining amount of work by assuming the
@@ -55654,10 +59387,16 @@ var ts;
                                 if (estimatedCount > 1000000) {
                                     ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.instant("checkTypes" /* CheckTypes */, "removeSubtypes_DepthLimit", { typeIds: types.map(function (t) { return t.id; }) });
                                     error(currentNode, ts.Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent);
-                                    return false;
+                                    return undefined;
                                 }
                             }
                             count++;
+                            if (keyProperty && target.flags & (524288 /* Object */ | 2097152 /* Intersection */ | 58982400 /* InstantiableNonPrimitive */)) {
+                                var t = getTypeOfPropertyOfType(target, keyProperty.escapedName);
+                                if (t && isUnitType(t) && getRegularTypeOfLiteralType(t) !== keyPropertyType) {
+                                    continue;
+                                }
+                            }
                             if (isTypeRelatedTo(source, target, strictSubtypeRelation) && (!(ts.getObjectFlags(getTargetType(source)) & 1 /* Class */) ||
                                 !(ts.getObjectFlags(getTargetType(target)) & 1 /* Class */) ||
                                 isTypeDerivedFrom(source, target))) {
@@ -55668,7 +59407,8 @@ var ts;
                     }
                 }
             }
-            return true;
+            subtypeReductionCache.set(id, types);
+            return types;
         }
         function removeRedundantLiteralTypes(types, includes, reduceVoidUndefined) {
             var i = types.length;
@@ -55676,7 +59416,7 @@ var ts;
                 i--;
                 var t = types[i];
                 var flags = t.flags;
-                var remove = flags & 128 /* StringLiteral */ && includes & 4 /* String */ ||
+                var remove = flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && includes & 4 /* String */ ||
                     flags & 256 /* NumberLiteral */ && includes & 8 /* Number */ ||
                     flags & 2048 /* BigIntLiteral */ && includes & 64 /* BigInt */ ||
                     flags & 8192 /* UniqueESSymbol */ && includes & 4096 /* ESSymbol */ ||
@@ -55691,15 +59431,15 @@ var ts;
             var templates = ts.filter(types, isPatternLiteralType);
             if (templates.length) {
                 var i = types.length;
-                var _loop_14 = function () {
+                var _loop_16 = function () {
                     i--;
                     var t = types[i];
-                    if (t.flags & 128 /* StringLiteral */ && ts.some(templates, function (template) { return isTypeSubtypeOf(t, template); })) {
+                    if (t.flags & 128 /* StringLiteral */ && ts.some(templates, function (template) { return isTypeMatchedByTemplateLiteralType(t, template); })) {
                         ts.orderedRemoveItemAt(types, i);
                     }
                 };
                 while (i > 0) {
-                    _loop_14();
+                    _loop_16();
                 }
             }
         }
@@ -55707,8 +59447,8 @@ var ts;
             return !!(type.flags & 1048576 /* Union */ && (type.aliasSymbol || type.origin));
         }
         function addNamedUnions(namedUnions, types) {
-            for (var _i = 0, types_12 = types; _i < types_12.length; _i++) {
-                var t = types_12[_i];
+            for (var _i = 0, types_11 = types; _i < types_11.length; _i++) {
+                var t = types_11[_i];
                 if (t.flags & 1048576 /* Union */) {
                     var origin = t.origin;
                     if (t.aliasSymbol || origin && !(origin.flags & 1048576 /* Union */)) {
@@ -55744,18 +59484,25 @@ var ts;
             var includes = addTypesToUnion(typeSet, 0, types);
             if (unionReduction !== 0 /* None */) {
                 if (includes & 3 /* AnyOrUnknown */) {
-                    return includes & 1 /* Any */ ? includes & 8388608 /* IncludesWildcard */ ? wildcardType : anyType : unknownType;
+                    return includes & 1 /* Any */ ?
+                        includes & 8388608 /* IncludesWildcard */ ? wildcardType : anyType :
+                        includes & 65536 /* Null */ || containsType(typeSet, unknownType) ? unknownType : nonNullUnknownType;
                 }
-                if (unionReduction & (1 /* Literal */ | 2 /* Subtype */)) {
-                    if (includes & (2944 /* Literal */ | 8192 /* UniqueESSymbol */) || includes & 16384 /* Void */ && includes & 32768 /* Undefined */) {
-                        removeRedundantLiteralTypes(typeSet, includes, !!(unionReduction & 2 /* Subtype */));
-                    }
-                    if (includes & 128 /* StringLiteral */ && includes & 134217728 /* TemplateLiteral */) {
-                        removeStringLiteralsMatchedByTemplateLiterals(typeSet);
+                if (exactOptionalPropertyTypes && includes & 32768 /* Undefined */) {
+                    var missingIndex = ts.binarySearch(typeSet, missingType, getTypeId, ts.compareValues);
+                    if (missingIndex >= 0 && containsType(typeSet, undefinedType)) {
+                        ts.orderedRemoveItemAt(typeSet, missingIndex);
                     }
                 }
-                if (unionReduction & 2 /* Subtype */) {
-                    if (!removeSubtypes(typeSet, !!(includes & 524288 /* Object */))) {
+                if (includes & (2944 /* Literal */ | 8192 /* UniqueESSymbol */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) || includes & 16384 /* Void */ && includes & 32768 /* Undefined */) {
+                    removeRedundantLiteralTypes(typeSet, includes, !!(unionReduction & 2 /* Subtype */));
+                }
+                if (includes & 128 /* StringLiteral */ && includes & 134217728 /* TemplateLiteral */) {
+                    removeStringLiteralsMatchedByTemplateLiterals(typeSet);
+                }
+                if (unionReduction === 2 /* Subtype */) {
+                    typeSet = removeSubtypes(typeSet, !!(includes & 524288 /* Object */));
+                    if (!typeSet) {
                         return errorType;
                     }
                 }
@@ -55769,14 +59516,14 @@ var ts;
                 var namedUnions = [];
                 addNamedUnions(namedUnions, types);
                 var reducedTypes = [];
-                var _loop_15 = function (t) {
+                var _loop_17 = function (t) {
                     if (!ts.some(namedUnions, function (union) { return containsType(union.types, t); })) {
                         reducedTypes.push(t);
                     }
                 };
                 for (var _i = 0, typeSet_1 = typeSet; _i < typeSet_1.length; _i++) {
                     var t = typeSet_1[_i];
-                    _loop_15(t);
+                    _loop_17(t);
                 }
                 if (!aliasSymbol && namedUnions.length === 1 && reducedTypes.length === 0) {
                     return namedUnions[0];
@@ -55792,18 +59539,23 @@ var ts;
                     origin = createOriginUnionOrIntersectionType(1048576 /* Union */, reducedTypes);
                 }
             }
-            var objectFlags = (includes & 468598819 /* NotPrimitiveUnion */ ? 0 : 262144 /* PrimitiveUnion */) |
-                (includes & 2097152 /* Intersection */ ? 268435456 /* ContainsIntersections */ : 0);
+            var objectFlags = (includes & 36323363 /* NotPrimitiveUnion */ ? 0 : 65536 /* PrimitiveUnion */) |
+                (includes & 2097152 /* Intersection */ ? 33554432 /* ContainsIntersections */ : 0);
             return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments, origin);
         }
-        function getUnionTypePredicate(signatures) {
+        function getUnionOrIntersectionTypePredicate(signatures, kind) {
             var first;
             var types = [];
             for (var _i = 0, signatures_6 = signatures; _i < signatures_6.length; _i++) {
                 var sig = signatures_6[_i];
                 var pred = getTypePredicateOfSignature(sig);
                 if (!pred || pred.kind === 2 /* AssertsThis */ || pred.kind === 3 /* AssertsIdentifier */) {
-                    continue;
+                    if (kind !== 2097152 /* Intersection */) {
+                        continue;
+                    }
+                    else {
+                        return; // intersections demand all members be type predicates for the result to have a predicate
+                    }
                 }
                 if (first) {
                     if (!typePredicateKindsMatch(first, pred)) {
@@ -55817,24 +59569,15 @@ var ts;
                 types.push(pred.type);
             }
             if (!first) {
-                // No union signatures had a type predicate.
+                // No signatures had a type predicate.
                 return undefined;
             }
-            var unionType = getUnionType(types);
-            return createTypePredicate(first.kind, first.parameterName, first.parameterIndex, unionType);
+            var compositeType = getUnionOrIntersectionType(types, kind);
+            return createTypePredicate(first.kind, first.parameterName, first.parameterIndex, compositeType);
         }
         function typePredicateKindsMatch(a, b) {
             return a.kind === b.kind && a.parameterIndex === b.parameterIndex;
         }
-        function createUnionType(types, aliasSymbol, aliasTypeArguments, origin) {
-            var result = createType(1048576 /* Union */);
-            result.objectFlags = getPropagatingFlagsOfTypes(types, /*excludeKinds*/ 98304 /* Nullable */);
-            result.types = types;
-            result.origin = origin;
-            result.aliasSymbol = aliasSymbol;
-            result.aliasTypeArguments = aliasTypeArguments;
-            return result;
-        }
         // This function assumes the constituent type list is sorted and deduplicated.
         function getUnionTypeFromSortedList(types, objectFlags, aliasSymbol, aliasTypeArguments, origin) {
             if (types.length === 0) {
@@ -55844,14 +59587,22 @@ var ts;
                 return types[0];
             }
             var typeKey = !origin ? getTypeListId(types) :
-                origin.flags & 1048576 /* Union */ ? "|" + getTypeListId(origin.types) :
-                    origin.flags & 2097152 /* Intersection */ ? "&" + getTypeListId(origin.types) :
-                        "#" + origin.type.id;
+                origin.flags & 1048576 /* Union */ ? "|".concat(getTypeListId(origin.types)) :
+                    origin.flags & 2097152 /* Intersection */ ? "&".concat(getTypeListId(origin.types)) :
+                        "#".concat(origin.type.id, "|").concat(getTypeListId(types)); // origin type id alone is insufficient, as `keyof x` may resolve to multiple WIP values while `x` is still resolving
             var id = typeKey + getAliasId(aliasSymbol, aliasTypeArguments);
             var type = unionTypes.get(id);
             if (!type) {
-                type = createUnionType(types, aliasSymbol, aliasTypeArguments, origin);
-                type.objectFlags |= objectFlags;
+                type = createType(1048576 /* Union */);
+                type.objectFlags = objectFlags | getPropagatingFlagsOfTypes(types, /*excludeKinds*/ 98304 /* Nullable */);
+                type.types = types;
+                type.origin = origin;
+                type.aliasSymbol = aliasSymbol;
+                type.aliasTypeArguments = aliasTypeArguments;
+                if (types.length === 2 && types[0].flags & 512 /* BooleanLiteral */ && types[1].flags & 512 /* BooleanLiteral */) {
+                    type.flags |= 16 /* Boolean */;
+                    type.intrinsicName = "boolean";
+                }
                 unionTypes.set(id, type);
             }
             return type;
@@ -55880,13 +59631,19 @@ var ts;
                     if (type === wildcardType)
                         includes |= 8388608 /* IncludesWildcard */;
                 }
-                else if ((strictNullChecks || !(flags & 98304 /* Nullable */)) && !typeSet.has(type.id.toString())) {
-                    if (type.flags & 109440 /* Unit */ && includes & 109440 /* Unit */) {
-                        // We have seen two distinct unit types which means we should reduce to an
-                        // empty intersection. Adding TypeFlags.NonPrimitive causes that to happen.
-                        includes |= 67108864 /* NonPrimitive */;
+                else if (strictNullChecks || !(flags & 98304 /* Nullable */)) {
+                    if (exactOptionalPropertyTypes && type === missingType) {
+                        includes |= 262144 /* IncludesMissingType */;
+                        type = undefinedType;
+                    }
+                    if (!typeSet.has(type.id.toString())) {
+                        if (type.flags & 109440 /* Unit */ && includes & 109440 /* Unit */) {
+                            // We have seen two distinct unit types which means we should reduce to an
+                            // empty intersection. Adding TypeFlags.NonPrimitive causes that to happen.
+                            includes |= 67108864 /* NonPrimitive */;
+                        }
+                        typeSet.set(type.id.toString(), type);
                     }
-                    typeSet.set(type.id.toString(), type);
                 }
                 includes |= flags & 205258751 /* IncludesMask */;
             }
@@ -55895,8 +59652,8 @@ var ts;
         // Add the given types to the given type set. Order is preserved, freshness is removed from literal
         // types, duplicates are removed, and nested types of the given kind are flattened into the set.
         function addTypesToIntersection(typeSet, includes, types) {
-            for (var _i = 0, types_13 = types; _i < types_13.length; _i++) {
-                var type = types_13[_i];
+            for (var _i = 0, types_12 = types; _i < types_12.length; _i++) {
+                var type = types_12[_i];
                 includes = addTypeToIntersection(typeSet, includes, getRegularTypeOfLiteralType(type));
             }
             return includes;
@@ -55959,21 +59716,20 @@ var ts;
             }
             return false;
         }
-        function extractIrreducible(types, flag) {
-            if (ts.every(types, function (t) { return !!(t.flags & 1048576 /* Union */) && ts.some(t.types, function (tt) { return !!(tt.flags & flag); }); })) {
-                for (var i = 0; i < types.length; i++) {
-                    types[i] = filterType(types[i], function (t) { return !(t.flags & flag); });
-                }
-                return true;
+        function eachIsUnionContaining(types, flag) {
+            return ts.every(types, function (t) { return !!(t.flags & 1048576 /* Union */) && ts.some(t.types, function (tt) { return !!(tt.flags & flag); }); });
+        }
+        function removeFromEach(types, flag) {
+            for (var i = 0; i < types.length; i++) {
+                types[i] = filterType(types[i], function (t) { return !(t.flags & flag); });
             }
-            return false;
         }
         // If the given list of types contains more than one union of primitive types, replace the
         // first with a union containing an intersection of those primitive types, then remove the
         // other unions and return true. Otherwise, do nothing and return false.
         function intersectUnionsOfPrimitiveTypes(types) {
             var unionTypes;
-            var index = ts.findIndex(types, function (t) { return !!(ts.getObjectFlags(t) & 262144 /* PrimitiveUnion */); });
+            var index = ts.findIndex(types, function (t) { return !!(ts.getObjectFlags(t) & 65536 /* PrimitiveUnion */); });
             if (index < 0) {
                 return false;
             }
@@ -55982,7 +59738,7 @@ var ts;
             // the unionTypes array.
             while (i < types.length) {
                 var t = types[i];
-                if (ts.getObjectFlags(t) & 262144 /* PrimitiveUnion */) {
+                if (ts.getObjectFlags(t) & 65536 /* PrimitiveUnion */) {
                     (unionTypes || (unionTypes = [types[index]])).push(t);
                     ts.orderedRemoveItemAt(types, i);
                 }
@@ -56011,7 +59767,7 @@ var ts;
                 }
             }
             // Finally replace the first union with the result
-            types[index] = getUnionTypeFromSortedList(result, 262144 /* PrimitiveUnion */);
+            types[index] = getUnionTypeFromSortedList(result, 65536 /* PrimitiveUnion */);
             return true;
         }
         function createIntersectionType(types, aliasSymbol, aliasTypeArguments) {
@@ -56045,8 +59801,10 @@ var ts;
             // a symbol-like type and a type known to be non-symbol-like, or
             // a void-like type and a type known to be non-void-like, or
             // a non-primitive type and a type known to be primitive.
-            if (includes & 131072 /* Never */ ||
-                strictNullChecks && includes & 98304 /* Nullable */ && includes & (524288 /* Object */ | 67108864 /* NonPrimitive */ | 16777216 /* IncludesEmptyObject */) ||
+            if (includes & 131072 /* Never */) {
+                return ts.contains(typeSet, silentNeverType) ? silentNeverType : neverType;
+            }
+            if (strictNullChecks && includes & 98304 /* Nullable */ && includes & (524288 /* Object */ | 67108864 /* NonPrimitive */ | 16777216 /* IncludesEmptyObject */) ||
                 includes & 67108864 /* NonPrimitive */ && includes & (469892092 /* DisjointDomains */ & ~67108864 /* NonPrimitive */) ||
                 includes & 402653316 /* StringLike */ && includes & (469892092 /* DisjointDomains */ & ~402653316 /* StringLike */) ||
                 includes & 296 /* NumberLike */ && includes & (469892092 /* DisjointDomains */ & ~296 /* NumberLike */) ||
@@ -56073,6 +59831,9 @@ var ts;
             if (includes & 16777216 /* IncludesEmptyObject */ && includes & 524288 /* Object */) {
                 ts.orderedRemoveItemAt(typeSet, ts.findIndex(typeSet, isEmptyAnonymousObjectType));
             }
+            if (includes & 262144 /* IncludesMissingType */) {
+                typeSet[typeSet.indexOf(undefinedType)] = missingType;
+            }
             if (typeSet.length === 0) {
                 return unknownType;
             }
@@ -56089,10 +59850,13 @@ var ts;
                         // reduced we'll never reduce again, so this occurs at most once.
                         result = getIntersectionType(typeSet, aliasSymbol, aliasTypeArguments);
                     }
-                    else if (extractIrreducible(typeSet, 32768 /* Undefined */)) {
-                        result = getUnionType([getIntersectionType(typeSet), undefinedType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
+                    else if (eachIsUnionContaining(typeSet, 32768 /* Undefined */)) {
+                        var undefinedOrMissingType = exactOptionalPropertyTypes && ts.some(typeSet, function (t) { return containsType(t.types, missingType); }) ? missingType : undefinedType;
+                        removeFromEach(typeSet, 32768 /* Undefined */);
+                        result = getUnionType([getIntersectionType(typeSet), undefinedOrMissingType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
                     }
-                    else if (extractIrreducible(typeSet, 65536 /* Null */)) {
+                    else if (eachIsUnionContaining(typeSet, 65536 /* Null */)) {
+                        removeFromEach(typeSet, 65536 /* Null */);
                         result = getUnionType([getIntersectionType(typeSet), nullType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
                     }
                     else {
@@ -56172,54 +59936,89 @@ var ts;
                 type.resolvedStringIndexType || (type.resolvedStringIndexType = createIndexType(type, /*stringsOnly*/ true)) :
                 type.resolvedIndexType || (type.resolvedIndexType = createIndexType(type, /*stringsOnly*/ false));
         }
-        function instantiateTypeAsMappedNameType(nameType, type, t) {
-            return instantiateType(nameType, appendTypeMapping(type.mapper, getTypeParameterFromMappedType(type), t));
-        }
-        function getIndexTypeForMappedType(type, noIndexSignatures) {
-            var constraint = filterType(getConstraintTypeFromMappedType(type), function (t) { return !(noIndexSignatures && t.flags & (1 /* Any */ | 4 /* String */)); });
-            var nameType = type.declaration.nameType && getTypeFromTypeNode(type.declaration.nameType);
-            // If the constraint is exclusively string/number/never type(s), we need to pull the property names from the modified type and run them through the `nameType` mapper as well
-            // since they won't appear in the constraint, due to subtype reducing with the string/number index types
-            var properties = nameType && everyType(constraint, function (t) { return !!(t.flags & (4 /* String */ | 8 /* Number */ | 131072 /* Never */)); }) && getPropertiesOfType(getApparentType(getModifiersTypeFromMappedType(type)));
-            return nameType ?
-                getUnionType([mapType(constraint, function (t) { return instantiateTypeAsMappedNameType(nameType, type, t); }), mapType(getUnionType(ts.map(properties || ts.emptyArray, function (p) { return getLiteralTypeFromProperty(p, 8576 /* StringOrNumberLiteralOrUnique */); })), function (t) { return instantiateTypeAsMappedNameType(nameType, type, t); })]) :
-                constraint;
+        /**
+         * This roughly mirrors `resolveMappedTypeMembers` in the nongeneric case, except only reports a union of the keys calculated,
+         * rather than manufacturing the properties. We can't just fetch the `constraintType` since that would ignore mappings
+         * and mapping the `constraintType` directly ignores how mapped types map _properties_ and not keys (thus ignoring subtype
+         * reduction in the constraintType) when possible.
+         * @param noIndexSignatures Indicates if _string_ index signatures should be elided. (other index signatures are always reported)
+         */
+        function getIndexTypeForMappedType(type, stringsOnly, noIndexSignatures) {
+            var typeParameter = getTypeParameterFromMappedType(type);
+            var constraintType = getConstraintTypeFromMappedType(type);
+            var nameType = getNameTypeFromMappedType(type.target || type);
+            if (!nameType && !noIndexSignatures) {
+                // no mapping and no filtering required, just quickly bail to returning the constraint in the common case
+                return constraintType;
+            }
+            var keyTypes = [];
+            if (isMappedTypeWithKeyofConstraintDeclaration(type)) {
+                // We have a { [P in keyof T]: X }
+                // `getApparentType` on the T in a generic mapped type can trigger a circularity
+                // (conditionals and `infer` types create a circular dependency in the constraint resolution)
+                // so we only eagerly manifest the keys if the constraint is nongeneric
+                if (!isGenericIndexType(constraintType)) {
+                    var modifiersType = getApparentType(getModifiersTypeFromMappedType(type)); // The 'T' in 'keyof T'
+                    forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(modifiersType, 8576 /* StringOrNumberLiteralOrUnique */, stringsOnly, addMemberForKeyType);
+                }
+                else {
+                    // we have a generic index and a homomorphic mapping (but a distributive key remapping) - we need to defer the whole `keyof whatever` for later
+                    // since it's not safe to resolve the shape of modifier type
+                    return getIndexTypeForGenericType(type, stringsOnly);
+                }
+            }
+            else {
+                forEachType(getLowerBoundOfKeyType(constraintType), addMemberForKeyType);
+            }
+            if (isGenericIndexType(constraintType)) { // include the generic component in the resulting type
+                forEachType(constraintType, addMemberForKeyType);
+            }
+            // we had to pick apart the constraintType to potentially map/filter it - compare the final resulting list with the original constraintType,
+            // so we can return the union that preserves aliases/origin data if possible
+            var result = noIndexSignatures ? filterType(getUnionType(keyTypes), function (t) { return !(t.flags & (1 /* Any */ | 4 /* String */)); }) : getUnionType(keyTypes);
+            if (result.flags & 1048576 /* Union */ && constraintType.flags & 1048576 /* Union */ && getTypeListId(result.types) === getTypeListId(constraintType.types)) {
+                return constraintType;
+            }
+            return result;
+            function addMemberForKeyType(keyType) {
+                var propNameType = nameType ? instantiateType(nameType, appendTypeMapping(type.mapper, typeParameter, keyType)) : keyType;
+                // `keyof` currently always returns `string | number` for concrete `string` index signatures - the below ternary keeps that behavior for mapped types
+                // See `getLiteralTypeFromProperties` where there's a similar ternary to cause the same behavior.
+                keyTypes.push(propNameType === stringType ? stringOrNumberType : propNameType);
+            }
         }
         // Ordinarily we reduce a keyof M, where M is a mapped type { [P in K as N<P>]: X }, to simply N<K>. This however presumes
-        // that N distributes over union types, i.e. that N<A | B | C> is equivalent to N<A> | N<B> | N<C>. That presumption may not
-        // be true when N is a non-distributive conditional type or an instantiable type with a non-distributive conditional type as
-        // a constituent. In those cases, we cannot reduce keyof M and need to preserve it as is.
-        function maybeNonDistributiveNameType(type) {
-            return !!(type && (type.flags & 16777216 /* Conditional */ && (!type.root.isDistributive || maybeNonDistributiveNameType(type.checkType)) ||
-                type.flags & (3145728 /* UnionOrIntersection */ | 134217728 /* TemplateLiteral */) && ts.some(type.types, maybeNonDistributiveNameType) ||
-                type.flags & (4194304 /* Index */ | 268435456 /* StringMapping */) && maybeNonDistributiveNameType(type.type) ||
-                type.flags & 8388608 /* IndexedAccess */ && maybeNonDistributiveNameType(type.indexType) ||
-                type.flags & 33554432 /* Substitution */ && maybeNonDistributiveNameType(type.substitute)));
+        // that N distributes over union types, i.e. that N<A | B | C> is equivalent to N<A> | N<B> | N<C>. Specifically, we only
+        // want to perform the reduction when the name type of a mapped type is distributive with respect to the type variable
+        // introduced by the 'in' clause of the mapped type. Note that non-generic types are considered to be distributive because
+        // they're the same type regardless of what's being distributed over.
+        function hasDistributiveNameType(mappedType) {
+            var typeVariable = getTypeParameterFromMappedType(mappedType);
+            return isDistributive(getNameTypeFromMappedType(mappedType) || typeVariable);
+            function isDistributive(type) {
+                return type.flags & (3 /* AnyOrUnknown */ | 131068 /* Primitive */ | 131072 /* Never */ | 262144 /* TypeParameter */ | 524288 /* Object */ | 67108864 /* NonPrimitive */) ? true :
+                    type.flags & 16777216 /* Conditional */ ? type.root.isDistributive && type.checkType === typeVariable :
+                        type.flags & (3145728 /* UnionOrIntersection */ | 134217728 /* TemplateLiteral */) ? ts.every(type.types, isDistributive) :
+                            type.flags & 8388608 /* IndexedAccess */ ? isDistributive(type.objectType) && isDistributive(type.indexType) :
+                                type.flags & 33554432 /* Substitution */ ? isDistributive(type.substitute) :
+                                    type.flags & 268435456 /* StringMapping */ ? isDistributive(type.type) :
+                                        false;
+            }
         }
         function getLiteralTypeFromPropertyName(name) {
             if (ts.isPrivateIdentifier(name)) {
                 return neverType;
             }
-            return ts.isIdentifier(name) ? getLiteralType(ts.unescapeLeadingUnderscores(name.escapedText)) :
+            return ts.isIdentifier(name) ? getStringLiteralType(ts.unescapeLeadingUnderscores(name.escapedText)) :
                 getRegularTypeOfLiteralType(ts.isComputedPropertyName(name) ? checkComputedPropertyName(name) : checkExpression(name));
         }
-        function getBigIntLiteralType(node) {
-            return getLiteralType({
-                negative: false,
-                base10Value: ts.parsePseudoBigInt(node.text)
-            });
-        }
-        function getLiteralTypeFromProperty(prop, include) {
-            if (!(ts.getDeclarationModifierFlagsFromSymbol(prop) & 24 /* NonPublicAccessibilityModifier */)) {
+        function getLiteralTypeFromProperty(prop, include, includeNonPublic) {
+            if (includeNonPublic || !(ts.getDeclarationModifierFlagsFromSymbol(prop) & 24 /* NonPublicAccessibilityModifier */)) {
                 var type = getSymbolLinks(getLateBoundSymbol(prop)).nameType;
-                if (!type && !ts.isKnownSymbol(prop)) {
-                    if (prop.escapedName === "default" /* Default */) {
-                        type = getLiteralType("default");
-                    }
-                    else {
-                        var name = prop.valueDeclaration && ts.getNameOfDeclaration(prop.valueDeclaration);
-                        type = name && getLiteralTypeFromPropertyName(name) || getLiteralType(ts.symbolName(prop));
-                    }
+                if (!type) {
+                    var name = ts.getNameOfDeclaration(prop.valueDeclaration);
+                    type = prop.escapedName === "default" /* Default */ ? getStringLiteralType("default") :
+                        name && getLiteralTypeFromPropertyName(name) || (!ts.isKnownSymbol(prop) ? getStringLiteralType(ts.symbolName(prop)) : undefined);
                 }
                 if (type && type.flags & include) {
                     return type;
@@ -56227,30 +60026,28 @@ var ts;
             }
             return neverType;
         }
+        function isKeyTypeIncluded(keyType, include) {
+            return !!(keyType.flags & include || keyType.flags & 2097152 /* Intersection */ && ts.some(keyType.types, function (t) { return isKeyTypeIncluded(t, include); }));
+        }
         function getLiteralTypeFromProperties(type, include, includeOrigin) {
             var origin = includeOrigin && (ts.getObjectFlags(type) & (3 /* ClassOrInterface */ | 4 /* Reference */) || type.aliasSymbol) ? createOriginIndexType(type) : undefined;
-            return getUnionType(ts.map(getPropertiesOfType(type), function (p) { return getLiteralTypeFromProperty(p, include); }), 1 /* Literal */, 
+            var propertyTypes = ts.map(getPropertiesOfType(type), function (prop) { return getLiteralTypeFromProperty(prop, include); });
+            var indexKeyTypes = ts.map(getIndexInfosOfType(type), function (info) { return info !== enumNumberIndexInfo && isKeyTypeIncluded(info.keyType, include) ?
+                info.keyType === stringType && include & 8 /* Number */ ? stringOrNumberType : info.keyType : neverType; });
+            return getUnionType(ts.concatenate(propertyTypes, indexKeyTypes), 1 /* Literal */, 
             /*aliasSymbol*/ undefined, /*aliasTypeArguments*/ undefined, origin);
         }
-        function getNonEnumNumberIndexInfo(type) {
-            var numberIndexInfo = getIndexInfoOfType(type, 1 /* Number */);
-            return numberIndexInfo !== enumNumberIndexInfo ? numberIndexInfo : undefined;
-        }
         function getIndexType(type, stringsOnly, noIndexSignatures) {
             if (stringsOnly === void 0) { stringsOnly = keyofStringsOnly; }
-            var includeOrigin = stringsOnly === keyofStringsOnly && !noIndexSignatures;
             type = getReducedType(type);
             return type.flags & 1048576 /* Union */ ? getIntersectionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) :
                 type.flags & 2097152 /* Intersection */ ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) :
-                    type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericTupleType(type) || isGenericMappedType(type) && maybeNonDistributiveNameType(getNameTypeFromMappedType(type)) ? getIndexTypeForGenericType(type, stringsOnly) :
-                        ts.getObjectFlags(type) & 32 /* Mapped */ ? getIndexTypeForMappedType(type, noIndexSignatures) :
+                    type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericTupleType(type) || isGenericMappedType(type) && !hasDistributiveNameType(type) ? getIndexTypeForGenericType(type, stringsOnly) :
+                        ts.getObjectFlags(type) & 32 /* Mapped */ ? getIndexTypeForMappedType(type, stringsOnly, noIndexSignatures) :
                             type === wildcardType ? wildcardType :
                                 type.flags & 2 /* Unknown */ ? neverType :
                                     type.flags & (1 /* Any */ | 131072 /* Never */) ? keyofConstraintType :
-                                        stringsOnly ? !noIndexSignatures && getIndexInfoOfType(type, 0 /* String */) ? stringType : getLiteralTypeFromProperties(type, 128 /* StringLiteral */, includeOrigin) :
-                                            !noIndexSignatures && getIndexInfoOfType(type, 0 /* String */) ? getUnionType([stringType, numberType, getLiteralTypeFromProperties(type, 8192 /* UniqueESSymbol */, includeOrigin)]) :
-                                                getNonEnumNumberIndexInfo(type) ? getUnionType([numberType, getLiteralTypeFromProperties(type, 128 /* StringLiteral */ | 8192 /* UniqueESSymbol */, includeOrigin)]) :
-                                                    getLiteralTypeFromProperties(type, 8576 /* StringOrNumberLiteralOrUnique */, includeOrigin);
+                                        getLiteralTypeFromProperties(type, (noIndexSignatures ? 128 /* StringLiteral */ : 402653316 /* StringLike */) | (stringsOnly ? 0 : 296 /* NumberLike */ | 12288 /* ESSymbolLike */), stringsOnly === keyofStringsOnly && !noIndexSignatures);
         }
         function getExtractStringType(type) {
             if (keyofStringsOnly) {
@@ -56267,15 +60064,15 @@ var ts;
             var links = getNodeLinks(node);
             if (!links.resolvedType) {
                 switch (node.operator) {
-                    case 138 /* KeyOfKeyword */:
+                    case 140 /* KeyOfKeyword */:
                         links.resolvedType = getIndexType(getTypeFromTypeNode(node.type));
                         break;
-                    case 151 /* UniqueKeyword */:
-                        links.resolvedType = node.type.kind === 148 /* SymbolKeyword */
+                    case 153 /* UniqueKeyword */:
+                        links.resolvedType = node.type.kind === 150 /* SymbolKeyword */
                             ? getESSymbolLikeTypeForNode(ts.walkUpParenthesizedTypes(node.parent))
                             : errorType;
                         break;
-                    case 142 /* ReadonlyKeyword */:
+                    case 144 /* ReadonlyKeyword */:
                         links.resolvedType = getTypeFromTypeNode(node.type);
                         break;
                     default:
@@ -56287,7 +60084,7 @@ var ts;
         function getTypeFromTemplateTypeNode(node) {
             var links = getNodeLinks(node);
             if (!links.resolvedType) {
-                links.resolvedType = getTemplateLiteralType(__spreadArray([node.head.text], ts.map(node.templateSpans, function (span) { return span.literal.text; })), ts.map(node.templateSpans, function (span) { return getTypeFromTypeNode(span.type); }));
+                links.resolvedType = getTemplateLiteralType(__spreadArray([node.head.text], ts.map(node.templateSpans, function (span) { return span.literal.text; }), true), ts.map(node.templateSpans, function (span) { return getTypeFromTypeNode(span.type); }));
             }
             return links.resolvedType;
         }
@@ -56308,13 +60105,13 @@ var ts;
                 return stringType;
             }
             if (newTypes.length === 0) {
-                return getLiteralType(text);
+                return getStringLiteralType(text);
             }
             newTexts.push(text);
             if (ts.every(newTexts, function (t) { return t === ""; }) && ts.every(newTypes, function (t) { return !!(t.flags & 4 /* String */); })) {
                 return stringType;
             }
-            var id = getTypeListId(newTypes) + "|" + ts.map(newTexts, function (t) { return t.length; }).join(",") + "|" + newTexts.join("");
+            var id = "".concat(getTypeListId(newTypes), "|").concat(ts.map(newTexts, function (t) { return t.length; }).join(","), "|").concat(newTexts.join(""));
             var type = templateLiteralTypes.get(id);
             if (!type) {
                 templateLiteralTypes.set(id, type = createTemplateLiteralType(newTexts, newTypes));
@@ -56349,10 +60146,8 @@ var ts;
             return type.flags & 128 /* StringLiteral */ ? type.value :
                 type.flags & 256 /* NumberLiteral */ ? "" + type.value :
                     type.flags & 2048 /* BigIntLiteral */ ? ts.pseudoBigIntToString(type.value) :
-                        type.flags & 512 /* BooleanLiteral */ ? type.intrinsicName :
-                            type.flags & 65536 /* Null */ ? "null" :
-                                type.flags & 32768 /* Undefined */ ? "undefined" :
-                                    undefined;
+                        type.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) ? type.intrinsicName :
+                            undefined;
         }
         function createTemplateLiteralType(texts, types) {
             var type = createType(134217728 /* TemplateLiteral */);
@@ -56363,7 +60158,7 @@ var ts;
         function getStringMappingType(symbol, type) {
             return type.flags & (1048576 /* Union */ | 131072 /* Never */) ? mapType(type, function (t) { return getStringMappingType(symbol, t); }) :
                 isGenericIndexType(type) ? getStringMappingTypeForGenericType(symbol, type) :
-                    type.flags & 128 /* StringLiteral */ ? getLiteralType(applyStringMapping(symbol, type.value)) :
+                    type.flags & 128 /* StringLiteral */ ? getStringLiteralType(applyStringMapping(symbol, type.value)) :
                         type;
         }
         function applyStringMapping(symbol, str) {
@@ -56376,7 +60171,7 @@ var ts;
             return str;
         }
         function getStringMappingTypeForGenericType(symbol, type) {
-            var id = getSymbolId(symbol) + "," + getTypeId(type);
+            var id = "".concat(getSymbolId(symbol), ",").concat(getTypeId(type));
             var result = stringMappingTypes.get(id);
             if (!result) {
                 stringMappingTypes.set(id, result = createStringMappingType(symbol, type));
@@ -56389,13 +60184,13 @@ var ts;
             result.type = type;
             return result;
         }
-        function createIndexedAccessType(objectType, indexType, aliasSymbol, aliasTypeArguments, shouldIncludeUndefined) {
+        function createIndexedAccessType(objectType, indexType, accessFlags, aliasSymbol, aliasTypeArguments) {
             var type = createType(8388608 /* IndexedAccess */);
             type.objectType = objectType;
             type.indexType = indexType;
+            type.accessFlags = accessFlags;
             type.aliasSymbol = aliasSymbol;
             type.aliasTypeArguments = aliasTypeArguments;
-            type.noUncheckedIndexedAccessCandidate = shouldIncludeUndefined;
             return type;
         }
         /**
@@ -56411,7 +60206,7 @@ var ts;
             if (noImplicitAny) {
                 return false; // Flag is meaningless under `noImplicitAny` mode
             }
-            if (ts.getObjectFlags(type) & 16384 /* JSLiteral */) {
+            if (ts.getObjectFlags(type) & 8192 /* JSLiteral */) {
                 return true;
             }
             if (type.flags & 1048576 /* Union */) {
@@ -56427,15 +60222,12 @@ var ts;
             return false;
         }
         function getPropertyNameFromIndex(indexType, accessNode) {
-            var accessExpression = accessNode && accessNode.kind === 202 /* ElementAccessExpression */ ? accessNode : undefined;
             return isTypeUsableAsPropertyName(indexType) ?
                 getPropertyNameFromType(indexType) :
-                accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, /*reportError*/ false) ?
-                    ts.getPropertyNameForKnownSymbolName(ts.idText(accessExpression.argumentExpression.name)) :
-                    accessNode && ts.isPropertyName(accessNode) ?
-                        // late bound names are handled in the first branch, so here we only need to handle normal names
-                        ts.getPropertyNameForPropertyNameNode(accessNode) :
-                        undefined;
+                accessNode && ts.isPropertyName(accessNode) ?
+                    // late bound names are handled in the first branch, so here we only need to handle normal names
+                    ts.getPropertyNameForPropertyNameNode(accessNode) :
+                    undefined;
         }
         function isUncalledFunctionReference(node, symbol) {
             if (symbol.flags & (16 /* Function */ | 8192 /* Method */)) {
@@ -56447,24 +60239,27 @@ var ts;
             }
             return true;
         }
-        function getPropertyTypeForIndexType(originalObjectType, objectType, indexType, fullIndexType, suppressNoImplicitAnyError, accessNode, accessFlags, noUncheckedIndexedAccessCandidate, reportDeprecated) {
+        function getPropertyTypeForIndexType(originalObjectType, objectType, indexType, fullIndexType, accessNode, accessFlags) {
             var _a;
-            var accessExpression = accessNode && accessNode.kind === 202 /* ElementAccessExpression */ ? accessNode : undefined;
+            var accessExpression = accessNode && accessNode.kind === 206 /* ElementAccessExpression */ ? accessNode : undefined;
             var propName = accessNode && ts.isPrivateIdentifier(accessNode) ? undefined : getPropertyNameFromIndex(indexType, accessNode);
             if (propName !== undefined) {
+                if (accessFlags & 256 /* Contextual */) {
+                    return getTypeOfPropertyOfContextualType(objectType, propName) || anyType;
+                }
                 var prop = getPropertyOfType(objectType, propName);
                 if (prop) {
-                    if (reportDeprecated && accessNode && getDeclarationNodeFlagsFromSymbol(prop) & 134217728 /* Deprecated */ && isUncalledFunctionReference(accessNode, prop)) {
+                    if (accessFlags & 64 /* ReportDeprecated */ && accessNode && prop.declarations && getDeclarationNodeFlagsFromSymbol(prop) & 134217728 /* Deprecated */ && isUncalledFunctionReference(accessNode, prop)) {
                         var deprecatedNode = (_a = accessExpression === null || accessExpression === void 0 ? void 0 : accessExpression.argumentExpression) !== null && _a !== void 0 ? _a : (ts.isIndexedAccessTypeNode(accessNode) ? accessNode.indexType : accessNode);
                         addDeprecatedSuggestion(deprecatedNode, prop.declarations, propName);
                     }
                     if (accessExpression) {
-                        markPropertyAsReferenced(prop, accessExpression, /*isThisAccess*/ accessExpression.expression.kind === 107 /* ThisKeyword */);
+                        markPropertyAsReferenced(prop, accessExpression, isSelfTypeAccess(accessExpression.expression, objectType.symbol));
                         if (isAssignmentToReadonlyEntity(accessExpression, prop, ts.getAssignmentTargetKind(accessExpression))) {
                             error(accessExpression.argumentExpression, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, symbolToString(prop));
                             return undefined;
                         }
-                        if (accessFlags & 4 /* CacheSymbol */) {
+                        if (accessFlags & 8 /* CacheSymbol */) {
                             getNodeLinks(accessNode).resolvedSymbol = prop;
                         }
                         if (isThisPropertyAccessInConstructor(accessExpression, prop)) {
@@ -56477,7 +60272,7 @@ var ts;
                         propType;
                 }
                 if (everyType(objectType, isTupleType) && isNumericLiteralName(propName) && +propName >= 0) {
-                    if (accessNode && everyType(objectType, function (t) { return !t.target.hasRestElement; }) && !(accessFlags & 8 /* NoTupleBoundsCheck */)) {
+                    if (accessNode && everyType(objectType, function (t) { return !t.target.hasRestElement; }) && !(accessFlags & 16 /* NoTupleBoundsCheck */)) {
                         var indexNode = getIndexNodeForAccessExpression(accessNode);
                         if (isTupleType(objectType)) {
                             error(indexNode, ts.Diagnostics.Tuple_type_0_of_length_1_has_no_element_at_index_2, typeToString(objectType), getTypeReferenceArity(objectType), ts.unescapeLeadingUnderscores(propName));
@@ -56486,10 +60281,10 @@ var ts;
                             error(indexNode, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.unescapeLeadingUnderscores(propName), typeToString(objectType));
                         }
                     }
-                    errorIfWritingToReadonlyIndex(getIndexInfoOfType(objectType, 1 /* Number */));
+                    errorIfWritingToReadonlyIndex(getIndexInfoOfType(objectType, numberType));
                     return mapType(objectType, function (t) {
                         var restType = getRestTypeOfTupleType(t) || undefinedType;
-                        return noUncheckedIndexedAccessCandidate ? getUnionType([restType, undefinedType]) : restType;
+                        return accessFlags & 1 /* IncludeUndefined */ ? getUnionType([restType, undefinedType]) : restType;
                     });
                 }
             }
@@ -56497,22 +60292,23 @@ var ts;
                 if (objectType.flags & (1 /* Any */ | 131072 /* Never */)) {
                     return objectType;
                 }
-                var stringIndexInfo = getIndexInfoOfType(objectType, 0 /* String */);
-                var indexInfo = isTypeAssignableToKind(indexType, 296 /* NumberLike */) && getIndexInfoOfType(objectType, 1 /* Number */) || stringIndexInfo;
+                // If no index signature is applicable, we default to the string index signature. In effect, this means the string
+                // index signature applies even when accessing with a symbol-like type.
+                var indexInfo = getApplicableIndexInfo(objectType, indexType) || getIndexInfoOfType(objectType, stringType);
                 if (indexInfo) {
-                    if (accessFlags & 1 /* NoIndexSignatures */ && indexInfo === stringIndexInfo) {
+                    if (accessFlags & 2 /* NoIndexSignatures */ && indexInfo.keyType !== numberType) {
                         if (accessExpression) {
                             error(accessExpression, ts.Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(originalObjectType));
                         }
                         return undefined;
                     }
-                    if (accessNode && !isTypeAssignableToKind(indexType, 4 /* String */ | 8 /* Number */)) {
+                    if (accessNode && indexInfo.keyType === stringType && !isTypeAssignableToKind(indexType, 4 /* String */ | 8 /* Number */)) {
                         var indexNode = getIndexNodeForAccessExpression(accessNode);
                         error(indexNode, ts.Diagnostics.Type_0_cannot_be_used_as_an_index_type, typeToString(indexType));
-                        return noUncheckedIndexedAccessCandidate ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type;
+                        return accessFlags & 1 /* IncludeUndefined */ ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type;
                     }
                     errorIfWritingToReadonlyIndex(indexInfo);
-                    return noUncheckedIndexedAccessCandidate ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type;
+                    return accessFlags & 1 /* IncludeUndefined */ ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type;
                 }
                 if (indexType.flags & 131072 /* Never */) {
                     return neverType;
@@ -56536,12 +60332,12 @@ var ts;
                     if (objectType.symbol === globalThisSymbol && propName !== undefined && globalThisSymbol.exports.has(propName) && (globalThisSymbol.exports.get(propName).flags & 418 /* BlockScoped */)) {
                         error(accessExpression, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.unescapeLeadingUnderscores(propName), typeToString(objectType));
                     }
-                    else if (noImplicitAny && !compilerOptions.suppressImplicitAnyIndexErrors && !suppressNoImplicitAnyError) {
+                    else if (noImplicitAny && !compilerOptions.suppressImplicitAnyIndexErrors && !(accessFlags & 128 /* SuppressNoImplicitAnyError */)) {
                         if (propName !== undefined && typeHasStaticProperty(propName, objectType)) {
                             var typeName = typeToString(objectType);
                             error(accessExpression, ts.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead, propName, typeName, typeName + "[" + ts.getTextOfNode(accessExpression.argumentExpression) + "]");
                         }
-                        else if (getIndexTypeOfType(objectType, 1 /* Number */)) {
+                        else if (getIndexTypeOfType(objectType, numberType)) {
                             error(accessExpression.argumentExpression, ts.Diagnostics.Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number);
                         }
                         else {
@@ -56609,36 +60405,43 @@ var ts;
             }
         }
         function getIndexNodeForAccessExpression(accessNode) {
-            return accessNode.kind === 202 /* ElementAccessExpression */ ? accessNode.argumentExpression :
-                accessNode.kind === 189 /* IndexedAccessType */ ? accessNode.indexType :
-                    accessNode.kind === 158 /* ComputedPropertyName */ ? accessNode.expression :
+            return accessNode.kind === 206 /* ElementAccessExpression */ ? accessNode.argumentExpression :
+                accessNode.kind === 193 /* IndexedAccessType */ ? accessNode.indexType :
+                    accessNode.kind === 161 /* ComputedPropertyName */ ? accessNode.expression :
                         accessNode;
         }
         function isPatternLiteralPlaceholderType(type) {
-            return templateConstraintType.types.indexOf(type) !== -1 || !!(type.flags & 1 /* Any */);
+            return !!(type.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 64 /* BigInt */));
         }
         function isPatternLiteralType(type) {
             return !!(type.flags & 134217728 /* TemplateLiteral */) && ts.every(type.types, isPatternLiteralPlaceholderType);
         }
+        function isGenericType(type) {
+            return !!getGenericObjectFlags(type);
+        }
         function isGenericObjectType(type) {
-            if (type.flags & 3145728 /* UnionOrIntersection */) {
-                if (!(type.objectFlags & 4194304 /* IsGenericObjectTypeComputed */)) {
-                    type.objectFlags |= 4194304 /* IsGenericObjectTypeComputed */ |
-                        (ts.some(type.types, isGenericObjectType) ? 8388608 /* IsGenericObjectType */ : 0);
-                }
-                return !!(type.objectFlags & 8388608 /* IsGenericObjectType */);
-            }
-            return !!(type.flags & 58982400 /* InstantiableNonPrimitive */) || isGenericMappedType(type) || isGenericTupleType(type);
+            return !!(getGenericObjectFlags(type) & 8388608 /* IsGenericObjectType */);
         }
         function isGenericIndexType(type) {
+            return !!(getGenericObjectFlags(type) & 16777216 /* IsGenericIndexType */);
+        }
+        function getGenericObjectFlags(type) {
             if (type.flags & 3145728 /* UnionOrIntersection */) {
-                if (!(type.objectFlags & 16777216 /* IsGenericIndexTypeComputed */)) {
-                    type.objectFlags |= 16777216 /* IsGenericIndexTypeComputed */ |
-                        (ts.some(type.types, isGenericIndexType) ? 33554432 /* IsGenericIndexType */ : 0);
+                if (!(type.objectFlags & 4194304 /* IsGenericTypeComputed */)) {
+                    type.objectFlags |= 4194304 /* IsGenericTypeComputed */ |
+                        ts.reduceLeft(type.types, function (flags, t) { return flags | getGenericObjectFlags(t); }, 0);
+                }
+                return type.objectFlags & 25165824 /* IsGenericType */;
+            }
+            if (type.flags & 33554432 /* Substitution */) {
+                if (!(type.objectFlags & 4194304 /* IsGenericTypeComputed */)) {
+                    type.objectFlags |= 4194304 /* IsGenericTypeComputed */ |
+                        getGenericObjectFlags(type.substitute) | getGenericObjectFlags(type.baseType);
                 }
-                return !!(type.objectFlags & 33554432 /* IsGenericIndexType */);
+                return type.objectFlags & 25165824 /* IsGenericType */;
             }
-            return !!(type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */)) && !isPatternLiteralType(type);
+            return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 8388608 /* IsGenericObjectType */ : 0) |
+                (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 16777216 /* IsGenericIndexType */ : 0);
         }
         function isThisTypeParameter(type) {
             return !!(type.flags & 262144 /* TypeParameter */ && type.isThisType);
@@ -56748,9 +60551,9 @@ var ts;
             var templateMapper = combineTypeMappers(objectType.mapper, mapper);
             return instantiateType(getTemplateTypeFromMappedType(objectType), templateMapper);
         }
-        function getIndexedAccessType(objectType, indexType, noUncheckedIndexedAccessCandidate, accessNode, aliasSymbol, aliasTypeArguments, accessFlags) {
+        function getIndexedAccessType(objectType, indexType, accessFlags, accessNode, aliasSymbol, aliasTypeArguments) {
             if (accessFlags === void 0) { accessFlags = 0 /* None */; }
-            return getIndexedAccessTypeOrUndefined(objectType, indexType, noUncheckedIndexedAccessCandidate, accessNode, accessFlags, aliasSymbol, aliasTypeArguments) || (accessNode ? errorType : unknownType);
+            return getIndexedAccessTypeOrUndefined(objectType, indexType, accessFlags, accessNode, aliasSymbol, aliasTypeArguments) || (accessNode ? errorType : unknownType);
         }
         function indexTypeLessThan(indexType, limit) {
             return everyType(indexType, function (t) {
@@ -56764,36 +60567,38 @@ var ts;
                 return false;
             });
         }
-        function getIndexedAccessTypeOrUndefined(objectType, indexType, noUncheckedIndexedAccessCandidate, accessNode, accessFlags, aliasSymbol, aliasTypeArguments) {
+        function getIndexedAccessTypeOrUndefined(objectType, indexType, accessFlags, accessNode, aliasSymbol, aliasTypeArguments) {
             if (accessFlags === void 0) { accessFlags = 0 /* None */; }
             if (objectType === wildcardType || indexType === wildcardType) {
                 return wildcardType;
             }
-            var shouldIncludeUndefined = noUncheckedIndexedAccessCandidate ||
-                (!!compilerOptions.noUncheckedIndexedAccess &&
-                    (accessFlags & (2 /* Writing */ | 16 /* ExpressionPosition */)) === 16 /* ExpressionPosition */);
             // If the object type has a string index signature and no other members we know that the result will
             // always be the type of that index signature and we can simplify accordingly.
             if (isStringIndexSignatureOnlyType(objectType) && !(indexType.flags & 98304 /* Nullable */) && isTypeAssignableToKind(indexType, 4 /* String */ | 8 /* Number */)) {
                 indexType = stringType;
             }
+            // In noUncheckedIndexedAccess mode, indexed access operations that occur in an expression in a read position and resolve to
+            // an index signature have 'undefined' included in their type.
+            if (compilerOptions.noUncheckedIndexedAccess && accessFlags & 32 /* ExpressionPosition */)
+                accessFlags |= 1 /* IncludeUndefined */;
             // If the index type is generic, or if the object type is generic and doesn't originate in an expression and
             // the operation isn't exclusively indexing the fixed (non-variadic) portion of a tuple type, we are performing
             // a higher-order index access where we cannot meaningfully access the properties of the object type. Note that
             // for a generic T and a non-generic K, we eagerly resolve T[K] if it originates in an expression. This is to
             // preserve backwards compatibility. For example, an element access 'this["foo"]' has always been resolved
             // eagerly using the constraint type of 'this' at the given location.
-            if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 189 /* IndexedAccessType */ ?
+            if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 193 /* IndexedAccessType */ ?
                 isGenericTupleType(objectType) && !indexTypeLessThan(indexType, objectType.target.fixedLength) :
                 isGenericObjectType(objectType) && !(isTupleType(objectType) && indexTypeLessThan(indexType, objectType.target.fixedLength)))) {
                 if (objectType.flags & 3 /* AnyOrUnknown */) {
                     return objectType;
                 }
                 // Defer the operation by creating an indexed access type.
-                var id = objectType.id + "," + indexType.id + (shouldIncludeUndefined ? "?" : "") + getAliasId(aliasSymbol, aliasTypeArguments);
+                var persistentAccessFlags = accessFlags & 1 /* Persistent */;
+                var id = objectType.id + "," + indexType.id + "," + persistentAccessFlags + getAliasId(aliasSymbol, aliasTypeArguments);
                 var type = indexedAccessTypes.get(id);
                 if (!type) {
-                    indexedAccessTypes.set(id, type = createIndexedAccessType(objectType, indexType, aliasSymbol, aliasTypeArguments, shouldIncludeUndefined));
+                    indexedAccessTypes.set(id, type = createIndexedAccessType(objectType, indexType, persistentAccessFlags, aliasSymbol, aliasTypeArguments));
                 }
                 return type;
             }
@@ -56806,7 +60611,7 @@ var ts;
                 var wasMissingProp = false;
                 for (var _i = 0, _a = indexType.types; _i < _a.length; _i++) {
                     var t = _a[_i];
-                    var propType = getPropertyTypeForIndexType(objectType, apparentObjectType, t, indexType, wasMissingProp, accessNode, accessFlags, shouldIncludeUndefined);
+                    var propType = getPropertyTypeForIndexType(objectType, apparentObjectType, t, indexType, accessNode, accessFlags | (wasMissingProp ? 128 /* SuppressNoImplicitAnyError */ : 0));
                     if (propType) {
                         propTypes.push(propType);
                     }
@@ -56822,11 +60627,11 @@ var ts;
                 if (wasMissingProp) {
                     return undefined;
                 }
-                return accessFlags & 2 /* Writing */
+                return accessFlags & 4 /* Writing */
                     ? getIntersectionType(propTypes, aliasSymbol, aliasTypeArguments)
                     : getUnionType(propTypes, 1 /* Literal */, aliasSymbol, aliasTypeArguments);
             }
-            return getPropertyTypeForIndexType(objectType, apparentObjectType, indexType, indexType, /* supressNoImplicitAnyError */ false, accessNode, accessFlags | 4 /* CacheSymbol */, shouldIncludeUndefined, /* reportDeprecated */ true);
+            return getPropertyTypeForIndexType(objectType, apparentObjectType, indexType, indexType, accessNode, accessFlags | 8 /* CacheSymbol */ | 64 /* ReportDeprecated */);
         }
         function getTypeFromIndexedAccessTypeNode(node) {
             var links = getNodeLinks(node);
@@ -56834,7 +60639,7 @@ var ts;
                 var objectType = getTypeFromTypeNode(node.objectType);
                 var indexType = getTypeFromTypeNode(node.indexType);
                 var potentialAlias = getAliasSymbolForTypeNode(node);
-                var resolved = getIndexedAccessType(objectType, indexType, /*noUncheckedIndexedAccessCandidate*/ undefined, node, potentialAlias, getTypeArgumentsForAliasSymbol(potentialAlias));
+                var resolved = getIndexedAccessType(objectType, indexType, 0 /* None */, node, potentialAlias, getTypeArgumentsForAliasSymbol(potentialAlias));
                 links.resolvedType = resolved.flags & 8388608 /* IndexedAccess */ &&
                     resolved.objectType === objectType &&
                     resolved.indexType === indexType ?
@@ -56867,11 +60672,10 @@ var ts;
             return type;
         }
         function isTypicalNondistributiveConditional(root) {
-            return !root.isDistributive
-                && root.node.checkType.kind === 179 /* TupleType */
-                && ts.length(root.node.checkType.elements) === 1
-                && root.node.extendsType.kind === 179 /* TupleType */
-                && ts.length(root.node.extendsType.elements) === 1;
+            return !root.isDistributive && isSingletonTupleType(root.node.checkType) && isSingletonTupleType(root.node.extendsType);
+        }
+        function isSingletonTupleType(node) {
+            return ts.isTupleTypeNode(node) && ts.length(node.elements) === 1 && !ts.isOptionalTypeNode(node.elements[0]) && !ts.isRestTypeNode(node.elements[0]);
         }
         /**
          * We syntactually check for common nondistributive conditional shapes and unwrap them into
@@ -56884,13 +60688,21 @@ var ts;
         function getConditionalType(root, mapper, aliasSymbol, aliasTypeArguments) {
             var result;
             var extraTypes;
+            var tailCount = 0;
             // We loop here for an immediately nested conditional type in the false position, effectively treating
             // types of the form 'A extends B ? X : C extends D ? Y : E extends F ? Z : ...' as a single construct for
-            // purposes of resolution. This means such types aren't subject to the instatiation depth limiter.
+            // purposes of resolution. We also loop here when resolution of a conditional type ends in resolution of
+            // another (or, through recursion, possibly the same) conditional type. In the potentially tail-recursive
+            // cases we increment the tail recursion counter and stop after 1000 iterations.
             while (true) {
+                if (tailCount === 1000) {
+                    error(currentNode, ts.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite);
+                    result = errorType;
+                    break;
+                }
                 var isUnwrapped = isTypicalNondistributiveConditional(root);
-                var checkType = instantiateType(unwrapNondistributiveConditionalTuple(root, root.checkType), mapper);
-                var checkTypeInstantiable = isGenericObjectType(checkType) || isGenericIndexType(checkType);
+                var checkType = instantiateType(unwrapNondistributiveConditionalTuple(root, getActualTypeVariable(root.checkType)), mapper);
+                var checkTypeInstantiable = isGenericType(checkType);
                 var extendsType = instantiateType(unwrapNondistributiveConditionalTuple(root, root.extendsType), mapper);
                 if (checkType === wildcardType || extendsType === wildcardType) {
                     return wildcardType;
@@ -56902,14 +60714,17 @@ var ts;
                         // We don't want inferences from constraints as they may cause us to eagerly resolve the
                         // conditional type instead of deferring resolution. Also, we always want strict function
                         // types rules (i.e. proper contravariance) for inferences.
-                        inferTypes(context.inferences, checkType, extendsType, 256 /* NoConstraints */ | 512 /* AlwaysStrict */);
+                        inferTypes(context.inferences, checkType, extendsType, 512 /* NoConstraints */ | 1024 /* AlwaysStrict */);
                     }
-                    combinedMapper = mergeTypeMappers(mapper, context.mapper);
+                    // It's possible for 'infer T' type paramteters to be given uninstantiated constraints when the
+                    // those type parameters are used in type references (see getInferredTypeParameterConstraint). For
+                    // that reason we need context.mapper to be first in the combined mapper. See #42636 for examples.
+                    combinedMapper = mapper ? combineTypeMappers(context.mapper, mapper) : context.mapper;
                 }
                 // Instantiate the extends type including inferences for 'infer T' type parameters
                 var inferredExtendsType = combinedMapper ? instantiateType(unwrapNondistributiveConditionalTuple(root, root.extendsType), combinedMapper) : extendsType;
                 // We attempt to resolve the conditional type only when the check and extends types are non-generic
-                if (!checkTypeInstantiable && !isGenericObjectType(inferredExtendsType) && !isGenericIndexType(inferredExtendsType)) {
+                if (!checkTypeInstantiable && !isGenericType(inferredExtendsType)) {
                     // Return falseType for a definitely false extends check. We check an instantiations of the two
                     // types with type parameters mapped to the wildcard type, the most permissive instantiations
                     // possible (the wildcard type is assignable to and from all types). If those are not related,
@@ -56928,6 +60743,9 @@ var ts;
                                 root = newRoot;
                                 continue;
                             }
+                            if (canTailRecurse(falseType_1, mapper)) {
+                                continue;
+                            }
                         }
                         result = instantiateType(falseType_1, mapper);
                         break;
@@ -56938,7 +60756,12 @@ var ts;
                     //   type Foo<T extends { x: any }> = T extends { x: string } ? string : number
                     // doesn't immediately resolve to 'string' instead of being deferred.
                     if (inferredExtendsType.flags & 3 /* AnyOrUnknown */ || isTypeAssignableTo(getRestrictiveInstantiation(checkType), getRestrictiveInstantiation(inferredExtendsType))) {
-                        result = instantiateType(getTypeFromTypeNode(root.node.trueType), combinedMapper || mapper);
+                        var trueType_1 = getTypeFromTypeNode(root.node.trueType);
+                        var trueMapper = combinedMapper || mapper;
+                        if (canTailRecurse(trueType_1, trueMapper)) {
+                            continue;
+                        }
+                        result = instantiateType(trueType_1, trueMapper);
                         break;
                     }
                 }
@@ -56954,6 +60777,32 @@ var ts;
                 break;
             }
             return extraTypes ? getUnionType(ts.append(extraTypes, result)) : result;
+            // We tail-recurse for generic conditional types that (a) have not already been evaluated and cached, and
+            // (b) are non distributive, have a check type that is unaffected by instantiation, or have a non-union check
+            // type. Note that recursion is possible only through aliased conditional types, so we only increment the tail
+            // recursion counter for those.
+            function canTailRecurse(newType, newMapper) {
+                if (newType.flags & 16777216 /* Conditional */ && newMapper) {
+                    var newRoot = newType.root;
+                    if (newRoot.outerTypeParameters) {
+                        var typeParamMapper_1 = combineTypeMappers(newType.mapper, newMapper);
+                        var typeArguments = ts.map(newRoot.outerTypeParameters, function (t) { return getMappedType(t, typeParamMapper_1); });
+                        var newRootMapper = createTypeMapper(newRoot.outerTypeParameters, typeArguments);
+                        var newCheckType = newRoot.isDistributive ? getMappedType(newRoot.checkType, newRootMapper) : undefined;
+                        if (!newCheckType || newCheckType === newRoot.checkType || !(newCheckType.flags & (1048576 /* Union */ | 131072 /* Never */))) {
+                            root = newRoot;
+                            mapper = newRootMapper;
+                            aliasSymbol = undefined;
+                            aliasTypeArguments = undefined;
+                            if (newRoot.aliasSymbol) {
+                                tailCount++;
+                            }
+                            return true;
+                        }
+                    }
+                }
+                return false;
+            }
         }
         function getTrueTypeFromConditionalType(type) {
             return type.resolvedTrueType || (type.resolvedTrueType = instantiateType(getTypeFromTypeNode(type.root.node.trueType), type.mapper));
@@ -56975,6 +60824,10 @@ var ts;
             }
             return result;
         }
+        function isDistributionDependent(root) {
+            return root.isDistributive && (isTypeParameterPossiblyReferenced(root.checkType, root.node.trueType) ||
+                isTypeParameterPossiblyReferenced(root.checkType, root.node.falseType));
+        }
         function getTypeFromConditionalTypeNode(node) {
             var links = getNodeLinks(node);
             if (!links.resolvedType) {
@@ -57109,7 +60962,7 @@ var ts;
         }
         function getAliasSymbolForTypeNode(node) {
             var host = node.parent;
-            while (ts.isParenthesizedTypeNode(host) || ts.isJSDocTypeExpression(host) || ts.isTypeOperatorNode(host) && host.operator === 142 /* ReadonlyKeyword */) {
+            while (ts.isParenthesizedTypeNode(host) || ts.isJSDocTypeExpression(host) || ts.isTypeOperatorNode(host) && host.operator === 144 /* ReadonlyKeyword */) {
                 host = host.parent;
             }
             return ts.isTypeAlias(host) ? getSymbolOfNode(host) : undefined;
@@ -57124,16 +60977,19 @@ var ts;
             return isEmptyObjectType(type) || !!(type.flags & (65536 /* Null */ | 32768 /* Undefined */ | 528 /* BooleanLike */ | 296 /* NumberLike */ | 2112 /* BigIntLike */ | 402653316 /* StringLike */ | 1056 /* EnumLike */ | 67108864 /* NonPrimitive */ | 4194304 /* Index */));
         }
         function tryMergeUnionOfObjectTypeAndEmptyObject(type, readonly) {
+            if (!(type.flags & 1048576 /* Union */)) {
+                return type;
+            }
             if (ts.every(type.types, isEmptyObjectTypeOrSpreadsIntoEmptyObject)) {
                 return ts.find(type.types, isEmptyObjectType) || emptyObjectType;
             }
             var firstType = ts.find(type.types, function (t) { return !isEmptyObjectTypeOrSpreadsIntoEmptyObject(t); });
             if (!firstType) {
-                return undefined;
+                return type;
             }
-            var secondType = firstType && ts.find(type.types, function (t) { return t !== firstType && !isEmptyObjectTypeOrSpreadsIntoEmptyObject(t); });
+            var secondType = ts.find(type.types, function (t) { return t !== firstType && !isEmptyObjectTypeOrSpreadsIntoEmptyObject(t); });
             if (secondType) {
-                return undefined;
+                return type;
             }
             return getAnonymousPartialType(firstType);
             function getAnonymousPartialType(type) {
@@ -57148,15 +61004,15 @@ var ts;
                         var isSetonlyAccessor = prop.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */);
                         var flags = 4 /* Property */ | 16777216 /* Optional */;
                         var result = createSymbol(flags, prop.escapedName, getIsLateCheckFlag(prop) | (readonly ? 8 /* Readonly */ : 0));
-                        result.type = isSetonlyAccessor ? undefinedType : getUnionType([getTypeOfSymbol(prop), undefinedType]);
+                        result.type = isSetonlyAccessor ? undefinedType : addOptionality(getTypeOfSymbol(prop), /*isProperty*/ true);
                         result.declarations = prop.declarations;
                         result.nameType = getSymbolLinks(prop).nameType;
                         result.syntheticOrigin = prop;
                         members.set(prop.escapedName, result);
                     }
                 }
-                var spread = createAnonymousType(type.symbol, members, ts.emptyArray, ts.emptyArray, getIndexInfoOfType(type, 0 /* String */), getIndexInfoOfType(type, 1 /* Number */));
-                spread.objectFlags |= 128 /* ObjectLiteral */ | 1048576 /* ContainsObjectOrArrayLiteral */;
+                var spread = createAnonymousType(type.symbol, members, ts.emptyArray, ts.emptyArray, getIndexInfosOfType(type));
+                spread.objectFlags |= 128 /* ObjectLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */;
                 return spread;
             }
         }
@@ -57178,20 +61034,14 @@ var ts;
             if (right.flags & 131072 /* Never */) {
                 return left;
             }
+            left = tryMergeUnionOfObjectTypeAndEmptyObject(left, readonly);
             if (left.flags & 1048576 /* Union */) {
-                var merged = tryMergeUnionOfObjectTypeAndEmptyObject(left, readonly);
-                if (merged) {
-                    return getSpreadType(merged, right, symbol, objectFlags, readonly);
-                }
                 return checkCrossProductUnion([left, right])
                     ? mapType(left, function (t) { return getSpreadType(t, right, symbol, objectFlags, readonly); })
                     : errorType;
             }
+            right = tryMergeUnionOfObjectTypeAndEmptyObject(right, readonly);
             if (right.flags & 1048576 /* Union */) {
-                var merged = tryMergeUnionOfObjectTypeAndEmptyObject(right, readonly);
-                if (merged) {
-                    return getSpreadType(left, merged, symbol, objectFlags, readonly);
-                }
                 return checkCrossProductUnion([left, right])
                     ? mapType(right, function (t) { return getSpreadType(left, t, symbol, objectFlags, readonly); })
                     : errorType;
@@ -57217,17 +61067,7 @@ var ts;
             }
             var members = ts.createSymbolTable();
             var skippedPrivateMembers = new ts.Set();
-            var stringIndexInfo;
-            var numberIndexInfo;
-            if (left === emptyObjectType) {
-                // for the first spread element, left === emptyObjectType, so take the right's string indexer
-                stringIndexInfo = getIndexInfoOfType(right, 0 /* String */);
-                numberIndexInfo = getIndexInfoOfType(right, 1 /* Number */);
-            }
-            else {
-                stringIndexInfo = unionSpreadIndexInfos(getIndexInfoOfType(left, 0 /* String */), getIndexInfoOfType(right, 0 /* String */));
-                numberIndexInfo = unionSpreadIndexInfos(getIndexInfoOfType(left, 1 /* Number */), getIndexInfoOfType(right, 1 /* Number */));
-            }
+            var indexInfos = left === emptyObjectType ? getIndexInfosOfType(right) : getUnionIndexInfos([left, right]);
             for (var _i = 0, _a = getPropertiesOfType(right); _i < _a.length; _i++) {
                 var rightProp = _a[_i];
                 if (ts.getDeclarationModifierFlagsFromSymbol(rightProp) & (8 /* Private */ | 16 /* Protected */)) {
@@ -57249,7 +61089,7 @@ var ts;
                         var declarations = ts.concatenate(leftProp.declarations, rightProp.declarations);
                         var flags = 4 /* Property */ | (leftProp.flags & 16777216 /* Optional */);
                         var result = createSymbol(flags, leftProp.escapedName);
-                        result.type = getUnionType([getTypeOfSymbol(leftProp), getTypeWithFacts(rightType, 524288 /* NEUndefined */)]);
+                        result.type = getUnionType([getTypeOfSymbol(leftProp), removeMissingOrUndefinedType(rightType)]);
                         result.leftSpread = leftProp;
                         result.rightSpread = rightProp;
                         result.declarations = declarations;
@@ -57261,15 +61101,16 @@ var ts;
                     members.set(leftProp.escapedName, getSpreadSymbol(leftProp, readonly));
                 }
             }
-            var spread = createAnonymousType(symbol, members, ts.emptyArray, ts.emptyArray, getIndexInfoWithReadonly(stringIndexInfo, readonly), getIndexInfoWithReadonly(numberIndexInfo, readonly));
-            spread.objectFlags |= 128 /* ObjectLiteral */ | 1048576 /* ContainsObjectOrArrayLiteral */ | 1024 /* ContainsSpread */ | objectFlags;
+            var spread = createAnonymousType(symbol, members, ts.emptyArray, ts.emptyArray, ts.sameMap(indexInfos, function (info) { return getIndexInfoWithReadonly(info, readonly); }));
+            spread.objectFlags |= 128 /* ObjectLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */ | 4194304 /* ContainsSpread */ | objectFlags;
             return spread;
         }
         /** We approximate own properties as non-methods plus methods that are inside the object literal */
         function isSpreadableProperty(prop) {
-            return !ts.some(prop.declarations, ts.isPrivateIdentifierPropertyDeclaration) &&
+            var _a;
+            return !ts.some(prop.declarations, ts.isPrivateIdentifierClassElementDeclaration) &&
                 (!(prop.flags & (8192 /* Method */ | 32768 /* GetAccessor */ | 65536 /* SetAccessor */)) ||
-                    !prop.declarations.some(function (decl) { return ts.isClassLike(decl.parent); }));
+                    !((_a = prop.declarations) === null || _a === void 0 ? void 0 : _a.some(function (decl) { return ts.isClassLike(decl.parent); })));
         }
         function getSpreadSymbol(prop, readonly) {
             var isSetonlyAccessor = prop.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */);
@@ -57285,19 +61126,19 @@ var ts;
             return result;
         }
         function getIndexInfoWithReadonly(info, readonly) {
-            return info && info.isReadonly !== readonly ? createIndexInfo(info.type, readonly, info.declaration) : info;
+            return info.isReadonly !== readonly ? createIndexInfo(info.keyType, info.type, readonly, info.declaration) : info;
         }
-        function createLiteralType(flags, value, symbol) {
+        function createLiteralType(flags, value, symbol, regularType) {
             var type = createType(flags);
             type.symbol = symbol;
             type.value = value;
+            type.regularType = regularType || type;
             return type;
         }
         function getFreshTypeOfLiteralType(type) {
             if (type.flags & 2944 /* Literal */) {
                 if (!type.freshType) {
-                    var freshType = createLiteralType(type.flags, type.value, type.symbol);
-                    freshType.regularType = type;
+                    var freshType = createLiteralType(type.flags, type.value, type.symbol, type);
                     freshType.freshType = freshType;
                     type.freshType = freshType;
                 }
@@ -57313,25 +61154,32 @@ var ts;
         function isFreshLiteralType(type) {
             return !!(type.flags & 2944 /* Literal */) && type.freshType === type;
         }
-        function getLiteralType(value, enumId, symbol) {
-            // We store all literal types in a single map with keys of the form '#NNN' and '@SSS',
-            // where NNN is the text representation of a numeric literal and SSS are the characters
-            // of a string literal. For literal enum members we use 'EEE#NNN' and 'EEE@SSS', where
-            // EEE is a unique id for the containing enum type.
-            var qualifier = typeof value === "number" ? "#" : typeof value === "string" ? "@" : "n";
-            var key = (enumId ? enumId : "") + qualifier + (typeof value === "object" ? ts.pseudoBigIntToString(value) : value);
-            var type = literalTypes.get(key);
-            if (!type) {
-                var flags = (typeof value === "number" ? 256 /* NumberLiteral */ :
-                    typeof value === "string" ? 128 /* StringLiteral */ : 2048 /* BigIntLiteral */) |
-                    (enumId ? 1024 /* EnumLiteral */ : 0);
-                literalTypes.set(key, type = createLiteralType(flags, value, symbol));
-                type.regularType = type;
-            }
-            return type;
+        function getStringLiteralType(value) {
+            var type;
+            return stringLiteralTypes.get(value) ||
+                (stringLiteralTypes.set(value, type = createLiteralType(128 /* StringLiteral */, value)), type);
+        }
+        function getNumberLiteralType(value) {
+            var type;
+            return numberLiteralTypes.get(value) ||
+                (numberLiteralTypes.set(value, type = createLiteralType(256 /* NumberLiteral */, value)), type);
+        }
+        function getBigIntLiteralType(value) {
+            var type;
+            var key = ts.pseudoBigIntToString(value);
+            return bigIntLiteralTypes.get(key) ||
+                (bigIntLiteralTypes.set(key, type = createLiteralType(2048 /* BigIntLiteral */, value)), type);
+        }
+        function getEnumLiteralType(value, enumId, symbol) {
+            var type;
+            var qualifier = typeof value === "string" ? "@" : "#";
+            var key = enumId + qualifier + value;
+            var flags = 1024 /* EnumLiteral */ | (typeof value === "string" ? 128 /* StringLiteral */ : 256 /* NumberLiteral */);
+            return enumLiteralTypes.get(key) ||
+                (enumLiteralTypes.set(key, type = createLiteralType(flags, value, symbol)), type);
         }
         function getTypeFromLiteralTypeNode(node) {
-            if (node.literal.kind === 103 /* NullKeyword */) {
+            if (node.literal.kind === 104 /* NullKeyword */) {
                 return nullType;
             }
             var links = getNodeLinks(node);
@@ -57343,7 +61191,7 @@ var ts;
         function createUniqueESSymbolType(symbol) {
             var type = createType(8192 /* UniqueESSymbol */);
             type.symbol = symbol;
-            type.escapedName = "__@" + type.symbol.escapedName + "@" + getSymbolId(type.symbol);
+            type.escapedName = "__@".concat(type.symbol.escapedName, "@").concat(getSymbolId(type.symbol));
             return type;
         }
         function getESSymbolLikeTypeForNode(node) {
@@ -57357,8 +61205,8 @@ var ts;
         function getThisType(node) {
             var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false);
             var parent = container && container.parent;
-            if (parent && (ts.isClassLike(parent) || parent.kind === 253 /* InterfaceDeclaration */)) {
-                if (!ts.hasSyntacticModifier(container, 32 /* Static */) &&
+            if (parent && (ts.isClassLike(parent) || parent.kind === 257 /* InterfaceDeclaration */)) {
+                if (!ts.isStatic(container) &&
                     (!ts.isConstructorDeclaration(container) || ts.isNodeDescendantOf(node, container.body))) {
                     return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType;
                 }
@@ -57392,17 +61240,17 @@ var ts;
         }
         function getArrayElementTypeNode(node) {
             switch (node.kind) {
-                case 186 /* ParenthesizedType */:
+                case 190 /* ParenthesizedType */:
                     return getArrayElementTypeNode(node.type);
-                case 179 /* TupleType */:
+                case 183 /* TupleType */:
                     if (node.elements.length === 1) {
                         node = node.elements[0];
-                        if (node.kind === 181 /* RestType */ || node.kind === 192 /* NamedTupleMember */ && node.dotDotDotToken) {
+                        if (node.kind === 185 /* RestType */ || node.kind === 196 /* NamedTupleMember */ && node.dotDotDotToken) {
                             return getArrayElementTypeNode(node.type);
                         }
                     }
                     break;
-                case 178 /* ArrayType */:
+                case 182 /* ArrayType */:
                     return node.elementType;
             }
             return undefined;
@@ -57411,107 +61259,106 @@ var ts;
             var links = getNodeLinks(node);
             return links.resolvedType || (links.resolvedType =
                 node.dotDotDotToken ? getTypeFromRestTypeNode(node) :
-                    node.questionToken && strictNullChecks ? getOptionalType(getTypeFromTypeNode(node.type)) :
-                        getTypeFromTypeNode(node.type));
+                    addOptionality(getTypeFromTypeNode(node.type), /*isProperty*/ true, !!node.questionToken));
         }
         function getTypeFromTypeNode(node) {
             return getConditionalFlowTypeOfType(getTypeFromTypeNodeWorker(node), node);
         }
         function getTypeFromTypeNodeWorker(node) {
             switch (node.kind) {
-                case 128 /* AnyKeyword */:
-                case 303 /* JSDocAllType */:
-                case 304 /* JSDocUnknownType */:
+                case 130 /* AnyKeyword */:
+                case 310 /* JSDocAllType */:
+                case 311 /* JSDocUnknownType */:
                     return anyType;
-                case 152 /* UnknownKeyword */:
+                case 154 /* UnknownKeyword */:
                     return unknownType;
-                case 147 /* StringKeyword */:
+                case 149 /* StringKeyword */:
                     return stringType;
-                case 144 /* NumberKeyword */:
+                case 146 /* NumberKeyword */:
                     return numberType;
-                case 155 /* BigIntKeyword */:
+                case 157 /* BigIntKeyword */:
                     return bigintType;
-                case 131 /* BooleanKeyword */:
+                case 133 /* BooleanKeyword */:
                     return booleanType;
-                case 148 /* SymbolKeyword */:
+                case 150 /* SymbolKeyword */:
                     return esSymbolType;
-                case 113 /* VoidKeyword */:
+                case 114 /* VoidKeyword */:
                     return voidType;
-                case 150 /* UndefinedKeyword */:
+                case 152 /* UndefinedKeyword */:
                     return undefinedType;
-                case 103 /* NullKeyword */:
+                case 104 /* NullKeyword */:
                     // TODO(rbuckton): `NullKeyword` is no longer a `TypeNode`, but we defensively allow it here because of incorrect casts in the Language Service.
                     return nullType;
-                case 141 /* NeverKeyword */:
+                case 143 /* NeverKeyword */:
                     return neverType;
-                case 145 /* ObjectKeyword */:
+                case 147 /* ObjectKeyword */:
                     return node.flags & 131072 /* JavaScriptFile */ && !noImplicitAny ? anyType : nonPrimitiveType;
-                case 136 /* IntrinsicKeyword */:
+                case 138 /* IntrinsicKeyword */:
                     return intrinsicMarkerType;
-                case 187 /* ThisType */:
-                case 107 /* ThisKeyword */:
+                case 191 /* ThisType */:
+                case 108 /* ThisKeyword */:
                     // TODO(rbuckton): `ThisKeyword` is no longer a `TypeNode`, but we defensively allow it here because of incorrect casts in the Language Service and because of `isPartOfTypeNode`.
                     return getTypeFromThisTypeNode(node);
-                case 191 /* LiteralType */:
+                case 195 /* LiteralType */:
                     return getTypeFromLiteralTypeNode(node);
-                case 173 /* TypeReference */:
+                case 177 /* TypeReference */:
                     return getTypeFromTypeReference(node);
-                case 172 /* TypePredicate */:
+                case 176 /* TypePredicate */:
                     return node.assertsModifier ? voidType : booleanType;
-                case 223 /* ExpressionWithTypeArguments */:
+                case 227 /* ExpressionWithTypeArguments */:
                     return getTypeFromTypeReference(node);
-                case 176 /* TypeQuery */:
+                case 180 /* TypeQuery */:
                     return getTypeFromTypeQueryNode(node);
-                case 178 /* ArrayType */:
-                case 179 /* TupleType */:
+                case 182 /* ArrayType */:
+                case 183 /* TupleType */:
                     return getTypeFromArrayOrTupleTypeNode(node);
-                case 180 /* OptionalType */:
+                case 184 /* OptionalType */:
                     return getTypeFromOptionalTypeNode(node);
-                case 182 /* UnionType */:
+                case 186 /* UnionType */:
                     return getTypeFromUnionTypeNode(node);
-                case 183 /* IntersectionType */:
+                case 187 /* IntersectionType */:
                     return getTypeFromIntersectionTypeNode(node);
-                case 305 /* JSDocNullableType */:
+                case 312 /* JSDocNullableType */:
                     return getTypeFromJSDocNullableTypeNode(node);
-                case 307 /* JSDocOptionalType */:
+                case 314 /* JSDocOptionalType */:
                     return addOptionality(getTypeFromTypeNode(node.type));
-                case 192 /* NamedTupleMember */:
+                case 196 /* NamedTupleMember */:
                     return getTypeFromNamedTupleTypeNode(node);
-                case 186 /* ParenthesizedType */:
-                case 306 /* JSDocNonNullableType */:
-                case 301 /* JSDocTypeExpression */:
+                case 190 /* ParenthesizedType */:
+                case 313 /* JSDocNonNullableType */:
+                case 307 /* JSDocTypeExpression */:
                     return getTypeFromTypeNode(node.type);
-                case 181 /* RestType */:
+                case 185 /* RestType */:
                     return getTypeFromRestTypeNode(node);
-                case 309 /* JSDocVariadicType */:
+                case 316 /* JSDocVariadicType */:
                     return getTypeFromJSDocVariadicType(node);
-                case 174 /* FunctionType */:
-                case 175 /* ConstructorType */:
-                case 177 /* TypeLiteral */:
-                case 312 /* JSDocTypeLiteral */:
-                case 308 /* JSDocFunctionType */:
-                case 313 /* JSDocSignature */:
+                case 178 /* FunctionType */:
+                case 179 /* ConstructorType */:
+                case 181 /* TypeLiteral */:
+                case 320 /* JSDocTypeLiteral */:
+                case 315 /* JSDocFunctionType */:
+                case 321 /* JSDocSignature */:
                     return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node);
-                case 188 /* TypeOperator */:
+                case 192 /* TypeOperator */:
                     return getTypeFromTypeOperatorNode(node);
-                case 189 /* IndexedAccessType */:
+                case 193 /* IndexedAccessType */:
                     return getTypeFromIndexedAccessTypeNode(node);
-                case 190 /* MappedType */:
+                case 194 /* MappedType */:
                     return getTypeFromMappedTypeNode(node);
-                case 184 /* ConditionalType */:
+                case 188 /* ConditionalType */:
                     return getTypeFromConditionalTypeNode(node);
-                case 185 /* InferType */:
+                case 189 /* InferType */:
                     return getTypeFromInferTypeNode(node);
-                case 193 /* TemplateLiteralType */:
+                case 197 /* TemplateLiteralType */:
                     return getTypeFromTemplateTypeNode(node);
-                case 195 /* ImportType */:
+                case 199 /* ImportType */:
                     return getTypeFromImportTypeNode(node);
                 // This function assumes that an identifier, qualified name, or property access expression is a type expression
                 // Callers should first ensure this by calling `isPartOfTypeNode`
                 // TODO(rbuckton): These aren't valid TypeNodes, but we treat them as such because of `isPartOfTypeNode`, which returns `true` for things that aren't `TypeNode`s.
-                case 78 /* Identifier */:
-                case 157 /* QualifiedName */:
-                case 201 /* PropertyAccessExpression */:
+                case 79 /* Identifier */:
+                case 160 /* QualifiedName */:
+                case 205 /* PropertyAccessExpression */:
                     var symbol = getSymbolAtLocation(node);
                     return symbol ? getDeclaredTypeOfSymbol(symbol) : errorType;
                 default:
@@ -57541,6 +61388,9 @@ var ts;
         function instantiateSignatures(signatures, mapper) {
             return instantiateList(signatures, mapper, instantiateSignature);
         }
+        function instantiateIndexInfos(indexInfos, mapper) {
+            return instantiateList(indexInfos, mapper, instantiateIndexInfo);
+        }
         function createTypeMapper(sources, targets) {
             return sources.length === 1 ? makeUnaryTypeMapper(sources[0], targets ? targets[0] : anyType) : makeArrayTypeMapper(sources, targets);
         }
@@ -57681,8 +61531,9 @@ var ts;
                     outerTypeParameters = ts.addRange(outerTypeParameters, templateTagParameters);
                 }
                 typeParameters = outerTypeParameters || ts.emptyArray;
-                typeParameters = (target.objectFlags & 4 /* Reference */ || target.symbol.flags & 2048 /* TypeLiteral */) && !target.aliasTypeArguments ?
-                    ts.filter(typeParameters, function (tp) { return isTypeParameterPossiblyReferenced(tp, declaration); }) :
+                var allDeclarations_1 = type.objectFlags & 4 /* Reference */ ? [declaration] : type.symbol.declarations;
+                typeParameters = (target.objectFlags & 4 /* Reference */ || target.symbol.flags & 8192 /* Method */ || target.symbol.flags & 2048 /* TypeLiteral */) && !target.aliasTypeArguments ?
+                    ts.filter(typeParameters, function (tp) { return ts.some(allDeclarations_1, function (d) { return isTypeParameterPossiblyReferenced(tp, d); }); }) :
                     typeParameters;
                 links.outerTypeParameters = typeParameters;
             }
@@ -57712,9 +61563,8 @@ var ts;
             return type;
         }
         function maybeTypeParameterReference(node) {
-            return !(node.kind === 157 /* QualifiedName */ ||
-                node.parent.kind === 173 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName ||
-                node.parent.kind === 195 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier);
+            return !(node.parent.kind === 177 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName ||
+                node.parent.kind === 199 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier);
         }
         function isTypeParameterPossiblyReferenced(tp, node) {
             // If the type parameter doesn't have exactly one declaration, if there are invening statement blocks
@@ -57723,22 +61573,28 @@ var ts;
             if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) {
                 var container = tp.symbol.declarations[0].parent;
                 for (var n = node; n !== container; n = n.parent) {
-                    if (!n || n.kind === 230 /* Block */ || n.kind === 184 /* ConditionalType */ && ts.forEachChild(n.extendsType, containsReference)) {
+                    if (!n || n.kind === 234 /* Block */ || n.kind === 188 /* ConditionalType */ && ts.forEachChild(n.extendsType, containsReference)) {
                         return true;
                     }
                 }
-                return !!ts.forEachChild(node, containsReference);
+                return containsReference(node);
             }
             return true;
             function containsReference(node) {
                 switch (node.kind) {
-                    case 187 /* ThisType */:
+                    case 191 /* ThisType */:
                         return !!tp.isThisType;
-                    case 78 /* Identifier */:
+                    case 79 /* Identifier */:
                         return !tp.isThisType && ts.isPartOfTypeNode(node) && maybeTypeParameterReference(node) &&
                             getTypeFromTypeNodeWorker(node) === tp; // use worker because we're looking for === equality
-                    case 176 /* TypeQuery */:
+                    case 180 /* TypeQuery */:
                         return true;
+                    case 168 /* MethodDeclaration */:
+                    case 167 /* MethodSignature */:
+                        return !node.type && !!node.body ||
+                            ts.some(node.typeParameters, containsReference) ||
+                            ts.some(node.parameters, containsReference) ||
+                            !!node.type && containsReference(node.type);
                 }
                 return !!ts.forEachChild(node, containsReference);
             }
@@ -57769,9 +61625,11 @@ var ts;
                 var mappedTypeVariable = instantiateType(typeVariable, mapper);
                 if (typeVariable !== mappedTypeVariable) {
                     return mapTypeWithAlias(getReducedType(mappedTypeVariable), function (t) {
-                        if (t.flags & (3 /* AnyOrUnknown */ | 58982400 /* InstantiableNonPrimitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && t !== wildcardType && t !== errorType) {
+                        if (t.flags & (3 /* AnyOrUnknown */ | 58982400 /* InstantiableNonPrimitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && t !== wildcardType && !isErrorType(t)) {
                             if (!type.declaration.nameType) {
-                                if (isArrayType(t)) {
+                                var constraint = void 0;
+                                if (isArrayType(t) || t.flags & 1 /* Any */ && findResolutionCycleStartIndex(typeVariable, 4 /* ImmediateBaseConstraint */) < 0 &&
+                                    (constraint = getConstraintOfTypeParameter(typeVariable)) && everyType(constraint, ts.or(isArrayType, isTupleType))) {
                                     return instantiateMappedArrayType(t, type, prependTypeMapping(typeVariable, t, mapper));
                                 }
                                 if (isGenericTupleType(t)) {
@@ -57811,13 +61669,13 @@ var ts;
         }
         function instantiateMappedArrayType(arrayType, mappedType, mapper) {
             var elementType = instantiateMappedTypeTemplate(mappedType, numberType, /*isOptional*/ true, mapper);
-            return elementType === errorType ? errorType :
+            return isErrorType(elementType) ? errorType :
                 createArrayType(elementType, getModifiedReadonlyState(isReadonlyArrayType(arrayType), getMappedTypeModifiers(mappedType)));
         }
         function instantiateMappedTupleType(tupleType, mappedType, mapper) {
             var elementFlags = tupleType.target.elementFlags;
             var elementTypes = ts.map(getTypeArguments(tupleType), function (_, i) {
-                return instantiateMappedTypeTemplate(mappedType, getLiteralType("" + i), !!(elementFlags[i] & 2 /* Optional */), mapper);
+                return instantiateMappedTypeTemplate(mappedType, getStringLiteralType("" + i), !!(elementFlags[i] & 2 /* Optional */), mapper);
             });
             var modifiers = getMappedTypeModifiers(mappedType);
             var newTupleModifiers = modifiers & 4 /* IncludeOptional */ ? ts.map(elementFlags, function (f) { return f & 1 /* Required */ ? 2 /* Optional */ : f; }) :
@@ -57831,7 +61689,7 @@ var ts;
             var templateMapper = appendTypeMapping(mapper, getTypeParameterFromMappedType(type), key);
             var propType = instantiateType(getTemplateTypeFromMappedType(type.target || type), templateMapper);
             var modifiers = getMappedTypeModifiers(type);
-            return strictNullChecks && modifiers & 4 /* IncludeOptional */ && !maybeTypeOfKind(propType, 32768 /* Undefined */ | 16384 /* Void */) ? getOptionalType(propType) :
+            return strictNullChecks && modifiers & 4 /* IncludeOptional */ && !maybeTypeOfKind(propType, 32768 /* Undefined */ | 16384 /* Void */) ? getOptionalType(propType, /*isProperty*/ true) :
                 strictNullChecks && modifiers & 8 /* ExcludeOptional */ && isOptional ? getTypeWithFacts(propType, 524288 /* NEUndefined */) :
                     propType;
         }
@@ -57862,27 +61720,21 @@ var ts;
                 var id = getTypeListId(typeArguments) + getAliasId(aliasSymbol, aliasTypeArguments);
                 var result = root.instantiations.get(id);
                 if (!result) {
-                    var newMapper = createTypeMapper(root.outerTypeParameters, typeArguments);
-                    result = instantiateConditionalType(root, newMapper, aliasSymbol, aliasTypeArguments);
+                    var newMapper_1 = createTypeMapper(root.outerTypeParameters, typeArguments);
+                    var checkType_1 = root.checkType;
+                    var distributionType = root.isDistributive ? getMappedType(checkType_1, newMapper_1) : undefined;
+                    // Distributive conditional types are distributed over union types. For example, when the
+                    // distributive conditional type T extends U ? X : Y is instantiated with A | B for T, the
+                    // result is (A extends U ? X : Y) | (B extends U ? X : Y).
+                    result = distributionType && checkType_1 !== distributionType && distributionType.flags & (1048576 /* Union */ | 131072 /* Never */) ?
+                        mapTypeWithAlias(distributionType, function (t) { return getConditionalType(root, prependTypeMapping(checkType_1, t, newMapper_1)); }, aliasSymbol, aliasTypeArguments) :
+                        getConditionalType(root, newMapper_1, aliasSymbol, aliasTypeArguments);
                     root.instantiations.set(id, result);
                 }
                 return result;
             }
             return type;
         }
-        function instantiateConditionalType(root, mapper, aliasSymbol, aliasTypeArguments) {
-            // Check if we have a conditional type where the check type is a naked type parameter. If so,
-            // the conditional type is distributive over union types and when T is instantiated to a union
-            // type A | B, we produce (A extends U ? X : Y) | (B extends U ? X : Y).
-            if (root.isDistributive) {
-                var checkType_1 = root.checkType;
-                var instantiatedType = getMappedType(checkType_1, mapper);
-                if (checkType_1 !== instantiatedType && instantiatedType.flags & (1048576 /* Union */ | 131072 /* Never */)) {
-                    return mapTypeWithAlias(instantiatedType, function (t) { return getConditionalType(root, prependTypeMapping(checkType_1, t, mapper)); }, aliasSymbol, aliasTypeArguments);
-                }
-            }
-            return getConditionalType(root, mapper, aliasSymbol, aliasTypeArguments);
-        }
         function instantiateType(type, mapper) {
             return type && mapper ? instantiateTypeWithAlias(type, mapper, /*aliasSymbol*/ undefined, /*aliasTypeArguments*/ undefined) : type;
         }
@@ -57890,10 +61742,10 @@ var ts;
             if (!couldContainTypeVariables(type)) {
                 return type;
             }
-            if (instantiationDepth === 50 || instantiationCount >= 5000000) {
-                // We have reached 50 recursive type instantiations and there is a very high likelyhood we're dealing
-                // with a combination of infinite generic types that perpetually generate new type identities. We stop
-                // the recursion here by yielding the error type.
+            if (instantiationDepth === 100 || instantiationCount >= 5000000) {
+                // We have reached 100 recursive type instantiations, or 5M type instantiations caused by the same statement
+                // or expression. There is a very high likelyhood we're dealing with a combination of infinite generic types
+                // that perpetually generate new type identities, so we stop the recursion here by yielding the error type.
                 ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.instant("checkTypes" /* CheckTypes */, "instantiateType_DepthLimit", { typeId: type.id, instantiationDepth: instantiationDepth, instantiationCount: instantiationCount });
                 error(currentNode, ts.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite);
                 return errorType;
@@ -57918,6 +61770,9 @@ var ts;
                         var newTypeArguments = instantiateTypes(resolvedTypeArguments, mapper);
                         return newTypeArguments !== resolvedTypeArguments ? createNormalizedTypeReference(type.target, newTypeArguments) : type;
                     }
+                    if (objectFlags & 1024 /* ReverseMapped */) {
+                        return instantiateReverseMappedType(type, mapper);
+                    }
                     return getObjectTypeInstantiation(type, mapper, aliasSymbol, aliasTypeArguments);
                 }
                 return type;
@@ -57947,7 +61802,7 @@ var ts;
             if (flags & 8388608 /* IndexedAccess */) {
                 var newAliasSymbol = aliasSymbol || type.aliasSymbol;
                 var newAliasTypeArguments = aliasSymbol ? aliasTypeArguments : instantiateTypes(type.aliasTypeArguments, mapper);
-                return getIndexedAccessType(instantiateType(type.objectType, mapper), instantiateType(type.indexType, mapper), type.noUncheckedIndexedAccessCandidate, /*accessNode*/ undefined, newAliasSymbol, newAliasTypeArguments);
+                return getIndexedAccessType(instantiateType(type.objectType, mapper), instantiateType(type.indexType, mapper), type.accessFlags, /*accessNode*/ undefined, newAliasSymbol, newAliasTypeArguments);
             }
             if (flags & 16777216 /* Conditional */) {
                 return getConditionalTypeInstantiation(type, combineTypeMappers(type.mapper, mapper), aliasSymbol, aliasTypeArguments);
@@ -57967,6 +61822,21 @@ var ts;
             }
             return type;
         }
+        function instantiateReverseMappedType(type, mapper) {
+            var innerMappedType = instantiateType(type.mappedType, mapper);
+            if (!(ts.getObjectFlags(innerMappedType) & 32 /* Mapped */)) {
+                return type;
+            }
+            var innerIndexType = instantiateType(type.constraintType, mapper);
+            if (!(innerIndexType.flags & 4194304 /* Index */)) {
+                return type;
+            }
+            var instantiated = inferTypeForHomomorphicMappedType(instantiateType(type.source, mapper), innerMappedType, innerIndexType);
+            if (instantiated) {
+                return instantiated;
+            }
+            return type; // Nested invocation of `inferTypeForHomomorphicMappedType` or the `source` instantiated into something unmappable
+        }
         function getPermissiveInstantiation(type) {
             return type.flags & (131068 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */) ? type :
                 type.permissiveInstantiation || (type.permissiveInstantiation = instantiateType(type, permissiveMapper));
@@ -57988,40 +61858,40 @@ var ts;
             return type.restrictiveInstantiation;
         }
         function instantiateIndexInfo(info, mapper) {
-            return info && createIndexInfo(instantiateType(info.type, mapper), info.isReadonly, info.declaration);
+            return createIndexInfo(info.keyType, instantiateType(info.type, mapper), info.isReadonly, info.declaration);
         }
         // Returns true if the given expression contains (at any level of nesting) a function or arrow expression
         // that is subject to contextual typing.
         function isContextSensitive(node) {
-            ts.Debug.assert(node.kind !== 165 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node));
+            ts.Debug.assert(node.kind !== 168 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node));
             switch (node.kind) {
-                case 208 /* FunctionExpression */:
-                case 209 /* ArrowFunction */:
-                case 165 /* MethodDeclaration */:
-                case 251 /* FunctionDeclaration */: // Function declarations can have context when annotated with a jsdoc @type
+                case 212 /* FunctionExpression */:
+                case 213 /* ArrowFunction */:
+                case 168 /* MethodDeclaration */:
+                case 255 /* FunctionDeclaration */: // Function declarations can have context when annotated with a jsdoc @type
                     return isContextSensitiveFunctionLikeDeclaration(node);
-                case 200 /* ObjectLiteralExpression */:
+                case 204 /* ObjectLiteralExpression */:
                     return ts.some(node.properties, isContextSensitive);
-                case 199 /* ArrayLiteralExpression */:
+                case 203 /* ArrayLiteralExpression */:
                     return ts.some(node.elements, isContextSensitive);
-                case 217 /* ConditionalExpression */:
+                case 221 /* ConditionalExpression */:
                     return isContextSensitive(node.whenTrue) ||
                         isContextSensitive(node.whenFalse);
-                case 216 /* BinaryExpression */:
+                case 220 /* BinaryExpression */:
                     return (node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */) &&
                         (isContextSensitive(node.left) || isContextSensitive(node.right));
-                case 288 /* PropertyAssignment */:
+                case 294 /* PropertyAssignment */:
                     return isContextSensitive(node.initializer);
-                case 207 /* ParenthesizedExpression */:
+                case 211 /* ParenthesizedExpression */:
                     return isContextSensitive(node.expression);
-                case 281 /* JsxAttributes */:
+                case 285 /* JsxAttributes */:
                     return ts.some(node.properties, isContextSensitive) || ts.isJsxOpeningElement(node.parent) && ts.some(node.parent.parent.children, isContextSensitive);
-                case 280 /* JsxAttribute */: {
+                case 284 /* JsxAttribute */: {
                     // If there is no initializer, JSX attribute has a boolean value of true which is not context sensitive.
                     var initializer = node.initializer;
                     return !!initializer && isContextSensitive(initializer);
                 }
-                case 283 /* JsxExpression */: {
+                case 287 /* JsxExpression */: {
                     // It is possible to that node.expression is undefined (e.g <div x={} />)
                     var expression = node.expression;
                     return !!expression && isContextSensitive(expression);
@@ -58031,32 +61901,14 @@ var ts;
         }
         function isContextSensitiveFunctionLikeDeclaration(node) {
             return (!ts.isFunctionDeclaration(node) || ts.isInJSFile(node) && !!getTypeForDeclarationFromJSDocComment(node)) &&
-                (hasContextSensitiveParameters(node) || hasContextSensitiveReturnExpression(node));
-        }
-        function hasContextSensitiveParameters(node) {
-            // Functions with type parameters are not context sensitive.
-            if (!node.typeParameters) {
-                // Functions with any parameters that lack type annotations are context sensitive.
-                if (ts.some(node.parameters, function (p) { return !ts.getEffectiveTypeAnnotationNode(p); })) {
-                    return true;
-                }
-                if (node.kind !== 209 /* ArrowFunction */) {
-                    // If the first parameter is not an explicit 'this' parameter, then the function has
-                    // an implicit 'this' parameter which is subject to contextual typing.
-                    var parameter = ts.firstOrUndefined(node.parameters);
-                    if (!(parameter && ts.parameterIsThisKeyword(parameter))) {
-                        return true;
-                    }
-                }
-            }
-            return false;
+                (ts.hasContextSensitiveParameters(node) || hasContextSensitiveReturnExpression(node));
         }
         function hasContextSensitiveReturnExpression(node) {
             // TODO(anhans): A block should be context-sensitive if it has a context-sensitive return value.
-            return !node.typeParameters && !ts.getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 230 /* Block */ && isContextSensitive(node.body);
+            return !node.typeParameters && !ts.getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 234 /* Block */ && isContextSensitive(node.body);
         }
         function isContextSensitiveFunctionOrObjectLiteralMethod(func) {
-            return (ts.isInJSFile(func) && ts.isFunctionDeclaration(func) || isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) &&
+            return (ts.isInJSFile(func) && ts.isFunctionDeclaration(func) || ts.isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) &&
                 isContextSensitiveFunctionLikeDeclaration(func);
         }
         function getTypeWithoutSignatures(type) {
@@ -58068,6 +61920,7 @@ var ts;
                     result.properties = resolved.properties;
                     result.callSignatures = ts.emptyArray;
                     result.constructSignatures = ts.emptyArray;
+                    result.indexInfos = ts.emptyArray;
                     return result;
                 }
             }
@@ -58156,23 +62009,23 @@ var ts;
                 return true;
             }
             switch (node.kind) {
-                case 283 /* JsxExpression */:
-                case 207 /* ParenthesizedExpression */:
+                case 287 /* JsxExpression */:
+                case 211 /* ParenthesizedExpression */:
                     return elaborateError(node.expression, source, target, relation, headMessage, containingMessageChain, errorOutputContainer);
-                case 216 /* BinaryExpression */:
+                case 220 /* BinaryExpression */:
                     switch (node.operatorToken.kind) {
-                        case 62 /* EqualsToken */:
+                        case 63 /* EqualsToken */:
                         case 27 /* CommaToken */:
                             return elaborateError(node.right, source, target, relation, headMessage, containingMessageChain, errorOutputContainer);
                     }
                     break;
-                case 200 /* ObjectLiteralExpression */:
+                case 204 /* ObjectLiteralExpression */:
                     return elaborateObjectLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer);
-                case 199 /* ArrayLiteralExpression */:
+                case 203 /* ArrayLiteralExpression */:
                     return elaborateArrayLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer);
-                case 281 /* JsxAttributes */:
+                case 285 /* JsxAttributes */:
                     return elaborateJsxComponents(node, source, target, relation, containingMessageChain, errorOutputContainer);
-                case 209 /* ArrowFunction */:
+                case 213 /* ArrowFunction */:
                     return elaborateArrowFunction(node, source, target, relation, containingMessageChain, errorOutputContainer);
             }
             return false;
@@ -58273,20 +62126,32 @@ var ts;
                 if (!targetPropType || targetPropType.flags & 8388608 /* IndexedAccess */)
                     continue; // Don't elaborate on indexes on generic variables
                 var sourcePropType = getIndexedAccessTypeOrUndefined(source, nameType);
-                if (sourcePropType && !checkTypeRelatedTo(sourcePropType, targetPropType, relation, /*errorNode*/ undefined)) {
+                if (!sourcePropType)
+                    continue;
+                var propName = getPropertyNameFromIndex(nameType, /*accessNode*/ undefined);
+                if (!checkTypeRelatedTo(sourcePropType, targetPropType, relation, /*errorNode*/ undefined)) {
                     var elaborated = next && elaborateError(next, sourcePropType, targetPropType, relation, /*headMessage*/ undefined, containingMessageChain, errorOutputContainer);
-                    if (elaborated) {
-                        reportedError = true;
-                    }
-                    else {
+                    reportedError = true;
+                    if (!elaborated) {
                         // Issue error on the prop itself, since the prop couldn't elaborate the error
                         var resultObj = errorOutputContainer || {};
                         // Use the expression type, if available
                         var specificSource = next ? checkExpressionForMutableLocationWithContextualType(next, sourcePropType) : sourcePropType;
-                        var result = checkTypeRelatedTo(specificSource, targetPropType, relation, prop, errorMessage, containingMessageChain, resultObj);
-                        if (result && specificSource !== sourcePropType) {
-                            // If for whatever reason the expression type doesn't yield an error, make sure we still issue an error on the sourcePropType
-                            checkTypeRelatedTo(sourcePropType, targetPropType, relation, prop, errorMessage, containingMessageChain, resultObj);
+                        if (exactOptionalPropertyTypes && isExactOptionalPropertyMismatch(specificSource, targetPropType)) {
+                            var diag = ts.createDiagnosticForNode(prop, ts.Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target, typeToString(specificSource), typeToString(targetPropType));
+                            diagnostics.add(diag);
+                            resultObj.errors = [diag];
+                        }
+                        else {
+                            var targetIsOptional = !!(propName && (getPropertyOfType(target, propName) || unknownSymbol).flags & 16777216 /* Optional */);
+                            var sourceIsOptional = !!(propName && (getPropertyOfType(source, propName) || unknownSymbol).flags & 16777216 /* Optional */);
+                            targetPropType = removeMissingType(targetPropType, targetIsOptional);
+                            sourcePropType = removeMissingType(sourcePropType, targetIsOptional && sourceIsOptional);
+                            var result = checkTypeRelatedTo(specificSource, targetPropType, relation, prop, errorMessage, containingMessageChain, resultObj);
+                            if (result && specificSource !== sourcePropType) {
+                                // If for whatever reason the expression type doesn't yield an error, make sure we still issue an error on the sourcePropType
+                                checkTypeRelatedTo(sourcePropType, targetPropType, relation, prop, errorMessage, containingMessageChain, resultObj);
+                            }
                         }
                         if (resultObj.errors) {
                             var reportedDiag = resultObj.errors[resultObj.errors.length - 1];
@@ -58294,9 +62159,7 @@ var ts;
                             var targetProp = propertyName !== undefined ? getPropertyOfType(target, propertyName) : undefined;
                             var issuedElaboration = false;
                             if (!targetProp) {
-                                var indexInfo = isTypeAssignableToKind(nameType, 296 /* NumberLike */) && getIndexInfoOfType(target, 1 /* Number */) ||
-                                    getIndexInfoOfType(target, 0 /* String */) ||
-                                    undefined;
+                                var indexInfo = getApplicableIndexInfo(target, nameType);
                                 if (indexInfo && indexInfo.declaration && !ts.getSourceFileOfNode(indexInfo.declaration).hasNoDefaultLib) {
                                     issuedElaboration = true;
                                     ts.addRelatedInfo(reportedDiag, ts.createDiagnosticForNode(indexInfo.declaration, ts.Diagnostics.The_expected_type_comes_from_this_index_signature));
@@ -58309,7 +62172,6 @@ var ts;
                                 }
                             }
                         }
-                        reportedError = true;
                     }
                 }
             }
@@ -58327,9 +62189,9 @@ var ts;
                     case 1:
                         if (!(_i < _a.length)) return [3 /*break*/, 4];
                         prop = _a[_i];
-                        if (ts.isJsxSpreadAttribute(prop))
+                        if (ts.isJsxSpreadAttribute(prop) || isHyphenatedJsxName(ts.idText(prop.name)))
                             return [3 /*break*/, 3];
-                        return [4 /*yield*/, { errorNode: prop.name, innerExpression: prop.initializer, nameType: getLiteralType(ts.idText(prop.name)) }];
+                        return [4 /*yield*/, { errorNode: prop.name, innerExpression: prop.initializer, nameType: getStringLiteralType(ts.idText(prop.name)) }];
                     case 2:
                         _b.sent();
                         _b.label = 3;
@@ -58353,7 +62215,7 @@ var ts;
                     case 1:
                         if (!(i < node.children.length)) return [3 /*break*/, 5];
                         child = node.children[i];
-                        nameType = getLiteralType(i - memberOffset);
+                        nameType = getNumberLiteralType(i - memberOffset);
                         elem = getElaborationElementForJsxChild(child, nameType, getInvalidTextDiagnostic);
                         if (!elem) return [3 /*break*/, 3];
                         return [4 /*yield*/, elem];
@@ -58372,7 +62234,7 @@ var ts;
         }
         function getElaborationElementForJsxChild(child, nameType, getInvalidTextDiagnostic) {
             switch (child.kind) {
-                case 283 /* JsxExpression */:
+                case 287 /* JsxExpression */:
                     // child is of the type of the expression
                     return { errorNode: child, innerExpression: child.expression, nameType: nameType };
                 case 11 /* JsxText */:
@@ -58381,9 +62243,9 @@ var ts;
                     }
                     // child is a string
                     return { errorNode: child, innerExpression: undefined, nameType: nameType, errorMessage: getInvalidTextDiagnostic() };
-                case 273 /* JsxElement */:
-                case 274 /* JsxSelfClosingElement */:
-                case 277 /* JsxFragment */:
+                case 277 /* JsxElement */:
+                case 278 /* JsxSelfClosingElement */:
+                case 281 /* JsxFragment */:
                     // child is of type JSX.Element
                     return { errorNode: child, innerExpression: child, nameType: nameType };
                 default:
@@ -58397,7 +62259,7 @@ var ts;
                 var containingElement = node.parent.parent;
                 var childPropName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(node));
                 var childrenPropName = childPropName === undefined ? "children" : ts.unescapeLeadingUnderscores(childPropName);
-                var childrenNameType = getLiteralType(childrenPropName);
+                var childrenNameType = getStringLiteralType(childrenPropName);
                 var childrenTargetType = getIndexedAccessType(target, childrenNameType);
                 var validChildren = ts.getSemanticJsxChildren(containingElement.children);
                 if (!ts.length(validChildren)) {
@@ -58452,7 +62314,7 @@ var ts;
                     var tagNameText = ts.getTextOfNode(node.parent.tagName);
                     var childPropName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(node));
                     var childrenPropName = childPropName === undefined ? "children" : ts.unescapeLeadingUnderscores(childPropName);
-                    var childrenTargetType = getIndexedAccessType(target, getLiteralType(childrenPropName));
+                    var childrenTargetType = getIndexedAccessType(target, getStringLiteralType(childrenPropName));
                     var diagnostic = ts.Diagnostics._0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2;
                     invalidTextDiagnostic = __assign(__assign({}, diagnostic), { key: "!!ALREADY FORMATTED!!", message: ts.formatMessage(/*_dummy*/ undefined, diagnostic, tagNameText, childrenPropName, typeToString(childrenTargetType)) });
                 }
@@ -58477,7 +62339,7 @@ var ts;
                         elem = node.elements[i];
                         if (ts.isOmittedExpression(elem))
                             return [3 /*break*/, 3];
-                        nameType = getLiteralType(i);
+                        nameType = getNumberLiteralType(i);
                         return [4 /*yield*/, { errorNode: elem, innerExpression: elem, nameType: nameType }];
                     case 2:
                         _a.sent();
@@ -58531,11 +62393,11 @@ var ts;
                         }
                         _b = prop.kind;
                         switch (_b) {
-                            case 168 /* SetAccessor */: return [3 /*break*/, 2];
-                            case 167 /* GetAccessor */: return [3 /*break*/, 2];
-                            case 165 /* MethodDeclaration */: return [3 /*break*/, 2];
-                            case 289 /* ShorthandPropertyAssignment */: return [3 /*break*/, 2];
-                            case 288 /* PropertyAssignment */: return [3 /*break*/, 4];
+                            case 172 /* SetAccessor */: return [3 /*break*/, 2];
+                            case 171 /* GetAccessor */: return [3 /*break*/, 2];
+                            case 168 /* MethodDeclaration */: return [3 /*break*/, 2];
+                            case 295 /* ShorthandPropertyAssignment */: return [3 /*break*/, 2];
+                            case 294 /* PropertyAssignment */: return [3 /*break*/, 4];
                         }
                         return [3 /*break*/, 6];
                     case 2: return [4 /*yield*/, { errorNode: prop.name, innerExpression: undefined, nameType: type }];
@@ -58612,8 +62474,8 @@ var ts;
                 return 0 /* False */;
             }
             var kind = target.declaration ? target.declaration.kind : 0 /* Unknown */;
-            var strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 165 /* MethodDeclaration */ &&
-                kind !== 164 /* MethodSignature */ && kind !== 166 /* Constructor */;
+            var strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 168 /* MethodDeclaration */ &&
+                kind !== 167 /* MethodSignature */ && kind !== 170 /* Constructor */;
             var result = -1 /* True */;
             var sourceThisType = getThisTypeOfSignature(source);
             if (sourceThisType && sourceThisType !== voidType) {
@@ -58747,8 +62609,7 @@ var ts;
                 t.properties.length === 0 &&
                 t.callSignatures.length === 0 &&
                 t.constructSignatures.length === 0 &&
-                !t.stringIndexInfo &&
-                !t.numberIndexInfo;
+                t.indexInfos.length === 0;
         }
         function isEmptyObjectType(type) {
             return type.flags & 524288 /* Object */ ? !isGenericMappedType(type) && isEmptyResolvedType(resolveStructuredTypeMembers(type)) :
@@ -58762,7 +62623,7 @@ var ts;
                 type.symbol && type.symbol.flags & 2048 /* TypeLiteral */ && getMembersOfSymbol(type.symbol).size === 0));
         }
         function isStringIndexSignatureOnlyType(type) {
-            return type.flags & 524288 /* Object */ && !isGenericMappedType(type) && getPropertiesOfType(type).length === 0 && getIndexInfoOfType(type, 0 /* String */) && !getIndexInfoOfType(type, 1 /* Number */) ||
+            return type.flags & 524288 /* Object */ && !isGenericMappedType(type) && getPropertiesOfType(type).length === 0 && getIndexInfosOfType(type).length === 1 && !!getIndexInfoOfType(type, stringType) ||
                 type.flags & 3145728 /* UnionOrIntersection */ && ts.every(type.types, isStringIndexSignatureOnlyType) ||
                 false;
         }
@@ -58846,7 +62707,7 @@ var ts;
                 // Type number or any numeric literal type is assignable to any numeric enum type or any
                 // numeric enum literal type. This rule exists for backwards compatibility reasons because
                 // bit-flag enum types sometimes look like literal enum types with numeric literal values.
-                if (s & (8 /* Number */ | 256 /* NumberLiteral */) && !(s & 1024 /* EnumLiteral */) && (t & 32 /* Enum */ || t & 256 /* NumberLiteral */ && t & 1024 /* EnumLiteral */))
+                if (s & (8 /* Number */ | 256 /* NumberLiteral */) && !(s & 1024 /* EnumLiteral */) && (t & 32 /* Enum */ || relation === assignableRelation && t & 256 /* NumberLiteral */ && t & 1024 /* EnumLiteral */))
                     return true;
             }
             return false;
@@ -58867,9 +62728,10 @@ var ts;
                 }
             }
             else {
-                if (!(source.flags & 3145728 /* UnionOrIntersection */) && !(target.flags & 3145728 /* UnionOrIntersection */) &&
-                    source.flags !== target.flags && !(source.flags & 469237760 /* Substructure */))
+                if (source.flags !== target.flags)
                     return false;
+                if (source.flags & 67358815 /* Singleton */)
+                    return true;
             }
             if (source.flags & 524288 /* Object */ && target.flags & 524288 /* Object */) {
                 var related = relation.get(getRelationKey(source, target, 0 /* None */, relation));
@@ -58883,7 +62745,7 @@ var ts;
             return false;
         }
         function isIgnoredJsxProperty(source, sourceProp) {
-            return ts.getObjectFlags(source) & 4096 /* JsxAttributes */ && !isUnhyphenatedJsxName(sourceProp.escapedName);
+            return ts.getObjectFlags(source) & 2048 /* JsxAttributes */ && isHyphenatedJsxName(sourceProp.escapedName);
         }
         function getNormalizedType(type, writing) {
             while (true) {
@@ -58893,6 +62755,7 @@ var ts;
                             type.flags & 33554432 /* Substitution */ ? writing ? type.baseType : type.substitute :
                                 type.flags & 25165824 /* Simplifiable */ ? getSimplifiedType(type, writing) :
                                     type;
+                t = getSingleBaseForNonAugmentingSubtype(t) || t;
                 if (t === type)
                     break;
                 type = t;
@@ -58917,7 +62780,8 @@ var ts;
             var sourceStack;
             var targetStack;
             var maybeCount = 0;
-            var depth = 0;
+            var sourceDepth = 0;
+            var targetDepth = 0;
             var expandingFlags = 0 /* None */;
             var overflow = false;
             var overrideNextErrorInfo = 0; // How many `reportRelationError` calls should be skipped in the elaboration pyramid
@@ -58925,12 +62789,12 @@ var ts;
             var incompatibleStack = [];
             var inPropertyCheck = false;
             ts.Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking");
-            var result = isRelatedTo(source, target, /*reportErrors*/ !!errorNode, headMessage);
+            var result = isRelatedTo(source, target, 3 /* Both */, /*reportErrors*/ !!errorNode, headMessage);
             if (incompatibleStack.length) {
                 reportIncompatibleStack();
             }
             if (overflow) {
-                ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.instant("checkTypes" /* CheckTypes */, "checkTypeRelatedTo_DepthLimit", { sourceId: source.id, targetId: target.id, depth: depth });
+                ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.instant("checkTypes" /* CheckTypes */, "checkTypeRelatedTo_DepthLimit", { sourceId: source.id, targetId: target.id, depth: sourceDepth, targetDepth: targetDepth });
                 var diag = error(errorNode || currentNode, ts.Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source), typeToString(target));
                 if (errorOutputContainer) {
                     (errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag);
@@ -58959,7 +62823,7 @@ var ts;
                 }
                 var diag = ts.createDiagnosticForNodeFromMessageChain(errorNode, errorInfo, relatedInformation);
                 if (relatedInfo) {
-                    ts.addRelatedInfo.apply(void 0, __spreadArray([diag], relatedInfo));
+                    ts.addRelatedInfo.apply(void 0, __spreadArray([diag], relatedInfo, false));
                 }
                 if (errorOutputContainer) {
                     (errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag);
@@ -59002,7 +62866,7 @@ var ts;
                     reportError.apply(void 0, stack[0]);
                     if (info) {
                         // Actually do the last relation error
-                        reportRelationError.apply(void 0, __spreadArray([/*headMessage*/ undefined], info));
+                        reportRelationError.apply(void 0, __spreadArray([/*headMessage*/ undefined], info, false));
                     }
                     return;
                 }
@@ -59016,24 +62880,24 @@ var ts;
                         case ts.Diagnostics.Types_of_property_0_are_incompatible.code: {
                             // Parenthesize a `new` if there is one
                             if (path.indexOf("new ") === 0) {
-                                path = "(" + path + ")";
+                                path = "(".concat(path, ")");
                             }
                             var str = "" + args[0];
                             // If leading, just print back the arg (irrespective of if it's a valid identifier)
                             if (path.length === 0) {
-                                path = "" + str;
+                                path = "".concat(str);
                             }
                             // Otherwise write a dotted name if possible
-                            else if (ts.isIdentifierText(str, compilerOptions.target)) {
-                                path = path + "." + str;
+                            else if (ts.isIdentifierText(str, ts.getEmitScriptTarget(compilerOptions))) {
+                                path = "".concat(path, ".").concat(str);
                             }
                             // Failing that, check if the name is already a computed name
                             else if (str[0] === "[" && str[str.length - 1] === "]") {
-                                path = "" + path + str;
+                                path = "".concat(path).concat(str);
                             }
                             // And finally write out a computed name as a last resort
                             else {
-                                path = path + "[" + str + "]";
+                                path = "".concat(path, "[").concat(str, "]");
                             }
                             break;
                         }
@@ -59062,12 +62926,20 @@ var ts;
                                     msg.code === ts.Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code)
                                     ? ""
                                     : "...";
-                                path = "" + prefix + path + "(" + params + ")";
+                                path = "".concat(prefix).concat(path, "(").concat(params, ")");
                             }
                             break;
                         }
+                        case ts.Diagnostics.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target.code: {
+                            secondaryRootErrors.unshift([ts.Diagnostics.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target, args[0], args[1]]);
+                            break;
+                        }
+                        case ts.Diagnostics.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target.code: {
+                            secondaryRootErrors.unshift([ts.Diagnostics.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target, args[0], args[1], args[2]]);
+                            break;
+                        }
                         default:
-                            return ts.Debug.fail("Unhandled Diagnostic: " + msg.code);
+                            return ts.Debug.fail("Unhandled Diagnostic: ".concat(msg.code));
                     }
                 }
                 if (path) {
@@ -59083,12 +62955,12 @@ var ts;
                     var _b = secondaryRootErrors_1[_i], msg = _b[0], args = _b.slice(1);
                     var originalValue = msg.elidedInCompatabilityPyramid;
                     msg.elidedInCompatabilityPyramid = false; // Temporarily override elision to ensure error is reported
-                    reportError.apply(void 0, __spreadArray([msg], args));
+                    reportError.apply(void 0, __spreadArray([msg], args, false));
                     msg.elidedInCompatabilityPyramid = originalValue;
                 }
                 if (info) {
                     // Actually do the last relation error
-                    reportRelationError.apply(void 0, __spreadArray([/*headMessage*/ undefined], info));
+                    reportRelationError.apply(void 0, __spreadArray([/*headMessage*/ undefined], info, false));
                 }
             }
             function reportError(message, arg0, arg1, arg2, arg3) {
@@ -59126,6 +62998,7 @@ var ts;
                         reportError(ts.Diagnostics._0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2, needsOriginalSource ? sourceType : generalizedSourceType, targetType, typeToString(constraint));
                     }
                     else {
+                        errorInfo = undefined;
                         reportError(ts.Diagnostics._0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1, targetType, generalizedSourceType);
                     }
                 }
@@ -59136,10 +63009,25 @@ var ts;
                     else if (sourceType === targetType) {
                         message = ts.Diagnostics.Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated;
                     }
+                    else if (exactOptionalPropertyTypes && getExactOptionalUnassignableProperties(source, target).length) {
+                        message = ts.Diagnostics.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 (source.flags & 128 /* StringLiteral */ && target.flags & 1048576 /* Union */) {
+                            var suggestedType = getSuggestedTypeForNonexistentStringLiteralType(source, target);
+                            if (suggestedType) {
+                                reportError(ts.Diagnostics.Type_0_is_not_assignable_to_type_1_Did_you_mean_2, generalizedSourceType, targetType, typeToString(suggestedType));
+                                return;
+                            }
+                        }
                         message = ts.Diagnostics.Type_0_is_not_assignable_to_type_1;
                     }
                 }
+                else if (message === ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1
+                    && exactOptionalPropertyTypes
+                    && getExactOptionalUnassignableProperties(source, target).length) {
+                    message = ts.Diagnostics.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;
+                }
                 reportError(message, generalizedSourceType, targetType);
             }
             function tryElaborateErrorsForPrimitivesAndObjects(source, target) {
@@ -59186,13 +63074,17 @@ var ts;
                 }
                 return true;
             }
+            function isRelatedToWorker(source, target, reportErrors) {
+                return isRelatedTo(source, target, 3 /* Both */, reportErrors);
+            }
             /**
              * Compare two types and return
              * * Ternary.True if they are related with no assumptions,
              * * Ternary.Maybe if they are related with assumptions of other relationships, or
              * * Ternary.False if they are not related.
              */
-            function isRelatedTo(originalSource, originalTarget, reportErrors, headMessage, intersectionState) {
+            function isRelatedTo(originalSource, originalTarget, recursionFlags, reportErrors, headMessage, intersectionState) {
+                if (recursionFlags === void 0) { recursionFlags = 3 /* Both */; }
                 if (reportErrors === void 0) { reportErrors = false; }
                 if (intersectionState === void 0) { intersectionState = 0 /* None */; }
                 // Before normalization: if `source` is type an object type, and `target` is primitive,
@@ -59201,7 +63093,7 @@ var ts;
                     if (isSimpleTypeRelatedTo(originalSource, originalTarget, relation, reportErrors ? reportError : undefined)) {
                         return -1 /* True */;
                     }
-                    reportErrorResults(originalSource, originalTarget, 0 /* False */, !!(ts.getObjectFlags(originalSource) & 4096 /* JsxAttributes */));
+                    reportErrorResults(originalSource, originalTarget, 0 /* False */, !!(ts.getObjectFlags(originalSource) & 2048 /* JsxAttributes */));
                     return 0 /* False */;
                 }
                 // Normalize the source and target types: Turn fresh literal types into regular literal types,
@@ -59213,7 +63105,7 @@ var ts;
                 if (source === target)
                     return -1 /* True */;
                 if (relation === identityRelation) {
-                    return isIdenticalTo(source, target);
+                    return isIdenticalTo(source, target, recursionFlags);
                 }
                 // We fastpath comparing a type parameter to exactly its constraint, as this is _super_ common,
                 // and otherwise, for type parameters in large unions, causes us to need to compare the union to itself,
@@ -59236,16 +63128,16 @@ var ts;
                     target.types.length <= 3 && maybeTypeOfKind(target, 98304 /* Nullable */)) {
                     var nullStrippedTarget = extractTypesOfKind(target, ~98304 /* Nullable */);
                     if (!(nullStrippedTarget.flags & (1048576 /* Union */ | 131072 /* Never */))) {
-                        if (source === nullStrippedTarget)
-                            return -1 /* True */;
-                        target = nullStrippedTarget;
+                        target = getNormalizedType(nullStrippedTarget, /*writing*/ true);
                     }
+                    if (source === nullStrippedTarget)
+                        return -1 /* True */;
                 }
                 if (relation === comparableRelation && !(target.flags & 131072 /* Never */) && isSimpleTypeRelatedTo(target, source, relation) ||
                     isSimpleTypeRelatedTo(source, target, relation, reportErrors ? reportError : undefined))
                     return -1 /* True */;
-                var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 4096 /* JsxAttributes */);
-                var isPerformingExcessPropertyChecks = !(intersectionState & 2 /* Target */) && (isObjectLiteralType(source) && ts.getObjectFlags(source) & 32768 /* FreshLiteral */);
+                var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 2048 /* JsxAttributes */);
+                var isPerformingExcessPropertyChecks = !(intersectionState & 2 /* Target */) && (isObjectLiteralType(source) && ts.getObjectFlags(source) & 16384 /* FreshLiteral */);
                 if (isPerformingExcessPropertyChecks) {
                     if (hasExcessProperties(source, target, reportErrors)) {
                         if (reportErrors) {
@@ -59264,8 +63156,8 @@ var ts;
                         var targetString = typeToString(originalTarget.aliasSymbol ? originalTarget : target);
                         var calls = getSignaturesOfType(source, 0 /* Call */);
                         var constructs = getSignaturesOfType(source, 1 /* Construct */);
-                        if (calls.length > 0 && isRelatedTo(getReturnTypeOfSignature(calls[0]), target, /*reportErrors*/ false) ||
-                            constructs.length > 0 && isRelatedTo(getReturnTypeOfSignature(constructs[0]), target, /*reportErrors*/ false)) {
+                        if (calls.length > 0 && isRelatedTo(getReturnTypeOfSignature(calls[0]), target, 1 /* Source */, /*reportErrors*/ false) ||
+                            constructs.length > 0 && isRelatedTo(getReturnTypeOfSignature(constructs[0]), target, 1 /* Source */, /*reportErrors*/ false)) {
                             reportError(ts.Diagnostics.Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it, sourceString, targetString);
                         }
                         else {
@@ -59277,16 +63169,15 @@ var ts;
                 traceUnionsOrIntersectionsTooLarge(source, target);
                 var result = 0 /* False */;
                 var saveErrorInfo = captureErrorCalculationState();
-                // Note that these checks are specifically ordered to produce correct results. In particular,
-                // we need to deconstruct unions before intersections (because unions are always at the top),
-                // and we need to handle "each" relations before "some" relations for the same kind of type.
-                if (source.flags & 3145728 /* UnionOrIntersection */ || target.flags & 3145728 /* UnionOrIntersection */) {
-                    result = getConstituentCount(source) * getConstituentCount(target) >= 4 ?
-                        recursiveTypeRelatedTo(source, target, reportErrors, intersectionState | 8 /* UnionIntersectionCheck */) :
-                        structuredTypeRelatedTo(source, target, reportErrors, intersectionState | 8 /* UnionIntersectionCheck */);
+                if ((source.flags & 1048576 /* Union */ || target.flags & 1048576 /* Union */) && getConstituentCount(source) * getConstituentCount(target) < 4) {
+                    // We skip caching when source or target is a union with no more than three constituents.
+                    result = structuredTypeRelatedTo(source, target, reportErrors, intersectionState | 8 /* UnionIntersectionCheck */);
+                }
+                else if (source.flags & 3145728 /* UnionOrIntersection */ || target.flags & 3145728 /* UnionOrIntersection */) {
+                    result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState | 8 /* UnionIntersectionCheck */, recursionFlags);
                 }
                 if (!result && !(source.flags & 1048576 /* Union */) && (source.flags & (469499904 /* StructuredOrInstantiable */) || target.flags & 469499904 /* StructuredOrInstantiable */)) {
-                    if (result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState)) {
+                    if (result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState, recursionFlags)) {
                         resetErrorInfo(saveErrorInfo);
                     }
                 }
@@ -59308,7 +63199,7 @@ var ts;
                     if (constraint && (source.flags & 2097152 /* Intersection */ || target.flags & 1048576 /* Union */)) {
                         if (everyType(constraint, function (c) { return c !== source; })) { // Skip comparison if expansion contains the source itself
                             // TODO: Stack errors so we get a pyramid for the "normal" comparison above, _and_ a second for this
-                            if (result = isRelatedTo(constraint, target, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState)) {
+                            if (result = isRelatedTo(constraint, target, 1 /* Source */, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState)) {
                                 resetErrorInfo(saveErrorInfo);
                             }
                         }
@@ -59330,17 +63221,19 @@ var ts;
                 // We suppress recursive intersection property checks because they can generate lots of work when relating
                 // recursive intersections that are structurally similar but not exactly identical. See #37854.
                 if (result && !inPropertyCheck && (target.flags & 2097152 /* Intersection */ && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks) ||
-                    isNonGenericObjectType(target) && !isArrayType(target) && !isTupleType(target) && source.flags & 2097152 /* Intersection */ && getApparentType(source).flags & 3670016 /* StructuredType */ && !ts.some(source.types, function (t) { return !!(ts.getObjectFlags(t) & 2097152 /* NonInferrableType */); }))) {
+                    isNonGenericObjectType(target) && !isArrayType(target) && !isTupleType(target) && source.flags & 2097152 /* Intersection */ && getApparentType(source).flags & 3670016 /* StructuredType */ && !ts.some(source.types, function (t) { return !!(ts.getObjectFlags(t) & 524288 /* NonInferrableType */); }))) {
                     inPropertyCheck = true;
-                    result &= recursiveTypeRelatedTo(source, target, reportErrors, 4 /* PropertyCheck */);
+                    result &= recursiveTypeRelatedTo(source, target, reportErrors, 4 /* PropertyCheck */, recursionFlags);
                     inPropertyCheck = false;
                 }
                 reportErrorResults(source, target, result, isComparingJsxAttributes);
                 return result;
                 function reportErrorResults(source, target, result, isComparingJsxAttributes) {
                     if (!result && reportErrors) {
-                        source = originalSource.aliasSymbol ? originalSource : source;
-                        target = originalTarget.aliasSymbol ? originalTarget : target;
+                        var sourceHasBase = !!getSingleBaseForNonAugmentingSubtype(originalSource);
+                        var targetHasBase = !!getSingleBaseForNonAugmentingSubtype(originalTarget);
+                        source = (originalSource.aliasSymbol || sourceHasBase) ? originalSource : source;
+                        target = (originalTarget.aliasSymbol || targetHasBase) ? originalTarget : target;
                         var maybeSuppress = overrideNextErrorInfo > 0;
                         if (maybeSuppress) {
                             overrideNextErrorInfo--;
@@ -59362,7 +63255,7 @@ var ts;
                             var targetTypes = target.types;
                             var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, errorNode);
                             var intrinsicClassAttributes = getJsxType(JsxNames.IntrinsicClassAttributes, errorNode);
-                            if (intrinsicAttributes !== errorType && intrinsicClassAttributes !== errorType &&
+                            if (!isErrorType(intrinsicAttributes) && !isErrorType(intrinsicClassAttributes) &&
                                 (ts.contains(targetTypes, intrinsicAttributes) || ts.contains(targetTypes, intrinsicClassAttributes))) {
                                 // do not report top error
                                 return result;
@@ -59387,7 +63280,7 @@ var ts;
                 if ((source.flags & 3145728 /* UnionOrIntersection */) && (target.flags & 3145728 /* UnionOrIntersection */)) {
                     var sourceUnionOrIntersection = source;
                     var targetUnionOrIntersection = target;
-                    if (sourceUnionOrIntersection.objectFlags & targetUnionOrIntersection.objectFlags & 262144 /* PrimitiveUnion */) {
+                    if (sourceUnionOrIntersection.objectFlags & targetUnionOrIntersection.objectFlags & 65536 /* PrimitiveUnion */) {
                         // There's a fast path for comparing primitive unions
                         return;
                     }
@@ -59405,35 +63298,37 @@ var ts;
                     }
                 }
             }
-            function isIdenticalTo(source, target) {
-                var flags = source.flags & target.flags;
-                if (!(flags & 469237760 /* Substructure */)) {
+            function isIdenticalTo(source, target, recursionFlags) {
+                if (source.flags !== target.flags)
                     return 0 /* False */;
-                }
+                if (source.flags & 67358815 /* Singleton */)
+                    return -1 /* True */;
                 traceUnionsOrIntersectionsTooLarge(source, target);
-                if (flags & 3145728 /* UnionOrIntersection */) {
-                    var result_6 = eachTypeRelatedToSomeType(source, target);
-                    if (result_6) {
-                        result_6 &= eachTypeRelatedToSomeType(target, source);
+                if (source.flags & 3145728 /* UnionOrIntersection */) {
+                    var result_7 = eachTypeRelatedToSomeType(source, target);
+                    if (result_7) {
+                        result_7 &= eachTypeRelatedToSomeType(target, source);
                     }
-                    return result_6;
+                    return result_7;
                 }
-                return recursiveTypeRelatedTo(source, target, /*reportErrors*/ false, 0 /* None */);
+                return recursiveTypeRelatedTo(source, target, /*reportErrors*/ false, 0 /* None */, recursionFlags);
             }
             function getTypeOfPropertyInTypes(types, name) {
                 var appendPropType = function (propTypes, type) {
+                    var _a;
                     type = getApparentType(type);
                     var prop = type.flags & 3145728 /* UnionOrIntersection */ ? getPropertyOfUnionOrIntersectionType(type, name) : getPropertyOfObjectType(type, name);
-                    var propType = prop && getTypeOfSymbol(prop) || isNumericLiteralName(name) && getIndexTypeOfType(type, 1 /* Number */) || getIndexTypeOfType(type, 0 /* String */) || undefinedType;
+                    var propType = prop && getTypeOfSymbol(prop) || ((_a = getApplicableIndexInfoForName(type, name)) === null || _a === void 0 ? void 0 : _a.type) || undefinedType;
                     return ts.append(propTypes, propType);
                 };
                 return getUnionType(ts.reduceLeft(types, appendPropType, /*initial*/ undefined) || ts.emptyArray);
             }
             function hasExcessProperties(source, target, reportErrors) {
-                if (!isExcessPropertyCheckTarget(target) || !noImplicitAny && ts.getObjectFlags(target) & 16384 /* JSLiteral */) {
+                var _a;
+                if (!isExcessPropertyCheckTarget(target) || !noImplicitAny && ts.getObjectFlags(target) & 8192 /* JSLiteral */) {
                     return false; // Disable excess property checks on JS literals to simulate having an implicit "index signature" - but only outside of noImplicitAny
                 }
-                var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 4096 /* JsxAttributes */);
+                var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 2048 /* JsxAttributes */);
                 if ((relation === assignableRelation || relation === comparableRelation) &&
                     (isTypeSubsetOf(globalObjectType, target) || (!isComparingJsxAttributes && isEmptyObjectType(target)))) {
                     return false;
@@ -59444,7 +63339,7 @@ var ts;
                     reducedTarget = findMatchingDiscriminantType(source, target, isRelatedTo) || filterPrimitivesIfContainsNonPrimitive(target);
                     checkTypes = reducedTarget.flags & 1048576 /* Union */ ? reducedTarget.types : [reducedTarget];
                 }
-                var _loop_16 = function (prop) {
+                var _loop_18 = function (prop) {
                     if (shouldCheckAsExcessProperty(prop, source.symbol) && !isIgnoredJsxProperty(source, prop)) {
                         if (!isKnownProperty(reducedTarget, prop.escapedName, isComparingJsxAttributes)) {
                             if (reportErrors) {
@@ -59476,7 +63371,7 @@ var ts;
                                 }
                                 else {
                                     // use the property's value declaration if the property is assigned inside the literal itself
-                                    var objectLiteralDeclaration_1 = source.symbol && ts.firstOrUndefined(source.symbol.declarations);
+                                    var objectLiteralDeclaration_1 = ((_a = source.symbol) === null || _a === void 0 ? void 0 : _a.declarations) && ts.firstOrUndefined(source.symbol.declarations);
                                     var suggestion = void 0;
                                     if (prop.valueDeclaration && ts.findAncestor(prop.valueDeclaration, function (d) { return d === objectLiteralDeclaration_1; }) && ts.getSourceFileOfNode(objectLiteralDeclaration_1) === ts.getSourceFileOfNode(errorNode)) {
                                         var propDeclaration = prop.valueDeclaration;
@@ -59497,7 +63392,7 @@ var ts;
                             }
                             return { value: true };
                         }
-                        if (checkTypes && !isRelatedTo(getTypeOfSymbol(prop), getTypeOfPropertyInTypes(checkTypes, prop.escapedName), reportErrors)) {
+                        if (checkTypes && !isRelatedTo(getTypeOfSymbol(prop), getTypeOfPropertyInTypes(checkTypes, prop.escapedName), 3 /* Both */, reportErrors)) {
                             if (reportErrors) {
                                 reportIncompatibleError(ts.Diagnostics.Types_of_property_0_are_incompatible, symbolToString(prop));
                             }
@@ -59505,9 +63400,9 @@ var ts;
                         }
                     }
                 };
-                for (var _i = 0, _a = getPropertiesOfType(source); _i < _a.length; _i++) {
-                    var prop = _a[_i];
-                    var state_5 = _loop_16(prop);
+                for (var _i = 0, _b = getPropertiesOfType(source); _i < _b.length; _i++) {
+                    var prop = _b[_i];
+                    var state_5 = _loop_18(prop);
                     if (typeof state_5 === "object")
                         return state_5.value;
                 }
@@ -59531,19 +63426,28 @@ var ts;
             }
             function typeRelatedToSomeType(source, target, reportErrors) {
                 var targetTypes = target.types;
-                if (target.flags & 1048576 /* Union */ && containsType(targetTypes, source)) {
-                    return -1 /* True */;
+                if (target.flags & 1048576 /* Union */) {
+                    if (containsType(targetTypes, source)) {
+                        return -1 /* True */;
+                    }
+                    var match = getMatchingUnionConstituentForType(target, source);
+                    if (match) {
+                        var related = isRelatedTo(source, match, 2 /* Target */, /*reportErrors*/ false);
+                        if (related) {
+                            return related;
+                        }
+                    }
                 }
                 for (var _i = 0, targetTypes_1 = targetTypes; _i < targetTypes_1.length; _i++) {
                     var type = targetTypes_1[_i];
-                    var related = isRelatedTo(source, type, /*reportErrors*/ false);
+                    var related = isRelatedTo(source, type, 2 /* Target */, /*reportErrors*/ false);
                     if (related) {
                         return related;
                     }
                 }
                 if (reportErrors) {
                     var bestMatchingType = getBestMatchingType(source, target, isRelatedTo);
-                    isRelatedTo(source, bestMatchingType || targetTypes[targetTypes.length - 1], /*reportErrors*/ true);
+                    isRelatedTo(source, bestMatchingType || targetTypes[targetTypes.length - 1], 2 /* Target */, /*reportErrors*/ true);
                 }
                 return 0 /* False */;
             }
@@ -59552,7 +63456,7 @@ var ts;
                 var targetTypes = target.types;
                 for (var _i = 0, targetTypes_2 = targetTypes; _i < targetTypes_2.length; _i++) {
                     var targetType = targetTypes_2[_i];
-                    var related = isRelatedTo(source, targetType, reportErrors, /*headMessage*/ undefined, intersectionState);
+                    var related = isRelatedTo(source, targetType, 2 /* Target */, reportErrors, /*headMessage*/ undefined, intersectionState);
                     if (!related) {
                         return 0 /* False */;
                     }
@@ -59567,7 +63471,7 @@ var ts;
                 }
                 var len = sourceTypes.length;
                 for (var i = 0; i < len; i++) {
-                    var related = isRelatedTo(sourceTypes[i], target, reportErrors && i === len - 1, /*headMessage*/ undefined, intersectionState);
+                    var related = isRelatedTo(sourceTypes[i], target, 1 /* Source */, reportErrors && i === len - 1, /*headMessage*/ undefined, intersectionState);
                     if (related) {
                         return related;
                     }
@@ -59597,13 +63501,13 @@ var ts;
                         // union has a union of objects intersected with it. In such cases, if the input was, eg `("a" | "b" | "c") & (string | boolean | {} | {whatever})`,
                         // the result will have the structure `"a" | "b" | "c" | "a" & {} | "b" & {} | "c" & {} | "a" & {whatever} | "b" & {whatever} | "c" & {whatever}`
                         // - the resulting union has a length which is a multiple of the original union, and the elements correspond modulo the length of the original union
-                        var related_1 = isRelatedTo(sourceType, undefinedStrippedTarget.types[i % undefinedStrippedTarget.types.length], /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState);
+                        var related_1 = isRelatedTo(sourceType, undefinedStrippedTarget.types[i % undefinedStrippedTarget.types.length], 3 /* Both */, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState);
                         if (related_1) {
                             result &= related_1;
                             continue;
                         }
                     }
-                    var related = isRelatedTo(sourceType, target, reportErrors, /*headMessage*/ undefined, intersectionState);
+                    var related = isRelatedTo(sourceType, target, 1 /* Source */, reportErrors, /*headMessage*/ undefined, intersectionState);
                     if (!related) {
                         return 0 /* False */;
                     }
@@ -59635,31 +63539,31 @@ var ts;
                             // Even an `Unmeasurable` variance works out without a structural check if the source and target are _identical_.
                             // We can't simply assume invariance, because `Unmeasurable` marks nonlinear relations, for example, a relation tained by
                             // the `-?` modifier in a mapped type (where, no matter how the inputs are related, the outputs still might not be)
-                            related = relation === identityRelation ? isRelatedTo(s, t, /*reportErrors*/ false) : compareTypesIdentical(s, t);
+                            related = relation === identityRelation ? isRelatedTo(s, t, 3 /* Both */, /*reportErrors*/ false) : compareTypesIdentical(s, t);
                         }
                         else if (variance === 1 /* Covariant */) {
-                            related = isRelatedTo(s, t, reportErrors, /*headMessage*/ undefined, intersectionState);
+                            related = isRelatedTo(s, t, 3 /* Both */, reportErrors, /*headMessage*/ undefined, intersectionState);
                         }
                         else if (variance === 2 /* Contravariant */) {
-                            related = isRelatedTo(t, s, reportErrors, /*headMessage*/ undefined, intersectionState);
+                            related = isRelatedTo(t, s, 3 /* Both */, reportErrors, /*headMessage*/ undefined, intersectionState);
                         }
                         else if (variance === 3 /* Bivariant */) {
                             // In the bivariant case we first compare contravariantly without reporting
                             // errors. Then, if that doesn't succeed, we compare covariantly with error
                             // reporting. Thus, error elaboration will be based on the the covariant check,
                             // which is generally easier to reason about.
-                            related = isRelatedTo(t, s, /*reportErrors*/ false);
+                            related = isRelatedTo(t, s, 3 /* Both */, /*reportErrors*/ false);
                             if (!related) {
-                                related = isRelatedTo(s, t, reportErrors, /*headMessage*/ undefined, intersectionState);
+                                related = isRelatedTo(s, t, 3 /* Both */, reportErrors, /*headMessage*/ undefined, intersectionState);
                             }
                         }
                         else {
                             // In the invariant case we first compare covariantly, and only when that
                             // succeeds do we proceed to compare contravariantly. Thus, error elaboration
                             // will typically be based on the covariant check.
-                            related = isRelatedTo(s, t, reportErrors, /*headMessage*/ undefined, intersectionState);
+                            related = isRelatedTo(s, t, 3 /* Both */, reportErrors, /*headMessage*/ undefined, intersectionState);
                             if (related) {
-                                related &= isRelatedTo(t, s, reportErrors, /*headMessage*/ undefined, intersectionState);
+                                related &= isRelatedTo(t, s, 3 /* Both */, reportErrors, /*headMessage*/ undefined, intersectionState);
                             }
                         }
                         if (!related) {
@@ -59675,7 +63579,7 @@ var ts;
             // Third, check if both types are part of deeply nested chains of generic type instantiations and if so assume the types are
             // equal and infinitely expanding. Fourth, if we have reached a depth of 100 nested comparisons, assume we have runaway recursion
             // and issue an error. Otherwise, actually compare the structure of the two types.
-            function recursiveTypeRelatedTo(source, target, reportErrors, intersectionState) {
+            function recursiveTypeRelatedTo(source, target, reportErrors, intersectionState, recursionFlags) {
                 if (overflow) {
                     return 0 /* False */;
                 }
@@ -59706,13 +63610,20 @@ var ts;
                     targetStack = [];
                 }
                 else {
+                    // generate a key where all type parameter id positions are replaced with unconstrained type parameter ids
+                    // this isn't perfect - nested type references passed as type arguments will muck up the indexes and thus
+                    // prevent finding matches- but it should hit up the common cases
+                    var broadestEquivalentId = id.split(",").map(function (i) { return i.replace(/-\d+/g, function (_match, offset) {
+                        var index = ts.length(id.slice(0, offset).match(/[-=]/g) || undefined);
+                        return "=".concat(index);
+                    }); }).join(",");
                     for (var i = 0; i < maybeCount; i++) {
                         // If source and target are already being compared, consider them related with assumptions
-                        if (id === maybeKeys[i]) {
+                        if (id === maybeKeys[i] || broadestEquivalentId === maybeKeys[i]) {
                             return 3 /* Maybe */;
                         }
                     }
-                    if (depth === 100) {
+                    if (sourceDepth === 100 || targetDepth === 100) {
                         overflow = true;
                         return 0 /* False */;
                     }
@@ -59720,14 +63631,19 @@ var ts;
                 var maybeStart = maybeCount;
                 maybeKeys[maybeCount] = id;
                 maybeCount++;
-                sourceStack[depth] = source;
-                targetStack[depth] = target;
-                depth++;
                 var saveExpandingFlags = expandingFlags;
-                if (!(expandingFlags & 1 /* Source */) && isDeeplyNestedType(source, sourceStack, depth))
-                    expandingFlags |= 1 /* Source */;
-                if (!(expandingFlags & 2 /* Target */) && isDeeplyNestedType(target, targetStack, depth))
-                    expandingFlags |= 2 /* Target */;
+                if (recursionFlags & 1 /* Source */) {
+                    sourceStack[sourceDepth] = source;
+                    sourceDepth++;
+                    if (!(expandingFlags & 1 /* Source */) && isDeeplyNestedType(source, sourceStack, sourceDepth))
+                        expandingFlags |= 1 /* Source */;
+                }
+                if (recursionFlags & 2 /* Target */) {
+                    targetStack[targetDepth] = target;
+                    targetDepth++;
+                    if (!(expandingFlags & 2 /* Target */) && isDeeplyNestedType(target, targetStack, targetDepth))
+                        expandingFlags |= 2 /* Target */;
+                }
                 var originalHandler;
                 var propagatingVarianceFlags = 0;
                 if (outofbandVarianceMarkerHandler) {
@@ -59743,17 +63659,23 @@ var ts;
                         sourceIdStack: sourceStack.map(function (t) { return t.id; }),
                         targetId: target.id,
                         targetIdStack: targetStack.map(function (t) { return t.id; }),
-                        depth: depth,
+                        depth: sourceDepth,
+                        targetDepth: targetDepth
                     });
                 }
                 var result = expandingFlags !== 3 /* Both */ ? structuredTypeRelatedTo(source, target, reportErrors, intersectionState) : 3 /* Maybe */;
                 if (outofbandVarianceMarkerHandler) {
                     outofbandVarianceMarkerHandler = originalHandler;
                 }
+                if (recursionFlags & 1 /* Source */) {
+                    sourceDepth--;
+                }
+                if (recursionFlags & 2 /* Target */) {
+                    targetDepth--;
+                }
                 expandingFlags = saveExpandingFlags;
-                depth--;
                 if (result) {
-                    if (result === -1 /* True */ || depth === 0) {
+                    if (result === -1 /* True */ || (sourceDepth === 0 && targetDepth === 0)) {
                         if (result === -1 /* True */ || result === 3 /* Maybe */) {
                             // If result is definitely true, record all maybe keys as having succeeded. Also, record Ternary.Maybe
                             // results as having succeeded once we reach depth 0, but never record Ternary.Unknown results.
@@ -59797,8 +63719,21 @@ var ts;
                     if (target.flags & 2097152 /* Intersection */) {
                         return typeRelatedToEachType(getRegularTypeOfObjectLiteral(source), target, reportErrors, 2 /* Target */);
                     }
-                    // Source is an intersection. Check to see if any constituents of the intersection are immediately related
-                    // to the target.
+                    // Source is an intersection. For the comparable relation, if the target is a primitive type we hoist the
+                    // constraints of all non-primitive types in the source into a new intersection. We do this because the
+                    // intersection may further constrain the constraints of the non-primitive types. For example, given a type
+                    // parameter 'T extends 1 | 2', the intersection 'T & 1' should be reduced to '1' such that it doesn't
+                    // appear to be comparable to '2'.
+                    if (relation === comparableRelation && target.flags & 131068 /* Primitive */) {
+                        var constraints = ts.sameMap(source.types, getBaseConstraintOrType);
+                        if (constraints !== source.types) {
+                            source = getIntersectionType(constraints);
+                            if (!(source.flags & 2097152 /* Intersection */)) {
+                                return isRelatedTo(source, target, 1 /* Source */, /*reportErrors*/ false);
+                            }
+                        }
+                    }
+                    // Check to see if any constituents of the intersection are immediately related to the target.
                     //
                     // Don't report errors though. Checking whether a constituent is related to the source is not actually
                     // useful and leads to some confusing error messages. Instead it is better to let the below checks
@@ -59816,23 +63751,23 @@ var ts;
                 var flags = source.flags & target.flags;
                 if (relation === identityRelation && !(flags & 524288 /* Object */)) {
                     if (flags & 4194304 /* Index */) {
-                        return isRelatedTo(source.type, target.type, /*reportErrors*/ false);
+                        return isRelatedTo(source.type, target.type, 3 /* Both */, /*reportErrors*/ false);
                     }
-                    var result_7 = 0 /* False */;
+                    var result_8 = 0 /* False */;
                     if (flags & 8388608 /* IndexedAccess */) {
-                        if (result_7 = isRelatedTo(source.objectType, target.objectType, /*reportErrors*/ false)) {
-                            if (result_7 &= isRelatedTo(source.indexType, target.indexType, /*reportErrors*/ false)) {
-                                return result_7;
+                        if (result_8 = isRelatedTo(source.objectType, target.objectType, 3 /* Both */, /*reportErrors*/ false)) {
+                            if (result_8 &= isRelatedTo(source.indexType, target.indexType, 3 /* Both */, /*reportErrors*/ false)) {
+                                return result_8;
                             }
                         }
                     }
                     if (flags & 16777216 /* Conditional */) {
                         if (source.root.isDistributive === target.root.isDistributive) {
-                            if (result_7 = isRelatedTo(source.checkType, target.checkType, /*reportErrors*/ false)) {
-                                if (result_7 &= isRelatedTo(source.extendsType, target.extendsType, /*reportErrors*/ false)) {
-                                    if (result_7 &= isRelatedTo(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target), /*reportErrors*/ false)) {
-                                        if (result_7 &= isRelatedTo(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target), /*reportErrors*/ false)) {
-                                            return result_7;
+                            if (result_8 = isRelatedTo(source.checkType, target.checkType, 3 /* Both */, /*reportErrors*/ false)) {
+                                if (result_8 &= isRelatedTo(source.extendsType, target.extendsType, 3 /* Both */, /*reportErrors*/ false)) {
+                                    if (result_8 &= isRelatedTo(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target), 3 /* Both */, /*reportErrors*/ false)) {
+                                        if (result_8 &= isRelatedTo(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target), 3 /* Both */, /*reportErrors*/ false)) {
+                                            return result_8;
                                         }
                                     }
                                 }
@@ -59840,7 +63775,7 @@ var ts;
                         }
                     }
                     if (flags & 33554432 /* Substitution */) {
-                        return isRelatedTo(source.substitute, target.substitute, /*reportErrors*/ false);
+                        return isRelatedTo(source.substitute, target.substitute, 3 /* Both */, /*reportErrors*/ false);
                     }
                     return 0 /* False */;
                 }
@@ -59865,53 +63800,91 @@ var ts;
                 }
                 // For a generic type T and a type U that is assignable to T, [...U] is assignable to T, U is assignable to readonly [...T],
                 // and U is assignable to [...T] when U is constrained to a mutable array or tuple type.
-                if (isSingleElementGenericTupleType(source) && !source.target.readonly && (result = isRelatedTo(getTypeArguments(source)[0], target)) ||
-                    isSingleElementGenericTupleType(target) && (target.target.readonly || isMutableArrayOrTuple(getBaseConstraintOfType(source) || source)) && (result = isRelatedTo(source, getTypeArguments(target)[0]))) {
+                if (isSingleElementGenericTupleType(source) && !source.target.readonly && (result = isRelatedTo(getTypeArguments(source)[0], target, 1 /* Source */)) ||
+                    isSingleElementGenericTupleType(target) && (target.target.readonly || isMutableArrayOrTuple(getBaseConstraintOfType(source) || source)) && (result = isRelatedTo(source, getTypeArguments(target)[0], 2 /* Target */))) {
                     return result;
                 }
                 if (target.flags & 262144 /* TypeParameter */) {
                     // A source type { [P in Q]: X } is related to a target type T if keyof T is related to Q and X is related to T[Q].
-                    if (ts.getObjectFlags(source) & 32 /* Mapped */ && !source.declaration.nameType && isRelatedTo(getIndexType(target), getConstraintTypeFromMappedType(source))) {
+                    if (ts.getObjectFlags(source) & 32 /* Mapped */ && !source.declaration.nameType && isRelatedTo(getIndexType(target), getConstraintTypeFromMappedType(source), 3 /* Both */)) {
                         if (!(getMappedTypeModifiers(source) & 4 /* IncludeOptional */)) {
                             var templateType = getTemplateTypeFromMappedType(source);
                             var indexedAccessType = getIndexedAccessType(target, getTypeParameterFromMappedType(source));
-                            if (result = isRelatedTo(templateType, indexedAccessType, reportErrors)) {
+                            if (result = isRelatedTo(templateType, indexedAccessType, 3 /* Both */, reportErrors)) {
                                 return result;
                             }
                         }
                     }
                 }
                 else if (target.flags & 4194304 /* Index */) {
-                    var targetType = target.type;
+                    var targetType_1 = target.type;
                     // A keyof S is related to a keyof T if T is related to S.
                     if (source.flags & 4194304 /* Index */) {
-                        if (result = isRelatedTo(targetType, source.type, /*reportErrors*/ false)) {
+                        if (result = isRelatedTo(targetType_1, source.type, 3 /* Both */, /*reportErrors*/ false)) {
                             return result;
                         }
                     }
-                    if (isTupleType(targetType)) {
+                    if (isTupleType(targetType_1)) {
                         // An index type can have a tuple type target when the tuple type contains variadic elements.
                         // Check if the source is related to the known keys of the tuple type.
-                        if (result = isRelatedTo(source, getKnownKeysOfTupleType(targetType), reportErrors)) {
+                        if (result = isRelatedTo(source, getKnownKeysOfTupleType(targetType_1), 2 /* Target */, reportErrors)) {
                             return result;
                         }
                     }
                     else {
                         // A type S is assignable to keyof T if S is assignable to keyof C, where C is the
                         // simplified form of T or, if T doesn't simplify, the constraint of T.
-                        var constraint = getSimplifiedTypeOrConstraint(targetType);
+                        var constraint = getSimplifiedTypeOrConstraint(targetType_1);
                         if (constraint) {
                             // We require Ternary.True here such that circular constraints don't cause
                             // false positives. For example, given 'T extends { [K in keyof T]: string }',
                             // 'keyof T' has itself as its constraint and produces a Ternary.Maybe when
                             // related to other types.
-                            if (isRelatedTo(source, getIndexType(constraint, target.stringsOnly), reportErrors) === -1 /* True */) {
+                            if (isRelatedTo(source, getIndexType(constraint, target.stringsOnly), 2 /* Target */, reportErrors) === -1 /* True */) {
+                                return -1 /* True */;
+                            }
+                        }
+                        else if (isGenericMappedType(targetType_1)) {
+                            // generic mapped types that don't simplify or have a constraint still have a very simple set of keys we can compare against
+                            // - their nameType or constraintType.
+                            // In many ways, this comparison is a deferred version of what `getIndexTypeForMappedType` does to actually resolve the keys for _non_-generic types
+                            var nameType_1 = getNameTypeFromMappedType(targetType_1);
+                            var constraintType = getConstraintTypeFromMappedType(targetType_1);
+                            var targetKeys = void 0;
+                            if (nameType_1 && isMappedTypeWithKeyofConstraintDeclaration(targetType_1)) {
+                                // we need to get the apparent mappings and union them with the generic mappings, since some properties may be
+                                // missing from the `constraintType` which will otherwise be mapped in the object
+                                var modifiersType = getApparentType(getModifiersTypeFromMappedType(targetType_1));
+                                var mappedKeys_1 = [];
+                                forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(modifiersType, 8576 /* StringOrNumberLiteralOrUnique */, 
+                                /*stringsOnly*/ false, function (t) { return void mappedKeys_1.push(instantiateType(nameType_1, appendTypeMapping(targetType_1.mapper, getTypeParameterFromMappedType(targetType_1), t))); });
+                                // We still need to include the non-apparent (and thus still generic) keys in the target side of the comparison (in case they're in the source side)
+                                targetKeys = getUnionType(__spreadArray(__spreadArray([], mappedKeys_1, true), [nameType_1], false));
+                            }
+                            else {
+                                targetKeys = nameType_1 || constraintType;
+                            }
+                            if (isRelatedTo(source, targetKeys, 2 /* Target */, reportErrors) === -1 /* True */) {
                                 return -1 /* True */;
                             }
                         }
                     }
                 }
                 else if (target.flags & 8388608 /* IndexedAccess */) {
+                    if (source.flags & 8388608 /* IndexedAccess */) {
+                        // Relate components directly before falling back to constraint relationships
+                        // A type S[K] is related to a type T[J] if S is related to T and K is related to J.
+                        if (result = isRelatedTo(source.objectType, target.objectType, 3 /* Both */, reportErrors)) {
+                            result &= isRelatedTo(source.indexType, target.indexType, 3 /* Both */, reportErrors);
+                        }
+                        if (result) {
+                            resetErrorInfo(saveErrorInfo);
+                            return result;
+                        }
+                        if (reportErrors) {
+                            originalErrorInfo = errorInfo;
+                        }
+                    }
                     // A type S is related to a type T[K] if S is related to C, where C is the base
                     // constraint of T[K] for writing.
                     if (relation === assignableRelation || relation === comparableRelation) {
@@ -59920,47 +63893,81 @@ var ts;
                         var baseObjectType = getBaseConstraintOfType(objectType) || objectType;
                         var baseIndexType = getBaseConstraintOfType(indexType) || indexType;
                         if (!isGenericObjectType(baseObjectType) && !isGenericIndexType(baseIndexType)) {
-                            var accessFlags = 2 /* Writing */ | (baseObjectType !== objectType ? 1 /* NoIndexSignatures */ : 0);
-                            var constraint = getIndexedAccessTypeOrUndefined(baseObjectType, baseIndexType, target.noUncheckedIndexedAccessCandidate, /*accessNode*/ undefined, accessFlags);
-                            if (constraint && (result = isRelatedTo(source, constraint, reportErrors))) {
-                                return result;
+                            var accessFlags = 4 /* Writing */ | (baseObjectType !== objectType ? 2 /* NoIndexSignatures */ : 0);
+                            var constraint = getIndexedAccessTypeOrUndefined(baseObjectType, baseIndexType, accessFlags);
+                            if (constraint) {
+                                if (reportErrors && originalErrorInfo) {
+                                    // create a new chain for the constraint error
+                                    resetErrorInfo(saveErrorInfo);
+                                }
+                                if (result = isRelatedTo(source, constraint, 2 /* Target */, reportErrors)) {
+                                    return result;
+                                }
+                                // prefer the shorter chain of the constraint comparison chain, and the direct comparison chain
+                                if (reportErrors && originalErrorInfo && errorInfo) {
+                                    errorInfo = countMessageChainBreadth([originalErrorInfo]) <= countMessageChainBreadth([errorInfo]) ? originalErrorInfo : errorInfo;
+                                }
                             }
                         }
                     }
+                    if (reportErrors) {
+                        originalErrorInfo = undefined;
+                    }
                 }
-                else if (isGenericMappedType(target) && !target.declaration.nameType) {
-                    // A source type T is related to a target type { [P in X]: T[P] }
-                    var template = getTemplateTypeFromMappedType(target);
+                else if (isGenericMappedType(target) && relation !== identityRelation) {
+                    // Check if source type `S` is related to target type `{ [P in Q]: T }` or `{ [P in Q as R]: T}`.
+                    var keysRemapped = !!target.declaration.nameType;
+                    var templateType = getTemplateTypeFromMappedType(target);
                     var modifiers = getMappedTypeModifiers(target);
                     if (!(modifiers & 8 /* ExcludeOptional */)) {
-                        if (template.flags & 8388608 /* IndexedAccess */ && template.objectType === source &&
-                            template.indexType === getTypeParameterFromMappedType(target)) {
+                        // If the mapped type has shape `{ [P in Q]: T[P] }`,
+                        // source `S` is related to target if `T` = `S`, i.e. `S` is related to `{ [P in Q]: S[P] }`.
+                        if (!keysRemapped && templateType.flags & 8388608 /* IndexedAccess */ && templateType.objectType === source &&
+                            templateType.indexType === getTypeParameterFromMappedType(target)) {
                             return -1 /* True */;
                         }
                         if (!isGenericMappedType(source)) {
-                            var targetConstraint = getConstraintTypeFromMappedType(target);
+                            // If target has shape `{ [P in Q as R]: T}`, then its keys have type `R`.
+                            // If target has shape `{ [P in Q]: T }`, then its keys have type `Q`.
+                            var targetKeys = keysRemapped ? getNameTypeFromMappedType(target) : getConstraintTypeFromMappedType(target);
+                            // Type of the keys of source type `S`, i.e. `keyof S`.
                             var sourceKeys = getIndexType(source, /*stringsOnly*/ undefined, /*noIndexSignatures*/ true);
                             var includeOptional = modifiers & 4 /* IncludeOptional */;
-                            var filteredByApplicability = includeOptional ? intersectTypes(targetConstraint, sourceKeys) : undefined;
-                            // A source type T is related to a target type { [P in Q]: X } if Q is related to keyof T and T[Q] is related to X.
-                            // A source type T is related to a target type { [P in Q]?: X } if some constituent Q' of Q is related to keyof T and T[Q'] is related to X.
+                            var filteredByApplicability = includeOptional ? intersectTypes(targetKeys, sourceKeys) : undefined;
+                            // A source type `S` is related to a target type `{ [P in Q]: T }` if `Q` is related to `keyof S` and `S[Q]` is related to `T`.
+                            // A source type `S` is related to a target type `{ [P in Q as R]: T }` if `R` is related to `keyof S` and `S[R]` is related to `T.
+                            // A source type `S` is related to a target type `{ [P in Q]?: T }` if some constituent `Q'` of `Q` is related to `keyof S` and `S[Q']` is related to `T`.
+                            // A source type `S` is related to a target type `{ [P in Q as R]?: T }` if some constituent `R'` of `R` is related to `keyof S` and `S[R']` is related to `T`.
                             if (includeOptional
                                 ? !(filteredByApplicability.flags & 131072 /* Never */)
-                                : isRelatedTo(targetConstraint, sourceKeys)) {
-                                var templateType = getTemplateTypeFromMappedType(target);
+                                : isRelatedTo(targetKeys, sourceKeys, 3 /* Both */)) {
+                                var templateType_1 = getTemplateTypeFromMappedType(target);
                                 var typeParameter = getTypeParameterFromMappedType(target);
-                                // Fastpath: When the template has the form Obj[P] where P is the mapped type parameter, directly compare `source` with `Obj`
-                                // to avoid creating the (potentially very large) number of new intermediate types made by manufacturing `source[P]`
-                                var nonNullComponent = extractTypesOfKind(templateType, ~98304 /* Nullable */);
-                                if (nonNullComponent.flags & 8388608 /* IndexedAccess */ && nonNullComponent.indexType === typeParameter) {
-                                    if (result = isRelatedTo(source, nonNullComponent.objectType, reportErrors)) {
+                                // Fastpath: When the template type has the form `Obj[P]` where `P` is the mapped type parameter, directly compare source `S` with `Obj`
+                                // to avoid creating the (potentially very large) number of new intermediate types made by manufacturing `S[P]`.
+                                var nonNullComponent = extractTypesOfKind(templateType_1, ~98304 /* Nullable */);
+                                if (!keysRemapped && nonNullComponent.flags & 8388608 /* IndexedAccess */ && nonNullComponent.indexType === typeParameter) {
+                                    if (result = isRelatedTo(source, nonNullComponent.objectType, 2 /* Target */, reportErrors)) {
                                         return result;
                                     }
                                 }
                                 else {
-                                    var indexingType = filteredByApplicability ? getIntersectionType([filteredByApplicability, typeParameter]) : typeParameter;
+                                    // We need to compare the type of a property on the source type `S` to the type of the same property on the target type,
+                                    // so we need to construct an indexing type representing a property, and then use indexing type to index the source type for comparison.
+                                    // If the target type has shape `{ [P in Q]: T }`, then a property of the target has type `P`.
+                                    // If the target type has shape `{ [P in Q]?: T }`, then a property of the target has type `P`,
+                                    // but the property is optional, so we only want to compare properties `P` that are common between `keyof S` and `Q`.
+                                    // If the target type has shape `{ [P in Q as R]: T }`, then a property of the target has type `R`.
+                                    // If the target type has shape `{ [P in Q as R]?: T }`, then a property of the target has type `R`,
+                                    // but the property is optional, so we only want to compare properties `R` that are common between `keyof S` and `R`.
+                                    var indexingType = keysRemapped
+                                        ? (filteredByApplicability || targetKeys)
+                                        : filteredByApplicability
+                                            ? getIntersectionType([filteredByApplicability, typeParameter])
+                                            : typeParameter;
                                     var indexedAccessType = getIndexedAccessType(source, indexingType);
-                                    if (result = isRelatedTo(indexedAccessType, templateType, reportErrors)) {
+                                    // Compare `S[indexingType]` to `T`, where `T` is the type of a property of the target type.
+                                    if (result = isRelatedTo(indexedAccessType, templateType_1, 3 /* Both */, reportErrors)) {
                                         return result;
                                     }
                                 }
@@ -59970,83 +63977,104 @@ var ts;
                         }
                     }
                 }
-                else if (target.flags & 134217728 /* TemplateLiteral */ && source.flags & 128 /* StringLiteral */) {
-                    if (isPatternLiteralType(target)) {
-                        // match all non-`string` segments
-                        var result_8 = inferLiteralsFromTemplateLiteralType(source, target);
-                        if (result_8 && ts.every(result_8, function (r, i) { return isStringLiteralTypeValueParsableAsType(r, target.types[i]); })) {
-                            return -1 /* True */;
+                else if (target.flags & 16777216 /* Conditional */) {
+                    // If we reach 10 levels of nesting for the same conditional type, assume it is an infinitely expanding recursive
+                    // conditional type and bail out with a Ternary.Maybe result.
+                    if (isDeeplyNestedType(target, targetStack, targetDepth, 10)) {
+                        resetErrorInfo(saveErrorInfo);
+                        return 3 /* Maybe */;
+                    }
+                    var c = target;
+                    // We check for a relationship to a conditional type target only when the conditional type has no
+                    // 'infer' positions and is not distributive or is distributive but doesn't reference the check type
+                    // parameter in either of the result types.
+                    if (!c.root.inferTypeParameters && !isDistributionDependent(c.root)) {
+                        // Check if the conditional is always true or always false but still deferred for distribution purposes.
+                        var skipTrue = !isTypeAssignableTo(getPermissiveInstantiation(c.checkType), getPermissiveInstantiation(c.extendsType));
+                        var skipFalse = !skipTrue && isTypeAssignableTo(getRestrictiveInstantiation(c.checkType), getRestrictiveInstantiation(c.extendsType));
+                        // TODO: Find a nice way to include potential conditional type breakdowns in error output, if they seem good (they usually don't)
+                        if (result = skipTrue ? -1 /* True */ : isRelatedTo(source, getTrueTypeFromConditionalType(c), 2 /* Target */, /*reportErrors*/ false)) {
+                            result &= skipFalse ? -1 /* True */ : isRelatedTo(source, getFalseTypeFromConditionalType(c), 2 /* Target */, /*reportErrors*/ false);
+                            if (result) {
+                                resetErrorInfo(saveErrorInfo);
+                                return result;
+                            }
                         }
                     }
                 }
-                if (source.flags & 8650752 /* TypeVariable */) {
-                    if (source.flags & 8388608 /* IndexedAccess */ && target.flags & 8388608 /* IndexedAccess */) {
-                        // A type S[K] is related to a type T[J] if S is related to T and K is related to J.
-                        if (result = isRelatedTo(source.objectType, target.objectType, reportErrors)) {
-                            result &= isRelatedTo(source.indexType, target.indexType, reportErrors);
-                        }
-                        if (result) {
-                            resetErrorInfo(saveErrorInfo);
-                            return result;
+                else if (target.flags & 134217728 /* TemplateLiteral */) {
+                    if (source.flags & 134217728 /* TemplateLiteral */) {
+                        if (relation === comparableRelation) {
+                            return templateLiteralTypesDefinitelyUnrelated(source, target) ? 0 /* False */ : -1 /* True */;
                         }
+                        // Report unreliable variance for type variables referenced in template literal type placeholders.
+                        // For example, `foo-${number}` is related to `foo-${string}` even though number isn't related to string.
+                        instantiateType(source, makeFunctionTypeMapper(reportUnreliableMarkers));
                     }
-                    else {
+                    if (isTypeMatchedByTemplateLiteralType(source, target)) {
+                        return -1 /* True */;
+                    }
+                }
+                if (source.flags & 8650752 /* TypeVariable */) {
+                    // IndexedAccess comparisons are handled above in the `target.flags & TypeFlage.IndexedAccess` branch
+                    if (!(source.flags & 8388608 /* IndexedAccess */ && target.flags & 8388608 /* IndexedAccess */)) {
                         var constraint = getConstraintOfType(source);
                         if (!constraint || (source.flags & 262144 /* TypeParameter */ && constraint.flags & 1 /* Any */)) {
                             // A type variable with no constraint is not related to the non-primitive object type.
-                            if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~67108864 /* NonPrimitive */))) {
+                            if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~67108864 /* NonPrimitive */), 3 /* Both */)) {
                                 resetErrorInfo(saveErrorInfo);
                                 return result;
                             }
                         }
                         // hi-speed no-this-instantiation check (less accurate, but avoids costly `this`-instantiation when the constraint will suffice), see #28231 for report on why this is needed
-                        else if (result = isRelatedTo(constraint, target, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState)) {
+                        else if (result = isRelatedTo(constraint, target, 1 /* Source */, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState)) {
                             resetErrorInfo(saveErrorInfo);
                             return result;
                         }
                         // slower, fuller, this-instantiated check (necessary when comparing raw `this` types from base classes), see `subclassWithPolymorphicThisIsAssignable.ts` test for example
-                        else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, reportErrors, /*headMessage*/ undefined, intersectionState)) {
+                        else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, 1 /* Source */, reportErrors && !(target.flags & source.flags & 262144 /* TypeParameter */), /*headMessage*/ undefined, intersectionState)) {
                             resetErrorInfo(saveErrorInfo);
                             return result;
                         }
                     }
                 }
                 else if (source.flags & 4194304 /* Index */) {
-                    if (result = isRelatedTo(keyofConstraintType, target, reportErrors)) {
+                    if (result = isRelatedTo(keyofConstraintType, target, 1 /* Source */, reportErrors)) {
                         resetErrorInfo(saveErrorInfo);
                         return result;
                     }
                 }
-                else if (source.flags & 134217728 /* TemplateLiteral */) {
-                    if (target.flags & 134217728 /* TemplateLiteral */ &&
-                        source.texts.length === target.texts.length &&
-                        source.types.length === target.types.length &&
-                        ts.every(source.texts, function (t, i) { return t === target.texts[i]; }) &&
-                        ts.every(instantiateType(source, makeFunctionTypeMapper(reportUnreliableMarkers)).types, function (t, i) { return !!(target.types[i].flags & (1 /* Any */ | 4 /* String */)) || !!isRelatedTo(t, target.types[i], /*reportErrors*/ false); })) {
-                        return -1 /* True */;
-                    }
-                    var constraint = getBaseConstraintOfType(source);
-                    if (constraint && constraint !== source && (result = isRelatedTo(constraint, target, reportErrors))) {
-                        resetErrorInfo(saveErrorInfo);
-                        return result;
+                else if (source.flags & 134217728 /* TemplateLiteral */ && !(target.flags & 524288 /* Object */)) {
+                    if (!(target.flags & 134217728 /* TemplateLiteral */)) {
+                        var constraint = getBaseConstraintOfType(source);
+                        if (constraint && constraint !== source && (result = isRelatedTo(constraint, target, 1 /* Source */, reportErrors))) {
+                            resetErrorInfo(saveErrorInfo);
+                            return result;
+                        }
                     }
                 }
                 else if (source.flags & 268435456 /* StringMapping */) {
                     if (target.flags & 268435456 /* StringMapping */ && source.symbol === target.symbol) {
-                        if (result = isRelatedTo(source.type, target.type, reportErrors)) {
+                        if (result = isRelatedTo(source.type, target.type, 3 /* Both */, reportErrors)) {
                             resetErrorInfo(saveErrorInfo);
                             return result;
                         }
                     }
                     else {
                         var constraint = getBaseConstraintOfType(source);
-                        if (constraint && (result = isRelatedTo(constraint, target, reportErrors))) {
+                        if (constraint && (result = isRelatedTo(constraint, target, 1 /* Source */, reportErrors))) {
                             resetErrorInfo(saveErrorInfo);
                             return result;
                         }
                     }
                 }
                 else if (source.flags & 16777216 /* Conditional */) {
+                    // If we reach 10 levels of nesting for the same conditional type, assume it is an infinitely expanding recursive
+                    // conditional type and bail out with a Ternary.Maybe result.
+                    if (isDeeplyNestedType(source, sourceStack, sourceDepth, 10)) {
+                        resetErrorInfo(saveErrorInfo);
+                        return 3 /* Maybe */;
+                    }
                     if (target.flags & 16777216 /* Conditional */) {
                         // Two conditional types 'T1 extends U1 ? X1 : Y1' and 'T2 extends U2 ? X2 : Y2' are related if
                         // one of T1 and T2 is related to the other, U1 and U2 are identical types, X1 is related to X2,
@@ -60056,15 +64084,15 @@ var ts;
                         var mapper = void 0;
                         if (sourceParams) {
                             // If the source has infer type parameters, we instantiate them in the context of the target
-                            var ctx = createInferenceContext(sourceParams, /*signature*/ undefined, 0 /* None */, isRelatedTo);
-                            inferTypes(ctx.inferences, target.extendsType, sourceExtends, 256 /* NoConstraints */ | 512 /* AlwaysStrict */);
+                            var ctx = createInferenceContext(sourceParams, /*signature*/ undefined, 0 /* None */, isRelatedToWorker);
+                            inferTypes(ctx.inferences, target.extendsType, sourceExtends, 512 /* NoConstraints */ | 1024 /* AlwaysStrict */);
                             sourceExtends = instantiateType(sourceExtends, ctx.mapper);
                             mapper = ctx.mapper;
                         }
                         if (isTypeIdenticalTo(sourceExtends, target.extendsType) &&
-                            (isRelatedTo(source.checkType, target.checkType) || isRelatedTo(target.checkType, source.checkType))) {
-                            if (result = isRelatedTo(instantiateType(getTrueTypeFromConditionalType(source), mapper), getTrueTypeFromConditionalType(target), reportErrors)) {
-                                result &= isRelatedTo(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target), reportErrors);
+                            (isRelatedTo(source.checkType, target.checkType, 3 /* Both */) || isRelatedTo(target.checkType, source.checkType, 3 /* Both */))) {
+                            if (result = isRelatedTo(instantiateType(getTrueTypeFromConditionalType(source), mapper), getTrueTypeFromConditionalType(target), 3 /* Both */, reportErrors)) {
+                                result &= isRelatedTo(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target), 3 /* Both */, reportErrors);
                             }
                             if (result) {
                                 resetErrorInfo(saveErrorInfo);
@@ -60077,17 +64105,17 @@ var ts;
                         // more assignments than are desirable (since it maps the source check type to its constraint, it loses information)
                         var distributiveConstraint = getConstraintOfDistributiveConditionalType(source);
                         if (distributiveConstraint) {
-                            if (result = isRelatedTo(distributiveConstraint, target, reportErrors)) {
+                            if (result = isRelatedTo(distributiveConstraint, target, 1 /* Source */, reportErrors)) {
                                 resetErrorInfo(saveErrorInfo);
                                 return result;
                             }
                         }
                     }
                     // conditionals _can_ be related to one another via normal constraint, as, eg, `A extends B ? O : never` should be assignable to `O`
-                    // when `O` is a conditional (`never` is trivially aissgnable to `O`, as is `O`!).
+                    // when `O` is a conditional (`never` is trivially assignable to `O`, as is `O`!).
                     var defaultConstraint = getDefaultConstraintOfConditionalType(source);
                     if (defaultConstraint) {
-                        if (result = isRelatedTo(defaultConstraint, target, reportErrors)) {
+                        if (result = isRelatedTo(defaultConstraint, target, 1 /* Source */, reportErrors)) {
                             resetErrorInfo(saveErrorInfo);
                             return result;
                         }
@@ -60115,7 +64143,7 @@ var ts;
                         return 0 /* False */;
                     }
                     if (ts.getObjectFlags(source) & 4 /* Reference */ && ts.getObjectFlags(target) & 4 /* Reference */ && source.target === target.target &&
-                        !(ts.getObjectFlags(source) & 8192 /* MarkerType */ || ts.getObjectFlags(target) & 8192 /* MarkerType */)) {
+                        !isTupleType(source) && !(ts.getObjectFlags(source) & 4096 /* MarkerType */ || ts.getObjectFlags(target) & 4096 /* MarkerType */)) {
                         // We have type references to the same generic type, and the type references are not marker
                         // type references (which are intended by be compared structurally). Obtain the variance
                         // information for the type parameters and relate the type arguments accordingly.
@@ -60133,7 +64161,7 @@ var ts;
                     }
                     else if (isReadonlyArrayType(target) ? isArrayType(source) || isTupleType(source) : isArrayType(target) && isTupleType(source) && !source.target.readonly) {
                         if (relation !== identityRelation) {
-                            return isRelatedTo(getIndexTypeOfType(source, 1 /* Number */) || anyType, getIndexTypeOfType(target, 1 /* Number */) || anyType, reportErrors);
+                            return isRelatedTo(getIndexTypeOfType(source, numberType) || anyType, getIndexTypeOfType(target, numberType) || anyType, 3 /* Both */, reportErrors);
                         }
                         else {
                             // By flags alone, we know that the `target` is a readonly array while the source is a normal array or tuple
@@ -60143,7 +64171,7 @@ var ts;
                     }
                     // Consider a fresh empty object literal type "closed" under the subtype relationship - this way `{} <- {[idx: string]: any} <- fresh({})`
                     // and not `{} <- fresh({}) <- {[idx: string]: any}`
-                    else if ((relation === subtypeRelation || relation === strictSubtypeRelation) && isEmptyObjectType(target) && ts.getObjectFlags(target) & 32768 /* FreshLiteral */ && !isEmptyObjectType(source)) {
+                    else if ((relation === subtypeRelation || relation === strictSubtypeRelation) && isEmptyObjectType(target) && ts.getObjectFlags(target) & 16384 /* FreshLiteral */ && !isEmptyObjectType(source)) {
                         return 0 /* False */;
                     }
                     // Even if relationship doesn't hold for unions, intersections, or generic type references,
@@ -60160,10 +64188,7 @@ var ts;
                             if (result) {
                                 result &= signaturesRelatedTo(source, target, 1 /* Construct */, reportStructuralErrors);
                                 if (result) {
-                                    result &= indexTypesRelatedTo(source, target, 0 /* String */, sourceIsPrimitive, reportStructuralErrors, intersectionState);
-                                    if (result) {
-                                        result &= indexTypesRelatedTo(source, target, 1 /* Number */, sourceIsPrimitive, reportStructuralErrors, intersectionState);
-                                    }
+                                    result &= indexSignaturesRelatedTo(source, target, sourceIsPrimitive, reportStructuralErrors, intersectionState);
                                 }
                             }
                         }
@@ -60189,6 +64214,11 @@ var ts;
                     }
                 }
                 return 0 /* False */;
+                function countMessageChainBreadth(info) {
+                    if (!info)
+                        return 0;
+                    return ts.reduceLeft(info, function (value, chain) { return value + 1 + countMessageChainBreadth(chain.next); }, 0);
+                }
                 function relateVariances(sourceTypeArguments, targetTypeArguments, variances, intersectionState) {
                     if (result = typeArgumentsRelatedTo(sourceTypeArguments, targetTypeArguments, variances, reportErrors, intersectionState)) {
                         return result;
@@ -60253,10 +64283,10 @@ var ts;
                     var result_10;
                     var targetConstraint = getConstraintTypeFromMappedType(target);
                     var sourceConstraint = instantiateType(getConstraintTypeFromMappedType(source), makeFunctionTypeMapper(getCombinedMappedTypeOptionality(source) < 0 ? reportUnmeasurableMarkers : reportUnreliableMarkers));
-                    if (result_10 = isRelatedTo(targetConstraint, sourceConstraint, reportErrors)) {
+                    if (result_10 = isRelatedTo(targetConstraint, sourceConstraint, 3 /* Both */, reportErrors)) {
                         var mapper = createTypeMapper([getTypeParameterFromMappedType(source)], [getTypeParameterFromMappedType(target)]);
                         if (instantiateType(getNameTypeFromMappedType(source), mapper) === instantiateType(getNameTypeFromMappedType(target), mapper)) {
-                            return result_10 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), reportErrors);
+                            return result_10 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), 3 /* Both */, reportErrors);
                         }
                     }
                 }
@@ -60284,7 +64314,7 @@ var ts;
                 var numCombinations = 1;
                 for (var _i = 0, sourcePropertiesFiltered_1 = sourcePropertiesFiltered; _i < sourcePropertiesFiltered_1.length; _i++) {
                     var sourceProperty = sourcePropertiesFiltered_1[_i];
-                    numCombinations *= countTypes(getTypeOfSymbol(sourceProperty));
+                    numCombinations *= countTypes(getNonMissingTypeOfSymbol(sourceProperty));
                     if (numCombinations > 25) {
                         // We've reached the complexity limit.
                         ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.instant("checkTypes" /* CheckTypes */, "typeRelatedToDiscriminatedType_DepthLimit", { sourceId: source.id, targetId: target.id, numCombinations: numCombinations });
@@ -60296,7 +64326,7 @@ var ts;
                 var excludedProperties = new ts.Set();
                 for (var i = 0; i < sourcePropertiesFiltered.length; i++) {
                     var sourceProperty = sourcePropertiesFiltered[i];
-                    var sourcePropertyType = getTypeOfSymbol(sourceProperty);
+                    var sourcePropertyType = getNonMissingTypeOfSymbol(sourceProperty);
                     sourceDiscriminantTypes[i] = sourcePropertyType.flags & 1048576 /* Union */
                         ? sourcePropertyType.types
                         : [sourcePropertyType];
@@ -60306,11 +64336,11 @@ var ts;
                 // constituents of 'target'. If any combination does not have a match then 'source' is not relatable.
                 var discriminantCombinations = ts.cartesianProduct(sourceDiscriminantTypes);
                 var matchingTypes = [];
-                var _loop_17 = function (combination) {
+                var _loop_19 = function (combination) {
                     var hasMatch = false;
                     outer: for (var _c = 0, _d = target.types; _c < _d.length; _c++) {
                         var type = _d[_c];
-                        var _loop_18 = function (i) {
+                        var _loop_20 = function (i) {
                             var sourceProperty = sourcePropertiesFiltered[i];
                             var targetProperty = getPropertyOfType(type, sourceProperty.escapedName);
                             if (!targetProperty)
@@ -60326,7 +64356,7 @@ var ts;
                             }
                         };
                         for (var i = 0; i < sourcePropertiesFiltered.length; i++) {
-                            var state_7 = _loop_18(i);
+                            var state_7 = _loop_20(i);
                             switch (state_7) {
                                 case "continue-outer": continue outer;
                             }
@@ -60340,7 +64370,7 @@ var ts;
                 };
                 for (var _a = 0, discriminantCombinations_1 = discriminantCombinations; _a < discriminantCombinations_1.length; _a++) {
                     var combination = discriminantCombinations_1[_a];
-                    var state_6 = _loop_17(combination);
+                    var state_6 = _loop_19(combination);
                     if (typeof state_6 === "object")
                         return state_6.value;
                 }
@@ -60353,15 +64383,12 @@ var ts;
                         result &= signaturesRelatedTo(source, type, 0 /* Call */, /*reportStructuralErrors*/ false);
                         if (result) {
                             result &= signaturesRelatedTo(source, type, 1 /* Construct */, /*reportStructuralErrors*/ false);
-                            if (result) {
-                                result &= indexTypesRelatedTo(source, type, 0 /* String */, /*sourceIsPrimitive*/ false, /*reportStructuralErrors*/ false, 0 /* None */);
+                            if (result && !(isTupleType(source) && isTupleType(type))) {
                                 // Comparing numeric index types when both `source` and `type` are tuples is unnecessary as the
                                 // element types should be sufficiently covered by `propertiesRelatedTo`. It also causes problems
                                 // with index type assignability as the types for the excluded discriminants are still included
                                 // in the index type.
-                                if (result && !(isTupleType(source) && isTupleType(type))) {
-                                    result &= indexTypesRelatedTo(source, type, 1 /* Number */, /*sourceIsPrimitive*/ false, /*reportStructuralErrors*/ false, 0 /* None */);
-                                }
+                                result &= indexSignaturesRelatedTo(source, type, /*sourceIsPrimitive*/ false, /*reportStructuralErrors*/ false, 0 /* None */);
                             }
                         }
                     }
@@ -60389,46 +64416,9 @@ var ts;
             }
             function isPropertySymbolTypeRelated(sourceProp, targetProp, getTypeOfSourceProperty, reportErrors, intersectionState) {
                 var targetIsOptional = strictNullChecks && !!(ts.getCheckFlags(targetProp) & 48 /* Partial */);
-                var source = getTypeOfSourceProperty(sourceProp);
-                if (ts.getCheckFlags(targetProp) & 65536 /* DeferredType */ && !getSymbolLinks(targetProp).type) {
-                    // Rather than resolving (and normalizing) the type, relate constituent-by-constituent without performing normalization or seconadary passes
-                    var links = getSymbolLinks(targetProp);
-                    ts.Debug.assertIsDefined(links.deferralParent);
-                    ts.Debug.assertIsDefined(links.deferralConstituents);
-                    var unionParent = !!(links.deferralParent.flags & 1048576 /* Union */);
-                    var result_11 = unionParent ? 0 /* False */ : -1 /* True */;
-                    var targetTypes = links.deferralConstituents;
-                    for (var _i = 0, targetTypes_3 = targetTypes; _i < targetTypes_3.length; _i++) {
-                        var targetType = targetTypes_3[_i];
-                        var related = isRelatedTo(source, targetType, /*reportErrors*/ false, /*headMessage*/ undefined, unionParent ? 0 : 2 /* Target */);
-                        if (!unionParent) {
-                            if (!related) {
-                                // Can't assign to a target individually - have to fallback to assigning to the _whole_ intersection (which forces normalization)
-                                return isRelatedTo(source, addOptionality(getTypeOfSymbol(targetProp), targetIsOptional), reportErrors);
-                            }
-                            result_11 &= related;
-                        }
-                        else {
-                            if (related) {
-                                return related;
-                            }
-                        }
-                    }
-                    if (unionParent && !result_11 && targetIsOptional) {
-                        result_11 = isRelatedTo(source, undefinedType);
-                    }
-                    if (unionParent && !result_11 && reportErrors) {
-                        // The easiest way to get the right errors here is to un-defer (which may be costly)
-                        // If it turns out this is too costly too often, we can replicate the error handling logic within
-                        // typeRelatedToSomeType without the discriminatable type branch (as that requires a manifest union
-                        // type on which to hand discriminable properties, which we are expressly trying to avoid here)
-                        return isRelatedTo(source, addOptionality(getTypeOfSymbol(targetProp), targetIsOptional), reportErrors);
-                    }
-                    return result_11;
-                }
-                else {
-                    return isRelatedTo(source, addOptionality(getTypeOfSymbol(targetProp), targetIsOptional), reportErrors, /*headMessage*/ undefined, intersectionState);
-                }
+                var effectiveTarget = addOptionality(getNonMissingTypeOfSymbol(targetProp), /*isProperty*/ false, targetIsOptional);
+                var effectiveSource = getTypeOfSourceProperty(sourceProp);
+                return isRelatedTo(effectiveSource, effectiveTarget, 3 /* Both */, reportErrors, /*headMessage*/ undefined, intersectionState);
             }
             function propertyRelatedTo(source, target, sourceProp, targetProp, getTypeOfSourceProperty, reportErrors, intersectionState, skipOptional) {
                 var sourcePropFlags = ts.getDeclarationModifierFlagsFromSymbol(sourceProp);
@@ -60508,7 +64498,7 @@ var ts;
                 }
                 if (props.length === 1) {
                     var propName = symbolToString(unmatchedProperty);
-                    reportError.apply(void 0, __spreadArray([ts.Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2, propName], getTypeNamesForErrorDisplay(source, target)));
+                    reportError.apply(void 0, __spreadArray([ts.Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2, propName], getTypeNamesForErrorDisplay(source, target), false));
                     if (ts.length(unmatchedProperty.declarations)) {
                         associateRelatedInfo(ts.createDiagnosticForNode(unmatchedProperty.declarations[0], ts.Diagnostics._0_is_declared_here, propName));
                     }
@@ -60557,7 +64547,7 @@ var ts;
                             }
                             return 0 /* False */;
                         }
-                        if (!targetRestFlag && sourceRestFlag) {
+                        if (!targetRestFlag && (sourceRestFlag || targetArity < sourceArity)) {
                             if (reportErrors) {
                                 if (sourceMinLength < targetMinLength) {
                                     reportError(ts.Diagnostics.Target_requires_0_element_s_but_source_may_have_fewer, targetMinLength);
@@ -60605,13 +64595,14 @@ var ts;
                                 }
                             }
                             var sourceType = !isTupleType(source) ? sourceTypeArguments[0] :
-                                i < startCount || i >= targetArity - endCount ? sourceTypeArguments[sourceIndex] :
+                                i < startCount || i >= targetArity - endCount ? removeMissingType(sourceTypeArguments[sourceIndex], !!(sourceFlags & targetFlags & 2 /* Optional */)) :
                                     getElementTypeOfSliceOfTupleType(source, startCount, endCount) || neverType;
                             var targetType = targetTypeArguments[i];
-                            var targetCheckType = sourceFlags & 8 /* Variadic */ && targetFlags & 4 /* Rest */ ? createArrayType(targetType) : targetType;
-                            var related = isRelatedTo(sourceType, targetCheckType, reportErrors, /*headMessage*/ undefined, intersectionState);
+                            var targetCheckType = sourceFlags & 8 /* Variadic */ && targetFlags & 4 /* Rest */ ? createArrayType(targetType) :
+                                removeMissingType(targetType, !!(targetFlags & 2 /* Optional */));
+                            var related = isRelatedTo(sourceType, targetCheckType, 3 /* Both */, reportErrors, /*headMessage*/ undefined, intersectionState);
                             if (!related) {
-                                if (reportErrors) {
+                                if (reportErrors && (targetArity > 1 || sourceArity > 1)) {
                                     if (i < startCount || i >= targetArity - endCount || sourceArity - startCount - endCount === 1) {
                                         reportIncompatibleError(ts.Diagnostics.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target, sourceIndex, i);
                                     }
@@ -60642,7 +64633,7 @@ var ts;
                         var sourceProp = _a[_i];
                         if (!getPropertyOfObjectType(target, sourceProp.escapedName)) {
                             var sourceType = getTypeOfSymbol(sourceProp);
-                            if (!(sourceType === undefinedType || sourceType === undefinedWideningType || sourceType === optionalType)) {
+                            if (!(sourceType.flags & 32768 /* Undefined */)) {
                                 if (reportErrors) {
                                     reportError(ts.Diagnostics.Property_0_does_not_exist_on_type_1, symbolToString(sourceProp), typeToString(target));
                                 }
@@ -60661,7 +64652,7 @@ var ts;
                     if (!(targetProp.flags & 4194304 /* Prototype */) && (!numericNamesOnly || isNumericLiteralName(name) || name === "length")) {
                         var sourceProp = getPropertyOfType(source, name);
                         if (sourceProp && sourceProp !== targetProp) {
-                            var related = propertyRelatedTo(source, target, sourceProp, targetProp, getTypeOfSymbol, reportErrors, intersectionState, relation === comparableRelation);
+                            var related = propertyRelatedTo(source, target, sourceProp, targetProp, getNonMissingTypeOfSymbol, reportErrors, intersectionState, relation === comparableRelation);
                             if (!related) {
                                 return 0 /* False */;
                             }
@@ -60755,7 +64746,7 @@ var ts;
                     var targetSignature = ts.first(targetSignatures);
                     result = signatureRelatedTo(sourceSignature, targetSignature, eraseGenerics, reportErrors, incompatibleReporter(sourceSignature, targetSignature));
                     if (!result && reportErrors && kind === 1 /* Construct */ && (sourceObjectFlags & targetObjectFlags) &&
-                        (((_a = targetSignature.declaration) === null || _a === void 0 ? void 0 : _a.kind) === 166 /* Constructor */ || ((_b = sourceSignature.declaration) === null || _b === void 0 ? void 0 : _b.kind) === 166 /* Constructor */)) {
+                        (((_a = targetSignature.declaration) === null || _a === void 0 ? void 0 : _a.kind) === 170 /* Constructor */ || ((_b = sourceSignature.declaration) === null || _b === void 0 ? void 0 : _b.kind) === 170 /* Constructor */)) {
                         var constructSignatureToString = function (signature) {
                             return signatureToString(signature, /*enclosingDeclaration*/ undefined, 262144 /* WriteArrowStyleSignature */, kind);
                         };
@@ -60803,7 +64794,7 @@ var ts;
              * See signatureAssignableTo, compareSignaturesIdentical
              */
             function signatureRelatedTo(source, target, erase, reportErrors, incompatibleReporter) {
-                return compareSignaturesRelated(erase ? getErasedSignature(source) : source, erase ? getErasedSignature(target) : target, relation === strictSubtypeRelation ? 8 /* StrictArity */ : 0, reportErrors, reportError, incompatibleReporter, isRelatedTo, makeFunctionTypeMapper(reportUnreliableMarkers));
+                return compareSignaturesRelated(erase ? getErasedSignature(source) : source, erase ? getErasedSignature(target) : target, relation === strictSubtypeRelation ? 8 /* StrictArity */ : 0, reportErrors, reportError, incompatibleReporter, isRelatedToWorker, makeFunctionTypeMapper(reportUnreliableMarkers));
             }
             function signaturesIdenticalTo(source, target, kind) {
                 var sourceSignatures = getSignaturesOfType(source, kind);
@@ -60821,8 +64812,9 @@ var ts;
                 }
                 return result;
             }
-            function eachPropertyRelatedTo(source, target, kind, reportErrors) {
+            function membersRelatedToIndexInfo(source, targetInfo, reportErrors) {
                 var result = -1 /* True */;
+                var keyType = targetInfo.keyType;
                 var props = source.flags & 2097152 /* Intersection */ ? getPropertiesOfUnionOrIntersectionType(source) : getPropertiesOfObjectType(source);
                 for (var _i = 0, props_2 = props; _i < props_2.length; _i++) {
                     var prop = props_2[_i];
@@ -60830,16 +64822,12 @@ var ts;
                     if (isIgnoredJsxProperty(source, prop)) {
                         continue;
                     }
-                    var nameType = getSymbolLinks(prop).nameType;
-                    if (nameType && nameType.flags & 8192 /* UniqueESSymbol */) {
-                        continue;
-                    }
-                    if (kind === 0 /* String */ || isNumericLiteralName(prop.escapedName)) {
-                        var propType = getTypeOfSymbol(prop);
-                        var type = propType.flags & 32768 /* Undefined */ || !(kind === 0 /* String */ && prop.flags & 16777216 /* Optional */)
+                    if (isApplicableIndexType(getLiteralTypeFromProperty(prop, 8576 /* StringOrNumberLiteralOrUnique */), keyType)) {
+                        var propType = getNonMissingTypeOfSymbol(prop);
+                        var type = exactOptionalPropertyTypes || propType.flags & 32768 /* Undefined */ || keyType === numberType || !(prop.flags & 16777216 /* Optional */)
                             ? propType
                             : getTypeWithFacts(propType, 524288 /* NEUndefined */);
-                        var related = isRelatedTo(type, target, reportErrors);
+                        var related = isRelatedTo(type, targetInfo.type, 3 /* Both */, reportErrors);
                         if (!related) {
                             if (reportErrors) {
                                 reportError(ts.Diagnostics.Property_0_is_incompatible_with_index_signature, symbolToString(prop));
@@ -60849,60 +64837,77 @@ var ts;
                         result &= related;
                     }
                 }
+                for (var _a = 0, _b = getIndexInfosOfType(source); _a < _b.length; _a++) {
+                    var info = _b[_a];
+                    if (isApplicableIndexType(info.keyType, keyType)) {
+                        var related = indexInfoRelatedTo(info, targetInfo, reportErrors);
+                        if (!related) {
+                            return 0 /* False */;
+                        }
+                        result &= related;
+                    }
+                }
                 return result;
             }
-            function indexTypeRelatedTo(sourceType, targetType, reportErrors) {
-                var related = isRelatedTo(sourceType, targetType, reportErrors);
+            function indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors) {
+                var related = isRelatedTo(sourceInfo.type, targetInfo.type, 3 /* Both */, reportErrors);
                 if (!related && reportErrors) {
-                    reportError(ts.Diagnostics.Index_signatures_are_incompatible);
+                    if (sourceInfo.keyType === targetInfo.keyType) {
+                        reportError(ts.Diagnostics._0_index_signatures_are_incompatible, typeToString(sourceInfo.keyType));
+                    }
+                    else {
+                        reportError(ts.Diagnostics._0_and_1_index_signatures_are_incompatible, typeToString(sourceInfo.keyType), typeToString(targetInfo.keyType));
+                    }
                 }
                 return related;
             }
-            function indexTypesRelatedTo(source, target, kind, sourceIsPrimitive, reportErrors, intersectionState) {
+            function indexSignaturesRelatedTo(source, target, sourceIsPrimitive, reportErrors, intersectionState) {
                 if (relation === identityRelation) {
-                    return indexTypesIdenticalTo(source, target, kind);
-                }
-                var targetType = getIndexTypeOfType(target, kind);
-                if (!targetType || targetType.flags & 1 /* Any */ && !sourceIsPrimitive) {
-                    // Index signature of type any permits assignment from everything but primitives
-                    return -1 /* True */;
+                    return indexSignaturesIdenticalTo(source, target);
                 }
-                if (isGenericMappedType(source)) {
-                    // A generic mapped type { [P in K]: T } is related to a type with an index signature
-                    // { [x: string]: U }, and optionally with an index signature { [x: number]: V },
-                    // if T is related to U and V.
-                    return getIndexTypeOfType(target, 0 /* String */) ? isRelatedTo(getTemplateTypeFromMappedType(source), targetType, reportErrors) : 0 /* False */;
+                var indexInfos = getIndexInfosOfType(target);
+                var targetHasStringIndex = ts.some(indexInfos, function (info) { return info.keyType === stringType; });
+                var result = -1 /* True */;
+                for (var _i = 0, indexInfos_3 = indexInfos; _i < indexInfos_3.length; _i++) {
+                    var targetInfo = indexInfos_3[_i];
+                    var related = !sourceIsPrimitive && targetHasStringIndex && targetInfo.type.flags & 1 /* Any */ ? -1 /* True */ :
+                        isGenericMappedType(source) && targetHasStringIndex ? isRelatedTo(getTemplateTypeFromMappedType(source), targetInfo.type, 3 /* Both */, reportErrors) :
+                            typeRelatedToIndexInfo(source, targetInfo, reportErrors, intersectionState);
+                    if (!related) {
+                        return 0 /* False */;
+                    }
+                    result &= related;
                 }
-                var indexType = getIndexTypeOfType(source, kind) || kind === 1 /* Number */ && getIndexTypeOfType(source, 0 /* String */);
-                if (indexType) {
-                    return indexTypeRelatedTo(indexType, targetType, reportErrors);
+                return result;
+            }
+            function typeRelatedToIndexInfo(source, targetInfo, reportErrors, intersectionState) {
+                var sourceInfo = getApplicableIndexInfo(source, targetInfo.keyType);
+                if (sourceInfo) {
+                    return indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors);
                 }
                 if (!(intersectionState & 1 /* Source */) && isObjectTypeWithInferableIndex(source)) {
                     // Intersection constituents are never considered to have an inferred index signature
-                    var related = eachPropertyRelatedTo(source, targetType, kind, reportErrors);
-                    if (related && kind === 0 /* String */) {
-                        var numberIndexType = getIndexTypeOfType(source, 1 /* Number */);
-                        if (numberIndexType) {
-                            related &= indexTypeRelatedTo(numberIndexType, targetType, reportErrors);
-                        }
-                    }
-                    return related;
+                    return membersRelatedToIndexInfo(source, targetInfo, reportErrors);
                 }
                 if (reportErrors) {
-                    reportError(ts.Diagnostics.Index_signature_is_missing_in_type_0, typeToString(source));
+                    reportError(ts.Diagnostics.Index_signature_for_type_0_is_missing_in_type_1, typeToString(targetInfo.keyType), typeToString(source));
                 }
                 return 0 /* False */;
             }
-            function indexTypesIdenticalTo(source, target, indexKind) {
-                var targetInfo = getIndexInfoOfType(target, indexKind);
-                var sourceInfo = getIndexInfoOfType(source, indexKind);
-                if (!sourceInfo && !targetInfo) {
-                    return -1 /* True */;
+            function indexSignaturesIdenticalTo(source, target) {
+                var sourceInfos = getIndexInfosOfType(source);
+                var targetInfos = getIndexInfosOfType(target);
+                if (sourceInfos.length !== targetInfos.length) {
+                    return 0 /* False */;
                 }
-                if (sourceInfo && targetInfo && sourceInfo.isReadonly === targetInfo.isReadonly) {
-                    return isRelatedTo(sourceInfo.type, targetInfo.type);
+                for (var _i = 0, targetInfos_1 = targetInfos; _i < targetInfos_1.length; _i++) {
+                    var targetInfo = targetInfos_1[_i];
+                    var sourceInfo = getIndexInfoOfType(source, targetInfo.keyType);
+                    if (!(sourceInfo && isRelatedTo(sourceInfo.type, targetInfo.type, 3 /* Both */) && sourceInfo.isReadonly === targetInfo.isReadonly)) {
+                        return 0 /* False */;
+                    }
                 }
-                return 0 /* False */;
+                return -1 /* True */;
             }
             function constructorVisibilitiesAreCompatible(sourceSignature, targetSignature, reportErrors) {
                 if (!sourceSignature.declaration || !targetSignature.declaration) {
@@ -60946,6 +64951,18 @@ var ts;
             }
             return isUnitType(type) || !!(type.flags & 134217728 /* TemplateLiteral */);
         }
+        function getExactOptionalUnassignableProperties(source, target) {
+            if (isTupleType(source) && isTupleType(target))
+                return ts.emptyArray;
+            return getPropertiesOfType(target)
+                .filter(function (targetProp) { return isExactOptionalPropertyMismatch(getTypeOfPropertyOfType(source, targetProp.escapedName), getTypeOfSymbol(targetProp)); });
+        }
+        function isExactOptionalPropertyMismatch(source, target) {
+            return !!source && !!target && maybeTypeOfKind(source, 32768 /* Undefined */) && !!containsMissingType(target);
+        }
+        function getExactOptionalProperties(type) {
+            return getPropertiesOfType(type).filter(function (targetProp) { return containsMissingType(getTypeOfSymbol(targetProp)); });
+        }
         function getBestMatchingType(source, target, isRelatedTo) {
             if (isRelatedTo === void 0) { isRelatedTo = compareTypesAssignable; }
             return findMatchingDiscriminantType(source, target, isRelatedTo, /*skipPartial*/ true) ||
@@ -60998,10 +65015,8 @@ var ts;
         function isWeakType(type) {
             if (type.flags & 524288 /* Object */) {
                 var resolved = resolveStructuredTypeMembers(type);
-                return resolved.callSignatures.length === 0 && resolved.constructSignatures.length === 0 &&
-                    !resolved.stringIndexInfo && !resolved.numberIndexInfo &&
-                    resolved.properties.length > 0 &&
-                    ts.every(resolved.properties, function (p) { return !!(p.flags & 16777216 /* Optional */); });
+                return resolved.callSignatures.length === 0 && resolved.constructSignatures.length === 0 && resolved.indexInfos.length === 0 &&
+                    resolved.properties.length > 0 && ts.every(resolved.properties, function (p) { return !!(p.flags & 16777216 /* Optional */); });
             }
             if (type.flags & 2097152 /* Intersection */) {
                 return ts.every(type.types, isWeakType);
@@ -61021,7 +65036,7 @@ var ts;
         // type, and flag the result as a marker type reference.
         function getMarkerTypeReference(type, source, target) {
             var result = createTypeReference(type, ts.map(type.typeParameters, function (t) { return t === source ? target : t; }));
-            result.objectFlags |= 8192 /* MarkerType */;
+            result.objectFlags |= 4096 /* MarkerType */;
             return result;
         }
         function getAliasVariances(symbol) {
@@ -61046,7 +65061,7 @@ var ts;
                 // The emptyArray singleton is used to signal a recursive invocation.
                 cache.variances = ts.emptyArray;
                 variances = [];
-                var _loop_19 = function (tp) {
+                var _loop_21 = function (tp) {
                     var unmeasurable = false;
                     var unreliable = false;
                     var oldHandler = outofbandVarianceMarkerHandler;
@@ -61078,7 +65093,7 @@ var ts;
                 };
                 for (var _i = 0, typeParameters_1 = typeParameters; _i < typeParameters_1.length; _i++) {
                     var tp = typeParameters_1[_i];
-                    _loop_19(tp);
+                    _loop_21(tp);
                 }
                 cache.variances = variances;
                 ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
@@ -61109,7 +65124,7 @@ var ts;
             return !!(ts.getObjectFlags(type) & 4 /* Reference */) && !type.node;
         }
         function isTypeReferenceWithGenericArguments(type) {
-            return isNonDeferredTypeReference(type) && ts.some(getTypeArguments(type), function (t) { return isUnconstrainedTypeParameter(t) || isTypeReferenceWithGenericArguments(t); });
+            return isNonDeferredTypeReference(type) && ts.some(getTypeArguments(type), function (t) { return !!(t.flags & 262144 /* TypeParameter */) || isTypeReferenceWithGenericArguments(t); });
         }
         /**
          * getTypeReferenceId(A<T, number, U>) returns "111=0-12=1"
@@ -61195,8 +65210,8 @@ var ts;
         }
         // Return true if the given class derives from each of the declaring classes of the protected
         // constituents of the given property.
-        function isClassDerivedFromDeclaringClasses(checkClass, prop) {
-            return forEachProperty(prop, function (p) { return ts.getDeclarationModifierFlagsFromSymbol(p) & 16 /* Protected */ ?
+        function isClassDerivedFromDeclaringClasses(checkClass, prop, writing) {
+            return forEachProperty(prop, function (p) { return ts.getDeclarationModifierFlagsFromSymbol(p, writing) & 16 /* Protected */ ?
                 !hasBaseType(checkClass, getDeclaringClass(p)) : false; }) ? undefined : checkClass;
         }
         // Return true if the given type is deeply nested. We consider this to be the case when structural type comparisons
@@ -61211,26 +65226,30 @@ var ts;
         // `type A<T> = null extends T ? [A<NonNullable<T>>] : [T]`
         // has expanded into `[A<NonNullable<NonNullable<NonNullable<NonNullable<NonNullable<T>>>>>>]`
         // in such cases we need to terminate the expansion, and we do so here.
-        function isDeeplyNestedType(type, stack, depth) {
-            if (depth >= 5) {
+        function isDeeplyNestedType(type, stack, depth, maxDepth) {
+            if (maxDepth === void 0) { maxDepth = 5; }
+            if (depth >= maxDepth) {
                 var identity_1 = getRecursionIdentity(type);
-                if (identity_1) {
-                    var count = 0;
-                    for (var i = 0; i < depth; i++) {
-                        if (getRecursionIdentity(stack[i]) === identity_1) {
-                            count++;
-                            if (count >= 5) {
-                                return true;
-                            }
+                var count = 0;
+                for (var i = 0; i < depth; i++) {
+                    if (getRecursionIdentity(stack[i]) === identity_1) {
+                        count++;
+                        if (count >= maxDepth) {
+                            return true;
                         }
                     }
                 }
             }
             return false;
         }
-        // Types with constituents that could circularly reference the type have a recursion identity. The recursion
-        // identity is some object that is common to instantiations of the type with the same origin.
+        // The recursion identity of a type is an object identity that is shared among multiple instantiations of the type.
+        // We track recursion identities in order to identify deeply nested and possibly infinite type instantiations with
+        // the same origin. For example, when type parameters are in scope in an object type such as { x: T }, all
+        // instantiations of that type have the same recursion identity. The default recursion identity is the object
+        // identity of the type, meaning that every type is unique. Generally, types with constituents that could circularly
+        // reference the type have a recursion identity that differs from the object identity.
         function getRecursionIdentity(type) {
+            // Object and array literals are known not to contain recursive references and don't need a recursion identity.
             if (type.flags & 524288 /* Object */ && !isObjectOrArrayLiteralType(type)) {
                 if (ts.getObjectFlags(type) && 4 /* Reference */ && type.node) {
                     // Deferred type references are tracked through their associated AST node. This gives us finer
@@ -61248,6 +65267,9 @@ var ts;
                     return type.target;
                 }
             }
+            if (type.flags & 262144 /* TypeParameter */) {
+                return type.symbol;
+            }
             if (type.flags & 8388608 /* IndexedAccess */) {
                 // Identity is the leftmost object type in a chain of indexed accesses, eg, in A[P][Q] it is A
                 do {
@@ -61259,7 +65281,7 @@ var ts;
                 // The root object represents the origin of the conditional type
                 return type.root;
             }
-            return undefined;
+            return type;
         }
         function isPropertyIdenticalTo(sourceProp, targetProp) {
             return compareProperties(sourceProp, targetProp, compareTypesIdentical) !== 0 /* False */;
@@ -61382,8 +65404,8 @@ var ts;
         }
         function literalTypesWithSameBaseType(types) {
             var commonBaseType;
-            for (var _i = 0, types_14 = types; _i < types_14.length; _i++) {
-                var t = types_14[_i];
+            for (var _i = 0, types_13 = types; _i < types_13.length; _i++) {
+                var t = types_13[_i];
                 var baseType = getBaseTypeOfLiteralType(t);
                 if (!commonBaseType) {
                     commonBaseType = baseType;
@@ -61398,6 +65420,9 @@ var ts;
         // of those literal types. Otherwise, return the leftmost type for which no type to the
         // right is a supertype.
         function getSupertypeOrUnion(types) {
+            if (types.length === 1) {
+                return types[0];
+            }
             return literalTypesWithSameBaseType(types) ?
                 getUnionType(types) :
                 ts.reduceLeft(types, function (s, t) { return isTypeSubtypeOf(s, t) ? t : s; });
@@ -61432,9 +65457,43 @@ var ts;
             // or if it is not the undefined or null type and if it is assignable to ReadonlyArray<any>
             return isArrayType(type) || !(type.flags & 98304 /* Nullable */) && isTypeAssignableTo(type, anyReadonlyArrayType);
         }
+        function getSingleBaseForNonAugmentingSubtype(type) {
+            if (!(ts.getObjectFlags(type) & 4 /* Reference */) || !(ts.getObjectFlags(type.target) & 3 /* ClassOrInterface */)) {
+                return undefined;
+            }
+            if (ts.getObjectFlags(type) & 33554432 /* IdenticalBaseTypeCalculated */) {
+                return ts.getObjectFlags(type) & 67108864 /* IdenticalBaseTypeExists */ ? type.cachedEquivalentBaseType : undefined;
+            }
+            type.objectFlags |= 33554432 /* IdenticalBaseTypeCalculated */;
+            var target = type.target;
+            if (ts.getObjectFlags(target) & 1 /* Class */) {
+                var baseTypeNode = getBaseTypeNodeOfClass(target);
+                // A base type expression may circularly reference the class itself (e.g. as an argument to function call), so we only
+                // check for base types specified as simple qualified names.
+                if (baseTypeNode && baseTypeNode.expression.kind !== 79 /* Identifier */ && baseTypeNode.expression.kind !== 205 /* PropertyAccessExpression */) {
+                    return undefined;
+                }
+            }
+            var bases = getBaseTypes(target);
+            if (bases.length !== 1) {
+                return undefined;
+            }
+            if (getMembersOfSymbol(type.symbol).size) {
+                return undefined; // If the interface has any members, they may subtype members in the base, so we should do a full structural comparison
+            }
+            var instantiatedBase = !ts.length(target.typeParameters) ? bases[0] : instantiateType(bases[0], createTypeMapper(target.typeParameters, getTypeArguments(type).slice(0, target.typeParameters.length)));
+            if (ts.length(getTypeArguments(type)) > ts.length(target.typeParameters)) {
+                instantiatedBase = getTypeWithThisArgument(instantiatedBase, ts.last(getTypeArguments(type)));
+            }
+            type.objectFlags |= 67108864 /* IdenticalBaseTypeExists */;
+            return type.cachedEquivalentBaseType = instantiatedBase;
+        }
+        function isEmptyLiteralType(type) {
+            return strictNullChecks ? type === implicitNeverType : type === undefinedWideningType;
+        }
         function isEmptyArrayLiteralType(type) {
-            var elementType = isArrayType(type) ? getTypeArguments(type)[0] : undefined;
-            return elementType === undefinedWideningType || elementType === implicitNeverType;
+            var elementType = getElementTypeOfArrayType(type);
+            return !!elementType && isEmptyLiteralType(elementType);
         }
         function isTupleLikeType(type) {
             return isTupleType(type) || !!getPropertyOfType(type, "0");
@@ -61458,6 +65517,13 @@ var ts;
         function isUnitType(type) {
             return !!(type.flags & 109440 /* Unit */);
         }
+        function isUnitLikeType(type) {
+            return type.flags & 2097152 /* Intersection */ ? ts.some(type.types, isUnitType) :
+                !!(type.flags & 109440 /* Unit */);
+        }
+        function extractUnitType(type) {
+            return type.flags & 2097152 /* Intersection */ ? ts.find(type.types, isUnitType) || type : type;
+        }
         function isLiteralType(type) {
             return type.flags & 16 /* Boolean */ ? true :
                 type.flags & 1048576 /* Union */ ? type.flags & 1024 /* EnumLiteral */ ? true : ts.every(type.types, isUnitType) :
@@ -61554,8 +65620,8 @@ var ts;
         }
         function getFalsyFlagsOfTypes(types) {
             var result = 0;
-            for (var _i = 0, types_15 = types; _i < types_15.length; _i++) {
-                var t = types_15[_i];
+            for (var _i = 0, types_14 = types; _i < types_14.length; _i++) {
+                var t = types_14[_i];
                 result |= getFalsyFlags(t);
             }
             return result;
@@ -61603,19 +65669,23 @@ var ts;
                     missing === 65536 /* Null */ ? getUnionType([type, nullType]) :
                         getUnionType([type, undefinedType, nullType]);
         }
-        function getOptionalType(type) {
+        function getOptionalType(type, isProperty) {
+            if (isProperty === void 0) { isProperty = false; }
             ts.Debug.assert(strictNullChecks);
-            return type.flags & 32768 /* Undefined */ ? type : getUnionType([type, undefinedType]);
+            return type.flags & 32768 /* Undefined */ ? type : getUnionType([type, isProperty ? missingType : undefinedType]);
         }
         function getGlobalNonNullableTypeInstantiation(type) {
+            // First reduce away any constituents that are assignable to 'undefined' or 'null'. This not only eliminates
+            // 'undefined' and 'null', but also higher-order types such as a type parameter 'U extends undefined | null'
+            // that isn't eliminated by a NonNullable<T> instantiation.
+            var reducedType = getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
             if (!deferredGlobalNonNullableTypeAlias) {
                 deferredGlobalNonNullableTypeAlias = getGlobalSymbol("NonNullable", 524288 /* TypeAlias */, /*diagnostic*/ undefined) || unknownSymbol;
             }
-            // Use NonNullable global type alias if available to improve quick info/declaration emit
-            if (deferredGlobalNonNullableTypeAlias !== unknownSymbol) {
-                return getTypeAliasInstantiation(deferredGlobalNonNullableTypeAlias, [type]);
-            }
-            return getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */); // Type alias unavailable, fall back to non-higher-order behavior
+            // If the NonNullable<T> type is available, return an instantiation. Otherwise just return the reduced type.
+            return deferredGlobalNonNullableTypeAlias !== unknownSymbol ?
+                getTypeAliasInstantiation(deferredGlobalNonNullableTypeAlias, [reducedType]) :
+                reducedType;
         }
         function getNonNullableType(type) {
             return strictNullChecks ? getGlobalNonNullableTypeInstantiation(type) : type;
@@ -61623,11 +65693,8 @@ var ts;
         function addOptionalTypeMarker(type) {
             return strictNullChecks ? getUnionType([type, optionalType]) : type;
         }
-        function isNotOptionalTypeMarker(type) {
-            return type !== optionalType;
-        }
         function removeOptionalTypeMarker(type) {
-            return strictNullChecks ? filterType(type, isNotOptionalTypeMarker) : type;
+            return strictNullChecks ? removeType(type, optionalType) : type;
         }
         function propagateOptionalTypeMarker(type, node, wasOptional) {
             return wasOptional ? ts.isOutermostOptionalChain(node) ? getOptionalType(type) : addOptionalTypeMarker(type) : type;
@@ -61637,6 +65704,15 @@ var ts;
                 ts.isOptionalChain(expression) ? removeOptionalTypeMarker(exprType) :
                     exprType;
         }
+        function removeMissingType(type, isOptional) {
+            return exactOptionalPropertyTypes && isOptional ? removeType(type, missingType) : type;
+        }
+        function containsMissingType(type) {
+            return exactOptionalPropertyTypes && (type === missingType || type.flags & 1048576 /* Union */ && containsType(type.types, missingType));
+        }
+        function removeMissingOrUndefinedType(type) {
+            return exactOptionalPropertyTypes ? removeType(type, missingType) : getTypeWithFacts(type, 524288 /* NEUndefined */);
+        }
         /**
          * Is source potentially coercible to target type under `==`.
          * Assumes that `source` is a constituent of a union, hence
@@ -61668,7 +65744,7 @@ var ts;
         function isObjectTypeWithInferableIndex(type) {
             return type.flags & 2097152 /* Intersection */ ? ts.every(type.types, isObjectTypeWithInferableIndex) :
                 !!(type.symbol && (type.symbol.flags & (4096 /* ObjectLiteral */ | 2048 /* TypeLiteral */ | 384 /* Enum */ | 512 /* ValueModule */)) !== 0 &&
-                    !typeHasCallOrConstructSignatures(type)) || !!(ts.getObjectFlags(type) & 2048 /* ReverseMapped */ && isObjectTypeWithInferableIndex(type.source));
+                    !typeHasCallOrConstructSignatures(type)) || !!(ts.getObjectFlags(type) & 1024 /* ReverseMapped */ && isObjectTypeWithInferableIndex(type.source));
         }
         function createSymbolWithType(source, type) {
             var symbol = createSymbol(source.flags, source.escapedName, ts.getCheckFlags(source) & 8 /* Readonly */);
@@ -61701,7 +65777,7 @@ var ts;
          * Leave signatures alone since they are not subject to the check.
          */
         function getRegularTypeOfObjectLiteral(type) {
-            if (!(isObjectLiteralType(type) && ts.getObjectFlags(type) & 32768 /* FreshLiteral */)) {
+            if (!(isObjectLiteralType(type) && ts.getObjectFlags(type) & 16384 /* FreshLiteral */)) {
                 return type;
             }
             var regularType = type.regularType;
@@ -61710,9 +65786,9 @@ var ts;
             }
             var resolved = type;
             var members = transformTypeOfMembers(type, getRegularTypeOfObjectLiteral);
-            var regularNew = createAnonymousType(resolved.symbol, members, resolved.callSignatures, resolved.constructSignatures, resolved.stringIndexInfo, resolved.numberIndexInfo);
+            var regularNew = createAnonymousType(resolved.symbol, members, resolved.callSignatures, resolved.constructSignatures, resolved.indexInfos);
             regularNew.flags = resolved.flags;
-            regularNew.objectFlags |= resolved.objectFlags & ~32768 /* FreshLiteral */;
+            regularNew.objectFlags |= resolved.objectFlags & ~16384 /* FreshLiteral */;
             type.regularType = regularNew;
             return regularNew;
         }
@@ -61742,7 +65818,7 @@ var ts;
                 var names = new ts.Map();
                 for (var _i = 0, _a = getSiblingsOfContext(context); _i < _a.length; _i++) {
                     var t = _a[_i];
-                    if (isObjectLiteralType(t) && !(ts.getObjectFlags(t) & 1024 /* ContainsSpread */)) {
+                    if (isObjectLiteralType(t) && !(ts.getObjectFlags(t) & 4194304 /* ContainsSpread */)) {
                         for (var _b = 0, _c = getPropertiesOfType(t); _b < _c.length; _b++) {
                             var prop = _c[_b];
                             names.set(prop.escapedName, prop);
@@ -61769,7 +65845,7 @@ var ts;
             if (cached) {
                 return cached;
             }
-            var result = createSymbolWithType(prop, undefinedType);
+            var result = createSymbolWithType(prop, missingType);
             result.flags |= 16777216 /* Optional */;
             undefinedProperties.set(prop.escapedName, result);
             return result;
@@ -61788,17 +65864,15 @@ var ts;
                     }
                 }
             }
-            var stringIndexInfo = getIndexInfoOfType(type, 0 /* String */);
-            var numberIndexInfo = getIndexInfoOfType(type, 1 /* Number */);
-            var result = createAnonymousType(type.symbol, members, ts.emptyArray, ts.emptyArray, stringIndexInfo && createIndexInfo(getWidenedType(stringIndexInfo.type), stringIndexInfo.isReadonly), numberIndexInfo && createIndexInfo(getWidenedType(numberIndexInfo.type), numberIndexInfo.isReadonly));
-            result.objectFlags |= (ts.getObjectFlags(type) & (16384 /* JSLiteral */ | 2097152 /* NonInferrableType */)); // Retain js literal flag through widening
+            var result = createAnonymousType(type.symbol, members, ts.emptyArray, ts.emptyArray, ts.sameMap(getIndexInfosOfType(type), function (info) { return createIndexInfo(info.keyType, getWidenedType(info.type), info.isReadonly); }));
+            result.objectFlags |= (ts.getObjectFlags(type) & (8192 /* JSLiteral */ | 524288 /* NonInferrableType */)); // Retain js literal flag through widening
             return result;
         }
         function getWidenedType(type) {
             return getWidenedTypeWithContext(type, /*context*/ undefined);
         }
         function getWidenedTypeWithContext(type, context) {
-            if (ts.getObjectFlags(type) & 1572864 /* RequiresWidening */) {
+            if (ts.getObjectFlags(type) & 393216 /* RequiresWidening */) {
                 if (context === undefined && type.widened) {
                     return type.widened;
                 }
@@ -61843,7 +65917,7 @@ var ts;
          */
         function reportWideningErrorsInType(type) {
             var errorReported = false;
-            if (ts.getObjectFlags(type) & 524288 /* ContainsWideningType */) {
+            if (ts.getObjectFlags(type) & 131072 /* ContainsWideningType */) {
                 if (type.flags & 1048576 /* Union */) {
                     if (ts.some(type.types, isEmptyObjectType)) {
                         errorReported = true;
@@ -61869,7 +65943,7 @@ var ts;
                     for (var _d = 0, _e = getPropertiesOfObjectType(type); _d < _e.length; _d++) {
                         var p = _e[_d];
                         var t = getTypeOfSymbol(p);
-                        if (ts.getObjectFlags(t) & 524288 /* ContainsWideningType */) {
+                        if (ts.getObjectFlags(t) & 131072 /* ContainsWideningType */) {
                             if (!reportWideningErrorsInType(t)) {
                                 error(p.valueDeclaration, ts.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, symbolToString(p), typeToString(getWidenedType(t)));
                             }
@@ -61888,12 +65962,12 @@ var ts;
             }
             var diagnostic;
             switch (declaration.kind) {
-                case 216 /* BinaryExpression */:
-                case 163 /* PropertyDeclaration */:
-                case 162 /* PropertySignature */:
+                case 220 /* BinaryExpression */:
+                case 166 /* PropertyDeclaration */:
+                case 165 /* PropertySignature */:
                     diagnostic = noImplicitAny ? ts.Diagnostics.Member_0_implicitly_has_an_1_type : ts.Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage;
                     break;
-                case 160 /* Parameter */:
+                case 163 /* Parameter */:
                     var param = declaration;
                     if (ts.isIdentifier(param.name) &&
                         (ts.isCallSignatureDeclaration(param.parent) || ts.isMethodSignature(param.parent) || ts.isFunctionTypeNode(param.parent)) &&
@@ -61901,30 +65975,31 @@ var ts;
                         (resolveName(param, param.name.escapedText, 788968 /* Type */, undefined, param.name.escapedText, /*isUse*/ true) ||
                             param.name.originalKeywordKind && ts.isTypeNodeKind(param.name.originalKeywordKind))) {
                         var newName = "arg" + param.parent.parameters.indexOf(param);
-                        errorOrSuggestion(noImplicitAny, declaration, ts.Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1, newName, ts.declarationNameToString(param.name));
+                        var typeName = ts.declarationNameToString(param.name) + (param.dotDotDotToken ? "[]" : "");
+                        errorOrSuggestion(noImplicitAny, declaration, ts.Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1, newName, typeName);
                         return;
                     }
                     diagnostic = declaration.dotDotDotToken ?
                         noImplicitAny ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage :
                         noImplicitAny ? ts.Diagnostics.Parameter_0_implicitly_has_an_1_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage;
                     break;
-                case 198 /* BindingElement */:
+                case 202 /* BindingElement */:
                     diagnostic = ts.Diagnostics.Binding_element_0_implicitly_has_an_1_type;
                     if (!noImplicitAny) {
                         // Don't issue a suggestion for binding elements since the codefix doesn't yet support them.
                         return;
                     }
                     break;
-                case 308 /* JSDocFunctionType */:
+                case 315 /* JSDocFunctionType */:
                     error(declaration, ts.Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString);
                     return;
-                case 251 /* FunctionDeclaration */:
-                case 165 /* MethodDeclaration */:
-                case 164 /* MethodSignature */:
-                case 167 /* GetAccessor */:
-                case 168 /* SetAccessor */:
-                case 208 /* FunctionExpression */:
-                case 209 /* ArrowFunction */:
+                case 255 /* FunctionDeclaration */:
+                case 168 /* MethodDeclaration */:
+                case 167 /* MethodSignature */:
+                case 171 /* GetAccessor */:
+                case 172 /* SetAccessor */:
+                case 212 /* FunctionExpression */:
+                case 213 /* ArrowFunction */:
                     if (noImplicitAny && !declaration.name) {
                         if (wideningKind === 3 /* GeneratorYield */) {
                             error(declaration, ts.Diagnostics.Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation, typeAsString);
@@ -61938,7 +66013,7 @@ var ts;
                         wideningKind === 3 /* GeneratorYield */ ? ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type :
                             ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type;
                     break;
-                case 190 /* MappedType */:
+                case 194 /* MappedType */:
                     if (noImplicitAny) {
                         error(declaration, ts.Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type);
                     }
@@ -61949,7 +66024,7 @@ var ts;
             errorOrSuggestion(noImplicitAny, declaration, diagnostic, ts.declarationNameToString(ts.getNameOfDeclaration(declaration)), typeAsString);
         }
         function reportErrorsFromWidening(declaration, type, wideningKind) {
-            if (produceDiagnostics && noImplicitAny && ts.getObjectFlags(type) & 524288 /* ContainsWideningType */ && (!wideningKind || !getContextualSignatureForFunctionLikeDeclaration(declaration))) {
+            if (produceDiagnostics && noImplicitAny && ts.getObjectFlags(type) & 131072 /* ContainsWideningType */ && (!wideningKind || !getContextualSignatureForFunctionLikeDeclaration(declaration))) {
                 // Report implicit any error within type if possible, otherwise report error on declaration
                 if (!reportWideningErrorsInType(type)) {
                     reportImplicitAny(declaration, type, wideningKind);
@@ -62065,23 +66140,23 @@ var ts;
         // results for union and intersection types for performance reasons.
         function couldContainTypeVariables(type) {
             var objectFlags = ts.getObjectFlags(type);
-            if (objectFlags & 67108864 /* CouldContainTypeVariablesComputed */) {
-                return !!(objectFlags & 134217728 /* CouldContainTypeVariables */);
+            if (objectFlags & 1048576 /* CouldContainTypeVariablesComputed */) {
+                return !!(objectFlags & 2097152 /* CouldContainTypeVariables */);
             }
             var result = !!(type.flags & 465829888 /* Instantiable */ ||
                 type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || ts.forEach(getTypeArguments(type), couldContainTypeVariables)) ||
                     objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations ||
-                    objectFlags & (32 /* Mapped */ | 131072 /* ObjectRestType */)) ||
+                    objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 8388608 /* ObjectRestType */)) ||
                 type.flags & 3145728 /* UnionOrIntersection */ && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && ts.some(type.types, couldContainTypeVariables));
             if (type.flags & 3899393 /* ObjectFlagsType */) {
-                type.objectFlags |= 67108864 /* CouldContainTypeVariablesComputed */ | (result ? 134217728 /* CouldContainTypeVariables */ : 0);
+                type.objectFlags |= 1048576 /* CouldContainTypeVariablesComputed */ | (result ? 2097152 /* CouldContainTypeVariables */ : 0);
             }
             return result;
         }
         function isNonGenericTopLevelType(type) {
             if (type.aliasSymbol && !type.aliasTypeArguments) {
-                var declaration = ts.getDeclarationOfKind(type.aliasSymbol, 254 /* TypeAliasDeclaration */);
-                return !!(declaration && ts.findAncestor(declaration.parent, function (n) { return n.kind === 297 /* SourceFile */ ? true : n.kind === 256 /* ModuleDeclaration */ ? false : "quit"; }));
+                var declaration = ts.getDeclarationOfKind(type.aliasSymbol, 258 /* TypeAliasDeclaration */);
+                return !!(declaration && ts.findAncestor(declaration.parent, function (n) { return n.kind === 303 /* SourceFile */ ? true : n.kind === 260 /* ModuleDeclaration */ ? false : "quit"; }));
             }
             return false;
         }
@@ -62106,8 +66181,8 @@ var ts;
                 }
                 members.set(name, literalProp);
             });
-            var indexInfo = type.flags & 4 /* String */ ? createIndexInfo(emptyObjectType, /*isReadonly*/ false) : undefined;
-            return createAnonymousType(undefined, members, ts.emptyArray, ts.emptyArray, indexInfo, undefined);
+            var indexInfos = type.flags & 4 /* String */ ? [createIndexInfo(stringType, emptyObjectType, /*isReadonly*/ false)] : ts.emptyArray;
+            return createAnonymousType(undefined, members, ts.emptyArray, ts.emptyArray, indexInfos);
         }
         /**
          * Infer a suitable input type for a homomorphic mapped type { [P in keyof T]: X }. We construct
@@ -62134,14 +66209,14 @@ var ts;
         // literal { a: 123, b: x => true } is marked non-inferable because it contains a context sensitive
         // arrow function, but is considered partially inferable because property 'a' has an inferable type.
         function isPartiallyInferableType(type) {
-            return !(ts.getObjectFlags(type) & 2097152 /* NonInferrableType */) ||
+            return !(ts.getObjectFlags(type) & 524288 /* NonInferrableType */) ||
                 isObjectLiteralType(type) && ts.some(getPropertiesOfType(type), function (prop) { return isPartiallyInferableType(getTypeOfSymbol(prop)); }) ||
                 isTupleType(type) && ts.some(getTypeArguments(type), isPartiallyInferableType);
         }
         function createReverseMappedType(source, target, constraint) {
             // We consider a source type reverse mappable if it has a string index signature or if
             // it has one or more properties and is of a partially inferable type.
-            if (!(getIndexInfoOfType(source, 0 /* String */) || getPropertiesOfType(source).length !== 0 && isPartiallyInferableType(source))) {
+            if (!(getIndexInfoOfType(source, stringType) || getPropertiesOfType(source).length !== 0 && isPartiallyInferableType(source))) {
                 return undefined;
             }
             // For arrays and tuples we infer new arrays and tuples where the reverse mapping has been
@@ -62158,14 +66233,18 @@ var ts;
             }
             // For all other object types we infer a new object type where the reverse mapping has been
             // applied to the type of each property.
-            var reversed = createObjectType(2048 /* ReverseMapped */ | 16 /* Anonymous */, /*symbol*/ undefined);
+            var reversed = createObjectType(1024 /* ReverseMapped */ | 16 /* Anonymous */, /*symbol*/ undefined);
             reversed.source = source;
             reversed.mappedType = target;
             reversed.constraintType = constraint;
             return reversed;
         }
         function getTypeOfReverseMappedSymbol(symbol) {
-            return inferReverseMappedType(symbol.propertyType, symbol.mappedType, symbol.constraintType);
+            var links = getSymbolLinks(symbol);
+            if (!links.type) {
+                links.type = inferReverseMappedType(symbol.propertyType, symbol.mappedType, symbol.constraintType);
+            }
+            return links.type;
         }
         function inferReverseMappedType(sourceType, target, constraint) {
             var typeParameter = getIndexedAccessType(constraint.type, getTypeParameterFromMappedType(target));
@@ -62240,6 +66319,17 @@ var ts;
         function isFromInferenceBlockedSource(type) {
             return !!(type.symbol && ts.some(type.symbol.declarations, hasSkipDirectInferenceFlag));
         }
+        function templateLiteralTypesDefinitelyUnrelated(source, target) {
+            // Two template literal types with diffences in their starting or ending text spans are definitely unrelated.
+            var sourceStart = source.texts[0];
+            var targetStart = target.texts[0];
+            var sourceEnd = source.texts[source.texts.length - 1];
+            var targetEnd = target.texts[target.texts.length - 1];
+            var startLen = Math.min(sourceStart.length, targetStart.length);
+            var endLen = Math.min(sourceEnd.length, targetEnd.length);
+            return sourceStart.slice(0, startLen) !== targetStart.slice(0, startLen) ||
+                sourceEnd.slice(sourceEnd.length - endLen) !== targetEnd.slice(targetEnd.length - endLen);
+        }
         function isValidBigIntString(s) {
             var scanner = ts.createScanner(99 /* ESNext */, /*skipTrivia*/ false);
             var success = true;
@@ -62257,51 +66347,117 @@ var ts;
             // * it does not contain a numeric seperator (the `BigInt` constructor does not accept a numeric seperator in its input)
             return success && result === 9 /* BigIntLiteral */ && scanner.getTextPos() === (s.length + 1) && !(flags & 512 /* ContainsSeparator */);
         }
-        function isStringLiteralTypeValueParsableAsType(s, target) {
-            if (target.flags & 1048576 /* Union */) {
-                return !!forEachType(target, function (t) { return isStringLiteralTypeValueParsableAsType(s, t); });
-            }
-            switch (target) {
-                case stringType: return true;
-                case numberType: return s.value !== "" && isFinite(+(s.value));
-                case bigintType: return s.value !== "" && isValidBigIntString(s.value);
-                // the next 4 should be handled in `getTemplateLiteralType`, as they are all exactly one value, but are here for completeness, just in case
-                // this function is ever used on types which don't come from template literal holes
-                case trueType: return s.value === "true";
-                case falseType: return s.value === "false";
-                case undefinedType: return s.value === "undefined";
-                case nullType: return s.value === "null";
-                default: return !!(target.flags & 1 /* Any */);
-            }
-        }
-        function inferLiteralsFromTemplateLiteralType(source, target) {
-            var value = source.value;
-            var texts = target.texts;
-            var lastIndex = texts.length - 1;
-            var startText = texts[0];
-            var endText = texts[lastIndex];
-            if (!(value.startsWith(startText) && value.slice(startText.length).endsWith(endText)))
+        function isValidTypeForTemplateLiteralPlaceholder(source, target) {
+            if (source === target || target.flags & (1 /* Any */ | 4 /* String */)) {
+                return true;
+            }
+            if (source.flags & 128 /* StringLiteral */) {
+                var value = source.value;
+                return !!(target.flags & 8 /* Number */ && value !== "" && isFinite(+value) ||
+                    target.flags & 64 /* BigInt */ && value !== "" && isValidBigIntString(value) ||
+                    target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName);
+            }
+            if (source.flags & 134217728 /* TemplateLiteral */) {
+                var texts = source.texts;
+                return texts.length === 2 && texts[0] === "" && texts[1] === "" && isTypeAssignableTo(source.types[0], target);
+            }
+            return isTypeAssignableTo(source, target);
+        }
+        function inferTypesFromTemplateLiteralType(source, target) {
+            return source.flags & 128 /* StringLiteral */ ? inferFromLiteralPartsToTemplateLiteral([source.value], ts.emptyArray, target) :
+                source.flags & 134217728 /* TemplateLiteral */ ?
+                    ts.arraysEqual(source.texts, target.texts) ? ts.map(source.types, getStringLikeTypeForType) :
+                        inferFromLiteralPartsToTemplateLiteral(source.texts, source.types, target) :
+                    undefined;
+        }
+        function isTypeMatchedByTemplateLiteralType(source, target) {
+            var inferences = inferTypesFromTemplateLiteralType(source, target);
+            return !!inferences && ts.every(inferences, function (r, i) { return isValidTypeForTemplateLiteralPlaceholder(r, target.types[i]); });
+        }
+        function getStringLikeTypeForType(type) {
+            return type.flags & (1 /* Any */ | 402653316 /* StringLike */) ? type : getTemplateLiteralType(["", ""], [type]);
+        }
+        // This function infers from the text parts and type parts of a source literal to a target template literal. The number
+        // of text parts is always one more than the number of type parts, and a source string literal is treated as a source
+        // with one text part and zero type parts. The function returns an array of inferred string or template literal types
+        // corresponding to the placeholders in the target template literal, or undefined if the source doesn't match the target.
+        //
+        // We first check that the starting source text part matches the starting target text part, and that the ending source
+        // text part ends matches the ending target text part. We then iterate through the remaining target text parts, finding
+        // a match for each in the source and inferring string or template literal types created from the segments of the source
+        // that occur between the matches. During this iteration, seg holds the index of the current text part in the sourceTexts
+        // array and pos holds the current character position in the current text part.
+        //
+        // Consider inference from type `<<${string}>.<${number}-${number}>>` to type `<${string}.${string}>`, i.e.
+        //   sourceTexts = ['<<', '>.<', '-', '>>']
+        //   sourceTypes = [string, number, number]
+        //   target.texts = ['<', '.', '>']
+        // We first match '<' in the target to the start of '<<' in the source and '>' in the target to the end of '>>' in
+        // the source. The first match for the '.' in target occurs at character 1 in the source text part at index 1, and thus
+        // the first inference is the template literal type `<${string}>`. The remainder of the source makes up the second
+        // inference, the template literal type `<${number}-${number}>`.
+        function inferFromLiteralPartsToTemplateLiteral(sourceTexts, sourceTypes, target) {
+            var lastSourceIndex = sourceTexts.length - 1;
+            var sourceStartText = sourceTexts[0];
+            var sourceEndText = sourceTexts[lastSourceIndex];
+            var targetTexts = target.texts;
+            var lastTargetIndex = targetTexts.length - 1;
+            var targetStartText = targetTexts[0];
+            var targetEndText = targetTexts[lastTargetIndex];
+            if (lastSourceIndex === 0 && sourceStartText.length < targetStartText.length + targetEndText.length ||
+                !sourceStartText.startsWith(targetStartText) || !sourceEndText.endsWith(targetEndText))
                 return undefined;
+            var remainingEndText = sourceEndText.slice(0, sourceEndText.length - targetEndText.length);
             var matches = [];
-            var str = value.slice(startText.length, value.length - endText.length);
-            var pos = 0;
-            for (var i = 1; i < lastIndex; i++) {
-                var delim = texts[i];
-                var delimPos = delim.length > 0 ? str.indexOf(delim, pos) : pos < str.length ? pos + 1 : -1;
-                if (delimPos < 0)
+            var seg = 0;
+            var pos = targetStartText.length;
+            for (var i = 1; i < lastTargetIndex; i++) {
+                var delim = targetTexts[i];
+                if (delim.length > 0) {
+                    var s = seg;
+                    var p = pos;
+                    while (true) {
+                        p = getSourceText(s).indexOf(delim, p);
+                        if (p >= 0)
+                            break;
+                        s++;
+                        if (s === sourceTexts.length)
+                            return undefined;
+                        p = 0;
+                    }
+                    addMatch(s, p);
+                    pos += delim.length;
+                }
+                else if (pos < getSourceText(seg).length) {
+                    addMatch(seg, pos + 1);
+                }
+                else if (seg < lastSourceIndex) {
+                    addMatch(seg + 1, 0);
+                }
+                else {
                     return undefined;
-                matches.push(getLiteralType(str.slice(pos, delimPos)));
-                pos = delimPos + delim.length;
+                }
             }
-            matches.push(getLiteralType(str.slice(pos)));
+            addMatch(lastSourceIndex, getSourceText(lastSourceIndex).length);
             return matches;
+            function getSourceText(index) {
+                return index < lastSourceIndex ? sourceTexts[index] : remainingEndText;
+            }
+            function addMatch(s, p) {
+                var matchType = s === seg ?
+                    getStringLiteralType(getSourceText(s).slice(pos, p)) :
+                    getTemplateLiteralType(__spreadArray(__spreadArray([sourceTexts[seg].slice(pos)], sourceTexts.slice(seg + 1, s), true), [getSourceText(s).slice(0, p)], false), sourceTypes.slice(seg, s));
+                matches.push(matchType);
+                seg = s;
+                pos = p;
+            }
         }
         function inferTypes(inferences, originalSource, originalTarget, priority, contravariant) {
             if (priority === void 0) { priority = 0; }
             if (contravariant === void 0) { contravariant = false; }
             var bivariant = false;
             var propagationType;
-            var inferencePriority = 1024 /* MaxValue */;
+            var inferencePriority = 2048 /* MaxValue */;
             var allowComplexConstraintInference = true;
             var visited;
             var sourceStack;
@@ -62388,8 +66544,8 @@ var ts;
                     // not contain anyFunctionType when we come back to this argument for its second round
                     // of inference. Also, we exclude inferences for silentNeverType (which is used as a wildcard
                     // when constructing types from type parameters that had no inference candidates).
-                    if (ts.getObjectFlags(source) & 2097152 /* NonInferrableType */ || source === nonInferrableAnyType || source === silentNeverType ||
-                        (priority & 64 /* ReturnType */ && (source === autoType || source === autoArrayType)) || isFromInferenceBlockedSource(source)) {
+                    if (ts.getObjectFlags(source) & 524288 /* NonInferrableType */ || source === nonInferrableAnyType || source === silentNeverType ||
+                        (priority & 128 /* ReturnType */ && (source === autoType || source === autoArrayType)) || isFromInferenceBlockedSource(source)) {
                         return;
                     }
                     var inference = getInferenceInfoForType(target);
@@ -62416,7 +66572,7 @@ var ts;
                                     clearCachedInferences(inferences);
                                 }
                             }
-                            if (!(priority & 64 /* ReturnType */) && target.flags & 262144 /* TypeParameter */ && inference.topLevel && !isTypeParameterAtTopLevel(originalTarget, target)) {
+                            if (!(priority & 128 /* ReturnType */) && target.flags & 262144 /* TypeParameter */ && inference.topLevel && !isTypeParameterAtTopLevel(originalTarget, target)) {
                                 inference.topLevel = false;
                                 clearCachedInferences(inferences);
                             }
@@ -62456,7 +66612,7 @@ var ts;
                 else if ((isLiteralType(source) || source.flags & 4 /* String */) && target.flags & 4194304 /* Index */) {
                     var empty = createEmptyObjectTypeFromStringLiteral(source);
                     contravariant = !contravariant;
-                    inferWithPriority(empty, target.type, 128 /* LiteralKeyof */);
+                    inferWithPriority(empty, target.type, 256 /* LiteralKeyof */);
                     contravariant = !contravariant;
                 }
                 else if (source.flags & 8388608 /* IndexedAccess */ && target.flags & 8388608 /* IndexedAccess */) {
@@ -62468,6 +66624,13 @@ var ts;
                         inferFromTypes(source.type, target.type);
                     }
                 }
+                else if (source.flags & 33554432 /* Substitution */) {
+                    inferFromTypes(source.baseType, target);
+                    var oldPriority = priority;
+                    priority |= 4 /* SubstituteSource */;
+                    inferFromTypes(source.substitute, target); // Make substitute inference at a lower priority
+                    priority = oldPriority;
+                }
                 else if (target.flags & 16777216 /* Conditional */) {
                     invokeOnce(source, target, inferToConditionalType);
                 }
@@ -62487,7 +66650,7 @@ var ts;
                 }
                 else {
                     source = getReducedType(source);
-                    if (!(priority & 256 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 465829888 /* Instantiable */))) {
+                    if (!(priority & 512 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 465829888 /* Instantiable */))) {
                         var apparentSource = getApparentType(source);
                         // getApparentType can return _any_ type, since an indexed access or conditional may simplify to any other type.
                         // If that occurs and it doesn't simplify to an object or intersection, we'll need to restart `inferFromTypes`
@@ -62525,26 +66688,22 @@ var ts;
                 }
                 (visited || (visited = new ts.Map())).set(key, -1 /* Circularity */);
                 var saveInferencePriority = inferencePriority;
-                inferencePriority = 1024 /* MaxValue */;
+                inferencePriority = 2048 /* MaxValue */;
                 // We stop inferring and report a circularity if we encounter duplicate recursion identities on both
                 // the source side and the target side.
                 var saveExpandingFlags = expandingFlags;
-                var sourceIdentity = getRecursionIdentity(source) || source;
-                var targetIdentity = getRecursionIdentity(target) || target;
-                if (sourceIdentity && ts.contains(sourceStack, sourceIdentity))
+                var sourceIdentity = getRecursionIdentity(source);
+                var targetIdentity = getRecursionIdentity(target);
+                if (ts.contains(sourceStack, sourceIdentity))
                     expandingFlags |= 1 /* Source */;
-                if (targetIdentity && ts.contains(targetStack, targetIdentity))
+                if (ts.contains(targetStack, targetIdentity))
                     expandingFlags |= 2 /* Target */;
                 if (expandingFlags !== 3 /* Both */) {
-                    if (sourceIdentity)
-                        (sourceStack || (sourceStack = [])).push(sourceIdentity);
-                    if (targetIdentity)
-                        (targetStack || (targetStack = [])).push(targetIdentity);
+                    (sourceStack || (sourceStack = [])).push(sourceIdentity);
+                    (targetStack || (targetStack = [])).push(targetIdentity);
                     action(source, target);
-                    if (targetIdentity)
-                        targetStack.pop();
-                    if (sourceIdentity)
-                        sourceStack.pop();
+                    targetStack.pop();
+                    sourceStack.pop();
                 }
                 else {
                     inferencePriority = -1 /* Circularity */;
@@ -62584,7 +66743,7 @@ var ts;
                 }
             }
             function inferFromContravariantTypes(source, target) {
-                if (strictFunctionTypes || priority & 512 /* AlwaysStrict */) {
+                if (strictFunctionTypes || priority & 1024 /* AlwaysStrict */) {
                     contravariant = !contravariant;
                     inferFromTypes(source, target);
                     contravariant = !contravariant;
@@ -62606,8 +66765,8 @@ var ts;
             }
             function getSingleTypeVariableFromIntersectionTypes(types) {
                 var typeVariable;
-                for (var _i = 0, types_16 = types; _i < types_16.length; _i++) {
-                    var type = types_16[_i];
+                for (var _i = 0, types_15 = types; _i < types_15.length; _i++) {
+                    var type = types_15[_i];
                     var t = type.flags & 2097152 /* Intersection */ && ts.find(type.types, function (t) { return !!getInferenceInfoForType(t); });
                     if (!t || typeVariable && t !== typeVariable) {
                         return undefined;
@@ -62636,7 +66795,7 @@ var ts;
                         else {
                             for (var i = 0; i < sources.length; i++) {
                                 var saveInferencePriority = inferencePriority;
-                                inferencePriority = 1024 /* MaxValue */;
+                                inferencePriority = 2048 /* MaxValue */;
                                 inferFromTypes(sources[i], t);
                                 if (inferencePriority === priority)
                                     matched_1[i] = true;
@@ -62715,9 +66874,9 @@ var ts;
                             // We assign a lower priority to inferences made from types containing non-inferrable
                             // types because we may only have a partial result (i.e. we may have failed to make
                             // reverse inferences for some properties).
-                            inferWithPriority(inferredType, inference.typeParameter, ts.getObjectFlags(source) & 2097152 /* NonInferrableType */ ?
-                                8 /* PartialHomomorphicMappedType */ :
-                                4 /* HomomorphicMappedType */);
+                            inferWithPriority(inferredType, inference.typeParameter, ts.getObjectFlags(source) & 524288 /* NonInferrableType */ ?
+                                16 /* PartialHomomorphicMappedType */ :
+                                8 /* HomomorphicMappedType */);
                         }
                     }
                     return true;
@@ -62725,7 +66884,7 @@ var ts;
                 if (constraintType.flags & 262144 /* TypeParameter */) {
                     // We're inferring from some source type S to a mapped type { [P in K]: X }, where K is a type
                     // parameter. First infer from 'keyof S' to K.
-                    inferWithPriority(getIndexType(source), constraintType, 16 /* MappedTypeConstraint */);
+                    inferWithPriority(getIndexType(source), constraintType, 32 /* MappedTypeConstraint */);
                     // If K is constrained to a type C, also infer to C. Thus, for a mapped type { [P in K]: X },
                     // where K extends keyof T, we make the same inferences as for a homomorphic mapped type
                     // { [P in keyof T]: X }. This enables us to make meaningful inferences when the target is a
@@ -62737,10 +66896,8 @@ var ts;
                     // If no inferences can be made to K's constraint, infer from a union of the property types
                     // in the source to the template type X.
                     var propTypes = ts.map(getPropertiesOfType(source), getTypeOfSymbol);
-                    var stringIndexType = getIndexTypeOfType(source, 0 /* String */);
-                    var numberIndexInfo = getNonEnumNumberIndexInfo(source);
-                    var numberIndexType = numberIndexInfo && numberIndexInfo.type;
-                    inferFromTypes(getUnionType(ts.append(ts.append(propTypes, stringIndexType), numberIndexType)), getTemplateTypeFromMappedType(target));
+                    var indexTypes = ts.map(getIndexInfosOfType(source), function (info) { return info !== enumNumberIndexInfo ? info.type : neverType; });
+                    inferFromTypes(getUnionType(ts.concatenate(propTypes, indexTypes)), getTemplateTypeFromMappedType(target));
                     return true;
                 }
                 return false;
@@ -62754,19 +66911,25 @@ var ts;
                 }
                 else {
                     var savePriority = priority;
-                    priority |= contravariant ? 32 /* ContravariantConditional */ : 0;
+                    priority |= contravariant ? 64 /* ContravariantConditional */ : 0;
                     var targetTypes = [getTrueTypeFromConditionalType(target), getFalseTypeFromConditionalType(target)];
                     inferToMultipleTypes(source, targetTypes, target.flags);
                     priority = savePriority;
                 }
             }
             function inferToTemplateLiteralType(source, target) {
-                var matches = source.flags & 128 /* StringLiteral */ ? inferLiteralsFromTemplateLiteralType(source, target) :
-                    source.flags & 134217728 /* TemplateLiteral */ && ts.arraysEqual(source.texts, target.texts) ? source.types :
-                        undefined;
+                var matches = inferTypesFromTemplateLiteralType(source, target);
                 var types = target.types;
-                for (var i = 0; i < types.length; i++) {
-                    inferFromTypes(matches ? matches[i] : neverType, types[i]);
+                // When the target template literal contains only placeholders (meaning that inference is intended to extract
+                // single characters and remainder strings) and inference fails to produce matches, we want to infer 'never' for
+                // each placeholder such that instantiation with the inferred value(s) produces 'never', a type for which an
+                // assignment check will fail. If we make no inferences, we'll likely end up with the constraint 'string' which,
+                // upon instantiation, would collapse all the placeholders to just 'string', and an assignment check might
+                // succeed. That would be a pointless and confusing outcome.
+                if (matches || ts.every(target.texts, function (s) { return s.length === 0; })) {
+                    for (var i = 0; i < types.length; i++) {
+                        inferFromTypes(matches ? matches[i] : neverType, types[i]);
+                    }
                 }
             }
             function inferFromObjectTypes(source, target) {
@@ -62879,7 +67042,7 @@ var ts;
                 var sourceLen = sourceSignatures.length;
                 var targetLen = targetSignatures.length;
                 var len = sourceLen < targetLen ? sourceLen : targetLen;
-                var skipParameters = !!(ts.getObjectFlags(source) & 2097152 /* NonInferrableType */);
+                var skipParameters = !!(ts.getObjectFlags(source) & 524288 /* NonInferrableType */);
                 for (var i = 0; i < len; i++) {
                     inferFromSignature(getBaseSignature(sourceSignatures[sourceLen - len + i]), getErasedSignature(targetSignatures[targetLen - len + i]), skipParameters);
                 }
@@ -62889,34 +67052,50 @@ var ts;
                     var saveBivariant = bivariant;
                     var kind = target.declaration ? target.declaration.kind : 0 /* Unknown */;
                     // Once we descend into a bivariant signature we remain bivariant for all nested inferences
-                    bivariant = bivariant || kind === 165 /* MethodDeclaration */ || kind === 164 /* MethodSignature */ || kind === 166 /* Constructor */;
+                    bivariant = bivariant || kind === 168 /* MethodDeclaration */ || kind === 167 /* MethodSignature */ || kind === 170 /* Constructor */;
                     applyToParameterTypes(source, target, inferFromContravariantTypes);
                     bivariant = saveBivariant;
                 }
                 applyToReturnTypes(source, target, inferFromTypes);
             }
             function inferFromIndexTypes(source, target) {
-                var targetStringIndexType = getIndexTypeOfType(target, 0 /* String */);
-                if (targetStringIndexType) {
-                    var sourceIndexType = getIndexTypeOfType(source, 0 /* String */) ||
-                        getImplicitIndexTypeOfType(source, 0 /* String */);
-                    if (sourceIndexType) {
-                        inferFromTypes(sourceIndexType, targetStringIndexType);
+                // Inferences across mapped type index signatures are pretty much the same a inferences to homomorphic variables
+                var priority = (ts.getObjectFlags(source) & ts.getObjectFlags(target) & 32 /* Mapped */) ? 8 /* HomomorphicMappedType */ : 0;
+                var indexInfos = getIndexInfosOfType(target);
+                if (isObjectTypeWithInferableIndex(source)) {
+                    for (var _i = 0, indexInfos_4 = indexInfos; _i < indexInfos_4.length; _i++) {
+                        var targetInfo = indexInfos_4[_i];
+                        var propTypes = [];
+                        for (var _a = 0, _b = getPropertiesOfType(source); _a < _b.length; _a++) {
+                            var prop = _b[_a];
+                            if (isApplicableIndexType(getLiteralTypeFromProperty(prop, 8576 /* StringOrNumberLiteralOrUnique */), targetInfo.keyType)) {
+                                var propType = getTypeOfSymbol(prop);
+                                propTypes.push(prop.flags & 16777216 /* Optional */ ? removeMissingOrUndefinedType(propType) : propType);
+                            }
+                        }
+                        for (var _c = 0, _d = getIndexInfosOfType(source); _c < _d.length; _c++) {
+                            var info = _d[_c];
+                            if (isApplicableIndexType(info.keyType, targetInfo.keyType)) {
+                                propTypes.push(info.type);
+                            }
+                        }
+                        if (propTypes.length) {
+                            inferWithPriority(getUnionType(propTypes), targetInfo.type, priority);
+                        }
                     }
                 }
-                var targetNumberIndexType = getIndexTypeOfType(target, 1 /* Number */);
-                if (targetNumberIndexType) {
-                    var sourceIndexType = getIndexTypeOfType(source, 1 /* Number */) ||
-                        getIndexTypeOfType(source, 0 /* String */) ||
-                        getImplicitIndexTypeOfType(source, 1 /* Number */);
-                    if (sourceIndexType) {
-                        inferFromTypes(sourceIndexType, targetNumberIndexType);
+                for (var _e = 0, indexInfos_5 = indexInfos; _e < indexInfos_5.length; _e++) {
+                    var targetInfo = indexInfos_5[_e];
+                    var sourceInfo = getApplicableIndexInfo(source, targetInfo.keyType);
+                    if (sourceInfo) {
+                        inferWithPriority(sourceInfo.type, targetInfo.type, priority);
                     }
                 }
             }
         }
         function isTypeOrBaseIdenticalTo(s, t) {
-            return isTypeIdenticalTo(s, t) || !!(t.flags & 4 /* String */ && s.flags & 128 /* StringLiteral */ || t.flags & 8 /* Number */ && s.flags & 256 /* NumberLiteral */);
+            return exactOptionalPropertyTypes && t === missingType ? s === t :
+                (isTypeIdenticalTo(s, t) || !!(t.flags & 4 /* String */ && s.flags & 128 /* StringLiteral */ || t.flags & 8 /* Number */ && s.flags & 256 /* NumberLiteral */));
         }
         function isTypeCloselyMatchedBy(s, t) {
             return !!(s.flags & 524288 /* Object */ && t.flags & 524288 /* Object */ && s.symbol && s.symbol === t.symbol ||
@@ -62930,7 +67109,7 @@ var ts;
             return !!(ts.getObjectFlags(type) & 128 /* ObjectLiteral */);
         }
         function isObjectOrArrayLiteralType(type) {
-            return !!(ts.getObjectFlags(type) & (128 /* ObjectLiteral */ | 65536 /* ArrayLiteral */));
+            return !!(ts.getObjectFlags(type) & (128 /* ObjectLiteral */ | 32768 /* ArrayLiteral */));
         }
         function unionObjectAndArrayLiteralCandidates(candidates) {
             if (candidates.length > 1) {
@@ -62943,7 +67122,7 @@ var ts;
             return candidates;
         }
         function getContravariantInference(inference) {
-            return inference.priority & 208 /* PriorityImpliesCombination */ ? getIntersectionType(inference.contraCandidates) : getCommonSubtype(inference.contraCandidates);
+            return inference.priority & 416 /* PriorityImpliesCombination */ ? getIntersectionType(inference.contraCandidates) : getCommonSubtype(inference.contraCandidates);
         }
         function getCovariantInference(inference, signature) {
             // Extract all object and array literal types and replace them with a single widened and normalized type.
@@ -62960,7 +67139,7 @@ var ts;
                     candidates;
             // If all inferences were made from a position that implies a combined result, infer a union type.
             // Otherwise, infer a common supertype.
-            var unwidenedType = inference.priority & 208 /* PriorityImpliesCombination */ ?
+            var unwidenedType = inference.priority & 416 /* PriorityImpliesCombination */ ?
                 getUnionType(baseCandidates, 2 /* Subtype */) :
                 getCommonSupertype(baseCandidates);
             return getWidenedType(unwidenedType);
@@ -62971,17 +67150,16 @@ var ts;
                 var inferredType = void 0;
                 var signature = context.signature;
                 if (signature) {
-                    var inferredCovariantType = inference.candidates ? getCovariantInference(inference, signature) : undefined;
+                    var inferredCovariantType_1 = inference.candidates ? getCovariantInference(inference, signature) : undefined;
                     if (inference.contraCandidates) {
-                        var inferredContravariantType = getContravariantInference(inference);
                         // If we have both co- and contra-variant inferences, we prefer the contra-variant inference
-                        // unless the co-variant inference is a subtype and not 'never'.
-                        inferredType = inferredCovariantType && !(inferredCovariantType.flags & 131072 /* Never */) &&
-                            isTypeSubtypeOf(inferredCovariantType, inferredContravariantType) ?
-                            inferredCovariantType : inferredContravariantType;
+                        // unless the co-variant inference is a subtype of some contra-variant inference and not 'never'.
+                        inferredType = inferredCovariantType_1 && !(inferredCovariantType_1.flags & 131072 /* Never */) &&
+                            ts.some(inference.contraCandidates, function (t) { return isTypeSubtypeOf(inferredCovariantType_1, t); }) ?
+                            inferredCovariantType_1 : getContravariantInference(inference);
                     }
-                    else if (inferredCovariantType) {
-                        inferredType = inferredCovariantType;
+                    else if (inferredCovariantType_1) {
+                        inferredType = inferredCovariantType_1;
                     }
                     else if (context.flags & 1 /* NoDefault */) {
                         // We use silentNeverType as the wildcard that signals no inferences.
@@ -63069,7 +67247,7 @@ var ts;
                 case "BigUint64Array":
                     return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later;
                 default:
-                    if (node.parent.kind === 289 /* ShorthandPropertyAssignment */) {
+                    if (node.parent.kind === 295 /* ShorthandPropertyAssignment */) {
                         return ts.Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer;
                     }
                     else {
@@ -63082,7 +67260,7 @@ var ts;
             if (!links.resolvedSymbol) {
                 links.resolvedSymbol = !ts.nodeIsMissing(node) &&
                     resolveName(node, node.escapedText, 111551 /* Value */ | 1048576 /* ExportValue */, getCannotFindNameDiagnosticForName(node), node, !ts.isWriteOnlyAccess(node), 
-                    /*excludeGlobals*/ false, ts.Diagnostics.Cannot_find_name_0_Did_you_mean_1) || unknownSymbol;
+                    /*excludeGlobals*/ false) || unknownSymbol;
             }
             return links.resolvedSymbol;
         }
@@ -63090,26 +67268,30 @@ var ts;
             // TypeScript 1.0 spec (April 2014): 3.6.3
             // A type query consists of the keyword typeof followed by an expression.
             // The expression is restricted to a single identifier or a sequence of identifiers separated by periods
-            return !!ts.findAncestor(node, function (n) { return n.kind === 176 /* TypeQuery */ ? true : n.kind === 78 /* Identifier */ || n.kind === 157 /* QualifiedName */ ? false : "quit"; });
+            return !!ts.findAncestor(node, function (n) { return n.kind === 180 /* TypeQuery */ ? true : n.kind === 79 /* Identifier */ || n.kind === 160 /* QualifiedName */ ? false : "quit"; });
         }
         // Return the flow cache key for a "dotted name" (i.e. a sequence of identifiers
         // separated by dots). The key consists of the id of the symbol referenced by the
         // leftmost identifier followed by zero or more property names separated by dots.
-        // The result is undefined if the reference isn't a dotted name. We prefix nodes
-        // occurring in an apparent type position with '@' because the control flow type
-        // of such nodes may be based on the apparent type instead of the declared type.
+        // The result is undefined if the reference isn't a dotted name.
         function getFlowCacheKey(node, declaredType, initialType, flowContainer) {
             switch (node.kind) {
-                case 78 /* Identifier */:
-                    var symbol = getResolvedSymbol(node);
-                    return symbol !== unknownSymbol ? (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType) + "|" + (isConstraintPosition(node) ? "@" : "") + getSymbolId(symbol) : undefined;
-                case 107 /* ThisKeyword */:
-                    return "0|" + (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType);
-                case 225 /* NonNullExpression */:
-                case 207 /* ParenthesizedExpression */:
+                case 79 /* Identifier */:
+                    if (!ts.isThisInTypeQuery(node)) {
+                        var symbol = getResolvedSymbol(node);
+                        return symbol !== unknownSymbol ? "".concat(flowContainer ? getNodeId(flowContainer) : "-1", "|").concat(getTypeId(declaredType), "|").concat(getTypeId(initialType), "|").concat(getSymbolId(symbol)) : undefined;
+                    }
+                // falls through
+                case 108 /* ThisKeyword */:
+                    return "0|".concat(flowContainer ? getNodeId(flowContainer) : "-1", "|").concat(getTypeId(declaredType), "|").concat(getTypeId(initialType));
+                case 229 /* NonNullExpression */:
+                case 211 /* ParenthesizedExpression */:
                     return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer);
-                case 201 /* PropertyAccessExpression */:
-                case 202 /* ElementAccessExpression */:
+                case 160 /* QualifiedName */:
+                    var left = getFlowCacheKey(node.left, declaredType, initialType, flowContainer);
+                    return left && left + "." + node.right.escapedText;
+                case 205 /* PropertyAccessExpression */:
+                case 206 /* ElementAccessExpression */:
                     var propName = getAccessedPropertyName(node);
                     if (propName !== undefined) {
                         var key = getFlowCacheKey(node.expression, declaredType, initialType, flowContainer);
@@ -63120,50 +67302,75 @@ var ts;
         }
         function isMatchingReference(source, target) {
             switch (target.kind) {
-                case 207 /* ParenthesizedExpression */:
-                case 225 /* NonNullExpression */:
+                case 211 /* ParenthesizedExpression */:
+                case 229 /* NonNullExpression */:
                     return isMatchingReference(source, target.expression);
-                case 216 /* BinaryExpression */:
+                case 220 /* BinaryExpression */:
                     return (ts.isAssignmentExpression(target) && isMatchingReference(source, target.left)) ||
                         (ts.isBinaryExpression(target) && target.operatorToken.kind === 27 /* CommaToken */ && isMatchingReference(source, target.right));
             }
             switch (source.kind) {
-                case 78 /* Identifier */:
-                case 79 /* PrivateIdentifier */:
-                    return target.kind === 78 /* Identifier */ && getResolvedSymbol(source) === getResolvedSymbol(target) ||
-                        (target.kind === 249 /* VariableDeclaration */ || target.kind === 198 /* BindingElement */) &&
-                            getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target);
-                case 107 /* ThisKeyword */:
-                    return target.kind === 107 /* ThisKeyword */;
-                case 105 /* SuperKeyword */:
-                    return target.kind === 105 /* SuperKeyword */;
-                case 225 /* NonNullExpression */:
-                case 207 /* ParenthesizedExpression */:
+                case 230 /* MetaProperty */:
+                    return target.kind === 230 /* MetaProperty */
+                        && source.keywordToken === target.keywordToken
+                        && source.name.escapedText === target.name.escapedText;
+                case 79 /* Identifier */:
+                case 80 /* PrivateIdentifier */:
+                    return ts.isThisInTypeQuery(source) ?
+                        target.kind === 108 /* ThisKeyword */ :
+                        target.kind === 79 /* Identifier */ && getResolvedSymbol(source) === getResolvedSymbol(target) ||
+                            (target.kind === 253 /* VariableDeclaration */ || target.kind === 202 /* BindingElement */) &&
+                                getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target);
+                case 108 /* ThisKeyword */:
+                    return target.kind === 108 /* ThisKeyword */;
+                case 106 /* SuperKeyword */:
+                    return target.kind === 106 /* SuperKeyword */;
+                case 229 /* NonNullExpression */:
+                case 211 /* ParenthesizedExpression */:
                     return isMatchingReference(source.expression, target);
-                case 201 /* PropertyAccessExpression */:
-                case 202 /* ElementAccessExpression */:
+                case 205 /* PropertyAccessExpression */:
+                case 206 /* ElementAccessExpression */:
                     return ts.isAccessExpression(target) &&
                         getAccessedPropertyName(source) === getAccessedPropertyName(target) &&
                         isMatchingReference(source.expression, target.expression);
-                case 157 /* QualifiedName */:
+                case 160 /* QualifiedName */:
                     return ts.isAccessExpression(target) &&
                         source.right.escapedText === getAccessedPropertyName(target) &&
                         isMatchingReference(source.left, target.expression);
-                case 216 /* BinaryExpression */:
+                case 220 /* BinaryExpression */:
                     return (ts.isBinaryExpression(source) && source.operatorToken.kind === 27 /* CommaToken */ && isMatchingReference(source.right, target));
             }
             return false;
         }
-        // Given a source x, check if target matches x or is an && operation with an operand that matches x.
-        function containsTruthyCheck(source, target) {
-            return isMatchingReference(source, target) ||
-                (target.kind === 216 /* BinaryExpression */ && target.operatorToken.kind === 55 /* AmpersandAmpersandToken */ &&
-                    (containsTruthyCheck(source, target.left) || containsTruthyCheck(source, target.right)));
+        function getPropertyAccess(expr) {
+            if (ts.isAccessExpression(expr)) {
+                return expr;
+            }
+            if (ts.isIdentifier(expr)) {
+                var symbol = getResolvedSymbol(expr);
+                if (isConstVariable(symbol)) {
+                    var declaration = symbol.valueDeclaration;
+                    // Given 'const x = obj.kind', allow 'x' as an alias for 'obj.kind'
+                    if (ts.isVariableDeclaration(declaration) && !declaration.type && declaration.initializer && ts.isAccessExpression(declaration.initializer)) {
+                        return declaration.initializer;
+                    }
+                    // Given 'const { kind: x } = obj', allow 'x' as an alias for 'obj.kind'
+                    if (ts.isBindingElement(declaration) && !declaration.initializer) {
+                        var parent = declaration.parent.parent;
+                        if (ts.isVariableDeclaration(parent) && !parent.type && parent.initializer && (ts.isIdentifier(parent.initializer) || ts.isAccessExpression(parent.initializer))) {
+                            return declaration;
+                        }
+                    }
+                }
+            }
+            return undefined;
         }
         function getAccessedPropertyName(access) {
-            return access.kind === 201 /* PropertyAccessExpression */ ? access.name.escapedText :
-                ts.isStringOrNumericLiteralLike(access.argumentExpression) ? ts.escapeLeadingUnderscores(access.argumentExpression.text) :
-                    undefined;
+            var propertyName;
+            return access.kind === 205 /* PropertyAccessExpression */ ? access.name.escapedText :
+                access.kind === 206 /* ElementAccessExpression */ && ts.isStringOrNumericLiteralLike(access.argumentExpression) ? ts.escapeLeadingUnderscores(access.argumentExpression.text) :
+                    access.kind === 202 /* BindingElement */ && (propertyName = getDestructuringPropertyName(access)) ? ts.escapeLeadingUnderscores(propertyName) :
+                        undefined;
         }
         function containsMatchingReference(source, target) {
             while (ts.isAccessExpression(source)) {
@@ -63190,7 +67397,7 @@ var ts;
                     if (prop.isDiscriminantProperty === undefined) {
                         prop.isDiscriminantProperty =
                             (prop.checkFlags & 192 /* Discriminant */) === 192 /* Discriminant */ &&
-                                !maybeTypeOfKind(getTypeOfSymbol(prop), 465829888 /* Instantiable */);
+                                !isGenericType(getTypeOfSymbol(prop));
                     }
                     return !!prop.isDiscriminantProperty;
                 }
@@ -63211,6 +67418,87 @@ var ts;
             }
             return result;
         }
+        // Given a set of constituent types and a property name, create and return a map keyed by the literal
+        // types of the property by that name in each constituent type. No map is returned if some key property
+        // has a non-literal type or if less than 10 or less than 50% of the constituents have a unique key.
+        // Entries with duplicate keys have unknownType as the value.
+        function mapTypesByKeyProperty(types, name) {
+            var map = new ts.Map();
+            var count = 0;
+            var _loop_22 = function (type) {
+                if (type.flags & (524288 /* Object */ | 2097152 /* Intersection */ | 58982400 /* InstantiableNonPrimitive */)) {
+                    var discriminant = getTypeOfPropertyOfType(type, name);
+                    if (discriminant) {
+                        if (!isLiteralType(discriminant)) {
+                            return { value: undefined };
+                        }
+                        var duplicate_1 = false;
+                        forEachType(discriminant, function (t) {
+                            var id = getTypeId(getRegularTypeOfLiteralType(t));
+                            var existing = map.get(id);
+                            if (!existing) {
+                                map.set(id, type);
+                            }
+                            else if (existing !== unknownType) {
+                                map.set(id, unknownType);
+                                duplicate_1 = true;
+                            }
+                        });
+                        if (!duplicate_1)
+                            count++;
+                    }
+                }
+            };
+            for (var _i = 0, types_16 = types; _i < types_16.length; _i++) {
+                var type = types_16[_i];
+                var state_8 = _loop_22(type);
+                if (typeof state_8 === "object")
+                    return state_8.value;
+            }
+            return count >= 10 && count * 2 >= types.length ? map : undefined;
+        }
+        // Return the name of a discriminant property for which it was possible and feasible to construct a map of
+        // constituent types keyed by the literal types of the property by that name in each constituent type.
+        function getKeyPropertyName(unionType) {
+            var types = unionType.types;
+            // We only construct maps for unions with many non-primitive constituents.
+            if (types.length < 10 || ts.getObjectFlags(unionType) & 65536 /* PrimitiveUnion */ ||
+                ts.countWhere(types, function (t) { return !!(t.flags & (524288 /* Object */ | 58982400 /* InstantiableNonPrimitive */)); }) < 10) {
+                return undefined;
+            }
+            if (unionType.keyPropertyName === undefined) {
+                // The candidate key property name is the name of the first property with a unit type in one of the
+                // constituent types.
+                var keyPropertyName = ts.forEach(types, function (t) {
+                    return t.flags & (524288 /* Object */ | 58982400 /* InstantiableNonPrimitive */) ?
+                        ts.forEach(getPropertiesOfType(t), function (p) { return isUnitType(getTypeOfSymbol(p)) ? p.escapedName : undefined; }) :
+                        undefined;
+                });
+                var mapByKeyProperty = keyPropertyName && mapTypesByKeyProperty(types, keyPropertyName);
+                unionType.keyPropertyName = mapByKeyProperty ? keyPropertyName : "";
+                unionType.constituentMap = mapByKeyProperty;
+            }
+            return unionType.keyPropertyName.length ? unionType.keyPropertyName : undefined;
+        }
+        // Given a union type for which getKeyPropertyName returned a non-undefined result, return the constituent
+        // that corresponds to the given key type for that property name.
+        function getConstituentTypeForKeyType(unionType, keyType) {
+            var _a;
+            var result = (_a = unionType.constituentMap) === null || _a === void 0 ? void 0 : _a.get(getTypeId(getRegularTypeOfLiteralType(keyType)));
+            return result !== unknownType ? result : undefined;
+        }
+        function getMatchingUnionConstituentForType(unionType, type) {
+            var keyPropertyName = getKeyPropertyName(unionType);
+            var propType = keyPropertyName && getTypeOfPropertyOfType(type, keyPropertyName);
+            return propType && getConstituentTypeForKeyType(unionType, propType);
+        }
+        function getMatchingUnionConstituentForObjectLiteral(unionType, node) {
+            var keyPropertyName = getKeyPropertyName(unionType);
+            var propNode = keyPropertyName && ts.find(node.properties, function (p) { return p.symbol && p.kind === 294 /* PropertyAssignment */ &&
+                p.symbol.escapedName === keyPropertyName && isPossiblyDiscriminantValue(p.initializer); });
+            var propType = propNode && getContextFreeTypeOfExpression(propNode.initializer);
+            return propType && getConstituentTypeForKeyType(unionType, propType);
+        }
         function isOrContainsMatchingReference(source, target) {
             return isMatchingReference(source, target) || containsMatchingReference(source, target);
         }
@@ -63223,7 +67511,7 @@ var ts;
                     }
                 }
             }
-            if (expression.expression.kind === 201 /* PropertyAccessExpression */ &&
+            if (expression.expression.kind === 205 /* PropertyAccessExpression */ &&
                 isOrContainsMatchingReference(reference, expression.expression.expression)) {
                 return true;
             }
@@ -63270,14 +67558,6 @@ var ts;
             }
             return declaredType;
         }
-        function getTypeFactsOfTypes(types) {
-            var result = 0 /* None */;
-            for (var _i = 0, types_17 = types; _i < types_17.length; _i++) {
-                var t = types_17[_i];
-                result |= getTypeFacts(t);
-            }
-            return result;
-        }
         function isFunctionObjectType(type) {
             // We do a quick check for a "bind" property before performing the more expensive subtype
             // check. This gives us a quicker out in the common case where an object type is not a function.
@@ -63285,7 +67565,8 @@ var ts;
             return !!(resolved.callSignatures.length || resolved.constructSignatures.length ||
                 resolved.members.get("bind") && isTypeSubtypeOf(type, globalFunctionType));
         }
-        function getTypeFacts(type) {
+        function getTypeFacts(type, ignoreObjects) {
+            if (ignoreObjects === void 0) { ignoreObjects = false; }
             var flags = type.flags;
             if (flags & 4 /* String */) {
                 return strictNullChecks ? 16317953 /* StringStrictFacts */ : 16776705 /* StringFacts */;
@@ -63322,7 +67603,7 @@ var ts;
                     (type === falseType || type === regularFalseType) ? 12121864 /* FalseStrictFacts */ : 7927560 /* TrueStrictFacts */ :
                     (type === falseType || type === regularFalseType) ? 12580616 /* FalseFacts */ : 16774920 /* TrueFacts */;
             }
-            if (flags & 524288 /* Object */) {
+            if (flags & 524288 /* Object */ && !ignoreObjects) {
                 return ts.getObjectFlags(type) & 16 /* Anonymous */ && isEmptyObjectType(type) ?
                     strictNullChecks ? 16318463 /* EmptyObjectStrictFacts */ : 16777215 /* EmptyObjectFacts */ :
                     isFunctionObjectType(type) ?
@@ -63345,11 +67626,17 @@ var ts;
                 return 0 /* None */;
             }
             if (flags & 465829888 /* Instantiable */) {
-                return !isPatternLiteralType(type) ? getTypeFacts(getBaseConstraintOfType(type) || unknownType) :
+                return !isPatternLiteralType(type) ? getTypeFacts(getBaseConstraintOfType(type) || unknownType, ignoreObjects) :
                     strictNullChecks ? 7929345 /* NonEmptyStringStrictFacts */ : 16776705 /* NonEmptyStringFacts */;
             }
-            if (flags & 3145728 /* UnionOrIntersection */) {
-                return getTypeFactsOfTypes(type.types);
+            if (flags & 1048576 /* Union */) {
+                return ts.reduceLeft(type.types, function (facts, t) { return facts | getTypeFacts(t, ignoreObjects); }, 0 /* None */);
+            }
+            if (flags & 2097152 /* Intersection */) {
+                // When an intersection contains a primitive type we ignore object type constituents as they are
+                // presumably type tags. For example, in string & { __kind__: "name" } we ignore the object type.
+                ignoreObjects || (ignoreObjects = maybeTypeOfKind(type, 131068 /* Primitive */));
+                return ts.reduceLeft(type.types, function (facts, t) { return facts & getTypeFacts(t, ignoreObjects); }, 16777215 /* All */);
             }
             return 16777215 /* All */;
         }
@@ -63357,21 +67644,17 @@ var ts;
             return filterType(type, function (t) { return (getTypeFacts(t) & include) !== 0; });
         }
         function getTypeWithDefault(type, defaultExpression) {
-            if (defaultExpression) {
-                var defaultType = getTypeOfExpression(defaultExpression);
-                return getUnionType([getTypeWithFacts(type, 524288 /* NEUndefined */), defaultType]);
-            }
-            return type;
+            return defaultExpression ?
+                getUnionType([getNonUndefinedType(type), getTypeOfExpression(defaultExpression)]) :
+                type;
         }
         function getTypeOfDestructuredProperty(type, name) {
+            var _a;
             var nameType = getLiteralTypeFromPropertyName(name);
             if (!isTypeUsableAsPropertyName(nameType))
                 return errorType;
             var text = getPropertyNameFromType(nameType);
-            return getConstraintForLocation(getTypeOfPropertyOfType(type, text), name) ||
-                isNumericLiteralName(text) && includeUndefinedInIndexSignature(getIndexTypeOfType(type, 1 /* Number */)) ||
-                includeUndefinedInIndexSignature(getIndexTypeOfType(type, 0 /* String */)) ||
-                errorType;
+            return getTypeOfPropertyOfType(type, text) || includeUndefinedInIndexSignature((_a = getApplicableIndexInfoForName(type, text)) === null || _a === void 0 ? void 0 : _a.type) || errorType;
         }
         function getTypeOfDestructuredArrayElement(type, index) {
             return everyType(type, isTupleLikeType) && getTupleElementType(type, index) ||
@@ -63389,15 +67672,15 @@ var ts;
             return createArrayType(checkIteratedTypeOrElementType(65 /* Destructuring */, type, undefinedType, /*errorNode*/ undefined) || errorType);
         }
         function getAssignedTypeOfBinaryExpression(node) {
-            var isDestructuringDefaultAssignment = node.parent.kind === 199 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) ||
-                node.parent.kind === 288 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent);
+            var isDestructuringDefaultAssignment = node.parent.kind === 203 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) ||
+                node.parent.kind === 294 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent);
             return isDestructuringDefaultAssignment ?
                 getTypeWithDefault(getAssignedType(node), node.right) :
                 getTypeOfExpression(node.right);
         }
         function isDestructuringAssignmentTarget(parent) {
-            return parent.parent.kind === 216 /* BinaryExpression */ && parent.parent.left === parent ||
-                parent.parent.kind === 239 /* ForOfStatement */ && parent.parent.initializer === parent;
+            return parent.parent.kind === 220 /* BinaryExpression */ && parent.parent.left === parent ||
+                parent.parent.kind === 243 /* ForOfStatement */ && parent.parent.initializer === parent;
         }
         function getAssignedTypeOfArrayLiteralElement(node, element) {
             return getTypeOfDestructuredArrayElement(getAssignedType(node), node.elements.indexOf(element));
@@ -63414,21 +67697,21 @@ var ts;
         function getAssignedType(node) {
             var parent = node.parent;
             switch (parent.kind) {
-                case 238 /* ForInStatement */:
+                case 242 /* ForInStatement */:
                     return stringType;
-                case 239 /* ForOfStatement */:
+                case 243 /* ForOfStatement */:
                     return checkRightHandSideOfForOf(parent) || errorType;
-                case 216 /* BinaryExpression */:
+                case 220 /* BinaryExpression */:
                     return getAssignedTypeOfBinaryExpression(parent);
-                case 210 /* DeleteExpression */:
+                case 214 /* DeleteExpression */:
                     return undefinedType;
-                case 199 /* ArrayLiteralExpression */:
+                case 203 /* ArrayLiteralExpression */:
                     return getAssignedTypeOfArrayLiteralElement(parent, node);
-                case 220 /* SpreadElement */:
+                case 224 /* SpreadElement */:
                     return getAssignedTypeOfSpreadExpression(parent);
-                case 288 /* PropertyAssignment */:
+                case 294 /* PropertyAssignment */:
                     return getAssignedTypeOfPropertyAssignment(parent);
-                case 289 /* ShorthandPropertyAssignment */:
+                case 295 /* ShorthandPropertyAssignment */:
                     return getAssignedTypeOfShorthandPropertyAssignment(parent);
             }
             return errorType;
@@ -63436,7 +67719,7 @@ var ts;
         function getInitialTypeOfBindingElement(node) {
             var pattern = node.parent;
             var parentType = getInitialType(pattern.parent);
-            var type = pattern.kind === 196 /* ObjectBindingPattern */ ?
+            var type = pattern.kind === 200 /* ObjectBindingPattern */ ?
                 getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) :
                 !node.dotDotDotToken ?
                     getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) :
@@ -63454,35 +67737,35 @@ var ts;
             if (node.initializer) {
                 return getTypeOfInitializer(node.initializer);
             }
-            if (node.parent.parent.kind === 238 /* ForInStatement */) {
+            if (node.parent.parent.kind === 242 /* ForInStatement */) {
                 return stringType;
             }
-            if (node.parent.parent.kind === 239 /* ForOfStatement */) {
+            if (node.parent.parent.kind === 243 /* ForOfStatement */) {
                 return checkRightHandSideOfForOf(node.parent.parent) || errorType;
             }
             return errorType;
         }
         function getInitialType(node) {
-            return node.kind === 249 /* VariableDeclaration */ ?
+            return node.kind === 253 /* VariableDeclaration */ ?
                 getInitialTypeOfVariableDeclaration(node) :
                 getInitialTypeOfBindingElement(node);
         }
         function isEmptyArrayAssignment(node) {
-            return node.kind === 249 /* VariableDeclaration */ && node.initializer &&
+            return node.kind === 253 /* VariableDeclaration */ && node.initializer &&
                 isEmptyArrayLiteral(node.initializer) ||
-                node.kind !== 198 /* BindingElement */ && node.parent.kind === 216 /* BinaryExpression */ &&
+                node.kind !== 202 /* BindingElement */ && node.parent.kind === 220 /* BinaryExpression */ &&
                     isEmptyArrayLiteral(node.parent.right);
         }
         function getReferenceCandidate(node) {
             switch (node.kind) {
-                case 207 /* ParenthesizedExpression */:
+                case 211 /* ParenthesizedExpression */:
                     return getReferenceCandidate(node.expression);
-                case 216 /* BinaryExpression */:
+                case 220 /* BinaryExpression */:
                     switch (node.operatorToken.kind) {
-                        case 62 /* EqualsToken */:
-                        case 74 /* BarBarEqualsToken */:
-                        case 75 /* AmpersandAmpersandEqualsToken */:
-                        case 76 /* QuestionQuestionEqualsToken */:
+                        case 63 /* EqualsToken */:
+                        case 75 /* BarBarEqualsToken */:
+                        case 76 /* AmpersandAmpersandEqualsToken */:
+                        case 77 /* QuestionQuestionEqualsToken */:
                             return getReferenceCandidate(node.left);
                         case 27 /* CommaToken */:
                             return getReferenceCandidate(node.right);
@@ -63492,13 +67775,13 @@ var ts;
         }
         function getReferenceRoot(node) {
             var parent = node.parent;
-            return parent.kind === 207 /* ParenthesizedExpression */ ||
-                parent.kind === 216 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */ && parent.left === node ||
-                parent.kind === 216 /* BinaryExpression */ && parent.operatorToken.kind === 27 /* CommaToken */ && parent.right === node ?
+            return parent.kind === 211 /* ParenthesizedExpression */ ||
+                parent.kind === 220 /* BinaryExpression */ && parent.operatorToken.kind === 63 /* EqualsToken */ && parent.left === node ||
+                parent.kind === 220 /* BinaryExpression */ && parent.operatorToken.kind === 27 /* CommaToken */ && parent.right === node ?
                 getReferenceRoot(parent) : node;
         }
         function getTypeOfSwitchClause(clause) {
-            if (clause.kind === 284 /* CaseClause */) {
+            if (clause.kind === 288 /* CaseClause */) {
                 return getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression));
             }
             return neverType;
@@ -63518,7 +67801,7 @@ var ts;
             var witnesses = [];
             for (var _i = 0, _a = switchStatement.caseBlock.clauses; _i < _a.length; _i++) {
                 var clause = _a[_i];
-                if (clause.kind === 284 /* CaseClause */) {
+                if (clause.kind === 288 /* CaseClause */) {
                     if (ts.isStringLiteralLike(clause.expression)) {
                         witnesses.push(clause.expression.text);
                         continue;
@@ -63554,9 +67837,15 @@ var ts;
         function forEachType(type, f) {
             return type.flags & 1048576 /* Union */ ? ts.forEach(type.types, f) : f(type);
         }
+        function someType(type, f) {
+            return type.flags & 1048576 /* Union */ ? ts.some(type.types, f) : f(type);
+        }
         function everyType(type, f) {
             return type.flags & 1048576 /* Union */ ? ts.every(type.types, f) : f(type);
         }
+        function everyContainedType(type, f) {
+            return type.flags & 3145728 /* UnionOrIntersection */ ? ts.every(type.types, f) : f(type);
+        }
         function filterType(type, f) {
             if (type.flags & 1048576 /* Union */) {
                 var types = type.types;
@@ -63585,6 +67874,9 @@ var ts;
             }
             return type.flags & 131072 /* Never */ || f(type) ? type : neverType;
         }
+        function removeType(type, targetType) {
+            return filterType(type, function (t) { return t !== targetType; });
+        }
         function countTypes(type) {
             return type.flags & 1048576 /* Union */ ? type.types.length : 1;
         }
@@ -63599,8 +67891,8 @@ var ts;
             var types = origin && origin.flags & 1048576 /* Union */ ? origin.types : type.types;
             var mappedTypes;
             var changed = false;
-            for (var _i = 0, types_18 = types; _i < types_18.length; _i++) {
-                var t = types_18[_i];
+            for (var _i = 0, types_17 = types; _i < types_17.length; _i++) {
+                var t = types_17[_i];
                 var mapped = t.flags & 1048576 /* Union */ ? mapType(t, mapper, noReductions) : mapper(t);
                 changed || (changed = t !== mapped);
                 if (mapped) {
@@ -63620,22 +67912,24 @@ var ts;
                 mapType(type, mapper);
         }
         function getConstituentCount(type) {
-            return type.flags & 3145728 /* UnionOrIntersection */ ? type.types.length : 1;
+            return type.flags & 1048576 /* Union */ ? type.types.length : 1;
         }
         function extractTypesOfKind(type, kind) {
             return filterType(type, function (t) { return (t.flags & kind) !== 0; });
         }
-        // Return a new type in which occurrences of the string and number primitive types in
-        // typeWithPrimitives have been replaced with occurrences of string literals and numeric
-        // literals in typeWithLiterals, respectively.
+        // Return a new type in which occurrences of the string, number and bigint primitives and placeholder template
+        // literal types in typeWithPrimitives have been replaced with occurrences of compatible and more specific types
+        // from typeWithLiterals. This is essentially a limited form of intersection between the two types. We avoid a
+        // true intersection because it is more costly and, when applied to union types, generates a large number of
+        // types we don't actually care about.
         function replacePrimitivesWithLiterals(typeWithPrimitives, typeWithLiterals) {
-            if (isTypeSubsetOf(stringType, typeWithPrimitives) && maybeTypeOfKind(typeWithLiterals, 128 /* StringLiteral */) ||
-                isTypeSubsetOf(numberType, typeWithPrimitives) && maybeTypeOfKind(typeWithLiterals, 256 /* NumberLiteral */) ||
-                isTypeSubsetOf(bigintType, typeWithPrimitives) && maybeTypeOfKind(typeWithLiterals, 2048 /* BigIntLiteral */)) {
+            if (maybeTypeOfKind(typeWithPrimitives, 4 /* String */ | 134217728 /* TemplateLiteral */ | 8 /* Number */ | 64 /* BigInt */) &&
+                maybeTypeOfKind(typeWithLiterals, 128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */ | 256 /* NumberLiteral */ | 2048 /* BigIntLiteral */)) {
                 return mapType(typeWithPrimitives, function (t) {
-                    return t.flags & 4 /* String */ ? extractTypesOfKind(typeWithLiterals, 4 /* String */ | 128 /* StringLiteral */) :
-                        t.flags & 8 /* Number */ ? extractTypesOfKind(typeWithLiterals, 8 /* Number */ | 256 /* NumberLiteral */) :
-                            t.flags & 64 /* BigInt */ ? extractTypesOfKind(typeWithLiterals, 64 /* BigInt */ | 2048 /* BigIntLiteral */) : t;
+                    return t.flags & 4 /* String */ ? extractTypesOfKind(typeWithLiterals, 4 /* String */ | 128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) :
+                        isPatternLiteralType(t) && !maybeTypeOfKind(typeWithLiterals, 4 /* String */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) ? extractTypesOfKind(typeWithLiterals, 128 /* StringLiteral */) :
+                            t.flags & 8 /* Number */ ? extractTypesOfKind(typeWithLiterals, 8 /* Number */ | 256 /* NumberLiteral */) :
+                                t.flags & 64 /* BigInt */ ? extractTypesOfKind(typeWithLiterals, 64 /* BigInt */ | 2048 /* BigIntLiteral */) : t;
                 });
             }
             return typeWithPrimitives;
@@ -63687,8 +67981,8 @@ var ts;
         }
         function isEvolvingArrayTypeList(types) {
             var hasEvolvingArrayType = false;
-            for (var _i = 0, types_19 = types; _i < types_19.length; _i++) {
-                var t = types_19[_i];
+            for (var _i = 0, types_18 = types; _i < types_18.length; _i++) {
+                var t = types_18[_i];
                 if (!(t.flags & 131072 /* Never */)) {
                     if (!(ts.getObjectFlags(t) & 256 /* EvolvingArray */)) {
                         return false;
@@ -63704,22 +67998,22 @@ var ts;
             var root = getReferenceRoot(node);
             var parent = root.parent;
             var isLengthPushOrUnshift = ts.isPropertyAccessExpression(parent) && (parent.name.escapedText === "length" ||
-                parent.parent.kind === 203 /* CallExpression */
+                parent.parent.kind === 207 /* CallExpression */
                     && ts.isIdentifier(parent.name)
                     && ts.isPushOrUnshiftIdentifier(parent.name));
-            var isElementAssignment = parent.kind === 202 /* ElementAccessExpression */ &&
+            var isElementAssignment = parent.kind === 206 /* ElementAccessExpression */ &&
                 parent.expression === root &&
-                parent.parent.kind === 216 /* BinaryExpression */ &&
-                parent.parent.operatorToken.kind === 62 /* EqualsToken */ &&
+                parent.parent.kind === 220 /* BinaryExpression */ &&
+                parent.parent.operatorToken.kind === 63 /* EqualsToken */ &&
                 parent.parent.left === parent &&
                 !ts.isAssignmentTarget(parent.parent) &&
                 isTypeAssignableToKind(getTypeOfExpression(parent.argumentExpression), 296 /* NumberLike */);
             return isLengthPushOrUnshift || isElementAssignment;
         }
-        function isDeclarationWithExplicitTypeAnnotation(declaration) {
-            return (declaration.kind === 249 /* VariableDeclaration */ || declaration.kind === 160 /* Parameter */ ||
-                declaration.kind === 163 /* PropertyDeclaration */ || declaration.kind === 162 /* PropertySignature */) &&
-                !!ts.getEffectiveTypeAnnotationNode(declaration);
+        function isDeclarationWithExplicitTypeAnnotation(node) {
+            return (ts.isVariableDeclaration(node) || ts.isPropertyDeclaration(node) || ts.isPropertySignature(node) || ts.isParameter(node)) &&
+                !!(ts.getEffectiveTypeAnnotationNode(node) ||
+                    ts.isInJSFile(node) && ts.hasInitializer(node) && node.initializer && ts.isFunctionExpressionOrArrowFunction(node.initializer) && ts.getEffectiveReturnTypeNode(node.initializer));
         }
         function getExplicitTypeOfSymbol(symbol, diagnostic) {
             if (symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 512 /* ValueModule */)) {
@@ -63737,7 +68031,7 @@ var ts;
                     if (isDeclarationWithExplicitTypeAnnotation(declaration)) {
                         return getTypeOfSymbol(symbol);
                     }
-                    if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 239 /* ForOfStatement */) {
+                    if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 243 /* ForOfStatement */) {
                         var statement = declaration.parent.parent;
                         var expressionType = getTypeOfDottedName(statement.expression, /*diagnostic*/ undefined);
                         if (expressionType) {
@@ -63758,14 +68052,14 @@ var ts;
         function getTypeOfDottedName(node, diagnostic) {
             if (!(node.flags & 16777216 /* InWithStatement */)) {
                 switch (node.kind) {
-                    case 78 /* Identifier */:
+                    case 79 /* Identifier */:
                         var symbol = getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(node));
                         return getExplicitTypeOfSymbol(symbol.flags & 2097152 /* Alias */ ? resolveAlias(symbol) : symbol, diagnostic);
-                    case 107 /* ThisKeyword */:
+                    case 108 /* ThisKeyword */:
                         return getExplicitThisType(node);
-                    case 105 /* SuperKeyword */:
+                    case 106 /* SuperKeyword */:
                         return checkSuperExpression(node);
-                    case 201 /* PropertyAccessExpression */: {
+                    case 205 /* PropertyAccessExpression */: {
                         var type = getTypeOfDottedName(node.expression, diagnostic);
                         if (type) {
                             var name = node.name;
@@ -63783,7 +68077,7 @@ var ts;
                         }
                         return undefined;
                     }
-                    case 207 /* ParenthesizedExpression */:
+                    case 211 /* ParenthesizedExpression */:
                         return getTypeOfDottedName(node.expression, diagnostic);
                 }
             }
@@ -63797,10 +68091,10 @@ var ts;
                 // circularities in control flow analysis, we use getTypeOfDottedName when resolving the call
                 // target expression of an assertion.
                 var funcType = void 0;
-                if (node.parent.kind === 233 /* ExpressionStatement */) {
+                if (node.parent.kind === 237 /* ExpressionStatement */) {
                     funcType = getTypeOfDottedName(node.expression, /*diagnostic*/ undefined);
                 }
-                else if (node.expression.kind !== 105 /* SuperKeyword */) {
+                else if (node.expression.kind !== 106 /* SuperKeyword */) {
                     if (ts.isOptionalChain(node)) {
                         funcType = checkNonNullType(getOptionalExpressionType(checkExpression(node.expression), node.expression), node.expression);
                     }
@@ -63840,8 +68134,8 @@ var ts;
             return result;
         }
         function isFalseExpression(expr) {
-            var node = ts.skipParentheses(expr);
-            return node.kind === 94 /* FalseKeyword */ || node.kind === 216 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) ||
+            var node = ts.skipParentheses(expr, /*excludeJSDocTypeAssertions*/ true);
+            return node.kind === 95 /* FalseKeyword */ || node.kind === 220 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) ||
                 node.operatorToken.kind === 56 /* BarBarToken */ && isFalseExpression(node.left) && isFalseExpression(node.right));
         }
         function isReachableFlowNodeWorker(flow, noCacheCheck) {
@@ -63929,7 +68223,7 @@ var ts;
                     flow = flow.antecedent;
                 }
                 else if (flags & 512 /* Call */) {
-                    if (flow.node.expression.kind === 105 /* SuperKeyword */) {
+                    if (flow.node.expression.kind === 106 /* SuperKeyword */) {
                         return true;
                     }
                     flow = flow.antecedent;
@@ -63956,7 +68250,20 @@ var ts;
                 }
             }
         }
-        function getFlowTypeOfReference(reference, declaredType, initialType, flowContainer, couldBeUninitialized) {
+        function isConstantReference(node) {
+            switch (node.kind) {
+                case 79 /* Identifier */: {
+                    var symbol = getResolvedSymbol(node);
+                    return isConstVariable(symbol) || ts.isParameterOrCatchClauseVariable(symbol) && !isSymbolAssigned(symbol);
+                }
+                case 205 /* PropertyAccessExpression */:
+                case 206 /* ElementAccessExpression */:
+                    // The resolvedSymbol property is initialized by checkPropertyAccess or checkElementAccess before we get here.
+                    return isConstantReference(node.expression) && isReadonlySymbol(getNodeLinks(node).resolvedSymbol || unknownSymbol);
+            }
+            return false;
+        }
+        function getFlowTypeOfReference(reference, declaredType, initialType, flowContainer) {
             if (initialType === void 0) { initialType = declaredType; }
             var key;
             var isKeySet = false;
@@ -63964,7 +68271,7 @@ var ts;
             if (flowAnalysisDisabled) {
                 return errorType;
             }
-            if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 536624127 /* Narrowable */)) {
+            if (!reference.flowNode) {
                 return declaredType;
             }
             flowInvocationCount++;
@@ -63976,10 +68283,11 @@ var ts;
             // on empty arrays are possible without implicit any errors and new element types can be inferred without
             // type mismatch errors.
             var resultType = ts.getObjectFlags(evolvedType) & 256 /* EvolvingArray */ && isEvolvingArrayOperationTarget(reference) ? autoArrayType : finalizeEvolvingArrayType(evolvedType);
-            if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 225 /* NonNullExpression */ && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) {
+            if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 229 /* NonNullExpression */ && !(resultType.flags & 131072 /* Never */) && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) {
                 return declaredType;
             }
-            return resultType;
+            // The non-null unknown type should never escape control flow analysis.
+            return resultType === nonNullUnknownType ? unknownType : resultType;
             function getOrSetCacheKey() {
                 if (isKeySet) {
                     return key;
@@ -64060,9 +68368,9 @@ var ts;
                         // Check if we should continue with the control flow of the containing function.
                         var container = flow.node;
                         if (container && container !== flowContainer &&
-                            reference.kind !== 201 /* PropertyAccessExpression */ &&
-                            reference.kind !== 202 /* ElementAccessExpression */ &&
-                            reference.kind !== 107 /* ThisKeyword */) {
+                            reference.kind !== 205 /* PropertyAccessExpression */ &&
+                            reference.kind !== 206 /* ElementAccessExpression */ &&
+                            reference.kind !== 108 /* ThisKeyword */) {
                             flow = container.flowNode;
                             continue;
                         }
@@ -64086,7 +68394,7 @@ var ts;
             }
             function getInitialOrAssignedType(flow) {
                 var node = flow.node;
-                return getConstraintForLocation(node.kind === 249 /* VariableDeclaration */ || node.kind === 198 /* BindingElement */ ?
+                return getNarrowableTypeForReference(node.kind === 253 /* VariableDeclaration */ || node.kind === 202 /* BindingElement */ ?
                     getInitialType(node) :
                     getAssignedType(node), reference);
             }
@@ -64126,25 +68434,25 @@ var ts;
                     // in which case we continue control flow analysis back to the function's declaration
                     if (ts.isVariableDeclaration(node) && (ts.isInJSFile(node) || ts.isVarConst(node))) {
                         var init = ts.getDeclaredExpandoInitializer(node);
-                        if (init && (init.kind === 208 /* FunctionExpression */ || init.kind === 209 /* ArrowFunction */)) {
+                        if (init && (init.kind === 212 /* FunctionExpression */ || init.kind === 213 /* ArrowFunction */)) {
                             return getTypeAtFlowNode(flow.antecedent);
                         }
                     }
                     return declaredType;
                 }
                 // for (const _ in ref) acts as a nonnull on ref
-                if (ts.isVariableDeclaration(node) && node.parent.parent.kind === 238 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) {
+                if (ts.isVariableDeclaration(node) && node.parent.parent.kind === 242 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) {
                     return getNonNullableTypeIfNeeded(getTypeFromFlowType(getTypeAtFlowNode(flow.antecedent)));
                 }
                 // Assignment doesn't affect reference
                 return undefined;
             }
             function narrowTypeByAssertion(type, expr) {
-                var node = ts.skipParentheses(expr);
-                if (node.kind === 94 /* FalseKeyword */) {
+                var node = ts.skipParentheses(expr, /*excludeJSDocTypeAssertions*/ true);
+                if (node.kind === 95 /* FalseKeyword */) {
                     return unreachableNeverType;
                 }
-                if (node.kind === 216 /* BinaryExpression */) {
+                if (node.kind === 220 /* BinaryExpression */) {
                     if (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */) {
                         return narrowTypeByAssertion(narrowTypeByAssertion(type, node.left), node.right);
                     }
@@ -64175,7 +68483,7 @@ var ts;
             function getTypeAtFlowArrayMutation(flow) {
                 if (declaredType === autoType || declaredType === autoArrayType) {
                     var node = flow.node;
-                    var expr = node.kind === 203 /* CallExpression */ ?
+                    var expr = node.kind === 207 /* CallExpression */ ?
                         node.expression.expression :
                         node.left.expression;
                     if (isMatchingReference(reference, getReferenceCandidate(expr))) {
@@ -64183,7 +68491,7 @@ var ts;
                         var type = getTypeFromFlowType(flowType);
                         if (ts.getObjectFlags(type) & 256 /* EvolvingArray */) {
                             var evolvedType_1 = type;
-                            if (node.kind === 203 /* CallExpression */) {
+                            if (node.kind === 207 /* CallExpression */) {
                                 for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) {
                                     var arg = _a[_i];
                                     evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, arg);
@@ -64231,7 +68539,7 @@ var ts;
                 if (isMatchingReference(reference, expr)) {
                     type = narrowTypeBySwitchOnDiscriminant(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd);
                 }
-                else if (expr.kind === 211 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) {
+                else if (expr.kind === 215 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) {
                     type = narrowBySwitchOnTypeOf(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd);
                 }
                 else {
@@ -64239,12 +68547,13 @@ var ts;
                         if (optionalChainContainsReference(expr, reference)) {
                             type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, function (t) { return !(t.flags & (32768 /* Undefined */ | 131072 /* Never */)); });
                         }
-                        else if (expr.kind === 211 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) {
+                        else if (expr.kind === 215 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) {
                             type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, function (t) { return !(t.flags & 131072 /* Never */ || t.flags & 128 /* StringLiteral */ && t.value === "undefined"); });
                         }
                     }
-                    if (isMatchingReferenceDiscriminant(expr, type)) {
-                        type = narrowTypeByDiscriminant(type, expr, function (t) { return narrowTypeBySwitchOnDiscriminant(t, flow.switchStatement, flow.clauseStart, flow.clauseEnd); });
+                    var access = getDiscriminantPropertyAccess(expr, type);
+                    if (access) {
+                        type = narrowTypeBySwitchOnDiscriminantProperty(type, access, flow.switchStatement, flow.clauseStart, flow.clauseEnd);
                     }
                 }
                 return createFlowType(type, isIncomplete(flowType));
@@ -64399,24 +68708,20 @@ var ts;
                 }
                 return result;
             }
-            function isMatchingReferenceDiscriminant(expr, computedType) {
+            function getDiscriminantPropertyAccess(expr, computedType) {
+                var access, name;
                 var type = declaredType.flags & 1048576 /* Union */ ? declaredType : computedType;
-                if (!(type.flags & 1048576 /* Union */) || !ts.isAccessExpression(expr)) {
-                    return false;
-                }
-                var name = getAccessedPropertyName(expr);
-                if (name === undefined) {
-                    return false;
-                }
-                return isMatchingReference(reference, expr.expression) && isDiscriminantProperty(type, name);
+                return type.flags & 1048576 /* Union */ && (access = getPropertyAccess(expr)) && (name = getAccessedPropertyName(access)) &&
+                    isMatchingReference(reference, ts.isAccessExpression(access) ? access.expression : access.parent.parent.initializer) &&
+                    isDiscriminantProperty(type, name) ?
+                    access : undefined;
             }
             function narrowTypeByDiscriminant(type, access, narrowType) {
                 var propName = getAccessedPropertyName(access);
                 if (propName === undefined) {
                     return type;
                 }
-                var includesNullable = strictNullChecks && maybeTypeOfKind(type, 98304 /* Nullable */);
-                var removeNullable = includesNullable && ts.isOptionalChain(access);
+                var removeNullable = strictNullChecks && ts.isOptionalChain(access) && maybeTypeOfKind(type, 98304 /* Nullable */);
                 var propType = getTypeOfPropertyOfType(removeNullable ? getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */) : type, propName);
                 if (!propType) {
                     return type;
@@ -64425,100 +68730,163 @@ var ts;
                 var narrowedPropType = narrowType(propType);
                 return filterType(type, function (t) {
                     var discriminantType = getTypeOfPropertyOrIndexSignature(t, propName);
-                    return !(discriminantType.flags & 131072 /* Never */) && isTypeComparableTo(discriminantType, narrowedPropType);
+                    return !(narrowedPropType.flags & 131072 /* Never */) && isTypeComparableTo(narrowedPropType, discriminantType);
                 });
             }
+            function narrowTypeByDiscriminantProperty(type, access, operator, value, assumeTrue) {
+                if ((operator === 36 /* EqualsEqualsEqualsToken */ || operator === 37 /* ExclamationEqualsEqualsToken */) && type.flags & 1048576 /* Union */) {
+                    var keyPropertyName = getKeyPropertyName(type);
+                    if (keyPropertyName && keyPropertyName === getAccessedPropertyName(access)) {
+                        var candidate = getConstituentTypeForKeyType(type, getTypeOfExpression(value));
+                        if (candidate) {
+                            return operator === (assumeTrue ? 36 /* EqualsEqualsEqualsToken */ : 37 /* ExclamationEqualsEqualsToken */) ? candidate :
+                                isUnitType(getTypeOfPropertyOfType(candidate, keyPropertyName) || unknownType) ? removeType(type, candidate) :
+                                    type;
+                        }
+                    }
+                }
+                return narrowTypeByDiscriminant(type, access, function (t) { return narrowTypeByEquality(t, operator, value, assumeTrue); });
+            }
+            function narrowTypeBySwitchOnDiscriminantProperty(type, access, switchStatement, clauseStart, clauseEnd) {
+                if (clauseStart < clauseEnd && type.flags & 1048576 /* Union */ && getKeyPropertyName(type) === getAccessedPropertyName(access)) {
+                    var clauseTypes = getSwitchClauseTypes(switchStatement).slice(clauseStart, clauseEnd);
+                    var candidate = getUnionType(ts.map(clauseTypes, function (t) { return getConstituentTypeForKeyType(type, t) || unknownType; }));
+                    if (candidate !== unknownType) {
+                        return candidate;
+                    }
+                }
+                return narrowTypeByDiscriminant(type, access, function (t) { return narrowTypeBySwitchOnDiscriminant(t, switchStatement, clauseStart, clauseEnd); });
+            }
             function narrowTypeByTruthiness(type, expr, assumeTrue) {
                 if (isMatchingReference(reference, expr)) {
-                    return getTypeWithFacts(type, assumeTrue ? 4194304 /* Truthy */ : 8388608 /* Falsy */);
+                    return type.flags & 2 /* Unknown */ && assumeTrue ? nonNullUnknownType :
+                        getTypeWithFacts(type, assumeTrue ? 4194304 /* Truthy */ : 8388608 /* Falsy */);
                 }
                 if (strictNullChecks && assumeTrue && optionalChainContainsReference(expr, reference)) {
                     type = getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
                 }
-                if (isMatchingReferenceDiscriminant(expr, type)) {
-                    return narrowTypeByDiscriminant(type, expr, function (t) { return getTypeWithFacts(t, assumeTrue ? 4194304 /* Truthy */ : 8388608 /* Falsy */); });
+                var access = getDiscriminantPropertyAccess(expr, type);
+                if (access) {
+                    return narrowTypeByDiscriminant(type, access, function (t) { return getTypeWithFacts(t, assumeTrue ? 4194304 /* Truthy */ : 8388608 /* Falsy */); });
                 }
                 return type;
             }
             function isTypePresencePossible(type, propName, assumeTrue) {
-                if (getIndexInfoOfType(type, 0 /* String */)) {
-                    return true;
-                }
                 var prop = getPropertyOfType(type, propName);
                 if (prop) {
                     return prop.flags & 16777216 /* Optional */ ? true : assumeTrue;
                 }
-                return !assumeTrue;
+                return getApplicableIndexInfoForName(type, propName) ? true : !assumeTrue;
             }
-            function narrowByInKeyword(type, literal, assumeTrue) {
-                if (type.flags & (1048576 /* Union */ | 524288 /* Object */)
+            function narrowByInKeyword(type, name, assumeTrue) {
+                if (type.flags & 1048576 /* Union */
+                    || type.flags & 524288 /* Object */ && declaredType !== type
                     || isThisTypeParameter(type)
                     || type.flags & 2097152 /* Intersection */ && ts.every(type.types, function (t) { return t.symbol !== globalThisSymbol; })) {
-                    var propName_1 = ts.escapeLeadingUnderscores(literal.text);
-                    return filterType(type, function (t) { return isTypePresencePossible(t, propName_1, assumeTrue); });
+                    return filterType(type, function (t) { return isTypePresencePossible(t, name, assumeTrue); });
                 }
                 return type;
             }
             function narrowTypeByBinaryExpression(type, expr, assumeTrue) {
                 switch (expr.operatorToken.kind) {
-                    case 62 /* EqualsToken */:
-                    case 74 /* BarBarEqualsToken */:
-                    case 75 /* AmpersandAmpersandEqualsToken */:
-                    case 76 /* QuestionQuestionEqualsToken */:
+                    case 63 /* EqualsToken */:
+                    case 75 /* BarBarEqualsToken */:
+                    case 76 /* AmpersandAmpersandEqualsToken */:
+                    case 77 /* QuestionQuestionEqualsToken */:
                         return narrowTypeByTruthiness(narrowType(type, expr.right, assumeTrue), expr.left, assumeTrue);
                     case 34 /* EqualsEqualsToken */:
                     case 35 /* ExclamationEqualsToken */:
                     case 36 /* EqualsEqualsEqualsToken */:
                     case 37 /* ExclamationEqualsEqualsToken */:
-                        var operator_1 = expr.operatorToken.kind;
-                        var left_1 = getReferenceCandidate(expr.left);
-                        var right_1 = getReferenceCandidate(expr.right);
-                        if (left_1.kind === 211 /* TypeOfExpression */ && ts.isStringLiteralLike(right_1)) {
-                            return narrowTypeByTypeof(type, left_1, operator_1, right_1, assumeTrue);
+                        var operator = expr.operatorToken.kind;
+                        var left = getReferenceCandidate(expr.left);
+                        var right = getReferenceCandidate(expr.right);
+                        if (left.kind === 215 /* TypeOfExpression */ && ts.isStringLiteralLike(right)) {
+                            return narrowTypeByTypeof(type, left, operator, right, assumeTrue);
                         }
-                        if (right_1.kind === 211 /* TypeOfExpression */ && ts.isStringLiteralLike(left_1)) {
-                            return narrowTypeByTypeof(type, right_1, operator_1, left_1, assumeTrue);
+                        if (right.kind === 215 /* TypeOfExpression */ && ts.isStringLiteralLike(left)) {
+                            return narrowTypeByTypeof(type, right, operator, left, assumeTrue);
                         }
-                        if (isMatchingReference(reference, left_1)) {
-                            return narrowTypeByEquality(type, operator_1, right_1, assumeTrue);
+                        if (isMatchingReference(reference, left)) {
+                            return narrowTypeByEquality(type, operator, right, assumeTrue);
                         }
-                        if (isMatchingReference(reference, right_1)) {
-                            return narrowTypeByEquality(type, operator_1, left_1, assumeTrue);
+                        if (isMatchingReference(reference, right)) {
+                            return narrowTypeByEquality(type, operator, left, assumeTrue);
                         }
                         if (strictNullChecks) {
-                            if (optionalChainContainsReference(left_1, reference)) {
-                                type = narrowTypeByOptionalChainContainment(type, operator_1, right_1, assumeTrue);
+                            if (optionalChainContainsReference(left, reference)) {
+                                type = narrowTypeByOptionalChainContainment(type, operator, right, assumeTrue);
                             }
-                            else if (optionalChainContainsReference(right_1, reference)) {
-                                type = narrowTypeByOptionalChainContainment(type, operator_1, left_1, assumeTrue);
+                            else if (optionalChainContainsReference(right, reference)) {
+                                type = narrowTypeByOptionalChainContainment(type, operator, left, assumeTrue);
                             }
                         }
-                        if (isMatchingReferenceDiscriminant(left_1, type)) {
-                            return narrowTypeByDiscriminant(type, left_1, function (t) { return narrowTypeByEquality(t, operator_1, right_1, assumeTrue); });
+                        var leftAccess = getDiscriminantPropertyAccess(left, type);
+                        if (leftAccess) {
+                            return narrowTypeByDiscriminantProperty(type, leftAccess, operator, right, assumeTrue);
                         }
-                        if (isMatchingReferenceDiscriminant(right_1, type)) {
-                            return narrowTypeByDiscriminant(type, right_1, function (t) { return narrowTypeByEquality(t, operator_1, left_1, assumeTrue); });
+                        var rightAccess = getDiscriminantPropertyAccess(right, type);
+                        if (rightAccess) {
+                            return narrowTypeByDiscriminantProperty(type, rightAccess, operator, left, assumeTrue);
                         }
-                        if (isMatchingConstructorReference(left_1)) {
-                            return narrowTypeByConstructor(type, operator_1, right_1, assumeTrue);
+                        if (isMatchingConstructorReference(left)) {
+                            return narrowTypeByConstructor(type, operator, right, assumeTrue);
                         }
-                        if (isMatchingConstructorReference(right_1)) {
-                            return narrowTypeByConstructor(type, operator_1, left_1, assumeTrue);
+                        if (isMatchingConstructorReference(right)) {
+                            return narrowTypeByConstructor(type, operator, left, assumeTrue);
                         }
                         break;
-                    case 101 /* InstanceOfKeyword */:
+                    case 102 /* InstanceOfKeyword */:
                         return narrowTypeByInstanceof(type, expr, assumeTrue);
-                    case 100 /* InKeyword */:
+                    case 101 /* InKeyword */:
+                        if (ts.isPrivateIdentifier(expr.left)) {
+                            return narrowTypeByPrivateIdentifierInInExpression(type, expr, assumeTrue);
+                        }
                         var target = getReferenceCandidate(expr.right);
-                        if (ts.isStringLiteralLike(expr.left) && isMatchingReference(reference, target)) {
-                            return narrowByInKeyword(type, expr.left, assumeTrue);
+                        var leftType = getTypeOfNode(expr.left);
+                        if (leftType.flags & 128 /* StringLiteral */) {
+                            var name = ts.escapeLeadingUnderscores(leftType.value);
+                            if (containsMissingType(type) && ts.isAccessExpression(reference) && isMatchingReference(reference.expression, target) &&
+                                getAccessedPropertyName(reference) === name) {
+                                return getTypeWithFacts(type, assumeTrue ? 524288 /* NEUndefined */ : 65536 /* EQUndefined */);
+                            }
+                            if (isMatchingReference(reference, target)) {
+                                return narrowByInKeyword(type, name, assumeTrue);
+                            }
                         }
                         break;
                     case 27 /* CommaToken */:
                         return narrowType(type, expr.right, assumeTrue);
+                    // Ordinarily we won't see && and || expressions in control flow analysis because the Binder breaks those
+                    // expressions down to individual conditional control flows. However, we may encounter them when analyzing
+                    // aliased conditional expressions.
+                    case 55 /* AmpersandAmpersandToken */:
+                        return assumeTrue ?
+                            narrowType(narrowType(type, expr.left, /*assumeTrue*/ true), expr.right, /*assumeTrue*/ true) :
+                            getUnionType([narrowType(type, expr.left, /*assumeTrue*/ false), narrowType(type, expr.right, /*assumeTrue*/ false)]);
+                    case 56 /* BarBarToken */:
+                        return assumeTrue ?
+                            getUnionType([narrowType(type, expr.left, /*assumeTrue*/ true), narrowType(type, expr.right, /*assumeTrue*/ true)]) :
+                            narrowType(narrowType(type, expr.left, /*assumeTrue*/ false), expr.right, /*assumeTrue*/ false);
                 }
                 return type;
             }
+            function narrowTypeByPrivateIdentifierInInExpression(type, expr, assumeTrue) {
+                var target = getReferenceCandidate(expr.right);
+                if (!isMatchingReference(reference, target)) {
+                    return type;
+                }
+                ts.Debug.assertNode(expr.left, ts.isPrivateIdentifier);
+                var symbol = getSymbolForPrivateIdentifierExpression(expr.left);
+                if (symbol === undefined) {
+                    return type;
+                }
+                var classSymbol = symbol.parent;
+                var targetType = ts.hasStaticModifier(ts.Debug.checkDefined(symbol.valueDeclaration, "should always have a declaration"))
+                    ? getTypeOfSymbol(classSymbol)
+                    : getDeclaredTypeOfSymbol(classSymbol);
+                return getNarrowedType(type, targetType, assumeTrue, isTypeDerivedFrom);
+            }
             function narrowTypeByOptionalChainContainment(type, operator, value, assumeTrue) {
                 // We are in a branch of obj?.foo === value (or any one of the other equality operators). We narrow obj as follows:
                 // When operator is === and type of value excludes undefined, null and undefined is removed from type of obj in true branch.
@@ -64545,6 +68913,9 @@ var ts;
                     assumeTrue = !assumeTrue;
                 }
                 var valueType = getTypeOfExpression(value);
+                if (assumeTrue && (type.flags & 2 /* Unknown */) && (operator === 34 /* EqualsEqualsToken */ || operator === 35 /* ExclamationEqualsToken */) && (valueType.flags & 65536 /* Null */)) {
+                    return getUnionType([nullType, undefinedType]);
+                }
                 if ((type.flags & 2 /* Unknown */) && assumeTrue && (operator === 36 /* EqualsEqualsEqualsToken */ || operator === 37 /* ExclamationEqualsEqualsToken */)) {
                     if (valueType.flags & (131068 /* Primitive */ | 67108864 /* NonPrimitive */)) {
                         return valueType;
@@ -64564,17 +68935,16 @@ var ts;
                         valueType.flags & 65536 /* Null */ ?
                             assumeTrue ? 131072 /* EQNull */ : 1048576 /* NENull */ :
                             assumeTrue ? 65536 /* EQUndefined */ : 524288 /* NEUndefined */;
-                    return getTypeWithFacts(type, facts);
+                    return type.flags & 2 /* Unknown */ && facts & (1048576 /* NENull */ | 2097152 /* NEUndefinedOrNull */) ? nonNullUnknownType : getTypeWithFacts(type, facts);
                 }
                 if (assumeTrue) {
                     var filterFn = operator === 34 /* EqualsEqualsToken */ ?
-                        (function (t) { return areTypesComparable(t, valueType) || isCoercibleUnderDoubleEquals(t, valueType); }) :
+                        function (t) { return areTypesComparable(t, valueType) || isCoercibleUnderDoubleEquals(t, valueType); } :
                         function (t) { return areTypesComparable(t, valueType); };
                     return replacePrimitivesWithLiterals(filterType(type, filterFn), valueType);
                 }
                 if (isUnitType(valueType)) {
-                    var regularType_1 = getRegularTypeOfLiteralType(valueType);
-                    return filterType(type, function (t) { return isUnitType(t) ? !areTypesComparable(t, valueType) : getRegularTypeOfLiteralType(t) !== regularType_1; });
+                    return filterType(type, function (t) { return !(isUnitLikeType(t) && areTypesComparable(t, valueType)); });
                 }
                 return type;
             }
@@ -64594,15 +68964,10 @@ var ts;
                     return type;
                 }
                 if (assumeTrue && type.flags & 2 /* Unknown */ && literal.text === "object") {
-                    // The pattern x && typeof x === 'object', where x is of type unknown, narrows x to type object. We don't
-                    // need to check for the reverse typeof x === 'object' && x since that already narrows correctly.
-                    if (typeOfExpr.parent.parent.kind === 216 /* BinaryExpression */) {
-                        var expr = typeOfExpr.parent.parent;
-                        if (expr.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && expr.right === typeOfExpr.parent && containsTruthyCheck(reference, expr.left)) {
-                            return nonPrimitiveType;
-                        }
-                    }
-                    return getUnionType([nonPrimitiveType, nullType]);
+                    // The non-null unknown type is used to track whether a previous narrowing operation has removed the null type
+                    // from the unknown type. For example, the expression `x && typeof x === 'object'` first narrows x to the non-null
+                    // unknown type, and then narrows that to the non-primitive type.
+                    return type === nonNullUnknownType ? nonPrimitiveType : getUnionType([nonPrimitiveType, nullType]);
                 }
                 var facts = assumeTrue ?
                     typeofEQFacts.get(literal.text) || 128 /* TypeofEQHostObject */ :
@@ -64652,7 +69017,7 @@ var ts;
                 if (!hasDefaultClause) {
                     return caseType;
                 }
-                var defaultType = filterType(type, function (t) { return !(isUnitType(t) && ts.contains(switchTypes, getRegularTypeOfLiteralType(t))); });
+                var defaultType = filterType(type, function (t) { return !(isUnitLikeType(t) && ts.contains(switchTypes, getRegularTypeOfLiteralType(extractUnitType(t)))); });
                 return caseType.flags & 131072 /* Never */ ? defaultType : getUnionType([caseType, defaultType]);
             }
             function getImpliedTypeFromTypeofGuard(type, text) {
@@ -64862,6 +69227,16 @@ var ts;
                         return narrowTypeByTypePredicate(type, predicate, callExpression, assumeTrue);
                     }
                 }
+                if (containsMissingType(type) && ts.isAccessExpression(reference) && ts.isPropertyAccessExpression(callExpression.expression)) {
+                    var callAccess = callExpression.expression;
+                    if (isMatchingReference(reference.expression, getReferenceCandidate(callAccess.expression)) &&
+                        ts.isIdentifier(callAccess.name) && callAccess.name.escapedText === "hasOwnProperty" && callExpression.arguments.length === 1) {
+                        var argument = callExpression.arguments[0];
+                        if (ts.isStringLiteralLike(argument) && getAccessedPropertyName(reference) === ts.escapeLeadingUnderscores(argument.text)) {
+                            return getTypeWithFacts(type, assumeTrue ? 524288 /* NEUndefined */ : 65536 /* EQUndefined */);
+                        }
+                    }
+                }
                 return type;
             }
             function narrowTypeByTypePredicate(type, predicate, callExpression, assumeTrue) {
@@ -64876,8 +69251,9 @@ var ts;
                             !(getTypeFacts(predicate.type) & 65536 /* EQUndefined */)) {
                             type = getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
                         }
-                        if (isMatchingReferenceDiscriminant(predicateArgument, type)) {
-                            return narrowTypeByDiscriminant(type, predicateArgument, function (t) { return getNarrowedType(t, predicate.type, assumeTrue, isTypeSubtypeOf); });
+                        var access = getDiscriminantPropertyAccess(predicateArgument, type);
+                        if (access) {
+                            return narrowTypeByDiscriminant(type, access, function (t) { return getNarrowedType(t, predicate.type, assumeTrue, isTypeSubtypeOf); });
                         }
                     }
                 }
@@ -64892,20 +69268,35 @@ var ts;
                     return narrowTypeByOptionality(type, expr, assumeTrue);
                 }
                 switch (expr.kind) {
-                    case 78 /* Identifier */:
-                    case 107 /* ThisKeyword */:
-                    case 105 /* SuperKeyword */:
-                    case 201 /* PropertyAccessExpression */:
-                    case 202 /* ElementAccessExpression */:
+                    case 79 /* Identifier */:
+                        // When narrowing a reference to a const variable, non-assigned parameter, or readonly property, we inline
+                        // up to five levels of aliased conditional expressions that are themselves declared as const variables.
+                        if (!isMatchingReference(reference, expr) && inlineLevel < 5) {
+                            var symbol = getResolvedSymbol(expr);
+                            if (isConstVariable(symbol)) {
+                                var declaration = symbol.valueDeclaration;
+                                if (declaration && ts.isVariableDeclaration(declaration) && !declaration.type && declaration.initializer && isConstantReference(reference)) {
+                                    inlineLevel++;
+                                    var result = narrowType(type, declaration.initializer, assumeTrue);
+                                    inlineLevel--;
+                                    return result;
+                                }
+                            }
+                        }
+                    // falls through
+                    case 108 /* ThisKeyword */:
+                    case 106 /* SuperKeyword */:
+                    case 205 /* PropertyAccessExpression */:
+                    case 206 /* ElementAccessExpression */:
                         return narrowTypeByTruthiness(type, expr, assumeTrue);
-                    case 203 /* CallExpression */:
+                    case 207 /* CallExpression */:
                         return narrowTypeByCallExpression(type, expr, assumeTrue);
-                    case 207 /* ParenthesizedExpression */:
-                    case 225 /* NonNullExpression */:
+                    case 211 /* ParenthesizedExpression */:
+                    case 229 /* NonNullExpression */:
                         return narrowType(type, expr.expression, assumeTrue);
-                    case 216 /* BinaryExpression */:
+                    case 220 /* BinaryExpression */:
                         return narrowTypeByBinaryExpression(type, expr, assumeTrue);
-                    case 214 /* PrefixUnaryExpression */:
+                    case 218 /* PrefixUnaryExpression */:
                         if (expr.operator === 53 /* ExclamationToken */) {
                             return narrowType(type, expr.operand, !assumeTrue);
                         }
@@ -64917,8 +69308,9 @@ var ts;
                 if (isMatchingReference(reference, expr)) {
                     return getTypeWithFacts(type, assumePresent ? 2097152 /* NEUndefinedOrNull */ : 262144 /* EQUndefinedOrNull */);
                 }
-                if (isMatchingReferenceDiscriminant(expr, type)) {
-                    return narrowTypeByDiscriminant(type, expr, function (t) { return getTypeWithFacts(t, assumePresent ? 2097152 /* NEUndefinedOrNull */ : 262144 /* EQUndefinedOrNull */); });
+                var access = getDiscriminantPropertyAccess(expr, type);
+                if (access) {
+                    return narrowTypeByDiscriminant(type, access, function (t) { return getTypeWithFacts(t, assumePresent ? 2097152 /* NEUndefinedOrNull */ : 262144 /* EQUndefinedOrNull */); });
                 }
                 return type;
             }
@@ -64929,68 +69321,76 @@ var ts;
             // an dotted name expression, and if the location is not an assignment target, obtain the type
             // of the expression (which will reflect control flow analysis). If the expression indeed
             // resolved to the given symbol, return the narrowed type.
-            if (location.kind === 78 /* Identifier */) {
+            if (location.kind === 79 /* Identifier */ || location.kind === 80 /* PrivateIdentifier */) {
                 if (ts.isRightSideOfQualifiedNameOrPropertyAccess(location)) {
                     location = location.parent;
                 }
-                if (ts.isExpressionNode(location) && !ts.isAssignmentTarget(location)) {
+                if (ts.isExpressionNode(location) && (!ts.isAssignmentTarget(location) || ts.isWriteAccess(location))) {
                     var type = getTypeOfExpression(location);
                     if (getExportSymbolOfValueSymbolIfExported(getNodeLinks(location).resolvedSymbol) === symbol) {
                         return type;
                     }
                 }
             }
+            if (ts.isDeclarationName(location) && ts.isSetAccessor(location.parent) && getAnnotatedAccessorTypeNode(location.parent)) {
+                return resolveTypeOfAccessors(location.parent.symbol, /*writing*/ true);
+            }
             // The location isn't a reference to the given symbol, meaning we're being asked
             // a hypothetical question of what type the symbol would have if there was a reference
             // to it at the given location. Since we have no control flow information for the
             // hypothetical reference (control flow information is created and attached by the
             // binder), we simply return the declared type of the symbol.
-            return getTypeOfSymbol(symbol);
+            return getNonMissingTypeOfSymbol(symbol);
         }
         function getControlFlowContainer(node) {
             return ts.findAncestor(node.parent, function (node) {
                 return ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) ||
-                    node.kind === 257 /* ModuleBlock */ ||
-                    node.kind === 297 /* SourceFile */ ||
-                    node.kind === 163 /* PropertyDeclaration */;
+                    node.kind === 261 /* ModuleBlock */ ||
+                    node.kind === 303 /* SourceFile */ ||
+                    node.kind === 166 /* PropertyDeclaration */;
             });
         }
-        // Check if a parameter is assigned anywhere within its declaring function.
-        function isParameterAssigned(symbol) {
-            var func = ts.getRootDeclaration(symbol.valueDeclaration).parent;
-            var links = getNodeLinks(func);
+        // Check if a parameter or catch variable is assigned anywhere
+        function isSymbolAssigned(symbol) {
+            if (!symbol.valueDeclaration) {
+                return false;
+            }
+            var parent = ts.getRootDeclaration(symbol.valueDeclaration).parent;
+            var links = getNodeLinks(parent);
             if (!(links.flags & 8388608 /* AssignmentsMarked */)) {
                 links.flags |= 8388608 /* AssignmentsMarked */;
-                if (!hasParentWithAssignmentsMarked(func)) {
-                    markParameterAssignments(func);
+                if (!hasParentWithAssignmentsMarked(parent)) {
+                    markNodeAssignments(parent);
                 }
             }
             return symbol.isAssigned || false;
         }
         function hasParentWithAssignmentsMarked(node) {
-            return !!ts.findAncestor(node.parent, function (node) { return ts.isFunctionLike(node) && !!(getNodeLinks(node).flags & 8388608 /* AssignmentsMarked */); });
+            return !!ts.findAncestor(node.parent, function (node) {
+                return (ts.isFunctionLike(node) || ts.isCatchClause(node)) && !!(getNodeLinks(node).flags & 8388608 /* AssignmentsMarked */);
+            });
         }
-        function markParameterAssignments(node) {
-            if (node.kind === 78 /* Identifier */) {
+        function markNodeAssignments(node) {
+            if (node.kind === 79 /* Identifier */) {
                 if (ts.isAssignmentTarget(node)) {
                     var symbol = getResolvedSymbol(node);
-                    if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 160 /* Parameter */) {
+                    if (ts.isParameterOrCatchClauseVariable(symbol)) {
                         symbol.isAssigned = true;
                     }
                 }
             }
             else {
-                ts.forEachChild(node, markParameterAssignments);
+                ts.forEachChild(node, markNodeAssignments);
             }
         }
         function isConstVariable(symbol) {
-            return symbol.flags & 3 /* Variable */ && (getDeclarationNodeFlagsFromSymbol(symbol) & 2 /* Const */) !== 0 && getTypeOfSymbol(symbol) !== autoArrayType;
+            return symbol.flags & 3 /* Variable */ && (getDeclarationNodeFlagsFromSymbol(symbol) & 2 /* Const */) !== 0;
         }
         /** remove undefined from the annotated type of a parameter when there is an initializer (that doesn't include undefined) */
         function removeOptionalityFromDeclaredType(declaredType, declaration) {
             if (pushTypeResolution(declaration.symbol, 2 /* DeclaredType */)) {
                 var annotationIncludesUndefined = strictNullChecks &&
-                    declaration.kind === 160 /* Parameter */ &&
+                    declaration.kind === 163 /* Parameter */ &&
                     declaration.initializer &&
                     getFalsyFlags(declaredType) & 32768 /* Undefined */ &&
                     !(getFalsyFlags(checkExpression(declaration.initializer)) & 32768 /* Undefined */);
@@ -65002,28 +69402,57 @@ var ts;
                 return declaredType;
             }
         }
-        function isConstraintPosition(node) {
+        function isConstraintPosition(type, node) {
             var parent = node.parent;
-            return parent.kind === 201 /* PropertyAccessExpression */ ||
-                parent.kind === 203 /* CallExpression */ && parent.expression === node ||
-                parent.kind === 202 /* ElementAccessExpression */ && parent.expression === node ||
-                parent.kind === 198 /* BindingElement */ && parent.name === node && !!parent.initializer;
-        }
-        function typeHasNullableConstraint(type) {
-            return type.flags & 58982400 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 98304 /* Nullable */);
-        }
-        function getConstraintForLocation(type, node) {
-            // When a node is the left hand expression of a property access, element access, or call expression,
-            // and the type of the node includes type variables with constraints that are nullable, we fetch the
-            // apparent type of the node *before* performing control flow analysis such that narrowings apply to
-            // the constraint type.
-            if (type && isConstraintPosition(node) && forEachType(type, typeHasNullableConstraint)) {
-                return mapType(getWidenedType(type), getBaseConstraintOrType);
-            }
-            return type;
+            // In an element access obj[x], we consider obj to be in a constraint position, except when obj is of
+            // a generic type without a nullable constraint and x is a generic type. This is because when both obj
+            // and x are of generic types T and K, we want the resulting type to be T[K].
+            return parent.kind === 205 /* PropertyAccessExpression */ ||
+                parent.kind === 207 /* CallExpression */ && parent.expression === node ||
+                parent.kind === 206 /* ElementAccessExpression */ && parent.expression === node &&
+                    !(someType(type, isGenericTypeWithoutNullableConstraint) && isGenericIndexType(getTypeOfExpression(parent.argumentExpression)));
+        }
+        function isGenericTypeWithUnionConstraint(type) {
+            return !!(type.flags & 465829888 /* Instantiable */ && getBaseConstraintOrType(type).flags & (98304 /* Nullable */ | 1048576 /* Union */));
+        }
+        function isGenericTypeWithoutNullableConstraint(type) {
+            return !!(type.flags & 465829888 /* Instantiable */ && !maybeTypeOfKind(getBaseConstraintOrType(type), 98304 /* Nullable */));
+        }
+        function hasNonBindingPatternContextualTypeWithNoGenericTypes(node) {
+            // Computing the contextual type for a child of a JSX element involves resolving the type of the
+            // element's tag name, so we exclude that here to avoid circularities.
+            var contextualType = (ts.isIdentifier(node) || ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node)) &&
+                !((ts.isJsxOpeningElement(node.parent) || ts.isJsxSelfClosingElement(node.parent)) && node.parent.tagName === node) &&
+                getContextualType(node, 8 /* SkipBindingPatterns */);
+            return contextualType && !isGenericType(contextualType);
+        }
+        function getNarrowableTypeForReference(type, reference, checkMode) {
+            // When the type of a reference is or contains an instantiable type with a union type constraint, and
+            // when the reference is in a constraint position (where it is known we'll obtain the apparent type) or
+            // has a contextual type containing no top-level instantiables (meaning constraints will determine
+            // assignability), we substitute constraints for all instantiables in the type of the reference to give
+            // control flow analysis an opportunity to narrow it further. For example, for a reference of a type
+            // parameter type 'T extends string | undefined' with a contextual type 'string', we substitute
+            // 'string | undefined' to give control flow analysis the opportunity to narrow to type 'string'.
+            var substituteConstraints = !(checkMode && checkMode & 2 /* Inferential */) &&
+                someType(type, isGenericTypeWithUnionConstraint) &&
+                (isConstraintPosition(type, reference) || hasNonBindingPatternContextualTypeWithNoGenericTypes(reference));
+            return substituteConstraints ? mapType(type, function (t) { return t.flags & 465829888 /* Instantiable */ ? getBaseConstraintOrType(t) : t; }) : type;
         }
         function isExportOrExportExpression(location) {
-            return !!ts.findAncestor(location, function (e) { return e.parent && ts.isExportAssignment(e.parent) && e.parent.expression === e && ts.isEntityNameExpression(e); });
+            return !!ts.findAncestor(location, function (n) {
+                var parent = n.parent;
+                if (parent === undefined) {
+                    return "quit";
+                }
+                if (ts.isExportAssignment(parent)) {
+                    return parent.expression === n && ts.isEntityNameExpression(n);
+                }
+                if (ts.isExportSpecifier(parent)) {
+                    return parent.name === n || parent.propertyName === n;
+                }
+                return false;
+            });
         }
         function markAliasReferenced(symbol, location) {
             if (isNonLocalAlias(symbol, /*excludes*/ 111551 /* Value */) && !isInTypeQuery(location) && !getTypeOnlyAliasDeclaration(symbol)) {
@@ -65043,7 +69472,7 @@ var ts;
                 }
             }
         }
-        function checkIdentifier(node) {
+        function checkIdentifier(node, checkMode) {
             var symbol = getResolvedSymbol(node);
             if (symbol === unknownSymbol) {
                 return errorType;
@@ -65055,9 +69484,13 @@ var ts;
             // To avoid that we will give an error to users if they use arguments objects in arrow function so that they
             // can explicitly bound arguments objects
             if (symbol === argumentsSymbol) {
+                if (isInPropertyInitializerOrClassStaticBlock(node)) {
+                    error(node, ts.Diagnostics.arguments_cannot_be_referenced_in_property_initializers);
+                    return errorType;
+                }
                 var container = ts.getContainingFunction(node);
                 if (languageVersion < 2 /* ES2015 */) {
-                    if (container.kind === 209 /* ArrowFunction */) {
+                    if (container.kind === 213 /* ArrowFunction */) {
                         error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression);
                     }
                     else if (ts.hasSyntacticModifier(container, 256 /* Async */)) {
@@ -65074,15 +69507,15 @@ var ts;
             }
             var localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol);
             var sourceSymbol = localOrExportSymbol.flags & 2097152 /* Alias */ ? resolveAlias(localOrExportSymbol) : localOrExportSymbol;
-            if (getDeclarationNodeFlagsFromSymbol(sourceSymbol) & 134217728 /* Deprecated */ && isUncalledFunctionReference(node, sourceSymbol)) {
+            if (sourceSymbol.declarations && getDeclarationNodeFlagsFromSymbol(sourceSymbol) & 134217728 /* Deprecated */ && isUncalledFunctionReference(node, sourceSymbol)) {
                 addDeprecatedSuggestion(node, sourceSymbol.declarations, node.escapedText);
             }
             var declaration = localOrExportSymbol.valueDeclaration;
-            if (localOrExportSymbol.flags & 32 /* Class */) {
+            if (declaration && localOrExportSymbol.flags & 32 /* Class */) {
                 // Due to the emit for class decorators, any reference to the class from inside of the class body
                 // must instead be rewritten to point to a temporary variable to avoid issues with the double-bind
                 // behavior of class names in ES6.
-                if (declaration.kind === 252 /* ClassDeclaration */
+                if (declaration.kind === 256 /* ClassDeclaration */
                     && ts.nodeIsDecorated(declaration)) {
                     var container = ts.getContainingClass(node);
                     while (container !== undefined) {
@@ -65094,14 +69527,14 @@ var ts;
                         container = ts.getContainingClass(container);
                     }
                 }
-                else if (declaration.kind === 221 /* ClassExpression */) {
+                else if (declaration.kind === 225 /* ClassExpression */) {
                     // When we emit a class expression with static members that contain a reference
                     // to the constructor in the initializer, we will need to substitute that
                     // binding with an alias as the class name is not in scope.
                     var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false);
-                    while (container.kind !== 297 /* SourceFile */) {
+                    while (container.kind !== 303 /* SourceFile */) {
                         if (container.parent === declaration) {
-                            if (container.kind === 163 /* PropertyDeclaration */ && ts.hasSyntacticModifier(container, 32 /* Static */)) {
+                            if (ts.isPropertyDeclaration(container) && ts.isStatic(container) || ts.isClassStaticBlockDeclaration(container)) {
                                 getNodeLinks(declaration).flags |= 16777216 /* ClassWithConstructorReference */;
                                 getNodeLinks(node).flags |= 33554432 /* ConstructorReferenceInClass */;
                             }
@@ -65112,12 +69545,18 @@ var ts;
                 }
             }
             checkNestedBlockScopedBinding(node, symbol);
-            var type = getConstraintForLocation(getTypeOfSymbol(localOrExportSymbol), node);
+            var type = getTypeOfSymbol(localOrExportSymbol);
             var assignmentKind = ts.getAssignmentTargetKind(node);
             if (assignmentKind) {
                 if (!(localOrExportSymbol.flags & 3 /* Variable */) &&
                     !(ts.isInJSFile(node) && localOrExportSymbol.flags & 512 /* ValueModule */)) {
-                    error(node, ts.Diagnostics.Cannot_assign_to_0_because_it_is_not_a_variable, symbolToString(symbol));
+                    var assignmentError = localOrExportSymbol.flags & 384 /* Enum */ ? ts.Diagnostics.Cannot_assign_to_0_because_it_is_an_enum
+                        : localOrExportSymbol.flags & 32 /* Class */ ? ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_class
+                            : localOrExportSymbol.flags & 1536 /* Module */ ? ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_namespace
+                                : localOrExportSymbol.flags & 16 /* Function */ ? ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_function
+                                    : localOrExportSymbol.flags & 2097152 /* Alias */ ? ts.Diagnostics.Cannot_assign_to_0_because_it_is_an_import
+                                        : ts.Diagnostics.Cannot_assign_to_0_because_it_is_not_a_variable;
+                    error(node, assignmentError, symbolToString(symbol));
                     return errorType;
                 }
                 if (isReadonlySymbol(localOrExportSymbol)) {
@@ -65139,7 +69578,7 @@ var ts;
                 }
             }
             else if (isAlias) {
-                declaration = ts.find(symbol.declarations, isSomeImportDeclaration);
+                declaration = getDeclarationOfAliasSymbol(symbol);
             }
             else {
                 return type;
@@ -65147,10 +69586,11 @@ var ts;
             if (!declaration) {
                 return type;
             }
+            type = getNarrowableTypeForReference(type, node, checkMode);
             // The declaration container is the innermost function that encloses the declaration of the variable
             // or parameter. The flow container is the innermost function starting with which we analyze the control
             // flow graph to determine the control flow based type.
-            var isParameter = ts.getRootDeclaration(declaration).kind === 160 /* Parameter */;
+            var isParameter = ts.getRootDeclaration(declaration).kind === 163 /* Parameter */;
             var declarationContainer = getControlFlowContainer(declaration);
             var flowContainer = getControlFlowContainer(node);
             var isOuterVariable = flowContainer !== declarationContainer;
@@ -65159,9 +69599,9 @@ var ts;
             // When the control flow originates in a function expression or arrow function and we are referencing
             // a const variable or parameter from an outer function, we extend the origin of the control flow
             // analysis to include the immediately enclosing function.
-            while (flowContainer !== declarationContainer && (flowContainer.kind === 208 /* FunctionExpression */ ||
-                flowContainer.kind === 209 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) &&
-                (isConstVariable(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) {
+            while (flowContainer !== declarationContainer && (flowContainer.kind === 212 /* FunctionExpression */ ||
+                flowContainer.kind === 213 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) &&
+                (isConstVariable(localOrExportSymbol) && type !== autoArrayType || isParameter && !isSymbolAssigned(localOrExportSymbol))) {
                 flowContainer = getControlFlowContainer(flowContainer);
             }
             // We only look for uninitialized variables in strict null checking mode, and only when we can analyze
@@ -65169,14 +69609,14 @@ var ts;
             // declaration container are the same).
             var assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || ts.isBindingElement(declaration) ||
                 type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 ||
-                    isInTypeQuery(node) || node.parent.kind === 270 /* ExportSpecifier */) ||
-                node.parent.kind === 225 /* NonNullExpression */ ||
-                declaration.kind === 249 /* VariableDeclaration */ && declaration.exclamationToken ||
+                    isInTypeQuery(node) || node.parent.kind === 274 /* ExportSpecifier */) ||
+                node.parent.kind === 229 /* NonNullExpression */ ||
+                declaration.kind === 253 /* VariableDeclaration */ && declaration.exclamationToken ||
                 declaration.flags & 8388608 /* Ambient */;
             var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, declaration) : type) :
                 type === autoType || type === autoArrayType ? undefinedType :
                     getOptionalType(type);
-            var flowType = getFlowTypeOfReference(node, type, initialType, flowContainer, !assumeInitialized);
+            var flowType = getFlowTypeOfReference(node, type, initialType, flowContainer);
             // A variable is considered uninitialized when it is possible to analyze the entire control flow graph
             // from declaration to use, and when the variable's declared type doesn't include undefined but the
             // control flow based type does include undefined.
@@ -65196,17 +69636,21 @@ var ts;
             }
             return assignmentKind ? getBaseTypeOfLiteralType(flowType) : flowType;
         }
-        function isInsideFunction(node, threshold) {
-            return !!ts.findAncestor(node, function (n) { return n === threshold ? "quit" : ts.isFunctionLike(n); });
+        function isInsideFunctionOrInstancePropertyInitializer(node, threshold) {
+            return !!ts.findAncestor(node, function (n) { return n === threshold ? "quit" : ts.isFunctionLike(n) || (n.parent && ts.isPropertyDeclaration(n.parent) && !ts.hasStaticModifier(n.parent) && n.parent.initializer === n); });
         }
         function getPartOfForStatementContainingNode(node, container) {
             return ts.findAncestor(node, function (n) { return n === container ? "quit" : n === container.initializer || n === container.condition || n === container.incrementor || n === container.statement; });
         }
+        function getEnclosingIterationStatement(node) {
+            return ts.findAncestor(node, function (n) { return (!n || ts.nodeStartsNewLexicalEnvironment(n)) ? "quit" : ts.isIterationStatement(n, /*lookInLabeledStatements*/ false); });
+        }
         function checkNestedBlockScopedBinding(node, symbol) {
             if (languageVersion >= 2 /* ES2015 */ ||
                 (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 ||
+                !symbol.valueDeclaration ||
                 ts.isSourceFile(symbol.valueDeclaration) ||
-                symbol.valueDeclaration.parent.kind === 287 /* CatchClause */) {
+                symbol.valueDeclaration.parent.kind === 291 /* CatchClause */) {
                 return;
             }
             // 1. walk from the use site up to the declaration and check
@@ -65214,22 +69658,14 @@ var ts;
             // 2. walk from the declaration up to the boundary of lexical environment and check
             // if there is an iteration statement in between declaration and boundary (is binding/class declared inside iteration statement)
             var container = ts.getEnclosingBlockScopeContainer(symbol.valueDeclaration);
-            var usedInFunction = isInsideFunction(node.parent, container);
-            var current = container;
-            var containedInIterationStatement = false;
-            while (current && !ts.nodeStartsNewLexicalEnvironment(current)) {
-                if (ts.isIterationStatement(current, /*lookInLabeledStatements*/ false)) {
-                    containedInIterationStatement = true;
-                    break;
-                }
-                current = current.parent;
-            }
-            if (containedInIterationStatement) {
-                if (usedInFunction) {
+            var isCaptured = isInsideFunctionOrInstancePropertyInitializer(node, container);
+            var enclosingIterationStatement = getEnclosingIterationStatement(container);
+            if (enclosingIterationStatement) {
+                if (isCaptured) {
                     // mark iteration statement as containing block-scoped binding captured in some function
                     var capturesBlockScopeBindingInLoopBody = true;
                     if (ts.isForStatement(container)) {
-                        var varDeclList = ts.getAncestor(symbol.valueDeclaration, 250 /* VariableDeclarationList */);
+                        var varDeclList = ts.getAncestor(symbol.valueDeclaration, 254 /* VariableDeclarationList */);
                         if (varDeclList && varDeclList.parent === container) {
                             var part = getPartOfForStatementContainingNode(node.parent, container);
                             if (part) {
@@ -65244,13 +69680,13 @@ var ts;
                         }
                     }
                     if (capturesBlockScopeBindingInLoopBody) {
-                        getNodeLinks(current).flags |= 65536 /* LoopWithCapturedBlockScopedBinding */;
+                        getNodeLinks(enclosingIterationStatement).flags |= 65536 /* LoopWithCapturedBlockScopedBinding */;
                     }
                 }
                 // mark variables that are declared in loop initializer and reassigned inside the body of ForStatement.
                 // if body of ForStatement will be converted to function then we'll need a extra machinery to propagate reassigned values back.
                 if (ts.isForStatement(container)) {
-                    var varDeclList = ts.getAncestor(symbol.valueDeclaration, 250 /* VariableDeclarationList */);
+                    var varDeclList = ts.getAncestor(symbol.valueDeclaration, 254 /* VariableDeclarationList */);
                     if (varDeclList && varDeclList.parent === container && isAssignedInBodyOfForStatement(node, container)) {
                         getNodeLinks(symbol.valueDeclaration).flags |= 4194304 /* NeedsLoopOutParameter */;
                     }
@@ -65258,7 +69694,7 @@ var ts;
                 // set 'declared inside loop' bit on the block-scoped binding
                 getNodeLinks(symbol.valueDeclaration).flags |= 524288 /* BlockScopedBindingInLoop */;
             }
-            if (usedInFunction) {
+            if (isCaptured) {
                 getNodeLinks(symbol.valueDeclaration).flags |= 262144 /* CapturedBlockScopedBinding */;
             }
         }
@@ -65269,7 +69705,7 @@ var ts;
         function isAssignedInBodyOfForStatement(node, container) {
             // skip parenthesized nodes
             var current = node;
-            while (current.parent.kind === 207 /* ParenthesizedExpression */) {
+            while (current.parent.kind === 211 /* ParenthesizedExpression */) {
                 current = current.parent;
             }
             // check if node is used as LHS in some assignment expression
@@ -65277,7 +69713,7 @@ var ts;
             if (ts.isAssignmentTarget(current)) {
                 isAssigned = true;
             }
-            else if ((current.parent.kind === 214 /* PrefixUnaryExpression */ || current.parent.kind === 215 /* PostfixUnaryExpression */)) {
+            else if ((current.parent.kind === 218 /* PrefixUnaryExpression */ || current.parent.kind === 219 /* PostfixUnaryExpression */)) {
                 var expr = current.parent;
                 isAssigned = expr.operator === 45 /* PlusPlusToken */ || expr.operator === 46 /* MinusMinusToken */;
             }
@@ -65290,7 +69726,7 @@ var ts;
         }
         function captureLexicalThis(node, container) {
             getNodeLinks(node).flags |= 2 /* LexicalThis */;
-            if (container.kind === 163 /* PropertyDeclaration */ || container.kind === 166 /* Constructor */) {
+            if (container.kind === 166 /* PropertyDeclaration */ || container.kind === 170 /* Constructor */) {
                 var classNode = container.parent;
                 getNodeLinks(classNode).flags |= 4 /* CaptureThis */;
             }
@@ -65325,47 +69761,48 @@ var ts;
                 }
             }
         }
+        function checkThisInStaticClassFieldInitializerInDecoratedClass(thisExpression, container) {
+            if (ts.isPropertyDeclaration(container) && ts.hasStaticModifier(container) &&
+                container.initializer && ts.textRangeContainsPositionInclusive(container.initializer, thisExpression.pos) && ts.length(container.parent.decorators)) {
+                error(thisExpression, ts.Diagnostics.Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class);
+            }
+        }
         function checkThisExpression(node) {
+            var isNodeInTypeQuery = isInTypeQuery(node);
             // Stop at the first arrow function so that we can
             // tell whether 'this' needs to be captured.
             var container = ts.getThisContainer(node, /* includeArrowFunctions */ true);
             var capturedByArrowFunction = false;
-            if (container.kind === 166 /* Constructor */) {
+            if (container.kind === 170 /* Constructor */) {
                 checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class);
             }
             // Now skip arrow functions to get the "real" owner of 'this'.
-            if (container.kind === 209 /* ArrowFunction */) {
+            if (container.kind === 213 /* ArrowFunction */) {
                 container = ts.getThisContainer(container, /* includeArrowFunctions */ false);
                 capturedByArrowFunction = true;
             }
+            checkThisInStaticClassFieldInitializerInDecoratedClass(node, container);
             switch (container.kind) {
-                case 256 /* ModuleDeclaration */:
+                case 260 /* ModuleDeclaration */:
                     error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body);
                     // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks
                     break;
-                case 255 /* EnumDeclaration */:
+                case 259 /* EnumDeclaration */:
                     error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location);
                     // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks
                     break;
-                case 166 /* Constructor */:
+                case 170 /* Constructor */:
                     if (isInConstructorArgumentInitializer(node, container)) {
                         error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments);
                         // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks
                     }
                     break;
-                case 163 /* PropertyDeclaration */:
-                case 162 /* PropertySignature */:
-                    if (ts.hasSyntacticModifier(container, 32 /* Static */) && !(compilerOptions.target === 99 /* ESNext */ && compilerOptions.useDefineForClassFields)) {
-                        error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer);
-                        // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks
-                    }
-                    break;
-                case 158 /* ComputedPropertyName */:
+                case 161 /* ComputedPropertyName */:
                     error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name);
                     break;
             }
             // When targeting es6, mark that we'll need to capture `this` in its lexically bound scope.
-            if (capturedByArrowFunction && languageVersion < 2 /* ES2015 */) {
+            if (!isNodeInTypeQuery && capturedByArrowFunction && languageVersion < 2 /* ES2015 */) {
                 captureLexicalThis(node, container);
             }
             var type = tryGetThisTypeAt(node, /*includeGlobalThis*/ true, container);
@@ -65415,7 +69852,7 @@ var ts;
             }
             if (ts.isClassLike(container.parent)) {
                 var symbol = getSymbolOfNode(container.parent);
-                var type = ts.hasSyntacticModifier(container, 32 /* Static */) ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol).thisType;
+                var type = ts.isStatic(container) ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol).thisType;
                 return getFlowTypeOfReference(node, type);
             }
             if (ts.isSourceFile(container)) {
@@ -65443,12 +69880,12 @@ var ts;
             }
             if (ts.isClassLike(container.parent)) {
                 var symbol = getSymbolOfNode(container.parent);
-                return ts.hasSyntacticModifier(container, 32 /* Static */) ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol).thisType;
+                return ts.isStatic(container) ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol).thisType;
             }
         }
         function getClassNameFromPrototypeMethod(container) {
             // Check if it's the RHS of a x.prototype.y = function [name]() { .... }
-            if (container.kind === 208 /* FunctionExpression */ &&
+            if (container.kind === 212 /* FunctionExpression */ &&
                 ts.isBinaryExpression(container.parent) &&
                 ts.getAssignmentDeclarationKind(container.parent) === 3 /* PrototypeProperty */) {
                 // Get the 'x' of 'x.prototype.y = container'
@@ -65458,16 +69895,16 @@ var ts;
                     .expression; // x
             }
             // x.prototype = { method() { } }
-            else if (container.kind === 165 /* MethodDeclaration */ &&
-                container.parent.kind === 200 /* ObjectLiteralExpression */ &&
+            else if (container.kind === 168 /* MethodDeclaration */ &&
+                container.parent.kind === 204 /* ObjectLiteralExpression */ &&
                 ts.isBinaryExpression(container.parent.parent) &&
                 ts.getAssignmentDeclarationKind(container.parent.parent) === 6 /* Prototype */) {
                 return container.parent.parent.left.expression;
             }
             // x.prototype = { method: function() { } }
-            else if (container.kind === 208 /* FunctionExpression */ &&
-                container.parent.kind === 288 /* PropertyAssignment */ &&
-                container.parent.parent.kind === 200 /* ObjectLiteralExpression */ &&
+            else if (container.kind === 212 /* FunctionExpression */ &&
+                container.parent.kind === 294 /* PropertyAssignment */ &&
+                container.parent.parent.kind === 204 /* ObjectLiteralExpression */ &&
                 ts.isBinaryExpression(container.parent.parent.parent) &&
                 ts.getAssignmentDeclarationKind(container.parent.parent.parent) === 6 /* Prototype */) {
                 return container.parent.parent.parent.left.expression;
@@ -65475,7 +69912,7 @@ var ts;
             // Object.defineProperty(x, "method", { value: function() { } });
             // Object.defineProperty(x, "method", { set: (x: () => void) => void });
             // Object.defineProperty(x, "method", { get: () => function() { }) });
-            else if (container.kind === 208 /* FunctionExpression */ &&
+            else if (container.kind === 212 /* FunctionExpression */ &&
                 ts.isPropertyAssignment(container.parent) &&
                 ts.isIdentifier(container.parent.name) &&
                 (container.parent.name.escapedText === "value" || container.parent.name.escapedText === "get" || container.parent.name.escapedText === "set") &&
@@ -65500,7 +69937,7 @@ var ts;
         }
         function getTypeForThisExpressionFromJSDoc(node) {
             var jsdocType = ts.getJSDocType(node);
-            if (jsdocType && jsdocType.kind === 308 /* JSDocFunctionType */) {
+            if (jsdocType && jsdocType.kind === 315 /* JSDocFunctionType */) {
                 var jsDocFunctionType = jsdocType;
                 if (jsDocFunctionType.parameters.length > 0 &&
                     jsDocFunctionType.parameters[0].name &&
@@ -65514,16 +69951,16 @@ var ts;
             }
         }
         function isInConstructorArgumentInitializer(node, constructorDecl) {
-            return !!ts.findAncestor(node, function (n) { return ts.isFunctionLikeDeclaration(n) ? "quit" : n.kind === 160 /* Parameter */ && n.parent === constructorDecl; });
+            return !!ts.findAncestor(node, function (n) { return ts.isFunctionLikeDeclaration(n) ? "quit" : n.kind === 163 /* Parameter */ && n.parent === constructorDecl; });
         }
         function checkSuperExpression(node) {
-            var isCallExpression = node.parent.kind === 203 /* CallExpression */ && node.parent.expression === node;
+            var isCallExpression = node.parent.kind === 207 /* CallExpression */ && node.parent.expression === node;
             var immediateContainer = ts.getSuperContainer(node, /*stopOnFunctions*/ true);
             var container = immediateContainer;
             var needToCaptureLexicalThis = false;
             // adjust the container reference in case if super is used inside arrow functions with arbitrarily deep nesting
             if (!isCallExpression) {
-                while (container && container.kind === 209 /* ArrowFunction */) {
+                while (container && container.kind === 213 /* ArrowFunction */) {
                     container = ts.getSuperContainer(container, /*stopOnFunctions*/ true);
                     needToCaptureLexicalThis = languageVersion < 2 /* ES2015 */;
                 }
@@ -65536,14 +69973,14 @@ var ts;
                 // class B {
                 //     [super.foo()]() {}
                 // }
-                var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 158 /* ComputedPropertyName */; });
-                if (current && current.kind === 158 /* ComputedPropertyName */) {
+                var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 161 /* ComputedPropertyName */; });
+                if (current && current.kind === 161 /* ComputedPropertyName */) {
                     error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name);
                 }
                 else if (isCallExpression) {
                     error(node, ts.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors);
                 }
-                else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 200 /* ObjectLiteralExpression */)) {
+                else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 204 /* ObjectLiteralExpression */)) {
                     error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions);
                 }
                 else {
@@ -65551,11 +69988,23 @@ var ts;
                 }
                 return errorType;
             }
-            if (!isCallExpression && immediateContainer.kind === 166 /* Constructor */) {
+            if (!isCallExpression && immediateContainer.kind === 170 /* Constructor */) {
                 checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class);
             }
-            if (ts.hasSyntacticModifier(container, 32 /* Static */) || isCallExpression) {
+            if (ts.isStatic(container) || isCallExpression) {
                 nodeCheckFlag = 512 /* SuperStatic */;
+                if (!isCallExpression &&
+                    languageVersion >= 2 /* ES2015 */ && languageVersion <= 8 /* ES2021 */ &&
+                    (ts.isPropertyDeclaration(container) || ts.isClassStaticBlockDeclaration(container))) {
+                    // for `super.x` or `super[x]` in a static initializer, mark all enclosing
+                    // block scope containers so that we can report potential collisions with
+                    // `Reflect`.
+                    ts.forEachEnclosingBlockScopeContainer(node.parent, function (current) {
+                        if (!ts.isSourceFile(current) || ts.isExternalOrCommonJsModule(current)) {
+                            getNodeLinks(current).flags |= 134217728 /* ContainsSuperPropertyInStaticInitializer */;
+                        }
+                    });
+                }
             }
             else {
                 nodeCheckFlag = 256 /* SuperInstance */;
@@ -65620,7 +70069,7 @@ var ts;
             // as a call expression cannot be used as the target of a destructuring assignment while a property access can.
             //
             // For element access expressions (`super[x]`), we emit a generic helper that forwards the element access in both situations.
-            if (container.kind === 165 /* MethodDeclaration */ && ts.hasSyntacticModifier(container, 256 /* Async */)) {
+            if (container.kind === 168 /* MethodDeclaration */ && ts.hasSyntacticModifier(container, 256 /* Async */)) {
                 if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) {
                     getNodeLinks(container).flags |= 4096 /* AsyncMethodWithSuperBinding */;
                 }
@@ -65634,7 +70083,7 @@ var ts;
                 // in this case they should also use correct lexical this
                 captureLexicalThis(node.parent, container);
             }
-            if (container.parent.kind === 200 /* ObjectLiteralExpression */) {
+            if (container.parent.kind === 204 /* ObjectLiteralExpression */) {
                 if (languageVersion < 2 /* ES2015 */) {
                     error(node, ts.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher);
                     return errorType;
@@ -65655,7 +70104,7 @@ var ts;
             if (!baseClassType) {
                 return errorType;
             }
-            if (container.kind === 166 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) {
+            if (container.kind === 170 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) {
                 // issue custom error message for super property access in constructor arguments (to be aligned with old compiler)
                 error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments);
                 return errorType;
@@ -65670,7 +70119,7 @@ var ts;
                 if (isCallExpression) {
                     // TS 1.0 SPEC (April 2014): 4.8.1
                     // Super calls are only permitted in constructors of derived classes
-                    return container.kind === 166 /* Constructor */;
+                    return container.kind === 170 /* Constructor */;
                 }
                 else {
                     // TS 1.0 SPEC (April 2014)
@@ -65678,21 +70127,23 @@ var ts;
                     // - In a constructor, instance member function, instance member accessor, or instance member variable initializer where this references a derived class instance
                     // - In a static member function or static member accessor
                     // topmost container must be something that is directly nested in the class declaration\object literal expression
-                    if (ts.isClassLike(container.parent) || container.parent.kind === 200 /* ObjectLiteralExpression */) {
-                        if (ts.hasSyntacticModifier(container, 32 /* Static */)) {
-                            return container.kind === 165 /* MethodDeclaration */ ||
-                                container.kind === 164 /* MethodSignature */ ||
-                                container.kind === 167 /* GetAccessor */ ||
-                                container.kind === 168 /* SetAccessor */;
+                    if (ts.isClassLike(container.parent) || container.parent.kind === 204 /* ObjectLiteralExpression */) {
+                        if (ts.isStatic(container)) {
+                            return container.kind === 168 /* MethodDeclaration */ ||
+                                container.kind === 167 /* MethodSignature */ ||
+                                container.kind === 171 /* GetAccessor */ ||
+                                container.kind === 172 /* SetAccessor */ ||
+                                container.kind === 166 /* PropertyDeclaration */ ||
+                                container.kind === 169 /* ClassStaticBlockDeclaration */;
                         }
                         else {
-                            return container.kind === 165 /* MethodDeclaration */ ||
-                                container.kind === 164 /* MethodSignature */ ||
-                                container.kind === 167 /* GetAccessor */ ||
-                                container.kind === 168 /* SetAccessor */ ||
-                                container.kind === 163 /* PropertyDeclaration */ ||
-                                container.kind === 162 /* PropertySignature */ ||
-                                container.kind === 166 /* Constructor */;
+                            return container.kind === 168 /* MethodDeclaration */ ||
+                                container.kind === 167 /* MethodSignature */ ||
+                                container.kind === 171 /* GetAccessor */ ||
+                                container.kind === 172 /* SetAccessor */ ||
+                                container.kind === 166 /* PropertyDeclaration */ ||
+                                container.kind === 165 /* PropertySignature */ ||
+                                container.kind === 170 /* Constructor */;
                         }
                     }
                 }
@@ -65700,10 +70151,10 @@ var ts;
             }
         }
         function getContainingObjectLiteral(func) {
-            return (func.kind === 165 /* MethodDeclaration */ ||
-                func.kind === 167 /* GetAccessor */ ||
-                func.kind === 168 /* SetAccessor */) && func.parent.kind === 200 /* ObjectLiteralExpression */ ? func.parent :
-                func.kind === 208 /* FunctionExpression */ && func.parent.kind === 288 /* PropertyAssignment */ ? func.parent.parent :
+            return (func.kind === 168 /* MethodDeclaration */ ||
+                func.kind === 171 /* GetAccessor */ ||
+                func.kind === 172 /* SetAccessor */) && func.parent.kind === 204 /* ObjectLiteralExpression */ ? func.parent :
+                func.kind === 212 /* FunctionExpression */ && func.parent.kind === 294 /* PropertyAssignment */ ? func.parent.parent :
                     undefined;
         }
         function getThisTypeArgument(type) {
@@ -65715,7 +70166,7 @@ var ts;
             });
         }
         function getContextualThisParameterType(func) {
-            if (func.kind === 209 /* ArrowFunction */) {
+            if (func.kind === 213 /* ArrowFunction */) {
                 return undefined;
             }
             if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) {
@@ -65742,7 +70193,7 @@ var ts;
                         if (thisType) {
                             return instantiateType(thisType, getMapperFromContext(getInferenceContext(containingLiteral)));
                         }
-                        if (literal.parent.kind !== 288 /* PropertyAssignment */) {
+                        if (literal.parent.kind !== 294 /* PropertyAssignment */) {
                             break;
                         }
                         literal = literal.parent.parent;
@@ -65756,7 +70207,7 @@ var ts;
                 // In an assignment of the form 'obj.xxx = function(...)' or 'obj[xxx] = function(...)', the
                 // contextual type for 'this' is 'obj'.
                 var parent = ts.walkUpParenthesizedExpressions(func.parent);
-                if (parent.kind === 216 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */) {
+                if (parent.kind === 220 /* BinaryExpression */ && parent.operatorToken.kind === 63 /* EqualsToken */) {
                     var target = parent.left;
                     if (ts.isAccessExpression(target)) {
                         var expression = target.expression;
@@ -65809,12 +70260,12 @@ var ts;
                 return getTypeFromTypeNode(typeNode);
             }
             switch (declaration.kind) {
-                case 160 /* Parameter */:
+                case 163 /* Parameter */:
                     return getContextuallyTypedParameterType(declaration);
-                case 198 /* BindingElement */:
+                case 202 /* BindingElement */:
                     return getContextualTypeForBindingElement(declaration);
-                case 163 /* PropertyDeclaration */:
-                    if (ts.hasSyntacticModifier(declaration, 32 /* Static */)) {
+                case 166 /* PropertyDeclaration */:
+                    if (ts.isStatic(declaration)) {
                         return getContextualTypeForStaticPropertyDeclaration(declaration);
                     }
                 // By default, do nothing and return undefined - only the above cases have context implied by a parent
@@ -65824,10 +70275,10 @@ var ts;
             var parent = declaration.parent.parent;
             var name = declaration.propertyName || declaration.name;
             var parentType = getContextualTypeForVariableLikeDeclaration(parent) ||
-                parent.kind !== 198 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent);
+                parent.kind !== 202 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent);
             if (!parentType || ts.isBindingPattern(name) || ts.isComputedNonLiteralName(name))
                 return undefined;
-            if (parent.name.kind === 197 /* ArrayBindingPattern */) {
+            if (parent.name.kind === 201 /* ArrayBindingPattern */) {
                 var index = ts.indexOfNode(declaration.parent.elements, declaration);
                 if (index < 0)
                     return undefined;
@@ -65882,7 +70333,8 @@ var ts;
                         // falls through to unwrap Promise for AsyncGenerators
                     }
                     if (functionFlags & 2 /* Async */) { // Async function or AsyncGenerator function
-                        var contextualAwaitedType = mapType(contextualReturnType, getAwaitedType);
+                        // Get the awaited type without the `Awaited<T>` alias
+                        var contextualAwaitedType = mapType(contextualReturnType, getAwaitedTypeNoAlias);
                         return contextualAwaitedType && getUnionType([contextualAwaitedType, createPromiseLikeType(contextualAwaitedType)]);
                     }
                     return contextualReturnType; // Regular function or Generator function
@@ -65893,7 +70345,7 @@ var ts;
         function getContextualTypeForAwaitOperand(node, contextFlags) {
             var contextualType = getContextualType(node, contextFlags);
             if (contextualType) {
-                var contextualAwaitedType = getAwaitedType(contextualType);
+                var contextualAwaitedType = getAwaitedTypeNoAlias(contextualType);
                 return contextualAwaitedType && getUnionType([contextualAwaitedType, createPromiseLikeType(contextualAwaitedType)]);
             }
             return undefined;
@@ -65946,6 +70398,10 @@ var ts;
             if (signature && !isResolvingReturnTypeOfSignature(signature)) {
                 return getReturnTypeOfSignature(signature);
             }
+            var iife = ts.getImmediatelyInvokedFunctionExpression(functionDecl);
+            if (iife) {
+                return getContextualType(iife);
+            }
             return undefined;
         }
         // In a typed function call, an argument or substitution expression is contextually typed by the type of the corresponding parameter.
@@ -65955,16 +70411,24 @@ var ts;
             return argIndex === -1 ? undefined : getContextualTypeForArgumentAtIndex(callTarget, argIndex);
         }
         function getContextualTypeForArgumentAtIndex(callTarget, argIndex) {
+            if (ts.isImportCall(callTarget)) {
+                return argIndex === 0 ? stringType :
+                    argIndex === 1 ? getGlobalImportCallOptionsType(/*reportErrors*/ false) :
+                        anyType;
+            }
             // If we're already in the process of resolving the given signature, don't resolve again as
             // that could cause infinite recursion. Instead, return anySignature.
             var signature = getNodeLinks(callTarget).resolvedSignature === resolvingSignature ? resolvingSignature : getResolvedSignature(callTarget);
             if (ts.isJsxOpeningLikeElement(callTarget) && argIndex === 0) {
                 return getEffectiveFirstArgumentForJsxSignature(signature, callTarget);
             }
-            return getTypeAtPosition(signature, argIndex);
+            var restIndex = signature.parameters.length - 1;
+            return signatureHasRestParameter(signature) && argIndex >= restIndex ?
+                getIndexedAccessType(getTypeOfSymbol(signature.parameters[restIndex]), getNumberLiteralType(argIndex - restIndex), 256 /* Contextual */) :
+                getTypeAtPosition(signature, argIndex);
         }
         function getContextualTypeForSubstitutionExpression(template, substitutionExpression) {
-            if (template.parent.kind === 205 /* TaggedTemplateExpression */) {
+            if (template.parent.kind === 209 /* TaggedTemplateExpression */) {
                 return getContextualTypeForArgument(template.parent, substitutionExpression);
             }
             return undefined;
@@ -65973,10 +70437,10 @@ var ts;
             var binaryExpression = node.parent;
             var left = binaryExpression.left, operatorToken = binaryExpression.operatorToken, right = binaryExpression.right;
             switch (operatorToken.kind) {
-                case 62 /* EqualsToken */:
-                case 75 /* AmpersandAmpersandEqualsToken */:
-                case 74 /* BarBarEqualsToken */:
-                case 76 /* QuestionQuestionEqualsToken */:
+                case 63 /* EqualsToken */:
+                case 76 /* AmpersandAmpersandEqualsToken */:
+                case 75 /* BarBarEqualsToken */:
+                case 77 /* QuestionQuestionEqualsToken */:
                     return node === right ? getContextualTypeForAssignmentDeclaration(binaryExpression) : undefined;
                 case 56 /* BarBarToken */:
                 case 60 /* QuestionQuestionToken */:
@@ -65995,19 +70459,51 @@ var ts;
                     return undefined;
             }
         }
+        /**
+         * Try to find a resolved symbol for an expression without also resolving its type, as
+         * getSymbolAtLocation would (as that could be reentrant into contextual typing)
+         */
+        function getSymbolForExpression(e) {
+            if (e.symbol) {
+                return e.symbol;
+            }
+            if (ts.isIdentifier(e)) {
+                return getResolvedSymbol(e);
+            }
+            if (ts.isPropertyAccessExpression(e)) {
+                var lhsType = getTypeOfExpression(e.expression);
+                return ts.isPrivateIdentifier(e.name) ? tryGetPrivateIdentifierPropertyOfType(lhsType, e.name) : getPropertyOfType(lhsType, e.name.escapedText);
+            }
+            return undefined;
+            function tryGetPrivateIdentifierPropertyOfType(type, id) {
+                var lexicallyScopedSymbol = lookupSymbolForPrivateIdentifierDeclaration(id.escapedText, id);
+                return lexicallyScopedSymbol && getPrivateIdentifierPropertyOfType(type, lexicallyScopedSymbol);
+            }
+        }
         // In an assignment expression, the right operand is contextually typed by the type of the left operand.
         // Don't do this for assignment declarations unless there is a type tag on the assignment, to avoid circularity from checking the right operand.
         function getContextualTypeForAssignmentDeclaration(binaryExpression) {
+            var _a, _b;
             var kind = ts.getAssignmentDeclarationKind(binaryExpression);
             switch (kind) {
                 case 0 /* None */:
-                    return getTypeOfExpression(binaryExpression.left);
+                case 4 /* ThisProperty */:
+                    var lhsSymbol = getSymbolForExpression(binaryExpression.left);
+                    var decl = lhsSymbol && lhsSymbol.valueDeclaration;
+                    // Unannotated, uninitialized property declarations have a type implied by their usage in the constructor.
+                    // We avoid calling back into `getTypeOfExpression` and reentering contextual typing to avoid a bogus circularity error in that case.
+                    if (decl && (ts.isPropertyDeclaration(decl) || ts.isPropertySignature(decl))) {
+                        var overallAnnotation = ts.getEffectiveTypeAnnotationNode(decl);
+                        return (overallAnnotation && instantiateType(getTypeFromTypeNode(overallAnnotation), getSymbolLinks(lhsSymbol).mapper)) ||
+                            (decl.initializer && getTypeOfExpression(binaryExpression.left));
+                    }
+                    if (kind === 0 /* None */) {
+                        return getTypeOfExpression(binaryExpression.left);
+                    }
+                    return getContextualTypeForThisPropertyAssignment(binaryExpression);
                 case 5 /* Property */:
-                case 1 /* ExportsProperty */:
-                case 6 /* Prototype */:
-                case 3 /* PrototypeProperty */:
                     if (isPossiblyAliasedThisProperty(binaryExpression, kind)) {
-                        return getContextualTypeForThisPropertyAssignment(binaryExpression, kind);
+                        return getContextualTypeForThisPropertyAssignment(binaryExpression);
                     }
                     // If `binaryExpression.left` was assigned a symbol, then this is a new declaration; otherwise it is an assignment to an existing declaration.
                     // See `bindStaticPropertyAssignment` in `binder.ts`.
@@ -66015,12 +70511,12 @@ var ts;
                         return getTypeOfExpression(binaryExpression.left);
                     }
                     else {
-                        var decl = binaryExpression.left.symbol.valueDeclaration;
-                        if (!decl) {
+                        var decl_1 = binaryExpression.left.symbol.valueDeclaration;
+                        if (!decl_1) {
                             return undefined;
                         }
                         var lhs = ts.cast(binaryExpression.left, ts.isAccessExpression);
-                        var overallAnnotation = ts.getEffectiveTypeAnnotationNode(decl);
+                        var overallAnnotation = ts.getEffectiveTypeAnnotationNode(decl_1);
                         if (overallAnnotation) {
                             return getTypeFromTypeNode(overallAnnotation);
                         }
@@ -66028,21 +70524,27 @@ var ts;
                             var id = lhs.expression;
                             var parentSymbol = resolveName(id, id.escapedText, 111551 /* Value */, undefined, id.escapedText, /*isUse*/ true);
                             if (parentSymbol) {
-                                var annotated = parentSymbol.valueDeclaration && ts.getEffectiveTypeAnnotationNode(parentSymbol.valueDeclaration);
-                                if (annotated) {
+                                var annotated_1 = parentSymbol.valueDeclaration && ts.getEffectiveTypeAnnotationNode(parentSymbol.valueDeclaration);
+                                if (annotated_1) {
                                     var nameStr = ts.getElementOrPropertyAccessName(lhs);
                                     if (nameStr !== undefined) {
-                                        return getTypeOfPropertyOfContextualType(getTypeFromTypeNode(annotated), nameStr);
+                                        return getTypeOfPropertyOfContextualType(getTypeFromTypeNode(annotated_1), nameStr);
                                     }
                                 }
                                 return undefined;
                             }
                         }
-                        return ts.isInJSFile(decl) ? undefined : getTypeOfExpression(binaryExpression.left);
+                        return ts.isInJSFile(decl_1) ? undefined : getTypeOfExpression(binaryExpression.left);
                     }
+                case 1 /* ExportsProperty */:
+                case 6 /* Prototype */:
+                case 3 /* PrototypeProperty */:
+                    var valueDeclaration = (_a = binaryExpression.left.symbol) === null || _a === void 0 ? void 0 : _a.valueDeclaration;
+                // falls through
                 case 2 /* ModuleExports */:
-                case 4 /* ThisProperty */:
-                    return getContextualTypeForThisPropertyAssignment(binaryExpression, kind);
+                    valueDeclaration || (valueDeclaration = (_b = binaryExpression.symbol) === null || _b === void 0 ? void 0 : _b.valueDeclaration);
+                    var annotated = valueDeclaration && ts.getEffectiveTypeAnnotationNode(valueDeclaration);
+                    return annotated ? getTypeFromTypeNode(annotated) : undefined;
                 case 7 /* ObjectDefinePropertyValue */:
                 case 8 /* ObjectDefinePropertyExports */:
                 case 9 /* ObjectDefinePrototypeProperty */:
@@ -66063,7 +70565,7 @@ var ts;
             var symbol = resolveName(declaration.left, name, 111551 /* Value */, undefined, undefined, /*isUse*/ true, /*excludeGlobals*/ true);
             return ts.isThisInitializedDeclaration(symbol === null || symbol === void 0 ? void 0 : symbol.valueDeclaration);
         }
-        function getContextualTypeForThisPropertyAssignment(binaryExpression, kind) {
+        function getContextualTypeForThisPropertyAssignment(binaryExpression) {
             if (!binaryExpression.symbol)
                 return getTypeOfExpression(binaryExpression.left);
             if (binaryExpression.symbol.valueDeclaration) {
@@ -66075,8 +70577,6 @@ var ts;
                     }
                 }
             }
-            if (kind === 2 /* ModuleExports */)
-                return undefined;
             var thisAccess = ts.cast(binaryExpression.left, ts.isAccessExpression);
             if (!ts.isObjectLiteralMethod(ts.getThisContainer(thisAccess.expression, /*includeArrowFunctions*/ false))) {
                 return undefined;
@@ -66090,10 +70590,11 @@ var ts;
         }
         function getTypeOfPropertyOfContextualType(type, name) {
             return mapType(type, function (t) {
+                var _a;
                 if (isGenericMappedType(t)) {
                     var constraint = getConstraintTypeFromMappedType(t);
                     var constraintOfConstraint = getBaseConstraintOfType(constraint) || constraint;
-                    var propertyNameType = getLiteralType(ts.unescapeLeadingUnderscores(name));
+                    var propertyNameType = getStringLiteralType(ts.unescapeLeadingUnderscores(name));
                     if (isTypeAssignableTo(propertyNameType, constraintOfConstraint)) {
                         return substituteIndexedMappedType(t, propertyNameType);
                     }
@@ -66109,15 +70610,11 @@ var ts;
                             return restType;
                         }
                     }
-                    return isNumericLiteralName(name) && getIndexTypeOfContextualType(t, 1 /* Number */) ||
-                        getIndexTypeOfContextualType(t, 0 /* String */);
+                    return (_a = findApplicableIndexInfo(getIndexInfosOfStructuredType(t), getStringLiteralType(ts.unescapeLeadingUnderscores(name)))) === null || _a === void 0 ? void 0 : _a.type;
                 }
                 return undefined;
             }, /*noReductions*/ true);
         }
-        function getIndexTypeOfContextualType(type, kind) {
-            return mapType(type, function (t) { return getIndexTypeOfStructuredType(t, kind); }, /*noReductions*/ true);
-        }
         // In an object literal contextually typed by a type T, the contextual type of a property assignment is the type of
         // the matching property in T, if one exists. Otherwise, it is the type of the numeric index signature in T, if one
         // exists. Otherwise, it is the type of the string index signature in T, if one exists.
@@ -66131,20 +70628,23 @@ var ts;
         }
         function getContextualTypeForObjectLiteralElement(element, contextFlags) {
             var objectLiteral = element.parent;
+            var propertyAssignmentType = ts.isPropertyAssignment(element) && getContextualTypeForVariableLikeDeclaration(element);
+            if (propertyAssignmentType) {
+                return propertyAssignmentType;
+            }
             var type = getApparentTypeOfContextualType(objectLiteral, contextFlags);
             if (type) {
                 if (hasBindableName(element)) {
                     // For a (non-symbol) computed property, there is no reason to look up the name
                     // in the type. It will just be "__computed", which does not appear in any
                     // SymbolTable.
-                    var symbolName_3 = getSymbolOfNode(element).escapedName;
-                    var propertyType = getTypeOfPropertyOfContextualType(type, symbolName_3);
-                    if (propertyType) {
-                        return propertyType;
-                    }
+                    return getTypeOfPropertyOfContextualType(type, getSymbolOfNode(element).escapedName);
+                }
+                if (element.name) {
+                    var nameType_2 = getLiteralTypeFromPropertyName(element.name);
+                    // We avoid calling getApplicableIndexInfo here because it performs potentially expensive intersection reduction.
+                    return mapType(type, function (t) { var _a; return (_a = findApplicableIndexInfo(getIndexInfosOfStructuredType(t), nameType_2)) === null || _a === void 0 ? void 0 : _a.type; }, /*noReductions*/ true);
                 }
-                return isNumericName(element.name) && getIndexTypeOfContextualType(type, 1 /* Number */) ||
-                    getIndexTypeOfContextualType(type, 0 /* String */);
             }
             return undefined;
         }
@@ -66174,7 +70674,7 @@ var ts;
             var childFieldType = getTypeOfPropertyOfContextualType(attributesType, jsxChildrenPropertyName);
             return childFieldType && (realChildren.length === 1 ? childFieldType : mapType(childFieldType, function (t) {
                 if (isArrayLikeType(t)) {
-                    return getIndexedAccessType(t, getLiteralType(childIndex));
+                    return getIndexedAccessType(t, getNumberLiteralType(childIndex));
                 }
                 else {
                     return t;
@@ -66213,25 +70713,25 @@ var ts;
                 case 8 /* NumericLiteral */:
                 case 9 /* BigIntLiteral */:
                 case 14 /* NoSubstitutionTemplateLiteral */:
-                case 109 /* TrueKeyword */:
-                case 94 /* FalseKeyword */:
-                case 103 /* NullKeyword */:
-                case 78 /* Identifier */:
-                case 150 /* UndefinedKeyword */:
+                case 110 /* TrueKeyword */:
+                case 95 /* FalseKeyword */:
+                case 104 /* NullKeyword */:
+                case 79 /* Identifier */:
+                case 152 /* UndefinedKeyword */:
                     return true;
-                case 201 /* PropertyAccessExpression */:
-                case 207 /* ParenthesizedExpression */:
+                case 205 /* PropertyAccessExpression */:
+                case 211 /* ParenthesizedExpression */:
                     return isPossiblyDiscriminantValue(node.expression);
-                case 283 /* JsxExpression */:
+                case 287 /* JsxExpression */:
                     return !node.expression || isPossiblyDiscriminantValue(node.expression);
             }
             return false;
         }
         function discriminateContextualTypeByObjectMembers(node, contextualType) {
-            return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 288 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return checkExpression(prop.initializer); }, prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType);
+            return getMatchingUnionConstituentForObjectLiteral(contextualType, node) || discriminateTypeByDiscriminableItems(contextualType, ts.concatenate(ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 294 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return getContextFreeTypeOfExpression(prop.initializer); }, prop.symbol.escapedName]; }), ts.map(ts.filter(getPropertiesOfType(contextualType), function (s) { var _a; return !!(s.flags & 16777216 /* Optional */) && !!((_a = node === null || node === void 0 ? void 0 : node.symbol) === null || _a === void 0 ? void 0 : _a.members) && !node.symbol.members.has(s.escapedName) && isDiscriminantProperty(contextualType, s.escapedName); }), function (s) { return [function () { return undefinedType; }, s.escapedName]; })), isTypeAssignableTo, contextualType);
         }
         function discriminateContextualTypeByJSXAttributes(node, contextualType) {
-            return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 280 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return checkExpression(prop.initializer); }), prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType);
+            return discriminateTypeByDiscriminableItems(contextualType, ts.concatenate(ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 284 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return getContextFreeTypeOfExpression(prop.initializer); }), prop.symbol.escapedName]; }), ts.map(ts.filter(getPropertiesOfType(contextualType), function (s) { var _a; return !!(s.flags & 16777216 /* Optional */) && !!((_a = node === null || node === void 0 ? void 0 : node.symbol) === null || _a === void 0 ? void 0 : _a.members) && !node.symbol.members.has(s.escapedName) && isDiscriminantProperty(contextualType, s.escapedName); }), function (s) { return [function () { return undefinedType; }, s.escapedName]; })), isTypeAssignableTo, contextualType);
         }
         // Return the contextual type for a given expression node. During overload resolution, a contextual type may temporarily
         // be "pushed" onto a node using the contextualType property.
@@ -66242,15 +70742,9 @@ var ts;
             var instantiatedType = instantiateContextualType(contextualType, node, contextFlags);
             if (instantiatedType && !(contextFlags && contextFlags & 2 /* NoConstraints */ && instantiatedType.flags & 8650752 /* TypeVariable */)) {
                 var apparentType = mapType(instantiatedType, getApparentType, /*noReductions*/ true);
-                if (apparentType.flags & 1048576 /* Union */) {
-                    if (ts.isObjectLiteralExpression(node)) {
-                        return discriminateContextualTypeByObjectMembers(node, apparentType);
-                    }
-                    else if (ts.isJsxAttributes(node)) {
-                        return discriminateContextualTypeByJSXAttributes(node, apparentType);
-                    }
-                }
-                return apparentType;
+                return apparentType.flags & 1048576 /* Union */ && ts.isObjectLiteralExpression(node) ? discriminateContextualTypeByObjectMembers(node, apparentType) :
+                    apparentType.flags & 1048576 /* Union */ && ts.isJsxAttributes(node) ? discriminateContextualTypeByJSXAttributes(node, apparentType) :
+                        apparentType;
             }
         }
         // If the given contextual type contains instantiable types and if a mapper representing
@@ -66317,60 +70811,58 @@ var ts;
             }
             var parent = node.parent;
             switch (parent.kind) {
-                case 249 /* VariableDeclaration */:
-                case 160 /* Parameter */:
-                case 163 /* PropertyDeclaration */:
-                case 162 /* PropertySignature */:
-                case 198 /* BindingElement */:
+                case 253 /* VariableDeclaration */:
+                case 163 /* Parameter */:
+                case 166 /* PropertyDeclaration */:
+                case 165 /* PropertySignature */:
+                case 202 /* BindingElement */:
                     return getContextualTypeForInitializerExpression(node, contextFlags);
-                case 209 /* ArrowFunction */:
-                case 242 /* ReturnStatement */:
+                case 213 /* ArrowFunction */:
+                case 246 /* ReturnStatement */:
                     return getContextualTypeForReturnExpression(node);
-                case 219 /* YieldExpression */:
+                case 223 /* YieldExpression */:
                     return getContextualTypeForYieldOperand(parent);
-                case 213 /* AwaitExpression */:
+                case 217 /* AwaitExpression */:
                     return getContextualTypeForAwaitOperand(parent, contextFlags);
-                case 203 /* CallExpression */:
-                    if (parent.expression.kind === 99 /* ImportKeyword */) {
-                        return stringType;
-                    }
-                /* falls through */
-                case 204 /* NewExpression */:
+                case 207 /* CallExpression */:
+                case 208 /* NewExpression */:
                     return getContextualTypeForArgument(parent, node);
-                case 206 /* TypeAssertionExpression */:
-                case 224 /* AsExpression */:
+                case 210 /* TypeAssertionExpression */:
+                case 228 /* AsExpression */:
                     return ts.isConstTypeReference(parent.type) ? tryFindWhenConstTypeReference(parent) : getTypeFromTypeNode(parent.type);
-                case 216 /* BinaryExpression */:
+                case 220 /* BinaryExpression */:
                     return getContextualTypeForBinaryOperand(node, contextFlags);
-                case 288 /* PropertyAssignment */:
-                case 289 /* ShorthandPropertyAssignment */:
+                case 294 /* PropertyAssignment */:
+                case 295 /* ShorthandPropertyAssignment */:
                     return getContextualTypeForObjectLiteralElement(parent, contextFlags);
-                case 290 /* SpreadAssignment */:
-                    return getApparentTypeOfContextualType(parent.parent, contextFlags);
-                case 199 /* ArrayLiteralExpression */: {
+                case 296 /* SpreadAssignment */:
+                    return getContextualType(parent.parent, contextFlags);
+                case 203 /* ArrayLiteralExpression */: {
                     var arrayLiteral = parent;
                     var type = getApparentTypeOfContextualType(arrayLiteral, contextFlags);
                     return getContextualTypeForElementExpression(type, ts.indexOfNode(arrayLiteral.elements, node));
                 }
-                case 217 /* ConditionalExpression */:
+                case 221 /* ConditionalExpression */:
                     return getContextualTypeForConditionalOperand(node, contextFlags);
-                case 228 /* TemplateSpan */:
-                    ts.Debug.assert(parent.parent.kind === 218 /* TemplateExpression */);
+                case 232 /* TemplateSpan */:
+                    ts.Debug.assert(parent.parent.kind === 222 /* TemplateExpression */);
                     return getContextualTypeForSubstitutionExpression(parent.parent, node);
-                case 207 /* ParenthesizedExpression */: {
+                case 211 /* ParenthesizedExpression */: {
                     // Like in `checkParenthesizedExpression`, an `/** @type {xyz} */` comment before a parenthesized expression acts as a type cast.
                     var tag = ts.isInJSFile(parent) ? ts.getJSDocTypeTag(parent) : undefined;
-                    return tag ? getTypeFromTypeNode(tag.typeExpression.type) : getContextualType(parent, contextFlags);
+                    return !tag ? getContextualType(parent, contextFlags) :
+                        ts.isJSDocTypeTag(tag) && ts.isConstTypeReference(tag.typeExpression.type) ? tryFindWhenConstTypeReference(parent) :
+                            getTypeFromTypeNode(tag.typeExpression.type);
                 }
-                case 225 /* NonNullExpression */:
+                case 229 /* NonNullExpression */:
                     return getContextualType(parent, contextFlags);
-                case 283 /* JsxExpression */:
+                case 287 /* JsxExpression */:
                     return getContextualTypeForJsxExpression(parent);
-                case 280 /* JsxAttribute */:
-                case 282 /* JsxSpreadAttribute */:
+                case 284 /* JsxAttribute */:
+                case 286 /* JsxSpreadAttribute */:
                     return getContextualTypeForJsxAttribute(parent);
-                case 275 /* JsxOpeningElement */:
-                case 274 /* JsxSelfClosingElement */:
+                case 279 /* JsxOpeningElement */:
+                case 278 /* JsxSelfClosingElement */:
                     return getContextualJsxElementAttributesType(parent, contextFlags);
             }
             return undefined;
@@ -66400,20 +70892,20 @@ var ts;
             var propsType = getTypeOfFirstParameterOfSignatureWithFallback(sig, unknownType);
             propsType = getJsxManagedAttributesFromLocatedAttributes(context, getJsxNamespaceAt(context), propsType);
             var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes, context);
-            if (intrinsicAttribs !== errorType) {
+            if (!isErrorType(intrinsicAttribs)) {
                 propsType = intersectTypes(intrinsicAttribs, propsType);
             }
             return propsType;
         }
         function getJsxPropsTypeForSignatureFromMember(sig, forcedLookupLocation) {
-            if (sig.unionSignatures) {
+            if (sig.compositeSignatures) {
                 // JSX Elements using the legacy `props`-field based lookup (eg, react class components) need to treat the `props` member as an input
                 // instead of an output position when resolving the signature. We need to go back to the input signatures of the composite signature,
                 // get the type of `props` on each return type individually, and then _intersect them_, rather than union them (as would normally occur
                 // for a union signature). It's an unfortunate quirk of looking in the output of the signature for the type we want to use for the input.
                 // The default behavior of `getTypeOfFirstParameterOfSignatureWithFallback` when no `props` member name is defined is much more sane.
                 var results = [];
-                for (var _i = 0, _a = sig.unionSignatures; _i < _a.length; _i++) {
+                for (var _i = 0, _a = sig.compositeSignatures; _i < _a.length; _i++) {
                     var signature = _a[_i];
                     var instance = getReturnTypeOfSignature(signature);
                     if (isTypeAny(instance)) {
@@ -66425,7 +70917,7 @@ var ts;
                     }
                     results.push(propType);
                 }
-                return getIntersectionType(results);
+                return getIntersectionType(results); // Same result for both union and intersection signatures
             }
             var instanceType = getReturnTypeOfSignature(sig);
             return isTypeAny(instanceType) ? instanceType : getTypeOfPropertyOfType(instanceType, forcedLookupLocation);
@@ -66493,7 +70985,7 @@ var ts;
                 // Normal case -- add in IntrinsicClassElements<T> and IntrinsicElements
                 var apparentAttributesType = attributesType;
                 var intrinsicClassAttribs = getJsxType(JsxNames.IntrinsicClassAttributes, context);
-                if (intrinsicClassAttribs !== errorType) {
+                if (!isErrorType(intrinsicClassAttribs)) {
                     var typeParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(intrinsicClassAttribs.symbol);
                     var hostClassType = getReturnTypeOfSignature(sig);
                     apparentAttributesType = intersectTypes(typeParams
@@ -66501,22 +70993,99 @@ var ts;
                         : intrinsicClassAttribs, apparentAttributesType);
                 }
                 var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes, context);
-                if (intrinsicAttribs !== errorType) {
+                if (!isErrorType(intrinsicAttribs)) {
                     apparentAttributesType = intersectTypes(intrinsicAttribs, apparentAttributesType);
                 }
                 return apparentAttributesType;
             }
         }
+        function getIntersectedSignatures(signatures) {
+            return ts.getStrictOptionValue(compilerOptions, "noImplicitAny")
+                ? ts.reduceLeft(signatures, function (left, right) {
+                    return left === right || !left ? left
+                        : compareTypeParametersIdentical(left.typeParameters, right.typeParameters) ? combineSignaturesOfIntersectionMembers(left, right)
+                            : undefined;
+                })
+                : undefined;
+        }
+        function combineIntersectionThisParam(left, right, mapper) {
+            if (!left || !right) {
+                return left || right;
+            }
+            // A signature `this` type might be a read or a write position... It's very possible that it should be invariant
+            // and we should refuse to merge signatures if there are `this` types and they do not match. However, so as to be
+            // pessimistic when contextual typing, for now, we'll union the `this` types.
+            var thisType = getUnionType([getTypeOfSymbol(left), instantiateType(getTypeOfSymbol(right), mapper)]);
+            return createSymbolWithType(left, thisType);
+        }
+        function combineIntersectionParameters(left, right, mapper) {
+            var leftCount = getParameterCount(left);
+            var rightCount = getParameterCount(right);
+            var longest = leftCount >= rightCount ? left : right;
+            var shorter = longest === left ? right : left;
+            var longestCount = longest === left ? leftCount : rightCount;
+            var eitherHasEffectiveRest = (hasEffectiveRestParameter(left) || hasEffectiveRestParameter(right));
+            var needsExtraRestElement = eitherHasEffectiveRest && !hasEffectiveRestParameter(longest);
+            var params = new Array(longestCount + (needsExtraRestElement ? 1 : 0));
+            for (var i = 0; i < longestCount; i++) {
+                var longestParamType = tryGetTypeAtPosition(longest, i);
+                if (longest === right) {
+                    longestParamType = instantiateType(longestParamType, mapper);
+                }
+                var shorterParamType = tryGetTypeAtPosition(shorter, i) || unknownType;
+                if (shorter === right) {
+                    shorterParamType = instantiateType(shorterParamType, mapper);
+                }
+                var unionParamType = getUnionType([longestParamType, shorterParamType]);
+                var isRestParam = eitherHasEffectiveRest && !needsExtraRestElement && i === (longestCount - 1);
+                var isOptional = i >= getMinArgumentCount(longest) && i >= getMinArgumentCount(shorter);
+                var leftName = i >= leftCount ? undefined : getParameterNameAtPosition(left, i);
+                var rightName = i >= rightCount ? undefined : getParameterNameAtPosition(right, i);
+                var paramName = leftName === rightName ? leftName :
+                    !leftName ? rightName :
+                        !rightName ? leftName :
+                            undefined;
+                var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), paramName || "arg".concat(i));
+                paramSymbol.type = isRestParam ? createArrayType(unionParamType) : unionParamType;
+                params[i] = paramSymbol;
+            }
+            if (needsExtraRestElement) {
+                var restParamSymbol = createSymbol(1 /* FunctionScopedVariable */, "args");
+                restParamSymbol.type = createArrayType(getTypeAtPosition(shorter, longestCount));
+                if (shorter === right) {
+                    restParamSymbol.type = instantiateType(restParamSymbol.type, mapper);
+                }
+                params[longestCount] = restParamSymbol;
+            }
+            return params;
+        }
+        function combineSignaturesOfIntersectionMembers(left, right) {
+            var typeParams = left.typeParameters || right.typeParameters;
+            var paramMapper;
+            if (left.typeParameters && right.typeParameters) {
+                paramMapper = createTypeMapper(right.typeParameters, left.typeParameters);
+                // We just use the type parameter defaults from the first signature
+            }
+            var declaration = left.declaration;
+            var params = combineIntersectionParameters(left, right, paramMapper);
+            var thisParam = combineIntersectionThisParam(left.thisParameter, right.thisParameter, paramMapper);
+            var minArgCount = Math.max(left.minArgumentCount, right.minArgumentCount);
+            var result = createSignature(declaration, typeParams, thisParam, params, 
+            /*resolvedReturnType*/ undefined, 
+            /*resolvedTypePredicate*/ undefined, minArgCount, (left.flags | right.flags) & 39 /* PropagatingFlags */);
+            result.compositeKind = 2097152 /* Intersection */;
+            result.compositeSignatures = ts.concatenate(left.compositeKind === 2097152 /* Intersection */ && left.compositeSignatures || [left], [right]);
+            if (paramMapper) {
+                result.mapper = left.compositeKind === 2097152 /* Intersection */ && left.mapper && left.compositeSignatures ? combineTypeMappers(left.mapper, paramMapper) : paramMapper;
+            }
+            return result;
+        }
         // If the given type is an object or union type with a single signature, and if that signature has at
         // least as many parameters as the given function, return the signature. Otherwise return undefined.
         function getContextualCallSignature(type, node) {
             var signatures = getSignaturesOfType(type, 0 /* Call */);
-            if (signatures.length === 1) {
-                var signature = signatures[0];
-                if (!isAritySmaller(signature, node)) {
-                    return signature;
-                }
-            }
+            var applicableByArity = ts.filter(signatures, function (s) { return !isAritySmaller(s, node); });
+            return applicableByArity.length === 1 ? applicableByArity[0] : getIntersectedSignatures(applicableByArity);
         }
         /** If the contextual signature has fewer parameters than the function expression, do not use it */
         function isAritySmaller(signature, target) {
@@ -66532,12 +71101,9 @@ var ts;
             }
             return !hasEffectiveRestParameter(signature) && getParameterCount(signature) < targetParameterCount;
         }
-        function isFunctionExpressionOrArrowFunction(node) {
-            return node.kind === 208 /* FunctionExpression */ || node.kind === 209 /* ArrowFunction */;
-        }
         function getContextualSignatureForFunctionLikeDeclaration(node) {
             // Only function expressions, arrow functions, and object literal methods are contextually typed.
-            return isFunctionExpressionOrArrowFunction(node) || ts.isObjectLiteralMethod(node)
+            return ts.isFunctionExpressionOrArrowFunction(node) || ts.isObjectLiteralMethod(node)
                 ? getContextualSignature(node)
                 : undefined;
         }
@@ -66547,7 +71113,7 @@ var ts;
         // all identical ignoring their return type, the result is same signature but with return type as
         // union type of return types from these signatures
         function getContextualSignature(node) {
-            ts.Debug.assert(node.kind !== 165 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node));
+            ts.Debug.assert(node.kind !== 168 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node));
             var typeTagSignature = getSignatureOfTypeTag(node);
             if (typeTagSignature) {
                 return typeTagSignature;
@@ -66561,8 +71127,8 @@ var ts;
             }
             var signatureList;
             var types = type.types;
-            for (var _i = 0, types_20 = types; _i < types_20.length; _i++) {
-                var current = types_20[_i];
+            for (var _i = 0, types_19 = types; _i < types_19.length; _i++) {
+                var current = types_19[_i];
                 var signature = getContextualCallSignature(current, node);
                 if (signature) {
                     if (!signatureList) {
@@ -66595,8 +71161,8 @@ var ts;
             return node.isSpread ? getIndexedAccessType(node.type, numberType) : node.type;
         }
         function hasDefaultValue(node) {
-            return (node.kind === 198 /* BindingElement */ && !!node.initializer) ||
-                (node.kind === 216 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */);
+            return (node.kind === 202 /* BindingElement */ && !!node.initializer) ||
+                (node.kind === 220 /* BinaryExpression */ && node.operatorToken.kind === 63 /* EqualsToken */);
         }
         function checkArrayLiteral(node, checkMode, forceTuple) {
             var elements = node.elements;
@@ -66606,9 +71172,10 @@ var ts;
             var contextualType = getApparentTypeOfContextualType(node);
             var inDestructuringPattern = ts.isAssignmentTarget(node);
             var inConstContext = isConstContext(node);
+            var hasOmittedExpression = false;
             for (var i = 0; i < elementCount; i++) {
                 var e = elements[i];
-                if (e.kind === 220 /* SpreadElement */) {
+                if (e.kind === 224 /* SpreadElement */) {
                     if (languageVersion < 2 /* ES2015 */) {
                         checkExternalEmitHelpers(e, compilerOptions.downlevelIteration ? 1536 /* SpreadIncludes */ : 1024 /* SpreadArray */);
                     }
@@ -66630,7 +71197,7 @@ var ts;
                         // get the contextual element type from it. So we do something similar to
                         // getContextualTypeForElementExpression, which will crucially not error
                         // if there is no index type / iterated type.
-                        var restElementType = getIndexTypeOfType(spreadType, 1 /* Number */) ||
+                        var restElementType = getIndexTypeOfType(spreadType, numberType) ||
                             getIteratedTypeOrElementType(65 /* Destructuring */, spreadType, undefinedType, /*errorNode*/ undefined, /*checkAssignability*/ false) ||
                             unknownType;
                         elementTypes.push(restElementType);
@@ -66641,17 +71208,22 @@ var ts;
                         elementFlags.push(4 /* Rest */);
                     }
                 }
+                else if (exactOptionalPropertyTypes && e.kind === 226 /* OmittedExpression */) {
+                    hasOmittedExpression = true;
+                    elementTypes.push(missingType);
+                    elementFlags.push(2 /* Optional */);
+                }
                 else {
                     var elementContextualType = getContextualTypeForElementExpression(contextualType, elementTypes.length);
                     var type = checkExpressionForMutableLocation(e, checkMode, elementContextualType, forceTuple);
-                    elementTypes.push(type);
-                    elementFlags.push(1 /* Required */);
+                    elementTypes.push(addOptionality(type, /*isProperty*/ true, hasOmittedExpression));
+                    elementFlags.push(hasOmittedExpression ? 2 /* Optional */ : 1 /* Required */);
                 }
             }
             if (inDestructuringPattern) {
                 return createTupleType(elementTypes, elementFlags);
             }
-            if (forceTuple || inConstContext || contextualType && forEachType(contextualType, isTupleLikeType)) {
+            if (forceTuple || inConstContext || contextualType && someType(contextualType, isTupleLikeType)) {
                 return createArrayLiteralType(createTupleType(elementTypes, elementFlags, /*readonly*/ inConstContext));
             }
             return createArrayLiteralType(createArrayType(elementTypes.length ?
@@ -66665,15 +71237,15 @@ var ts;
             var literalType = type.literalType;
             if (!literalType) {
                 literalType = type.literalType = cloneTypeReference(type);
-                literalType.objectFlags |= 65536 /* ArrayLiteral */ | 1048576 /* ContainsObjectOrArrayLiteral */;
+                literalType.objectFlags |= 32768 /* ArrayLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */;
             }
             return literalType;
         }
         function isNumericName(name) {
             switch (name.kind) {
-                case 158 /* ComputedPropertyName */:
+                case 161 /* ComputedPropertyName */:
                     return isNumericComputedName(name);
-                case 78 /* Identifier */:
+                case 79 /* Identifier */:
                     return isNumericLiteralName(name.escapedText);
                 case 8 /* NumericLiteral */:
                 case 10 /* StringLiteral */:
@@ -66687,9 +71259,6 @@ var ts;
             // but this behavior is consistent with checkIndexedAccess
             return isTypeAssignableToKind(checkComputedPropertyName(name), 296 /* NumberLike */);
         }
-        function isInfinityOrNaNString(name) {
-            return name === "Infinity" || name === "-Infinity" || name === "NaN";
-        }
         function isNumericLiteralName(name) {
             // The intent of numeric names is that
             //     - they are names with text in a numeric form, and that
@@ -66717,7 +71286,25 @@ var ts;
         function checkComputedPropertyName(node) {
             var links = getNodeLinks(node.expression);
             if (!links.resolvedType) {
+                if ((ts.isTypeLiteralNode(node.parent.parent) || ts.isClassLike(node.parent.parent) || ts.isInterfaceDeclaration(node.parent.parent))
+                    && ts.isBinaryExpression(node.expression) && node.expression.operatorToken.kind === 101 /* InKeyword */) {
+                    return links.resolvedType = errorType;
+                }
                 links.resolvedType = checkExpression(node.expression);
+                // The computed property name of a non-static class field within a loop must be stored in a block-scoped binding.
+                // (It needs to be bound at class evaluation time.)
+                if (ts.isPropertyDeclaration(node.parent) && !ts.hasStaticModifier(node.parent) && ts.isClassExpression(node.parent.parent)) {
+                    var container = ts.getEnclosingBlockScopeContainer(node.parent.parent);
+                    var enclosingIterationStatement = getEnclosingIterationStatement(container);
+                    if (enclosingIterationStatement) {
+                        // The computed field name will use a block scoped binding which can be unique for each iteration of the loop.
+                        getNodeLinks(enclosingIterationStatement).flags |= 65536 /* LoopWithCapturedBlockScopedBinding */;
+                        // The generated variable which stores the computed field name must be block-scoped.
+                        getNodeLinks(node).flags |= 524288 /* BlockScopedBindingInLoop */;
+                        // The generated variable which stores the class must be block-scoped.
+                        getNodeLinks(node.parent.parent).flags |= 524288 /* BlockScopedBindingInLoop */;
+                    }
+                }
                 // This will allow types number, string, symbol or any. It will also allow enums, the unknown
                 // type, and any union of these types (like string | number).
                 if (links.resolvedType.flags & 98304 /* Nullable */ ||
@@ -66725,9 +71312,6 @@ var ts;
                         !isTypeAssignableTo(links.resolvedType, stringNumberSymbolType)) {
                     error(node, ts.Diagnostics.A_computed_property_name_must_be_of_type_string_number_symbol_or_any);
                 }
-                else {
-                    checkThatExpressionIsProperSymbolReference(node.expression, links.resolvedType, /*reportError*/ true);
-                }
             }
             return links.resolvedType;
         }
@@ -66736,15 +71320,24 @@ var ts;
             var firstDecl = (_a = symbol.declarations) === null || _a === void 0 ? void 0 : _a[0];
             return isNumericLiteralName(symbol.escapedName) || (firstDecl && ts.isNamedDeclaration(firstDecl) && isNumericName(firstDecl.name));
         }
-        function getObjectLiteralIndexInfo(node, offset, properties, kind) {
+        function isSymbolWithSymbolName(symbol) {
+            var _a;
+            var firstDecl = (_a = symbol.declarations) === null || _a === void 0 ? void 0 : _a[0];
+            return ts.isKnownSymbol(symbol) || (firstDecl && ts.isNamedDeclaration(firstDecl) && ts.isComputedPropertyName(firstDecl.name) &&
+                isTypeAssignableToKind(checkComputedPropertyName(firstDecl.name), 4096 /* ESSymbol */));
+        }
+        function getObjectLiteralIndexInfo(node, offset, properties, keyType) {
             var propTypes = [];
             for (var i = offset; i < properties.length; i++) {
-                if (kind === 0 /* String */ || isSymbolWithNumericName(properties[i])) {
+                var prop = properties[i];
+                if (keyType === stringType && !isSymbolWithSymbolName(prop) ||
+                    keyType === numberType && isSymbolWithNumericName(prop) ||
+                    keyType === esSymbolType && isSymbolWithSymbolName(prop)) {
                     propTypes.push(getTypeOfSymbol(properties[i]));
                 }
             }
             var unionType = propTypes.length ? getUnionType(propTypes, 2 /* Subtype */) : undefinedType;
-            return createIndexInfo(unionType, isConstContext(node));
+            return createIndexInfo(keyType, unionType, isConstContext(node));
         }
         function getImmediateAliasedSymbol(symbol) {
             ts.Debug.assert((symbol.flags & 2097152 /* Alias */) !== 0, "Should only get Alias here.");
@@ -66767,7 +71360,7 @@ var ts;
             var spread = emptyObjectType;
             var contextualType = getApparentTypeOfContextualType(node);
             var contextualTypeHasPattern = contextualType && contextualType.pattern &&
-                (contextualType.pattern.kind === 196 /* ObjectBindingPattern */ || contextualType.pattern.kind === 200 /* ObjectLiteralExpression */);
+                (contextualType.pattern.kind === 200 /* ObjectBindingPattern */ || contextualType.pattern.kind === 204 /* ObjectLiteralExpression */);
             var inConstContext = isConstContext(node);
             var checkFlags = inConstContext ? 8 /* Readonly */ : 0;
             var isInJavascript = ts.isInJSFile(node) && !ts.isInJsonFile(node);
@@ -66777,12 +71370,13 @@ var ts;
             var patternWithComputedProperties = false;
             var hasComputedStringProperty = false;
             var hasComputedNumberProperty = false;
+            var hasComputedSymbolProperty = false;
             // Spreads may cause an early bail; ensure computed names are always checked (this is cached)
             // As otherwise they may not be checked until exports for the type at this position are retrieved,
             // which may never occur.
             for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {
                 var elem = _a[_i];
-                if (elem.name && ts.isComputedPropertyName(elem.name) && !ts.isWellKnownSymbolSyntactically(elem.name)) {
+                if (elem.name && ts.isComputedPropertyName(elem.name)) {
                     checkComputedPropertyName(elem.name);
                 }
             }
@@ -66790,16 +71384,16 @@ var ts;
             for (var _b = 0, _c = node.properties; _b < _c.length; _b++) {
                 var memberDecl = _c[_b];
                 var member = getSymbolOfNode(memberDecl);
-                var computedNameType = memberDecl.name && memberDecl.name.kind === 158 /* ComputedPropertyName */ && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ?
+                var computedNameType = memberDecl.name && memberDecl.name.kind === 161 /* ComputedPropertyName */ ?
                     checkComputedPropertyName(memberDecl.name) : undefined;
-                if (memberDecl.kind === 288 /* PropertyAssignment */ ||
-                    memberDecl.kind === 289 /* ShorthandPropertyAssignment */ ||
+                if (memberDecl.kind === 294 /* PropertyAssignment */ ||
+                    memberDecl.kind === 295 /* ShorthandPropertyAssignment */ ||
                     ts.isObjectLiteralMethod(memberDecl)) {
-                    var type = memberDecl.kind === 288 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) :
+                    var type = memberDecl.kind === 294 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) :
                         // 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'".
-                        memberDecl.kind === 289 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(!inDestructuringPattern && memberDecl.objectAssignmentInitializer ? memberDecl.objectAssignmentInitializer : memberDecl.name, checkMode) :
+                        memberDecl.kind === 295 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(!inDestructuringPattern && memberDecl.objectAssignmentInitializer ? memberDecl.objectAssignmentInitializer : memberDecl.name, checkMode) :
                             checkObjectLiteralMethod(memberDecl, checkMode);
                     if (isInJavascript) {
                         var jsDocType = getTypeForDeclarationFromJSDocComment(memberDecl);
@@ -66811,7 +71405,7 @@ var ts;
                             checkTypeAssignableTo(type, getTypeFromTypeNode(enumTag.typeExpression), memberDecl);
                         }
                     }
-                    objectFlags |= ts.getObjectFlags(type) & 3670016 /* PropagatingFlags */;
+                    objectFlags |= ts.getObjectFlags(type) & 917504 /* PropagatingFlags */;
                     var nameType = computedNameType && isTypeUsableAsPropertyName(computedNameType) ? computedNameType : undefined;
                     var prop = nameType ?
                         createSymbol(4 /* Property */ | member.flags, getPropertyNameFromType(nameType), checkFlags | 4096 /* Late */) :
@@ -66822,8 +71416,8 @@ var ts;
                     if (inDestructuringPattern) {
                         // If object literal is an assignment pattern and if the assignment pattern specifies a default value
                         // for the property, make the property optional.
-                        var isOptional = (memberDecl.kind === 288 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) ||
-                            (memberDecl.kind === 289 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer);
+                        var isOptional = (memberDecl.kind === 294 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) ||
+                            (memberDecl.kind === 295 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer);
                         if (isOptional) {
                             prop.flags |= 16777216 /* Optional */;
                         }
@@ -66835,7 +71429,7 @@ var ts;
                         if (impliedProp) {
                             prop.flags |= impliedProp.flags & 16777216 /* Optional */;
                         }
-                        else if (!compilerOptions.suppressExcessPropertyErrors && !getIndexInfoOfType(contextualType, 0 /* String */)) {
+                        else if (!compilerOptions.suppressExcessPropertyErrors && !getIndexInfoOfType(contextualType, stringType)) {
                             error(memberDecl.name, ts.Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(member), typeToString(contextualType));
                         }
                     }
@@ -66849,7 +71443,7 @@ var ts;
                     member = prop;
                     allPropertiesTable === null || allPropertiesTable === void 0 ? void 0 : allPropertiesTable.set(prop.escapedName, prop);
                 }
-                else if (memberDecl.kind === 290 /* SpreadAssignment */) {
+                else if (memberDecl.kind === 296 /* SpreadAssignment */) {
                     if (languageVersion < 2 /* ES2015 */) {
                         checkExternalEmitHelpers(memberDecl, 2 /* Assign */);
                     }
@@ -66859,17 +71453,24 @@ var ts;
                         propertiesTable = ts.createSymbolTable();
                         hasComputedStringProperty = false;
                         hasComputedNumberProperty = false;
+                        hasComputedSymbolProperty = false;
                     }
                     var type = getReducedType(checkExpression(memberDecl.expression));
-                    if (!isValidSpreadType(type)) {
-                        error(memberDecl, ts.Diagnostics.Spread_types_may_only_be_created_from_object_types);
-                        return errorType;
+                    if (isValidSpreadType(type)) {
+                        var mergedType = tryMergeUnionOfObjectTypeAndEmptyObject(type, inConstContext);
+                        if (allPropertiesTable) {
+                            checkSpreadPropOverrides(mergedType, allPropertiesTable, memberDecl);
+                        }
+                        offset = propertiesArray.length;
+                        if (isErrorType(spread)) {
+                            continue;
+                        }
+                        spread = getSpreadType(spread, mergedType, node.symbol, objectFlags, inConstContext);
                     }
-                    if (allPropertiesTable) {
-                        checkSpreadPropOverrides(type, allPropertiesTable, memberDecl);
+                    else {
+                        error(memberDecl, ts.Diagnostics.Spread_types_may_only_be_created_from_object_types);
+                        spread = errorType;
                     }
-                    spread = getSpreadType(spread, type, node.symbol, objectFlags, inConstContext);
-                    offset = propertiesArray.length;
                     continue;
                 }
                 else {
@@ -66878,7 +71479,7 @@ var ts;
                     // an ordinary function declaration(section 6.1) with no parameters.
                     // A set accessor declaration is processed in the same manner
                     // as an ordinary function declaration with a single parameter and a Void return type.
-                    ts.Debug.assert(memberDecl.kind === 167 /* GetAccessor */ || memberDecl.kind === 168 /* SetAccessor */);
+                    ts.Debug.assert(memberDecl.kind === 171 /* GetAccessor */ || memberDecl.kind === 172 /* SetAccessor */);
                     checkNodeDeferred(memberDecl);
                 }
                 if (computedNameType && !(computedNameType.flags & 8576 /* StringOrNumberLiteralOrUnique */)) {
@@ -66886,6 +71487,9 @@ var ts;
                         if (isTypeAssignableTo(computedNameType, numberType)) {
                             hasComputedNumberProperty = true;
                         }
+                        else if (isTypeAssignableTo(computedNameType, esSymbolType)) {
+                            hasComputedSymbolProperty = true;
+                        }
                         else {
                             hasComputedStringProperty = true;
                         }
@@ -66903,7 +71507,7 @@ var ts;
             // type with those properties for which the binding pattern specifies a default value.
             // If the object literal is spread into another object literal, skip this step and let the top-level object
             // literal handle it instead.
-            if (contextualTypeHasPattern && node.parent.kind !== 290 /* SpreadAssignment */) {
+            if (contextualTypeHasPattern && node.parent.kind !== 296 /* SpreadAssignment */) {
                 for (var _d = 0, _e = getPropertiesOfType(contextualType); _d < _e.length; _d++) {
                     var prop = _e[_d];
                     if (!propertiesTable.get(prop.escapedName) && !getPropertyOfType(spread, prop.escapedName)) {
@@ -66915,6 +71519,9 @@ var ts;
                     }
                 }
             }
+            if (isErrorType(spread)) {
+                return errorType;
+            }
             if (spread !== emptyObjectType) {
                 if (propertiesArray.length > 0) {
                     spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, objectFlags, inConstContext);
@@ -66928,12 +71535,17 @@ var ts;
             }
             return createObjectLiteralType();
             function createObjectLiteralType() {
-                var stringIndexInfo = hasComputedStringProperty ? getObjectLiteralIndexInfo(node, offset, propertiesArray, 0 /* String */) : undefined;
-                var numberIndexInfo = hasComputedNumberProperty ? getObjectLiteralIndexInfo(node, offset, propertiesArray, 1 /* Number */) : undefined;
-                var result = createAnonymousType(node.symbol, propertiesTable, ts.emptyArray, ts.emptyArray, stringIndexInfo, numberIndexInfo);
-                result.objectFlags |= objectFlags | 128 /* ObjectLiteral */ | 1048576 /* ContainsObjectOrArrayLiteral */;
+                var indexInfos = [];
+                if (hasComputedStringProperty)
+                    indexInfos.push(getObjectLiteralIndexInfo(node, offset, propertiesArray, stringType));
+                if (hasComputedNumberProperty)
+                    indexInfos.push(getObjectLiteralIndexInfo(node, offset, propertiesArray, numberType));
+                if (hasComputedSymbolProperty)
+                    indexInfos.push(getObjectLiteralIndexInfo(node, offset, propertiesArray, esSymbolType));
+                var result = createAnonymousType(node.symbol, propertiesTable, ts.emptyArray, ts.emptyArray, indexInfos);
+                result.objectFlags |= objectFlags | 128 /* ObjectLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */;
                 if (isJSObjectLiteral) {
-                    result.objectFlags |= 16384 /* JSLiteral */;
+                    result.objectFlags |= 8192 /* JSLiteral */;
                 }
                 if (patternWithComputedProperties) {
                     result.objectFlags |= 512 /* ObjectLiteralPatternWithComputedProperties */;
@@ -66992,14 +71604,14 @@ var ts;
             checkJsxChildren(node);
             return getJsxElementTypeAt(node) || anyType;
         }
-        function isUnhyphenatedJsxName(name) {
-            return !ts.stringContains(name, "-");
+        function isHyphenatedJsxName(name) {
+            return ts.stringContains(name, "-");
         }
         /**
          * Returns true iff React would emit this tag name as a string rather than an identifier or qualified name
          */
         function isJsxIntrinsicIdentifier(tagName) {
-            return tagName.kind === 78 /* Identifier */ && ts.isIntrinsicJsxName(tagName.escapedText);
+            return tagName.kind === 79 /* Identifier */ && ts.isIntrinsicJsxName(tagName.escapedText);
         }
         function checkJsxAttribute(node, checkMode) {
             return node.initializer
@@ -67023,14 +71635,14 @@ var ts;
             var hasSpreadAnyType = false;
             var typeToIntersect;
             var explicitlySpecifyChildrenAttribute = false;
-            var objectFlags = 4096 /* JsxAttributes */;
+            var objectFlags = 2048 /* JsxAttributes */;
             var jsxChildrenPropertyName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(openingLikeElement));
             for (var _i = 0, _a = attributes.properties; _i < _a.length; _i++) {
                 var attributeDecl = _a[_i];
                 var member = attributeDecl.symbol;
                 if (ts.isJsxAttribute(attributeDecl)) {
                     var exprType = checkJsxAttribute(attributeDecl, checkMode);
-                    objectFlags |= ts.getObjectFlags(exprType) & 3670016 /* PropagatingFlags */;
+                    objectFlags |= ts.getObjectFlags(exprType) & 917504 /* PropagatingFlags */;
                     var attributeSymbol = createSymbol(4 /* Property */ | member.flags, member.escapedName);
                     attributeSymbol.declarations = member.declarations;
                     attributeSymbol.parent = member.parent;
@@ -67046,7 +71658,7 @@ var ts;
                     }
                 }
                 else {
-                    ts.Debug.assert(attributeDecl.kind === 282 /* JsxSpreadAttribute */);
+                    ts.Debug.assert(attributeDecl.kind === 286 /* JsxSpreadAttribute */);
                     if (attributesTable.size > 0) {
                         spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, objectFlags, /*readonly*/ false);
                         attributesTable = ts.createSymbolTable();
@@ -67072,7 +71684,7 @@ var ts;
                 }
             }
             // Handle children attribute
-            var parent = openingLikeElement.parent.kind === 273 /* JsxElement */ ? openingLikeElement.parent : undefined;
+            var parent = openingLikeElement.parent.kind === 277 /* JsxElement */ ? openingLikeElement.parent : undefined;
             // We have to check that openingElement of the parent is the one we are visiting as this may not be true for selfClosingElement
             if (parent && parent.openingElement === openingLikeElement && parent.children.length > 0) {
                 var childrenTypes = checkJsxChildren(parent, checkMode);
@@ -67088,7 +71700,7 @@ var ts;
                     // If there are children in the body of JSX element, create dummy attribute "children" with the union of children types so that it will pass the attribute checking process
                     var childrenPropSymbol = createSymbol(4 /* Property */, jsxChildrenPropertyName);
                     childrenPropSymbol.type = childrenTypes.length === 1 ? childrenTypes[0] :
-                        childrenContextualType && forEachType(childrenContextualType, isTupleLikeType) ? createTupleType(childrenTypes) :
+                        childrenContextualType && someType(childrenContextualType, isTupleLikeType) ? createTupleType(childrenTypes) :
                             createArrayType(getUnionType(childrenTypes));
                     // Fake up a property declaration for the children
                     childrenPropSymbol.valueDeclaration = ts.factory.createPropertySignature(/*modifiers*/ undefined, ts.unescapeLeadingUnderscores(jsxChildrenPropertyName), /*questionToken*/ undefined, /*type*/ undefined);
@@ -67096,7 +71708,7 @@ var ts;
                     childrenPropSymbol.valueDeclaration.symbol = childrenPropSymbol;
                     var childPropMap = ts.createSymbolTable();
                     childPropMap.set(jsxChildrenPropertyName, childrenPropSymbol);
-                    spread = getSpreadType(spread, createAnonymousType(attributes.symbol, childPropMap, ts.emptyArray, ts.emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined), attributes.symbol, objectFlags, /*readonly*/ false);
+                    spread = getSpreadType(spread, createAnonymousType(attributes.symbol, childPropMap, ts.emptyArray, ts.emptyArray, ts.emptyArray), attributes.symbol, objectFlags, /*readonly*/ false);
                 }
             }
             if (hasSpreadAnyType) {
@@ -67113,8 +71725,8 @@ var ts;
              */
             function createJsxAttributesType() {
                 objectFlags |= freshObjectLiteralFlag;
-                var result = createAnonymousType(attributes.symbol, attributesTable, ts.emptyArray, ts.emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined);
-                result.objectFlags |= objectFlags | 128 /* ObjectLiteral */ | 1048576 /* ContainsObjectOrArrayLiteral */;
+                var result = createAnonymousType(attributes.symbol, attributesTable, ts.emptyArray, ts.emptyArray, ts.emptyArray);
+                result.objectFlags |= objectFlags | 128 /* ObjectLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */;
                 return result;
             }
         }
@@ -67129,7 +71741,7 @@ var ts;
                         childrenTypes.push(stringType);
                     }
                 }
-                else if (child.kind === 283 /* JsxExpression */ && !child.expression) {
+                else if (child.kind === 287 /* JsxExpression */ && !child.expression) {
                     continue; // empty jsx expressions don't *really* count as present children
                 }
                 else {
@@ -67141,11 +71753,12 @@ var ts;
         function checkSpreadPropOverrides(type, props, spread) {
             for (var _i = 0, _a = getPropertiesOfType(type); _i < _a.length; _i++) {
                 var right = _a[_i];
-                var left = props.get(right.escapedName);
-                var rightType = getTypeOfSymbol(right);
-                if (left && !maybeTypeOfKind(rightType, 98304 /* Nullable */) && !(maybeTypeOfKind(rightType, 3 /* AnyOrUnknown */) && right.flags & 16777216 /* Optional */)) {
-                    var diagnostic = error(left.valueDeclaration, ts.Diagnostics._0_is_specified_more_than_once_so_this_usage_will_be_overwritten, ts.unescapeLeadingUnderscores(left.escapedName));
-                    ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(spread, ts.Diagnostics.This_spread_always_overwrites_this_property));
+                if (!(right.flags & 16777216 /* Optional */)) {
+                    var left = props.get(right.escapedName);
+                    if (left) {
+                        var diagnostic = error(left.valueDeclaration, ts.Diagnostics._0_is_specified_more_than_once_so_this_usage_will_be_overwritten, ts.unescapeLeadingUnderscores(left.escapedName));
+                        ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(spread, ts.Diagnostics.This_spread_always_overwrites_this_property));
+                    }
                 }
             }
         }
@@ -67173,7 +71786,7 @@ var ts;
             var links = getNodeLinks(node);
             if (!links.resolvedSymbol) {
                 var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements, node);
-                if (intrinsicElementsType !== errorType) {
+                if (!isErrorType(intrinsicElementsType)) {
                     // Property case
                     if (!ts.isIdentifier(node.tagName))
                         return ts.Debug.fail();
@@ -67183,7 +71796,7 @@ var ts;
                         return links.resolvedSymbol = intrinsicProp;
                     }
                     // Intrinsic string indexer case
-                    var indexSignatureType = getIndexTypeOfType(intrinsicElementsType, 0 /* String */);
+                    var indexSignatureType = getIndexTypeOfType(intrinsicElementsType, stringType);
                     if (indexSignatureType) {
                         links.jsxFlags |= 2 /* IntrinsicIndexedElement */;
                         return links.resolvedSymbol = intrinsicElementsType.symbol;
@@ -67280,7 +71893,7 @@ var ts;
                 else if (propertiesOfJsxElementAttribPropInterface.length === 1) {
                     return propertiesOfJsxElementAttribPropInterface[0].escapedName;
                 }
-                else if (propertiesOfJsxElementAttribPropInterface.length > 1) {
+                else if (propertiesOfJsxElementAttribPropInterface.length > 1 && jsxElementAttribPropInterfaceSym.declarations) {
                     // More than one property on ElementAttributesProperty is an error
                     error(jsxElementAttribPropInterfaceSym.declarations[0], ts.Diagnostics.The_global_type_JSX_0_may_not_have_more_than_one_property, ts.unescapeLeadingUnderscores(nameOfAttribPropContainer));
                 }
@@ -67336,13 +71949,13 @@ var ts;
             //      var CustomTag: "h1" = "h1";
             //      <CustomTag> Hello World </CustomTag>
             var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements, location);
-            if (intrinsicElementsType !== errorType) {
+            if (!isErrorType(intrinsicElementsType)) {
                 var stringLiteralTypeName = type.value;
                 var intrinsicProp = getPropertyOfType(intrinsicElementsType, ts.escapeLeadingUnderscores(stringLiteralTypeName));
                 if (intrinsicProp) {
                     return getTypeOfSymbol(intrinsicProp);
                 }
-                var indexSignatureType = getIndexTypeOfType(intrinsicElementsType, 0 /* String */);
+                var indexSignatureType = getIndexTypeOfType(intrinsicElementsType, stringType);
                 if (indexSignatureType) {
                     return indexSignatureType;
                 }
@@ -67390,11 +72003,11 @@ var ts;
             if (!links.resolvedJsxElementAttributesType) {
                 var symbol = getIntrinsicTagSymbol(node);
                 if (links.jsxFlags & 1 /* IntrinsicNamedElement */) {
-                    return links.resolvedJsxElementAttributesType = getTypeOfSymbol(symbol);
+                    return links.resolvedJsxElementAttributesType = getTypeOfSymbol(symbol) || errorType;
                 }
                 else if (links.jsxFlags & 2 /* IntrinsicIndexedElement */) {
                     return links.resolvedJsxElementAttributesType =
-                        getIndexTypeOfType(getDeclaredTypeOfSymbol(symbol), 0 /* String */);
+                        getIndexTypeOfType(getJsxType(JsxNames.IntrinsicElements, node), stringType) || errorType;
                 }
                 else {
                     return links.resolvedJsxElementAttributesType = errorType;
@@ -67404,7 +72017,7 @@ var ts;
         }
         function getJsxElementClassTypeAt(location) {
             var type = getJsxType(JsxNames.ElementClass, location);
-            if (type === errorType)
+            if (isErrorType(type))
                 return undefined;
             return type;
         }
@@ -67461,6 +72074,14 @@ var ts;
                         markAliasSymbolAsReferenced(jsxFactorySym);
                     }
                 }
+                // For JsxFragment, mark jsx pragma as referenced via resolveName
+                if (ts.isJsxOpeningFragment(node)) {
+                    var file = ts.getSourceFileOfNode(node);
+                    var localJsxNamespace = getLocalJsxNamespace(file);
+                    if (localJsxNamespace) {
+                        resolveName(jsxFactoryLocation, localJsxNamespace, 111551 /* Value */, jsxFactoryRefErr, localJsxNamespace, /*isUse*/ true);
+                    }
+                }
             }
             if (isNodeOpeningLikeElement) {
                 var jsxOpeningLikeNode = node;
@@ -67484,11 +72105,13 @@ var ts;
          */
         function isKnownProperty(targetType, name, isComparingJsxAttributes) {
             if (targetType.flags & 524288 /* Object */) {
-                var resolved = resolveStructuredTypeMembers(targetType);
-                if (resolved.stringIndexInfo ||
-                    resolved.numberIndexInfo && isNumericLiteralName(name) ||
-                    getPropertyOfObjectType(targetType, name) ||
-                    isComparingJsxAttributes && !isUnhyphenatedJsxName(name)) {
+                // For backwards compatibility a symbol-named property is satisfied by a string index signature. This
+                // is incorrect and inconsistent with element access expressions, where it is an error, so eventually
+                // we should remove this exception.
+                if (getPropertyOfObjectType(targetType, name) ||
+                    getApplicableIndexInfoForName(targetType, name) ||
+                    isLateBoundName(name) && getIndexInfoOfType(targetType, stringType) ||
+                    isComparingJsxAttributes && isHyphenatedJsxName(name)) {
                     // For JSXAttributes, if the attribute has a hyphenated name, consider that the attribute to be known.
                     return true;
                 }
@@ -67547,9 +72170,26 @@ var ts;
          * @param type The type of the object whose property is being accessed. (Not the type of the property.)
          * @param prop The symbol for the property being accessed.
          */
-        function checkPropertyAccessibility(node, isSuper, type, prop) {
-            var flags = ts.getDeclarationModifierFlagsFromSymbol(prop);
-            var errorNode = node.kind === 157 /* QualifiedName */ ? node.right : node.kind === 195 /* ImportType */ ? node : node.name;
+        function checkPropertyAccessibility(node, isSuper, writing, type, prop, reportError) {
+            if (reportError === void 0) { reportError = true; }
+            var errorNode = !reportError ? undefined :
+                node.kind === 160 /* QualifiedName */ ? node.right :
+                    node.kind === 199 /* ImportType */ ? node :
+                        node.kind === 202 /* BindingElement */ && node.propertyName ? node.propertyName : node.name;
+            return checkPropertyAccessibilityAtLocation(node, isSuper, writing, type, prop, errorNode);
+        }
+        /**
+         * Check whether the requested property can be accessed at the requested location.
+         * Returns true if node is a valid property access, and false otherwise.
+         * @param location The location node where we want to check if the property is accessible.
+         * @param isSuper True if the access is from `super.`.
+         * @param writing True if this is a write property access, false if it is a read property access.
+         * @param containingType The type of the object whose property is being accessed. (Not the type of the property.)
+         * @param prop The symbol for the property being accessed.
+         * @param errorNode The node where we should report an invalid property access error, or undefined if we should not report errors.
+         */
+        function checkPropertyAccessibilityAtLocation(location, isSuper, writing, containingType, prop, errorNode) {
+            var flags = ts.getDeclarationModifierFlagsFromSymbol(prop, writing);
             if (isSuper) {
                 // TS 1.0 spec (April 2014): 4.8.2
                 // - In a constructor, instance member function, instance member accessor, or
@@ -67560,7 +72200,9 @@ var ts;
                 //   a super property access is permitted and must specify a public static member function of the base class.
                 if (languageVersion < 2 /* ES2015 */) {
                     if (symbolHasNonMethodDeclaration(prop)) {
-                        error(errorNode, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword);
+                        if (errorNode) {
+                            error(errorNode, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword);
+                        }
                         return false;
                     }
                 }
@@ -67569,24 +72211,22 @@ var ts;
                     // This error could mask a private property access error. But, a member
                     // cannot simultaneously be private and abstract, so this will trigger an
                     // additional error elsewhere.
-                    error(errorNode, ts.Diagnostics.Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression, symbolToString(prop), typeToString(getDeclaringClass(prop)));
+                    if (errorNode) {
+                        error(errorNode, ts.Diagnostics.Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression, symbolToString(prop), typeToString(getDeclaringClass(prop)));
+                    }
                     return false;
                 }
             }
             // Referencing abstract properties within their own constructors is not allowed
-            if ((flags & 128 /* Abstract */) && ts.isThisProperty(node) && symbolHasNonMethodDeclaration(prop)) {
+            if ((flags & 128 /* Abstract */) && symbolHasNonMethodDeclaration(prop) &&
+                (ts.isThisProperty(location) || ts.isThisInitializedObjectBindingExpression(location) || ts.isObjectBindingPattern(location.parent) && ts.isThisInitializedDeclaration(location.parent.parent))) {
                 var declaringClassDeclaration = ts.getClassLikeDeclarationOfSymbol(getParentOfSymbol(prop));
-                if (declaringClassDeclaration && isNodeUsedDuringClassInitialization(node)) {
-                    error(errorNode, ts.Diagnostics.Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor, symbolToString(prop), ts.getTextOfIdentifierOrLiteral(declaringClassDeclaration.name)); // TODO: GH#18217
-                    return false;
-                }
-            }
-            if (ts.isPropertyAccessExpression(node) && ts.isPrivateIdentifier(node.name)) {
-                if (!ts.getContainingClass(node)) {
-                    error(errorNode, ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);
+                if (declaringClassDeclaration && isNodeUsedDuringClassInitialization(location)) {
+                    if (errorNode) {
+                        error(errorNode, ts.Diagnostics.Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor, symbolToString(prop), ts.getTextOfIdentifierOrLiteral(declaringClassDeclaration.name));
+                    }
                     return false;
                 }
-                return true;
             }
             // Public properties are otherwise accessible.
             if (!(flags & 24 /* NonPublicAccessibilityModifier */)) {
@@ -67596,8 +72236,10 @@ var ts;
             // Private property is accessible if the property is within the declaring class
             if (flags & 8 /* Private */) {
                 var declaringClassDeclaration = ts.getClassLikeDeclarationOfSymbol(getParentOfSymbol(prop));
-                if (!isNodeWithinClass(node, declaringClassDeclaration)) {
-                    error(errorNode, ts.Diagnostics.Property_0_is_private_and_only_accessible_within_class_1, symbolToString(prop), typeToString(getDeclaringClass(prop)));
+                if (!isNodeWithinClass(location, declaringClassDeclaration)) {
+                    if (errorNode) {
+                        error(errorNode, ts.Diagnostics.Property_0_is_private_and_only_accessible_within_class_1, symbolToString(prop), typeToString(getDeclaringClass(prop)));
+                    }
                     return false;
                 }
                 return true;
@@ -67609,17 +72251,19 @@ var ts;
             }
             // Find the first enclosing class that has the declaring classes of the protected constituents
             // of the property as base classes
-            var enclosingClass = forEachEnclosingClass(node, function (enclosingDeclaration) {
+            var enclosingClass = forEachEnclosingClass(location, function (enclosingDeclaration) {
                 var enclosingClass = getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingDeclaration));
-                return isClassDerivedFromDeclaringClasses(enclosingClass, prop) ? enclosingClass : undefined;
+                return isClassDerivedFromDeclaringClasses(enclosingClass, prop, writing) ? enclosingClass : undefined;
             });
             // A protected property is accessible if the property is within the declaring class or classes derived from it
             if (!enclosingClass) {
                 // allow PropertyAccessibility if context is in function with this parameter
                 // static member access is disallow
                 var thisParameter = void 0;
-                if (flags & 32 /* Static */ || !(thisParameter = getThisParameterFromNodeContext(node)) || !thisParameter.type) {
-                    error(errorNode, ts.Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses, symbolToString(prop), typeToString(getDeclaringClass(prop) || type));
+                if (flags & 32 /* Static */ || !(thisParameter = getThisParameterFromNodeContext(location)) || !thisParameter.type) {
+                    if (errorNode) {
+                        error(errorNode, ts.Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses, symbolToString(prop), typeToString(getDeclaringClass(prop) || containingType));
+                    }
                     return false;
                 }
                 var thisType = getTypeFromTypeNode(thisParameter.type);
@@ -67629,12 +72273,14 @@ var ts;
             if (flags & 32 /* Static */) {
                 return true;
             }
-            if (type.flags & 262144 /* TypeParameter */) {
+            if (containingType.flags & 262144 /* TypeParameter */) {
                 // get the original type -- represented as the type constraint of the 'this' type
-                type = type.isThisType ? getConstraintOfTypeParameter(type) : getBaseConstraintOfType(type); // TODO: GH#18217 Use a different variable that's allowed to be undefined
+                containingType = containingType.isThisType ? getConstraintOfTypeParameter(containingType) : getBaseConstraintOfType(containingType); // TODO: GH#18217 Use a different variable that's allowed to be undefined
             }
-            if (!type || !hasBaseType(type, enclosingClass)) {
-                error(errorNode, ts.Diagnostics.Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1, symbolToString(prop), typeToString(enclosingClass));
+            if (!containingType || !hasBaseType(containingType, enclosingClass)) {
+                if (errorNode) {
+                    error(errorNode, ts.Diagnostics.Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_class_2, symbolToString(prop), typeToString(enclosingClass), typeToString(containingType));
+                }
                 return false;
             }
             return true;
@@ -67685,25 +72331,26 @@ var ts;
         }
         function checkNonNullNonVoidType(type, node) {
             var nonNullType = checkNonNullType(type, node);
-            if (nonNullType !== errorType && nonNullType.flags & 16384 /* Void */) {
+            if (nonNullType.flags & 16384 /* Void */) {
                 error(node, ts.Diagnostics.Object_is_possibly_undefined);
             }
             return nonNullType;
         }
-        function checkPropertyAccessExpression(node) {
-            return node.flags & 32 /* OptionalChain */ ? checkPropertyAccessChain(node) :
-                checkPropertyAccessExpressionOrQualifiedName(node, node.expression, checkNonNullExpression(node.expression), node.name);
+        function checkPropertyAccessExpression(node, checkMode) {
+            return node.flags & 32 /* OptionalChain */ ? checkPropertyAccessChain(node, checkMode) :
+                checkPropertyAccessExpressionOrQualifiedName(node, node.expression, checkNonNullExpression(node.expression), node.name, checkMode);
         }
-        function checkPropertyAccessChain(node) {
+        function checkPropertyAccessChain(node, checkMode) {
             var leftType = checkExpression(node.expression);
             var nonOptionalType = getOptionalExpressionType(leftType, node.expression);
-            return propagateOptionalTypeMarker(checkPropertyAccessExpressionOrQualifiedName(node, node.expression, checkNonNullType(nonOptionalType, node.expression), node.name), node, nonOptionalType !== leftType);
+            return propagateOptionalTypeMarker(checkPropertyAccessExpressionOrQualifiedName(node, node.expression, checkNonNullType(nonOptionalType, node.expression), node.name, checkMode), node, nonOptionalType !== leftType);
         }
-        function checkQualifiedName(node) {
-            return checkPropertyAccessExpressionOrQualifiedName(node, node.left, checkNonNullExpression(node.left), node.right);
+        function checkQualifiedName(node, checkMode) {
+            var leftType = ts.isPartOfTypeQuery(node) && ts.isThisIdentifier(node.left) ? checkNonNullType(checkThisExpression(node.left), node.left) : checkNonNullExpression(node.left);
+            return checkPropertyAccessExpressionOrQualifiedName(node, node.left, leftType, node.right, checkMode);
         }
         function isMethodAccessForCall(node) {
-            while (node.parent.kind === 207 /* ParenthesizedExpression */) {
+            while (node.parent.kind === 211 /* ParenthesizedExpression */) {
                 node = node.parent;
             }
             return ts.isCallOrNewExpression(node.parent) && node.parent.expression === node;
@@ -67719,6 +72366,36 @@ var ts;
                 }
             }
         }
+        function checkGrammarPrivateIdentifierExpression(privId) {
+            if (!ts.getContainingClass(privId)) {
+                return grammarErrorOnNode(privId, ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);
+            }
+            if (!ts.isExpressionNode(privId)) {
+                return grammarErrorOnNode(privId, ts.Diagnostics.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);
+            }
+            if (!getSymbolForPrivateIdentifierExpression(privId)) {
+                return grammarErrorOnNode(privId, ts.Diagnostics.Cannot_find_name_0, ts.idText(privId));
+            }
+            return false;
+        }
+        function checkPrivateIdentifierExpression(privId) {
+            checkGrammarPrivateIdentifierExpression(privId);
+            var symbol = getSymbolForPrivateIdentifierExpression(privId);
+            if (symbol) {
+                markPropertyAsReferenced(symbol, /* nodeForCheckWriteOnly: */ undefined, /* isThisAccess: */ false);
+            }
+            return anyType;
+        }
+        function getSymbolForPrivateIdentifierExpression(privId) {
+            if (!ts.isExpressionNode(privId)) {
+                return undefined;
+            }
+            var links = getNodeLinks(privId);
+            if (links.resolvedSymbol === undefined) {
+                links.resolvedSymbol = lookupSymbolForPrivateIdentifierDeclaration(privId.escapedText, privId);
+            }
+            return links.resolvedSymbol;
+        }
         function getPrivateIdentifierPropertyOfType(leftType, lexicallyScopedIdentifier) {
             return getPropertyOfType(leftType, lexicallyScopedIdentifier.escapedName);
         }
@@ -67738,14 +72415,13 @@ var ts;
             }
             var diagName = diagnosticName(right);
             if (propertyOnType) {
-                var typeValueDecl = propertyOnType.valueDeclaration;
-                var typeClass_1 = ts.getContainingClass(typeValueDecl);
-                ts.Debug.assert(!!typeClass_1);
+                var typeValueDecl = ts.Debug.checkDefined(propertyOnType.valueDeclaration);
+                var typeClass_1 = ts.Debug.checkDefined(ts.getContainingClass(typeValueDecl));
                 // We found a private identifier property with the same description.
                 // Either:
                 // - There is a lexically scoped private identifier AND it shadows the one we found on the type.
                 // - It is an attempt to access the private identifier outside of the class.
-                if (lexicallyScopedIdentifier) {
+                if (lexicallyScopedIdentifier === null || lexicallyScopedIdentifier === void 0 ? void 0 : lexicallyScopedIdentifier.valueDeclaration) {
                     var lexicalValueDecl = lexicallyScopedIdentifier.valueDeclaration;
                     var lexicalClass = ts.getContainingClass(lexicalValueDecl);
                     ts.Debug.assert(!!lexicalClass);
@@ -67764,20 +72440,45 @@ var ts;
             return (isConstructorDeclaredProperty(prop) || ts.isThisProperty(node) && isAutoTypedProperty(prop))
                 && ts.getThisContainer(node, /*includeArrowFunctions*/ true) === getDeclaringConstructor(prop);
         }
-        function checkPropertyAccessExpressionOrQualifiedName(node, left, leftType, right) {
+        function checkPropertyAccessExpressionOrQualifiedName(node, left, leftType, right, checkMode) {
             var parentSymbol = getNodeLinks(left).resolvedSymbol;
             var assignmentKind = ts.getAssignmentTargetKind(node);
             var apparentType = getApparentType(assignmentKind !== 0 /* None */ || isMethodAccessForCall(node) ? getWidenedType(leftType) : leftType);
-            if (ts.isPrivateIdentifier(right)) {
-                checkExternalEmitHelpers(node, 524288 /* ClassPrivateFieldGet */);
-            }
             var isAnyLike = isTypeAny(apparentType) || apparentType === silentNeverType;
             var prop;
             if (ts.isPrivateIdentifier(right)) {
+                if (languageVersion < 99 /* ESNext */) {
+                    if (assignmentKind !== 0 /* None */) {
+                        checkExternalEmitHelpers(node, 1048576 /* ClassPrivateFieldSet */);
+                    }
+                    if (assignmentKind !== 1 /* Definite */) {
+                        checkExternalEmitHelpers(node, 524288 /* ClassPrivateFieldGet */);
+                    }
+                }
                 var lexicallyScopedSymbol = lookupSymbolForPrivateIdentifierDeclaration(right.escapedText, right);
+                if (assignmentKind && lexicallyScopedSymbol && lexicallyScopedSymbol.valueDeclaration && ts.isMethodDeclaration(lexicallyScopedSymbol.valueDeclaration)) {
+                    grammarErrorOnNode(right, ts.Diagnostics.Cannot_assign_to_private_method_0_Private_methods_are_not_writable, ts.idText(right));
+                }
+                if ((lexicallyScopedSymbol === null || lexicallyScopedSymbol === void 0 ? void 0 : lexicallyScopedSymbol.valueDeclaration) && (ts.getEmitScriptTarget(compilerOptions) === 99 /* ESNext */ && !useDefineForClassFields)) {
+                    var lexicalClass_1 = ts.getContainingClass(lexicallyScopedSymbol.valueDeclaration);
+                    var parentStaticFieldInitializer = ts.findAncestor(node, function (n) {
+                        if (n === lexicalClass_1)
+                            return "quit";
+                        if (ts.isPropertyDeclaration(n.parent) && ts.hasStaticModifier(n.parent) && n.parent.initializer === n && n.parent.parent === lexicalClass_1) {
+                            return true;
+                        }
+                        return false;
+                    });
+                    if (parentStaticFieldInitializer) {
+                        var parentStaticFieldInitializerSymbol = getSymbolOfNode(parentStaticFieldInitializer.parent);
+                        ts.Debug.assert(parentStaticFieldInitializerSymbol, "Initializer without declaration symbol");
+                        var diagnostic = error(node, ts.Diagnostics.Property_0_may_not_be_used_in_a_static_property_s_initializer_in_the_same_class_when_target_is_esnext_and_useDefineForClassFields_is_false, ts.symbolName(lexicallyScopedSymbol));
+                        ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(parentStaticFieldInitializer.parent, ts.Diagnostics.Initializer_for_property_0, ts.symbolName(parentStaticFieldInitializerSymbol)));
+                    }
+                }
                 if (isAnyLike) {
                     if (lexicallyScopedSymbol) {
-                        return apparentType;
+                        return isErrorType(apparentType) ? errorType : apparentType;
                     }
                     if (!ts.getContainingClass(right)) {
                         grammarErrorOnNode(right, ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);
@@ -67789,13 +72490,20 @@ var ts;
                 if (!prop && checkPrivateIdentifierPropertyAccess(leftType, right, lexicallyScopedSymbol)) {
                     return errorType;
                 }
+                else {
+                    var isSetonlyAccessor = prop && prop.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */);
+                    if (isSetonlyAccessor && assignmentKind !== 1 /* Definite */) {
+                        error(node, ts.Diagnostics.Private_accessor_was_defined_without_a_getter);
+                    }
+                }
             }
             else {
                 if (isAnyLike) {
                     if (ts.isIdentifier(left) && parentSymbol) {
                         markAliasReferenced(parentSymbol, node);
                     }
-                    return apparentType;
+                    return isErrorType(apparentType) ? errorType : apparentType;
+                    ;
                 }
                 prop = getPropertyOfType(apparentType, right.escapedText);
             }
@@ -67808,9 +72516,11 @@ var ts;
             }
             var propType;
             if (!prop) {
-                var indexInfo = !ts.isPrivateIdentifier(right) && (assignmentKind === 0 /* None */ || !isGenericObjectType(leftType) || isThisTypeParameter(leftType)) ? getIndexInfoOfType(apparentType, 0 /* String */) : undefined;
+                var indexInfo = !ts.isPrivateIdentifier(right) && (assignmentKind === 0 /* None */ || !isGenericObjectType(leftType) || isThisTypeParameter(leftType)) ?
+                    getApplicableIndexInfoForName(apparentType, right.escapedText) : undefined;
                 if (!(indexInfo && indexInfo.type)) {
-                    if (isJSLiteralType(leftType)) {
+                    var isUncheckedJS = isUncheckedJSSuggestion(node, leftType.symbol, /*excludeClasses*/ true);
+                    if (!isUncheckedJS && isJSLiteralType(leftType)) {
                         return anyType;
                     }
                     if (leftType.symbol === globalThisSymbol) {
@@ -67823,7 +72533,7 @@ var ts;
                         return anyType;
                     }
                     if (right.escapedText && !checkAndReportErrorForExtendingInterface(node)) {
-                        reportNonexistentProperty(right, isThisTypeParameter(leftType) ? apparentType : leftType);
+                        reportNonexistentProperty(right, isThisTypeParameter(leftType) ? apparentType : leftType, isUncheckedJS);
                     }
                     return errorType;
                 }
@@ -67836,44 +72546,72 @@ var ts;
                 }
             }
             else {
-                if (getDeclarationNodeFlagsFromSymbol(prop) & 134217728 /* Deprecated */ && isUncalledFunctionReference(node, prop)) {
+                if (prop.declarations && getDeclarationNodeFlagsFromSymbol(prop) & 134217728 /* Deprecated */ && isUncalledFunctionReference(node, prop)) {
                     addDeprecatedSuggestion(right, prop.declarations, right.escapedText);
                 }
                 checkPropertyNotUsedBeforeDeclaration(prop, node, right);
-                markPropertyAsReferenced(prop, node, left.kind === 107 /* ThisKeyword */);
+                markPropertyAsReferenced(prop, node, isSelfTypeAccess(left, parentSymbol));
                 getNodeLinks(node).resolvedSymbol = prop;
-                checkPropertyAccessibility(node, left.kind === 105 /* SuperKeyword */, apparentType, prop);
+                var writing = ts.isWriteAccess(node);
+                checkPropertyAccessibility(node, left.kind === 106 /* SuperKeyword */, writing, apparentType, prop);
                 if (isAssignmentToReadonlyEntity(node, prop, assignmentKind)) {
                     error(right, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, ts.idText(right));
                     return errorType;
                 }
-                propType = isThisPropertyAccessInConstructor(node, prop) ? autoType : getConstraintForLocation(getTypeOfSymbol(prop), node);
+                propType = isThisPropertyAccessInConstructor(node, prop) ? autoType : writing ? getSetAccessorTypeOfSymbol(prop) : getTypeOfSymbol(prop);
             }
-            return getFlowTypeOfAccessExpression(node, prop, propType, right);
+            return getFlowTypeOfAccessExpression(node, prop, propType, right, checkMode);
         }
-        function getFlowTypeOfAccessExpression(node, prop, propType, errorNode) {
+        /**
+         * Determines whether a did-you-mean error should be a suggestion in an unchecked JS file.
+         * Only applies to unchecked JS files without checkJS, // @ts-check or // @ts-nocheck
+         * It does not suggest when the suggestion:
+         * - Is from a global file that is different from the reference file, or
+         * - (optionally) Is a class, or is a this.x property access expression
+         */
+        function isUncheckedJSSuggestion(node, suggestion, excludeClasses) {
+            var file = ts.getSourceFileOfNode(node);
+            if (file) {
+                if (compilerOptions.checkJs === undefined && file.checkJsDirective === undefined && (file.scriptKind === 1 /* JS */ || file.scriptKind === 2 /* JSX */)) {
+                    var declarationFile = ts.forEach(suggestion === null || suggestion === void 0 ? void 0 : suggestion.declarations, ts.getSourceFileOfNode);
+                    return !(file !== declarationFile && !!declarationFile && isGlobalSourceFile(declarationFile))
+                        && !(excludeClasses && suggestion && suggestion.flags & 32 /* Class */)
+                        && !(!!node && excludeClasses && ts.isPropertyAccessExpression(node) && node.expression.kind === 108 /* ThisKeyword */);
+                }
+            }
+            return false;
+        }
+        function getFlowTypeOfAccessExpression(node, prop, propType, errorNode, checkMode) {
             // Only compute control flow type if this is a property access expression that isn't an
             // assignment target, and the referenced property was declared as a variable, property,
             // accessor, or optional method.
             var assignmentKind = ts.getAssignmentTargetKind(node);
-            if (assignmentKind === 1 /* Definite */ ||
-                prop && !(prop.flags & (3 /* Variable */ | 4 /* Property */ | 98304 /* Accessor */)) && !(prop.flags & 8192 /* Method */ && propType.flags & 1048576 /* Union */)) {
+            if (assignmentKind === 1 /* Definite */) {
+                return removeMissingType(propType, !!(prop && prop.flags & 16777216 /* Optional */));
+            }
+            if (prop &&
+                !(prop.flags & (3 /* Variable */ | 4 /* Property */ | 98304 /* Accessor */))
+                && !(prop.flags & 8192 /* Method */ && propType.flags & 1048576 /* Union */)
+                && !isDuplicatedCommonJSExport(prop.declarations)) {
                 return propType;
             }
             if (propType === autoType) {
                 return getFlowTypeOfProperty(node, prop);
             }
+            propType = getNarrowableTypeForReference(propType, node, checkMode);
             // If strict null checks and strict property initialization checks are enabled, if we have
             // a this.xxx property access, if the property is an instance property without an initializer,
             // and if we are in a constructor of the same class as the property declaration, assume that
             // the property is uninitialized at the top of the control flow.
             var assumeUninitialized = false;
-            if (strictNullChecks && strictPropertyInitialization && ts.isAccessExpression(node) && node.expression.kind === 107 /* ThisKeyword */) {
+            if (strictNullChecks && strictPropertyInitialization && ts.isAccessExpression(node) && node.expression.kind === 108 /* ThisKeyword */) {
                 var declaration = prop && prop.valueDeclaration;
-                if (declaration && isInstancePropertyWithoutInitializer(declaration)) {
-                    var flowContainer = getControlFlowContainer(node);
-                    if (flowContainer.kind === 166 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 8388608 /* Ambient */)) {
-                        assumeUninitialized = true;
+                if (declaration && isPropertyWithoutInitializer(declaration)) {
+                    if (!ts.isStatic(declaration)) {
+                        var flowContainer = getControlFlowContainer(node);
+                        if (flowContainer.kind === 170 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 8388608 /* Ambient */)) {
+                            assumeUninitialized = true;
+                        }
                     }
                 }
             }
@@ -67898,14 +72636,15 @@ var ts;
             }
             var diagnosticMessage;
             var declarationName = ts.idText(right);
-            if (isInPropertyInitializer(node)
+            if (isInPropertyInitializerOrClassStaticBlock(node)
+                && !isOptionalPropertyDeclaration(valueDeclaration)
                 && !(ts.isAccessExpression(node) && ts.isAccessExpression(node.expression))
                 && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)
-                && !isPropertyDeclaredInAncestorClass(prop)) {
+                && (compilerOptions.useDefineForClassFields || !isPropertyDeclaredInAncestorClass(prop))) {
                 diagnosticMessage = error(right, ts.Diagnostics.Property_0_is_used_before_its_initialization, declarationName);
             }
-            else if (valueDeclaration.kind === 252 /* ClassDeclaration */ &&
-                node.parent.kind !== 173 /* TypeReference */ &&
+            else if (valueDeclaration.kind === 256 /* ClassDeclaration */ &&
+                node.parent.kind !== 177 /* TypeReference */ &&
                 !(valueDeclaration.flags & 8388608 /* Ambient */) &&
                 !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) {
                 diagnosticMessage = error(right, ts.Diagnostics.Class_0_used_before_its_declaration, declarationName);
@@ -67914,26 +72653,29 @@ var ts;
                 ts.addRelatedInfo(diagnosticMessage, ts.createDiagnosticForNode(valueDeclaration, ts.Diagnostics._0_is_declared_here, declarationName));
             }
         }
-        function isInPropertyInitializer(node) {
+        function isInPropertyInitializerOrClassStaticBlock(node) {
             return !!ts.findAncestor(node, function (node) {
                 switch (node.kind) {
-                    case 163 /* PropertyDeclaration */:
+                    case 166 /* PropertyDeclaration */:
                         return true;
-                    case 288 /* PropertyAssignment */:
-                    case 165 /* MethodDeclaration */:
-                    case 167 /* GetAccessor */:
-                    case 168 /* SetAccessor */:
-                    case 290 /* SpreadAssignment */:
-                    case 158 /* ComputedPropertyName */:
-                    case 228 /* TemplateSpan */:
-                    case 283 /* JsxExpression */:
-                    case 280 /* JsxAttribute */:
-                    case 281 /* JsxAttributes */:
-                    case 282 /* JsxSpreadAttribute */:
-                    case 275 /* JsxOpeningElement */:
-                    case 223 /* ExpressionWithTypeArguments */:
-                    case 286 /* HeritageClause */:
+                    case 294 /* PropertyAssignment */:
+                    case 168 /* MethodDeclaration */:
+                    case 171 /* GetAccessor */:
+                    case 172 /* SetAccessor */:
+                    case 296 /* SpreadAssignment */:
+                    case 161 /* ComputedPropertyName */:
+                    case 232 /* TemplateSpan */:
+                    case 287 /* JsxExpression */:
+                    case 284 /* JsxAttribute */:
+                    case 285 /* JsxAttributes */:
+                    case 286 /* JsxSpreadAttribute */:
+                    case 279 /* JsxOpeningElement */:
+                    case 227 /* ExpressionWithTypeArguments */:
+                    case 290 /* HeritageClause */:
                         return false;
+                    case 213 /* ArrowFunction */:
+                    case 237 /* ExpressionStatement */:
+                        return ts.isBlock(node.parent) && ts.isClassStaticBlockDeclaration(node.parent.parent) ? true : "quit";
                     default:
                         return ts.isExpressionNode(node) ? false : "quit";
                 }
@@ -67966,13 +72708,13 @@ var ts;
             }
             return getIntersectionType(x);
         }
-        function reportNonexistentProperty(propNode, containingType) {
+        function reportNonexistentProperty(propNode, containingType, isUncheckedJS) {
             var errorInfo;
             var relatedInfo;
             if (!ts.isPrivateIdentifier(propNode) && containingType.flags & 1048576 /* Union */ && !(containingType.flags & 131068 /* Primitive */)) {
                 for (var _i = 0, _a = containingType.types; _i < _a.length; _i++) {
                     var subtype = _a[_i];
-                    if (!getPropertyOfType(subtype, propNode.escapedText) && !getIndexInfoOfType(subtype, 0 /* String */)) {
+                    if (!getPropertyOfType(subtype, propNode.escapedText) && !getApplicableIndexInfoForName(subtype, propNode.escapedText)) {
                         errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.declarationNameToString(propNode), typeToString(subtype));
                         break;
                     }
@@ -68000,11 +72742,15 @@ var ts;
                         var suggestion = getSuggestedSymbolForNonexistentProperty(propNode, containingType);
                         if (suggestion !== undefined) {
                             var suggestedName = ts.symbolName(suggestion);
-                            errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2, missingProperty, container, suggestedName);
+                            var message = isUncheckedJS ? ts.Diagnostics.Property_0_may_not_exist_on_type_1_Did_you_mean_2 : ts.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2;
+                            errorInfo = ts.chainDiagnosticMessages(errorInfo, message, missingProperty, container, suggestedName);
                             relatedInfo = suggestion.valueDeclaration && ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestedName);
                         }
                         else {
-                            errorInfo = ts.chainDiagnosticMessages(elaborateNeverIntersection(errorInfo, containingType), ts.Diagnostics.Property_0_does_not_exist_on_type_1, missingProperty, container);
+                            var diagnostic = containerSeemsToBeEmptyDomElement(containingType)
+                                ? ts.Diagnostics.Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom
+                                : ts.Diagnostics.Property_0_does_not_exist_on_type_1;
+                            errorInfo = ts.chainDiagnosticMessages(elaborateNeverIntersection(errorInfo, containingType), diagnostic, missingProperty, container);
                         }
                     }
                 }
@@ -68013,11 +72759,16 @@ var ts;
             if (relatedInfo) {
                 ts.addRelatedInfo(resultDiagnostic, relatedInfo);
             }
-            diagnostics.add(resultDiagnostic);
+            addErrorOrSuggestion(!isUncheckedJS || errorInfo.code !== ts.Diagnostics.Property_0_may_not_exist_on_type_1_Did_you_mean_2.code, resultDiagnostic);
+        }
+        function containerSeemsToBeEmptyDomElement(containingType) {
+            return (compilerOptions.lib && !compilerOptions.lib.includes("dom")) &&
+                everyContainedType(containingType, function (type) { return type.symbol && /^(EventTarget|Node|((HTML[a-zA-Z]*)?Element))$/.test(ts.unescapeLeadingUnderscores(type.symbol.escapedName)); }) &&
+                isEmptyObjectType(containingType);
         }
         function typeHasStaticProperty(propName, containingType) {
             var prop = containingType.symbol && getPropertyOfType(getTypeOfSymbol(containingType.symbol), propName);
-            return prop !== undefined && prop.valueDeclaration && ts.hasSyntacticModifier(prop.valueDeclaration, 32 /* Static */);
+            return prop !== undefined && !!prop.valueDeclaration && ts.isStatic(prop.valueDeclaration);
         }
         function getSuggestedLibForNonExistentName(name) {
             var missingName = diagnosticName(name);
@@ -68047,8 +72798,19 @@ var ts;
                 }
             }
         }
+        function getSuggestedSymbolForNonexistentClassMember(name, baseType) {
+            return getSpellingSuggestionForName(name, getPropertiesOfType(baseType), 106500 /* ClassMember */);
+        }
         function getSuggestedSymbolForNonexistentProperty(name, containingType) {
-            return getSpellingSuggestionForName(ts.isString(name) ? name : ts.idText(name), getPropertiesOfType(containingType), 111551 /* Value */);
+            var props = getPropertiesOfType(containingType);
+            if (typeof name !== "string") {
+                var parent_2 = name.parent;
+                if (ts.isPropertyAccessExpression(parent_2)) {
+                    props = ts.filter(props, function (prop) { return isValidPropertyAccessForCompletions(parent_2, containingType, prop); });
+                }
+                name = ts.idText(name);
+            }
+            return getSpellingSuggestionForName(name, props, 111551 /* Value */);
         }
         function getSuggestedSymbolForNonexistentJSXAttribute(name, containingType) {
             var strName = ts.isString(name) ? name : ts.idText(name);
@@ -68070,7 +72832,19 @@ var ts;
                 // Sometimes the symbol is found when location is a return type of a function: `typeof x` and `x` is declared in the body of the function
                 // So the table *contains* `x` but `x` isn't actually in scope.
                 // However, resolveNameHelper will continue and call this callback again, so we'll eventually get a correct suggestion.
-                return symbol || getSpellingSuggestionForName(ts.unescapeLeadingUnderscores(name), ts.arrayFrom(symbols.values()), meaning);
+                if (symbol)
+                    return symbol;
+                var candidates;
+                if (symbols === globals) {
+                    var primitives = ts.mapDefined(["string", "number", "boolean", "object", "bigint", "symbol"], function (s) { return symbols.has((s.charAt(0).toUpperCase() + s.slice(1)))
+                        ? createSymbol(524288 /* TypeAlias */, s)
+                        : undefined; });
+                    candidates = primitives.concat(ts.arrayFrom(symbols.values()));
+                }
+                else {
+                    candidates = ts.arrayFrom(symbols.values());
+                }
+                return getSpellingSuggestionForName(ts.unescapeLeadingUnderscores(name), candidates, meaning);
             });
             return result;
         }
@@ -68109,6 +72883,10 @@ var ts;
             }
             return suggestion;
         }
+        function getSuggestedTypeForNonexistentStringLiteralType(source, target) {
+            var candidates = target.types.filter(function (type) { return !!(type.flags & 128 /* StringLiteral */); });
+            return ts.getSpellingSuggestion(source.value, candidates, function (type) { return type.value; });
+        }
         /**
          * Given a name and a list of symbols whose names are *not* equal to the name, return a spelling suggestion if there is one that is close enough.
          * Names less than length 3 only check for case-insensitive equality, not levenshtein distance.
@@ -68143,20 +72921,20 @@ var ts;
                 return undefined;
             }
         }
-        function markPropertyAsReferenced(prop, nodeForCheckWriteOnly, isThisAccess) {
+        function markPropertyAsReferenced(prop, nodeForCheckWriteOnly, isSelfTypeAccess) {
             var valueDeclaration = prop && (prop.flags & 106500 /* ClassMember */) && prop.valueDeclaration;
             if (!valueDeclaration) {
                 return;
             }
             var hasPrivateModifier = ts.hasEffectiveModifier(valueDeclaration, 8 /* Private */);
-            var hasPrivateIdentifier = ts.isNamedDeclaration(prop.valueDeclaration) && ts.isPrivateIdentifier(prop.valueDeclaration.name);
+            var hasPrivateIdentifier = prop.valueDeclaration && ts.isNamedDeclaration(prop.valueDeclaration) && ts.isPrivateIdentifier(prop.valueDeclaration.name);
             if (!hasPrivateModifier && !hasPrivateIdentifier) {
                 return;
             }
             if (nodeForCheckWriteOnly && ts.isWriteOnlyAccess(nodeForCheckWriteOnly) && !(prop.flags & 65536 /* SetAccessor */)) {
                 return;
             }
-            if (isThisAccess) {
+            if (isSelfTypeAccess) {
                 // Find any FunctionLikeDeclaration because those create a new 'this' binding. But this should only matter for methods (or getters/setters).
                 var containingMethod = ts.findAncestor(nodeForCheckWriteOnly, ts.isFunctionLikeDeclaration);
                 if (containingMethod && containingMethod.symbol === prop) {
@@ -68165,47 +72943,78 @@ var ts;
             }
             (ts.getCheckFlags(prop) & 1 /* Instantiated */ ? getSymbolLinks(prop).target : prop).isReferenced = 67108863 /* All */;
         }
+        function isSelfTypeAccess(name, parent) {
+            return name.kind === 108 /* ThisKeyword */
+                || !!parent && ts.isEntityNameExpression(name) && parent === getResolvedSymbol(ts.getFirstIdentifier(name));
+        }
         function isValidPropertyAccess(node, propertyName) {
             switch (node.kind) {
-                case 201 /* PropertyAccessExpression */:
-                    return isValidPropertyAccessWithType(node, node.expression.kind === 105 /* SuperKeyword */, propertyName, getWidenedType(checkExpression(node.expression)));
-                case 157 /* QualifiedName */:
+                case 205 /* PropertyAccessExpression */:
+                    return isValidPropertyAccessWithType(node, node.expression.kind === 106 /* SuperKeyword */, propertyName, getWidenedType(checkExpression(node.expression)));
+                case 160 /* QualifiedName */:
                     return isValidPropertyAccessWithType(node, /*isSuper*/ false, propertyName, getWidenedType(checkExpression(node.left)));
-                case 195 /* ImportType */:
+                case 199 /* ImportType */:
                     return isValidPropertyAccessWithType(node, /*isSuper*/ false, propertyName, getTypeFromTypeNode(node));
             }
         }
+        /**
+         * Checks if an existing property access is valid for completions purposes.
+         * @param node a property access-like node where we want to check if we can access a property.
+         * This node does not need to be an access of the property we are checking.
+         * e.g. in completions, this node will often be an incomplete property access node, as in `foo.`.
+         * Besides providing a location (i.e. scope) used to check property accessibility, we use this node for
+         * computing whether this is a `super` property access.
+         * @param type the type whose property we are checking.
+         * @param property the accessed property's symbol.
+         */
         function isValidPropertyAccessForCompletions(node, type, property) {
-            return isValidPropertyAccessWithType(node, node.kind === 201 /* PropertyAccessExpression */ && node.expression.kind === 105 /* SuperKeyword */, property.escapedName, type);
+            return isPropertyAccessible(node, node.kind === 205 /* PropertyAccessExpression */ && node.expression.kind === 106 /* SuperKeyword */, 
+            /* isWrite */ false, type, property);
             // Previously we validated the 'this' type of methods but this adversely affected performance. See #31377 for more context.
         }
         function isValidPropertyAccessWithType(node, isSuper, propertyName, type) {
-            if (type === errorType || isTypeAny(type)) {
+            // Short-circuiting for improved performance.
+            if (isTypeAny(type)) {
                 return true;
             }
             var prop = getPropertyOfType(type, propertyName);
-            if (prop) {
-                if (ts.isPropertyAccessExpression(node) && prop.valueDeclaration && ts.isPrivateIdentifierPropertyDeclaration(prop.valueDeclaration)) {
-                    var declClass_1 = ts.getContainingClass(prop.valueDeclaration);
-                    return !ts.isOptionalChain(node) && !!ts.findAncestor(node, function (parent) { return parent === declClass_1; });
-                }
-                return checkPropertyAccessibility(node, isSuper, type, prop);
+            return !!prop && isPropertyAccessible(node, isSuper, /* isWrite */ false, type, prop);
+        }
+        /**
+         * Checks if a property can be accessed in a location.
+         * The location is given by the `node` parameter.
+         * The node does not need to be a property access.
+         * @param node location where to check property accessibility
+         * @param isSuper whether to consider this a `super` property access, e.g. `super.foo`.
+         * @param isWrite whether this is a write access, e.g. `++foo.x`.
+         * @param containingType type where the property comes from.
+         * @param property property symbol.
+         */
+        function isPropertyAccessible(node, isSuper, isWrite, containingType, property) {
+            // Short-circuiting for improved performance.
+            if (isTypeAny(containingType)) {
+                return true;
             }
-            // In js files properties of unions are allowed in completion
-            return ts.isInJSFile(node) && (type.flags & 1048576 /* Union */) !== 0 && type.types.some(function (elementType) { return isValidPropertyAccessWithType(node, isSuper, propertyName, elementType); });
+            // A #private property access in an optional chain is an error dealt with by the parser.
+            // The checker does not check for it, so we need to do our own check here.
+            if (property.valueDeclaration && ts.isPrivateIdentifierClassElementDeclaration(property.valueDeclaration)) {
+                var declClass_1 = ts.getContainingClass(property.valueDeclaration);
+                return !ts.isOptionalChain(node) && !!ts.findAncestor(node, function (parent) { return parent === declClass_1; });
+            }
+            return checkPropertyAccessibilityAtLocation(node, isSuper, isWrite, containingType, property);
         }
         /**
          * Return the symbol of the for-in variable declared or referenced by the given for-in statement.
          */
         function getForInVariableSymbol(node) {
             var initializer = node.initializer;
-            if (initializer.kind === 250 /* VariableDeclarationList */) {
+            if (initializer.kind === 254 /* VariableDeclarationList */) {
                 var variable = initializer.declarations[0];
                 if (variable && !ts.isBindingPattern(variable.name)) {
                     return getSymbolOfNode(variable);
                 }
             }
-            else if (initializer.kind === 78 /* Identifier */) {
+            else if (initializer.kind === 79 /* Identifier */) {
                 return getResolvedSymbol(initializer);
             }
             return undefined;
@@ -68214,7 +73023,7 @@ var ts;
          * Return true if the given type is considered to have numeric property names.
          */
         function hasNumericPropertyNames(type) {
-            return getIndexTypeOfType(type, 1 /* Number */) && !getIndexTypeOfType(type, 0 /* String */);
+            return getIndexInfosOfType(type).length === 1 && !!getIndexInfoOfType(type, numberType);
         }
         /**
          * Return true if given node is an expression consisting of an identifier (possibly parenthesized)
@@ -68222,13 +73031,13 @@ var ts;
          */
         function isForInVariableForNumericPropertyNames(expr) {
             var e = ts.skipParentheses(expr);
-            if (e.kind === 78 /* Identifier */) {
+            if (e.kind === 79 /* Identifier */) {
                 var symbol = getResolvedSymbol(e);
                 if (symbol.flags & 3 /* Variable */) {
                     var child = expr;
                     var node = expr.parent;
                     while (node) {
-                        if (node.kind === 238 /* ForInStatement */ &&
+                        if (node.kind === 242 /* ForInStatement */ &&
                             child === node.statement &&
                             getForInVariableSymbol(node) === symbol &&
                             hasNumericPropertyNames(getTypeOfExpression(node.expression))) {
@@ -68241,20 +73050,20 @@ var ts;
             }
             return false;
         }
-        function checkIndexedAccess(node) {
-            return node.flags & 32 /* OptionalChain */ ? checkElementAccessChain(node) :
-                checkElementAccessExpression(node, checkNonNullExpression(node.expression));
+        function checkIndexedAccess(node, checkMode) {
+            return node.flags & 32 /* OptionalChain */ ? checkElementAccessChain(node, checkMode) :
+                checkElementAccessExpression(node, checkNonNullExpression(node.expression), checkMode);
         }
-        function checkElementAccessChain(node) {
+        function checkElementAccessChain(node, checkMode) {
             var exprType = checkExpression(node.expression);
             var nonOptionalType = getOptionalExpressionType(exprType, node.expression);
-            return propagateOptionalTypeMarker(checkElementAccessExpression(node, checkNonNullType(nonOptionalType, node.expression)), node, nonOptionalType !== exprType);
+            return propagateOptionalTypeMarker(checkElementAccessExpression(node, checkNonNullType(nonOptionalType, node.expression), checkMode), node, nonOptionalType !== exprType);
         }
-        function checkElementAccessExpression(node, exprType) {
+        function checkElementAccessExpression(node, exprType, checkMode) {
             var objectType = ts.getAssignmentTargetKind(node) !== 0 /* None */ || isMethodAccessForCall(node) ? getWidenedType(exprType) : exprType;
             var indexExpression = node.argumentExpression;
             var indexType = checkExpression(indexExpression);
-            if (objectType === errorType || objectType === silentNeverType) {
+            if (isErrorType(objectType) || objectType === silentNeverType) {
                 return objectType;
             }
             if (isConstEnumObjectType(objectType) && !ts.isStringLiteralLike(indexExpression)) {
@@ -68263,45 +73072,10 @@ var ts;
             }
             var effectiveIndexType = isForInVariableForNumericPropertyNames(indexExpression) ? numberType : indexType;
             var accessFlags = ts.isAssignmentTarget(node) ?
-                2 /* Writing */ | (isGenericObjectType(objectType) && !isThisTypeParameter(objectType) ? 1 /* NoIndexSignatures */ : 0) :
-                0 /* None */;
-            var indexedAccessType = getIndexedAccessTypeOrUndefined(objectType, effectiveIndexType, /*noUncheckedIndexedAccessCandidate*/ undefined, node, accessFlags | 16 /* ExpressionPosition */) || errorType;
-            return checkIndexedAccessIndexType(getFlowTypeOfAccessExpression(node, indexedAccessType.symbol, indexedAccessType, indexExpression), node);
-        }
-        function checkThatExpressionIsProperSymbolReference(expression, expressionType, reportError) {
-            if (expressionType === errorType) {
-                // There is already an error, so no need to report one.
-                return false;
-            }
-            if (!ts.isWellKnownSymbolSyntactically(expression)) {
-                return false;
-            }
-            // Make sure the property type is the primitive symbol type
-            if ((expressionType.flags & 12288 /* ESSymbolLike */) === 0) {
-                if (reportError) {
-                    error(expression, ts.Diagnostics.A_computed_property_name_of_the_form_0_must_be_of_type_symbol, ts.getTextOfNode(expression));
-                }
-                return false;
-            }
-            // The name is Symbol.<someName>, so make sure Symbol actually resolves to the
-            // global Symbol object
-            var leftHandSide = expression.expression;
-            var leftHandSideSymbol = getResolvedSymbol(leftHandSide);
-            if (!leftHandSideSymbol) {
-                return false;
-            }
-            var globalESSymbol = getGlobalESSymbolConstructorSymbol(/*reportErrors*/ true);
-            if (!globalESSymbol) {
-                // Already errored when we tried to look up the symbol
-                return false;
-            }
-            if (leftHandSideSymbol !== globalESSymbol) {
-                if (reportError) {
-                    error(leftHandSide, ts.Diagnostics.Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object);
-                }
-                return false;
-            }
-            return true;
+                4 /* Writing */ | (isGenericObjectType(objectType) && !isThisTypeParameter(objectType) ? 2 /* NoIndexSignatures */ : 0) :
+                32 /* ExpressionPosition */;
+            var indexedAccessType = getIndexedAccessTypeOrUndefined(objectType, effectiveIndexType, accessFlags, node) || errorType;
+            return checkIndexedAccessIndexType(getFlowTypeOfAccessExpression(node, getNodeLinks(node).resolvedSymbol, indexedAccessType, indexExpression, checkMode), node);
         }
         function callLikeExpressionMayHaveTypeArguments(node) {
             return ts.isCallOrNewExpression(node) || ts.isTaggedTemplateExpression(node) || ts.isJsxOpeningLikeElement(node);
@@ -68312,13 +73086,13 @@ var ts;
                 // This gets us diagnostics for the type arguments and marks them as referenced.
                 ts.forEach(node.typeArguments, checkSourceElement);
             }
-            if (node.kind === 205 /* TaggedTemplateExpression */) {
+            if (node.kind === 209 /* TaggedTemplateExpression */) {
                 checkExpression(node.template);
             }
             else if (ts.isJsxOpeningLikeElement(node)) {
                 checkExpression(node.attributes);
             }
-            else if (node.kind !== 161 /* Decorator */) {
+            else if (node.kind !== 164 /* Decorator */) {
                 ts.forEach(node.arguments, function (argument) {
                     checkExpression(argument);
                 });
@@ -68382,7 +73156,7 @@ var ts;
             }
         }
         function isSpreadArgument(arg) {
-            return !!arg && (arg.kind === 220 /* SpreadElement */ || arg.kind === 227 /* SyntheticExpression */ && arg.isSpread);
+            return !!arg && (arg.kind === 224 /* SpreadElement */ || arg.kind === 231 /* SyntheticExpression */ && arg.isSpread);
         }
         function getSpreadArgumentIndex(args) {
             return ts.findIndex(args, isSpreadArgument);
@@ -68399,9 +73173,9 @@ var ts;
             var callIsIncomplete = false; // In incomplete call we want to be lenient when we have too few arguments
             var effectiveParameterCount = getParameterCount(signature);
             var effectiveMinimumArguments = getMinArgumentCount(signature);
-            if (node.kind === 205 /* TaggedTemplateExpression */) {
+            if (node.kind === 209 /* TaggedTemplateExpression */) {
                 argCount = args.length;
-                if (node.template.kind === 218 /* TemplateExpression */) {
+                if (node.template.kind === 222 /* TemplateExpression */) {
                     // If a tagged template expression lacks a tail literal, the call is incomplete.
                     // Specifically, a template only can end in a TemplateTail or a Missing literal.
                     var lastSpan = ts.last(node.template.templateSpans); // we should always have at least one span.
@@ -68416,7 +73190,7 @@ var ts;
                     callIsIncomplete = !!templateLiteral.isUnterminated;
                 }
             }
-            else if (node.kind === 161 /* Decorator */) {
+            else if (node.kind === 164 /* Decorator */) {
                 argCount = getDecoratorArgumentCount(node, signature);
             }
             else if (ts.isJsxOpeningLikeElement(node)) {
@@ -68430,7 +73204,7 @@ var ts;
             }
             else if (!node.arguments) {
                 // This only happens when we have something of the form: 'new C'
-                ts.Debug.assert(node.kind === 204 /* NewExpression */);
+                ts.Debug.assert(node.kind === 208 /* NewExpression */);
                 return getMinArgumentCount(signature) === 0;
             }
             else {
@@ -68479,7 +73253,7 @@ var ts;
         function getSingleSignature(type, kind, allowMembers) {
             if (type.flags & 524288 /* Object */) {
                 var resolved = resolveStructuredTypeMembers(type);
-                if (allowMembers || resolved.properties.length === 0 && !resolved.stringIndexInfo && !resolved.numberIndexInfo) {
+                if (allowMembers || resolved.properties.length === 0 && resolved.indexInfos.length === 0) {
                     if (kind === 0 /* Call */ && resolved.callSignatures.length === 1 && resolved.constructSignatures.length === 0) {
                         return resolved.callSignatures[0];
                     }
@@ -68505,7 +73279,7 @@ var ts;
             });
             if (!inferenceContext) {
                 applyToReturnTypes(contextualSignature, signature, function (source, target) {
-                    inferTypes(context.inferences, source, target, 64 /* ReturnType */);
+                    inferTypes(context.inferences, source, target, 128 /* ReturnType */);
                 });
             }
             return getSignatureInstantiation(signature, getInferredTypes(context), ts.isInJSFile(contextualSignature.declaration));
@@ -68533,7 +73307,7 @@ var ts;
             // example, given a 'function wrap<T, U>(cb: (x: T) => U): (x: T) => U' and a call expression
             // 'let f: (x: string) => number = wrap(s => s.length)', we infer from the declared type of 'f' to the
             // return type of 'wrap'.
-            if (node.kind !== 161 /* Decorator */) {
+            if (node.kind !== 164 /* Decorator */) {
                 var contextualType = getContextualType(node, ts.every(signature.typeParameters, function (p) { return !!getDefaultFromTypeParameter(p); }) ? 8 /* SkipBindingPatterns */ : 0 /* None */);
                 if (contextualType) {
                     // We clone the inference context to avoid disturbing a resolution in progress for an
@@ -68555,7 +73329,7 @@ var ts;
                         instantiatedType;
                     var inferenceTargetType = getReturnTypeOfSignature(signature);
                     // Inferences made from return types have lower priority than all other inferences.
-                    inferTypes(context.inferences, inferenceSourceType, inferenceTargetType, 64 /* ReturnType */);
+                    inferTypes(context.inferences, inferenceSourceType, inferenceTargetType, 128 /* ReturnType */);
                     // Create a type mapper for instantiating generic contextual types using the inferences made
                     // from the return type. We need a separate inference pass here because (a) instantiation of
                     // the source type uses the outer context's return mapper (which excludes inferences made from
@@ -68581,7 +73355,7 @@ var ts;
             }
             for (var i = 0; i < argCount; i++) {
                 var arg = args[i];
-                if (arg.kind !== 222 /* OmittedExpression */) {
+                if (arg.kind !== 226 /* OmittedExpression */) {
                     var paramType = getTypeAtPosition(signature, i);
                     var argType = checkExpressionWithContextualType(arg, paramType, context, checkMode);
                     inferTypes(context.inferences, argType, paramType);
@@ -68605,7 +73379,7 @@ var ts;
                 if (isSpreadArgument(arg)) {
                     // We are inferring from a spread expression in the last argument position, i.e. both the parameter
                     // and the argument are ...x forms.
-                    return getMutableArrayOrTupleType(arg.kind === 227 /* SyntheticExpression */ ? arg.type :
+                    return getMutableArrayOrTupleType(arg.kind === 231 /* SyntheticExpression */ ? arg.type :
                         checkExpressionWithContextualType(arg.expression, restType, context, checkMode));
                 }
             }
@@ -68615,24 +73389,24 @@ var ts;
             for (var i = index; i < argCount; i++) {
                 var arg = args[i];
                 if (isSpreadArgument(arg)) {
-                    var spreadType = arg.kind === 227 /* SyntheticExpression */ ? arg.type : checkExpression(arg.expression);
+                    var spreadType = arg.kind === 231 /* SyntheticExpression */ ? arg.type : checkExpression(arg.expression);
                     if (isArrayLikeType(spreadType)) {
                         types.push(spreadType);
                         flags.push(8 /* Variadic */);
                     }
                     else {
-                        types.push(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, arg.kind === 220 /* SpreadElement */ ? arg.expression : arg));
+                        types.push(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, arg.kind === 224 /* SpreadElement */ ? arg.expression : arg));
                         flags.push(4 /* Rest */);
                     }
                 }
                 else {
-                    var contextualType = getIndexedAccessType(restType, getLiteralType(i - index));
+                    var contextualType = getIndexedAccessType(restType, getNumberLiteralType(i - index), 256 /* Contextual */);
                     var argType = checkExpressionWithContextualType(arg, contextualType, context, checkMode);
                     var hasPrimitiveContextualType = maybeTypeOfKind(contextualType, 131068 /* Primitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */);
                     types.push(hasPrimitiveContextualType ? getRegularTypeOfLiteralType(argType) : getWidenedLiteralType(argType));
                     flags.push(1 /* Required */);
                 }
-                if (arg.kind === 227 /* SyntheticExpression */ && arg.tupleNameSource) {
+                if (arg.kind === 231 /* SyntheticExpression */ && arg.tupleNameSource) {
                     names.push(arg.tupleNameSource);
                 }
             }
@@ -68776,7 +73550,7 @@ var ts;
                 return undefined;
             }
             var thisType = getThisTypeOfSignature(signature);
-            if (thisType && thisType !== voidType && node.kind !== 204 /* NewExpression */) {
+            if (thisType && thisType !== voidType && node.kind !== 208 /* NewExpression */) {
                 // If the called expression is not of the form `x.f` or `x["f"]`, then sourceType = voidType
                 // If the signature's 'this' type is voidType, then the check is skipped -- anything is compatible.
                 // If the expression is a new expression, then the check is skipped.
@@ -68794,7 +73568,7 @@ var ts;
             var argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length;
             for (var i = 0; i < argCount; i++) {
                 var arg = args[i];
-                if (arg.kind !== 222 /* OmittedExpression */) {
+                if (arg.kind !== 226 /* OmittedExpression */) {
                     var paramType = getTypeAtPosition(signature, i);
                     var argType = checkExpressionWithContextualType(arg, paramType, /*inferenceContext*/ undefined, checkMode);
                     // If one or more arguments are still excluded (as indicated by CheckMode.SkipContextSensitive),
@@ -68839,8 +73613,10 @@ var ts;
          * Returns the this argument in calls like x.f(...) and x[f](...). Undefined otherwise.
          */
         function getThisArgumentOfCall(node) {
-            if (node.kind === 203 /* CallExpression */) {
-                var callee = ts.skipOuterExpressions(node.expression);
+            var expression = node.kind === 207 /* CallExpression */ ? node.expression :
+                node.kind === 209 /* TaggedTemplateExpression */ ? node.tag : undefined;
+            if (expression) {
+                var callee = ts.skipOuterExpressions(expression);
                 if (ts.isAccessExpression(callee)) {
                     return callee.expression;
                 }
@@ -68856,17 +73632,17 @@ var ts;
          * Returns the effective arguments for an expression that works like a function invocation.
          */
         function getEffectiveCallArguments(node) {
-            if (node.kind === 205 /* TaggedTemplateExpression */) {
+            if (node.kind === 209 /* TaggedTemplateExpression */) {
                 var template = node.template;
                 var args_3 = [createSyntheticExpression(template, getGlobalTemplateStringsArrayType())];
-                if (template.kind === 218 /* TemplateExpression */) {
+                if (template.kind === 222 /* TemplateExpression */) {
                     ts.forEach(template.templateSpans, function (span) {
                         args_3.push(span.expression);
                     });
                 }
                 return args_3;
             }
-            if (node.kind === 161 /* Decorator */) {
+            if (node.kind === 164 /* Decorator */) {
                 return getEffectiveDecoratorArguments(node);
             }
             if (ts.isJsxOpeningLikeElement(node)) {
@@ -68877,10 +73653,10 @@ var ts;
             if (spreadIndex >= 0) {
                 // Create synthetic arguments from spreads of tuple types.
                 var effectiveArgs_1 = args.slice(0, spreadIndex);
-                var _loop_20 = function (i) {
+                var _loop_23 = function (i) {
                     var arg = args[i];
                     // We can call checkExpressionCached because spread expressions never have a contextual type.
-                    var spreadType = arg.kind === 220 /* SpreadElement */ && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression));
+                    var spreadType = arg.kind === 224 /* SpreadElement */ && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression));
                     if (spreadType && isTupleType(spreadType)) {
                         ts.forEach(getTypeArguments(spreadType), function (t, i) {
                             var _a;
@@ -68894,7 +73670,7 @@ var ts;
                     }
                 };
                 for (var i = spreadIndex; i < args.length; i++) {
-                    _loop_20(i);
+                    _loop_23(i);
                 }
                 return effectiveArgs_1;
             }
@@ -68907,30 +73683,30 @@ var ts;
             var parent = node.parent;
             var expr = node.expression;
             switch (parent.kind) {
-                case 252 /* ClassDeclaration */:
-                case 221 /* ClassExpression */:
+                case 256 /* ClassDeclaration */:
+                case 225 /* ClassExpression */:
                     // For a class decorator, the `target` is the type of the class (e.g. the
                     // "static" or "constructor" side of the class).
                     return [
                         createSyntheticExpression(expr, getTypeOfSymbol(getSymbolOfNode(parent)))
                     ];
-                case 160 /* Parameter */:
+                case 163 /* Parameter */:
                     // A parameter declaration decorator will have three arguments (see
                     // `ParameterDecorator` in core.d.ts).
                     var func = parent.parent;
                     return [
-                        createSyntheticExpression(expr, parent.parent.kind === 166 /* Constructor */ ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType),
+                        createSyntheticExpression(expr, parent.parent.kind === 170 /* Constructor */ ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType),
                         createSyntheticExpression(expr, anyType),
                         createSyntheticExpression(expr, numberType)
                     ];
-                case 163 /* PropertyDeclaration */:
-                case 165 /* MethodDeclaration */:
-                case 167 /* GetAccessor */:
-                case 168 /* SetAccessor */:
+                case 166 /* PropertyDeclaration */:
+                case 168 /* MethodDeclaration */:
+                case 171 /* GetAccessor */:
+                case 172 /* SetAccessor */:
                     // A method or accessor declaration decorator will have two or three arguments (see
                     // `PropertyDecorator` and `MethodDecorator` in core.d.ts). If we are emitting decorators
                     // for ES3, we will only pass two arguments.
-                    var hasPropDesc = parent.kind !== 163 /* PropertyDeclaration */ && languageVersion !== 0 /* ES3 */;
+                    var hasPropDesc = parent.kind !== 166 /* PropertyDeclaration */ && languageVersion !== 0 /* ES3 */;
                     return [
                         createSyntheticExpression(expr, getParentTypeOfClassElement(parent)),
                         createSyntheticExpression(expr, getClassElementPropertyKeyType(parent)),
@@ -68944,17 +73720,17 @@ var ts;
          */
         function getDecoratorArgumentCount(node, signature) {
             switch (node.parent.kind) {
-                case 252 /* ClassDeclaration */:
-                case 221 /* ClassExpression */:
+                case 256 /* ClassDeclaration */:
+                case 225 /* ClassExpression */:
                     return 1;
-                case 163 /* PropertyDeclaration */:
+                case 166 /* PropertyDeclaration */:
                     return 2;
-                case 165 /* MethodDeclaration */:
-                case 167 /* GetAccessor */:
-                case 168 /* SetAccessor */:
+                case 168 /* MethodDeclaration */:
+                case 171 /* GetAccessor */:
+                case 172 /* SetAccessor */:
                     // For ES3 or decorators with only two parameters we supply only two arguments
                     return languageVersion === 0 /* ES3 */ || signature.parameters.length <= 2 ? 2 : 3;
-                case 160 /* Parameter */:
+                case 163 /* Parameter */:
                     return 3;
                 default:
                     return ts.Debug.fail();
@@ -68990,7 +73766,7 @@ var ts;
                 return false;
             var symbol = resolveName(node.expression, node.expression.escapedText, 111551 /* Value */, undefined, undefined, false);
             var decl = symbol === null || symbol === void 0 ? void 0 : symbol.valueDeclaration;
-            if (!decl || !ts.isParameter(decl) || !isFunctionExpressionOrArrowFunction(decl.parent) || !ts.isNewExpression(decl.parent.parent) || !ts.isIdentifier(decl.parent.parent.expression)) {
+            if (!decl || !ts.isParameter(decl) || !ts.isFunctionExpressionOrArrowFunction(decl.parent) || !ts.isNewExpression(decl.parent.parent) || !ts.isIdentifier(decl.parent.parent.expression)) {
                 return false;
             }
             var globalPromiseSymbol = getGlobalPromiseConstructorSymbol(/*reportErrors*/ false);
@@ -69000,77 +73776,66 @@ var ts;
             return constructorSymbol === globalPromiseSymbol;
         }
         function getArgumentArityError(node, signatures, args) {
-            var min = Number.POSITIVE_INFINITY;
-            var max = Number.NEGATIVE_INFINITY;
-            var belowArgCount = Number.NEGATIVE_INFINITY;
-            var aboveArgCount = Number.POSITIVE_INFINITY;
-            var argCount = args.length;
+            var _a;
+            var spreadIndex = getSpreadArgumentIndex(args);
+            if (spreadIndex > -1) {
+                return ts.createDiagnosticForNode(args[spreadIndex], ts.Diagnostics.A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter);
+            }
+            var min = Number.POSITIVE_INFINITY; // smallest parameter count
+            var max = Number.NEGATIVE_INFINITY; // largest parameter count
+            var maxBelow = Number.NEGATIVE_INFINITY; // largest parameter count that is smaller than the number of arguments
+            var minAbove = Number.POSITIVE_INFINITY; // smallest parameter count that is larger than the number of arguments
             var closestSignature;
             for (var _i = 0, signatures_8 = signatures; _i < signatures_8.length; _i++) {
                 var sig = signatures_8[_i];
-                var minCount = getMinArgumentCount(sig);
-                var maxCount = getParameterCount(sig);
-                if (minCount < argCount && minCount > belowArgCount)
-                    belowArgCount = minCount;
-                if (argCount < maxCount && maxCount < aboveArgCount)
-                    aboveArgCount = maxCount;
-                if (minCount < min) {
-                    min = minCount;
+                var minParameter = getMinArgumentCount(sig);
+                var maxParameter = getParameterCount(sig);
+                // smallest/largest parameter counts
+                if (minParameter < min) {
+                    min = minParameter;
                     closestSignature = sig;
                 }
-                max = Math.max(max, maxCount);
+                max = Math.max(max, maxParameter);
+                // shortest parameter count *longer than the call*/longest parameter count *shorter than the call*
+                if (minParameter < args.length && minParameter > maxBelow)
+                    maxBelow = minParameter;
+                if (args.length < maxParameter && maxParameter < minAbove)
+                    minAbove = maxParameter;
             }
             var hasRestParameter = ts.some(signatures, hasEffectiveRestParameter);
-            var paramRange = hasRestParameter ? min :
-                min < max ? min + "-" + max :
-                    min;
-            var hasSpreadArgument = getSpreadArgumentIndex(args) > -1;
-            if (argCount <= max && hasSpreadArgument) {
-                argCount--;
-            }
-            var spanArray;
-            var related;
-            var error = hasRestParameter || hasSpreadArgument ?
-                hasRestParameter && hasSpreadArgument ?
-                    ts.Diagnostics.Expected_at_least_0_arguments_but_got_1_or_more :
-                    hasRestParameter ?
-                        ts.Diagnostics.Expected_at_least_0_arguments_but_got_1 :
-                        ts.Diagnostics.Expected_0_arguments_but_got_1_or_more :
-                paramRange === 1 && argCount === 0 && isPromiseResolveArityError(node) ?
-                    ts.Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise :
-                    ts.Diagnostics.Expected_0_arguments_but_got_1;
-            if (closestSignature && getMinArgumentCount(closestSignature) > argCount && closestSignature.declaration) {
-                var paramDecl = closestSignature.declaration.parameters[closestSignature.thisParameter ? argCount + 1 : argCount];
-                if (paramDecl) {
-                    related = ts.createDiagnosticForNode(paramDecl, ts.isBindingPattern(paramDecl.name) ? ts.Diagnostics.An_argument_matching_this_binding_pattern_was_not_provided :
-                        ts.isRestParameter(paramDecl) ? ts.Diagnostics.Arguments_for_the_rest_parameter_0_were_not_provided : ts.Diagnostics.An_argument_for_0_was_not_provided, !paramDecl.name ? argCount : !ts.isBindingPattern(paramDecl.name) ? ts.idText(ts.getFirstIdentifier(paramDecl.name)) : undefined);
-                }
-            }
-            if (min < argCount && argCount < max) {
-                return getDiagnosticForCallNode(node, ts.Diagnostics.No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments, argCount, belowArgCount, aboveArgCount);
-            }
-            if (!hasSpreadArgument && argCount < min) {
-                var diagnostic_1 = getDiagnosticForCallNode(node, error, paramRange, argCount);
-                return related ? ts.addRelatedInfo(diagnostic_1, related) : diagnostic_1;
-            }
-            if (hasRestParameter || hasSpreadArgument) {
-                spanArray = ts.factory.createNodeArray(args);
-                if (hasSpreadArgument && argCount) {
-                    var nextArg = ts.elementAt(args, getSpreadArgumentIndex(args) + 1) || undefined;
-                    spanArray = ts.factory.createNodeArray(args.slice(max > argCount && nextArg ? args.indexOf(nextArg) : Math.min(max, args.length - 1)));
+            var parameterRange = hasRestParameter ? min
+                : min < max ? min + "-" + max
+                    : min;
+            var error = hasRestParameter ? ts.Diagnostics.Expected_at_least_0_arguments_but_got_1
+                : parameterRange === 1 && args.length === 0 && isPromiseResolveArityError(node) ? ts.Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise
+                    : ts.Diagnostics.Expected_0_arguments_but_got_1;
+            if (min < args.length && args.length < max) {
+                // between min and max, but with no matching overload
+                return getDiagnosticForCallNode(node, ts.Diagnostics.No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments, args.length, maxBelow, minAbove);
+            }
+            else if (args.length < min) {
+                // too short: put the error span on the call expression, not any of the args
+                var diagnostic = getDiagnosticForCallNode(node, error, parameterRange, args.length);
+                var parameter = (_a = closestSignature === null || closestSignature === void 0 ? void 0 : closestSignature.declaration) === null || _a === void 0 ? void 0 : _a.parameters[closestSignature.thisParameter ? args.length + 1 : args.length];
+                if (parameter) {
+                    var parameterError = ts.createDiagnosticForNode(parameter, ts.isBindingPattern(parameter.name) ? ts.Diagnostics.An_argument_matching_this_binding_pattern_was_not_provided
+                        : ts.isRestParameter(parameter) ? ts.Diagnostics.Arguments_for_the_rest_parameter_0_were_not_provided
+                            : ts.Diagnostics.An_argument_for_0_was_not_provided, !parameter.name ? args.length : !ts.isBindingPattern(parameter.name) ? ts.idText(ts.getFirstIdentifier(parameter.name)) : undefined);
+                    return ts.addRelatedInfo(diagnostic, parameterError);
                 }
+                return diagnostic;
             }
             else {
-                spanArray = ts.factory.createNodeArray(args.slice(max));
-            }
-            var pos = ts.first(spanArray).pos;
-            var end = ts.last(spanArray).end;
-            if (end === pos) {
-                end++;
+                // too long; error goes on the excess parameters
+                var errorSpan = ts.factory.createNodeArray(args.slice(max));
+                var pos = ts.first(errorSpan).pos;
+                var end = ts.last(errorSpan).end;
+                if (end === pos) {
+                    end++;
+                }
+                ts.setTextRangePosEnd(errorSpan, pos, end);
+                return ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), errorSpan, error, parameterRange, args.length);
             }
-            ts.setTextRangePosEnd(spanArray, pos, end);
-            var diagnostic = ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), spanArray, error, paramRange, argCount);
-            return related ? ts.addRelatedInfo(diagnostic, related) : diagnostic;
         }
         function getTypeArgumentArityError(node, signatures, typeArguments) {
             var argCount = typeArguments.length;
@@ -69101,15 +73866,15 @@ var ts;
             return ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount);
         }
         function resolveCall(node, signatures, candidatesOutArray, checkMode, callChainFlags, fallbackError) {
-            var isTaggedTemplate = node.kind === 205 /* TaggedTemplateExpression */;
-            var isDecorator = node.kind === 161 /* Decorator */;
+            var isTaggedTemplate = node.kind === 209 /* TaggedTemplateExpression */;
+            var isDecorator = node.kind === 164 /* Decorator */;
             var isJsxOpeningOrSelfClosingElement = ts.isJsxOpeningLikeElement(node);
             var reportErrors = !candidatesOutArray && produceDiagnostics;
             var typeArguments;
             if (!isDecorator) {
                 typeArguments = node.typeArguments;
                 // We already perform checking on the type arguments on the class declaration itself.
-                if (isTaggedTemplate || isJsxOpeningOrSelfClosingElement || node.expression.kind !== 105 /* SuperKeyword */) {
+                if (isTaggedTemplate || isJsxOpeningOrSelfClosingElement || node.expression.kind !== 106 /* SuperKeyword */) {
                     ts.forEach(typeArguments, checkSourceElement);
                 }
             }
@@ -69164,7 +73929,7 @@ var ts;
             var result;
             // If we are in signature help, a trailing comma indicates that we intend to provide another argument,
             // so we will only accept overloads with arity at least 1 higher than the current number of provided arguments.
-            var signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 203 /* CallExpression */ && node.arguments.hasTrailingComma;
+            var signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 207 /* CallExpression */ && node.arguments.hasTrailingComma;
             // Section 4.12.1:
             // if the candidate list contains one or more signatures for which the type of each argument
             // expression is a subtype of each corresponding parameter type, the return type of the first
@@ -69218,7 +73983,7 @@ var ts;
                         var min_3 = Number.MAX_VALUE;
                         var minIndex = 0;
                         var i_1 = 0;
-                        var _loop_21 = function (c) {
+                        var _loop_24 = function (c) {
                             var chain_2 = function () { return ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Overload_0_of_1_2_gave_the_following_error, i_1 + 1, candidates.length, signatureToString(c)); };
                             var diags_2 = getSignatureApplicabilityError(node, args, c, assignableRelation, 0 /* Normal */, /*reportErrors*/ true, chain_2);
                             if (diags_2) {
@@ -69236,14 +74001,14 @@ var ts;
                         };
                         for (var _a = 0, candidatesForArgumentError_1 = candidatesForArgumentError; _a < candidatesForArgumentError_1.length; _a++) {
                             var c = candidatesForArgumentError_1[_a];
-                            _loop_21(c);
+                            _loop_24(c);
                         }
                         var diags_3 = max > 1 ? allDiagnostics[minIndex] : ts.flatten(allDiagnostics);
                         ts.Debug.assert(diags_3.length > 0, "No errors reported for 3 or fewer overload signatures");
                         var chain = ts.chainDiagnosticMessages(ts.map(diags_3, function (d) { return typeof d.messageText === "string" ? d : d.messageText; }), ts.Diagnostics.No_overload_matches_this_call);
                         // The below is a spread to guarantee we get a new (mutable) array - our `flatMap` helper tries to do "smart" optimizations where it reuses input
                         // arrays and the emptyArray singleton where possible, which is decidedly not what we want while we're still constructing this diagnostic
-                        var related = __spreadArray([], ts.flatMap(diags_3, function (d) { return d.relatedInformation; }));
+                        var related = __spreadArray([], ts.flatMap(diags_3, function (d) { return d.relatedInformation; }), true);
                         var diag = void 0;
                         if (ts.every(diags_3, function (d) { return d.start === diags_3[0].start && d.length === diags_3[0].length && d.file === diags_3[0].file; })) {
                             var _b = diags_3[0], file = _b.file, start = _b.start, length_7 = _b.length;
@@ -69394,7 +74159,7 @@ var ts;
             }
             var _a = ts.minAndMax(candidates, getNumNonRestParameters), minArgumentCount = _a.min, maxNonRestParam = _a.max;
             var parameters = [];
-            var _loop_22 = function (i) {
+            var _loop_25 = function (i) {
                 var symbols = ts.mapDefined(candidates, function (s) { return signatureHasRestParameter(s) ?
                     i < s.parameters.length - 1 ? s.parameters[i] : ts.last(s.parameters) :
                     i < s.parameters.length ? s.parameters[i] : undefined; });
@@ -69402,7 +74167,7 @@ var ts;
                 parameters.push(createCombinedSymbolFromTypes(symbols, ts.mapDefined(candidates, function (candidate) { return tryGetTypeAtPosition(candidate, i); })));
             };
             for (var i = 0; i < maxNonRestParam; i++) {
-                _loop_22(i);
+                _loop_25(i);
             }
             var restParameterSymbols = ts.mapDefined(candidates, function (c) { return signatureHasRestParameter(c) ? ts.last(c.parameters) : undefined; });
             var flags = 0 /* None */;
@@ -69483,7 +74248,7 @@ var ts;
             return maxParamsIndex;
         }
         function resolveCallExpression(node, candidatesOutArray, checkMode) {
-            if (node.expression.kind === 105 /* SuperKeyword */) {
+            if (node.expression.kind === 106 /* SuperKeyword */) {
                 var superType = checkSuperExpression(node.expression);
                 if (isTypeAny(superType)) {
                     for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) {
@@ -69492,7 +74257,7 @@ var ts;
                     }
                     return anySignature;
                 }
-                if (superType !== errorType) {
+                if (!isErrorType(superType)) {
                     // In super call, the candidate signatures are the matching arity signatures of the base constructor function instantiated
                     // with the type arguments specified in the extends clause.
                     var baseTypeNode = ts.getEffectiveBaseTypeNode(ts.getContainingClass(node));
@@ -69520,7 +74285,7 @@ var ts;
                 return silentNeverSignature;
             }
             var apparentType = getApparentType(funcType);
-            if (apparentType === errorType) {
+            if (isErrorType(apparentType)) {
                 // Another error has already been reported
                 return resolveErrorCall(node);
             }
@@ -69536,7 +74301,7 @@ var ts;
             if (isUntypedFunctionCall(funcType, apparentType, callSignatures.length, numConstructSignatures)) {
                 // The unknownType indicates that an error already occurred (and was reported).  No
                 // need to report another error in this case.
-                if (funcType !== errorType && node.typeArguments) {
+                if (!isErrorType(funcType) && node.typeArguments) {
                     error(node, ts.Diagnostics.Untyped_function_calls_may_not_accept_type_arguments);
                 }
                 return resolveUntypedCall(node);
@@ -69594,7 +74359,7 @@ var ts;
         function isUntypedFunctionCall(funcType, apparentFuncType, numCallSignatures, numConstructSignatures) {
             // We exclude union types because we may have a union of function types that happen to have no common signatures.
             return isTypeAny(funcType) || isTypeAny(apparentFuncType) && !!(funcType.flags & 262144 /* TypeParameter */) ||
-                !numCallSignatures && !numConstructSignatures && !(apparentFuncType.flags & (1048576 /* Union */ | 131072 /* Never */)) && isTypeAssignableTo(funcType, globalFunctionType);
+                !numCallSignatures && !numConstructSignatures && !(apparentFuncType.flags & 1048576 /* Union */) && !(getReducedType(apparentFuncType).flags & 131072 /* Never */) && isTypeAssignableTo(funcType, globalFunctionType);
         }
         function resolveNewExpression(node, candidatesOutArray, checkMode) {
             if (node.arguments && languageVersion < 1 /* ES5 */) {
@@ -69613,7 +74378,7 @@ var ts;
             // signatures for overload resolution. The result type of the function call becomes
             // the result type of the operation.
             expressionType = getApparentType(expressionType);
-            if (expressionType === errorType) {
+            if (isErrorType(expressionType)) {
                 // Another error has already been reported
                 return resolveErrorCall(node);
             }
@@ -69709,7 +74474,7 @@ var ts;
             var declaration = signature.declaration;
             var modifiers = ts.getSelectedEffectiveModifierFlags(declaration, 24 /* NonPublicAccessibilityModifier */);
             // (1) Public constructors and (2) constructor functions are always accessible.
-            if (!modifiers || declaration.kind !== 166 /* Constructor */) {
+            if (!modifiers || declaration.kind !== 170 /* Constructor */) {
                 return true;
             }
             var declaringClassDeclaration = ts.getClassLikeDeclarationOfSymbol(declaration.parent.symbol);
@@ -69741,8 +74506,8 @@ var ts;
             if (apparentType.flags & 1048576 /* Union */) {
                 var types = apparentType.types;
                 var hasSignatures = false;
-                for (var _i = 0, types_21 = types; _i < types_21.length; _i++) {
-                    var constituent = types_21[_i];
+                for (var _i = 0, types_20 = types; _i < types_20.length; _i++) {
+                    var constituent = types_20[_i];
                     var signatures = getSignaturesOfType(constituent, kind);
                     if (signatures.length !== 0) {
                         hasSignatures = true;
@@ -69828,7 +74593,7 @@ var ts;
         function resolveTaggedTemplateExpression(node, candidatesOutArray, checkMode) {
             var tagType = checkExpression(node.tag);
             var apparentType = getApparentType(tagType);
-            if (apparentType === errorType) {
+            if (isErrorType(apparentType)) {
                 // Another error has already been reported
                 return resolveErrorCall(node);
             }
@@ -69853,16 +74618,16 @@ var ts;
          */
         function getDiagnosticHeadMessageForDecoratorResolution(node) {
             switch (node.parent.kind) {
-                case 252 /* ClassDeclaration */:
-                case 221 /* ClassExpression */:
+                case 256 /* ClassDeclaration */:
+                case 225 /* ClassExpression */:
                     return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression;
-                case 160 /* Parameter */:
+                case 163 /* Parameter */:
                     return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression;
-                case 163 /* PropertyDeclaration */:
+                case 166 /* PropertyDeclaration */:
                     return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression;
-                case 165 /* MethodDeclaration */:
-                case 167 /* GetAccessor */:
-                case 168 /* SetAccessor */:
+                case 168 /* MethodDeclaration */:
+                case 171 /* GetAccessor */:
+                case 172 /* SetAccessor */:
                     return ts.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression;
                 default:
                     return ts.Debug.fail();
@@ -69874,7 +74639,7 @@ var ts;
         function resolveDecorator(node, candidatesOutArray, checkMode) {
             var funcType = checkExpression(node.expression);
             var apparentType = getApparentType(funcType);
-            if (apparentType === errorType) {
+            if (isErrorType(apparentType)) {
                 return resolveErrorCall(node);
             }
             var callSignatures = getSignaturesOfType(apparentType, 0 /* Call */);
@@ -69908,7 +74673,7 @@ var ts;
             // file would probably be preferable.
             var typeSymbol = exports && getSymbol(exports, JsxNames.Element, 788968 /* Type */);
             var returnNode = typeSymbol && nodeBuilder.symbolToEntityName(typeSymbol, 788968 /* Type */, node);
-            var declaration = ts.factory.createFunctionTypeNode(/*typeParameters*/ undefined, [ts.factory.createParameterDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotdotdot*/ undefined, "props", /*questionMark*/ undefined, nodeBuilder.typeToTypeNode(result, node))], returnNode ? ts.factory.createTypeReferenceNode(returnNode, /*typeArguments*/ undefined) : ts.factory.createKeywordTypeNode(128 /* AnyKeyword */));
+            var declaration = ts.factory.createFunctionTypeNode(/*typeParameters*/ undefined, [ts.factory.createParameterDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotdotdot*/ undefined, "props", /*questionMark*/ undefined, nodeBuilder.typeToTypeNode(result, node))], returnNode ? ts.factory.createTypeReferenceNode(returnNode, /*typeArguments*/ undefined) : ts.factory.createKeywordTypeNode(130 /* AnyKeyword */));
             var parameterSymbol = createSymbol(1 /* FunctionScopedVariable */, "props");
             parameterSymbol.type = result;
             return createSignature(declaration, 
@@ -69929,7 +74694,7 @@ var ts;
             }
             var exprTypes = checkExpression(node.tagName);
             var apparentType = getApparentType(exprTypes);
-            if (apparentType === errorType) {
+            if (isErrorType(apparentType)) {
                 return resolveErrorCall(node);
             }
             var signatures = getUninstantiatedJsxSignaturesOfType(exprTypes, node);
@@ -69957,16 +74722,16 @@ var ts;
         }
         function resolveSignature(node, candidatesOutArray, checkMode) {
             switch (node.kind) {
-                case 203 /* CallExpression */:
+                case 207 /* CallExpression */:
                     return resolveCallExpression(node, candidatesOutArray, checkMode);
-                case 204 /* NewExpression */:
+                case 208 /* NewExpression */:
                     return resolveNewExpression(node, candidatesOutArray, checkMode);
-                case 205 /* TaggedTemplateExpression */:
+                case 209 /* TaggedTemplateExpression */:
                     return resolveTaggedTemplateExpression(node, candidatesOutArray, checkMode);
-                case 161 /* Decorator */:
+                case 164 /* Decorator */:
                     return resolveDecorator(node, candidatesOutArray, checkMode);
-                case 275 /* JsxOpeningElement */:
-                case 274 /* JsxSelfClosingElement */:
+                case 279 /* JsxOpeningElement */:
+                case 278 /* JsxSelfClosingElement */:
                     return resolveJsxOpeningLikeElement(node, candidatesOutArray, checkMode);
             }
             throw ts.Debug.assertNever(node, "Branch in 'resolveSignature' should be unreachable.");
@@ -70066,7 +74831,7 @@ var ts;
             else if (ts.isBinaryExpression(node.parent)) {
                 var parentNode = node.parent;
                 var parentNodeOperator = node.parent.operatorToken.kind;
-                if (parentNodeOperator === 62 /* EqualsToken */ && (allowDeclaration || parentNode.right === node)) {
+                if (parentNodeOperator === 63 /* EqualsToken */ && (allowDeclaration || parentNode.right === node)) {
                     name = parentNode.left;
                     decl = name;
                 }
@@ -70075,7 +74840,7 @@ var ts;
                         name = parentNode.parent.name;
                         decl = parentNode.parent;
                     }
-                    else if (ts.isBinaryExpression(parentNode.parent) && parentNode.parent.operatorToken.kind === 62 /* EqualsToken */ && (allowDeclaration || parentNode.parent.right === parentNode)) {
+                    else if (ts.isBinaryExpression(parentNode.parent) && parentNode.parent.operatorToken.kind === 63 /* EqualsToken */ && (allowDeclaration || parentNode.parent.right === parentNode)) {
                         name = parentNode.parent.left;
                         decl = name;
                     }
@@ -70098,10 +74863,10 @@ var ts;
                 return false;
             }
             var parent = node.parent;
-            while (parent && parent.kind === 201 /* PropertyAccessExpression */) {
+            while (parent && parent.kind === 205 /* PropertyAccessExpression */) {
                 parent = parent.parent;
             }
-            if (parent && ts.isBinaryExpression(parent) && ts.isPrototypeAccess(parent.left) && parent.operatorToken.kind === 62 /* EqualsToken */) {
+            if (parent && ts.isBinaryExpression(parent) && ts.isPrototypeAccess(parent.left) && parent.operatorToken.kind === 63 /* EqualsToken */) {
                 var right = ts.getInitializerOfBinaryExpression(parent);
                 return ts.isObjectLiteralExpression(right) && right;
             }
@@ -70122,15 +74887,15 @@ var ts;
                 return nonInferrableType;
             }
             checkDeprecatedSignature(signature, node);
-            if (node.expression.kind === 105 /* SuperKeyword */) {
+            if (node.expression.kind === 106 /* SuperKeyword */) {
                 return voidType;
             }
-            if (node.kind === 204 /* NewExpression */) {
+            if (node.kind === 208 /* NewExpression */) {
                 var declaration = signature.declaration;
                 if (declaration &&
-                    declaration.kind !== 166 /* Constructor */ &&
-                    declaration.kind !== 170 /* ConstructSignature */ &&
-                    declaration.kind !== 175 /* ConstructorType */ &&
+                    declaration.kind !== 170 /* Constructor */ &&
+                    declaration.kind !== 174 /* ConstructSignature */ &&
+                    declaration.kind !== 179 /* ConstructorType */ &&
                     !ts.isJSDocConstructSignature(declaration) &&
                     !isJSConstructor(declaration)) {
                     // When resolved signature is a call signature (and not a construct signature) the result type is any
@@ -70150,7 +74915,7 @@ var ts;
             if (returnType.flags & 12288 /* ESSymbolLike */ && isSymbolOrSymbolForCall(node)) {
                 return getESSymbolLikeTypeForNode(ts.walkUpParenthesizedExpressions(node.parent));
             }
-            if (node.kind === 203 /* CallExpression */ && !node.questionDotToken && node.parent.kind === 233 /* ExpressionStatement */ &&
+            if (node.kind === 207 /* CallExpression */ && !node.questionDotToken && node.parent.kind === 237 /* ExpressionStatement */ &&
                 returnType.flags & 16384 /* Void */ && getTypePredicateOfSignature(signature)) {
                 if (!ts.isDottedName(node.expression)) {
                     error(node.expression, ts.Diagnostics.Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name);
@@ -70163,8 +74928,8 @@ var ts;
             if (ts.isInJSFile(node)) {
                 var jsSymbol = getSymbolOfExpando(node, /*allowDeclaration*/ false);
                 if ((_a = jsSymbol === null || jsSymbol === void 0 ? void 0 : jsSymbol.exports) === null || _a === void 0 ? void 0 : _a.size) {
-                    var jsAssignmentType = createAnonymousType(jsSymbol, jsSymbol.exports, ts.emptyArray, ts.emptyArray, undefined, undefined);
-                    jsAssignmentType.objectFlags |= 16384 /* JSLiteral */;
+                    var jsAssignmentType = createAnonymousType(jsSymbol, jsSymbol.exports, ts.emptyArray, ts.emptyArray, ts.emptyArray);
+                    jsAssignmentType.objectFlags |= 8192 /* JSLiteral */;
                     return getIntersectionType([returnType, jsAssignmentType]);
                 }
             }
@@ -70180,20 +74945,20 @@ var ts;
         function getDeprecatedSuggestionNode(node) {
             node = ts.skipParentheses(node);
             switch (node.kind) {
-                case 203 /* CallExpression */:
-                case 161 /* Decorator */:
-                case 204 /* NewExpression */:
+                case 207 /* CallExpression */:
+                case 164 /* Decorator */:
+                case 208 /* NewExpression */:
                     return getDeprecatedSuggestionNode(node.expression);
-                case 205 /* TaggedTemplateExpression */:
+                case 209 /* TaggedTemplateExpression */:
                     return getDeprecatedSuggestionNode(node.tag);
-                case 275 /* JsxOpeningElement */:
-                case 274 /* JsxSelfClosingElement */:
+                case 279 /* JsxOpeningElement */:
+                case 278 /* JsxSelfClosingElement */:
                     return getDeprecatedSuggestionNode(node.tagName);
-                case 202 /* ElementAccessExpression */:
+                case 206 /* ElementAccessExpression */:
                     return node.argumentExpression;
-                case 201 /* PropertyAccessExpression */:
+                case 205 /* PropertyAccessExpression */:
                     return node.name;
-                case 173 /* TypeReference */:
+                case 177 /* TypeReference */:
                     var typeReference = node;
                     return ts.isQualifiedName(typeReference.typeName) ? typeReference.typeName.right : typeReference;
                 default:
@@ -70226,38 +74991,62 @@ var ts;
             }
             var specifier = node.arguments[0];
             var specifierType = checkExpressionCached(specifier);
+            var optionsType = node.arguments.length > 1 ? checkExpressionCached(node.arguments[1]) : undefined;
             // Even though multiple arguments is grammatically incorrect, type-check extra arguments for completion
-            for (var i = 1; i < node.arguments.length; ++i) {
+            for (var i = 2; i < node.arguments.length; ++i) {
                 checkExpressionCached(node.arguments[i]);
             }
             if (specifierType.flags & 32768 /* Undefined */ || specifierType.flags & 65536 /* Null */ || !isTypeAssignableTo(specifierType, stringType)) {
                 error(specifier, ts.Diagnostics.Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0, typeToString(specifierType));
             }
+            if (optionsType) {
+                var importCallOptionsType = getGlobalImportCallOptionsType(/*reportErrors*/ true);
+                if (importCallOptionsType !== emptyObjectType) {
+                    checkTypeAssignableTo(optionsType, getNullableType(importCallOptionsType, 32768 /* Undefined */), node.arguments[1]);
+                }
+            }
             // resolveExternalModuleName will return undefined if the moduleReferenceExpression is not a string literal
             var moduleSymbol = resolveExternalModuleName(node, specifier);
             if (moduleSymbol) {
                 var esModuleSymbol = resolveESModuleSymbol(moduleSymbol, specifier, /*dontRecursivelyResolve*/ true, /*suppressUsageError*/ false);
                 if (esModuleSymbol) {
-                    return createPromiseReturnType(node, getTypeWithSyntheticDefaultImportType(getTypeOfSymbol(esModuleSymbol), esModuleSymbol, moduleSymbol));
+                    return createPromiseReturnType(node, getTypeWithSyntheticDefaultOnly(getTypeOfSymbol(esModuleSymbol), esModuleSymbol, moduleSymbol, specifier) ||
+                        getTypeWithSyntheticDefaultImportType(getTypeOfSymbol(esModuleSymbol), esModuleSymbol, moduleSymbol, specifier));
                 }
             }
             return createPromiseReturnType(node, anyType);
         }
-        function getTypeWithSyntheticDefaultImportType(type, symbol, originalSymbol) {
-            if (allowSyntheticDefaultImports && type && type !== errorType) {
+        function createDefaultPropertyWrapperForModule(symbol, originalSymbol, anonymousSymbol) {
+            var memberTable = ts.createSymbolTable();
+            var newSymbol = createSymbol(2097152 /* Alias */, "default" /* Default */);
+            newSymbol.parent = originalSymbol;
+            newSymbol.nameType = getStringLiteralType("default");
+            newSymbol.target = resolveSymbol(symbol);
+            memberTable.set("default" /* Default */, newSymbol);
+            return createAnonymousType(anonymousSymbol, memberTable, ts.emptyArray, ts.emptyArray, ts.emptyArray);
+        }
+        function getTypeWithSyntheticDefaultOnly(type, symbol, originalSymbol, moduleSpecifier) {
+            var hasDefaultOnly = isOnlyImportedAsDefault(moduleSpecifier);
+            if (hasDefaultOnly && type && !isErrorType(type)) {
+                var synthType = type;
+                if (!synthType.defaultOnlyType) {
+                    var type_4 = createDefaultPropertyWrapperForModule(symbol, originalSymbol);
+                    synthType.defaultOnlyType = type_4;
+                }
+                return synthType.defaultOnlyType;
+            }
+            return undefined;
+        }
+        function getTypeWithSyntheticDefaultImportType(type, symbol, originalSymbol, moduleSpecifier) {
+            var _a;
+            if (allowSyntheticDefaultImports && type && !isErrorType(type)) {
                 var synthType = type;
                 if (!synthType.syntheticType) {
-                    var file = ts.find(originalSymbol.declarations, ts.isSourceFile);
-                    var hasSyntheticDefault = canHaveSyntheticDefault(file, originalSymbol, /*dontResolveAlias*/ false);
+                    var file = (_a = originalSymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(ts.isSourceFile);
+                    var hasSyntheticDefault = canHaveSyntheticDefault(file, originalSymbol, /*dontResolveAlias*/ false, moduleSpecifier);
                     if (hasSyntheticDefault) {
-                        var memberTable = ts.createSymbolTable();
-                        var newSymbol = createSymbol(2097152 /* Alias */, "default" /* Default */);
-                        newSymbol.parent = originalSymbol;
-                        newSymbol.nameType = getLiteralType("default");
-                        newSymbol.target = resolveSymbol(symbol);
-                        memberTable.set("default" /* Default */, newSymbol);
                         var anonymousSymbol = createSymbol(2048 /* TypeLiteral */, "__type" /* Type */);
-                        var defaultContainingObject = createAnonymousType(anonymousSymbol, memberTable, ts.emptyArray, ts.emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined);
+                        var defaultContainingObject = createDefaultPropertyWrapperForModule(symbol, originalSymbol, anonymousSymbol);
                         anonymousSymbol.type = defaultContainingObject;
                         synthType.syntheticType = isValidSpreadType(type) ? getSpreadType(type, defaultContainingObject, anonymousSymbol, /*objectFlags*/ 0, /*readonly*/ false) : defaultContainingObject;
                     }
@@ -70285,9 +75074,9 @@ var ts;
                 return false;
             }
             var targetDeclarationKind = resolvedRequire.flags & 16 /* Function */
-                ? 251 /* FunctionDeclaration */
+                ? 255 /* FunctionDeclaration */
                 : resolvedRequire.flags & 3 /* Variable */
-                    ? 249 /* VariableDeclaration */
+                    ? 253 /* VariableDeclaration */
                     : 0 /* Unknown */;
             if (targetDeclarationKind !== 0 /* Unknown */) {
                 var decl = ts.getDeclarationOfKind(resolvedRequire, targetDeclarationKind);
@@ -70307,6 +75096,12 @@ var ts;
             return getReturnTypeOfSignature(signature);
         }
         function checkAssertion(node) {
+            if (node.kind === 210 /* TypeAssertionExpression */) {
+                var file = ts.getSourceFileOfNode(node);
+                if (file && ts.fileExtensionIsOneOf(file.fileName, [".cts" /* Cts */, ".mts" /* Mts */])) {
+                    grammarErrorOnNode(node, ts.Diagnostics.This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead);
+                }
+            }
             return checkAssertionWorker(node, node.type, node.expression);
         }
         function isValidConstAssertionArgument(node) {
@@ -70315,29 +75110,27 @@ var ts;
                 case 14 /* NoSubstitutionTemplateLiteral */:
                 case 8 /* NumericLiteral */:
                 case 9 /* BigIntLiteral */:
-                case 109 /* TrueKeyword */:
-                case 94 /* FalseKeyword */:
-                case 199 /* ArrayLiteralExpression */:
-                case 200 /* ObjectLiteralExpression */:
-                case 218 /* TemplateExpression */:
+                case 110 /* TrueKeyword */:
+                case 95 /* FalseKeyword */:
+                case 203 /* ArrayLiteralExpression */:
+                case 204 /* ObjectLiteralExpression */:
+                case 222 /* TemplateExpression */:
                     return true;
-                case 207 /* ParenthesizedExpression */:
+                case 211 /* ParenthesizedExpression */:
                     return isValidConstAssertionArgument(node.expression);
-                case 214 /* PrefixUnaryExpression */:
+                case 218 /* PrefixUnaryExpression */:
                     var op = node.operator;
                     var arg = node.operand;
                     return op === 40 /* MinusToken */ && (arg.kind === 8 /* NumericLiteral */ || arg.kind === 9 /* BigIntLiteral */) ||
                         op === 39 /* PlusToken */ && arg.kind === 8 /* NumericLiteral */;
-                case 201 /* PropertyAccessExpression */:
-                case 202 /* ElementAccessExpression */:
+                case 205 /* PropertyAccessExpression */:
+                case 206 /* ElementAccessExpression */:
                     var expr = node.expression;
-                    if (ts.isIdentifier(expr)) {
-                        var symbol = getSymbolAtLocation(expr);
-                        if (symbol && symbol.flags & 2097152 /* Alias */) {
-                            symbol = resolveAlias(symbol);
-                        }
-                        return !!(symbol && (symbol.flags & 384 /* Enum */) && getEnumKind(symbol) === 1 /* Literal */);
+                    var symbol = getTypeOfNode(expr).symbol;
+                    if (symbol && symbol.flags & 2097152 /* Alias */) {
+                        symbol = resolveAlias(symbol);
                     }
+                    return !!(symbol && (symbol.flags & 384 /* Enum */) && getEnumKind(symbol) === 1 /* Literal */);
             }
             return false;
         }
@@ -70352,7 +75145,7 @@ var ts;
             checkSourceElement(type);
             exprType = getRegularTypeOfObjectLiteral(getBaseTypeOfLiteralType(exprType));
             var targetType = getTypeFromTypeNode(type);
-            if (produceDiagnostics && targetType !== errorType) {
+            if (produceDiagnostics && !isErrorType(targetType)) {
                 var widenedType = getWidenedType(exprType);
                 if (!isTypeComparableTo(targetType, widenedType)) {
                     checkTypeComparableTo(exprType, targetType, errNode, ts.Diagnostics.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);
@@ -70371,21 +75164,32 @@ var ts;
         }
         function checkMetaProperty(node) {
             checkGrammarMetaProperty(node);
-            if (node.keywordToken === 102 /* NewKeyword */) {
+            if (node.keywordToken === 103 /* NewKeyword */) {
                 return checkNewTargetMetaProperty(node);
             }
-            if (node.keywordToken === 99 /* ImportKeyword */) {
+            if (node.keywordToken === 100 /* ImportKeyword */) {
                 return checkImportMetaProperty(node);
             }
             return ts.Debug.assertNever(node.keywordToken);
         }
+        function checkMetaPropertyKeyword(node) {
+            switch (node.keywordToken) {
+                case 100 /* ImportKeyword */:
+                    return getGlobalImportMetaExpressionType();
+                case 103 /* NewKeyword */:
+                    var type = checkNewTargetMetaProperty(node);
+                    return isErrorType(type) ? errorType : createNewTargetExpressionType(type);
+                default:
+                    ts.Debug.assertNever(node.keywordToken);
+            }
+        }
         function checkNewTargetMetaProperty(node) {
             var container = ts.getNewTargetContainer(node);
             if (!container) {
                 error(node, ts.Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target");
                 return errorType;
             }
-            else if (container.kind === 166 /* Constructor */) {
+            else if (container.kind === 170 /* Constructor */) {
                 var symbol = getSymbolOfNode(container.parent);
                 return getTypeOfSymbol(symbol);
             }
@@ -70395,12 +75199,16 @@ var ts;
             }
         }
         function checkImportMetaProperty(node) {
-            if (moduleKind !== ts.ModuleKind.ES2020 && moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.System) {
-                error(node, ts.Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_esnext_or_system);
+            if (moduleKind === ts.ModuleKind.Node12 || moduleKind === ts.ModuleKind.NodeNext) {
+                if (ts.getSourceFileOfNode(node).impliedNodeFormat !== ts.ModuleKind.ESNext) {
+                    error(node, ts.Diagnostics.The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output);
+                }
+            }
+            else if (moduleKind < ts.ModuleKind.ES2020 && moduleKind !== ts.ModuleKind.System) {
+                error(node, ts.Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node12_or_nodenext);
             }
             var file = ts.getSourceFileOfNode(node);
             ts.Debug.assert(!!(file.flags & 2097152 /* PossiblyContainsImportMeta */), "Containing file is missing import meta node flag.");
-            ts.Debug.assert(!!file.externalModuleIndicator, "Containing file should be a module.");
             return node.name.escapedText === "meta" ? getGlobalImportMetaType() : errorType;
         }
         function getTypeOfParameter(symbol) {
@@ -70431,8 +75239,37 @@ var ts;
             }
             return restParameter.escapedName;
         }
+        function getParameterIdentifierNameAtPosition(signature, pos) {
+            var paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0);
+            if (pos < paramCount) {
+                var param = signature.parameters[pos];
+                return isParameterDeclarationWithIdentifierName(param) ? [param.escapedName, false] : undefined;
+            }
+            var restParameter = signature.parameters[paramCount] || unknownSymbol;
+            if (!isParameterDeclarationWithIdentifierName(restParameter)) {
+                return undefined;
+            }
+            var restType = getTypeOfSymbol(restParameter);
+            if (isTupleType(restType)) {
+                var associatedNames = restType.target.labeledElementDeclarations;
+                var index = pos - paramCount;
+                var associatedName = associatedNames === null || associatedNames === void 0 ? void 0 : associatedNames[index];
+                var isRestTupleElement = !!(associatedName === null || associatedName === void 0 ? void 0 : associatedName.dotDotDotToken);
+                return associatedName ? [
+                    getTupleElementLabel(associatedName),
+                    isRestTupleElement
+                ] : undefined;
+            }
+            if (pos === paramCount) {
+                return [restParameter.escapedName, true];
+            }
+            return undefined;
+        }
+        function isParameterDeclarationWithIdentifierName(symbol) {
+            return symbol.valueDeclaration && ts.isParameter(symbol.valueDeclaration) && ts.isIdentifier(symbol.valueDeclaration.name);
+        }
         function isValidDeclarationForTupleLabel(d) {
-            return d.kind === 192 /* NamedTupleMember */ || (ts.isParameter(d) && d.name && ts.isIdentifier(d.name));
+            return d.kind === 196 /* NamedTupleMember */ || (ts.isParameter(d) && d.name && ts.isIdentifier(d.name));
         }
         function getNameableDeclarationAtPosition(signature, pos) {
             var paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0);
@@ -70464,7 +75301,7 @@ var ts;
                 var restType = getTypeOfSymbol(signature.parameters[paramCount]);
                 var index = pos - paramCount;
                 if (!isTupleType(restType) || restType.target.hasRestElement || index < restType.target.fixedLength) {
-                    return getIndexedAccessType(restType, getLiteralType(index));
+                    return getIndexedAccessType(restType, getNumberLiteralType(index));
                 }
             }
             return undefined;
@@ -70597,7 +75434,14 @@ var ts;
             }
         }
         function assignContextualParameterTypes(signature, context) {
-            signature.typeParameters = context.typeParameters;
+            if (context.typeParameters) {
+                if (!signature.typeParameters) {
+                    signature.typeParameters = context.typeParameters;
+                }
+                else {
+                    return; // This signature has already has a contextual inference performed and cached on it!
+                }
+            }
             if (context.thisParameter) {
                 var parameter = signature.thisParameter;
                 if (!parameter || parameter.valueDeclaration && !parameter.valueDeclaration.type) {
@@ -70638,7 +75482,7 @@ var ts;
             if (!links.type) {
                 var declaration = parameter.valueDeclaration;
                 links.type = type || getWidenedTypeForVariableLikeDeclaration(declaration, /*includeOptionality*/ true);
-                if (declaration.name.kind !== 78 /* Identifier */) {
+                if (declaration.name.kind !== 79 /* Identifier */) {
                     // if inference didn't come up with anything but unknown, fall back to the binding pattern if present.
                     if (links.type === unknownType) {
                         links.type = getTypeFromBindingPattern(declaration.name);
@@ -70653,7 +75497,7 @@ var ts;
             for (var _i = 0, _a = pattern.elements; _i < _a.length; _i++) {
                 var element = _a[_i];
                 if (!ts.isOmittedExpression(element)) {
-                    if (element.name.kind === 78 /* Identifier */) {
+                    if (element.name.kind === 79 /* Identifier */) {
                         getSymbolLinks(getSymbolOfNode(element)).type = getTypeForBindingElement(element);
                     }
                     else {
@@ -70667,7 +75511,8 @@ var ts;
             var globalPromiseType = getGlobalPromiseType(/*reportErrors*/ true);
             if (globalPromiseType !== emptyGenericType) {
                 // if the promised type is itself a promise, get the underlying type; otherwise, fallback to the promised type
-                promisedType = getAwaitedType(promisedType) || unknownType;
+                // Unwrap an `Awaited<T>` to `T` to improve inference.
+                promisedType = getAwaitedTypeNoAlias(unwrapAwaitedType(promisedType)) || unknownType;
                 return createTypeReference(globalPromiseType, [promisedType]);
             }
             return unknownType;
@@ -70677,7 +75522,8 @@ var ts;
             var globalPromiseLikeType = getGlobalPromiseLikeType(/*reportErrors*/ true);
             if (globalPromiseLikeType !== emptyGenericType) {
                 // if the promised type is itself a promise, get the underlying type; otherwise, fallback to the promised type
-                promisedType = getAwaitedType(promisedType) || unknownType;
+                // Unwrap an `Awaited<T>` to `T` to improve inference.
+                promisedType = getAwaitedTypeNoAlias(unwrapAwaitedType(promisedType)) || unknownType;
                 return createTypeReference(globalPromiseLikeType, [promisedType]);
             }
             return unknownType;
@@ -70697,6 +75543,16 @@ var ts;
             }
             return promiseType;
         }
+        function createNewTargetExpressionType(targetType) {
+            // Create a synthetic type `NewTargetExpression { target: TargetType; }`
+            var symbol = createSymbol(0 /* None */, "NewTargetExpression");
+            var targetPropertySymbol = createSymbol(4 /* Property */, "target", 8 /* Readonly */);
+            targetPropertySymbol.parent = symbol;
+            targetPropertySymbol.type = targetType;
+            var members = ts.createSymbolTable([targetPropertySymbol]);
+            symbol.members = members;
+            return createAnonymousType(symbol, members, ts.emptyArray, ts.emptyArray, ts.emptyArray);
+        }
         function getReturnTypeFromBody(func, checkMode) {
             if (!func.body) {
                 return errorType;
@@ -70708,14 +75564,14 @@ var ts;
             var yieldType;
             var nextType;
             var fallbackReturnType = voidType;
-            if (func.body.kind !== 230 /* Block */) { // Async or normal arrow function
+            if (func.body.kind !== 234 /* Block */) { // Async or normal arrow function
                 returnType = checkExpressionCached(func.body, checkMode && checkMode & ~8 /* SkipGenericFunctions */);
                 if (isAsync) {
                     // From within an async function you can return either a non-promise value or a promise. Any
                     // Promise/A+ compatible implementation will always assimilate any foreign promise, so the
                     // return type of the body should be unwrapped to its awaited type, which we will wrap in
                     // the native Promise<T> type later in this function.
-                    returnType = checkAwaitedType(returnType, /*errorNode*/ func, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);
+                    returnType = unwrapAwaitedType(checkAwaitedType(returnType, /*withAlias*/ false, /*errorNode*/ func, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member));
                 }
             }
             else if (isGenerator) { // Generator or AsyncGenerator function
@@ -70893,17 +75749,17 @@ var ts;
             return links.isExhaustive !== undefined ? links.isExhaustive : (links.isExhaustive = computeExhaustiveSwitchStatement(node));
         }
         function computeExhaustiveSwitchStatement(node) {
-            if (node.expression.kind === 211 /* TypeOfExpression */) {
+            if (node.expression.kind === 215 /* TypeOfExpression */) {
                 var operandType = getTypeOfExpression(node.expression.expression);
                 var witnesses = getSwitchClauseTypeOfWitnesses(node, /*retainDefault*/ false);
                 // notEqualFacts states that the type of the switched value is not equal to every type in the switch.
                 var notEqualFacts_1 = getFactsFromTypeofSwitch(0, 0, witnesses, /*hasDefault*/ true);
-                var type_4 = getBaseConstraintOfType(operandType) || operandType;
+                var type_5 = getBaseConstraintOfType(operandType) || operandType;
                 // Take any/unknown as a special condition. Or maybe we could change `type` to a union containing all primitive types.
-                if (type_4.flags & 3 /* AnyOrUnknown */) {
+                if (type_5.flags & 3 /* AnyOrUnknown */) {
                     return (556800 /* AllTypeofNE */ & notEqualFacts_1) === 556800 /* AllTypeofNE */;
                 }
-                return !!(filterType(type_4, function (t) { return (getTypeFacts(t) & notEqualFacts_1) === notEqualFacts_1; }).flags & 131072 /* Never */);
+                return !!(filterType(type_5, function (t) { return (getTypeFacts(t) & notEqualFacts_1) === notEqualFacts_1; }).flags & 131072 /* Never */);
             }
             var type = getTypeOfExpression(node.expression);
             if (!isLiteralType(type)) {
@@ -70933,7 +75789,7 @@ var ts;
                         // Promise/A+ compatible implementation will always assimilate any foreign promise, so the
                         // return type of the body should be unwrapped to its awaited type, which should be wrapped in
                         // the native Promise<T> type by the caller.
-                        type = checkAwaitedType(type, func, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);
+                        type = unwrapAwaitedType(checkAwaitedType(type, /*withAlias*/ false, func, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member));
                     }
                     if (type.flags & 131072 /* Never */) {
                         hasReturnOfTypeNever = true;
@@ -70956,11 +75812,11 @@ var ts;
         }
         function mayReturnNever(func) {
             switch (func.kind) {
-                case 208 /* FunctionExpression */:
-                case 209 /* ArrowFunction */:
+                case 212 /* FunctionExpression */:
+                case 213 /* ArrowFunction */:
                     return true;
-                case 165 /* MethodDeclaration */:
-                    return func.parent.kind === 200 /* ObjectLiteralExpression */;
+                case 168 /* MethodDeclaration */:
+                    return func.parent.kind === 204 /* ObjectLiteralExpression */;
                 default:
                     return false;
             }
@@ -70986,21 +75842,21 @@ var ts;
             }
             // If all we have is a function signature, or an arrow function with an expression body, then there is nothing to check.
             // also if HasImplicitReturn flag is not set this means that all codepaths in function body end with return or throw
-            if (func.kind === 164 /* MethodSignature */ || ts.nodeIsMissing(func.body) || func.body.kind !== 230 /* Block */ || !functionHasImplicitReturn(func)) {
+            if (func.kind === 167 /* MethodSignature */ || ts.nodeIsMissing(func.body) || func.body.kind !== 234 /* Block */ || !functionHasImplicitReturn(func)) {
                 return;
             }
             var hasExplicitReturn = func.flags & 512 /* HasExplicitReturn */;
+            var errorNode = ts.getEffectiveReturnTypeNode(func) || func;
             if (type && type.flags & 131072 /* Never */) {
-                error(ts.getEffectiveReturnTypeNode(func), ts.Diagnostics.A_function_returning_never_cannot_have_a_reachable_end_point);
+                error(errorNode, ts.Diagnostics.A_function_returning_never_cannot_have_a_reachable_end_point);
             }
             else if (type && !hasExplicitReturn) {
                 // minimal check: function has syntactic return type annotation and no explicit return statements in the body
                 // this function does not conform to the specification.
-                // NOTE: having returnType !== undefined is a precondition for entering this branch so func.type will always be present
-                error(ts.getEffectiveReturnTypeNode(func), ts.Diagnostics.A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value);
+                error(errorNode, ts.Diagnostics.A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value);
             }
             else if (type && strictNullChecks && !isTypeAssignableTo(undefinedType, type)) {
-                error(ts.getEffectiveReturnTypeNode(func) || func, ts.Diagnostics.Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined);
+                error(errorNode, ts.Diagnostics.Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined);
             }
             else if (compilerOptions.noImplicitReturns) {
                 if (!type) {
@@ -71015,16 +75871,19 @@ var ts;
                         return;
                     }
                 }
-                error(ts.getEffectiveReturnTypeNode(func) || func, ts.Diagnostics.Not_all_code_paths_return_a_value);
+                error(errorNode, ts.Diagnostics.Not_all_code_paths_return_a_value);
             }
         }
         function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) {
-            ts.Debug.assert(node.kind !== 165 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node));
+            ts.Debug.assert(node.kind !== 168 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node));
             checkNodeDeferred(node);
+            if (ts.isFunctionExpression(node)) {
+                checkCollisionsForDeclarationName(node, node.name);
+            }
             // The identityMapper object is used to indicate that function expressions are wildcards
             if (checkMode && checkMode & 4 /* SkipContextSensitive */ && isContextSensitive(node)) {
                 // Skip parameters, return signature with return type that retains noncontextual parts so inferences can still be drawn in an early stage
-                if (!ts.getEffectiveReturnTypeNode(node) && !hasContextSensitiveParameters(node)) {
+                if (!ts.getEffectiveReturnTypeNode(node) && !ts.hasContextSensitiveParameters(node)) {
                     // Return plain anyFunctionType if there is no possibility we'll make inferences from the return type
                     var contextualSignature = getContextualSignature(node);
                     if (contextualSignature && couldContainTypeVariables(getReturnTypeOfSignature(contextualSignature))) {
@@ -71034,8 +75893,8 @@ var ts;
                         }
                         var returnType = getReturnTypeFromBody(node, checkMode);
                         var returnOnlySignature = createSignature(undefined, undefined, undefined, ts.emptyArray, returnType, /*resolvedTypePredicate*/ undefined, 0, 0 /* None */);
-                        var returnOnlyType = createAnonymousType(node.symbol, emptySymbols, [returnOnlySignature], ts.emptyArray, undefined, undefined);
-                        returnOnlyType.objectFlags |= 2097152 /* NonInferrableType */;
+                        var returnOnlyType = createAnonymousType(node.symbol, emptySymbols, [returnOnlySignature], ts.emptyArray, ts.emptyArray);
+                        returnOnlyType.objectFlags |= 524288 /* NonInferrableType */;
                         return links.contextFreeType = returnOnlyType;
                     }
                 }
@@ -71043,7 +75902,7 @@ var ts;
             }
             // Grammar checking
             var hasGrammarError = checkGrammarFunctionLikeDeclaration(node);
-            if (!hasGrammarError && node.kind === 208 /* FunctionExpression */) {
+            if (!hasGrammarError && node.kind === 212 /* FunctionExpression */) {
                 checkGrammarForGenerator(node);
             }
             contextuallyCheckFunctionExpressionOrObjectLiteralMethod(node, checkMode);
@@ -71089,7 +75948,7 @@ var ts;
             }
         }
         function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) {
-            ts.Debug.assert(node.kind !== 165 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node));
+            ts.Debug.assert(node.kind !== 168 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node));
             var functionFlags = ts.getFunctionFlags(node);
             var returnType = getReturnTypeFromAnnotation(node);
             checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType);
@@ -71102,7 +75961,7 @@ var ts;
                     // checkFunctionExpressionBodies). So it must be done now.
                     getReturnTypeOfSignature(getSignatureFromDeclaration(node));
                 }
-                if (node.body.kind === 230 /* Block */) {
+                if (node.body.kind === 234 /* Block */) {
                     checkSourceElement(node.body);
                 }
                 else {
@@ -71115,7 +75974,7 @@ var ts;
                     var returnOrPromisedType = returnType && unwrapReturnType(returnType, functionFlags);
                     if (returnOrPromisedType) {
                         if ((functionFlags & 3 /* AsyncGenerator */) === 2 /* Async */) { // Async function
-                            var awaitedType = checkAwaitedType(exprType, node.body, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);
+                            var awaitedType = checkAwaitedType(exprType, /*withAlias*/ false, node.body, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);
                             checkTypeAssignableToAndOptionallyElaborate(awaitedType, returnOrPromisedType, node.body, node.body);
                         }
                         else { // Normal function
@@ -71189,10 +76048,10 @@ var ts;
                 // Allow assignments to readonly properties within constructors of the same class declaration.
                 if (symbol.flags & 4 /* Property */ &&
                     ts.isAccessExpression(expr) &&
-                    expr.expression.kind === 107 /* ThisKeyword */) {
+                    expr.expression.kind === 108 /* ThisKeyword */) {
                     // Look for if this is the constructor for the class that `symbol` is a property of.
                     var ctor = ts.getContainingFunction(expr);
-                    if (!(ctor && (ctor.kind === 166 /* Constructor */ || isJSConstructor(ctor)))) {
+                    if (!(ctor && (ctor.kind === 170 /* Constructor */ || isJSConstructor(ctor)))) {
                         return true;
                     }
                     if (symbol.valueDeclaration) {
@@ -71213,11 +76072,11 @@ var ts;
             if (ts.isAccessExpression(expr)) {
                 // references through namespace import should be readonly
                 var node = ts.skipParentheses(expr.expression);
-                if (node.kind === 78 /* Identifier */) {
+                if (node.kind === 79 /* Identifier */) {
                     var symbol_2 = getNodeLinks(node).resolvedSymbol;
                     if (symbol_2.flags & 2097152 /* Alias */) {
                         var declaration = getDeclarationOfAliasSymbol(symbol_2);
-                        return !!declaration && declaration.kind === 263 /* NamespaceImport */;
+                        return !!declaration && declaration.kind === 267 /* NamespaceImport */;
                     }
                 }
             }
@@ -71226,7 +76085,7 @@ var ts;
         function checkReferenceExpression(expr, invalidReferenceMessage, invalidOptionalChainMessage) {
             // References are combinations of identifiers, parentheses, and property accesses.
             var node = ts.skipOuterExpressions(expr, 6 /* Assertions */ | 1 /* Parentheses */);
-            if (node.kind !== 78 /* Identifier */ && !ts.isAccessExpression(node)) {
+            if (node.kind !== 79 /* Identifier */ && !ts.isAccessExpression(node)) {
                 error(expr, invalidReferenceMessage);
                 return false;
             }
@@ -71252,13 +76111,15 @@ var ts;
                 if (isReadonlySymbol(symbol)) {
                     error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_cannot_be_a_read_only_property);
                 }
-                checkDeleteExpressionMustBeOptional(expr, getTypeOfSymbol(symbol));
+                checkDeleteExpressionMustBeOptional(expr, symbol);
             }
             return booleanType;
         }
-        function checkDeleteExpressionMustBeOptional(expr, type) {
-            var AnyOrUnknownOrNeverFlags = 3 /* AnyOrUnknown */ | 131072 /* Never */;
-            if (strictNullChecks && !(type.flags & AnyOrUnknownOrNeverFlags) && !(getFalsyFlags(type) & 32768 /* Undefined */)) {
+        function checkDeleteExpressionMustBeOptional(expr, symbol) {
+            var type = getTypeOfSymbol(symbol);
+            if (strictNullChecks &&
+                !(type.flags & (3 /* AnyOrUnknown */ | 131072 /* Never */)) &&
+                !(exactOptionalPropertyTypes ? symbol.flags & 16777216 /* Optional */ : getFalsyFlags(type) & 32768 /* Undefined */)) {
                 error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_must_be_optional);
             }
         }
@@ -71273,7 +76134,11 @@ var ts;
         function checkAwaitExpression(node) {
             // Grammar checking
             if (produceDiagnostics) {
-                if (!(node.flags & 32768 /* AwaitContext */)) {
+                var container = ts.getContainingFunctionOrClassStaticBlock(node);
+                if (container && ts.isClassStaticBlockDeclaration(container)) {
+                    error(node, ts.Diagnostics.Await_expression_cannot_be_used_inside_a_class_static_block);
+                }
+                else if (!(node.flags & 32768 /* AwaitContext */)) {
                     if (ts.isInTopLevelContext(node)) {
                         var sourceFile = ts.getSourceFileOfNode(node);
                         if (!hasParseDiagnostics(sourceFile)) {
@@ -71284,9 +76149,9 @@ var ts;
                                 var diagnostic = ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.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);
                                 diagnostics.add(diagnostic);
                             }
-                            if ((moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.System) || languageVersion < 4 /* ES2017 */) {
+                            if ((moduleKind !== ts.ModuleKind.ES2022 && moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.System && !(moduleKind === ts.ModuleKind.NodeNext && ts.getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.ESNext)) || languageVersion < 4 /* ES2017 */) {
                                 span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos);
-                                var diagnostic = ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_esnext_or_system_and_the_target_option_is_set_to_es2017_or_higher);
+                                var diagnostic = ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher);
                                 diagnostics.add(diagnostic);
                             }
                         }
@@ -71297,9 +76162,8 @@ var ts;
                         if (!hasParseDiagnostics(sourceFile)) {
                             var span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos);
                             var diagnostic = ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules);
-                            var func = ts.getContainingFunction(node);
-                            if (func && func.kind !== 166 /* Constructor */ && (ts.getFunctionFlags(func) & 2 /* Async */) === 0) {
-                                var relatedInfo = ts.createDiagnosticForNode(func, ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async);
+                            if (container && container.kind !== 170 /* Constructor */ && (ts.getFunctionFlags(container) & 2 /* Async */) === 0) {
+                                var relatedInfo = ts.createDiagnosticForNode(container, ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async);
                                 ts.addRelatedInfo(diagnostic, relatedInfo);
                             }
                             diagnostics.add(diagnostic);
@@ -71311,8 +76175,8 @@ var ts;
                 }
             }
             var operandType = checkExpression(node.expression);
-            var awaitedType = checkAwaitedType(operandType, node, ts.Diagnostics.Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);
-            if (awaitedType === operandType && awaitedType !== errorType && !(operandType.flags & 3 /* AnyOrUnknown */)) {
+            var awaitedType = checkAwaitedType(operandType, /*withAlias*/ true, node, ts.Diagnostics.Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);
+            if (awaitedType === operandType && !isErrorType(awaitedType) && !(operandType.flags & 3 /* AnyOrUnknown */)) {
                 addErrorOrSuggestion(/*isError*/ false, ts.createDiagnosticForNode(node, ts.Diagnostics.await_has_no_effect_on_the_type_of_this_expression));
             }
             return awaitedType;
@@ -71326,14 +76190,14 @@ var ts;
                 case 8 /* NumericLiteral */:
                     switch (node.operator) {
                         case 40 /* MinusToken */:
-                            return getFreshTypeOfLiteralType(getLiteralType(-node.operand.text));
+                            return getFreshTypeOfLiteralType(getNumberLiteralType(-node.operand.text));
                         case 39 /* PlusToken */:
-                            return getFreshTypeOfLiteralType(getLiteralType(+node.operand.text));
+                            return getFreshTypeOfLiteralType(getNumberLiteralType(+node.operand.text));
                     }
                     break;
                 case 9 /* BigIntLiteral */:
                     if (node.operator === 40 /* MinusToken */) {
-                        return getFreshTypeOfLiteralType(getLiteralType({
+                        return getFreshTypeOfLiteralType(getBigIntLiteralType({
                             negative: true,
                             base10Value: ts.parsePseudoBigInt(node.operand.text)
                         }));
@@ -71400,8 +76264,8 @@ var ts;
             }
             if (type.flags & 3145728 /* UnionOrIntersection */) {
                 var types = type.types;
-                for (var _i = 0, types_22 = types; _i < types_22.length; _i++) {
-                    var t = types_22[_i];
+                for (var _i = 0, types_21 = types; _i < types_21.length; _i++) {
+                    var t = types_21[_i];
                     if (maybeTypeOfKind(t, kind)) {
                         return true;
                     }
@@ -71461,11 +76325,29 @@ var ts;
             if (leftType === silentNeverType || rightType === silentNeverType) {
                 return silentNeverType;
             }
-            leftType = checkNonNullType(leftType, left);
+            if (ts.isPrivateIdentifier(left)) {
+                if (languageVersion < 99 /* ESNext */) {
+                    checkExternalEmitHelpers(left, 2097152 /* ClassPrivateFieldIn */);
+                }
+                // Unlike in 'checkPrivateIdentifierExpression' we now have access to the RHS type
+                // which provides us with the opportunity to emit more detailed errors
+                if (!getNodeLinks(left).resolvedSymbol && ts.getContainingClass(left)) {
+                    var isUncheckedJS = isUncheckedJSSuggestion(left, rightType.symbol, /*excludeClasses*/ true);
+                    reportNonexistentProperty(left, rightType, isUncheckedJS);
+                }
+            }
+            else {
+                leftType = checkNonNullType(leftType, left);
+                // TypeScript 1.0 spec (April 2014): 4.15.5
+                // Require the left operand to be of type Any, the String primitive type, or the Number primitive type.
+                if (!(allTypesAssignableToKind(leftType, 402653316 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */) ||
+                    isTypeAssignableToKind(leftType, 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */ | 262144 /* TypeParameter */))) {
+                    error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_a_private_identifier_or_of_type_any_string_number_or_symbol);
+                }
+            }
             rightType = checkNonNullType(rightType, right);
             // TypeScript 1.0 spec (April 2014): 4.15.5
-            // The in operator requires the left operand to be of type Any, the String primitive type, or the Number primitive type,
-            // and the right operand to be
+            // The in operator requires the right operand to be
             //
             //   1. assignable to the non-primitive type,
             //   2. an unconstrained type parameter,
@@ -71483,10 +76365,6 @@ var ts;
             // unless *all* instantiations would result in an error.
             //
             // The result is always of the Boolean primitive type.
-            if (!(allTypesAssignableToKind(leftType, 402653316 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */) ||
-                isTypeAssignableToKind(leftType, 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */ | 262144 /* TypeParameter */))) {
-                error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol);
-            }
             var rightTypeConstraint = getConstraintOfType(rightType);
             if (!allTypesAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 58982400 /* InstantiableNonPrimitive */) ||
                 rightTypeConstraint && (isTypeAssignableToKind(rightType, 3145728 /* UnionOrIntersection */) && !allTypesAssignableToKind(rightTypeConstraint, 67108864 /* NonPrimitive */ | 58982400 /* InstantiableNonPrimitive */) ||
@@ -71510,7 +76388,7 @@ var ts;
             if (rightIsThis === void 0) { rightIsThis = false; }
             var properties = node.properties;
             var property = properties[propertyIndex];
-            if (property.kind === 288 /* PropertyAssignment */ || property.kind === 289 /* ShorthandPropertyAssignment */) {
+            if (property.kind === 294 /* PropertyAssignment */ || property.kind === 295 /* ShorthandPropertyAssignment */) {
                 var name = property.name;
                 var exprType = getLiteralTypeFromPropertyName(name);
                 if (isTypeUsableAsPropertyName(exprType)) {
@@ -71518,14 +76396,14 @@ var ts;
                     var prop = getPropertyOfType(objectLiteralType, text);
                     if (prop) {
                         markPropertyAsReferenced(prop, property, rightIsThis);
-                        checkPropertyAccessibility(property, /*isSuper*/ false, objectLiteralType, prop);
+                        checkPropertyAccessibility(property, /*isSuper*/ false, /*writing*/ true, objectLiteralType, prop);
                     }
                 }
-                var elementType = getIndexedAccessType(objectLiteralType, exprType, /*noUncheckedIndexedAccessCandidate*/ undefined, name, /*aliasSymbol*/ undefined, /*aliasTypeArguments*/ undefined, 16 /* ExpressionPosition */);
+                var elementType = getIndexedAccessType(objectLiteralType, exprType, 32 /* ExpressionPosition */, name);
                 var type = getFlowTypeOfDestructuring(property, elementType);
-                return checkDestructuringAssignment(property.kind === 289 /* ShorthandPropertyAssignment */ ? property : property.initializer, type);
+                return checkDestructuringAssignment(property.kind === 295 /* ShorthandPropertyAssignment */ ? property : property.initializer, type);
             }
-            else if (property.kind === 290 /* SpreadAssignment */) {
+            else if (property.kind === 296 /* SpreadAssignment */) {
                 if (propertyIndex < properties.length - 1) {
                     error(property, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern);
                 }
@@ -71563,7 +76441,7 @@ var ts;
             var inBoundsType = compilerOptions.noUncheckedIndexedAccess ? undefined : possiblyOutOfBoundsType;
             for (var i = 0; i < elements.length; i++) {
                 var type = possiblyOutOfBoundsType;
-                if (node.elements[i].kind === 220 /* SpreadElement */) {
+                if (node.elements[i].kind === 224 /* SpreadElement */) {
                     type = inBoundsType = inBoundsType !== null && inBoundsType !== void 0 ? inBoundsType : (checkIteratedTypeOrElementType(65 /* Destructuring */, sourceType, undefinedType, node) || errorType);
                 }
                 checkArrayLiteralDestructuringElementAssignment(node, sourceType, i, type, checkMode);
@@ -71573,14 +76451,14 @@ var ts;
         function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) {
             var elements = node.elements;
             var element = elements[elementIndex];
-            if (element.kind !== 222 /* OmittedExpression */) {
-                if (element.kind !== 220 /* SpreadElement */) {
-                    var indexType = getLiteralType(elementIndex);
+            if (element.kind !== 226 /* OmittedExpression */) {
+                if (element.kind !== 224 /* SpreadElement */) {
+                    var indexType = getNumberLiteralType(elementIndex);
                     if (isArrayLikeType(sourceType)) {
                         // We create a synthetic expression so that getIndexedAccessType doesn't get confused
                         // when the element is a SyntaxKind.ElementAccessExpression.
-                        var accessFlags = 16 /* ExpressionPosition */ | (hasDefaultValue(element) ? 8 /* NoTupleBoundsCheck */ : 0);
-                        var elementType_2 = getIndexedAccessTypeOrUndefined(sourceType, indexType, /*noUncheckedIndexedAccessCandidate*/ undefined, createSyntheticExpression(element, indexType), accessFlags) || errorType;
+                        var accessFlags = 32 /* ExpressionPosition */ | (hasDefaultValue(element) ? 16 /* NoTupleBoundsCheck */ : 0);
+                        var elementType_2 = getIndexedAccessTypeOrUndefined(sourceType, indexType, accessFlags, createSyntheticExpression(element, indexType)) || errorType;
                         var assignedType = hasDefaultValue(element) ? getTypeWithFacts(elementType_2, 524288 /* NEUndefined */) : elementType_2;
                         var type = getFlowTypeOfDestructuring(element, assignedType);
                         return checkDestructuringAssignment(element, type, checkMode);
@@ -71592,7 +76470,7 @@ var ts;
                 }
                 else {
                     var restExpression = element.expression;
-                    if (restExpression.kind === 216 /* BinaryExpression */ && restExpression.operatorToken.kind === 62 /* EqualsToken */) {
+                    if (restExpression.kind === 220 /* BinaryExpression */ && restExpression.operatorToken.kind === 63 /* EqualsToken */) {
                         error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer);
                     }
                     else {
@@ -71608,7 +76486,7 @@ var ts;
         }
         function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode, rightIsThis) {
             var target;
-            if (exprOrAssignment.kind === 289 /* ShorthandPropertyAssignment */) {
+            if (exprOrAssignment.kind === 295 /* ShorthandPropertyAssignment */) {
                 var prop = exprOrAssignment;
                 if (prop.objectAssignmentInitializer) {
                     // In strict null checking mode, if a default value of a non-undefined type is specified, remove
@@ -71624,24 +76502,24 @@ var ts;
             else {
                 target = exprOrAssignment;
             }
-            if (target.kind === 216 /* BinaryExpression */ && target.operatorToken.kind === 62 /* EqualsToken */) {
+            if (target.kind === 220 /* BinaryExpression */ && target.operatorToken.kind === 63 /* EqualsToken */) {
                 checkBinaryExpression(target, checkMode);
                 target = target.left;
             }
-            if (target.kind === 200 /* ObjectLiteralExpression */) {
+            if (target.kind === 204 /* ObjectLiteralExpression */) {
                 return checkObjectLiteralAssignment(target, sourceType, rightIsThis);
             }
-            if (target.kind === 199 /* ArrayLiteralExpression */) {
+            if (target.kind === 203 /* ArrayLiteralExpression */) {
                 return checkArrayLiteralAssignment(target, sourceType, checkMode);
             }
             return checkReferenceAssignment(target, sourceType, checkMode);
         }
         function checkReferenceAssignment(target, sourceType, checkMode) {
             var targetType = checkExpression(target, checkMode);
-            var error = target.parent.kind === 290 /* SpreadAssignment */ ?
+            var error = target.parent.kind === 296 /* SpreadAssignment */ ?
                 ts.Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access :
                 ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access;
-            var optionalError = target.parent.kind === 290 /* SpreadAssignment */ ?
+            var optionalError = target.parent.kind === 296 /* SpreadAssignment */ ?
                 ts.Diagnostics.The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access :
                 ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access;
             if (checkReferenceExpression(target, error, optionalError)) {
@@ -71663,39 +76541,39 @@ var ts;
         function isSideEffectFree(node) {
             node = ts.skipParentheses(node);
             switch (node.kind) {
-                case 78 /* Identifier */:
+                case 79 /* Identifier */:
                 case 10 /* StringLiteral */:
                 case 13 /* RegularExpressionLiteral */:
-                case 205 /* TaggedTemplateExpression */:
-                case 218 /* TemplateExpression */:
+                case 209 /* TaggedTemplateExpression */:
+                case 222 /* TemplateExpression */:
                 case 14 /* NoSubstitutionTemplateLiteral */:
                 case 8 /* NumericLiteral */:
                 case 9 /* BigIntLiteral */:
-                case 109 /* TrueKeyword */:
-                case 94 /* FalseKeyword */:
-                case 103 /* NullKeyword */:
-                case 150 /* UndefinedKeyword */:
-                case 208 /* FunctionExpression */:
-                case 221 /* ClassExpression */:
-                case 209 /* ArrowFunction */:
-                case 199 /* ArrayLiteralExpression */:
-                case 200 /* ObjectLiteralExpression */:
-                case 211 /* TypeOfExpression */:
-                case 225 /* NonNullExpression */:
-                case 274 /* JsxSelfClosingElement */:
-                case 273 /* JsxElement */:
+                case 110 /* TrueKeyword */:
+                case 95 /* FalseKeyword */:
+                case 104 /* NullKeyword */:
+                case 152 /* UndefinedKeyword */:
+                case 212 /* FunctionExpression */:
+                case 225 /* ClassExpression */:
+                case 213 /* ArrowFunction */:
+                case 203 /* ArrayLiteralExpression */:
+                case 204 /* ObjectLiteralExpression */:
+                case 215 /* TypeOfExpression */:
+                case 229 /* NonNullExpression */:
+                case 278 /* JsxSelfClosingElement */:
+                case 277 /* JsxElement */:
                     return true;
-                case 217 /* ConditionalExpression */:
+                case 221 /* ConditionalExpression */:
                     return isSideEffectFree(node.whenTrue) &&
                         isSideEffectFree(node.whenFalse);
-                case 216 /* BinaryExpression */:
+                case 220 /* BinaryExpression */:
                     if (ts.isAssignmentOperator(node.operatorToken.kind)) {
                         return false;
                     }
                     return isSideEffectFree(node.left) &&
                         isSideEffectFree(node.right);
-                case 214 /* PrefixUnaryExpression */:
-                case 215 /* PostfixUnaryExpression */:
+                case 218 /* PrefixUnaryExpression */:
+                case 219 /* PostfixUnaryExpression */:
                     // Unary operators ~, !, +, and - have no side effects.
                     // The rest do.
                     switch (node.operator) {
@@ -71707,9 +76585,9 @@ var ts;
                     }
                     return false;
                 // Some forms listed here for clarity
-                case 212 /* VoidExpression */: // Explicit opt-out
-                case 206 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings
-                case 224 /* AsExpression */: // Not SEF, but can produce useful type warnings
+                case 216 /* VoidExpression */: // Explicit opt-out
+                case 210 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings
+                case 228 /* AsExpression */: // Not SEF, but can produce useful type warnings
                 default:
                     return false;
             }
@@ -71717,84 +76595,111 @@ var ts;
         function isTypeEqualityComparableTo(source, target) {
             return (target.flags & 98304 /* Nullable */) !== 0 || isTypeComparableTo(source, target);
         }
-        var CheckBinaryExpressionState;
-        (function (CheckBinaryExpressionState) {
-            CheckBinaryExpressionState[CheckBinaryExpressionState["MaybeCheckLeft"] = 0] = "MaybeCheckLeft";
-            CheckBinaryExpressionState[CheckBinaryExpressionState["CheckRight"] = 1] = "CheckRight";
-            CheckBinaryExpressionState[CheckBinaryExpressionState["FinishCheck"] = 2] = "FinishCheck";
-        })(CheckBinaryExpressionState || (CheckBinaryExpressionState = {}));
-        function checkBinaryExpression(node, checkMode) {
-            var workStacks = {
-                expr: [node],
-                state: [0 /* MaybeCheckLeft */],
-                leftType: [undefined]
+        function createCheckBinaryExpression() {
+            var trampoline = ts.createBinaryExpressionTrampoline(onEnter, onLeft, onOperator, onRight, onExit, foldState);
+            return function (node, checkMode) {
+                var result = trampoline(node, checkMode);
+                ts.Debug.assertIsDefined(result);
+                return result;
             };
-            var stackIndex = 0;
-            var lastResult;
-            while (stackIndex >= 0) {
-                node = workStacks.expr[stackIndex];
-                switch (workStacks.state[stackIndex]) {
-                    case 0 /* MaybeCheckLeft */: {
-                        if (ts.isInJSFile(node) && ts.getAssignedExpandoInitializer(node)) {
-                            finishInvocation(checkExpression(node.right, checkMode));
-                            break;
-                        }
-                        checkGrammarNullishCoalesceWithLogicalExpression(node);
-                        var operator = node.operatorToken.kind;
-                        if (operator === 62 /* EqualsToken */ && (node.left.kind === 200 /* ObjectLiteralExpression */ || node.left.kind === 199 /* ArrayLiteralExpression */)) {
-                            finishInvocation(checkDestructuringAssignment(node.left, checkExpression(node.right, checkMode), checkMode, node.right.kind === 107 /* ThisKeyword */));
-                            break;
-                        }
-                        advanceState(1 /* CheckRight */);
-                        maybeCheckExpression(node.left);
-                        break;
-                    }
-                    case 1 /* CheckRight */: {
-                        var leftType = lastResult;
-                        workStacks.leftType[stackIndex] = leftType;
-                        var operator = node.operatorToken.kind;
-                        if (operator === 55 /* AmpersandAmpersandToken */ || operator === 56 /* BarBarToken */ || operator === 60 /* QuestionQuestionToken */) {
-                            if (operator === 55 /* AmpersandAmpersandToken */) {
-                                var parent = ts.walkUpParenthesizedExpressions(node.parent);
-                                checkTestingKnownTruthyCallableType(node.left, leftType, ts.isIfStatement(parent) ? parent.thenStatement : undefined);
-                            }
-                            checkTruthinessOfType(leftType, node.left);
+            function onEnter(node, state, checkMode) {
+                if (state) {
+                    state.stackIndex++;
+                    state.skip = false;
+                    setLeftType(state, /*type*/ undefined);
+                    setLastResult(state, /*type*/ undefined);
+                }
+                else {
+                    state = {
+                        checkMode: checkMode,
+                        skip: false,
+                        stackIndex: 0,
+                        typeStack: [undefined, undefined],
+                    };
+                }
+                if (ts.isInJSFile(node) && ts.getAssignedExpandoInitializer(node)) {
+                    state.skip = true;
+                    setLastResult(state, checkExpression(node.right, checkMode));
+                    return state;
+                }
+                checkGrammarNullishCoalesceWithLogicalExpression(node);
+                var operator = node.operatorToken.kind;
+                if (operator === 63 /* EqualsToken */ && (node.left.kind === 204 /* ObjectLiteralExpression */ || node.left.kind === 203 /* ArrayLiteralExpression */)) {
+                    state.skip = true;
+                    setLastResult(state, checkDestructuringAssignment(node.left, checkExpression(node.right, checkMode), checkMode, node.right.kind === 108 /* ThisKeyword */));
+                    return state;
+                }
+                return state;
+            }
+            function onLeft(left, state, _node) {
+                if (!state.skip) {
+                    return maybeCheckExpression(state, left);
+                }
+            }
+            function onOperator(operatorToken, state, node) {
+                if (!state.skip) {
+                    var leftType = getLastResult(state);
+                    ts.Debug.assertIsDefined(leftType);
+                    setLeftType(state, leftType);
+                    setLastResult(state, /*type*/ undefined);
+                    var operator = operatorToken.kind;
+                    if (operator === 55 /* AmpersandAmpersandToken */ || operator === 56 /* BarBarToken */ || operator === 60 /* QuestionQuestionToken */) {
+                        if (operator === 55 /* AmpersandAmpersandToken */) {
+                            var parent = ts.walkUpParenthesizedExpressions(node.parent);
+                            checkTestingKnownTruthyCallableOrAwaitableType(node.left, leftType, ts.isIfStatement(parent) ? parent.thenStatement : undefined);
                         }
-                        advanceState(2 /* FinishCheck */);
-                        maybeCheckExpression(node.right);
-                        break;
-                    }
-                    case 2 /* FinishCheck */: {
-                        var leftType = workStacks.leftType[stackIndex];
-                        var rightType = lastResult;
-                        finishInvocation(checkBinaryLikeExpressionWorker(node.left, node.operatorToken, node.right, leftType, rightType, node));
-                        break;
+                        checkTruthinessOfType(leftType, node.left);
                     }
-                    default: return ts.Debug.fail("Invalid state " + workStacks.state[stackIndex] + " for checkBinaryExpression");
                 }
             }
-            return lastResult;
-            function finishInvocation(result) {
-                lastResult = result;
-                stackIndex--;
-            }
-            /**
-             * Note that `advanceState` sets the _current_ head state, and that `maybeCheckExpression` potentially pushes on a new
-             * head state; so `advanceState` must be called before any `maybeCheckExpression` during a state's execution.
-             */
-            function advanceState(nextState) {
-                workStacks.state[stackIndex] = nextState;
+            function onRight(right, state, _node) {
+                if (!state.skip) {
+                    return maybeCheckExpression(state, right);
+                }
             }
-            function maybeCheckExpression(node) {
-                if (ts.isBinaryExpression(node)) {
-                    stackIndex++;
-                    workStacks.expr[stackIndex] = node;
-                    workStacks.state[stackIndex] = 0 /* MaybeCheckLeft */;
-                    workStacks.leftType[stackIndex] = undefined;
+            function onExit(node, state) {
+                var result;
+                if (state.skip) {
+                    result = getLastResult(state);
                 }
                 else {
-                    lastResult = checkExpression(node, checkMode);
+                    var leftType = getLeftType(state);
+                    ts.Debug.assertIsDefined(leftType);
+                    var rightType = getLastResult(state);
+                    ts.Debug.assertIsDefined(rightType);
+                    result = checkBinaryLikeExpressionWorker(node.left, node.operatorToken, node.right, leftType, rightType, node);
+                }
+                state.skip = false;
+                setLeftType(state, /*type*/ undefined);
+                setLastResult(state, /*type*/ undefined);
+                state.stackIndex--;
+                return result;
+            }
+            function foldState(state, result, _side) {
+                setLastResult(state, result);
+                return state;
+            }
+            function maybeCheckExpression(state, node) {
+                if (ts.isBinaryExpression(node)) {
+                    return node;
                 }
+                setLastResult(state, checkExpression(node, state.checkMode));
+            }
+            function getLeftType(state) {
+                return state.typeStack[state.stackIndex];
+            }
+            function setLeftType(state, type) {
+                state.typeStack[state.stackIndex] = type;
+            }
+            function getLastResult(state) {
+                return state.typeStack[state.stackIndex + 1];
+            }
+            function setLastResult(state, type) {
+                // To reduce overhead, reuse the next stack entry to store the
+                // last result. This avoids the overhead of an additional property
+                // on `WorkArea` and reuses empty stack entries as we walk back up
+                // the stack.
+                state.typeStack[state.stackIndex + 1] = type;
             }
         }
         function checkGrammarNullishCoalesceWithLogicalExpression(node) {
@@ -71812,8 +76717,8 @@ var ts;
         // expression-wide checks and does not use a work stack to fold nested binary expressions into the same callstack frame
         function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) {
             var operator = operatorToken.kind;
-            if (operator === 62 /* EqualsToken */ && (left.kind === 200 /* ObjectLiteralExpression */ || left.kind === 199 /* ArrayLiteralExpression */)) {
-                return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode, right.kind === 107 /* ThisKeyword */);
+            if (operator === 63 /* EqualsToken */ && (left.kind === 204 /* ObjectLiteralExpression */ || left.kind === 203 /* ArrayLiteralExpression */)) {
+                return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode, right.kind === 108 /* ThisKeyword */);
             }
             var leftType;
             if (operator === 55 /* AmpersandAmpersandToken */ || operator === 56 /* BarBarToken */ || operator === 60 /* QuestionQuestionToken */) {
@@ -71830,26 +76735,26 @@ var ts;
             switch (operator) {
                 case 41 /* AsteriskToken */:
                 case 42 /* AsteriskAsteriskToken */:
-                case 65 /* AsteriskEqualsToken */:
-                case 66 /* AsteriskAsteriskEqualsToken */:
+                case 66 /* AsteriskEqualsToken */:
+                case 67 /* AsteriskAsteriskEqualsToken */:
                 case 43 /* SlashToken */:
-                case 67 /* SlashEqualsToken */:
+                case 68 /* SlashEqualsToken */:
                 case 44 /* PercentToken */:
-                case 68 /* PercentEqualsToken */:
+                case 69 /* PercentEqualsToken */:
                 case 40 /* MinusToken */:
-                case 64 /* MinusEqualsToken */:
+                case 65 /* MinusEqualsToken */:
                 case 47 /* LessThanLessThanToken */:
-                case 69 /* LessThanLessThanEqualsToken */:
+                case 70 /* LessThanLessThanEqualsToken */:
                 case 48 /* GreaterThanGreaterThanToken */:
-                case 70 /* GreaterThanGreaterThanEqualsToken */:
+                case 71 /* GreaterThanGreaterThanEqualsToken */:
                 case 49 /* GreaterThanGreaterThanGreaterThanToken */:
-                case 71 /* GreaterThanGreaterThanGreaterThanEqualsToken */:
+                case 72 /* GreaterThanGreaterThanGreaterThanEqualsToken */:
                 case 51 /* BarToken */:
-                case 73 /* BarEqualsToken */:
+                case 74 /* BarEqualsToken */:
                 case 52 /* CaretToken */:
-                case 77 /* CaretEqualsToken */:
+                case 78 /* CaretEqualsToken */:
                 case 50 /* AmpersandToken */:
-                case 72 /* AmpersandEqualsToken */:
+                case 73 /* AmpersandEqualsToken */:
                     if (leftType === silentNeverType || rightType === silentNeverType) {
                         return silentNeverType;
                     }
@@ -71879,11 +76784,11 @@ var ts;
                         else if (bothAreBigIntLike(leftType, rightType)) {
                             switch (operator) {
                                 case 49 /* GreaterThanGreaterThanGreaterThanToken */:
-                                case 71 /* GreaterThanGreaterThanGreaterThanEqualsToken */:
+                                case 72 /* GreaterThanGreaterThanGreaterThanEqualsToken */:
                                     reportOperatorError();
                                     break;
                                 case 42 /* AsteriskAsteriskToken */:
-                                case 66 /* AsteriskAsteriskEqualsToken */:
+                                case 67 /* AsteriskAsteriskEqualsToken */:
                                     if (languageVersion < 3 /* ES2016 */) {
                                         error(errorNode, ts.Diagnostics.Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_later);
                                     }
@@ -71901,7 +76806,7 @@ var ts;
                         return resultType_1;
                     }
                 case 39 /* PlusToken */:
-                case 63 /* PlusEqualsToken */:
+                case 64 /* PlusEqualsToken */:
                     if (leftType === silentNeverType || rightType === silentNeverType) {
                         return silentNeverType;
                     }
@@ -71926,7 +76831,7 @@ var ts;
                     else if (isTypeAny(leftType) || isTypeAny(rightType)) {
                         // Otherwise, the result is of type Any.
                         // NOTE: unknown type here denotes error type. Old compiler treated this case as any type so do we.
-                        resultType = leftType === errorType || rightType === errorType ? errorType : anyType;
+                        resultType = isErrorType(leftType) || isErrorType(rightType) ? errorType : anyType;
                     }
                     // Symbols are not allowed at all in arithmetic expressions
                     if (resultType && !checkForDisallowedESSymbolOperand(operator)) {
@@ -71944,7 +76849,7 @@ var ts;
                         });
                         return anyType;
                     }
-                    if (operator === 63 /* PlusEqualsToken */) {
+                    if (operator === 64 /* PlusEqualsToken */) {
                         checkAssignmentOperator(resultType);
                     }
                     return resultType;
@@ -71966,41 +76871,41 @@ var ts;
                 case 37 /* ExclamationEqualsEqualsToken */:
                     reportOperatorErrorUnless(function (left, right) { return isTypeEqualityComparableTo(left, right) || isTypeEqualityComparableTo(right, left); });
                     return booleanType;
-                case 101 /* InstanceOfKeyword */:
+                case 102 /* InstanceOfKeyword */:
                     return checkInstanceOfExpression(left, right, leftType, rightType);
-                case 100 /* InKeyword */:
+                case 101 /* InKeyword */:
                     return checkInExpression(left, right, leftType, rightType);
                 case 55 /* AmpersandAmpersandToken */:
-                case 75 /* AmpersandAmpersandEqualsToken */: {
+                case 76 /* AmpersandAmpersandEqualsToken */: {
                     var resultType_2 = getTypeFacts(leftType) & 4194304 /* Truthy */ ?
                         getUnionType([extractDefinitelyFalsyTypes(strictNullChecks ? leftType : getBaseTypeOfLiteralType(rightType)), rightType]) :
                         leftType;
-                    if (operator === 75 /* AmpersandAmpersandEqualsToken */) {
+                    if (operator === 76 /* AmpersandAmpersandEqualsToken */) {
                         checkAssignmentOperator(rightType);
                     }
                     return resultType_2;
                 }
                 case 56 /* BarBarToken */:
-                case 74 /* BarBarEqualsToken */: {
+                case 75 /* BarBarEqualsToken */: {
                     var resultType_3 = getTypeFacts(leftType) & 8388608 /* Falsy */ ?
                         getUnionType([removeDefinitelyFalsyTypes(leftType), rightType], 2 /* Subtype */) :
                         leftType;
-                    if (operator === 74 /* BarBarEqualsToken */) {
+                    if (operator === 75 /* BarBarEqualsToken */) {
                         checkAssignmentOperator(rightType);
                     }
                     return resultType_3;
                 }
                 case 60 /* QuestionQuestionToken */:
-                case 76 /* QuestionQuestionEqualsToken */: {
+                case 77 /* QuestionQuestionEqualsToken */: {
                     var resultType_4 = getTypeFacts(leftType) & 262144 /* EQUndefinedOrNull */ ?
                         getUnionType([getNonNullableType(leftType), rightType], 2 /* Subtype */) :
                         leftType;
-                    if (operator === 76 /* QuestionQuestionEqualsToken */) {
+                    if (operator === 77 /* QuestionQuestionEqualsToken */) {
                         checkAssignmentOperator(rightType);
                     }
                     return resultType_4;
                 }
-                case 62 /* EqualsToken */:
+                case 63 /* EqualsToken */:
                     var declKind = ts.isBinaryExpression(left.parent) ? ts.getAssignmentDeclarationKind(left.parent) : 0 /* None */;
                     checkAssignmentDeclaration(declKind, rightType);
                     if (isAssignmentDeclaration(declKind)) {
@@ -72047,7 +76952,7 @@ var ts;
                         if (propType.symbol && propType.symbol.flags & 32 /* Class */) {
                             var name = prop.escapedName;
                             var symbol = resolveName(prop.valueDeclaration, name, 788968 /* Type */, undefined, name, /*isUse*/ false);
-                            if (symbol && symbol.declarations.some(ts.isJSDocTypedefTag)) {
+                            if ((symbol === null || symbol === void 0 ? void 0 : symbol.declarations) && symbol.declarations.some(ts.isJSDocTypedefTag)) {
                                 addDuplicateDeclarationErrorsForSymbols(symbol, ts.Diagnostics.Duplicate_identifier_0, ts.unescapeLeadingUnderscores(name), prop);
                                 addDuplicateDeclarationErrorsForSymbols(prop, ts.Diagnostics.Duplicate_identifier_0, ts.unescapeLeadingUnderscores(name), symbol);
                             }
@@ -72056,7 +76961,7 @@ var ts;
                 }
             }
             function isEvalNode(node) {
-                return node.kind === 78 /* Identifier */ && node.escapedText === "eval";
+                return node.kind === 79 /* Identifier */ && node.escapedText === "eval";
             }
             // Return true if there was no error, false if there was an error.
             function checkForDisallowedESSymbolOperand(operator) {
@@ -72072,13 +76977,13 @@ var ts;
             function getSuggestedBooleanOperator(operator) {
                 switch (operator) {
                     case 51 /* BarToken */:
-                    case 73 /* BarEqualsToken */:
+                    case 74 /* BarEqualsToken */:
                         return 56 /* BarBarToken */;
                     case 52 /* CaretToken */:
-                    case 77 /* CaretEqualsToken */:
+                    case 78 /* CaretEqualsToken */:
                         return 37 /* ExclamationEqualsEqualsToken */;
                     case 50 /* AmpersandToken */:
-                    case 72 /* AmpersandEqualsToken */:
+                    case 73 /* AmpersandEqualsToken */:
                         return 55 /* AmpersandAmpersandToken */;
                     default:
                         return undefined;
@@ -72094,8 +76999,15 @@ var ts;
                     // and the type of the non-compound operation to be assignable to the type of VarExpr.
                     if (checkReferenceExpression(left, ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access, ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access)
                         && (!ts.isIdentifier(left) || ts.unescapeLeadingUnderscores(left.escapedText) !== "exports")) {
+                        var headMessage = void 0;
+                        if (exactOptionalPropertyTypes && ts.isPropertyAccessExpression(left) && maybeTypeOfKind(valueType, 32768 /* Undefined */)) {
+                            var target = getTypeOfPropertyOfType(getTypeOfExpression(left.expression), left.name.escapedText);
+                            if (isExactOptionalPropertyMismatch(valueType, target)) {
+                                headMessage = ts.Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target;
+                            }
+                        }
                         // to avoid cascading errors check assignability only if 'isReference' check succeeded and no errors were reported
-                        checkTypeAssignableToAndOptionallyElaborate(valueType, leftType, left, right);
+                        checkTypeAssignableToAndOptionallyElaborate(valueType, leftType, left, right, headMessage);
                     }
                 }
             }
@@ -72132,8 +77044,8 @@ var ts;
                 var wouldWorkWithAwait = false;
                 var errNode = errorNode || operatorToken;
                 if (isRelated) {
-                    var awaitedLeftType = getAwaitedType(leftType);
-                    var awaitedRightType = getAwaitedType(rightType);
+                    var awaitedLeftType = getAwaitedTypeNoAlias(leftType);
+                    var awaitedRightType = getAwaitedTypeNoAlias(rightType);
                     wouldWorkWithAwait = !(awaitedLeftType === leftType && awaitedRightType === rightType)
                         && !!(awaitedLeftType && awaitedRightType)
                         && isRelated(awaitedLeftType, awaitedRightType);
@@ -72242,11 +77154,16 @@ var ts;
         }
         function checkConditionalExpression(node, checkMode) {
             var type = checkTruthinessExpression(node.condition);
-            checkTestingKnownTruthyCallableType(node.condition, type, node.whenTrue);
+            checkTestingKnownTruthyCallableOrAwaitableType(node.condition, type, node.whenTrue);
             var type1 = checkExpression(node.whenTrue, checkMode);
             var type2 = checkExpression(node.whenFalse, checkMode);
             return getUnionType([type1, type2], 2 /* Subtype */);
         }
+        function isTemplateLiteralContext(node) {
+            var parent = node.parent;
+            return ts.isParenthesizedExpression(parent) && isTemplateLiteralContext(parent) ||
+                ts.isElementAccessExpression(parent) && parent.argumentExpression === node;
+        }
         function checkTemplateExpression(node) {
             var texts = [node.head.text];
             var types = [];
@@ -72259,10 +77176,14 @@ var ts;
                 texts.push(span.literal.text);
                 types.push(isTypeAssignableTo(type, templateConstraintType) ? type : stringType);
             }
-            return isConstContext(node) ? getTemplateLiteralType(texts, types) : stringType;
+            return isConstContext(node) || isTemplateLiteralContext(node) || someType(getContextualType(node) || unknownType, isTemplateLiteralContextualType) ? getTemplateLiteralType(texts, types) : stringType;
+        }
+        function isTemplateLiteralContextualType(type) {
+            return !!(type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */) ||
+                type.flags & 58982400 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 402653316 /* StringLike */));
         }
         function getContextNode(node) {
-            if (node.kind === 281 /* JsxAttributes */ && !ts.isJsxSelfClosingElement(node.parent)) {
+            if (node.kind === 285 /* JsxAttributes */ && !ts.isJsxSelfClosingElement(node.parent)) {
                 return node.parent.parent; // Needs to be the root JsxElement, so it encompasses the attributes _and_ the children (which are essentially part of the attributes)
             }
             return node;
@@ -72310,14 +77231,16 @@ var ts;
             return links.resolvedType;
         }
         function isTypeAssertion(node) {
-            node = ts.skipParentheses(node);
-            return node.kind === 206 /* TypeAssertionExpression */ || node.kind === 224 /* AsExpression */;
+            node = ts.skipParentheses(node, /*excludeJSDocTypeAssertions*/ true);
+            return node.kind === 210 /* TypeAssertionExpression */ ||
+                node.kind === 228 /* AsExpression */ ||
+                ts.isJSDocTypeAssertion(node);
         }
         function checkDeclarationInitializer(declaration, contextualType) {
             var initializer = ts.getEffectiveInitializer(declaration);
             var type = getQuickTypeOfExpression(initializer) ||
                 (contextualType ? checkExpressionWithContextualType(initializer, contextualType, /*inferenceContext*/ undefined, 0 /* Normal */) : checkExpressionCached(initializer));
-            return ts.isParameter(declaration) && declaration.name.kind === 197 /* ArrayBindingPattern */ &&
+            return ts.isParameter(declaration) && declaration.name.kind === 201 /* ArrayBindingPattern */ &&
                 isTupleType(type) && !type.target.hasRestElement && getTypeReferenceArity(type) < declaration.name.elements.length ?
                 padTupleType(type, declaration.name) : type;
         }
@@ -72327,7 +77250,7 @@ var ts;
             var elementFlags = type.target.elementFlags.slice();
             for (var i = getTypeReferenceArity(type); i < patternElements.length; i++) {
                 var e = patternElements[i];
-                if (i < patternElements.length - 1 || !(e.kind === 198 /* BindingElement */ && e.dotDotDotToken)) {
+                if (i < patternElements.length - 1 || !(e.kind === 202 /* BindingElement */ && e.dotDotDotToken)) {
                     elementTypes.push(!ts.isOmittedExpression(e) && hasDefaultValue(e) ? getTypeFromBindingElement(e, /*includePatternInType*/ false, /*reportErrors*/ false) : anyType);
                     elementFlags.push(2 /* Optional */);
                     if (!ts.isOmittedExpression(e) && !hasDefaultValue(e)) {
@@ -72340,7 +77263,7 @@ var ts;
         function widenTypeInferredFromInitializer(declaration, type) {
             var widened = ts.getCombinedNodeFlags(declaration) & 2 /* Const */ || ts.isDeclarationReadonly(declaration) ? type : getWidenedLiteralType(type);
             if (ts.isInJSFile(declaration)) {
-                if (widened.flags & 98304 /* Nullable */) {
+                if (isEmptyLiteralType(widened)) {
                     reportImplicitAny(declaration, anyType);
                     return anyType;
                 }
@@ -72381,6 +77304,7 @@ var ts;
         function isConstContext(node) {
             var parent = node.parent;
             return ts.isAssertionExpression(parent) && ts.isConstTypeReference(parent.type) ||
+                ts.isJSDocTypeAssertion(parent) && ts.isConstTypeReference(ts.getJSDocTypeAssertionType(parent)) ||
                 (ts.isParenthesizedExpression(parent) || ts.isArrayLiteralExpression(parent) || ts.isSpreadElement(parent)) && isConstContext(parent) ||
                 (ts.isPropertyAssignment(parent) || ts.isShorthandPropertyAssignment(parent) || ts.isTemplateSpan(parent)) && isConstContext(parent.parent);
         }
@@ -72394,7 +77318,7 @@ var ts;
             // Do not use hasDynamicName here, because that returns false for well known symbols.
             // We want to perform checkComputedPropertyName for all computed properties, including
             // well known symbols.
-            if (node.name.kind === 158 /* ComputedPropertyName */) {
+            if (node.name.kind === 161 /* ComputedPropertyName */) {
                 checkComputedPropertyName(node.name);
             }
             return checkExpressionForMutableLocation(node.initializer, checkMode);
@@ -72405,7 +77329,7 @@ var ts;
             // Do not use hasDynamicName here, because that returns false for well known symbols.
             // We want to perform checkComputedPropertyName for all computed properties, including
             // well known symbols.
-            if (node.name.kind === 158 /* ComputedPropertyName */) {
+            if (node.name.kind === 161 /* ComputedPropertyName */) {
                 checkComputedPropertyName(node.name);
             }
             var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode);
@@ -72532,7 +77456,7 @@ var ts;
                 len--;
             var s = baseName.slice(0, len);
             for (var index = 1; true; index++) {
-                var augmentedName = (s + index);
+                var augmentedName = s + index;
                 if (!hasTypeParameterByName(typeParameters, augmentedName)) {
                     return augmentedName;
                 }
@@ -72578,10 +77502,17 @@ var ts;
             return type;
         }
         function getQuickTypeOfExpression(node) {
-            var expr = ts.skipParentheses(node);
+            var expr = ts.skipParentheses(node, /*excludeJSDocTypeAssertions*/ true);
+            if (ts.isJSDocTypeAssertion(expr)) {
+                var type = ts.getJSDocTypeAssertionType(expr);
+                if (!ts.isConstTypeReference(type)) {
+                    return getTypeFromTypeNode(type);
+                }
+            }
+            expr = ts.skipParentheses(node);
             // Optimize for the common case of a call to a function with a single non-generic call
             // signature where we can just fetch the return type without checking the arguments.
-            if (ts.isCallExpression(expr) && expr.expression.kind !== 105 /* SuperKeyword */ && !ts.isRequireCall(expr, /*checkArgumentIsStringLiteralLike*/ true) && !isSymbolOrSymbolForCall(expr)) {
+            if (ts.isCallExpression(expr) && expr.expression.kind !== 106 /* SuperKeyword */ && !ts.isRequireCall(expr, /*checkArgumentIsStringLiteralLike*/ true) && !isSymbolOrSymbolForCall(expr)) {
                 var type = ts.isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) :
                     getReturnTypeOfSingleNonGenericCallSignature(checkNonNullExpression(expr.expression));
                 if (type) {
@@ -72592,7 +77523,7 @@ var ts;
                 return getTypeFromTypeNode(expr.type);
             }
             else if (node.kind === 8 /* NumericLiteral */ || node.kind === 10 /* StringLiteral */ ||
-                node.kind === 109 /* TrueKeyword */ || node.kind === 94 /* FalseKeyword */) {
+                node.kind === 110 /* TrueKeyword */ || node.kind === 95 /* FalseKeyword */) {
                 return checkExpression(node);
             }
             return undefined;
@@ -72641,11 +77572,11 @@ var ts;
             // - 'left' in property access
             // - 'object' in indexed access
             // - target in rhs of import statement
-            var ok = (node.parent.kind === 201 /* PropertyAccessExpression */ && node.parent.expression === node) ||
-                (node.parent.kind === 202 /* ElementAccessExpression */ && node.parent.expression === node) ||
-                ((node.kind === 78 /* Identifier */ || node.kind === 157 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) ||
-                    (node.parent.kind === 176 /* TypeQuery */ && node.parent.exprName === node)) ||
-                (node.parent.kind === 270 /* ExportSpecifier */); // We allow reexporting const enums
+            var ok = (node.parent.kind === 205 /* PropertyAccessExpression */ && node.parent.expression === node) ||
+                (node.parent.kind === 206 /* ElementAccessExpression */ && node.parent.expression === node) ||
+                ((node.kind === 79 /* Identifier */ || node.kind === 160 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) ||
+                    (node.parent.kind === 180 /* TypeQuery */ && node.parent.exprName === node)) ||
+                (node.parent.kind === 274 /* ExportSpecifier */); // We allow reexporting const enums
             if (!ok) {
                 error(node, ts.Diagnostics.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);
             }
@@ -72658,9 +77589,9 @@ var ts;
             }
         }
         function checkParenthesizedExpression(node, checkMode) {
-            var tag = ts.isInJSFile(node) ? ts.getJSDocTypeTag(node) : undefined;
-            if (tag) {
-                return checkAssertionWorker(tag, tag.typeExpression.type, node.expression, checkMode);
+            if (ts.hasJSDocNodes(node) && ts.isJSDocTypeAssertion(node)) {
+                var type = ts.getJSDocTypeAssertionType(node);
+                return checkAssertionWorker(type, type, node.expression, checkMode);
             }
             return checkExpression(node.expression, checkMode);
         }
@@ -72670,106 +77601,111 @@ var ts;
                 // Only bother checking on a few construct kinds.  We don't want to be excessively
                 // hitting the cancellation token on every node we check.
                 switch (kind) {
-                    case 221 /* ClassExpression */:
-                    case 208 /* FunctionExpression */:
-                    case 209 /* ArrowFunction */:
+                    case 225 /* ClassExpression */:
+                    case 212 /* FunctionExpression */:
+                    case 213 /* ArrowFunction */:
                         cancellationToken.throwIfCancellationRequested();
                 }
             }
             switch (kind) {
-                case 78 /* Identifier */:
-                    return checkIdentifier(node);
-                case 107 /* ThisKeyword */:
+                case 79 /* Identifier */:
+                    return checkIdentifier(node, checkMode);
+                case 80 /* PrivateIdentifier */:
+                    return checkPrivateIdentifierExpression(node);
+                case 108 /* ThisKeyword */:
                     return checkThisExpression(node);
-                case 105 /* SuperKeyword */:
+                case 106 /* SuperKeyword */:
                     return checkSuperExpression(node);
-                case 103 /* NullKeyword */:
+                case 104 /* NullKeyword */:
                     return nullWideningType;
                 case 14 /* NoSubstitutionTemplateLiteral */:
                 case 10 /* StringLiteral */:
-                    return getFreshTypeOfLiteralType(getLiteralType(node.text));
+                    return getFreshTypeOfLiteralType(getStringLiteralType(node.text));
                 case 8 /* NumericLiteral */:
                     checkGrammarNumericLiteral(node);
-                    return getFreshTypeOfLiteralType(getLiteralType(+node.text));
+                    return getFreshTypeOfLiteralType(getNumberLiteralType(+node.text));
                 case 9 /* BigIntLiteral */:
                     checkGrammarBigIntLiteral(node);
-                    return getFreshTypeOfLiteralType(getBigIntLiteralType(node));
-                case 109 /* TrueKeyword */:
+                    return getFreshTypeOfLiteralType(getBigIntLiteralType({
+                        negative: false,
+                        base10Value: ts.parsePseudoBigInt(node.text)
+                    }));
+                case 110 /* TrueKeyword */:
                     return trueType;
-                case 94 /* FalseKeyword */:
+                case 95 /* FalseKeyword */:
                     return falseType;
-                case 218 /* TemplateExpression */:
+                case 222 /* TemplateExpression */:
                     return checkTemplateExpression(node);
                 case 13 /* RegularExpressionLiteral */:
                     return globalRegExpType;
-                case 199 /* ArrayLiteralExpression */:
+                case 203 /* ArrayLiteralExpression */:
                     return checkArrayLiteral(node, checkMode, forceTuple);
-                case 200 /* ObjectLiteralExpression */:
+                case 204 /* ObjectLiteralExpression */:
                     return checkObjectLiteral(node, checkMode);
-                case 201 /* PropertyAccessExpression */:
-                    return checkPropertyAccessExpression(node);
-                case 157 /* QualifiedName */:
-                    return checkQualifiedName(node);
-                case 202 /* ElementAccessExpression */:
-                    return checkIndexedAccess(node);
-                case 203 /* CallExpression */:
-                    if (node.expression.kind === 99 /* ImportKeyword */) {
+                case 205 /* PropertyAccessExpression */:
+                    return checkPropertyAccessExpression(node, checkMode);
+                case 160 /* QualifiedName */:
+                    return checkQualifiedName(node, checkMode);
+                case 206 /* ElementAccessExpression */:
+                    return checkIndexedAccess(node, checkMode);
+                case 207 /* CallExpression */:
+                    if (node.expression.kind === 100 /* ImportKeyword */) {
                         return checkImportCallExpression(node);
                     }
                 // falls through
-                case 204 /* NewExpression */:
+                case 208 /* NewExpression */:
                     return checkCallExpression(node, checkMode);
-                case 205 /* TaggedTemplateExpression */:
+                case 209 /* TaggedTemplateExpression */:
                     return checkTaggedTemplateExpression(node);
-                case 207 /* ParenthesizedExpression */:
+                case 211 /* ParenthesizedExpression */:
                     return checkParenthesizedExpression(node, checkMode);
-                case 221 /* ClassExpression */:
+                case 225 /* ClassExpression */:
                     return checkClassExpression(node);
-                case 208 /* FunctionExpression */:
-                case 209 /* ArrowFunction */:
+                case 212 /* FunctionExpression */:
+                case 213 /* ArrowFunction */:
                     return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode);
-                case 211 /* TypeOfExpression */:
+                case 215 /* TypeOfExpression */:
                     return checkTypeOfExpression(node);
-                case 206 /* TypeAssertionExpression */:
-                case 224 /* AsExpression */:
+                case 210 /* TypeAssertionExpression */:
+                case 228 /* AsExpression */:
                     return checkAssertion(node);
-                case 225 /* NonNullExpression */:
+                case 229 /* NonNullExpression */:
                     return checkNonNullAssertion(node);
-                case 226 /* MetaProperty */:
+                case 230 /* MetaProperty */:
                     return checkMetaProperty(node);
-                case 210 /* DeleteExpression */:
+                case 214 /* DeleteExpression */:
                     return checkDeleteExpression(node);
-                case 212 /* VoidExpression */:
+                case 216 /* VoidExpression */:
                     return checkVoidExpression(node);
-                case 213 /* AwaitExpression */:
+                case 217 /* AwaitExpression */:
                     return checkAwaitExpression(node);
-                case 214 /* PrefixUnaryExpression */:
+                case 218 /* PrefixUnaryExpression */:
                     return checkPrefixUnaryExpression(node);
-                case 215 /* PostfixUnaryExpression */:
+                case 219 /* PostfixUnaryExpression */:
                     return checkPostfixUnaryExpression(node);
-                case 216 /* BinaryExpression */:
+                case 220 /* BinaryExpression */:
                     return checkBinaryExpression(node, checkMode);
-                case 217 /* ConditionalExpression */:
+                case 221 /* ConditionalExpression */:
                     return checkConditionalExpression(node, checkMode);
-                case 220 /* SpreadElement */:
+                case 224 /* SpreadElement */:
                     return checkSpreadExpression(node, checkMode);
-                case 222 /* OmittedExpression */:
+                case 226 /* OmittedExpression */:
                     return undefinedWideningType;
-                case 219 /* YieldExpression */:
+                case 223 /* YieldExpression */:
                     return checkYieldExpression(node);
-                case 227 /* SyntheticExpression */:
+                case 231 /* SyntheticExpression */:
                     return checkSyntheticExpression(node);
-                case 283 /* JsxExpression */:
+                case 287 /* JsxExpression */:
                     return checkJsxExpression(node, checkMode);
-                case 273 /* JsxElement */:
+                case 277 /* JsxElement */:
                     return checkJsxElement(node, checkMode);
-                case 274 /* JsxSelfClosingElement */:
+                case 278 /* JsxSelfClosingElement */:
                     return checkJsxSelfClosingElement(node, checkMode);
-                case 277 /* JsxFragment */:
+                case 281 /* JsxFragment */:
                     return checkJsxFragment(node);
-                case 281 /* JsxAttributes */:
+                case 285 /* JsxAttributes */:
                     return checkJsxAttributes(node, checkMode);
-                case 275 /* JsxOpeningElement */:
+                case 279 /* JsxOpeningElement */:
                     ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement");
             }
             return errorType;
@@ -72805,11 +77741,11 @@ var ts;
             checkGrammarDecoratorsAndModifiers(node);
             checkVariableLikeDeclaration(node);
             var func = ts.getContainingFunction(node);
-            if (ts.hasSyntacticModifier(node, 92 /* ParameterPropertyModifier */)) {
-                if (!(func.kind === 166 /* Constructor */ && ts.nodeIsPresent(func.body))) {
+            if (ts.hasSyntacticModifier(node, 16476 /* ParameterPropertyModifier */)) {
+                if (!(func.kind === 170 /* Constructor */ && ts.nodeIsPresent(func.body))) {
                     error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation);
                 }
-                if (func.kind === 166 /* Constructor */ && ts.isIdentifier(node.name) && node.name.escapedText === "constructor") {
+                if (func.kind === 170 /* Constructor */ && ts.isIdentifier(node.name) && node.name.escapedText === "constructor") {
                     error(node.name, ts.Diagnostics.constructor_cannot_be_used_as_a_parameter_property_name);
                 }
             }
@@ -72820,13 +77756,13 @@ var ts;
                 if (func.parameters.indexOf(node) !== 0) {
                     error(node, ts.Diagnostics.A_0_parameter_must_be_the_first_parameter, node.name.escapedText);
                 }
-                if (func.kind === 166 /* Constructor */ || func.kind === 170 /* ConstructSignature */ || func.kind === 175 /* ConstructorType */) {
+                if (func.kind === 170 /* Constructor */ || func.kind === 174 /* ConstructSignature */ || func.kind === 179 /* ConstructorType */) {
                     error(node, ts.Diagnostics.A_constructor_cannot_have_a_this_parameter);
                 }
-                if (func.kind === 209 /* ArrowFunction */) {
+                if (func.kind === 213 /* ArrowFunction */) {
                     error(node, ts.Diagnostics.An_arrow_function_cannot_have_a_this_parameter);
                 }
-                if (func.kind === 167 /* GetAccessor */ || func.kind === 168 /* SetAccessor */) {
+                if (func.kind === 171 /* GetAccessor */ || func.kind === 172 /* SetAccessor */) {
                     error(node, ts.Diagnostics.get_and_set_accessors_cannot_declare_this_parameters);
                 }
             }
@@ -72884,13 +77820,13 @@ var ts;
         }
         function getTypePredicateParent(node) {
             switch (node.parent.kind) {
-                case 209 /* ArrowFunction */:
-                case 169 /* CallSignature */:
-                case 251 /* FunctionDeclaration */:
-                case 208 /* FunctionExpression */:
-                case 174 /* FunctionType */:
-                case 165 /* MethodDeclaration */:
-                case 164 /* MethodSignature */:
+                case 213 /* ArrowFunction */:
+                case 173 /* CallSignature */:
+                case 255 /* FunctionDeclaration */:
+                case 212 /* FunctionExpression */:
+                case 178 /* FunctionType */:
+                case 168 /* MethodDeclaration */:
+                case 167 /* MethodSignature */:
                     var parent = node.parent;
                     if (node === parent.type) {
                         return parent;
@@ -72904,11 +77840,11 @@ var ts;
                     continue;
                 }
                 var name = element.name;
-                if (name.kind === 78 /* Identifier */ && name.escapedText === predicateVariableName) {
+                if (name.kind === 79 /* Identifier */ && name.escapedText === predicateVariableName) {
                     error(predicateVariableNode, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName);
                     return true;
                 }
-                else if (name.kind === 197 /* ArrayBindingPattern */ || name.kind === 196 /* ObjectBindingPattern */) {
+                else if (name.kind === 201 /* ArrayBindingPattern */ || name.kind === 200 /* ObjectBindingPattern */) {
                     if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, predicateVariableNode, predicateVariableName)) {
                         return true;
                     }
@@ -72917,13 +77853,13 @@ var ts;
         }
         function checkSignatureDeclaration(node) {
             // Grammar checking
-            if (node.kind === 171 /* IndexSignature */) {
+            if (node.kind === 175 /* IndexSignature */) {
                 checkGrammarIndexSignature(node);
             }
             // TODO (yuisu): Remove this check in else-if when SyntaxKind.Construct is moved and ambient context is handled
-            else if (node.kind === 174 /* FunctionType */ || node.kind === 251 /* FunctionDeclaration */ || node.kind === 175 /* ConstructorType */ ||
-                node.kind === 169 /* CallSignature */ || node.kind === 166 /* Constructor */ ||
-                node.kind === 170 /* ConstructSignature */) {
+            else if (node.kind === 178 /* FunctionType */ || node.kind === 255 /* FunctionDeclaration */ || node.kind === 179 /* ConstructorType */ ||
+                node.kind === 173 /* CallSignature */ || node.kind === 170 /* Constructor */ ||
+                node.kind === 174 /* ConstructSignature */) {
                 checkGrammarFunctionLikeDeclaration(node);
             }
             var functionFlags = ts.getFunctionFlags(node);
@@ -72942,7 +77878,7 @@ var ts;
                     checkExternalEmitHelpers(node, 128 /* Generator */);
                 }
             }
-            checkTypeParameters(node.typeParameters);
+            checkTypeParameters(ts.getEffectiveTypeParameterDeclarations(node));
             ts.forEach(node.parameters, checkParameter);
             // TODO(rbuckton): Should we start checking JSDoc types?
             if (node.type) {
@@ -72953,10 +77889,10 @@ var ts;
                 var returnTypeNode = ts.getEffectiveReturnTypeNode(node);
                 if (noImplicitAny && !returnTypeNode) {
                     switch (node.kind) {
-                        case 170 /* ConstructSignature */:
+                        case 174 /* ConstructSignature */:
                             error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type);
                             break;
-                        case 169 /* CallSignature */:
+                        case 173 /* CallSignature */:
                             error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type);
                             break;
                     }
@@ -72986,7 +77922,7 @@ var ts;
                         checkAsyncFunctionReturnType(node, returnTypeNode);
                     }
                 }
-                if (node.kind !== 171 /* IndexSignature */ && node.kind !== 308 /* JSDocFunctionType */) {
+                if (node.kind !== 175 /* IndexSignature */ && node.kind !== 315 /* JSDocFunctionType */) {
                     registerForUnusedIdentifiersCheck(node);
                 }
             }
@@ -72998,7 +77934,7 @@ var ts;
             var privateIdentifiers = new ts.Map();
             for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
                 var member = _a[_i];
-                if (member.kind === 166 /* Constructor */) {
+                if (member.kind === 170 /* Constructor */) {
                     for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) {
                         var param = _c[_b];
                         if (ts.isParameterPropertyDeclaration(param, member) && !ts.isBindingPattern(param.name)) {
@@ -73007,28 +77943,30 @@ var ts;
                     }
                 }
                 else {
-                    var isStatic = ts.hasSyntacticModifier(member, 32 /* Static */);
+                    var isStaticMember = ts.isStatic(member);
                     var name = member.name;
                     if (!name) {
-                        return;
+                        continue;
                     }
-                    var names = ts.isPrivateIdentifier(name) ? privateIdentifiers :
-                        isStatic ? staticNames :
+                    var isPrivate = ts.isPrivateIdentifier(name);
+                    var privateStaticFlags = isPrivate && isStaticMember ? 16 /* PrivateStatic */ : 0;
+                    var names = isPrivate ? privateIdentifiers :
+                        isStaticMember ? staticNames :
                             instanceNames;
                     var memberName = name && ts.getPropertyNameForPropertyNameNode(name);
                     if (memberName) {
                         switch (member.kind) {
-                            case 167 /* GetAccessor */:
-                                addName(names, name, memberName, 1 /* GetAccessor */);
+                            case 171 /* GetAccessor */:
+                                addName(names, name, memberName, 1 /* GetAccessor */ | privateStaticFlags);
                                 break;
-                            case 168 /* SetAccessor */:
-                                addName(names, name, memberName, 2 /* SetAccessor */);
+                            case 172 /* SetAccessor */:
+                                addName(names, name, memberName, 2 /* SetAccessor */ | privateStaticFlags);
                                 break;
-                            case 163 /* PropertyDeclaration */:
-                                addName(names, name, memberName, 3 /* GetOrSetAccessor */);
+                            case 166 /* PropertyDeclaration */:
+                                addName(names, name, memberName, 3 /* GetOrSetAccessor */ | privateStaticFlags);
                                 break;
-                            case 165 /* MethodDeclaration */:
-                                addName(names, name, memberName, 8 /* Method */);
+                            case 168 /* MethodDeclaration */:
+                                addName(names, name, memberName, 8 /* Method */ | privateStaticFlags);
                                 break;
                         }
                     }
@@ -73037,16 +77975,25 @@ var ts;
             function addName(names, location, name, meaning) {
                 var prev = names.get(name);
                 if (prev) {
-                    if (prev & 8 /* Method */) {
-                        if (meaning !== 8 /* Method */) {
-                            error(location, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(location));
-                        }
-                    }
-                    else if (prev & meaning) {
-                        error(location, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(location));
+                    // For private identifiers, do not allow mixing of static and instance members with the same name
+                    if ((prev & 16 /* PrivateStatic */) !== (meaning & 16 /* PrivateStatic */)) {
+                        error(location, ts.Diagnostics.Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name, ts.getTextOfNode(location));
                     }
                     else {
-                        names.set(name, prev | meaning);
+                        var prevIsMethod = !!(prev & 8 /* Method */);
+                        var isMethod = !!(meaning & 8 /* Method */);
+                        if (prevIsMethod || isMethod) {
+                            if (prevIsMethod !== isMethod) {
+                                error(location, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(location));
+                            }
+                            // If this is a method/method duplication is might be an overload, so this will be handled when overloads are considered
+                        }
+                        else if (prev & meaning & ~16 /* PrivateStatic */) {
+                            error(location, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(location));
+                        }
+                        else {
+                            names.set(name, prev | meaning);
+                        }
                     }
                 }
                 else {
@@ -73069,8 +78016,8 @@ var ts;
             for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
                 var member = _a[_i];
                 var memberNameNode = member.name;
-                var isStatic = ts.hasSyntacticModifier(member, 32 /* Static */);
-                if (isStatic && memberNameNode) {
+                var isStaticMember = ts.isStatic(member);
+                if (isStaticMember && memberNameNode) {
                     var memberName = ts.getPropertyNameForPropertyNameNode(memberNameNode);
                     switch (memberName) {
                         case "name":
@@ -73090,7 +78037,7 @@ var ts;
             var names = new ts.Map();
             for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
                 var member = _a[_i];
-                if (member.kind === 162 /* PropertySignature */) {
+                if (member.kind === 165 /* PropertySignature */) {
                     var memberName = void 0;
                     var name = member.name;
                     switch (name.kind) {
@@ -73098,7 +78045,7 @@ var ts;
                         case 8 /* NumericLiteral */:
                             memberName = name.text;
                             break;
-                        case 78 /* Identifier */:
+                        case 79 /* Identifier */:
                             memberName = ts.idText(name);
                             break;
                         default:
@@ -73115,11 +78062,11 @@ var ts;
             }
         }
         function checkTypeForDuplicateIndexSignatures(node) {
-            if (node.kind === 253 /* InterfaceDeclaration */) {
+            if (node.kind === 257 /* InterfaceDeclaration */) {
                 var nodeSymbol = getSymbolOfNode(node);
                 // in case of merging interface declaration it is possible that we'll enter this check procedure several times for every declaration
                 // to prevent this run check only for the first declaration of a given kind
-                if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) {
+                if (nodeSymbol.declarations && nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) {
                     return;
                 }
             }
@@ -73127,33 +78074,33 @@ var ts;
             // 3.7.4: An object type can contain at most one string index signature and one numeric index signature.
             // 8.5: A class declaration can have at most one string index member declaration and one numeric index member declaration
             var indexSymbol = getIndexSymbol(getSymbolOfNode(node));
-            if (indexSymbol) {
-                var seenNumericIndexer = false;
-                var seenStringIndexer = false;
-                for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) {
-                    var decl = _a[_i];
-                    var declaration = decl;
+            if (indexSymbol === null || indexSymbol === void 0 ? void 0 : indexSymbol.declarations) {
+                var indexSignatureMap_1 = new ts.Map();
+                var _loop_26 = function (declaration) {
                     if (declaration.parameters.length === 1 && declaration.parameters[0].type) {
-                        switch (declaration.parameters[0].type.kind) {
-                            case 147 /* StringKeyword */:
-                                if (!seenStringIndexer) {
-                                    seenStringIndexer = true;
-                                }
-                                else {
-                                    error(declaration, ts.Diagnostics.Duplicate_string_index_signature);
-                                }
-                                break;
-                            case 144 /* NumberKeyword */:
-                                if (!seenNumericIndexer) {
-                                    seenNumericIndexer = true;
-                                }
-                                else {
-                                    error(declaration, ts.Diagnostics.Duplicate_number_index_signature);
-                                }
-                                break;
-                        }
+                        forEachType(getTypeFromTypeNode(declaration.parameters[0].type), function (type) {
+                            var entry = indexSignatureMap_1.get(getTypeId(type));
+                            if (entry) {
+                                entry.declarations.push(declaration);
+                            }
+                            else {
+                                indexSignatureMap_1.set(getTypeId(type), { type: type, declarations: [declaration] });
+                            }
+                        });
                     }
+                };
+                for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) {
+                    var declaration = _a[_i];
+                    _loop_26(declaration);
                 }
+                indexSignatureMap_1.forEach(function (entry) {
+                    if (entry.declarations.length > 1) {
+                        for (var _i = 0, _a = entry.declarations; _i < _a.length; _i++) {
+                            var declaration = _a[_i];
+                            error(declaration, ts.Diagnostics.Duplicate_index_signature_for_type_0, typeToString(entry.type));
+                        }
+                    }
+                });
             }
         }
         function checkPropertyDeclaration(node) {
@@ -73161,11 +78108,13 @@ var ts;
             if (!checkGrammarDecoratorsAndModifiers(node) && !checkGrammarProperty(node))
                 checkGrammarComputedPropertyName(node.name);
             checkVariableLikeDeclaration(node);
-            // Private class fields transformation relies on WeakMaps.
-            if (ts.isPrivateIdentifier(node.name) && languageVersion < 99 /* ESNext */) {
-                for (var lexicalScope = ts.getEnclosingBlockScopeContainer(node); !!lexicalScope; lexicalScope = ts.getEnclosingBlockScopeContainer(lexicalScope)) {
-                    getNodeLinks(lexicalScope).flags |= 67108864 /* ContainsClassWithPrivateIdentifiers */;
-                }
+            setNodeLinksForPrivateIdentifierScope(node);
+            if (ts.isPrivateIdentifier(node.name) && ts.hasStaticModifier(node) && node.initializer && languageVersion === 99 /* ESNext */ && !compilerOptions.useDefineForClassFields) {
+                error(node.initializer, ts.Diagnostics.Static_fields_with_private_names_can_t_have_initializers_when_the_useDefineForClassFields_flag_is_not_specified_with_a_target_of_esnext_Consider_adding_the_useDefineForClassFields_flag);
+            }
+            // property signatures already report "initializer not allowed in ambient context" elsewhere
+            if (ts.hasSyntacticModifier(node, 128 /* Abstract */) && node.kind === 166 /* PropertyDeclaration */ && node.initializer) {
+                error(node, ts.Diagnostics.Property_0_cannot_have_an_initializer_because_it_is_marked_abstract, ts.declarationNameToString(node.name));
             }
         }
         function checkPropertySignature(node) {
@@ -73178,16 +78127,38 @@ var ts;
             // Grammar checking
             if (!checkGrammarMethod(node))
                 checkGrammarComputedPropertyName(node.name);
-            if (ts.isPrivateIdentifier(node.name)) {
-                error(node, ts.Diagnostics.A_method_cannot_be_named_with_a_private_identifier);
-            }
             // Grammar checking for modifiers is done inside the function checkGrammarFunctionLikeDeclaration
             checkFunctionOrMethodDeclaration(node);
-            // Abstract methods cannot have an implementation.
-            // Extra checks are to avoid reporting multiple errors relating to the "abstractness" of the node.
-            if (ts.hasSyntacticModifier(node, 128 /* Abstract */) && node.kind === 165 /* MethodDeclaration */ && node.body) {
+            // method signatures already report "implementation not allowed in ambient context" elsewhere
+            if (ts.hasSyntacticModifier(node, 128 /* Abstract */) && node.kind === 168 /* MethodDeclaration */ && node.body) {
                 error(node, ts.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, ts.declarationNameToString(node.name));
             }
+            // Private named methods are only allowed in class declarations
+            if (ts.isPrivateIdentifier(node.name) && !ts.getContainingClass(node)) {
+                error(node, ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);
+            }
+            setNodeLinksForPrivateIdentifierScope(node);
+        }
+        function setNodeLinksForPrivateIdentifierScope(node) {
+            if (ts.isPrivateIdentifier(node.name) && languageVersion < 99 /* ESNext */) {
+                for (var lexicalScope = ts.getEnclosingBlockScopeContainer(node); !!lexicalScope; lexicalScope = ts.getEnclosingBlockScopeContainer(lexicalScope)) {
+                    getNodeLinks(lexicalScope).flags |= 67108864 /* ContainsClassWithPrivateIdentifiers */;
+                }
+                // If this is a private element in a class expression inside the body of a loop,
+                // then we must use a block-scoped binding to store the additional variables required
+                // to transform private elements.
+                if (ts.isClassExpression(node.parent)) {
+                    var enclosingIterationStatement = getEnclosingIterationStatement(node.parent);
+                    if (enclosingIterationStatement) {
+                        getNodeLinks(node.name).flags |= 524288 /* BlockScopedBindingInLoop */;
+                        getNodeLinks(enclosingIterationStatement).flags |= 65536 /* LoopWithCapturedBlockScopedBinding */;
+                    }
+                }
+            }
+        }
+        function checkClassStaticBlockDeclaration(node) {
+            checkGrammarDecoratorsAndModifiers(node);
+            ts.forEachChild(node, checkSourceElement);
         }
         function checkConstructorDeclaration(node) {
             // Grammar check on signature of constructor and modifier of the constructor is done in checkSignatureDeclaration function.
@@ -73210,11 +78181,11 @@ var ts;
                 return;
             }
             function isInstancePropertyWithInitializerOrPrivateIdentifierProperty(n) {
-                if (ts.isPrivateIdentifierPropertyDeclaration(n)) {
+                if (ts.isPrivateIdentifierClassElementDeclaration(n)) {
                     return true;
                 }
-                return n.kind === 163 /* PropertyDeclaration */ &&
-                    !ts.hasSyntacticModifier(n, 32 /* Static */) &&
+                return n.kind === 166 /* PropertyDeclaration */ &&
+                    !ts.isStatic(n) &&
                     !!n.initializer;
             }
             // TS 1.0 spec (April 2014): 8.3.2
@@ -73234,9 +78205,9 @@ var ts;
                     // - The containing class is a derived class.
                     // - The constructor declares parameter properties
                     //   or the containing class declares instance member variables with initializers.
-                    var superCallShouldBeFirst = (compilerOptions.target !== 99 /* ESNext */ || !compilerOptions.useDefineForClassFields) &&
+                    var superCallShouldBeFirst = (ts.getEmitScriptTarget(compilerOptions) !== 99 /* ESNext */ || !useDefineForClassFields) &&
                         (ts.some(node.parent.members, isInstancePropertyWithInitializerOrPrivateIdentifierProperty) ||
-                            ts.some(node.parameters, function (p) { return ts.hasSyntacticModifier(p, 92 /* ParameterPropertyModifier */); }));
+                            ts.some(node.parameters, function (p) { return ts.hasSyntacticModifier(p, 16476 /* ParameterPropertyModifier */); }));
                     // Skip past any prologue directives to find the first statement
                     // to ensure that it was a super call.
                     if (superCallShouldBeFirst) {
@@ -73244,7 +78215,7 @@ var ts;
                         var superCallStatement = void 0;
                         for (var _i = 0, statements_4 = statements; _i < statements_4.length; _i++) {
                             var statement = statements_4[_i];
-                            if (statement.kind === 233 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) {
+                            if (statement.kind === 237 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) {
                                 superCallStatement = statement;
                                 break;
                             }
@@ -73269,7 +78240,7 @@ var ts;
                     checkGrammarComputedPropertyName(node.name);
                 checkDecorators(node);
                 checkSignatureDeclaration(node);
-                if (node.kind === 167 /* GetAccessor */) {
+                if (node.kind === 171 /* GetAccessor */) {
                     if (!(node.flags & 8388608 /* Ambient */) && ts.nodeIsPresent(node.body) && (node.flags & 256 /* HasImplicitReturn */)) {
                         if (!(node.flags & 512 /* HasExplicitReturn */)) {
                             error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value);
@@ -73279,45 +78250,42 @@ var ts;
                 // Do not use hasDynamicName here, because that returns false for well known symbols.
                 // We want to perform checkComputedPropertyName for all computed properties, including
                 // well known symbols.
-                if (node.name.kind === 158 /* ComputedPropertyName */) {
+                if (node.name.kind === 161 /* ComputedPropertyName */) {
                     checkComputedPropertyName(node.name);
                 }
-                if (ts.isPrivateIdentifier(node.name)) {
-                    error(node.name, ts.Diagnostics.An_accessor_cannot_be_named_with_a_private_identifier);
-                }
                 if (hasBindableName(node)) {
                     // TypeScript 1.0 spec (April 2014): 8.4.3
                     // Accessors for the same member name must specify the same accessibility.
-                    var otherKind = node.kind === 167 /* GetAccessor */ ? 168 /* SetAccessor */ : 167 /* GetAccessor */;
-                    var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind);
-                    if (otherAccessor) {
-                        var nodeFlags = ts.getEffectiveModifierFlags(node);
-                        var otherFlags = ts.getEffectiveModifierFlags(otherAccessor);
-                        if ((nodeFlags & 28 /* AccessibilityModifier */) !== (otherFlags & 28 /* AccessibilityModifier */)) {
-                            error(node.name, ts.Diagnostics.Getter_and_setter_accessors_do_not_agree_in_visibility);
+                    var symbol = getSymbolOfNode(node);
+                    var getter = ts.getDeclarationOfKind(symbol, 171 /* GetAccessor */);
+                    var setter = ts.getDeclarationOfKind(symbol, 172 /* SetAccessor */);
+                    if (getter && setter && !(getNodeCheckFlags(getter) & 1 /* TypeChecked */)) {
+                        getNodeLinks(getter).flags |= 1 /* TypeChecked */;
+                        var getterFlags = ts.getEffectiveModifierFlags(getter);
+                        var setterFlags = ts.getEffectiveModifierFlags(setter);
+                        if ((getterFlags & 128 /* Abstract */) !== (setterFlags & 128 /* Abstract */)) {
+                            error(getter.name, ts.Diagnostics.Accessors_must_both_be_abstract_or_non_abstract);
+                            error(setter.name, ts.Diagnostics.Accessors_must_both_be_abstract_or_non_abstract);
+                        }
+                        if (((getterFlags & 16 /* Protected */) && !(setterFlags & (16 /* Protected */ | 8 /* Private */))) ||
+                            ((getterFlags & 8 /* Private */) && !(setterFlags & 8 /* Private */))) {
+                            error(getter.name, ts.Diagnostics.A_get_accessor_must_be_at_least_as_accessible_as_the_setter);
+                            error(setter.name, ts.Diagnostics.A_get_accessor_must_be_at_least_as_accessible_as_the_setter);
                         }
-                        if ((nodeFlags & 128 /* Abstract */) !== (otherFlags & 128 /* Abstract */)) {
-                            error(node.name, ts.Diagnostics.Accessors_must_both_be_abstract_or_non_abstract);
+                        var getterType = getAnnotatedAccessorType(getter);
+                        var setterType = getAnnotatedAccessorType(setter);
+                        if (getterType && setterType) {
+                            checkTypeAssignableTo(getterType, setterType, getter, ts.Diagnostics.The_return_type_of_a_get_accessor_must_be_assignable_to_its_set_accessor_type);
                         }
-                        // TypeScript 1.0 spec (April 2014): 4.5
-                        // If both accessors include type annotations, the specified types must be identical.
-                        checkAccessorDeclarationTypesIdentical(node, otherAccessor, getAnnotatedAccessorType, ts.Diagnostics.get_and_set_accessor_must_have_the_same_type);
-                        checkAccessorDeclarationTypesIdentical(node, otherAccessor, getThisTypeOfDeclaration, ts.Diagnostics.get_and_set_accessor_must_have_the_same_this_type);
                     }
                 }
                 var returnType = getTypeOfAccessors(getSymbolOfNode(node));
-                if (node.kind === 167 /* GetAccessor */) {
+                if (node.kind === 171 /* GetAccessor */) {
                     checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType);
                 }
             }
             checkSourceElement(node.body);
-        }
-        function checkAccessorDeclarationTypesIdentical(first, second, getAnnotatedType, message) {
-            var firstType = getAnnotatedType(first);
-            var secondType = getAnnotatedType(second);
-            if (firstType && secondType && !isTypeIdenticalTo(firstType, secondType)) {
-                error(first, message);
-            }
+            setNodeLinksForPrivateIdentifierScope(node);
         }
         function checkMissingDeclaration(node) {
             checkDecorators(node);
@@ -73343,7 +78311,7 @@ var ts;
         }
         function getTypeParametersForTypeReference(node) {
             var type = getTypeFromTypeReference(node);
-            if (type !== errorType) {
+            if (!isErrorType(type)) {
                 var symbol = getNodeLinks(node).resolvedSymbol;
                 if (symbol) {
                     return symbol.flags & 524288 /* TypeAlias */ && getSymbolLinks(symbol).typeParameters ||
@@ -73354,12 +78322,12 @@ var ts;
         }
         function checkTypeReferenceNode(node) {
             checkGrammarTypeArguments(node, node.typeArguments);
-            if (node.kind === 173 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJSFile(node) && !ts.isInJSDoc(node)) {
+            if (node.kind === 177 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJSFile(node) && !ts.isInJSDoc(node)) {
                 grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments);
             }
             ts.forEach(node.typeArguments, checkSourceElement);
             var type = getTypeFromTypeReference(node);
-            if (type !== errorType) {
+            if (!isErrorType(type)) {
                 if (node.typeArguments && produceDiagnostics) {
                     var typeParameters = getTypeParametersForTypeReference(node);
                     if (typeParameters) {
@@ -73381,7 +78349,9 @@ var ts;
             var typeReferenceNode = ts.tryCast(node.parent, ts.isTypeReferenceType);
             if (!typeReferenceNode)
                 return undefined;
-            var typeParameters = getTypeParametersForTypeReference(typeReferenceNode); // TODO: GH#18217
+            var typeParameters = getTypeParametersForTypeReference(typeReferenceNode);
+            if (!typeParameters)
+                return undefined;
             var constraint = getConstraintOfTypeParameter(typeParameters[typeReferenceNode.typeArguments.indexOf(node)]);
             return constraint && instantiateType(constraint, createTypeMapper(typeParameters, getEffectiveTypeArguments(typeReferenceNode, typeParameters)));
         }
@@ -73392,7 +78362,7 @@ var ts;
             ts.forEach(node.members, checkSourceElement);
             if (produceDiagnostics) {
                 var type = getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node);
-                checkIndexConstraints(type);
+                checkIndexConstraints(type, type.symbol);
                 checkTypeForDuplicateIndexSignatures(node);
                 checkObjectTypeForDuplicateDeclarations(node);
             }
@@ -73407,7 +78377,7 @@ var ts;
             var hasNamedElement = ts.some(elementTypes, ts.isNamedTupleMember);
             for (var _i = 0, elementTypes_1 = elementTypes; _i < elementTypes_1.length; _i++) {
                 var e = elementTypes_1[_i];
-                if (e.kind !== 192 /* NamedTupleMember */ && hasNamedElement) {
+                if (e.kind !== 196 /* NamedTupleMember */ && hasNamedElement) {
                     grammarErrorOnNode(e, ts.Diagnostics.Tuple_members_must_all_have_names_or_all_not_have_names);
                     break;
                 }
@@ -73456,7 +78426,7 @@ var ts;
             var objectType = type.objectType;
             var indexType = type.indexType;
             if (isTypeAssignableTo(indexType, getIndexType(objectType, /*stringsOnly*/ false))) {
-                if (accessNode.kind === 202 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) &&
+                if (accessNode.kind === 206 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) &&
                     ts.getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) {
                     error(accessNode, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType));
                 }
@@ -73465,7 +78435,7 @@ var ts;
             // Check if we're indexing with a numeric type and if either object or index types
             // is a generic type with a constraint that has a numeric index signature.
             var apparentObjectType = getApparentType(objectType);
-            if (getIndexInfoOfType(apparentObjectType, 1 /* Number */) && isTypeAssignableToKind(indexType, 296 /* NumberLike */)) {
+            if (getIndexInfoOfType(apparentObjectType, numberType) && isTypeAssignableToKind(indexType, 296 /* NumberLike */)) {
                 return type;
             }
             if (isGenericObjectType(objectType)) {
@@ -73487,6 +78457,7 @@ var ts;
             checkIndexedAccessIndexType(getTypeFromIndexedAccessTypeNode(node), node);
         }
         function checkMappedType(node) {
+            checkGrammarMappedType(node);
             checkSourceElement(node.typeParameter);
             checkSourceElement(node.nameType);
             checkSourceElement(node.type);
@@ -73503,6 +78474,12 @@ var ts;
                 checkTypeAssignableTo(constraintType, keyofConstraintType, ts.getEffectiveConstraintOfTypeParameter(node.typeParameter));
             }
         }
+        function checkGrammarMappedType(node) {
+            var _a;
+            if ((_a = node.members) === null || _a === void 0 ? void 0 : _a.length) {
+                return grammarErrorOnNode(node.members[0], ts.Diagnostics.A_mapped_type_may_not_declare_properties_or_methods);
+            }
+        }
         function checkThisType(node) {
             getTypeFromThisTypeNode(node);
         }
@@ -73514,7 +78491,7 @@ var ts;
             ts.forEachChild(node, checkSourceElement);
         }
         function checkInferType(node) {
-            if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 184 /* ConditionalType */ && n.parent.extendsType === n; })) {
+            if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 188 /* ConditionalType */ && n.parent.extendsType === n; })) {
                 grammarErrorOnNode(node, ts.Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type);
             }
             checkSourceElement(node.typeParameter);
@@ -73537,25 +78514,25 @@ var ts;
             if (node.dotDotDotToken && node.questionToken) {
                 grammarErrorOnNode(node, ts.Diagnostics.A_tuple_member_cannot_be_both_optional_and_rest);
             }
-            if (node.type.kind === 180 /* OptionalType */) {
+            if (node.type.kind === 184 /* OptionalType */) {
                 grammarErrorOnNode(node.type, ts.Diagnostics.A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type);
             }
-            if (node.type.kind === 181 /* RestType */) {
+            if (node.type.kind === 185 /* RestType */) {
                 grammarErrorOnNode(node.type, ts.Diagnostics.A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type);
             }
             checkSourceElement(node.type);
             getTypeFromTypeNode(node);
         }
         function isPrivateWithinAmbient(node) {
-            return (ts.hasEffectiveModifier(node, 8 /* Private */) || ts.isPrivateIdentifierPropertyDeclaration(node)) && !!(node.flags & 8388608 /* Ambient */);
+            return (ts.hasEffectiveModifier(node, 8 /* Private */) || ts.isPrivateIdentifierClassElementDeclaration(node)) && !!(node.flags & 8388608 /* Ambient */);
         }
         function getEffectiveDeclarationFlags(n, flagsToCheck) {
             var flags = ts.getCombinedModifierFlags(n);
             // children of classes (even ambient classes) should not be marked as ambient or export
             // because those flags have no useful semantics there.
-            if (n.parent.kind !== 253 /* InterfaceDeclaration */ &&
-                n.parent.kind !== 252 /* ClassDeclaration */ &&
-                n.parent.kind !== 221 /* ClassExpression */ &&
+            if (n.parent.kind !== 257 /* InterfaceDeclaration */ &&
+                n.parent.kind !== 256 /* ClassDeclaration */ &&
+                n.parent.kind !== 225 /* ClassExpression */ &&
                 n.flags & 8388608 /* Ambient */) {
                 if (!(flags & 2 /* Ambient */) && !(ts.isModuleBlock(n.parent) && ts.isModuleDeclaration(n.parent.parent) && ts.isGlobalScopeAugmentation(n.parent.parent))) {
                     // It is nested in an ambient context, which means it is automatically exported
@@ -73651,14 +78628,14 @@ var ts;
                             // Both are literal property names that are the same.
                             ts.isPropertyNameLiteral(node.name) && ts.isPropertyNameLiteral(subsequentName) &&
                                 ts.getEscapedTextOfIdentifierOrLiteral(node.name) === ts.getEscapedTextOfIdentifierOrLiteral(subsequentName))) {
-                            var reportError = (node.kind === 165 /* MethodDeclaration */ || node.kind === 164 /* MethodSignature */) &&
-                                ts.hasSyntacticModifier(node, 32 /* Static */) !== ts.hasSyntacticModifier(subsequentNode, 32 /* Static */);
+                            var reportError = (node.kind === 168 /* MethodDeclaration */ || node.kind === 167 /* MethodSignature */) &&
+                                ts.isStatic(node) !== ts.isStatic(subsequentNode);
                             // we can get here in two cases
                             // 1. mixed static and instance class members
                             // 2. something with the same name was defined before the set of overloads that prevents them from merging
                             // here we'll report error only for the first case since for second we should already report error in binder
                             if (reportError) {
-                                var diagnostic = ts.hasSyntacticModifier(node, 32 /* Static */) ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static;
+                                var diagnostic = ts.isStatic(node) ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static;
                                 error(errorNode_1, diagnostic);
                             }
                             return;
@@ -73688,55 +78665,57 @@ var ts;
             var multipleConstructorImplementation = false;
             var hasNonAmbientClass = false;
             var functionDeclarations = [];
-            for (var _i = 0, declarations_4 = declarations; _i < declarations_4.length; _i++) {
-                var current = declarations_4[_i];
-                var node = current;
-                var inAmbientContext = node.flags & 8388608 /* Ambient */;
-                var inAmbientContextOrInterface = node.parent && (node.parent.kind === 253 /* InterfaceDeclaration */ || node.parent.kind === 177 /* TypeLiteral */) || inAmbientContext;
-                if (inAmbientContextOrInterface) {
-                    // check if declarations are consecutive only if they are non-ambient
-                    // 1. ambient declarations can be interleaved
-                    // i.e. this is legal
-                    //     declare function foo();
-                    //     declare function bar();
-                    //     declare function foo();
-                    // 2. mixing ambient and non-ambient declarations is a separate error that will be reported - do not want to report an extra one
-                    previousDeclaration = undefined;
-                }
-                if ((node.kind === 252 /* ClassDeclaration */ || node.kind === 221 /* ClassExpression */) && !inAmbientContext) {
-                    hasNonAmbientClass = true;
-                }
-                if (node.kind === 251 /* FunctionDeclaration */ || node.kind === 165 /* MethodDeclaration */ || node.kind === 164 /* MethodSignature */ || node.kind === 166 /* Constructor */) {
-                    functionDeclarations.push(node);
-                    var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck);
-                    someNodeFlags |= currentNodeFlags;
-                    allNodeFlags &= currentNodeFlags;
-                    someHaveQuestionToken = someHaveQuestionToken || ts.hasQuestionToken(node);
-                    allHaveQuestionToken = allHaveQuestionToken && ts.hasQuestionToken(node);
-                    var bodyIsPresent = ts.nodeIsPresent(node.body);
-                    if (bodyIsPresent && bodyDeclaration) {
-                        if (isConstructor) {
-                            multipleConstructorImplementation = true;
+            if (declarations) {
+                for (var _i = 0, declarations_4 = declarations; _i < declarations_4.length; _i++) {
+                    var current = declarations_4[_i];
+                    var node = current;
+                    var inAmbientContext = node.flags & 8388608 /* Ambient */;
+                    var inAmbientContextOrInterface = node.parent && (node.parent.kind === 257 /* InterfaceDeclaration */ || node.parent.kind === 181 /* TypeLiteral */) || inAmbientContext;
+                    if (inAmbientContextOrInterface) {
+                        // check if declarations are consecutive only if they are non-ambient
+                        // 1. ambient declarations can be interleaved
+                        // i.e. this is legal
+                        //     declare function foo();
+                        //     declare function bar();
+                        //     declare function foo();
+                        // 2. mixing ambient and non-ambient declarations is a separate error that will be reported - do not want to report an extra one
+                        previousDeclaration = undefined;
+                    }
+                    if ((node.kind === 256 /* ClassDeclaration */ || node.kind === 225 /* ClassExpression */) && !inAmbientContext) {
+                        hasNonAmbientClass = true;
+                    }
+                    if (node.kind === 255 /* FunctionDeclaration */ || node.kind === 168 /* MethodDeclaration */ || node.kind === 167 /* MethodSignature */ || node.kind === 170 /* Constructor */) {
+                        functionDeclarations.push(node);
+                        var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck);
+                        someNodeFlags |= currentNodeFlags;
+                        allNodeFlags &= currentNodeFlags;
+                        someHaveQuestionToken = someHaveQuestionToken || ts.hasQuestionToken(node);
+                        allHaveQuestionToken = allHaveQuestionToken && ts.hasQuestionToken(node);
+                        var bodyIsPresent = ts.nodeIsPresent(node.body);
+                        if (bodyIsPresent && bodyDeclaration) {
+                            if (isConstructor) {
+                                multipleConstructorImplementation = true;
+                            }
+                            else {
+                                duplicateFunctionDeclaration = true;
+                            }
+                        }
+                        else if ((previousDeclaration === null || previousDeclaration === void 0 ? void 0 : previousDeclaration.parent) === node.parent && previousDeclaration.end !== node.pos) {
+                            reportImplementationExpectedError(previousDeclaration);
+                        }
+                        if (bodyIsPresent) {
+                            if (!bodyDeclaration) {
+                                bodyDeclaration = node;
+                            }
                         }
                         else {
-                            duplicateFunctionDeclaration = true;
+                            hasOverloads = true;
                         }
-                    }
-                    else if ((previousDeclaration === null || previousDeclaration === void 0 ? void 0 : previousDeclaration.parent) === node.parent && previousDeclaration.end !== node.pos) {
-                        reportImplementationExpectedError(previousDeclaration);
-                    }
-                    if (bodyIsPresent) {
-                        if (!bodyDeclaration) {
-                            bodyDeclaration = node;
+                        previousDeclaration = node;
+                        if (!inAmbientContextOrInterface) {
+                            lastSeenNonAmbientDeclaration = node;
                         }
                     }
-                    else {
-                        hasOverloads = true;
-                    }
-                    previousDeclaration = node;
-                    if (!inAmbientContextOrInterface) {
-                        lastSeenNonAmbientDeclaration = node;
-                    }
                 }
             }
             if (multipleConstructorImplementation) {
@@ -73749,13 +78728,18 @@ var ts;
                     error(ts.getNameOfDeclaration(declaration) || declaration, ts.Diagnostics.Duplicate_function_implementation);
                 });
             }
-            if (hasNonAmbientClass && !isConstructor && symbol.flags & 16 /* Function */) {
-                // A non-ambient class cannot be an implementation for a non-constructor function/class merge
-                // TODO: The below just replicates our older error from when classes and functions were
-                // entirely unable to merge - a more helpful message like "Class declaration cannot implement overload list"
-                // might be warranted. :shrug:
+            if (hasNonAmbientClass && !isConstructor && symbol.flags & 16 /* Function */ && declarations) {
+                var relatedDiagnostics_1 = ts.filter(declarations, function (d) { return d.kind === 256 /* ClassDeclaration */; })
+                    .map(function (d) { return ts.createDiagnosticForNode(d, ts.Diagnostics.Consider_adding_a_declare_modifier_to_this_class); });
                 ts.forEach(declarations, function (declaration) {
-                    addDuplicateDeclarationError(declaration, ts.Diagnostics.Duplicate_identifier_0, ts.symbolName(symbol), declarations);
+                    var diagnostic = declaration.kind === 256 /* ClassDeclaration */
+                        ? ts.Diagnostics.Class_declaration_cannot_implement_overload_list_for_0
+                        : declaration.kind === 255 /* FunctionDeclaration */
+                            ? ts.Diagnostics.Function_with_bodies_can_only_merge_with_classes_that_are_ambient
+                            : undefined;
+                    if (diagnostic) {
+                        ts.addRelatedInfo.apply(void 0, __spreadArray([error(ts.getNameOfDeclaration(declaration) || declaration, diagnostic, ts.symbolName(symbol))], relatedDiagnostics_1, false));
+                    }
                 });
             }
             // Abstract methods can't have an implementation -- in particular, they don't need one.
@@ -73764,8 +78748,10 @@ var ts;
                 reportImplementationExpectedError(lastSeenNonAmbientDeclaration);
             }
             if (hasOverloads) {
-                checkFlagAgreementBetweenOverloads(declarations, bodyDeclaration, flagsToCheck, someNodeFlags, allNodeFlags);
-                checkQuestionTokenAgreementBetweenOverloads(declarations, bodyDeclaration, someHaveQuestionToken, allHaveQuestionToken);
+                if (declarations) {
+                    checkFlagAgreementBetweenOverloads(declarations, bodyDeclaration, flagsToCheck, someNodeFlags, allNodeFlags);
+                    checkQuestionTokenAgreementBetweenOverloads(declarations, bodyDeclaration, someHaveQuestionToken, allHaveQuestionToken);
+                }
                 if (bodyDeclaration) {
                     var signatures = getSignaturesOfSymbol(symbol);
                     var bodySignature = getSignatureFromDeclaration(bodyDeclaration);
@@ -73839,44 +78825,49 @@ var ts;
             function getDeclarationSpaces(decl) {
                 var d = decl;
                 switch (d.kind) {
-                    case 253 /* InterfaceDeclaration */:
-                    case 254 /* TypeAliasDeclaration */:
+                    case 257 /* InterfaceDeclaration */:
+                    case 258 /* TypeAliasDeclaration */:
                     // A jsdoc typedef and callback are, by definition, type aliases.
                     // falls through
-                    case 331 /* JSDocTypedefTag */:
-                    case 324 /* JSDocCallbackTag */:
-                    case 325 /* JSDocEnumTag */:
+                    case 343 /* JSDocTypedefTag */:
+                    case 336 /* JSDocCallbackTag */:
+                    case 337 /* JSDocEnumTag */:
                         return 2 /* ExportType */;
-                    case 256 /* ModuleDeclaration */:
+                    case 260 /* ModuleDeclaration */:
                         return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */
                             ? 4 /* ExportNamespace */ | 1 /* ExportValue */
                             : 4 /* ExportNamespace */;
-                    case 252 /* ClassDeclaration */:
-                    case 255 /* EnumDeclaration */:
-                    case 291 /* EnumMember */:
+                    case 256 /* ClassDeclaration */:
+                    case 259 /* EnumDeclaration */:
+                    case 297 /* EnumMember */:
                         return 2 /* ExportType */ | 1 /* ExportValue */;
-                    case 297 /* SourceFile */:
+                    case 303 /* SourceFile */:
                         return 2 /* ExportType */ | 1 /* ExportValue */ | 4 /* ExportNamespace */;
-                    case 266 /* ExportAssignment */:
+                    case 270 /* ExportAssignment */:
+                    case 220 /* BinaryExpression */:
+                        var node_2 = d;
+                        var expression = ts.isExportAssignment(node_2) ? node_2.expression : node_2.right;
                         // Export assigned entity name expressions act as aliases and should fall through, otherwise they export values
-                        if (!ts.isEntityNameExpression(d.expression)) {
+                        if (!ts.isEntityNameExpression(expression)) {
                             return 1 /* ExportValue */;
                         }
-                        d = d.expression;
+                        d = expression;
                     // The below options all declare an Alias, which is allowed to merge with other values within the importing module.
                     // falls through
-                    case 260 /* ImportEqualsDeclaration */:
-                    case 263 /* NamespaceImport */:
-                    case 262 /* ImportClause */:
-                        var result_12 = 0 /* None */;
+                    case 264 /* ImportEqualsDeclaration */:
+                    case 267 /* NamespaceImport */:
+                    case 266 /* ImportClause */:
+                        var result_11 = 0 /* None */;
                         var target = resolveAlias(getSymbolOfNode(d));
-                        ts.forEach(target.declarations, function (d) { result_12 |= getDeclarationSpaces(d); });
-                        return result_12;
-                    case 249 /* VariableDeclaration */:
-                    case 198 /* BindingElement */:
-                    case 251 /* FunctionDeclaration */:
-                    case 265 /* ImportSpecifier */: // https://github.com/Microsoft/TypeScript/pull/7591
-                    case 78 /* Identifier */: // https://github.com/microsoft/TypeScript/issues/36098
+                        ts.forEach(target.declarations, function (d) {
+                            result_11 |= getDeclarationSpaces(d);
+                        });
+                        return result_11;
+                    case 253 /* VariableDeclaration */:
+                    case 202 /* BindingElement */:
+                    case 255 /* FunctionDeclaration */:
+                    case 269 /* ImportSpecifier */: // https://github.com/Microsoft/TypeScript/pull/7591
+                    case 79 /* Identifier */: // https://github.com/microsoft/TypeScript/issues/36098
                         // Identifiers are used as declarations of assignment declarations whose parents may be
                         // SyntaxKind.CallExpression - `Object.defineProperty(thing, "aField", {value: 42});`
                         // SyntaxKind.ElementAccessExpression - `thing["aField"] = 42;` or `thing["aField"];` (with a doc comment on it)
@@ -73918,6 +78909,10 @@ var ts;
             if (isReferenceToType(type, getGlobalPromiseType(/*reportErrors*/ false))) {
                 return typeAsPromise.promisedTypeOfPromise = getTypeArguments(type)[0];
             }
+            // primitives with a `{ then() }` won't be unwrapped/adopted.
+            if (allTypesAssignableToKind(type, 131068 /* Primitive */ | 131072 /* Never */)) {
+                return undefined;
+            }
             var thenFunction = getTypeOfPropertyOfType(type, "then"); // TODO: GH#18217
             if (isTypeAny(thenFunction)) {
                 return undefined;
@@ -73945,21 +78940,77 @@ var ts;
         /**
          * Gets the "awaited type" of a type.
          * @param type The type to await.
+         * @param withAlias When `true`, wraps the "awaited type" in `Awaited<T>` if needed.
          * @remarks The "awaited type" of an expression is its "promised type" if the expression is a
          * Promise-like type; otherwise, it is the type of the expression. This is used to reflect
          * The runtime behavior of the `await` keyword.
          */
-        function checkAwaitedType(type, errorNode, diagnosticMessage, arg0) {
-            var awaitedType = getAwaitedType(type, errorNode, diagnosticMessage, arg0);
+        function checkAwaitedType(type, withAlias, errorNode, diagnosticMessage, arg0) {
+            var awaitedType = withAlias ?
+                getAwaitedType(type, errorNode, diagnosticMessage, arg0) :
+                getAwaitedTypeNoAlias(type, errorNode, diagnosticMessage, arg0);
             return awaitedType || errorType;
         }
         /**
-         * Determines whether a type has a callable `then` member.
+         * Determines whether a type is an object with a callable `then` member.
          */
         function isThenableType(type) {
+            if (allTypesAssignableToKind(type, 131068 /* Primitive */ | 131072 /* Never */)) {
+                // primitive types cannot be considered "thenable" since they are not objects.
+                return false;
+            }
             var thenFunction = getTypeOfPropertyOfType(type, "then");
             return !!thenFunction && getSignaturesOfType(getTypeWithFacts(thenFunction, 2097152 /* NEUndefinedOrNull */), 0 /* Call */).length > 0;
         }
+        function isAwaitedTypeInstantiation(type) {
+            var _a;
+            if (type.flags & 16777216 /* Conditional */) {
+                var awaitedSymbol = getGlobalAwaitedSymbol(/*reportErrors*/ false);
+                return !!awaitedSymbol && type.aliasSymbol === awaitedSymbol && ((_a = type.aliasTypeArguments) === null || _a === void 0 ? void 0 : _a.length) === 1;
+            }
+            return false;
+        }
+        /**
+         * For a generic `Awaited<T>`, gets `T`.
+         */
+        function unwrapAwaitedType(type) {
+            return type.flags & 1048576 /* Union */ ? mapType(type, unwrapAwaitedType) :
+                isAwaitedTypeInstantiation(type) ? type.aliasTypeArguments[0] :
+                    type;
+        }
+        function createAwaitedTypeIfNeeded(type) {
+            // We wrap type `T` in `Awaited<T>` based on the following conditions:
+            // - `T` is not already an `Awaited<U>`, and
+            // - `T` is generic, and
+            // - One of the following applies:
+            //   - `T` has no base constraint, or
+            //   - The base constraint of `T` is `any`, `unknown`, `object`, or `{}`, or
+            //   - The base constraint of `T` is an object type with a callable `then` method.
+            if (isTypeAny(type)) {
+                return type;
+            }
+            // If this is already an `Awaited<T>`, just return it. This helps to avoid `Awaited<Awaited<T>>` in higher-order.
+            if (isAwaitedTypeInstantiation(type)) {
+                return type;
+            }
+            // Only instantiate `Awaited<T>` if `T` contains possibly non-primitive types.
+            if (isGenericObjectType(type)) {
+                var baseConstraint = getBaseConstraintOfType(type);
+                // Only instantiate `Awaited<T>` if `T` has no base constraint, or the base constraint of `T` is `any`, `unknown`, `{}`, `object`,
+                // or is promise-like.
+                if (!baseConstraint || (baseConstraint.flags & 3 /* AnyOrUnknown */) || isEmptyObjectType(baseConstraint) || isThenableType(baseConstraint)) {
+                    // Nothing to do if `Awaited<T>` doesn't exist
+                    var awaitedSymbol = getGlobalAwaitedSymbol(/*reportErrors*/ true);
+                    if (awaitedSymbol) {
+                        // Unwrap unions that may contain `Awaited<T>`, otherwise its possible to manufacture an `Awaited<Awaited<T> | U>` where
+                        // an `Awaited<T | U>` would suffice.
+                        return getTypeAliasInstantiation(awaitedSymbol, [unwrapAwaitedType(type)]);
+                    }
+                }
+            }
+            ts.Debug.assert(getPromisedTypeOfPromise(type) === undefined, "type provided should not be a non-generic 'promise'-like.");
+            return type;
+        }
         /**
          * Gets the "awaited type" of a type.
          *
@@ -73971,22 +79022,31 @@ var ts;
          * This is used to reflect the runtime behavior of the `await` keyword.
          */
         function getAwaitedType(type, errorNode, diagnosticMessage, arg0) {
+            var awaitedType = getAwaitedTypeNoAlias(type, errorNode, diagnosticMessage, arg0);
+            return awaitedType && createAwaitedTypeIfNeeded(awaitedType);
+        }
+        /**
+         * Gets the "awaited type" of a type without introducing an `Awaited<T>` wrapper.
+         *
+         * @see {@link getAwaitedType}
+         */
+        function getAwaitedTypeNoAlias(type, errorNode, diagnosticMessage, arg0) {
             if (isTypeAny(type)) {
                 return type;
             }
+            // If this is already an `Awaited<T>`, just return it. This avoids `Awaited<Awaited<T>>` in higher-order
+            if (isAwaitedTypeInstantiation(type)) {
+                return type;
+            }
+            // If we've already cached an awaited type, return a possible `Awaited<T>` for it.
             var typeAsAwaitable = type;
             if (typeAsAwaitable.awaitedTypeOfType) {
                 return typeAsAwaitable.awaitedTypeOfType;
             }
             // For a union, get a union of the awaited types of each constituent.
-            //
-            return typeAsAwaitable.awaitedTypeOfType =
-                mapType(type, errorNode ? function (constituentType) { return getAwaitedTypeWorker(constituentType, errorNode, diagnosticMessage, arg0); } : getAwaitedTypeWorker);
-        }
-        function getAwaitedTypeWorker(type, errorNode, diagnosticMessage, arg0) {
-            var typeAsAwaitable = type;
-            if (typeAsAwaitable.awaitedTypeOfType) {
-                return typeAsAwaitable.awaitedTypeOfType;
+            if (type.flags & 1048576 /* Union */) {
+                var mapper = errorNode ? function (constituentType) { return getAwaitedTypeNoAlias(constituentType, errorNode, diagnosticMessage, arg0); } : getAwaitedTypeNoAlias;
+                return typeAsAwaitable.awaitedTypeOfType = mapType(type, mapper);
             }
             var promisedType = getPromisedTypeOfPromise(type);
             if (promisedType) {
@@ -74032,7 +79092,7 @@ var ts;
                 // Keep track of the type we're about to unwrap to avoid bad recursive promise types.
                 // See the comments above for more information.
                 awaitedTypeStack.push(type.id);
-                var awaitedType = getAwaitedType(promisedType, errorNode, diagnosticMessage, arg0);
+                var awaitedType = getAwaitedTypeNoAlias(promisedType, errorNode, diagnosticMessage, arg0);
                 awaitedTypeStack.pop();
                 if (!awaitedType) {
                     return undefined;
@@ -74056,8 +79116,7 @@ var ts;
             // be treated as a promise, they can cast to <any>.
             if (isThenableType(type)) {
                 if (errorNode) {
-                    if (!diagnosticMessage)
-                        return ts.Debug.fail();
+                    ts.Debug.assertIsDefined(diagnosticMessage);
                     error(errorNode, diagnosticMessage, arg0);
                 }
                 return undefined;
@@ -74103,21 +79162,21 @@ var ts;
             //
             var returnType = getTypeFromTypeNode(returnTypeNode);
             if (languageVersion >= 2 /* ES2015 */) {
-                if (returnType === errorType) {
+                if (isErrorType(returnType)) {
                     return;
                 }
                 var globalPromiseType = getGlobalPromiseType(/*reportErrors*/ true);
                 if (globalPromiseType !== emptyGenericType && !isReferenceToType(returnType, globalPromiseType)) {
                     // The promise type was not a valid type reference to the global promise type, so we
                     // report an error and return the unknown type.
-                    error(returnTypeNode, ts.Diagnostics.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0, typeToString(getAwaitedType(returnType) || voidType));
+                    error(returnTypeNode, ts.Diagnostics.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0, typeToString(getAwaitedTypeNoAlias(returnType) || voidType));
                     return;
                 }
             }
             else {
                 // Always mark the type node as referenced if it points to a value
                 markTypeNodeAsReferenced(returnTypeNode);
-                if (returnType === errorType) {
+                if (isErrorType(returnType)) {
                     return;
                 }
                 var promiseConstructorName = ts.getEntityNameFromTypeNode(returnTypeNode);
@@ -74127,8 +79186,8 @@ var ts;
                 }
                 var promiseConstructorSymbol = resolveEntityName(promiseConstructorName, 111551 /* Value */, /*ignoreErrors*/ true);
                 var promiseConstructorType = promiseConstructorSymbol ? getTypeOfSymbol(promiseConstructorSymbol) : errorType;
-                if (promiseConstructorType === errorType) {
-                    if (promiseConstructorName.kind === 78 /* Identifier */ && promiseConstructorName.escapedText === "Promise" && getTargetType(returnType) === getGlobalPromiseType(/*reportErrors*/ false)) {
+                if (isErrorType(promiseConstructorType)) {
+                    if (promiseConstructorName.kind === 79 /* Identifier */ && promiseConstructorName.escapedText === "Promise" && getTargetType(returnType) === getGlobalPromiseType(/*reportErrors*/ false)) {
                         error(returnTypeNode, ts.Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option);
                     }
                     else {
@@ -74154,7 +79213,7 @@ var ts;
                     return;
                 }
             }
-            checkAwaitedType(returnType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);
+            checkAwaitedType(returnType, /*withAlias*/ false, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);
         }
         /** Check a decorator */
         function checkDecorator(node) {
@@ -74168,24 +79227,24 @@ var ts;
             var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node);
             var errorInfo;
             switch (node.parent.kind) {
-                case 252 /* ClassDeclaration */:
+                case 256 /* ClassDeclaration */:
                     var classSymbol = getSymbolOfNode(node.parent);
                     var classConstructorType = getTypeOfSymbol(classSymbol);
                     expectedReturnType = getUnionType([classConstructorType, voidType]);
                     break;
-                case 160 /* Parameter */:
+                case 163 /* Parameter */:
                     expectedReturnType = voidType;
                     errorInfo = ts.chainDiagnosticMessages(
                     /*details*/ undefined, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any);
                     break;
-                case 163 /* PropertyDeclaration */:
+                case 166 /* PropertyDeclaration */:
                     expectedReturnType = voidType;
                     errorInfo = ts.chainDiagnosticMessages(
                     /*details*/ undefined, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any);
                     break;
-                case 165 /* MethodDeclaration */:
-                case 167 /* GetAccessor */:
-                case 168 /* SetAccessor */:
+                case 168 /* MethodDeclaration */:
+                case 171 /* GetAccessor */:
+                case 172 /* SetAccessor */:
                     var methodType = getTypeOfNode(node.parent);
                     var descriptorType = createTypedPropertyDescriptorType(methodType);
                     expectedReturnType = getUnionType([descriptorType, voidType]);
@@ -74206,8 +79265,8 @@ var ts;
             if (!typeName)
                 return;
             var rootName = ts.getFirstIdentifier(typeName);
-            var meaning = (typeName.kind === 78 /* Identifier */ ? 788968 /* Type */ : 1920 /* Namespace */) | 2097152 /* Alias */;
-            var rootSymbol = resolveName(rootName, rootName.escapedText, meaning, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isRefernce*/ true);
+            var meaning = (typeName.kind === 79 /* Identifier */ ? 788968 /* Type */ : 1920 /* Namespace */) | 2097152 /* Alias */;
+            var rootSymbol = resolveName(rootName, rootName.escapedText, meaning, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isReference*/ true);
             if (rootSymbol
                 && rootSymbol.flags & 2097152 /* Alias */
                 && symbolIsValue(rootSymbol)
@@ -74232,30 +79291,30 @@ var ts;
         function getEntityNameForDecoratorMetadata(node) {
             if (node) {
                 switch (node.kind) {
-                    case 183 /* IntersectionType */:
-                    case 182 /* UnionType */:
+                    case 187 /* IntersectionType */:
+                    case 186 /* UnionType */:
                         return getEntityNameForDecoratorMetadataFromTypeList(node.types);
-                    case 184 /* ConditionalType */:
+                    case 188 /* ConditionalType */:
                         return getEntityNameForDecoratorMetadataFromTypeList([node.trueType, node.falseType]);
-                    case 186 /* ParenthesizedType */:
-                    case 192 /* NamedTupleMember */:
+                    case 190 /* ParenthesizedType */:
+                    case 196 /* NamedTupleMember */:
                         return getEntityNameForDecoratorMetadata(node.type);
-                    case 173 /* TypeReference */:
+                    case 177 /* TypeReference */:
                         return node.typeName;
                 }
             }
         }
         function getEntityNameForDecoratorMetadataFromTypeList(types) {
             var commonEntityName;
-            for (var _i = 0, types_23 = types; _i < types_23.length; _i++) {
-                var typeNode = types_23[_i];
-                while (typeNode.kind === 186 /* ParenthesizedType */ || typeNode.kind === 192 /* NamedTupleMember */) {
+            for (var _i = 0, types_22 = types; _i < types_22.length; _i++) {
+                var typeNode = types_22[_i];
+                while (typeNode.kind === 190 /* ParenthesizedType */ || typeNode.kind === 196 /* NamedTupleMember */) {
                     typeNode = typeNode.type; // Skip parens if need be
                 }
-                if (typeNode.kind === 141 /* NeverKeyword */) {
+                if (typeNode.kind === 143 /* NeverKeyword */) {
                     continue; // Always elide `never` from the union/intersection if possible
                 }
-                if (!strictNullChecks && (typeNode.kind === 191 /* LiteralType */ && typeNode.literal.kind === 103 /* NullKeyword */ || typeNode.kind === 150 /* UndefinedKeyword */)) {
+                if (!strictNullChecks && (typeNode.kind === 195 /* LiteralType */ && typeNode.literal.kind === 104 /* NullKeyword */ || typeNode.kind === 152 /* UndefinedKeyword */)) {
                     continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks
                 }
                 var individualEntityName = getEntityNameForDecoratorMetadata(typeNode);
@@ -74301,14 +79360,14 @@ var ts;
             }
             var firstDecorator = node.decorators[0];
             checkExternalEmitHelpers(firstDecorator, 8 /* Decorate */);
-            if (node.kind === 160 /* Parameter */) {
+            if (node.kind === 163 /* Parameter */) {
                 checkExternalEmitHelpers(firstDecorator, 32 /* Param */);
             }
             if (compilerOptions.emitDecoratorMetadata) {
                 checkExternalEmitHelpers(firstDecorator, 16 /* Metadata */);
                 // we only need to perform these checks if we are emitting serialized type metadata for the target of a decorator.
                 switch (node.kind) {
-                    case 252 /* ClassDeclaration */:
+                    case 256 /* ClassDeclaration */:
                         var constructor = ts.getFirstConstructorWithBody(node);
                         if (constructor) {
                             for (var _i = 0, _a = constructor.parameters; _i < _a.length; _i++) {
@@ -74317,23 +79376,23 @@ var ts;
                             }
                         }
                         break;
-                    case 167 /* GetAccessor */:
-                    case 168 /* SetAccessor */:
-                        var otherKind = node.kind === 167 /* GetAccessor */ ? 168 /* SetAccessor */ : 167 /* GetAccessor */;
+                    case 171 /* GetAccessor */:
+                    case 172 /* SetAccessor */:
+                        var otherKind = node.kind === 171 /* GetAccessor */ ? 172 /* SetAccessor */ : 171 /* GetAccessor */;
                         var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind);
                         markDecoratorMedataDataTypeNodeAsReferenced(getAnnotatedAccessorTypeNode(node) || otherAccessor && getAnnotatedAccessorTypeNode(otherAccessor));
                         break;
-                    case 165 /* MethodDeclaration */:
+                    case 168 /* MethodDeclaration */:
                         for (var _b = 0, _c = node.parameters; _b < _c.length; _b++) {
                             var parameter = _c[_b];
                             markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter));
                         }
                         markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveReturnTypeNode(node));
                         break;
-                    case 163 /* PropertyDeclaration */:
+                    case 166 /* PropertyDeclaration */:
                         markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveTypeAnnotationNode(node));
                         break;
-                    case 160 /* Parameter */:
+                    case 163 /* Parameter */:
                         markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node));
                         var containingSignature = node.parent;
                         for (var _d = 0, _e = containingSignature.parameters; _d < _e.length; _d++) {
@@ -74349,8 +79408,7 @@ var ts;
             if (produceDiagnostics) {
                 checkFunctionOrMethodDeclaration(node);
                 checkGrammarForGenerator(node);
-                checkCollisionWithRequireExportsInGeneratedCode(node, node.name);
-                checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name);
+                checkCollisionsForDeclarationName(node, node.name);
             }
         }
         function checkJSDocTypeAliasTag(node) {
@@ -74362,6 +79420,7 @@ var ts;
                 checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_alias_name_cannot_be_0);
             }
             checkSourceElement(node.typeExpression);
+            checkTypeParameters(ts.getEffectiveTypeParameterDeclarations(node));
         }
         function checkJSDocTemplateTag(node) {
             checkSourceElement(node.constraint);
@@ -74396,7 +79455,7 @@ var ts;
                     else if (ts.findLast(ts.getJSDocTags(decl), ts.isJSDocParameterTag) === node &&
                         node.typeExpression && node.typeExpression.type &&
                         !isArrayType(getTypeFromTypeNode(node.typeExpression.type))) {
-                        error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 157 /* QualifiedName */ ? node.name.right : node.name));
+                        error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 160 /* QualifiedName */ ? node.name.right : node.name));
                     }
                 }
             }
@@ -74436,24 +79495,31 @@ var ts;
                 }
             }
         }
+        function checkJSDocAccessibilityModifiers(node) {
+            var host = ts.getJSDocHost(node);
+            if (host && ts.isPrivateIdentifierClassElementDeclaration(host)) {
+                error(node, ts.Diagnostics.An_accessibility_modifier_cannot_be_used_with_a_private_identifier);
+            }
+        }
         function getIdentifierFromEntityNameExpression(node) {
             switch (node.kind) {
-                case 78 /* Identifier */:
+                case 79 /* Identifier */:
                     return node;
-                case 201 /* PropertyAccessExpression */:
+                case 205 /* PropertyAccessExpression */:
                     return node.name;
                 default:
                     return undefined;
             }
         }
         function checkFunctionOrMethodDeclaration(node) {
+            var _a;
             checkDecorators(node);
             checkSignatureDeclaration(node);
             var functionFlags = ts.getFunctionFlags(node);
             // Do not use hasDynamicName here, because that returns false for well known symbols.
             // We want to perform checkComputedPropertyName for all computed properties, including
             // well known symbols.
-            if (node.name && node.name.kind === 158 /* ComputedPropertyName */) {
+            if (node.name && node.name.kind === 161 /* ComputedPropertyName */) {
                 // This check will account for methods in class/interface declarations,
                 // as well as accessors in classes/object literals
                 checkComputedPropertyName(node.name);
@@ -74467,7 +79533,7 @@ var ts;
                 // Since the javascript won't do semantic analysis like typescript,
                 // if the javascript file comes before the typescript file and both contain same name functions,
                 // checkFunctionOrConstructorSymbol wouldn't be called if we didnt ignore javascript function.
-                var firstDeclaration = ts.find(localSymbol.declarations, 
+                var firstDeclaration = (_a = localSymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(
                 // Get first non javascript function declaration
                 function (declaration) { return declaration.kind === node.kind && !(declaration.flags & 131072 /* JavaScriptFile */); });
                 // Only type check the symbol once
@@ -74479,7 +79545,7 @@ var ts;
                     checkFunctionOrConstructorSymbol(symbol);
                 }
             }
-            var body = node.kind === 164 /* MethodSignature */ ? undefined : node.body;
+            var body = node.kind === 167 /* MethodSignature */ ? undefined : node.body;
             checkSourceElement(body);
             checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, getReturnTypeFromAnnotation(node));
             if (produceDiagnostics && !ts.getEffectiveReturnTypeNode(node)) {
@@ -74521,42 +79587,42 @@ var ts;
             for (var _i = 0, potentiallyUnusedIdentifiers_1 = potentiallyUnusedIdentifiers; _i < potentiallyUnusedIdentifiers_1.length; _i++) {
                 var node = potentiallyUnusedIdentifiers_1[_i];
                 switch (node.kind) {
-                    case 252 /* ClassDeclaration */:
-                    case 221 /* ClassExpression */:
+                    case 256 /* ClassDeclaration */:
+                    case 225 /* ClassExpression */:
                         checkUnusedClassMembers(node, addDiagnostic);
                         checkUnusedTypeParameters(node, addDiagnostic);
                         break;
-                    case 297 /* SourceFile */:
-                    case 256 /* ModuleDeclaration */:
-                    case 230 /* Block */:
-                    case 258 /* CaseBlock */:
-                    case 237 /* ForStatement */:
-                    case 238 /* ForInStatement */:
-                    case 239 /* ForOfStatement */:
+                    case 303 /* SourceFile */:
+                    case 260 /* ModuleDeclaration */:
+                    case 234 /* Block */:
+                    case 262 /* CaseBlock */:
+                    case 241 /* ForStatement */:
+                    case 242 /* ForInStatement */:
+                    case 243 /* ForOfStatement */:
                         checkUnusedLocalsAndParameters(node, addDiagnostic);
                         break;
-                    case 166 /* Constructor */:
-                    case 208 /* FunctionExpression */:
-                    case 251 /* FunctionDeclaration */:
-                    case 209 /* ArrowFunction */:
-                    case 165 /* MethodDeclaration */:
-                    case 167 /* GetAccessor */:
-                    case 168 /* SetAccessor */:
+                    case 170 /* Constructor */:
+                    case 212 /* FunctionExpression */:
+                    case 255 /* FunctionDeclaration */:
+                    case 213 /* ArrowFunction */:
+                    case 168 /* MethodDeclaration */:
+                    case 171 /* GetAccessor */:
+                    case 172 /* SetAccessor */:
                         if (node.body) { // Don't report unused parameters in overloads
                             checkUnusedLocalsAndParameters(node, addDiagnostic);
                         }
                         checkUnusedTypeParameters(node, addDiagnostic);
                         break;
-                    case 164 /* MethodSignature */:
-                    case 169 /* CallSignature */:
-                    case 170 /* ConstructSignature */:
-                    case 174 /* FunctionType */:
-                    case 175 /* ConstructorType */:
-                    case 254 /* TypeAliasDeclaration */:
-                    case 253 /* InterfaceDeclaration */:
+                    case 167 /* MethodSignature */:
+                    case 173 /* CallSignature */:
+                    case 174 /* ConstructSignature */:
+                    case 178 /* FunctionType */:
+                    case 179 /* ConstructorType */:
+                    case 258 /* TypeAliasDeclaration */:
+                    case 257 /* InterfaceDeclaration */:
                         checkUnusedTypeParameters(node, addDiagnostic);
                         break;
-                    case 185 /* InferType */:
+                    case 189 /* InferType */:
                         checkUnusedInferTypeParameter(node, addDiagnostic);
                         break;
                     default:
@@ -74576,11 +79642,11 @@ var ts;
             for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
                 var member = _a[_i];
                 switch (member.kind) {
-                    case 165 /* MethodDeclaration */:
-                    case 163 /* PropertyDeclaration */:
-                    case 167 /* GetAccessor */:
-                    case 168 /* SetAccessor */:
-                        if (member.kind === 168 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) {
+                    case 168 /* MethodDeclaration */:
+                    case 166 /* PropertyDeclaration */:
+                    case 171 /* GetAccessor */:
+                    case 172 /* SetAccessor */:
+                        if (member.kind === 172 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) {
                             // Already would have reported an error on the getter.
                             break;
                         }
@@ -74591,7 +79657,7 @@ var ts;
                             addDiagnostic(member, 0 /* Local */, ts.createDiagnosticForNode(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol)));
                         }
                         break;
-                    case 166 /* Constructor */:
+                    case 170 /* Constructor */:
                         for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) {
                             var parameter = _c[_b];
                             if (!parameter.symbol.isReferenced && ts.hasSyntacticModifier(parameter, 8 /* Private */)) {
@@ -74599,12 +79665,13 @@ var ts;
                             }
                         }
                         break;
-                    case 171 /* IndexSignature */:
-                    case 229 /* SemicolonClassElement */:
+                    case 175 /* IndexSignature */:
+                    case 233 /* SemicolonClassElement */:
+                    case 169 /* ClassStaticBlockDeclaration */:
                         // Can't be private
                         break;
                     default:
-                        ts.Debug.fail();
+                        ts.Debug.fail("Unexpected class member");
                 }
             }
         }
@@ -74617,7 +79684,8 @@ var ts;
         function checkUnusedTypeParameters(node, addDiagnostic) {
             // Only report errors on the last declaration for the type parameter container;
             // this ensures that all uses have been accounted for.
-            if (ts.last(getSymbolOfNode(node).declarations) !== node)
+            var declarations = getSymbolOfNode(node).declarations;
+            if (!declarations || ts.last(declarations) !== node)
                 return;
             var typeParameters = ts.getEffectiveTypeParameterDeclarations(node);
             var seenParentsWithEveryUnused = new ts.Set();
@@ -74627,7 +79695,7 @@ var ts;
                     continue;
                 var name = ts.idText(typeParameter.name);
                 var parent = typeParameter.parent;
-                if (parent.kind !== 185 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) {
+                if (parent.kind !== 189 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) {
                     if (ts.tryAddToSet(seenParentsWithEveryUnused, parent)) {
                         var sourceFile = ts.getSourceFileOfNode(parent);
                         var range = ts.isJSDocTemplateTag(parent)
@@ -74636,12 +79704,14 @@ var ts;
                             // Include the `<>` in the error message
                             : ts.rangeOfTypeParameters(sourceFile, parent.typeParameters);
                         var only = parent.typeParameters.length === 1;
+                        //TODO: following line is possible reason for bug #41974, unusedTypeParameters_TemplateTag
                         var message = only ? ts.Diagnostics._0_is_declared_but_its_value_is_never_read : ts.Diagnostics.All_type_parameters_are_unused;
                         var arg0 = only ? name : undefined;
                         addDiagnostic(typeParameter, 1 /* Parameter */, ts.createFileDiagnostic(sourceFile, range.pos, range.end - range.pos, message, arg0));
                     }
                 }
                 else {
+                    //TODO: following line is possible reason for bug #41974, unusedTypeParameters_TemplateTag
                     addDiagnostic(typeParameter, 1 /* Parameter */, ts.createDiagnosticForNode(typeParameter, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, name));
                 }
             }
@@ -74687,39 +79757,41 @@ var ts;
                 if (local.flags & 262144 /* TypeParameter */ ? !(local.flags & 3 /* Variable */ && !(local.isReferenced & 3 /* Variable */)) : local.isReferenced || local.exportSymbol) {
                     return;
                 }
-                for (var _i = 0, _a = local.declarations; _i < _a.length; _i++) {
-                    var declaration = _a[_i];
-                    if (isValidUnusedLocalDeclaration(declaration)) {
-                        continue;
-                    }
-                    if (isImportedDeclaration(declaration)) {
-                        addToGroup(unusedImports, importClauseFromImported(declaration), declaration, getNodeId);
-                    }
-                    else if (ts.isBindingElement(declaration) && ts.isObjectBindingPattern(declaration.parent)) {
-                        // In `{ a, ...b }, `a` is considered used since it removes a property from `b`. `b` may still be unused though.
-                        var lastElement = ts.last(declaration.parent.elements);
-                        if (declaration === lastElement || !ts.last(declaration.parent.elements).dotDotDotToken) {
-                            addToGroup(unusedDestructures, declaration.parent, declaration, getNodeId);
+                if (local.declarations) {
+                    for (var _i = 0, _a = local.declarations; _i < _a.length; _i++) {
+                        var declaration = _a[_i];
+                        if (isValidUnusedLocalDeclaration(declaration)) {
+                            continue;
                         }
-                    }
-                    else if (ts.isVariableDeclaration(declaration)) {
-                        addToGroup(unusedVariables, declaration.parent, declaration, getNodeId);
-                    }
-                    else {
-                        var parameter = local.valueDeclaration && tryGetRootParameterDeclaration(local.valueDeclaration);
-                        var name = local.valueDeclaration && ts.getNameOfDeclaration(local.valueDeclaration);
-                        if (parameter && name) {
-                            if (!ts.isParameterPropertyDeclaration(parameter, parameter.parent) && !ts.parameterIsThisKeyword(parameter) && !isIdentifierThatStartsWithUnderscore(name)) {
-                                if (ts.isBindingElement(declaration) && ts.isArrayBindingPattern(declaration.parent)) {
-                                    addToGroup(unusedDestructures, declaration.parent, declaration, getNodeId);
-                                }
-                                else {
-                                    addDiagnostic(parameter, 1 /* Parameter */, ts.createDiagnosticForNode(name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.symbolName(local)));
-                                }
+                        if (isImportedDeclaration(declaration)) {
+                            addToGroup(unusedImports, importClauseFromImported(declaration), declaration, getNodeId);
+                        }
+                        else if (ts.isBindingElement(declaration) && ts.isObjectBindingPattern(declaration.parent)) {
+                            // In `{ a, ...b }, `a` is considered used since it removes a property from `b`. `b` may still be unused though.
+                            var lastElement = ts.last(declaration.parent.elements);
+                            if (declaration === lastElement || !ts.last(declaration.parent.elements).dotDotDotToken) {
+                                addToGroup(unusedDestructures, declaration.parent, declaration, getNodeId);
                             }
                         }
+                        else if (ts.isVariableDeclaration(declaration)) {
+                            addToGroup(unusedVariables, declaration.parent, declaration, getNodeId);
+                        }
                         else {
-                            errorUnusedLocal(declaration, ts.symbolName(local), addDiagnostic);
+                            var parameter = local.valueDeclaration && tryGetRootParameterDeclaration(local.valueDeclaration);
+                            var name = local.valueDeclaration && ts.getNameOfDeclaration(local.valueDeclaration);
+                            if (parameter && name) {
+                                if (!ts.isParameterPropertyDeclaration(parameter, parameter.parent) && !ts.parameterIsThisKeyword(parameter) && !isIdentifierThatStartsWithUnderscore(name)) {
+                                    if (ts.isBindingElement(declaration) && ts.isArrayBindingPattern(declaration.parent)) {
+                                        addToGroup(unusedDestructures, declaration.parent, declaration, getNodeId);
+                                    }
+                                    else {
+                                        addDiagnostic(parameter, 1 /* Parameter */, ts.createDiagnosticForNode(name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.symbolName(local)));
+                                    }
+                                }
+                            }
+                            else {
+                                errorUnusedLocal(declaration, ts.symbolName(local), addDiagnostic);
+                            }
                         }
                     }
                 }
@@ -74729,7 +79801,7 @@ var ts;
                 var importDecl = importClause.parent;
                 var nDeclarations = (importClause.name ? 1 : 0) +
                     (importClause.namedBindings ?
-                        (importClause.namedBindings.kind === 263 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length)
+                        (importClause.namedBindings.kind === 267 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length)
                         : 0);
                 if (nDeclarations === unuseds.length) {
                     addDiagnostic(importDecl, 0 /* Local */, unuseds.length === 1
@@ -74747,7 +79819,7 @@ var ts;
                 var bindingPattern = _a[0], bindingElements = _a[1];
                 var kind = tryGetRootParameterDeclaration(bindingPattern.parent) ? 1 /* Parameter */ : 0 /* Local */;
                 if (bindingPattern.elements.length === bindingElements.length) {
-                    if (bindingElements.length === 1 && bindingPattern.parent.kind === 249 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 250 /* VariableDeclarationList */) {
+                    if (bindingElements.length === 1 && bindingPattern.parent.kind === 253 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 254 /* VariableDeclarationList */) {
                         addToGroup(unusedVariables, bindingPattern.parent.parent, bindingPattern.parent, getNodeId);
                     }
                     else {
@@ -74768,7 +79840,7 @@ var ts;
                 if (declarationList.declarations.length === declarations.length) {
                     addDiagnostic(declarationList, 0 /* Local */, declarations.length === 1
                         ? ts.createDiagnosticForNode(ts.first(declarations).name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(ts.first(declarations).name))
-                        : ts.createDiagnosticForNode(declarationList.parent.kind === 232 /* VariableStatement */ ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused));
+                        : ts.createDiagnosticForNode(declarationList.parent.kind === 236 /* VariableStatement */ ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused));
                 }
                 else {
                     for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) {
@@ -74780,24 +79852,24 @@ var ts;
         }
         function bindingNameText(name) {
             switch (name.kind) {
-                case 78 /* Identifier */:
+                case 79 /* Identifier */:
                     return ts.idText(name);
-                case 197 /* ArrayBindingPattern */:
-                case 196 /* ObjectBindingPattern */:
+                case 201 /* ArrayBindingPattern */:
+                case 200 /* ObjectBindingPattern */:
                     return bindingNameText(ts.cast(ts.first(name.elements), ts.isBindingElement).name);
                 default:
                     return ts.Debug.assertNever(name);
             }
         }
         function isImportedDeclaration(node) {
-            return node.kind === 262 /* ImportClause */ || node.kind === 265 /* ImportSpecifier */ || node.kind === 263 /* NamespaceImport */;
+            return node.kind === 266 /* ImportClause */ || node.kind === 269 /* ImportSpecifier */ || node.kind === 267 /* NamespaceImport */;
         }
         function importClauseFromImported(decl) {
-            return decl.kind === 262 /* ImportClause */ ? decl : decl.kind === 263 /* NamespaceImport */ ? decl.parent : decl.parent.parent;
+            return decl.kind === 266 /* ImportClause */ ? decl : decl.kind === 267 /* NamespaceImport */ ? decl.parent : decl.parent.parent;
         }
         function checkBlock(node) {
             // Grammar checking for SyntaxKind.Block
-            if (node.kind === 230 /* Block */) {
+            if (node.kind === 234 /* Block */) {
                 checkGrammarStatementInAmbientContext(node);
             }
             if (ts.isFunctionOrModuleBlock(node)) {
@@ -74823,25 +79895,37 @@ var ts;
                 }
             });
         }
+        /**
+         * Checks whether an {@link Identifier}, in the context of another {@link Node}, would collide with a runtime value
+         * of {@link name} in an outer scope. This is used to check for collisions for downlevel transformations that
+         * require names like `Object`, `Promise`, `Reflect`, `require`, `exports`, etc.
+         */
         function needCollisionCheckForIdentifier(node, identifier, name) {
-            if (!(identifier && identifier.escapedText === name)) {
+            if ((identifier === null || identifier === void 0 ? void 0 : identifier.escapedText) !== name) {
                 return false;
             }
-            if (node.kind === 163 /* PropertyDeclaration */ ||
-                node.kind === 162 /* PropertySignature */ ||
-                node.kind === 165 /* MethodDeclaration */ ||
-                node.kind === 164 /* MethodSignature */ ||
-                node.kind === 167 /* GetAccessor */ ||
-                node.kind === 168 /* SetAccessor */) {
-                // it is ok to have member named '_super' or '_this' - member access is always qualified
+            if (node.kind === 166 /* PropertyDeclaration */ ||
+                node.kind === 165 /* PropertySignature */ ||
+                node.kind === 168 /* MethodDeclaration */ ||
+                node.kind === 167 /* MethodSignature */ ||
+                node.kind === 171 /* GetAccessor */ ||
+                node.kind === 172 /* SetAccessor */ ||
+                node.kind === 294 /* PropertyAssignment */) {
+                // it is ok to have member named '_super', '_this', `Promise`, etc. - member access is always qualified
                 return false;
             }
             if (node.flags & 8388608 /* Ambient */) {
                 // ambient context - no codegen impact
                 return false;
             }
+            if (ts.isImportClause(node) || ts.isImportEqualsDeclaration(node) || ts.isImportSpecifier(node)) {
+                // type-only imports do not require collision checks against runtime values.
+                if (ts.isTypeOnlyImportOrExportDeclaration(node)) {
+                    return false;
+                }
+            }
             var root = ts.getRootDeclaration(node);
-            if (root.kind === 160 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) {
+            if (ts.isParameter(root) && ts.nodeIsMissing(root.parent.body)) {
                 // just an overload - no codegen impact
                 return false;
             }
@@ -74851,7 +79935,7 @@ var ts;
         function checkIfThisIsCapturedInEnclosingScope(node) {
             ts.findAncestor(node, function (current) {
                 if (getNodeCheckFlags(current) & 4 /* CaptureThis */) {
-                    var isDeclaration_1 = node.kind !== 78 /* Identifier */;
+                    var isDeclaration_1 = node.kind !== 79 /* Identifier */;
                     if (isDeclaration_1) {
                         error(ts.getNameOfDeclaration(node), ts.Diagnostics.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference);
                     }
@@ -74866,7 +79950,7 @@ var ts;
         function checkIfNewTargetIsCapturedInEnclosingScope(node) {
             ts.findAncestor(node, function (current) {
                 if (getNodeCheckFlags(current) & 8 /* CaptureNewTarget */) {
-                    var isDeclaration_2 = node.kind !== 78 /* Identifier */;
+                    var isDeclaration_2 = node.kind !== 79 /* Identifier */;
                     if (isDeclaration_2) {
                         error(ts.getNameOfDeclaration(node), ts.Diagnostics.Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference);
                     }
@@ -74878,18 +79962,12 @@ var ts;
                 return false;
             });
         }
-        function checkWeakMapCollision(node) {
-            var enclosingBlockScope = ts.getEnclosingBlockScopeContainer(node);
-            if (getNodeCheckFlags(enclosingBlockScope) & 67108864 /* ContainsClassWithPrivateIdentifiers */) {
-                errorSkippedOn("noEmit", node, ts.Diagnostics.Compiler_reserves_name_0_when_emitting_private_identifier_downlevel, "WeakMap");
-            }
-        }
         function checkCollisionWithRequireExportsInGeneratedCode(node, name) {
             // No need to check for require or exports for ES6 modules and later
-            if (moduleKind >= ts.ModuleKind.ES2015) {
+            if (moduleKind >= ts.ModuleKind.ES2015 && !(moduleKind >= ts.ModuleKind.Node12 && ts.getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.CommonJS)) {
                 return;
             }
-            if (!needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) {
+            if (!name || !needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) {
                 return;
             }
             // Uninstantiated modules shouldnt do this check
@@ -74898,13 +79976,13 @@ var ts;
             }
             // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent
             var parent = getDeclarationContainer(node);
-            if (parent.kind === 297 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) {
+            if (parent.kind === 303 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) {
                 // If the declaration happens to be in external module, report error that require and exports are reserved keywords
                 errorSkippedOn("noEmit", name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name));
             }
         }
         function checkCollisionWithGlobalPromiseInGeneratedCode(node, name) {
-            if (languageVersion >= 4 /* ES2017 */ || !needCollisionCheckForIdentifier(node, name, "Promise")) {
+            if (!name || languageVersion >= 4 /* ES2017 */ || !needCollisionCheckForIdentifier(node, name, "Promise")) {
                 return;
             }
             // Uninstantiated modules shouldnt do this check
@@ -74913,11 +79991,76 @@ var ts;
             }
             // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent
             var parent = getDeclarationContainer(node);
-            if (parent.kind === 297 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 2048 /* HasAsyncFunctions */) {
+            if (parent.kind === 303 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 2048 /* HasAsyncFunctions */) {
                 // If the declaration happens to be in external module, report error that Promise is a reserved identifier.
                 errorSkippedOn("noEmit", name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, ts.declarationNameToString(name), ts.declarationNameToString(name));
             }
         }
+        function recordPotentialCollisionWithWeakMapSetInGeneratedCode(node, name) {
+            if (languageVersion <= 8 /* ES2021 */
+                && (needCollisionCheckForIdentifier(node, name, "WeakMap") || needCollisionCheckForIdentifier(node, name, "WeakSet"))) {
+                potentialWeakMapSetCollisions.push(node);
+            }
+        }
+        function checkWeakMapSetCollision(node) {
+            var enclosingBlockScope = ts.getEnclosingBlockScopeContainer(node);
+            if (getNodeCheckFlags(enclosingBlockScope) & 67108864 /* ContainsClassWithPrivateIdentifiers */) {
+                ts.Debug.assert(ts.isNamedDeclaration(node) && ts.isIdentifier(node.name) && typeof node.name.escapedText === "string", "The target of a WeakMap/WeakSet collision check should be an identifier");
+                errorSkippedOn("noEmit", node, ts.Diagnostics.Compiler_reserves_name_0_when_emitting_private_identifier_downlevel, node.name.escapedText);
+            }
+        }
+        function recordPotentialCollisionWithReflectInGeneratedCode(node, name) {
+            if (name && languageVersion >= 2 /* ES2015 */ && languageVersion <= 8 /* ES2021 */
+                && needCollisionCheckForIdentifier(node, name, "Reflect")) {
+                potentialReflectCollisions.push(node);
+            }
+        }
+        function checkReflectCollision(node) {
+            var hasCollision = false;
+            if (ts.isClassExpression(node)) {
+                // ClassExpression names don't contribute to their containers, but do matter for any of their block-scoped members.
+                for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
+                    var member = _a[_i];
+                    if (getNodeCheckFlags(member) & 134217728 /* ContainsSuperPropertyInStaticInitializer */) {
+                        hasCollision = true;
+                        break;
+                    }
+                }
+            }
+            else if (ts.isFunctionExpression(node)) {
+                // FunctionExpression names don't contribute to their containers, but do matter for their contents
+                if (getNodeCheckFlags(node) & 134217728 /* ContainsSuperPropertyInStaticInitializer */) {
+                    hasCollision = true;
+                }
+            }
+            else {
+                var container = ts.getEnclosingBlockScopeContainer(node);
+                if (container && getNodeCheckFlags(container) & 134217728 /* ContainsSuperPropertyInStaticInitializer */) {
+                    hasCollision = true;
+                }
+            }
+            if (hasCollision) {
+                ts.Debug.assert(ts.isNamedDeclaration(node) && ts.isIdentifier(node.name), "The target of a Reflect collision check should be an identifier");
+                errorSkippedOn("noEmit", node, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializers, ts.declarationNameToString(node.name), "Reflect");
+            }
+        }
+        function checkCollisionsForDeclarationName(node, name) {
+            if (!name)
+                return;
+            checkCollisionWithRequireExportsInGeneratedCode(node, name);
+            checkCollisionWithGlobalPromiseInGeneratedCode(node, name);
+            recordPotentialCollisionWithWeakMapSetInGeneratedCode(node, name);
+            recordPotentialCollisionWithReflectInGeneratedCode(node, name);
+            if (ts.isClassLike(node)) {
+                checkTypeNameIsReserved(name, ts.Diagnostics.Class_name_cannot_be_0);
+                if (!(node.flags & 8388608 /* Ambient */)) {
+                    checkClassNameCollisionWithObject(name);
+                }
+            }
+            else if (ts.isEnumDeclaration(node)) {
+                checkTypeNameIsReserved(name, ts.Diagnostics.Enum_name_cannot_be_0);
+            }
+        }
         function checkVarDeclaredNamesNotShadowed(node) {
             // - ScriptBody : StatementList
             // It is a Syntax Error if any element of the LexicallyDeclaredNames of StatementList
@@ -74948,7 +80091,7 @@ var ts;
             // skip variable declarations that don't have initializers
             // NOTE: in ES6 spec initializer is required in variable declarations where name is binding pattern
             // so we'll always treat binding elements as initialized
-            if (node.kind === 249 /* VariableDeclaration */ && !node.initializer) {
+            if (node.kind === 253 /* VariableDeclaration */ && !node.initializer) {
                 return;
             }
             var symbol = getSymbolOfNode(node);
@@ -74960,17 +80103,17 @@ var ts;
                     localDeclarationSymbol !== symbol &&
                     localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) {
                     if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3 /* BlockScoped */) {
-                        var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 250 /* VariableDeclarationList */);
-                        var container = varDeclList.parent.kind === 232 /* VariableStatement */ && varDeclList.parent.parent
+                        var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 254 /* VariableDeclarationList */);
+                        var container = varDeclList.parent.kind === 236 /* VariableStatement */ && varDeclList.parent.parent
                             ? varDeclList.parent.parent
                             : undefined;
                         // names of block-scoped and function scoped variables can collide only
                         // if block scoped variable is defined in the function\module\source file scope (because of variable hoisting)
                         var namesShareScope = container &&
-                            (container.kind === 230 /* Block */ && ts.isFunctionLike(container.parent) ||
-                                container.kind === 257 /* ModuleBlock */ ||
-                                container.kind === 256 /* ModuleDeclaration */ ||
-                                container.kind === 297 /* SourceFile */);
+                            (container.kind === 234 /* Block */ && ts.isFunctionLike(container.parent) ||
+                                container.kind === 261 /* ModuleBlock */ ||
+                                container.kind === 260 /* ModuleDeclaration */ ||
+                                container.kind === 303 /* SourceFile */);
                         // here we know that function scoped variable is shadowed by block scoped one
                         // if they are defined in the same scope - binder has already reported redeclaration error
                         // otherwise if variable has an initializer - show error that initialization will fail
@@ -75001,18 +80144,18 @@ var ts;
             // Do not use hasDynamicName here, because that returns false for well known symbols.
             // We want to perform checkComputedPropertyName for all computed properties, including
             // well known symbols.
-            if (node.name.kind === 158 /* ComputedPropertyName */) {
+            if (node.name.kind === 161 /* ComputedPropertyName */) {
                 checkComputedPropertyName(node.name);
                 if (node.initializer) {
                     checkExpressionCached(node.initializer);
                 }
             }
-            if (node.kind === 198 /* BindingElement */) {
-                if (node.parent.kind === 196 /* ObjectBindingPattern */ && languageVersion < 99 /* ESNext */) {
+            if (ts.isBindingElement(node)) {
+                if (ts.isObjectBindingPattern(node.parent) && node.dotDotDotToken && languageVersion < 5 /* ES2018 */) {
                     checkExternalEmitHelpers(node, 4 /* Rest */);
                 }
                 // check computed properties inside property names of binding elements
-                if (node.propertyName && node.propertyName.kind === 158 /* ComputedPropertyName */) {
+                if (node.propertyName && node.propertyName.kind === 161 /* ComputedPropertyName */) {
                     checkComputedPropertyName(node.propertyName);
                 }
                 // check private/protected variable access
@@ -75025,15 +80168,15 @@ var ts;
                         var nameText = getPropertyNameFromType(exprType);
                         var property = getPropertyOfType(parentType, nameText);
                         if (property) {
-                            markPropertyAsReferenced(property, /*nodeForCheckWriteOnly*/ undefined, /*isThisAccess*/ false); // A destructuring is never a write-only reference.
-                            checkPropertyAccessibility(parent, !!parent.initializer && parent.initializer.kind === 105 /* SuperKeyword */, parentType, property);
+                            markPropertyAsReferenced(property, /*nodeForCheckWriteOnly*/ undefined, /*isSelfTypeAccess*/ false); // A destructuring is never a write-only reference.
+                            checkPropertyAccessibility(node, !!parent.initializer && parent.initializer.kind === 106 /* SuperKeyword */, /*writing*/ false, parentType, property);
                         }
                     }
                 }
             }
             // For a binding pattern, check contained binding elements
             if (ts.isBindingPattern(node.name)) {
-                if (node.name.kind === 197 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) {
+                if (node.name.kind === 201 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) {
                     checkExternalEmitHelpers(node, 512 /* Read */);
                 }
                 ts.forEach(node.name.elements, checkSourceElement);
@@ -75045,7 +80188,7 @@ var ts;
             }
             // For a binding pattern, validate the initializer and exit
             if (ts.isBindingPattern(node.name)) {
-                var needCheckInitializer = node.initializer && node.parent.parent.kind !== 238 /* ForInStatement */;
+                var needCheckInitializer = node.initializer && node.parent.parent.kind !== 242 /* ForInStatement */;
                 var needCheckWidenedType = node.name.elements.length === 0;
                 if (needCheckInitializer || needCheckWidenedType) {
                     // Don't validate for-in initializer as it is already an error
@@ -75073,7 +80216,7 @@ var ts;
             }
             // For a commonjs `const x = require`, validate the alias and exit
             var symbol = getSymbolOfNode(node);
-            if (symbol.flags & 2097152 /* Alias */ && ts.isRequireVariableDeclaration(node, /*requireStringLiteralLikeArgument*/ true)) {
+            if (symbol.flags & 2097152 /* Alias */ && ts.isRequireVariableDeclaration(node)) {
                 checkAliasSymbol(node);
                 return;
             }
@@ -75087,11 +80230,11 @@ var ts;
                         ts.isObjectLiteralExpression(initializer) &&
                         (initializer.properties.length === 0 || ts.isPrototypeAccess(node.name)) &&
                         !!((_a = symbol.exports) === null || _a === void 0 ? void 0 : _a.size);
-                    if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 238 /* ForInStatement */) {
+                    if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 242 /* ForInStatement */) {
                         checkTypeAssignableToAndOptionallyElaborate(checkExpressionCached(initializer), type, node, initializer, /*headMessage*/ undefined);
                     }
                 }
-                if (symbol.declarations.length > 1) {
+                if (symbol.declarations && symbol.declarations.length > 1) {
                     if (ts.some(symbol.declarations, function (d) { return d !== node && ts.isVariableLike(d) && !areDeclarationFlagsIdentical(d, node); })) {
                         error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name));
                     }
@@ -75101,7 +80244,7 @@ var ts;
                 // Node is a secondary declaration, check that type is identical to primary declaration and check that
                 // initializer is consistent with type associated with the node
                 var declarationType = convertAutoToAny(getWidenedTypeForVariableLikeDeclaration(node));
-                if (type !== errorType && declarationType !== errorType &&
+                if (!isErrorType(type) && !isErrorType(declarationType) &&
                     !isTypeIdenticalTo(type, declarationType) &&
                     !(symbol.flags & 67108864 /* Assignment */)) {
                     errorNextVariableOrPropertyDeclarationMustHaveSameType(symbol.valueDeclaration, type, node, declarationType);
@@ -75109,26 +80252,22 @@ var ts;
                 if (node.initializer) {
                     checkTypeAssignableToAndOptionallyElaborate(checkExpressionCached(node.initializer), declarationType, node, node.initializer, /*headMessage*/ undefined);
                 }
-                if (!areDeclarationFlagsIdentical(node, symbol.valueDeclaration)) {
+                if (symbol.valueDeclaration && !areDeclarationFlagsIdentical(node, symbol.valueDeclaration)) {
                     error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name));
                 }
             }
-            if (node.kind !== 163 /* PropertyDeclaration */ && node.kind !== 162 /* PropertySignature */) {
+            if (node.kind !== 166 /* PropertyDeclaration */ && node.kind !== 165 /* PropertySignature */) {
                 // We know we don't have a binding pattern or computed name here
                 checkExportsOnMergedDeclarations(node);
-                if (node.kind === 249 /* VariableDeclaration */ || node.kind === 198 /* BindingElement */) {
+                if (node.kind === 253 /* VariableDeclaration */ || node.kind === 202 /* BindingElement */) {
                     checkVarDeclaredNamesNotShadowed(node);
                 }
-                checkCollisionWithRequireExportsInGeneratedCode(node, node.name);
-                checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name);
-                if (languageVersion < 99 /* ESNext */ && needCollisionCheckForIdentifier(node, node.name, "WeakMap")) {
-                    potentialWeakMapCollisions.push(node);
-                }
+                checkCollisionsForDeclarationName(node, node.name);
             }
         }
         function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstDeclaration, firstType, nextDeclaration, nextType) {
             var nextDeclarationName = ts.getNameOfDeclaration(nextDeclaration);
-            var message = nextDeclaration.kind === 163 /* PropertyDeclaration */ || nextDeclaration.kind === 162 /* PropertySignature */
+            var message = nextDeclaration.kind === 166 /* PropertyDeclaration */ || nextDeclaration.kind === 165 /* PropertySignature */
                 ? ts.Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2
                 : ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2;
             var declName = ts.declarationNameToString(nextDeclarationName);
@@ -75138,8 +80277,8 @@ var ts;
             }
         }
         function areDeclarationFlagsIdentical(left, right) {
-            if ((left.kind === 160 /* Parameter */ && right.kind === 249 /* VariableDeclaration */) ||
-                (left.kind === 249 /* VariableDeclaration */ && right.kind === 160 /* Parameter */)) {
+            if ((left.kind === 163 /* Parameter */ && right.kind === 253 /* VariableDeclaration */) ||
+                (left.kind === 253 /* VariableDeclaration */ && right.kind === 163 /* Parameter */)) {
                 // Differences in optionality between parameters and variables are allowed.
                 return true;
             }
@@ -75179,51 +80318,53 @@ var ts;
             // Grammar checking
             checkGrammarStatementInAmbientContext(node);
             var type = checkTruthinessExpression(node.expression);
-            checkTestingKnownTruthyCallableType(node.expression, type, node.thenStatement);
+            checkTestingKnownTruthyCallableOrAwaitableType(node.expression, type, node.thenStatement);
             checkSourceElement(node.thenStatement);
-            if (node.thenStatement.kind === 231 /* EmptyStatement */) {
+            if (node.thenStatement.kind === 235 /* EmptyStatement */) {
                 error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement);
             }
             checkSourceElement(node.elseStatement);
         }
-        function checkTestingKnownTruthyCallableType(condExpr, type, body) {
-            if (!strictNullChecks) {
+        function checkTestingKnownTruthyCallableOrAwaitableType(condExpr, type, body) {
+            if (!strictNullChecks)
+                return;
+            if (getFalsyFlags(type))
                 return;
-            }
             var location = ts.isBinaryExpression(condExpr) ? condExpr.right : condExpr;
+            if (ts.isPropertyAccessExpression(location) && isTypeAssertion(location.expression)) {
+                return;
+            }
             var testedNode = ts.isIdentifier(location) ? location
                 : ts.isPropertyAccessExpression(location) ? location.name
                     : ts.isBinaryExpression(location) && ts.isIdentifier(location.right) ? location.right
                         : undefined;
-            var isPropertyExpressionCast = ts.isPropertyAccessExpression(location)
-                && ts.isAssertionExpression(ts.skipParentheses(location.expression));
-            if (!testedNode || isPropertyExpressionCast) {
-                return;
-            }
-            var possiblyFalsy = getFalsyFlags(type);
-            if (possiblyFalsy) {
-                return;
-            }
             // While it technically should be invalid for any known-truthy value
-            // to be tested, we de-scope to functions unrefenced in the block as a
-            // heuristic to identify the most common bugs. There are too many
-            // false positives for values sourced from type definitions without
-            // strictNullChecks otherwise.
+            // to be tested, we de-scope to functions and Promises unreferenced in
+            // the block as a heuristic to identify the most common bugs. There
+            // are too many false positives for values sourced from type
+            // definitions without strictNullChecks otherwise.
             var callSignatures = getSignaturesOfType(type, 0 /* Call */);
-            if (callSignatures.length === 0) {
+            var isPromise = !!getAwaitedTypeOfPromise(type);
+            if (callSignatures.length === 0 && !isPromise) {
                 return;
             }
-            var testedSymbol = getSymbolAtLocation(testedNode);
-            if (!testedSymbol) {
+            var testedSymbol = testedNode && getSymbolAtLocation(testedNode);
+            if (!testedSymbol && !isPromise) {
                 return;
             }
-            var isUsed = ts.isBinaryExpression(condExpr.parent) && isFunctionUsedInBinaryExpressionChain(condExpr.parent, testedSymbol)
-                || body && isFunctionUsedInConditionBody(condExpr, body, testedNode, testedSymbol);
+            var isUsed = testedSymbol && ts.isBinaryExpression(condExpr.parent) && isSymbolUsedInBinaryExpressionChain(condExpr.parent, testedSymbol)
+                || testedSymbol && body && isSymbolUsedInConditionBody(condExpr, body, testedNode, testedSymbol);
             if (!isUsed) {
-                error(location, ts.Diagnostics.This_condition_will_always_return_true_since_the_function_is_always_defined_Did_you_mean_to_call_it_instead);
+                if (isPromise) {
+                    errorAndMaybeSuggestAwait(location, 
+                    /*maybeMissingAwait*/ true, ts.Diagnostics.This_condition_will_always_return_true_since_this_0_is_always_defined, getTypeNameForErrorDisplay(type));
+                }
+                else {
+                    error(location, ts.Diagnostics.This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead);
+                }
             }
         }
-        function isFunctionUsedInConditionBody(expr, body, testedNode, testedSymbol) {
+        function isSymbolUsedInConditionBody(expr, body, testedNode, testedSymbol) {
             return !!ts.forEachChild(body, function check(childNode) {
                 if (ts.isIdentifier(childNode)) {
                     var childSymbol = getSymbolAtLocation(childNode);
@@ -75237,7 +80378,7 @@ var ts;
                         var childExpression = childNode.parent;
                         while (testedExpression && childExpression) {
                             if (ts.isIdentifier(testedExpression) && ts.isIdentifier(childExpression) ||
-                                testedExpression.kind === 107 /* ThisKeyword */ && childExpression.kind === 107 /* ThisKeyword */) {
+                                testedExpression.kind === 108 /* ThisKeyword */ && childExpression.kind === 108 /* ThisKeyword */) {
                                 return getSymbolAtLocation(testedExpression) === getSymbolAtLocation(childExpression);
                             }
                             else if (ts.isPropertyAccessExpression(testedExpression) && ts.isPropertyAccessExpression(childExpression)) {
@@ -75260,7 +80401,7 @@ var ts;
                 return ts.forEachChild(childNode, check);
             });
         }
-        function isFunctionUsedInBinaryExpressionChain(node, testedSymbol) {
+        function isSymbolUsedInBinaryExpressionChain(node, testedSymbol) {
             while (ts.isBinaryExpression(node) && node.operatorToken.kind === 55 /* AmpersandAmpersandToken */) {
                 var isUsed = ts.forEachChild(node.right, function visit(child) {
                     if (ts.isIdentifier(child)) {
@@ -75302,12 +80443,12 @@ var ts;
         function checkForStatement(node) {
             // Grammar checking
             if (!checkGrammarStatementInAmbientContext(node)) {
-                if (node.initializer && node.initializer.kind === 250 /* VariableDeclarationList */) {
+                if (node.initializer && node.initializer.kind === 254 /* VariableDeclarationList */) {
                     checkGrammarVariableDeclarationList(node.initializer);
                 }
             }
             if (node.initializer) {
-                if (node.initializer.kind === 250 /* VariableDeclarationList */) {
+                if (node.initializer.kind === 254 /* VariableDeclarationList */) {
                     ts.forEach(node.initializer.declarations, checkVariableDeclaration);
                 }
                 else {
@@ -75325,11 +80466,17 @@ var ts;
         }
         function checkForOfStatement(node) {
             checkGrammarForInOrForOfStatement(node);
+            var container = ts.getContainingFunctionOrClassStaticBlock(node);
             if (node.awaitModifier) {
-                var functionFlags = ts.getFunctionFlags(ts.getContainingFunction(node));
-                if ((functionFlags & (4 /* Invalid */ | 2 /* Async */)) === 2 /* Async */ && languageVersion < 99 /* ESNext */) {
-                    // for..await..of in an async function or async generator function prior to ESNext requires the __asyncValues helper
-                    checkExternalEmitHelpers(node, 16384 /* ForAwaitOfIncludes */);
+                if (container && ts.isClassStaticBlockDeclaration(container)) {
+                    grammarErrorOnNode(node.awaitModifier, ts.Diagnostics.For_await_loops_cannot_be_used_inside_a_class_static_block);
+                }
+                else {
+                    var functionFlags = ts.getFunctionFlags(container);
+                    if ((functionFlags & (4 /* Invalid */ | 2 /* Async */)) === 2 /* Async */ && languageVersion < 99 /* ESNext */) {
+                        // for..await..of in an async function or async generator function prior to ESNext requires the __asyncValues helper
+                        checkExternalEmitHelpers(node, 16384 /* ForAwaitOfIncludes */);
+                    }
                 }
             }
             else if (compilerOptions.downlevelIteration && languageVersion < 2 /* ES2015 */) {
@@ -75341,14 +80488,14 @@ var ts;
             // via checkRightHandSideOfForOf.
             // If the LHS is an expression, check the LHS, as a destructuring assignment or as a reference.
             // Then check that the RHS is assignable to it.
-            if (node.initializer.kind === 250 /* VariableDeclarationList */) {
+            if (node.initializer.kind === 254 /* VariableDeclarationList */) {
                 checkForInOrForOfVariableDeclaration(node);
             }
             else {
                 var varExpr = node.initializer;
                 var iteratedType = checkRightHandSideOfForOf(node);
                 // There may be a destructuring assignment on the left side
-                if (varExpr.kind === 199 /* ArrayLiteralExpression */ || varExpr.kind === 200 /* ObjectLiteralExpression */) {
+                if (varExpr.kind === 203 /* ArrayLiteralExpression */ || varExpr.kind === 204 /* ObjectLiteralExpression */) {
                     // iteratedType may be undefined. In this case, we still want to check the structure of
                     // varExpr, in particular making sure it's a valid LeftHandSideExpression. But we'd like
                     // to short circuit the type relation checking as much as possible, so we pass the unknownType.
@@ -75380,7 +80527,7 @@ var ts;
             // for (let VarDecl in Expr) Statement
             //   VarDecl must be a variable declaration without a type annotation that declares a variable of type Any,
             //   and Expr must be an expression of type Any, an object type, or a type parameter type.
-            if (node.initializer.kind === 250 /* VariableDeclarationList */) {
+            if (node.initializer.kind === 254 /* VariableDeclarationList */) {
                 var variable = node.initializer.declarations[0];
                 if (variable && ts.isBindingPattern(variable.name)) {
                     error(variable.name, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern);
@@ -75394,7 +80541,7 @@ var ts;
                 //   and Expr must be an expression of type Any, an object type, or a type parameter type.
                 var varExpr = node.initializer;
                 var leftType = checkExpression(varExpr);
-                if (varExpr.kind === 199 /* ArrayLiteralExpression */ || varExpr.kind === 200 /* ObjectLiteralExpression */) {
+                if (varExpr.kind === 203 /* ArrayLiteralExpression */ || varExpr.kind === 204 /* ObjectLiteralExpression */) {
                     error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern);
                 }
                 else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) {
@@ -75510,23 +80657,13 @@ var ts;
                     // want to say that number is not an array type. But if the input was just
                     // number and string input is allowed, we want to say that number is not an
                     // array type or a string type.
-                    var yieldType = getIterationTypeOfIterable(use, 0 /* Yield */, inputType, /*errorNode*/ undefined);
-                    var _a = !(use & 4 /* AllowsStringInputFlag */) || hasStringConstituent
-                        ? downlevelIteration
-                            ? [ts.Diagnostics.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator, true]
-                            : yieldType
-                                ? [ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators, false]
-                                : [ts.Diagnostics.Type_0_is_not_an_array_type, true]
-                        : downlevelIteration
-                            ? [ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator, true]
-                            : yieldType
-                                ? [ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators, false]
-                                : [ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type, true], defaultDiagnostic = _a[0], maybeMissingAwait = _a[1];
+                    var allowsStrings = !!(use & 4 /* AllowsStringInputFlag */) && !hasStringConstituent;
+                    var _a = getIterationDiagnosticDetails(allowsStrings, downlevelIteration), defaultDiagnostic = _a[0], maybeMissingAwait = _a[1];
                     errorAndMaybeSuggestAwait(errorNode, maybeMissingAwait && !!getAwaitedTypeOfPromise(arrayType), defaultDiagnostic, typeToString(arrayType));
                 }
                 return hasStringConstituent ? possibleOutOfBounds ? includeUndefinedInIndexSignature(stringType) : stringType : undefined;
             }
-            var arrayElementType = getIndexTypeOfType(arrayType, 1 /* Number */);
+            var arrayElementType = getIndexTypeOfType(arrayType, numberType);
             if (hasStringConstituent && arrayElementType) {
                 // This is just an optimization for the case where arrayOrStringType is string | string[]
                 if (arrayElementType.flags & 402653316 /* StringLike */ && !compilerOptions.noUncheckedIndexedAccess) {
@@ -75535,6 +80672,40 @@ var ts;
                 return getUnionType(possibleOutOfBounds ? [arrayElementType, stringType, undefinedType] : [arrayElementType, stringType], 2 /* Subtype */);
             }
             return (use & 128 /* PossiblyOutOfBounds */) ? includeUndefinedInIndexSignature(arrayElementType) : arrayElementType;
+            function getIterationDiagnosticDetails(allowsStrings, downlevelIteration) {
+                var _a;
+                if (downlevelIteration) {
+                    return allowsStrings
+                        ? [ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator, true]
+                        : [ts.Diagnostics.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator, true];
+                }
+                var yieldType = getIterationTypeOfIterable(use, 0 /* Yield */, inputType, /*errorNode*/ undefined);
+                if (yieldType) {
+                    return [ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators, false];
+                }
+                if (isES2015OrLaterIterable((_a = inputType.symbol) === null || _a === void 0 ? void 0 : _a.escapedName)) {
+                    return [ts.Diagnostics.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher, true];
+                }
+                return allowsStrings
+                    ? [ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type, true]
+                    : [ts.Diagnostics.Type_0_is_not_an_array_type, true];
+            }
+        }
+        function isES2015OrLaterIterable(n) {
+            switch (n) {
+                case "Float32Array":
+                case "Float64Array":
+                case "Int16Array":
+                case "Int32Array":
+                case "Int8Array":
+                case "NodeList":
+                case "Uint16Array":
+                case "Uint32Array":
+                case "Uint8Array":
+                case "Uint8ClampedArray":
+                    return true;
+            }
+            return false;
         }
         /**
          * Gets the requested "iteration type" from an `Iterable`-like or `AsyncIterable`-like type.
@@ -75581,8 +80752,8 @@ var ts;
             var yieldTypes;
             var returnTypes;
             var nextTypes;
-            for (var _i = 0, array_10 = array; _i < array_10.length; _i++) {
-                var iterationTypes = array_10[_i];
+            for (var _i = 0, array_11 = array; _i < array_11.length; _i++) {
+                var iterationTypes = array_11[_i];
                 if (iterationTypes === undefined || iterationTypes === noIterationTypes) {
                     continue;
                 }
@@ -75668,6 +80839,10 @@ var ts;
             if (iterationTypes === anyIterationTypes)
                 return anyIterationTypes;
             var yieldType = iterationTypes.yieldType, returnType = iterationTypes.returnType, nextType = iterationTypes.nextType;
+            // if we're requesting diagnostics, report errors for a missing `Awaited<T>`.
+            if (errorNode) {
+                getGlobalAwaitedSymbol(/*reportErrors*/ true);
+            }
             return createIterationTypes(getAwaitedType(yieldType, errorNode) || anyType, getAwaitedType(returnType, errorNode) || anyType, nextType);
         }
         /**
@@ -75688,7 +80863,9 @@ var ts;
                 var iterationTypes = getIterationTypesOfIterableCached(type, asyncIterationTypesResolver) ||
                     getIterationTypesOfIterableFast(type, asyncIterationTypesResolver);
                 if (iterationTypes) {
-                    return iterationTypes;
+                    return use & 8 /* ForOfFlag */ ?
+                        getAsyncFromSyncIterationTypes(iterationTypes, errorNode) :
+                        iterationTypes;
                 }
             }
             if (use & 1 /* AllowsSyncIterablesFlag */) {
@@ -75768,16 +80945,21 @@ var ts;
                 // While we define these as `any` and `undefined` in our libs by default, a custom lib *could* use
                 // different definitions.
                 var _a = getIterationTypesOfGlobalIterableType(globalType, resolver), returnType = _a.returnType, nextType = _a.nextType;
-                return setCachedIterationTypes(type, resolver.iterableCacheKey, createIterationTypes(yieldType, returnType, nextType));
+                return setCachedIterationTypes(type, resolver.iterableCacheKey, createIterationTypes(resolver.resolveIterationType(yieldType, /*errorNode*/ undefined) || yieldType, resolver.resolveIterationType(returnType, /*errorNode*/ undefined) || returnType, nextType));
             }
             // As an optimization, if the type is an instantiation of the following global type, then
             // just grab its related type arguments:
             // - `Generator<T, TReturn, TNext>` or `AsyncGenerator<T, TReturn, TNext>`
             if (isReferenceToType(type, resolver.getGlobalGeneratorType(/*reportErrors*/ false))) {
                 var _b = getTypeArguments(type), yieldType = _b[0], returnType = _b[1], nextType = _b[2];
-                return setCachedIterationTypes(type, resolver.iterableCacheKey, createIterationTypes(yieldType, returnType, nextType));
+                return setCachedIterationTypes(type, resolver.iterableCacheKey, createIterationTypes(resolver.resolveIterationType(yieldType, /*errorNode*/ undefined) || yieldType, resolver.resolveIterationType(returnType, /*errorNode*/ undefined) || returnType, nextType));
             }
         }
+        function getPropertyNameForKnownSymbolName(symbolName) {
+            var ctorType = getGlobalESSymbolConstructorSymbol(/*reportErrors*/ false);
+            var uniqueType = ctorType && getTypeOfPropertyOfType(getTypeOfSymbol(ctorType), ts.escapeLeadingUnderscores(symbolName));
+            return uniqueType && isTypeUsableAsPropertyName(uniqueType) ? getPropertyNameFromType(uniqueType) : "__@".concat(symbolName);
+        }
         /**
          * Gets the *yield*, *return*, and *next* types of an `Iterable`-like or `AsyncIterable`-like
          * type from its members.
@@ -75790,7 +80972,7 @@ var ts;
          */
         function getIterationTypesOfIterableSlow(type, resolver, errorNode) {
             var _a;
-            var method = getPropertyOfType(type, ts.getPropertyNameForKnownSymbolName(resolver.iteratorSymbolName));
+            var method = getPropertyOfType(type, getPropertyNameForKnownSymbolName(resolver.iteratorSymbolName));
             var methodType = method && !(method.flags & 16777216 /* Optional */) ? getTypeOfSymbol(method) : undefined;
             if (isTypeAny(methodType)) {
                 return setCachedIterationTypes(type, resolver.iterableCacheKey, anyIterationTypes);
@@ -76062,11 +81244,10 @@ var ts;
             // TODO: Check that target label is valid
         }
         function unwrapReturnType(returnType, functionFlags) {
-            var _a, _b;
             var isGenerator = !!(functionFlags & 1 /* Generator */);
             var isAsync = !!(functionFlags & 2 /* Async */);
-            return isGenerator ? (_a = getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, returnType, isAsync)) !== null && _a !== void 0 ? _a : errorType :
-                isAsync ? (_b = getAwaitedType(returnType)) !== null && _b !== void 0 ? _b : errorType :
+            return isGenerator ? getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, returnType, isAsync) || errorType :
+                isAsync ? getAwaitedTypeNoAlias(returnType) || errorType :
                     returnType;
         }
         function isUnwrappedReturnTypeVoidOrAny(func, returnType) {
@@ -76079,30 +81260,34 @@ var ts;
             if (checkGrammarStatementInAmbientContext(node)) {
                 return;
             }
-            var func = ts.getContainingFunction(node);
-            if (!func) {
+            var container = ts.getContainingFunctionOrClassStaticBlock(node);
+            if (container && ts.isClassStaticBlockDeclaration(container)) {
+                grammarErrorOnFirstToken(node, ts.Diagnostics.A_return_statement_cannot_be_used_inside_a_class_static_block);
+                return;
+            }
+            if (!container) {
                 grammarErrorOnFirstToken(node, ts.Diagnostics.A_return_statement_can_only_be_used_within_a_function_body);
                 return;
             }
-            var signature = getSignatureFromDeclaration(func);
+            var signature = getSignatureFromDeclaration(container);
             var returnType = getReturnTypeOfSignature(signature);
-            var functionFlags = ts.getFunctionFlags(func);
+            var functionFlags = ts.getFunctionFlags(container);
             if (strictNullChecks || node.expression || returnType.flags & 131072 /* Never */) {
                 var exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType;
-                if (func.kind === 168 /* SetAccessor */) {
+                if (container.kind === 172 /* SetAccessor */) {
                     if (node.expression) {
                         error(node, ts.Diagnostics.Setters_cannot_return_a_value);
                     }
                 }
-                else if (func.kind === 166 /* Constructor */) {
+                else if (container.kind === 170 /* Constructor */) {
                     if (node.expression && !checkTypeAssignableToAndOptionallyElaborate(exprType, returnType, node, node.expression)) {
                         error(node, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class);
                     }
                 }
-                else if (getReturnTypeFromAnnotation(func)) {
+                else if (getReturnTypeFromAnnotation(container)) {
                     var unwrappedReturnType = (_a = unwrapReturnType(returnType, functionFlags)) !== null && _a !== void 0 ? _a : returnType;
                     var unwrappedExprType = functionFlags & 2 /* Async */
-                        ? checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member)
+                        ? checkAwaitedType(exprType, /*withAlias*/ false, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member)
                         : exprType;
                     if (unwrappedReturnType) {
                         // If the function has a return type, but promisedType is
@@ -76112,7 +81297,7 @@ var ts;
                     }
                 }
             }
-            else if (func.kind !== 166 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) {
+            else if (container.kind !== 170 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(container, returnType)) {
                 // The function has a return type, but the return statement doesn't have an expression.
                 error(node, ts.Diagnostics.Not_all_code_paths_return_a_value);
             }
@@ -76141,7 +81326,7 @@ var ts;
             var expressionIsLiteral = isLiteralType(expressionType);
             ts.forEach(node.caseBlock.clauses, function (clause) {
                 // Grammar check for duplicate default clauses, skip if we already report duplicate default clause
-                if (clause.kind === 285 /* DefaultClause */ && !hasDuplicateDefaultClause) {
+                if (clause.kind === 289 /* DefaultClause */ && !hasDuplicateDefaultClause) {
                     if (firstDefaultClause === undefined) {
                         firstDefaultClause = clause;
                     }
@@ -76150,7 +81335,7 @@ var ts;
                         hasDuplicateDefaultClause = true;
                     }
                 }
-                if (produceDiagnostics && clause.kind === 284 /* CaseClause */) {
+                if (produceDiagnostics && clause.kind === 288 /* CaseClause */) {
                     // TypeScript 1.0 spec (April 2014): 5.9
                     // In a 'switch' statement, each 'case' expression must be of a type that is comparable
                     // to or from the type of the 'switch' expression.
@@ -76182,7 +81367,7 @@ var ts;
                     if (ts.isFunctionLike(current)) {
                         return "quit";
                     }
-                    if (current.kind === 245 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) {
+                    if (current.kind === 249 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) {
                         grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNode(node.label));
                         return true;
                     }
@@ -76212,10 +81397,11 @@ var ts;
                 // Grammar checking
                 if (catchClause.variableDeclaration) {
                     var declaration = catchClause.variableDeclaration;
-                    if (declaration.type) {
+                    var typeNode = ts.getEffectiveTypeAnnotationNode(ts.getRootDeclaration(declaration));
+                    if (typeNode) {
                         var type = getTypeForVariableLikeDeclaration(declaration, /*includeOptionality*/ false);
                         if (type && !(type.flags & 3 /* AnyOrUnknown */)) {
-                            grammarErrorOnFirstToken(declaration.type, ts.Diagnostics.Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified);
+                            grammarErrorOnFirstToken(typeNode, ts.Diagnostics.Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified);
                         }
                     }
                     else if (declaration.initializer) {
@@ -76226,7 +81412,7 @@ var ts;
                         if (blockLocals_1) {
                             ts.forEachKey(catchClause.locals, function (caughtName) {
                                 var blockLocal = blockLocals_1.get(caughtName);
-                                if (blockLocal && (blockLocal.flags & 2 /* BlockScopedVariable */) !== 0) {
+                                if ((blockLocal === null || blockLocal === void 0 ? void 0 : blockLocal.valueDeclaration) && (blockLocal.flags & 2 /* BlockScopedVariable */) !== 0) {
                                     grammarErrorOnNode(blockLocal.valueDeclaration, ts.Diagnostics.Cannot_redeclare_identifier_0_in_catch_clause, caughtName);
                                 }
                             });
@@ -76239,84 +81425,83 @@ var ts;
                 checkBlock(node.finallyBlock);
             }
         }
-        function checkIndexConstraints(type) {
-            var declaredNumberIndexer = getIndexDeclarationOfSymbol(type.symbol, 1 /* Number */);
-            var declaredStringIndexer = getIndexDeclarationOfSymbol(type.symbol, 0 /* String */);
-            var stringIndexType = getIndexTypeOfType(type, 0 /* String */);
-            var numberIndexType = getIndexTypeOfType(type, 1 /* Number */);
-            if (stringIndexType || numberIndexType) {
-                ts.forEach(getPropertiesOfObjectType(type), function (prop) {
-                    var propType = getTypeOfSymbol(prop);
-                    checkIndexConstraintForProperty(prop, propType, type, declaredStringIndexer, stringIndexType, 0 /* String */);
-                    checkIndexConstraintForProperty(prop, propType, type, declaredNumberIndexer, numberIndexType, 1 /* Number */);
-                });
-                var classDeclaration = type.symbol.valueDeclaration;
-                if (ts.getObjectFlags(type) & 1 /* Class */ && ts.isClassLike(classDeclaration)) {
-                    for (var _i = 0, _a = classDeclaration.members; _i < _a.length; _i++) {
-                        var member = _a[_i];
-                        // Only process instance properties with computed names here.
-                        // Static properties cannot be in conflict with indexers,
-                        // and properties with literal names were already checked.
-                        if (!ts.hasSyntacticModifier(member, 32 /* Static */) && !hasBindableName(member)) {
-                            var symbol = getSymbolOfNode(member);
-                            var propType = getTypeOfSymbol(symbol);
-                            checkIndexConstraintForProperty(symbol, propType, type, declaredStringIndexer, stringIndexType, 0 /* String */);
-                            checkIndexConstraintForProperty(symbol, propType, type, declaredNumberIndexer, numberIndexType, 1 /* Number */);
-                        }
+        function checkIndexConstraints(type, symbol, isStaticIndex) {
+            var indexInfos = getIndexInfosOfType(type);
+            if (indexInfos.length === 0) {
+                return;
+            }
+            for (var _i = 0, _a = getPropertiesOfObjectType(type); _i < _a.length; _i++) {
+                var prop = _a[_i];
+                if (!(isStaticIndex && prop.flags & 4194304 /* Prototype */)) {
+                    checkIndexConstraintForProperty(type, prop, getLiteralTypeFromProperty(prop, 8576 /* StringOrNumberLiteralOrUnique */, /*includeNonPublic*/ true), getNonMissingTypeOfSymbol(prop));
+                }
+            }
+            var typeDeclaration = symbol.valueDeclaration;
+            if (typeDeclaration && ts.isClassLike(typeDeclaration)) {
+                for (var _b = 0, _c = typeDeclaration.members; _b < _c.length; _b++) {
+                    var member = _c[_b];
+                    // Only process instance properties with computed names here. Static properties cannot be in conflict with indexers,
+                    // and properties with literal names were already checked.
+                    if (!ts.isStatic(member) && !hasBindableName(member)) {
+                        var symbol_3 = getSymbolOfNode(member);
+                        checkIndexConstraintForProperty(type, symbol_3, getTypeOfExpression(member.name.expression), getNonMissingTypeOfSymbol(symbol_3));
                     }
                 }
             }
-            var errorNode;
-            if (stringIndexType && numberIndexType) {
-                errorNode = declaredNumberIndexer || declaredStringIndexer;
-                // condition 'errorNode === undefined' may appear if types does not declare nor string neither number indexer
-                if (!errorNode && (ts.getObjectFlags(type) & 2 /* Interface */)) {
-                    var someBaseTypeHasBothIndexers = ts.forEach(getBaseTypes(type), function (base) { return getIndexTypeOfType(base, 0 /* String */) && getIndexTypeOfType(base, 1 /* Number */); });
-                    errorNode = someBaseTypeHasBothIndexers ? undefined : type.symbol.declarations[0];
+            if (indexInfos.length > 1) {
+                for (var _d = 0, indexInfos_6 = indexInfos; _d < indexInfos_6.length; _d++) {
+                    var info = indexInfos_6[_d];
+                    checkIndexConstraintForIndexSignature(type, info);
                 }
             }
-            if (errorNode && !isTypeAssignableTo(numberIndexType, stringIndexType)) { // TODO: GH#18217
-                error(errorNode, ts.Diagnostics.Numeric_index_type_0_is_not_assignable_to_string_index_type_1, typeToString(numberIndexType), typeToString(stringIndexType));
+        }
+        function checkIndexConstraintForProperty(type, prop, propNameType, propType) {
+            var declaration = prop.valueDeclaration;
+            var name = ts.getNameOfDeclaration(declaration);
+            if (name && ts.isPrivateIdentifier(name)) {
+                return;
             }
-            function checkIndexConstraintForProperty(prop, propertyType, containingType, indexDeclaration, indexType, indexKind) {
-                // ESSymbol properties apply to neither string nor numeric indexers.
-                if (!indexType || ts.isKnownSymbol(prop)) {
-                    return;
-                }
-                var propDeclaration = prop.valueDeclaration;
-                var name = propDeclaration && ts.getNameOfDeclaration(propDeclaration);
-                if (name && ts.isPrivateIdentifier(name)) {
-                    return;
-                }
-                // index is numeric and property name is not valid numeric literal
-                if (indexKind === 1 /* Number */ && !(name ? isNumericName(name) : isNumericLiteralName(prop.escapedName))) {
-                    return;
-                }
-                // perform property check if property or indexer is declared in 'type'
-                // this allows us to rule out cases when both property and indexer are inherited from the base class
-                var errorNode;
-                if (propDeclaration && name &&
-                    (propDeclaration.kind === 216 /* BinaryExpression */ ||
-                        name.kind === 158 /* ComputedPropertyName */ ||
-                        prop.parent === containingType.symbol)) {
-                    errorNode = propDeclaration;
-                }
-                else if (indexDeclaration) {
-                    errorNode = indexDeclaration;
+            var indexInfos = getApplicableIndexInfos(type, propNameType);
+            var interfaceDeclaration = ts.getObjectFlags(type) & 2 /* Interface */ ? ts.getDeclarationOfKind(type.symbol, 257 /* InterfaceDeclaration */) : undefined;
+            var localPropDeclaration = declaration && declaration.kind === 220 /* BinaryExpression */ ||
+                name && name.kind === 161 /* ComputedPropertyName */ || getParentOfSymbol(prop) === type.symbol ? declaration : undefined;
+            var _loop_27 = function (info) {
+                var localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : undefined;
+                // We check only when (a) the property is declared in the containing type, or (b) the applicable index signature is declared
+                // in the containing type, or (c) the containing type is an interface and no base interface contains both the property and
+                // the index signature (i.e. property and index signature are declared in separate inherited interfaces).
+                var errorNode = localPropDeclaration || localIndexDeclaration ||
+                    (interfaceDeclaration && !ts.some(getBaseTypes(type), function (base) { return !!getPropertyOfObjectType(base, prop.escapedName) && !!getIndexTypeOfType(base, info.keyType); }) ? interfaceDeclaration : undefined);
+                if (errorNode && !isTypeAssignableTo(propType, info.type)) {
+                    error(errorNode, ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_2_index_type_3, symbolToString(prop), typeToString(propType), typeToString(info.keyType), typeToString(info.type));
                 }
-                else if (ts.getObjectFlags(containingType) & 2 /* Interface */) {
-                    // for interfaces property and indexer might be inherited from different bases
-                    // check if any base class already has both property and indexer.
-                    // check should be performed only if 'type' is the first type that brings property\indexer together
-                    var someBaseClassHasBothPropertyAndIndexer = ts.forEach(getBaseTypes(containingType), function (base) { return getPropertyOfObjectType(base, prop.escapedName) && getIndexTypeOfType(base, indexKind); });
-                    errorNode = someBaseClassHasBothPropertyAndIndexer ? undefined : containingType.symbol.declarations[0];
-                }
-                if (errorNode && !isTypeAssignableTo(propertyType, indexType)) {
-                    var errorMessage = indexKind === 0 /* String */
-                        ? ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_string_index_type_2
-                        : ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2;
-                    error(errorNode, errorMessage, symbolToString(prop), typeToString(propertyType), typeToString(indexType));
+            };
+            for (var _i = 0, indexInfos_7 = indexInfos; _i < indexInfos_7.length; _i++) {
+                var info = indexInfos_7[_i];
+                _loop_27(info);
+            }
+        }
+        function checkIndexConstraintForIndexSignature(type, checkInfo) {
+            var declaration = checkInfo.declaration;
+            var indexInfos = getApplicableIndexInfos(type, checkInfo.keyType);
+            var interfaceDeclaration = ts.getObjectFlags(type) & 2 /* Interface */ ? ts.getDeclarationOfKind(type.symbol, 257 /* InterfaceDeclaration */) : undefined;
+            var localCheckDeclaration = declaration && getParentOfSymbol(getSymbolOfNode(declaration)) === type.symbol ? declaration : undefined;
+            var _loop_28 = function (info) {
+                if (info === checkInfo)
+                    return "continue";
+                var localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : undefined;
+                // We check only when (a) the check index signature is declared in the containing type, or (b) the applicable index
+                // signature is declared in the containing type, or (c) the containing type is an interface and no base interface contains
+                // both index signatures (i.e. the index signatures are declared in separate inherited interfaces).
+                var errorNode = localCheckDeclaration || localIndexDeclaration ||
+                    (interfaceDeclaration && !ts.some(getBaseTypes(type), function (base) { return !!getIndexInfoOfType(base, checkInfo.keyType) && !!getIndexTypeOfType(base, info.keyType); }) ? interfaceDeclaration : undefined);
+                if (errorNode && !isTypeAssignableTo(checkInfo.type, info.type)) {
+                    error(errorNode, ts.Diagnostics._0_index_type_1_is_not_assignable_to_2_index_type_3, typeToString(checkInfo.keyType), typeToString(checkInfo.type), typeToString(info.keyType), typeToString(info.type));
                 }
+            };
+            for (var _i = 0, indexInfos_8 = indexInfos; _i < indexInfos_8.length; _i++) {
+                var info = indexInfos_8[_i];
+                _loop_28(info);
             }
         }
         function checkTypeNameIsReserved(name, message) {
@@ -76325,6 +81510,7 @@ var ts;
             switch (name.escapedText) {
                 case "any":
                 case "unknown":
+                case "never":
                 case "number":
                 case "bigint":
                 case "boolean":
@@ -76339,8 +81525,8 @@ var ts;
          * The name cannot be used as 'Object' of user defined types with special target.
          */
         function checkClassNameCollisionWithObject(name) {
-            if (languageVersion === 1 /* ES5 */ && name.escapedText === "Object"
-                && moduleKind < ts.ModuleKind.ES2015) {
+            if (languageVersion >= 1 /* ES5 */ && name.escapedText === "Object"
+                && (moduleKind < ts.ModuleKind.ES2015 || ts.getSourceFileOfNode(name).impliedNodeFormat === ts.ModuleKind.CommonJS)) {
                 error(name, ts.Diagnostics.Class_name_cannot_be_Object_when_targeting_ES5_with_module_0, ts.ModuleKind[moduleKind]); // https://github.com/Microsoft/TypeScript/issues/17494
             }
         }
@@ -76374,7 +81560,7 @@ var ts;
         function checkTypeParametersNotReferenced(root, typeParameters, index) {
             visit(root);
             function visit(node) {
-                if (node.kind === 173 /* TypeReference */) {
+                if (node.kind === 177 /* TypeReference */) {
                     var type = getTypeFromTypeReference(node);
                     if (type.flags & 262144 /* TypeParameter */) {
                         for (var i = index; i < typeParameters.length; i++) {
@@ -76389,14 +81575,14 @@ var ts;
         }
         /** Check that type parameter lists are identical across multiple declarations */
         function checkTypeParameterListsIdentical(symbol) {
-            if (symbol.declarations.length === 1) {
+            if (symbol.declarations && symbol.declarations.length === 1) {
                 return;
             }
             var links = getSymbolLinks(symbol);
             if (!links.typeParametersChecked) {
                 links.typeParametersChecked = true;
                 var declarations = getClassOrInterfaceDeclarationsOfSymbol(symbol);
-                if (declarations.length <= 1) {
+                if (!declarations || declarations.length <= 1) {
                     return;
                 }
                 var type = getDeclaredTypeOfSymbol(symbol);
@@ -76460,6 +81646,9 @@ var ts;
             registerForUnusedIdentifiersCheck(node);
         }
         function checkClassDeclaration(node) {
+            if (ts.some(node.decorators) && ts.some(node.members, function (p) { return ts.hasStaticModifier(p) && ts.isPrivateIdentifierClassElementDeclaration(p); })) {
+                grammarErrorOnNode(node.decorators[0], ts.Diagnostics.Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator);
+            }
             if (!node.name && !ts.hasSyntacticModifier(node, 512 /* Default */)) {
                 grammarErrorOnFirstToken(node, ts.Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name);
             }
@@ -76470,14 +81659,7 @@ var ts;
         function checkClassLikeDeclaration(node) {
             checkGrammarClassLikeDeclaration(node);
             checkDecorators(node);
-            if (node.name) {
-                checkTypeNameIsReserved(node.name, ts.Diagnostics.Class_name_cannot_be_0);
-                checkCollisionWithRequireExportsInGeneratedCode(node, node.name);
-                checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name);
-                if (!(node.flags & 8388608 /* Ambient */)) {
-                    checkClassNameCollisionWithObject(node.name);
-                }
-            }
+            checkCollisionsForDeclarationName(node, node.name);
             checkTypeParameters(ts.getEffectiveTypeParameterDeclarations(node));
             checkExportsOnMergedDeclarations(node);
             var symbol = getSymbolOfNode(node);
@@ -76488,7 +81670,8 @@ var ts;
             checkFunctionOrConstructorSymbol(symbol);
             checkClassForDuplicateDeclarations(node);
             // Only check for reserved static identifiers on non-ambient context.
-            if (!(node.flags & 8388608 /* Ambient */)) {
+            var nodeInAmbientContext = !!(node.flags & 8388608 /* Ambient */);
+            if (!nodeInAmbientContext) {
                 checkClassForStaticPropertyNameConflicts(node);
             }
             var baseTypeNode = ts.getEffectiveBaseTypeNode(node);
@@ -76548,6 +81731,7 @@ var ts;
                     checkKindsOfPropertyMemberOverrides(type, baseType_1);
                 }
             }
+            checkMembersForOverrideModifier(node, type, typeWithThis, staticType);
             var implementedTypeNodes = ts.getEffectiveImplementsTypeNodes(node);
             if (implementedTypeNodes) {
                 for (var _b = 0, implementedTypeNodes_1 = implementedTypeNodes; _b < implementedTypeNodes_1.length; _b++) {
@@ -76558,7 +81742,7 @@ var ts;
                     checkTypeReferenceNode(typeRefNode);
                     if (produceDiagnostics) {
                         var t = getReducedType(getTypeFromTypeNode(typeRefNode));
-                        if (t !== errorType) {
+                        if (!isErrorType(t)) {
                             if (isValidBaseType(t)) {
                                 var genericDiag = t.symbol && t.symbol.flags & 32 /* Class */ ?
                                     ts.Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass :
@@ -76576,16 +81760,124 @@ var ts;
                 }
             }
             if (produceDiagnostics) {
-                checkIndexConstraints(type);
+                checkIndexConstraints(type, symbol);
+                checkIndexConstraints(staticType, symbol, /*isStaticIndex*/ true);
                 checkTypeForDuplicateIndexSignatures(node);
                 checkPropertyInitialization(node);
             }
         }
+        function checkMembersForOverrideModifier(node, type, typeWithThis, staticType) {
+            var baseTypeNode = ts.getEffectiveBaseTypeNode(node);
+            var baseTypes = baseTypeNode && getBaseTypes(type);
+            var baseWithThis = (baseTypes === null || baseTypes === void 0 ? void 0 : baseTypes.length) ? getTypeWithThisArgument(ts.first(baseTypes), type.thisType) : undefined;
+            var baseStaticType = getBaseConstructorTypeOfClass(type);
+            var _loop_29 = function (member) {
+                if (ts.hasAmbientModifier(member)) {
+                    return "continue";
+                }
+                if (ts.isConstructorDeclaration(member)) {
+                    ts.forEach(member.parameters, function (param) {
+                        if (ts.isParameterPropertyDeclaration(param, member)) {
+                            checkExistingMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, param, 
+                            /* memberIsParameterProperty */ true);
+                        }
+                    });
+                }
+                checkExistingMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, member, 
+                /* memberIsParameterProperty */ false);
+            };
+            for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
+                var member = _a[_i];
+                _loop_29(member);
+            }
+        }
+        /**
+         * @param member Existing member node to be checked.
+         * Note: `member` cannot be a synthetic node.
+         */
+        function checkExistingMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, member, memberIsParameterProperty, reportErrors) {
+            if (reportErrors === void 0) { reportErrors = true; }
+            var declaredProp = member.name
+                && getSymbolAtLocation(member.name)
+                || getSymbolAtLocation(member);
+            if (!declaredProp) {
+                return 0 /* Ok */;
+            }
+            return checkMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, ts.hasOverrideModifier(member), ts.hasAbstractModifier(member), ts.isStatic(member), memberIsParameterProperty, ts.symbolName(declaredProp), reportErrors ? member : undefined);
+        }
+        /**
+         * Checks a class member declaration for either a missing or an invalid `override` modifier.
+         * Note: this function can be used for speculative checking,
+         * i.e. checking a member that does not yet exist in the program.
+         * An example of that would be to call this function in a completions scenario,
+         * when offering a method declaration as completion.
+         * @param errorNode The node where we should report an error, or undefined if we should not report errors.
+         */
+        function checkMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, memberHasOverrideModifier, memberHasAbstractModifier, memberIsStatic, memberIsParameterProperty, memberName, errorNode) {
+            var isJs = ts.isInJSFile(node);
+            var nodeInAmbientContext = !!(node.flags & 8388608 /* Ambient */);
+            if (baseWithThis && (memberHasOverrideModifier || compilerOptions.noImplicitOverride)) {
+                var memberEscapedName = ts.escapeLeadingUnderscores(memberName);
+                var thisType = memberIsStatic ? staticType : typeWithThis;
+                var baseType = memberIsStatic ? baseStaticType : baseWithThis;
+                var prop = getPropertyOfType(thisType, memberEscapedName);
+                var baseProp = getPropertyOfType(baseType, memberEscapedName);
+                var baseClassName = typeToString(baseWithThis);
+                if (prop && !baseProp && memberHasOverrideModifier) {
+                    if (errorNode) {
+                        var suggestion = getSuggestedSymbolForNonexistentClassMember(memberName, baseType); // Again, using symbol name: note that's different from `symbol.escapedName`
+                        suggestion ?
+                            error(errorNode, isJs ?
+                                ts.Diagnostics.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 :
+                                ts.Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1, baseClassName, symbolToString(suggestion)) :
+                            error(errorNode, isJs ?
+                                ts.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0 :
+                                ts.Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0, baseClassName);
+                    }
+                    return 2 /* HasInvalidOverride */;
+                }
+                else if (prop && (baseProp === null || baseProp === void 0 ? void 0 : baseProp.declarations) && compilerOptions.noImplicitOverride && !nodeInAmbientContext) {
+                    var baseHasAbstract = ts.some(baseProp.declarations, ts.hasAbstractModifier);
+                    if (memberHasOverrideModifier) {
+                        return 0 /* Ok */;
+                    }
+                    if (!baseHasAbstract) {
+                        if (errorNode) {
+                            var diag = memberIsParameterProperty ?
+                                isJs ?
+                                    ts.Diagnostics.This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0 :
+                                    ts.Diagnostics.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0 :
+                                isJs ?
+                                    ts.Diagnostics.This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0 :
+                                    ts.Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0;
+                            error(errorNode, diag, baseClassName);
+                        }
+                        return 1 /* NeedsOverride */;
+                    }
+                    else if (memberHasAbstractModifier && baseHasAbstract) {
+                        if (errorNode) {
+                            error(errorNode, ts.Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0, baseClassName);
+                        }
+                        return 1 /* NeedsOverride */;
+                    }
+                }
+            }
+            else if (memberHasOverrideModifier) {
+                if (errorNode) {
+                    var className = typeToString(type);
+                    error(errorNode, isJs ?
+                        ts.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class :
+                        ts.Diagnostics.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class, className);
+                }
+                return 2 /* HasInvalidOverride */;
+            }
+            return 0 /* Ok */;
+        }
         function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) {
             // iterate over all implemented properties and issue errors on each one which isn't compatible, rather than the class as a whole, if possible
             var issuedMemberError = false;
-            var _loop_23 = function (member) {
-                if (ts.hasStaticModifier(member)) {
+            var _loop_30 = function (member) {
+                if (ts.isStatic(member)) {
                     return "continue";
                 }
                 var declaredProp = member.name && getSymbolAtLocation(member.name) || getSymbolAtLocation(member);
@@ -76603,7 +81895,7 @@ var ts;
             };
             for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
                 var member = _a[_i];
-                _loop_23(member);
+                _loop_30(member);
             }
             if (!issuedMemberError) {
                 // check again with diagnostics to generate a less-specific error
@@ -76622,6 +81914,31 @@ var ts;
                 }
             }
         }
+        /**
+         * Checks a member declaration node to see if has a missing or invalid `override` modifier.
+         * @param node Class-like node where the member is declared.
+         * @param member Member declaration node.
+         * Note: `member` can be a synthetic node without a parent.
+         */
+        function getMemberOverrideModifierStatus(node, member) {
+            if (!member.name) {
+                return 0 /* Ok */;
+            }
+            var symbol = getSymbolOfNode(node);
+            var type = getDeclaredTypeOfSymbol(symbol);
+            var typeWithThis = getTypeWithThisArgument(type);
+            var staticType = getTypeOfSymbol(symbol);
+            var baseTypeNode = ts.getEffectiveBaseTypeNode(node);
+            var baseTypes = baseTypeNode && getBaseTypes(type);
+            var baseWithThis = (baseTypes === null || baseTypes === void 0 ? void 0 : baseTypes.length) ? getTypeWithThisArgument(ts.first(baseTypes), type.thisType) : undefined;
+            var baseStaticType = getBaseConstructorTypeOfClass(type);
+            var memberHasOverrideModifier = member.parent
+                ? ts.hasOverrideModifier(member)
+                : ts.hasSyntacticModifier(member, 16384 /* Override */);
+            var memberName = ts.unescapeLeadingUnderscores(ts.getTextOfPropertyName(member.name));
+            return checkMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, memberHasOverrideModifier, ts.hasAbstractModifier(member), ts.isStatic(member), 
+            /* memberIsParameterProperty */ false, memberName);
+        }
         function getTargetSymbol(s) {
             // if symbol is instantiated its flags are not copied from the 'target'
             // so we'll need to get back original 'target' symbol to work with correct set of flags
@@ -76629,7 +81946,7 @@ var ts;
         }
         function getClassOrInterfaceDeclarationsOfSymbol(symbol) {
             return ts.filter(symbol.declarations, function (d) {
-                return d.kind === 252 /* ClassDeclaration */ || d.kind === 253 /* InterfaceDeclaration */;
+                return d.kind === 256 /* ClassDeclaration */ || d.kind === 257 /* InterfaceDeclaration */;
             });
         }
         function checkKindsOfPropertyMemberOverrides(type, baseType) {
@@ -76646,6 +81963,7 @@ var ts;
             // but not by other kinds of members.
             // Base class instance member variables and accessors can be overridden by
             // derived class instance member variables and accessors, but not by other kinds of members.
+            var _a, _b;
             // NOTE: assignability is checked in checkClassDeclaration
             var baseProperties = getPropertiesOfType(baseType);
             basePropertyCheck: for (var _i = 0, baseProperties_1 = baseProperties; _i < baseProperties_1.length; _i++) {
@@ -76674,8 +81992,8 @@ var ts;
                         // Searches other base types for a declaration that would satisfy the inherited abstract member.
                         // (The class may have more than one base type via declaration merging with an interface with the
                         // same name.)
-                        for (var _a = 0, _b = getBaseTypes(type); _a < _b.length; _a++) {
-                            var otherBaseType = _b[_a];
+                        for (var _c = 0, _d = getBaseTypes(type); _c < _d.length; _c++) {
+                            var otherBaseType = _d[_c];
                             if (otherBaseType === baseType)
                                 continue;
                             var baseSymbol_1 = getPropertyOfObjectType(otherBaseType, base.escapedName);
@@ -76684,7 +82002,7 @@ var ts;
                                 continue basePropertyCheck;
                             }
                         }
-                        if (derivedClassDecl.kind === 221 /* ClassExpression */) {
+                        if (derivedClassDecl.kind === 225 /* ClassExpression */) {
                             error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType));
                         }
                         else {
@@ -76705,7 +82023,7 @@ var ts;
                     if (basePropertyFlags && derivedPropertyFlags) {
                         // property/accessor is overridden with property/accessor
                         if (baseDeclarationFlags & 128 /* Abstract */ && !(base.valueDeclaration && ts.isPropertyDeclaration(base.valueDeclaration) && base.valueDeclaration.initializer)
-                            || base.valueDeclaration && base.valueDeclaration.parent.kind === 253 /* InterfaceDeclaration */
+                            || base.valueDeclaration && base.valueDeclaration.parent.kind === 257 /* InterfaceDeclaration */
                             || derived.valueDeclaration && ts.isBinaryExpression(derived.valueDeclaration)) {
                             // when the base property is abstract or from an interface, base/derived flags don't need to match
                             // same when the derived property is from an assignment
@@ -76719,13 +82037,13 @@ var ts;
                                 ts.Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor;
                             error(ts.getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage_1, symbolToString(base), typeToString(baseType), typeToString(type));
                         }
-                        else if (compilerOptions.useDefineForClassFields) {
-                            var uninitialized = ts.find(derived.declarations, function (d) { return d.kind === 163 /* PropertyDeclaration */ && !d.initializer; });
+                        else if (useDefineForClassFields) {
+                            var uninitialized = (_a = derived.declarations) === null || _a === void 0 ? void 0 : _a.find(function (d) { return d.kind === 166 /* PropertyDeclaration */ && !d.initializer; });
                             if (uninitialized
                                 && !(derived.flags & 33554432 /* Transient */)
                                 && !(baseDeclarationFlags & 128 /* Abstract */)
                                 && !(derivedDeclarationFlags & 128 /* Abstract */)
-                                && !derived.declarations.some(function (d) { return !!(d.flags & 8388608 /* Ambient */); })) {
+                                && !((_b = derived.declarations) === null || _b === void 0 ? void 0 : _b.some(function (d) { return !!(d.flags & 8388608 /* Ambient */); }))) {
                                 var constructor = findConstructorDeclaration(ts.getClassLikeDeclarationOfSymbol(type.symbol));
                                 var propName = uninitialized.name;
                                 if (uninitialized.exclamationToken
@@ -76766,7 +82084,9 @@ var ts;
                 return properties;
             }
             var seen = new ts.Map();
-            ts.forEach(properties, function (p) { seen.set(p.escapedName, p); });
+            ts.forEach(properties, function (p) {
+                seen.set(p.escapedName, p);
+            });
             for (var _i = 0, baseTypes_2 = baseTypes; _i < baseTypes_2.length; _i++) {
                 var base = baseTypes_2[_i];
                 var properties_5 = getPropertiesOfType(getTypeWithThisArgument(base, type.thisType));
@@ -76786,7 +82106,9 @@ var ts;
                 return true;
             }
             var seen = new ts.Map();
-            ts.forEach(resolveDeclaredMembers(type).declaredProperties, function (p) { seen.set(p.escapedName, { prop: p, containingType: type }); });
+            ts.forEach(resolveDeclaredMembers(type).declaredProperties, function (p) {
+                seen.set(p.escapedName, { prop: p, containingType: type });
+            });
             var ok = true;
             for (var _i = 0, baseTypes_3 = baseTypes; _i < baseTypes_3.length; _i++) {
                 var base = baseTypes_3[_i];
@@ -76822,7 +82144,7 @@ var ts;
                 if (ts.getEffectiveModifierFlags(member) & 2 /* Ambient */) {
                     continue;
                 }
-                if (isInstancePropertyWithoutInitializer(member)) {
+                if (!ts.isStatic(member) && isPropertyWithoutInitializer(member)) {
                     var propName = member.name;
                     if (ts.isIdentifier(propName) || ts.isPrivateIdentifier(propName)) {
                         var type = getTypeOfSymbol(getSymbolOfNode(member));
@@ -76835,12 +82157,29 @@ var ts;
                 }
             }
         }
-        function isInstancePropertyWithoutInitializer(node) {
-            return node.kind === 163 /* PropertyDeclaration */ &&
-                !ts.hasSyntacticModifier(node, 32 /* Static */ | 128 /* Abstract */) &&
+        function isPropertyWithoutInitializer(node) {
+            return node.kind === 166 /* PropertyDeclaration */ &&
+                !ts.hasAbstractModifier(node) &&
                 !node.exclamationToken &&
                 !node.initializer;
         }
+        function isPropertyInitializedInStaticBlocks(propName, propType, staticBlocks, startPos, endPos) {
+            for (var _i = 0, staticBlocks_2 = staticBlocks; _i < staticBlocks_2.length; _i++) {
+                var staticBlock = staticBlocks_2[_i];
+                // static block must be within the provided range as they are evaluated in document order (unlike constructors)
+                if (staticBlock.pos >= startPos && staticBlock.pos <= endPos) {
+                    var reference = ts.factory.createPropertyAccessExpression(ts.factory.createThis(), propName);
+                    ts.setParent(reference.expression, reference);
+                    ts.setParent(reference, staticBlock);
+                    reference.flowNode = staticBlock.returnFlowNode;
+                    var flowType = getFlowTypeOfReference(reference, propType, getOptionalType(propType));
+                    if (!(getFalsyFlags(flowType) & 32768 /* Undefined */)) {
+                        return true;
+                    }
+                }
+            }
+            return false;
+        }
         function isPropertyInitializedInConstructor(propName, propType, constructor) {
             var reference = ts.factory.createPropertyAccessExpression(ts.factory.createThis(), propName);
             ts.setParent(reference.expression, reference);
@@ -76860,7 +82199,7 @@ var ts;
                 var symbol = getSymbolOfNode(node);
                 checkTypeParameterListsIdentical(symbol);
                 // Only check this symbol once
-                var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 253 /* InterfaceDeclaration */);
+                var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 257 /* InterfaceDeclaration */);
                 if (node === firstInterfaceDecl) {
                     var type = getDeclaredTypeOfSymbol(symbol);
                     var typeWithThis = getTypeWithThisArgument(type);
@@ -76870,7 +82209,7 @@ var ts;
                             var baseType = _a[_i];
                             checkTypeAssignableTo(typeWithThis, getTypeWithThisArgument(baseType, type.thisType), node.name, ts.Diagnostics.Interface_0_incorrectly_extends_interface_1);
                         }
-                        checkIndexConstraints(type);
+                        checkIndexConstraints(type, symbol);
                     }
                 }
                 checkObjectTypeForDuplicateDeclarations(node);
@@ -76893,7 +82232,7 @@ var ts;
             checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_alias_name_cannot_be_0);
             checkExportsOnMergedDeclarations(node);
             checkTypeParameters(node.typeParameters);
-            if (node.type.kind === 136 /* IntrinsicKeyword */) {
+            if (node.type.kind === 138 /* IntrinsicKeyword */) {
                 if (!intrinsicTypeKinds.has(node.name.escapedText) || ts.length(node.typeParameters) !== 1) {
                     error(node.type, ts.Diagnostics.The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types);
                 }
@@ -76922,7 +82261,7 @@ var ts;
             }
             else {
                 var text = ts.getTextOfPropertyName(member.name);
-                if (isNumericLiteralName(text) && !isInfinityOrNaNString(text)) {
+                if (isNumericLiteralName(text) && !ts.isInfinityOrNaNString(text)) {
                     error(member.name, ts.Diagnostics.An_enum_member_cannot_have_a_numeric_name);
                 }
             }
@@ -76979,7 +82318,7 @@ var ts;
             return value;
             function evaluate(expr) {
                 switch (expr.kind) {
-                    case 214 /* PrefixUnaryExpression */:
+                    case 218 /* PrefixUnaryExpression */:
                         var value_2 = evaluate(expr.operand);
                         if (typeof value_2 === "number") {
                             switch (expr.operator) {
@@ -76989,7 +82328,7 @@ var ts;
                             }
                         }
                         break;
-                    case 216 /* BinaryExpression */:
+                    case 220 /* BinaryExpression */:
                         var left = evaluate(expr.left);
                         var right = evaluate(expr.right);
                         if (typeof left === "number" && typeof right === "number") {
@@ -77018,22 +82357,22 @@ var ts;
                     case 8 /* NumericLiteral */:
                         checkGrammarNumericLiteral(expr);
                         return +expr.text;
-                    case 207 /* ParenthesizedExpression */:
+                    case 211 /* ParenthesizedExpression */:
                         return evaluate(expr.expression);
-                    case 78 /* Identifier */:
+                    case 79 /* Identifier */:
                         var identifier = expr;
-                        if (isInfinityOrNaNString(identifier.escapedText)) {
+                        if (ts.isInfinityOrNaNString(identifier.escapedText)) {
                             return +(identifier.escapedText);
                         }
                         return ts.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), identifier.escapedText);
-                    case 202 /* ElementAccessExpression */:
-                    case 201 /* PropertyAccessExpression */:
+                    case 206 /* ElementAccessExpression */:
+                    case 205 /* PropertyAccessExpression */:
                         var ex = expr;
                         if (isConstantMemberAccess(ex)) {
                             var type = getTypeOfExpression(ex.expression);
                             if (type.symbol && type.symbol.flags & 384 /* Enum */) {
                                 var name = void 0;
-                                if (ex.kind === 201 /* PropertyAccessExpression */) {
+                                if (ex.kind === 205 /* PropertyAccessExpression */) {
                                     name = ex.name.escapedText;
                                 }
                                 else {
@@ -77051,7 +82390,7 @@ var ts;
                 if (memberSymbol) {
                     var declaration = memberSymbol.valueDeclaration;
                     if (declaration !== member) {
-                        if (isBlockScopedNameDeclaredBeforeUse(declaration, member)) {
+                        if (declaration && isBlockScopedNameDeclaredBeforeUse(declaration, member)) {
                             return getEnumMemberValue(declaration);
                         }
                         error(expr, ts.Diagnostics.A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums);
@@ -77065,9 +82404,9 @@ var ts;
             }
         }
         function isConstantMemberAccess(node) {
-            return node.kind === 78 /* Identifier */ ||
-                node.kind === 201 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) ||
-                node.kind === 202 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) &&
+            return node.kind === 79 /* Identifier */ ||
+                node.kind === 205 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) ||
+                node.kind === 206 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) &&
                     ts.isStringLiteralLike(node.argumentExpression);
         }
         function checkEnumDeclaration(node) {
@@ -77076,9 +82415,7 @@ var ts;
             }
             // Grammar checking
             checkGrammarDecoratorsAndModifiers(node);
-            checkTypeNameIsReserved(node.name, ts.Diagnostics.Enum_name_cannot_be_0);
-            checkCollisionWithRequireExportsInGeneratedCode(node, node.name);
-            checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name);
+            checkCollisionsForDeclarationName(node, node.name);
             checkExportsOnMergedDeclarations(node);
             node.members.forEach(checkEnumMember);
             computeEnumMemberValues(node);
@@ -77091,7 +82428,7 @@ var ts;
             var enumSymbol = getSymbolOfNode(node);
             var firstDeclaration = ts.getDeclarationOfKind(enumSymbol, node.kind);
             if (node === firstDeclaration) {
-                if (enumSymbol.declarations.length > 1) {
+                if (enumSymbol.declarations && enumSymbol.declarations.length > 1) {
                     var enumIsConst_1 = ts.isEnumConst(node);
                     // check that const is placed\omitted on all enum declarations
                     ts.forEach(enumSymbol.declarations, function (decl) {
@@ -77103,7 +82440,7 @@ var ts;
                 var seenEnumMissingInitialInitializer_1 = false;
                 ts.forEach(enumSymbol.declarations, function (declaration) {
                     // return true if we hit a violation of the rule, false otherwise
-                    if (declaration.kind !== 255 /* EnumDeclaration */) {
+                    if (declaration.kind !== 259 /* EnumDeclaration */) {
                         return false;
                     }
                     var enumDeclaration = declaration;
@@ -77129,12 +82466,14 @@ var ts;
         }
         function getFirstNonAmbientClassOrFunctionDeclaration(symbol) {
             var declarations = symbol.declarations;
-            for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) {
-                var declaration = declarations_8[_i];
-                if ((declaration.kind === 252 /* ClassDeclaration */ ||
-                    (declaration.kind === 251 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) &&
-                    !(declaration.flags & 8388608 /* Ambient */)) {
-                    return declaration;
+            if (declarations) {
+                for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) {
+                    var declaration = declarations_8[_i];
+                    if ((declaration.kind === 256 /* ClassDeclaration */ ||
+                        (declaration.kind === 255 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) &&
+                        !(declaration.flags & 8388608 /* Ambient */)) {
+                        return declaration;
+                    }
                 }
             }
             return undefined;
@@ -77174,14 +82513,14 @@ var ts;
                     }
                 }
                 if (ts.isIdentifier(node.name)) {
-                    checkCollisionWithRequireExportsInGeneratedCode(node, node.name);
-                    checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name);
+                    checkCollisionsForDeclarationName(node, node.name);
                 }
                 checkExportsOnMergedDeclarations(node);
                 var symbol = getSymbolOfNode(node);
                 // The following checks only apply on a non-ambient instantiated module declaration.
                 if (symbol.flags & 512 /* ValueModule */
                     && !inAmbientContext
+                    && symbol.declarations
                     && symbol.declarations.length > 1
                     && isInstantiatedModule(node, ts.shouldPreserveConstEnums(compilerOptions))) {
                     var firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol);
@@ -77195,7 +82534,7 @@ var ts;
                     }
                     // if the module merges with a class declaration in the same lexical scope,
                     // we need to track this to ensure the correct emit.
-                    var mergedClass = ts.getDeclarationOfKind(symbol, 252 /* ClassDeclaration */);
+                    var mergedClass = ts.getDeclarationOfKind(symbol, 256 /* ClassDeclaration */);
                     if (mergedClass &&
                         inSameLexicalScope(node, mergedClass)) {
                         getNodeLinks(node).flags |= 32768 /* LexicalModuleMergesWithClass */;
@@ -77244,40 +82583,41 @@ var ts;
             }
         }
         function checkModuleAugmentationElement(node, isGlobalAugmentation) {
+            var _a;
             switch (node.kind) {
-                case 232 /* VariableStatement */:
+                case 236 /* VariableStatement */:
                     // error each individual name in variable statement instead of marking the entire variable statement
-                    for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) {
-                        var decl = _a[_i];
+                    for (var _i = 0, _b = node.declarationList.declarations; _i < _b.length; _i++) {
+                        var decl = _b[_i];
                         checkModuleAugmentationElement(decl, isGlobalAugmentation);
                     }
                     break;
-                case 266 /* ExportAssignment */:
-                case 267 /* ExportDeclaration */:
+                case 270 /* ExportAssignment */:
+                case 271 /* ExportDeclaration */:
                     grammarErrorOnFirstToken(node, ts.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations);
                     break;
-                case 260 /* ImportEqualsDeclaration */:
-                case 261 /* ImportDeclaration */:
+                case 264 /* ImportEqualsDeclaration */:
+                case 265 /* ImportDeclaration */:
                     grammarErrorOnFirstToken(node, ts.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module);
                     break;
-                case 198 /* BindingElement */:
-                case 249 /* VariableDeclaration */:
+                case 202 /* BindingElement */:
+                case 253 /* VariableDeclaration */:
                     var name = node.name;
                     if (ts.isBindingPattern(name)) {
-                        for (var _b = 0, _c = name.elements; _b < _c.length; _b++) {
-                            var el = _c[_b];
+                        for (var _c = 0, _d = name.elements; _c < _d.length; _c++) {
+                            var el = _d[_c];
                             // mark individual names in binding pattern
                             checkModuleAugmentationElement(el, isGlobalAugmentation);
                         }
                         break;
                     }
                 // falls through
-                case 252 /* ClassDeclaration */:
-                case 255 /* EnumDeclaration */:
-                case 251 /* FunctionDeclaration */:
-                case 253 /* InterfaceDeclaration */:
-                case 256 /* ModuleDeclaration */:
-                case 254 /* TypeAliasDeclaration */:
+                case 256 /* ClassDeclaration */:
+                case 259 /* EnumDeclaration */:
+                case 255 /* FunctionDeclaration */:
+                case 257 /* InterfaceDeclaration */:
+                case 260 /* ModuleDeclaration */:
+                case 258 /* TypeAliasDeclaration */:
                     if (isGlobalAugmentation) {
                         return;
                     }
@@ -77290,7 +82630,7 @@ var ts;
                         var reportError = !(symbol.flags & 33554432 /* Transient */);
                         if (!reportError) {
                             // symbol should not originate in augmentation
-                            reportError = !!symbol.parent && ts.isExternalModuleAugmentation(symbol.parent.declarations[0]);
+                            reportError = !!((_a = symbol.parent) === null || _a === void 0 ? void 0 : _a.declarations) && ts.isExternalModuleAugmentation(symbol.parent.declarations[0]);
                         }
                     }
                     break;
@@ -77298,20 +82638,20 @@ var ts;
         }
         function getFirstNonModuleExportsIdentifier(node) {
             switch (node.kind) {
-                case 78 /* Identifier */:
+                case 79 /* Identifier */:
                     return node;
-                case 157 /* QualifiedName */:
+                case 160 /* QualifiedName */:
                     do {
                         node = node.left;
-                    } while (node.kind !== 78 /* Identifier */);
+                    } while (node.kind !== 79 /* Identifier */);
                     return node;
-                case 201 /* PropertyAccessExpression */:
+                case 205 /* PropertyAccessExpression */:
                     do {
                         if (ts.isModuleExportsAccessExpression(node.expression) && !ts.isPrivateIdentifier(node.name)) {
                             return node.name;
                         }
                         node = node.expression;
-                    } while (node.kind !== 78 /* Identifier */);
+                    } while (node.kind !== 79 /* Identifier */);
                     return node;
             }
         }
@@ -77325,9 +82665,9 @@ var ts;
                 error(moduleName, ts.Diagnostics.String_literal_expected);
                 return false;
             }
-            var inAmbientExternalModule = node.parent.kind === 257 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent);
-            if (node.parent.kind !== 297 /* SourceFile */ && !inAmbientExternalModule) {
-                error(moduleName, node.kind === 267 /* ExportDeclaration */ ?
+            var inAmbientExternalModule = node.parent.kind === 261 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent);
+            if (node.parent.kind !== 303 /* SourceFile */ && !inAmbientExternalModule) {
+                error(moduleName, node.kind === 271 /* ExportDeclaration */ ?
                     ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace :
                     ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module);
                 return false;
@@ -77362,18 +82702,46 @@ var ts;
                     (symbol.flags & 788968 /* Type */ ? 788968 /* Type */ : 0) |
                     (symbol.flags & 1920 /* Namespace */ ? 1920 /* Namespace */ : 0);
                 if (target.flags & excludedMeanings) {
-                    var message = node.kind === 270 /* ExportSpecifier */ ?
+                    var message = node.kind === 274 /* ExportSpecifier */ ?
                         ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 :
                         ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0;
                     error(node, message, symbolToString(symbol));
                 }
-                // Don't allow to re-export something with no value side when `--isolatedModules` is set.
                 if (compilerOptions.isolatedModules
-                    && node.kind === 270 /* ExportSpecifier */
-                    && !node.parent.parent.isTypeOnly
-                    && !(target.flags & 111551 /* Value */)
+                    && !ts.isTypeOnlyImportOrExportDeclaration(node)
                     && !(node.flags & 8388608 /* Ambient */)) {
-                    error(node, ts.Diagnostics.Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type);
+                    var typeOnlyAlias = getTypeOnlyAliasDeclaration(symbol);
+                    var isType = !(target.flags & 111551 /* Value */);
+                    if (isType || typeOnlyAlias) {
+                        switch (node.kind) {
+                            case 266 /* ImportClause */:
+                            case 269 /* ImportSpecifier */:
+                            case 264 /* ImportEqualsDeclaration */: {
+                                if (compilerOptions.preserveValueImports) {
+                                    ts.Debug.assertIsDefined(node.name, "An ImportClause with a symbol should have a name");
+                                    var message = isType
+                                        ? ts.Diagnostics._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled
+                                        : ts.Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled;
+                                    var name = ts.idText(node.kind === 269 /* ImportSpecifier */ ? node.propertyName || node.name : node.name);
+                                    addTypeOnlyDeclarationRelatedInfo(error(node, message, name), isType ? undefined : typeOnlyAlias, name);
+                                }
+                                break;
+                            }
+                            case 274 /* ExportSpecifier */: {
+                                // Don't allow re-exporting an export that will be elided when `--isolatedModules` is set.
+                                // The exception is that `import type { A } from './a'; export { A }` is allowed
+                                // because single-file analysis can determine that the export should be dropped.
+                                if (ts.getSourceFileOfNode(typeOnlyAlias) !== ts.getSourceFileOfNode(node)) {
+                                    var message = isType
+                                        ? ts.Diagnostics.Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type
+                                        : ts.Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isolatedModules_is_enabled;
+                                    var name = ts.idText(node.propertyName || node.name);
+                                    addTypeOnlyDeclarationRelatedInfo(error(node, message, name), isType ? undefined : typeOnlyAlias, name);
+                                    return;
+                                }
+                            }
+                        }
+                    }
                 }
                 if (ts.isImportSpecifier(node) && ((_a = target.declarations) === null || _a === void 0 ? void 0 : _a.every(function (d) { return !!(ts.getCombinedNodeFlags(d) & 134217728 /* Deprecated */); }))) {
                     addDeprecatedSuggestion(node.name, target.declarations, symbol.escapedName);
@@ -77381,16 +82749,26 @@ var ts;
             }
         }
         function checkImportBinding(node) {
-            checkCollisionWithRequireExportsInGeneratedCode(node, node.name);
-            checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name);
+            checkCollisionsForDeclarationName(node, node.name);
             checkAliasSymbol(node);
-            if (node.kind === 265 /* ImportSpecifier */ &&
+            if (node.kind === 269 /* ImportSpecifier */ &&
                 ts.idText(node.propertyName || node.name) === "default" &&
-                compilerOptions.esModuleInterop &&
-                moduleKind !== ts.ModuleKind.System && moduleKind < ts.ModuleKind.ES2015) {
+                ts.getESModuleInterop(compilerOptions) &&
+                moduleKind !== ts.ModuleKind.System && (moduleKind < ts.ModuleKind.ES2015 || ts.getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.CommonJS)) {
                 checkExternalEmitHelpers(node, 131072 /* ImportDefault */);
             }
         }
+        function checkAssertClause(declaration) {
+            var _a;
+            if (declaration.assertClause) {
+                if (moduleKind !== ts.ModuleKind.ESNext) {
+                    return grammarErrorOnNode(declaration.assertClause, ts.Diagnostics.Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext);
+                }
+                if (ts.isImportDeclaration(declaration) ? (_a = declaration.importClause) === null || _a === void 0 ? void 0 : _a.isTypeOnly : declaration.isTypeOnly) {
+                    return grammarErrorOnNode(declaration.assertClause, ts.Diagnostics.Import_assertions_cannot_be_used_with_type_only_imports_or_exports);
+                }
+            }
+        }
         function checkImportDeclaration(node) {
             if (checkGrammarModuleElementContext(node, ts.Diagnostics.An_import_declaration_can_only_be_used_in_a_namespace_or_module)) {
                 // If we hit an import declaration in an illegal context, just bail out to avoid cascading errors.
@@ -77406,9 +82784,9 @@ var ts;
                         checkImportBinding(importClause);
                     }
                     if (importClause.namedBindings) {
-                        if (importClause.namedBindings.kind === 263 /* NamespaceImport */) {
+                        if (importClause.namedBindings.kind === 267 /* NamespaceImport */) {
                             checkImportBinding(importClause.namedBindings);
-                            if (moduleKind !== ts.ModuleKind.System && moduleKind < ts.ModuleKind.ES2015 && compilerOptions.esModuleInterop) {
+                            if (moduleKind !== ts.ModuleKind.System && (moduleKind < ts.ModuleKind.ES2015 || ts.getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.CommonJS) && ts.getESModuleInterop(compilerOptions)) {
                                 // import * as ns from "foo";
                                 checkExternalEmitHelpers(node, 65536 /* ImportStar */);
                             }
@@ -77422,6 +82800,7 @@ var ts;
                     }
                 }
             }
+            checkAssertClause(node);
         }
         function checkImportEqualsDeclaration(node) {
             if (checkGrammarModuleElementContext(node, ts.Diagnostics.An_import_declaration_can_only_be_used_in_a_namespace_or_module)) {
@@ -77434,7 +82813,7 @@ var ts;
                 if (ts.hasSyntacticModifier(node, 1 /* Export */)) {
                     markExportAsReferenced(node);
                 }
-                if (node.moduleReference.kind !== 272 /* ExternalModuleReference */) {
+                if (node.moduleReference.kind !== 276 /* ExternalModuleReference */) {
                     var target = resolveAlias(getSymbolOfNode(node));
                     if (target !== unknownSymbol) {
                         if (target.flags & 111551 /* Value */) {
@@ -77453,7 +82832,7 @@ var ts;
                     }
                 }
                 else {
-                    if (moduleKind >= ts.ModuleKind.ES2015 && !node.isTypeOnly && !(node.flags & 8388608 /* Ambient */)) {
+                    if (moduleKind >= ts.ModuleKind.ES2015 && ts.getSourceFileOfNode(node).impliedNodeFormat === undefined && !node.isTypeOnly && !(node.flags & 8388608 /* Ambient */)) {
                         // Import equals declaration is deprecated in es6 or above
                         grammarErrorOnNode(node, ts.Diagnostics.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);
                     }
@@ -77469,7 +82848,7 @@ var ts;
                 grammarErrorOnFirstToken(node, ts.Diagnostics.An_export_declaration_cannot_have_modifiers);
             }
             if (node.moduleSpecifier && node.exportClause && ts.isNamedExports(node.exportClause) && ts.length(node.exportClause.elements) && languageVersion === 0 /* ES3 */) {
-                checkExternalEmitHelpers(node, 2097152 /* CreateBinding */);
+                checkExternalEmitHelpers(node, 4194304 /* CreateBinding */);
             }
             checkGrammarExportDeclaration(node);
             if (!node.moduleSpecifier || checkExternalImportOrExportDeclaration(node)) {
@@ -77477,10 +82856,10 @@ var ts;
                     // export { x, y }
                     // export { x, y } from "foo"
                     ts.forEach(node.exportClause.elements, checkExportSpecifier);
-                    var inAmbientExternalModule = node.parent.kind === 257 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent);
-                    var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 257 /* ModuleBlock */ &&
+                    var inAmbientExternalModule = node.parent.kind === 261 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent);
+                    var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 261 /* ModuleBlock */ &&
                         !node.moduleSpecifier && node.flags & 8388608 /* Ambient */;
-                    if (node.parent.kind !== 297 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) {
+                    if (node.parent.kind !== 303 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) {
                         error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace);
                     }
                 }
@@ -77494,12 +82873,12 @@ var ts;
                     else if (node.exportClause) {
                         checkAliasSymbol(node.exportClause);
                     }
-                    if (moduleKind !== ts.ModuleKind.System && moduleKind < ts.ModuleKind.ES2015) {
+                    if (moduleKind !== ts.ModuleKind.System && (moduleKind < ts.ModuleKind.ES2015 || ts.getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.CommonJS)) {
                         if (node.exportClause) {
                             // export * as ns from "foo";
                             // For ES2015 modules, we emit it as a pair of `import * as a_1 ...; export { a_1 as ns }` and don't need the helper.
                             // We only use the helper here when in esModuleInterop
-                            if (compilerOptions.esModuleInterop) {
+                            if (ts.getESModuleInterop(compilerOptions)) {
                                 checkExternalEmitHelpers(node, 65536 /* ImportStar */);
                             }
                         }
@@ -77510,17 +82889,22 @@ var ts;
                     }
                 }
             }
+            checkAssertClause(node);
         }
         function checkGrammarExportDeclaration(node) {
             var _a;
-            var isTypeOnlyExportStar = node.isTypeOnly && ((_a = node.exportClause) === null || _a === void 0 ? void 0 : _a.kind) !== 268 /* NamedExports */;
-            if (isTypeOnlyExportStar) {
-                grammarErrorOnNode(node, ts.Diagnostics.Only_named_exports_may_use_export_type);
+            if (node.isTypeOnly) {
+                if (((_a = node.exportClause) === null || _a === void 0 ? void 0 : _a.kind) === 272 /* NamedExports */) {
+                    return checkGrammarNamedImportsOrExports(node.exportClause);
+                }
+                else {
+                    return grammarErrorOnNode(node, ts.Diagnostics.Only_named_exports_may_use_export_type);
+                }
             }
-            return !isTypeOnlyExportStar;
+            return false;
         }
         function checkGrammarModuleElementContext(node, errorMessage) {
-            var isInAppropriateContext = node.parent.kind === 297 /* SourceFile */ || node.parent.kind === 257 /* ModuleBlock */ || node.parent.kind === 256 /* ModuleDeclaration */;
+            var isInAppropriateContext = node.parent.kind === 303 /* SourceFile */ || node.parent.kind === 261 /* ModuleBlock */ || node.parent.kind === 260 /* ModuleDeclaration */;
             if (!isInAppropriateContext) {
                 grammarErrorOnFirstToken(node, errorMessage);
             }
@@ -77570,7 +82954,7 @@ var ts;
                 // find immediate value referenced by exported name (SymbolFlags.Alias is set so we don't chase down aliases)
                 var symbol = resolveName(exportedName, exportedName.escapedText, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, 
                 /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ true);
-                if (symbol && (symbol === undefinedSymbol || symbol === globalThisSymbol || isGlobalSourceFile(getDeclarationContainer(symbol.declarations[0])))) {
+                if (symbol && (symbol === undefinedSymbol || symbol === globalThisSymbol || symbol.declarations && isGlobalSourceFile(getDeclarationContainer(symbol.declarations[0])))) {
                     error(exportedName, ts.Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module, ts.idText(exportedName));
                 }
                 else {
@@ -77582,21 +82966,24 @@ var ts;
                 }
             }
             else {
-                if (compilerOptions.esModuleInterop &&
+                if (ts.getESModuleInterop(compilerOptions) &&
                     moduleKind !== ts.ModuleKind.System &&
-                    moduleKind < ts.ModuleKind.ES2015 &&
+                    (moduleKind < ts.ModuleKind.ES2015 || ts.getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.CommonJS) &&
                     ts.idText(node.propertyName || node.name) === "default") {
                     checkExternalEmitHelpers(node, 131072 /* ImportDefault */);
                 }
             }
         }
         function checkExportAssignment(node) {
-            if (checkGrammarModuleElementContext(node, ts.Diagnostics.An_export_assignment_can_only_be_used_in_a_module)) {
+            var illegalContextMessage = node.isExportEquals
+                ? ts.Diagnostics.An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration
+                : ts.Diagnostics.A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration;
+            if (checkGrammarModuleElementContext(node, illegalContextMessage)) {
                 // If we hit an export assignment in an illegal context, just bail out to avoid cascading errors.
                 return;
             }
-            var container = node.parent.kind === 297 /* SourceFile */ ? node.parent : node.parent.parent;
-            if (container.kind === 256 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) {
+            var container = node.parent.kind === 303 /* SourceFile */ ? node.parent : node.parent.parent;
+            if (container.kind === 260 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) {
                 if (node.isExportEquals) {
                     error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace);
                 }
@@ -77609,7 +82996,11 @@ var ts;
             if (!checkGrammarDecoratorsAndModifiers(node) && ts.hasEffectiveModifiers(node)) {
                 grammarErrorOnFirstToken(node, ts.Diagnostics.An_export_assignment_cannot_have_modifiers);
             }
-            if (node.expression.kind === 78 /* Identifier */) {
+            var typeAnnotationNode = ts.getEffectiveTypeAnnotationNode(node);
+            if (typeAnnotationNode) {
+                checkTypeAssignableTo(checkExpressionCached(node.expression), getTypeFromTypeNode(typeAnnotationNode), node.expression);
+            }
+            if (node.expression.kind === 79 /* Identifier */) {
                 var id = node.expression;
                 var sym = resolveEntityName(id, 67108863 /* All */, /*ignoreErrors*/ true, /*dontResolveAlias*/ true, node);
                 if (sym) {
@@ -77636,7 +83027,7 @@ var ts;
                 grammarErrorOnNode(node.expression, ts.Diagnostics.The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context);
             }
             if (node.isExportEquals && !(node.flags & 8388608 /* Ambient */)) {
-                if (moduleKind >= ts.ModuleKind.ES2015) {
+                if (moduleKind >= ts.ModuleKind.ES2015 && ts.getSourceFileOfNode(node).impliedNodeFormat !== ts.ModuleKind.CommonJS) {
                     // export assignment is not supported in es6 modules
                     grammarErrorOnNode(node, ts.Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead);
                 }
@@ -77656,7 +83047,7 @@ var ts;
                 var exportEqualsSymbol = moduleSymbol.exports.get("export=");
                 if (exportEqualsSymbol && hasExportedMembers(moduleSymbol)) {
                     var declaration = getDeclarationOfAliasSymbol(exportEqualsSymbol) || exportEqualsSymbol.valueDeclaration;
-                    if (!isTopLevelInExternalModuleAugmentation(declaration) && !ts.isInJSFile(declaration)) {
+                    if (declaration && !isTopLevelInExternalModuleAugmentation(declaration) && !ts.isInJSFile(declaration)) {
                         error(declaration, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements);
                     }
                 }
@@ -77680,10 +83071,12 @@ var ts;
                             return;
                         }
                         if (exportedDeclarationsCount > 1) {
-                            for (var _i = 0, declarations_9 = declarations; _i < declarations_9.length; _i++) {
-                                var declaration = declarations_9[_i];
-                                if (isNotOverload(declaration)) {
-                                    diagnostics.add(ts.createDiagnosticForNode(declaration, ts.Diagnostics.Cannot_redeclare_exported_variable_0, ts.unescapeLeadingUnderscores(id)));
+                            if (!isDuplicatedCommonJSExport(declarations)) {
+                                for (var _i = 0, _b = declarations; _i < _b.length; _i++) {
+                                    var declaration = _b[_i];
+                                    if (isNotOverload(declaration)) {
+                                        diagnostics.add(ts.createDiagnosticForNode(declaration, ts.Diagnostics.Cannot_redeclare_exported_variable_0, ts.unescapeLeadingUnderscores(id)));
+                                    }
                                 }
                             }
                         }
@@ -77692,6 +83085,11 @@ var ts;
                 links.exportsChecked = true;
             }
         }
+        function isDuplicatedCommonJSExport(declarations) {
+            return declarations
+                && declarations.length > 1
+                && declarations.every(function (d) { return ts.isInJSFile(d) && ts.isAccessExpression(d) && (ts.isExportsIdentifier(d.expression) || ts.isModuleExportsAccessExpression(d.expression)); });
+        }
         function checkSourceElement(node) {
             if (node) {
                 var saveCurrentNode = currentNode;
@@ -77713,171 +83111,177 @@ var ts;
                 // Only bother checking on a few construct kinds.  We don't want to be excessively
                 // hitting the cancellation token on every node we check.
                 switch (kind) {
-                    case 256 /* ModuleDeclaration */:
-                    case 252 /* ClassDeclaration */:
-                    case 253 /* InterfaceDeclaration */:
-                    case 251 /* FunctionDeclaration */:
+                    case 260 /* ModuleDeclaration */:
+                    case 256 /* ClassDeclaration */:
+                    case 257 /* InterfaceDeclaration */:
+                    case 255 /* FunctionDeclaration */:
                         cancellationToken.throwIfCancellationRequested();
                 }
             }
-            if (kind >= 232 /* FirstStatement */ && kind <= 248 /* LastStatement */ && node.flowNode && !isReachableFlowNode(node.flowNode)) {
+            if (kind >= 236 /* FirstStatement */ && kind <= 252 /* LastStatement */ && node.flowNode && !isReachableFlowNode(node.flowNode)) {
                 errorOrSuggestion(compilerOptions.allowUnreachableCode === false, node, ts.Diagnostics.Unreachable_code_detected);
             }
             switch (kind) {
-                case 159 /* TypeParameter */:
+                case 162 /* TypeParameter */:
                     return checkTypeParameter(node);
-                case 160 /* Parameter */:
+                case 163 /* Parameter */:
                     return checkParameter(node);
-                case 163 /* PropertyDeclaration */:
+                case 166 /* PropertyDeclaration */:
                     return checkPropertyDeclaration(node);
-                case 162 /* PropertySignature */:
+                case 165 /* PropertySignature */:
                     return checkPropertySignature(node);
-                case 175 /* ConstructorType */:
-                case 174 /* FunctionType */:
-                case 169 /* CallSignature */:
-                case 170 /* ConstructSignature */:
-                case 171 /* IndexSignature */:
+                case 179 /* ConstructorType */:
+                case 178 /* FunctionType */:
+                case 173 /* CallSignature */:
+                case 174 /* ConstructSignature */:
+                case 175 /* IndexSignature */:
                     return checkSignatureDeclaration(node);
-                case 165 /* MethodDeclaration */:
-                case 164 /* MethodSignature */:
+                case 168 /* MethodDeclaration */:
+                case 167 /* MethodSignature */:
                     return checkMethodDeclaration(node);
-                case 166 /* Constructor */:
+                case 169 /* ClassStaticBlockDeclaration */:
+                    return checkClassStaticBlockDeclaration(node);
+                case 170 /* Constructor */:
                     return checkConstructorDeclaration(node);
-                case 167 /* GetAccessor */:
-                case 168 /* SetAccessor */:
+                case 171 /* GetAccessor */:
+                case 172 /* SetAccessor */:
                     return checkAccessorDeclaration(node);
-                case 173 /* TypeReference */:
+                case 177 /* TypeReference */:
                     return checkTypeReferenceNode(node);
-                case 172 /* TypePredicate */:
+                case 176 /* TypePredicate */:
                     return checkTypePredicate(node);
-                case 176 /* TypeQuery */:
+                case 180 /* TypeQuery */:
                     return checkTypeQuery(node);
-                case 177 /* TypeLiteral */:
+                case 181 /* TypeLiteral */:
                     return checkTypeLiteral(node);
-                case 178 /* ArrayType */:
+                case 182 /* ArrayType */:
                     return checkArrayType(node);
-                case 179 /* TupleType */:
+                case 183 /* TupleType */:
                     return checkTupleType(node);
-                case 182 /* UnionType */:
-                case 183 /* IntersectionType */:
+                case 186 /* UnionType */:
+                case 187 /* IntersectionType */:
                     return checkUnionOrIntersectionType(node);
-                case 186 /* ParenthesizedType */:
-                case 180 /* OptionalType */:
-                case 181 /* RestType */:
+                case 190 /* ParenthesizedType */:
+                case 184 /* OptionalType */:
+                case 185 /* RestType */:
                     return checkSourceElement(node.type);
-                case 187 /* ThisType */:
+                case 191 /* ThisType */:
                     return checkThisType(node);
-                case 188 /* TypeOperator */:
+                case 192 /* TypeOperator */:
                     return checkTypeOperator(node);
-                case 184 /* ConditionalType */:
+                case 188 /* ConditionalType */:
                     return checkConditionalType(node);
-                case 185 /* InferType */:
+                case 189 /* InferType */:
                     return checkInferType(node);
-                case 193 /* TemplateLiteralType */:
+                case 197 /* TemplateLiteralType */:
                     return checkTemplateLiteralType(node);
-                case 195 /* ImportType */:
+                case 199 /* ImportType */:
                     return checkImportType(node);
-                case 192 /* NamedTupleMember */:
+                case 196 /* NamedTupleMember */:
                     return checkNamedTupleMember(node);
-                case 315 /* JSDocAugmentsTag */:
+                case 326 /* JSDocAugmentsTag */:
                     return checkJSDocAugmentsTag(node);
-                case 316 /* JSDocImplementsTag */:
+                case 327 /* JSDocImplementsTag */:
                     return checkJSDocImplementsTag(node);
-                case 331 /* JSDocTypedefTag */:
-                case 324 /* JSDocCallbackTag */:
-                case 325 /* JSDocEnumTag */:
+                case 343 /* JSDocTypedefTag */:
+                case 336 /* JSDocCallbackTag */:
+                case 337 /* JSDocEnumTag */:
                     return checkJSDocTypeAliasTag(node);
-                case 330 /* JSDocTemplateTag */:
+                case 342 /* JSDocTemplateTag */:
                     return checkJSDocTemplateTag(node);
-                case 329 /* JSDocTypeTag */:
+                case 341 /* JSDocTypeTag */:
                     return checkJSDocTypeTag(node);
-                case 326 /* JSDocParameterTag */:
+                case 338 /* JSDocParameterTag */:
                     return checkJSDocParameterTag(node);
-                case 333 /* JSDocPropertyTag */:
+                case 345 /* JSDocPropertyTag */:
                     return checkJSDocPropertyTag(node);
-                case 308 /* JSDocFunctionType */:
+                case 315 /* JSDocFunctionType */:
                     checkJSDocFunctionType(node);
                 // falls through
-                case 306 /* JSDocNonNullableType */:
-                case 305 /* JSDocNullableType */:
-                case 303 /* JSDocAllType */:
-                case 304 /* JSDocUnknownType */:
-                case 312 /* JSDocTypeLiteral */:
+                case 313 /* JSDocNonNullableType */:
+                case 312 /* JSDocNullableType */:
+                case 310 /* JSDocAllType */:
+                case 311 /* JSDocUnknownType */:
+                case 320 /* JSDocTypeLiteral */:
                     checkJSDocTypeIsInJsFile(node);
                     ts.forEachChild(node, checkSourceElement);
                     return;
-                case 309 /* JSDocVariadicType */:
+                case 316 /* JSDocVariadicType */:
                     checkJSDocVariadicType(node);
                     return;
-                case 301 /* JSDocTypeExpression */:
+                case 307 /* JSDocTypeExpression */:
                     return checkSourceElement(node.type);
-                case 189 /* IndexedAccessType */:
+                case 331 /* JSDocPublicTag */:
+                case 333 /* JSDocProtectedTag */:
+                case 332 /* JSDocPrivateTag */:
+                    return checkJSDocAccessibilityModifiers(node);
+                case 193 /* IndexedAccessType */:
                     return checkIndexedAccessType(node);
-                case 190 /* MappedType */:
+                case 194 /* MappedType */:
                     return checkMappedType(node);
-                case 251 /* FunctionDeclaration */:
+                case 255 /* FunctionDeclaration */:
                     return checkFunctionDeclaration(node);
-                case 230 /* Block */:
-                case 257 /* ModuleBlock */:
+                case 234 /* Block */:
+                case 261 /* ModuleBlock */:
                     return checkBlock(node);
-                case 232 /* VariableStatement */:
+                case 236 /* VariableStatement */:
                     return checkVariableStatement(node);
-                case 233 /* ExpressionStatement */:
+                case 237 /* ExpressionStatement */:
                     return checkExpressionStatement(node);
-                case 234 /* IfStatement */:
+                case 238 /* IfStatement */:
                     return checkIfStatement(node);
-                case 235 /* DoStatement */:
+                case 239 /* DoStatement */:
                     return checkDoStatement(node);
-                case 236 /* WhileStatement */:
+                case 240 /* WhileStatement */:
                     return checkWhileStatement(node);
-                case 237 /* ForStatement */:
+                case 241 /* ForStatement */:
                     return checkForStatement(node);
-                case 238 /* ForInStatement */:
+                case 242 /* ForInStatement */:
                     return checkForInStatement(node);
-                case 239 /* ForOfStatement */:
+                case 243 /* ForOfStatement */:
                     return checkForOfStatement(node);
-                case 240 /* ContinueStatement */:
-                case 241 /* BreakStatement */:
+                case 244 /* ContinueStatement */:
+                case 245 /* BreakStatement */:
                     return checkBreakOrContinueStatement(node);
-                case 242 /* ReturnStatement */:
+                case 246 /* ReturnStatement */:
                     return checkReturnStatement(node);
-                case 243 /* WithStatement */:
+                case 247 /* WithStatement */:
                     return checkWithStatement(node);
-                case 244 /* SwitchStatement */:
+                case 248 /* SwitchStatement */:
                     return checkSwitchStatement(node);
-                case 245 /* LabeledStatement */:
+                case 249 /* LabeledStatement */:
                     return checkLabeledStatement(node);
-                case 246 /* ThrowStatement */:
+                case 250 /* ThrowStatement */:
                     return checkThrowStatement(node);
-                case 247 /* TryStatement */:
+                case 251 /* TryStatement */:
                     return checkTryStatement(node);
-                case 249 /* VariableDeclaration */:
+                case 253 /* VariableDeclaration */:
                     return checkVariableDeclaration(node);
-                case 198 /* BindingElement */:
+                case 202 /* BindingElement */:
                     return checkBindingElement(node);
-                case 252 /* ClassDeclaration */:
+                case 256 /* ClassDeclaration */:
                     return checkClassDeclaration(node);
-                case 253 /* InterfaceDeclaration */:
+                case 257 /* InterfaceDeclaration */:
                     return checkInterfaceDeclaration(node);
-                case 254 /* TypeAliasDeclaration */:
+                case 258 /* TypeAliasDeclaration */:
                     return checkTypeAliasDeclaration(node);
-                case 255 /* EnumDeclaration */:
+                case 259 /* EnumDeclaration */:
                     return checkEnumDeclaration(node);
-                case 256 /* ModuleDeclaration */:
+                case 260 /* ModuleDeclaration */:
                     return checkModuleDeclaration(node);
-                case 261 /* ImportDeclaration */:
+                case 265 /* ImportDeclaration */:
                     return checkImportDeclaration(node);
-                case 260 /* ImportEqualsDeclaration */:
+                case 264 /* ImportEqualsDeclaration */:
                     return checkImportEqualsDeclaration(node);
-                case 267 /* ExportDeclaration */:
+                case 271 /* ExportDeclaration */:
                     return checkExportDeclaration(node);
-                case 266 /* ExportAssignment */:
+                case 270 /* ExportAssignment */:
                     return checkExportAssignment(node);
-                case 231 /* EmptyStatement */:
-                case 248 /* DebuggerStatement */:
+                case 235 /* EmptyStatement */:
+                case 252 /* DebuggerStatement */:
                     checkGrammarStatementInAmbientContext(node);
                     return;
-                case 271 /* MissingDeclaration */:
+                case 275 /* MissingDeclaration */:
                     return checkMissingDeclaration(node);
             }
         }
@@ -77922,7 +83326,8 @@ var ts;
             if (ts.isJSDocTypeExpression(node.parent) && ts.isJSDocParameterTag(paramTag)) {
                 // Else we will add a diagnostic, see `checkJSDocVariadicType`.
                 var host_1 = ts.getHostSignatureFromJSDoc(paramTag);
-                if (host_1) {
+                var isCallbackTag = ts.isJSDocCallbackTag(paramTag.parent.parent);
+                if (host_1 || isCallbackTag) {
                     /*
                     Only return an array type if the corresponding parameter is marked as a rest parameter, or if there are no parameters.
                     So in the following situation we will not create an array type:
@@ -77930,7 +83335,9 @@ var ts;
                         function f(a) {}
                     Because `a` will just be of type `number | undefined`. A synthetic `...args` will also be added, which *will* get an array type.
                     */
-                    var lastParamDeclaration = ts.lastOrUndefined(host_1.parameters);
+                    var lastParamDeclaration = isCallbackTag
+                        ? ts.lastOrUndefined(paramTag.parent.parent.typeExpression.parameters)
+                        : ts.lastOrUndefined(host_1.parameters);
                     var symbol = ts.getParameterSymbolFromJSDoc(paramTag);
                     if (!lastParamDeclaration ||
                         symbol && lastParamDeclaration.symbol === symbol && ts.isRestParameter(lastParamDeclaration)) {
@@ -77973,33 +83380,33 @@ var ts;
             currentNode = node;
             instantiationCount = 0;
             switch (node.kind) {
-                case 203 /* CallExpression */:
-                case 204 /* NewExpression */:
-                case 205 /* TaggedTemplateExpression */:
-                case 161 /* Decorator */:
-                case 275 /* JsxOpeningElement */:
+                case 207 /* CallExpression */:
+                case 208 /* NewExpression */:
+                case 209 /* TaggedTemplateExpression */:
+                case 164 /* Decorator */:
+                case 279 /* JsxOpeningElement */:
                     // These node kinds are deferred checked when overload resolution fails
                     // To save on work, we ensure the arguments are checked just once, in
                     // a deferred way
                     resolveUntypedCall(node);
                     break;
-                case 208 /* FunctionExpression */:
-                case 209 /* ArrowFunction */:
-                case 165 /* MethodDeclaration */:
-                case 164 /* MethodSignature */:
+                case 212 /* FunctionExpression */:
+                case 213 /* ArrowFunction */:
+                case 168 /* MethodDeclaration */:
+                case 167 /* MethodSignature */:
                     checkFunctionExpressionOrObjectLiteralMethodDeferred(node);
                     break;
-                case 167 /* GetAccessor */:
-                case 168 /* SetAccessor */:
+                case 171 /* GetAccessor */:
+                case 172 /* SetAccessor */:
                     checkAccessorDeclaration(node);
                     break;
-                case 221 /* ClassExpression */:
+                case 225 /* ClassExpression */:
                     checkClassExpressionDeferred(node);
                     break;
-                case 274 /* JsxSelfClosingElement */:
+                case 278 /* JsxSelfClosingElement */:
                     checkJsxSelfClosingElementDeferred(node);
                     break;
-                case 273 /* JsxElement */:
+                case 277 /* JsxElement */:
                     checkJsxElementDeferred(node);
                     break;
             }
@@ -78041,7 +83448,8 @@ var ts;
                 checkGrammarSourceFile(node);
                 ts.clear(potentialThisCollisions);
                 ts.clear(potentialNewTargetCollisions);
-                ts.clear(potentialWeakMapCollisions);
+                ts.clear(potentialWeakMapSetCollisions);
+                ts.clear(potentialReflectCollisions);
                 ts.forEach(node.statements, checkSourceElement);
                 checkSourceElement(node.endOfFileToken);
                 checkDeferredNodes(node);
@@ -78071,9 +83479,13 @@ var ts;
                     ts.forEach(potentialNewTargetCollisions, checkIfNewTargetIsCapturedInEnclosingScope);
                     ts.clear(potentialNewTargetCollisions);
                 }
-                if (potentialWeakMapCollisions.length) {
-                    ts.forEach(potentialWeakMapCollisions, checkWeakMapCollision);
-                    ts.clear(potentialWeakMapCollisions);
+                if (potentialWeakMapSetCollisions.length) {
+                    ts.forEach(potentialWeakMapSetCollisions, checkWeakMapSetCollision);
+                    ts.clear(potentialWeakMapSetCollisions);
+                }
+                if (potentialReflectCollisions.length) {
+                    ts.forEach(potentialReflectCollisions, checkReflectCollision);
+                    ts.clear(potentialReflectCollisions);
                 }
                 links.flags |= 1 /* TypeChecked */;
             }
@@ -78135,7 +83547,7 @@ var ts;
                 return [];
             }
             var symbols = ts.createSymbolTable();
-            var isStatic = false;
+            var isStaticSymbol = false;
             populateSymbols();
             symbols.delete("this" /* This */); // Not a symbol, a keyword
             return symbolsToArray(symbols);
@@ -78145,17 +83557,17 @@ var ts;
                         copySymbols(location.locals, meaning);
                     }
                     switch (location.kind) {
-                        case 297 /* SourceFile */:
-                            if (!ts.isExternalOrCommonJsModule(location))
+                        case 303 /* SourceFile */:
+                            if (!ts.isExternalModule(location))
                                 break;
                         // falls through
-                        case 256 /* ModuleDeclaration */:
-                            copySymbols(getSymbolOfNode(location).exports, meaning & 2623475 /* ModuleMember */);
+                        case 260 /* ModuleDeclaration */:
+                            copyLocallyVisibleExportSymbols(getSymbolOfNode(location).exports, meaning & 2623475 /* ModuleMember */);
                             break;
-                        case 255 /* EnumDeclaration */:
+                        case 259 /* EnumDeclaration */:
                             copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */);
                             break;
-                        case 221 /* ClassExpression */:
+                        case 225 /* ClassExpression */:
                             var className = location.name;
                             if (className) {
                                 copySymbol(location.symbol, meaning);
@@ -78163,17 +83575,17 @@ var ts;
                         // this fall-through is necessary because we would like to handle
                         // type parameter inside class expression similar to how we handle it in classDeclaration and interface Declaration.
                         // falls through
-                        case 252 /* ClassDeclaration */:
-                        case 253 /* InterfaceDeclaration */:
+                        case 256 /* ClassDeclaration */:
+                        case 257 /* InterfaceDeclaration */:
                             // If we didn't come from static member of class or interface,
                             // add the type parameters into the symbol table
                             // (type parameters of classDeclaration/classExpression and interface are in member property of the symbol.
                             // Note: that the memberFlags come from previous iteration.
-                            if (!isStatic) {
+                            if (!isStaticSymbol) {
                                 copySymbols(getMembersOfSymbol(getSymbolOfNode(location)), meaning & 788968 /* Type */);
                             }
                             break;
-                        case 208 /* FunctionExpression */:
+                        case 212 /* FunctionExpression */:
                             var funcName = location.name;
                             if (funcName) {
                                 copySymbol(location.symbol, meaning);
@@ -78183,7 +83595,7 @@ var ts;
                     if (ts.introducesArgumentsExoticObject(location)) {
                         copySymbol(argumentsSymbol, meaning);
                     }
-                    isStatic = ts.hasSyntacticModifier(location, 32 /* Static */);
+                    isStaticSymbol = ts.isStatic(location);
                     location = location.parent;
                 }
                 copySymbols(globals, meaning);
@@ -78213,27 +83625,37 @@ var ts;
                     });
                 }
             }
+            function copyLocallyVisibleExportSymbols(source, meaning) {
+                if (meaning) {
+                    source.forEach(function (symbol) {
+                        // Similar condition as in `resolveNameHelper`
+                        if (!ts.getDeclarationOfKind(symbol, 274 /* ExportSpecifier */) && !ts.getDeclarationOfKind(symbol, 273 /* NamespaceExport */)) {
+                            copySymbol(symbol, meaning);
+                        }
+                    });
+                }
+            }
         }
         function isTypeDeclarationName(name) {
-            return name.kind === 78 /* Identifier */ &&
+            return name.kind === 79 /* Identifier */ &&
                 isTypeDeclaration(name.parent) &&
                 ts.getNameOfDeclaration(name.parent) === name;
         }
         function isTypeDeclaration(node) {
             switch (node.kind) {
-                case 159 /* TypeParameter */:
-                case 252 /* ClassDeclaration */:
-                case 253 /* InterfaceDeclaration */:
-                case 254 /* TypeAliasDeclaration */:
-                case 255 /* EnumDeclaration */:
-                case 331 /* JSDocTypedefTag */:
-                case 324 /* JSDocCallbackTag */:
-                case 325 /* JSDocEnumTag */:
+                case 162 /* TypeParameter */:
+                case 256 /* ClassDeclaration */:
+                case 257 /* InterfaceDeclaration */:
+                case 258 /* TypeAliasDeclaration */:
+                case 259 /* EnumDeclaration */:
+                case 343 /* JSDocTypedefTag */:
+                case 336 /* JSDocCallbackTag */:
+                case 337 /* JSDocEnumTag */:
                     return true;
-                case 262 /* ImportClause */:
+                case 266 /* ImportClause */:
                     return node.isTypeOnly;
-                case 265 /* ImportSpecifier */:
-                case 270 /* ExportSpecifier */:
+                case 269 /* ImportSpecifier */:
+                case 274 /* ExportSpecifier */:
                     return node.parent.parent.isTypeOnly;
                 default:
                     return false;
@@ -78241,25 +83663,16 @@ var ts;
         }
         // True if the given identifier is part of a type reference
         function isTypeReferenceIdentifier(node) {
-            while (node.parent.kind === 157 /* QualifiedName */) {
+            while (node.parent.kind === 160 /* QualifiedName */) {
                 node = node.parent;
             }
-            return node.parent.kind === 173 /* TypeReference */;
+            return node.parent.kind === 177 /* TypeReference */;
         }
         function isHeritageClauseElementIdentifier(node) {
-            while (node.parent.kind === 201 /* PropertyAccessExpression */) {
-                node = node.parent;
-            }
-            return node.parent.kind === 223 /* ExpressionWithTypeArguments */;
-        }
-        function isJSDocEntryNameReference(node) {
-            while (node.parent.kind === 157 /* QualifiedName */) {
+            while (node.parent.kind === 205 /* PropertyAccessExpression */) {
                 node = node.parent;
             }
-            while (node.parent.kind === 201 /* PropertyAccessExpression */) {
-                node = node.parent;
-            }
-            return node.parent.kind === 302 /* JSDocNameReference */;
+            return node.parent.kind === 227 /* ExpressionWithTypeArguments */;
         }
         function forEachEnclosingClass(node, callback) {
             var result;
@@ -78287,13 +83700,13 @@ var ts;
             return !!forEachEnclosingClass(node, function (n) { return n === classDeclaration; });
         }
         function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) {
-            while (nodeOnRightSide.parent.kind === 157 /* QualifiedName */) {
+            while (nodeOnRightSide.parent.kind === 160 /* QualifiedName */) {
                 nodeOnRightSide = nodeOnRightSide.parent;
             }
-            if (nodeOnRightSide.parent.kind === 260 /* ImportEqualsDeclaration */) {
+            if (nodeOnRightSide.parent.kind === 264 /* ImportEqualsDeclaration */) {
                 return nodeOnRightSide.parent.moduleReference === nodeOnRightSide ? nodeOnRightSide.parent : undefined;
             }
-            if (nodeOnRightSide.parent.kind === 266 /* ExportAssignment */) {
+            if (nodeOnRightSide.parent.kind === 270 /* ExportAssignment */) {
                 return nodeOnRightSide.parent.expression === nodeOnRightSide ? nodeOnRightSide.parent : undefined;
             }
             return undefined;
@@ -78319,7 +83732,7 @@ var ts;
                 node = parent;
                 parent = parent.parent;
             }
-            if (parent && parent.kind === 195 /* ImportType */ && parent.qualifier === node) {
+            if (parent && parent.kind === 199 /* ImportType */ && parent.qualifier === node) {
                 return parent;
             }
             return undefined;
@@ -78329,17 +83742,17 @@ var ts;
                 return getSymbolOfNode(name.parent);
             }
             if (ts.isInJSFile(name) &&
-                name.parent.kind === 201 /* PropertyAccessExpression */ &&
+                name.parent.kind === 205 /* PropertyAccessExpression */ &&
                 name.parent === name.parent.parent.left) {
                 // Check if this is a special property assignment
-                if (!ts.isPrivateIdentifier(name)) {
+                if (!ts.isPrivateIdentifier(name) && !ts.isJSDocMemberName(name)) {
                     var specialPropertyAssignmentSymbol = getSpecialPropertyAssignmentSymbolFromEntityName(name);
                     if (specialPropertyAssignmentSymbol) {
                         return specialPropertyAssignmentSymbol;
                     }
                 }
             }
-            if (name.parent.kind === 266 /* ExportAssignment */ && ts.isEntityNameExpression(name)) {
+            if (name.parent.kind === 270 /* ExportAssignment */ && ts.isEntityNameExpression(name)) {
                 // Even an entity name expression that doesn't resolve as an entityname may still typecheck as a property access expression
                 var success = resolveEntityName(name, 
                 /*all meanings*/ 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*ignoreErrors*/ true);
@@ -78347,13 +83760,13 @@ var ts;
                     return success;
                 }
             }
-            else if (!ts.isPropertyAccessExpression(name) && !ts.isPrivateIdentifier(name) && isInRightSideOfImportOrExportAssignment(name)) {
+            else if (ts.isEntityName(name) && isInRightSideOfImportOrExportAssignment(name)) {
                 // Since we already checked for ExportAssignment, this really could only be an Import
-                var importEqualsDeclaration = ts.getAncestor(name, 260 /* ImportEqualsDeclaration */);
+                var importEqualsDeclaration = ts.getAncestor(name, 264 /* ImportEqualsDeclaration */);
                 ts.Debug.assert(importEqualsDeclaration !== undefined);
                 return getSymbolOfPartOfRightHandSideOfImportEquals(name, /*dontResolveAlias*/ true);
             }
-            if (!ts.isPropertyAccessExpression(name) && !ts.isPrivateIdentifier(name)) {
+            if (ts.isEntityName(name)) {
                 var possibleImportNode = isImportTypeQualifierPart(name);
                 if (possibleImportNode) {
                     getTypeFromTypeNode(possibleImportNode);
@@ -78361,13 +83774,13 @@ var ts;
                     return sym === unknownSymbol ? undefined : sym;
                 }
             }
-            while (ts.isRightSideOfQualifiedNameOrPropertyAccess(name)) {
+            while (ts.isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName(name)) {
                 name = name.parent;
             }
             if (isHeritageClauseElementIdentifier(name)) {
                 var meaning = 0 /* None */;
                 // In an interface or class, we're definitely interested in a type.
-                if (name.parent.kind === 223 /* ExpressionWithTypeArguments */) {
+                if (name.parent.kind === 227 /* ExpressionWithTypeArguments */) {
                     meaning = 788968 /* Type */;
                     // In a class 'extends' clause we are also looking for a value.
                     if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(name.parent)) {
@@ -78383,10 +83796,10 @@ var ts;
                     return entityNameSymbol;
                 }
             }
-            if (name.parent.kind === 326 /* JSDocParameterTag */) {
+            if (name.parent.kind === 338 /* JSDocParameterTag */) {
                 return ts.getParameterSymbolFromJSDoc(name.parent);
             }
-            if (name.parent.kind === 159 /* TypeParameter */ && name.parent.parent.kind === 330 /* JSDocTemplateTag */) {
+            if (name.parent.kind === 162 /* TypeParameter */ && name.parent.parent.kind === 342 /* JSDocTemplateTag */) {
                 ts.Debug.assert(!ts.isInJSFile(name)); // Otherwise `isDeclarationName` would have been true.
                 var typeParameter = ts.getTypeParameterFromJsDoc(name.parent);
                 return typeParameter && typeParameter.symbol;
@@ -78396,43 +83809,85 @@ var ts;
                     // Missing entity name.
                     return undefined;
                 }
-                if (name.kind === 78 /* Identifier */) {
+                var isJSDoc_1 = ts.findAncestor(name, ts.or(ts.isJSDocLinkLike, ts.isJSDocNameReference, ts.isJSDocMemberName));
+                var meaning = isJSDoc_1 ? 788968 /* Type */ | 1920 /* Namespace */ | 111551 /* Value */ : 111551 /* Value */;
+                if (name.kind === 79 /* Identifier */) {
                     if (ts.isJSXTagName(name) && isJsxIntrinsicIdentifier(name)) {
                         var symbol = getIntrinsicTagSymbol(name.parent);
                         return symbol === unknownSymbol ? undefined : symbol;
                     }
-                    return resolveEntityName(name, 111551 /* Value */, /*ignoreErrors*/ false, /*dontResolveAlias*/ true);
+                    var result = resolveEntityName(name, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ !isJSDoc_1, ts.getHostSignatureFromJSDoc(name));
+                    if (!result && isJSDoc_1) {
+                        var container = ts.findAncestor(name, ts.or(ts.isClassLike, ts.isInterfaceDeclaration));
+                        if (container) {
+                            return resolveJSDocMemberName(name, getSymbolOfNode(container));
+                        }
+                    }
+                    return result;
+                }
+                else if (ts.isPrivateIdentifier(name)) {
+                    return getSymbolForPrivateIdentifierExpression(name);
                 }
-                else if (name.kind === 201 /* PropertyAccessExpression */ || name.kind === 157 /* QualifiedName */) {
+                else if (name.kind === 205 /* PropertyAccessExpression */ || name.kind === 160 /* QualifiedName */) {
                     var links = getNodeLinks(name);
                     if (links.resolvedSymbol) {
                         return links.resolvedSymbol;
                     }
-                    if (name.kind === 201 /* PropertyAccessExpression */) {
-                        checkPropertyAccessExpression(name);
+                    if (name.kind === 205 /* PropertyAccessExpression */) {
+                        checkPropertyAccessExpression(name, 0 /* Normal */);
                     }
                     else {
-                        checkQualifiedName(name);
+                        checkQualifiedName(name, 0 /* Normal */);
+                    }
+                    if (!links.resolvedSymbol && isJSDoc_1 && ts.isQualifiedName(name)) {
+                        return resolveJSDocMemberName(name);
                     }
                     return links.resolvedSymbol;
                 }
+                else if (ts.isJSDocMemberName(name)) {
+                    return resolveJSDocMemberName(name);
+                }
             }
             else if (isTypeReferenceIdentifier(name)) {
-                var meaning = name.parent.kind === 173 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */;
-                return resolveEntityName(name, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ true);
+                var meaning = name.parent.kind === 177 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */;
+                var symbol = resolveEntityName(name, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ true);
+                return symbol && symbol !== unknownSymbol ? symbol : getUnresolvedSymbolForEntityName(name);
             }
-            else if (isJSDocEntryNameReference(name)) {
-                var meaning = 788968 /* Type */ | 1920 /* Namespace */ | 111551 /* Value */;
-                return resolveEntityName(name, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ true, ts.getHostSignatureFromJSDoc(name));
-            }
-            if (name.parent.kind === 172 /* TypePredicate */) {
+            if (name.parent.kind === 176 /* TypePredicate */) {
                 return resolveEntityName(name, /*meaning*/ 1 /* FunctionScopedVariable */);
             }
-            // Do we want to return undefined here?
             return undefined;
         }
+        /**
+         * Recursively resolve entity names and jsdoc instance references:
+         * 1. K#m as K.prototype.m for a class (or other value) K
+         * 2. K.m as K.prototype.m
+         * 3. I.m as I.m for a type I, or any other I.m that fails to resolve in (1) or (2)
+         *
+         * For unqualified names, a container K may be provided as a second argument.
+         */
+        function resolveJSDocMemberName(name, container) {
+            if (ts.isEntityName(name)) {
+                // resolve static values first
+                var meaning = 788968 /* Type */ | 1920 /* Namespace */ | 111551 /* Value */;
+                var symbol = resolveEntityName(name, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ true, ts.getHostSignatureFromJSDoc(name));
+                if (!symbol && ts.isIdentifier(name) && container) {
+                    symbol = getMergedSymbol(getSymbol(getExportsOfSymbol(container), name.escapedText, meaning));
+                }
+                if (symbol) {
+                    return symbol;
+                }
+            }
+            var left = ts.isIdentifier(name) ? container : resolveJSDocMemberName(name.left);
+            var right = ts.isIdentifier(name) ? name.escapedText : name.right.escapedText;
+            if (left) {
+                var proto = left.flags & 111551 /* Value */ && getPropertyOfType(getTypeOfSymbol(left), "prototype");
+                var t = proto ? getTypeOfSymbol(proto) : getDeclaredTypeOfSymbol(left);
+                return getPropertyOfType(t, right);
+            }
+        }
         function getSymbolAtLocation(node, ignoreErrors) {
-            if (node.kind === 297 /* SourceFile */) {
+            if (node.kind === 303 /* SourceFile */) {
                 return ts.isExternalModule(node) ? getMergedSymbol(node.symbol) : undefined;
             }
             var parent = node.parent;
@@ -78451,12 +83906,12 @@ var ts;
             else if (ts.isLiteralComputedPropertyDeclarationName(node)) {
                 return getSymbolOfNode(parent.parent);
             }
-            if (node.kind === 78 /* Identifier */) {
+            if (node.kind === 79 /* Identifier */) {
                 if (isInRightSideOfImportOrExportAssignment(node)) {
                     return getSymbolOfNameOrPropertyAccessExpression(node);
                 }
-                else if (parent.kind === 198 /* BindingElement */ &&
-                    grandParent.kind === 196 /* ObjectBindingPattern */ &&
+                else if (parent.kind === 202 /* BindingElement */ &&
+                    grandParent.kind === 200 /* ObjectBindingPattern */ &&
                     node === parent.propertyName) {
                     var typeOfPattern = getTypeOfNode(grandParent);
                     var propertyDeclaration = getPropertyOfType(typeOfPattern, node.escapedText);
@@ -78464,14 +83919,24 @@ var ts;
                         return propertyDeclaration;
                     }
                 }
+                else if (ts.isMetaProperty(parent)) {
+                    var parentType = getTypeOfNode(parent);
+                    var propertyDeclaration = getPropertyOfType(parentType, node.escapedText);
+                    if (propertyDeclaration) {
+                        return propertyDeclaration;
+                    }
+                    if (parent.keywordToken === 103 /* NewKeyword */) {
+                        return checkNewTargetMetaProperty(parent).symbol;
+                    }
+                }
             }
             switch (node.kind) {
-                case 78 /* Identifier */:
-                case 79 /* PrivateIdentifier */:
-                case 201 /* PropertyAccessExpression */:
-                case 157 /* QualifiedName */:
+                case 79 /* Identifier */:
+                case 80 /* PrivateIdentifier */:
+                case 205 /* PropertyAccessExpression */:
+                case 160 /* QualifiedName */:
                     return getSymbolOfNameOrPropertyAccessExpression(node);
-                case 107 /* ThisKeyword */:
+                case 108 /* ThisKeyword */:
                     var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false);
                     if (ts.isFunctionLike(container)) {
                         var sig = getSignatureFromDeclaration(container);
@@ -78483,14 +83948,14 @@ var ts;
                         return checkExpression(node).symbol;
                     }
                 // falls through
-                case 187 /* ThisType */:
+                case 191 /* ThisType */:
                     return getTypeFromThisTypeNode(node).symbol;
-                case 105 /* SuperKeyword */:
+                case 106 /* SuperKeyword */:
                     return checkExpression(node).symbol;
-                case 132 /* ConstructorKeyword */:
+                case 134 /* ConstructorKeyword */:
                     // constructor keyword for an overload, should take us to the definition if it exist
                     var constructorDeclaration = node.parent;
-                    if (constructorDeclaration && constructorDeclaration.kind === 166 /* Constructor */) {
+                    if (constructorDeclaration && constructorDeclaration.kind === 170 /* Constructor */) {
                         return constructorDeclaration.parent.symbol;
                     }
                     return undefined;
@@ -78501,7 +83966,7 @@ var ts;
                     // 3). Dynamic import call or require in javascript
                     // 4). type A = import("./f/*gotToDefinitionHere*/oo")
                     if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) ||
-                        ((node.parent.kind === 261 /* ImportDeclaration */ || node.parent.kind === 267 /* ExportDeclaration */) && node.parent.moduleSpecifier === node) ||
+                        ((node.parent.kind === 265 /* ImportDeclaration */ || node.parent.kind === 271 /* ExportDeclaration */) && node.parent.moduleSpecifier === node) ||
                         ((ts.isInJSFile(node) && ts.isRequireCall(node.parent, /*checkArgumentIsStringLiteralLike*/ false)) || ts.isImportCall(node.parent)) ||
                         (ts.isLiteralTypeNode(node.parent) && ts.isLiteralImportTypeNode(node.parent.parent) && node.parent.parent.argument === node.parent)) {
                         return resolveExternalModuleName(node, node, ignoreErrors);
@@ -78518,21 +83983,35 @@ var ts;
                             ? getTypeFromTypeNode(grandParent.objectType)
                             : undefined;
                     return objectType && getPropertyOfType(objectType, ts.escapeLeadingUnderscores(node.text));
-                case 87 /* DefaultKeyword */:
-                case 97 /* FunctionKeyword */:
+                case 88 /* DefaultKeyword */:
+                case 98 /* FunctionKeyword */:
                 case 38 /* EqualsGreaterThanToken */:
-                case 83 /* ClassKeyword */:
+                case 84 /* ClassKeyword */:
                     return getSymbolOfNode(node.parent);
-                case 195 /* ImportType */:
+                case 199 /* ImportType */:
                     return ts.isLiteralImportTypeNode(node) ? getSymbolAtLocation(node.argument.literal, ignoreErrors) : undefined;
-                case 92 /* ExportKeyword */:
+                case 93 /* ExportKeyword */:
                     return ts.isExportAssignment(node.parent) ? ts.Debug.checkDefined(node.parent.symbol) : undefined;
+                case 100 /* ImportKeyword */:
+                case 103 /* NewKeyword */:
+                    return ts.isMetaProperty(node.parent) ? checkMetaPropertyKeyword(node.parent).symbol : undefined;
+                case 230 /* MetaProperty */:
+                    return checkExpression(node).symbol;
                 default:
                     return undefined;
             }
         }
+        function getIndexInfosAtLocation(node) {
+            if (ts.isIdentifier(node) && ts.isPropertyAccessExpression(node.parent) && node.parent.name === node) {
+                var keyType_1 = getLiteralTypeFromPropertyName(node);
+                var objectType = getTypeOfExpression(node.parent.expression);
+                var objectTypes = objectType.flags & 1048576 /* Union */ ? objectType.types : [objectType];
+                return ts.flatMap(objectTypes, function (t) { return ts.filter(getIndexInfosOfType(t), function (info) { return isApplicableIndexType(keyType_1, info.keyType); }); });
+            }
+            return undefined;
+        }
         function getShorthandAssignmentValueSymbol(location) {
-            if (location && location.kind === 289 /* ShorthandPropertyAssignment */) {
+            if (location && location.kind === 295 /* ShorthandPropertyAssignment */) {
                 return resolveEntityName(location.name, 111551 /* Value */ | 2097152 /* Alias */);
             }
             return undefined;
@@ -78599,9 +84078,12 @@ var ts;
                 var symbol = getSymbolAtLocation(node);
                 if (symbol) {
                     var declaredType = getDeclaredTypeOfSymbol(symbol);
-                    return declaredType !== errorType ? declaredType : getTypeOfSymbol(symbol);
+                    return !isErrorType(declaredType) ? declaredType : getTypeOfSymbol(symbol);
                 }
             }
+            if (ts.isMetaProperty(node.parent) && node.parent.keywordToken === node.kind) {
+                return checkMetaPropertyKeyword(node.parent);
+            }
             return errorType;
         }
         // Gets the type of object literal or array literal of destructuring assignment.
@@ -78611,27 +84093,27 @@ var ts;
         // [ a ] from
         //     [a] = [ some array ...]
         function getTypeOfAssignmentPattern(expr) {
-            ts.Debug.assert(expr.kind === 200 /* ObjectLiteralExpression */ || expr.kind === 199 /* ArrayLiteralExpression */);
+            ts.Debug.assert(expr.kind === 204 /* ObjectLiteralExpression */ || expr.kind === 203 /* ArrayLiteralExpression */);
             // If this is from "for of"
             //     for ( { a } of elems) {
             //     }
-            if (expr.parent.kind === 239 /* ForOfStatement */) {
+            if (expr.parent.kind === 243 /* ForOfStatement */) {
                 var iteratedType = checkRightHandSideOfForOf(expr.parent);
                 return checkDestructuringAssignment(expr, iteratedType || errorType);
             }
             // If this is from "for" initializer
             //     for ({a } = elems[0];.....) { }
-            if (expr.parent.kind === 216 /* BinaryExpression */) {
+            if (expr.parent.kind === 220 /* BinaryExpression */) {
                 var iteratedType = getTypeOfExpression(expr.parent.right);
                 return checkDestructuringAssignment(expr, iteratedType || errorType);
             }
             // If this is from nested object binding pattern
             //     for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) {
-            if (expr.parent.kind === 288 /* PropertyAssignment */) {
-                var node_2 = ts.cast(expr.parent.parent, ts.isObjectLiteralExpression);
-                var typeOfParentObjectLiteral = getTypeOfAssignmentPattern(node_2) || errorType;
-                var propertyIndex = ts.indexOfNode(node_2.properties, expr.parent);
-                return checkObjectLiteralDestructuringPropertyAssignment(node_2, typeOfParentObjectLiteral, propertyIndex);
+            if (expr.parent.kind === 294 /* PropertyAssignment */) {
+                var node_3 = ts.cast(expr.parent.parent, ts.isObjectLiteralExpression);
+                var typeOfParentObjectLiteral = getTypeOfAssignmentPattern(node_3) || errorType;
+                var propertyIndex = ts.indexOfNode(node_3.properties, expr.parent);
+                return checkObjectLiteralDestructuringPropertyAssignment(node_3, typeOfParentObjectLiteral, propertyIndex);
             }
             // Array literal assignment - array destructuring pattern
             var node = ts.cast(expr.parent, ts.isArrayLiteralExpression);
@@ -78663,19 +84145,19 @@ var ts;
          */
         function getParentTypeOfClassElement(node) {
             var classSymbol = getSymbolOfNode(node.parent);
-            return ts.hasSyntacticModifier(node, 32 /* Static */)
+            return ts.isStatic(node)
                 ? getTypeOfSymbol(classSymbol)
                 : getDeclaredTypeOfSymbol(classSymbol);
         }
         function getClassElementPropertyKeyType(element) {
             var name = element.name;
             switch (name.kind) {
-                case 78 /* Identifier */:
-                    return getLiteralType(ts.idText(name));
+                case 79 /* Identifier */:
+                    return getStringLiteralType(ts.idText(name));
                 case 8 /* NumericLiteral */:
                 case 10 /* StringLiteral */:
-                    return getLiteralType(name.text);
-                case 158 /* ComputedPropertyName */:
+                    return getStringLiteralType(name.text);
+                case 161 /* ComputedPropertyName */:
                     var nameType = checkComputedPropertyName(name);
                     return isTypeAssignableToKind(nameType, 12288 /* ESSymbolLike */) ? nameType : stringType;
                 default:
@@ -78772,6 +84254,7 @@ var ts;
         // When resolved as an expression identifier, if the given node references an exported entity, return the declaration
         // node of the exported entity's container. Otherwise, return undefined.
         function getReferencedExportContainer(nodeIn, prefixLocals) {
+            var _a;
             var node = ts.getParseTreeNode(nodeIn, ts.isIdentifier);
             if (node) {
                 // When resolving the export container for the name of a module or enum
@@ -78792,7 +84275,7 @@ var ts;
                     }
                     var parentSymbol_1 = getParentOfSymbol(symbol);
                     if (parentSymbol_1) {
-                        if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 297 /* SourceFile */) {
+                        if (parentSymbol_1.flags & 512 /* ValueModule */ && ((_a = parentSymbol_1.valueDeclaration) === null || _a === void 0 ? void 0 : _a.kind) === 303 /* SourceFile */) {
                             var symbolFile = parentSymbol_1.valueDeclaration;
                             var referenceFile = ts.getSourceFileOfNode(node);
                             // If `node` accesses an export and that export isn't in the same file, then symbol is a namespace export, so return undefined.
@@ -78822,11 +84305,12 @@ var ts;
             return undefined;
         }
         function isSymbolOfDestructuredElementOfCatchBinding(symbol) {
-            return ts.isBindingElement(symbol.valueDeclaration)
-                && ts.walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 287 /* CatchClause */;
+            return symbol.valueDeclaration
+                && ts.isBindingElement(symbol.valueDeclaration)
+                && ts.walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 291 /* CatchClause */;
         }
         function isSymbolOfDeclarationWithCollidingName(symbol) {
-            if (symbol.flags & 418 /* BlockScoped */ && !ts.isSourceFile(symbol.valueDeclaration)) {
+            if (symbol.flags & 418 /* BlockScoped */ && symbol.valueDeclaration && !ts.isSourceFile(symbol.valueDeclaration)) {
                 var links = getSymbolLinks(symbol);
                 if (links.isDeclarationWithCollidingName === undefined) {
                     var container = ts.getEnclosingBlockScopeContainer(symbol.valueDeclaration);
@@ -78854,7 +84338,7 @@ var ts;
                             //       they will not collide with anything
                             var isDeclaredInLoop = nodeLinks_1.flags & 524288 /* BlockScopedBindingInLoop */;
                             var inLoopInitializer = ts.isIterationStatement(container, /*lookInLabeledStatements*/ false);
-                            var inLoopBodyBlock = container.kind === 230 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false);
+                            var inLoopBodyBlock = container.kind === 234 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false);
                             links.isDeclarationWithCollidingName = !ts.isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || (!inLoopInitializer && !inLoopBodyBlock));
                         }
                         else {
@@ -78895,28 +84379,28 @@ var ts;
         }
         function isValueAliasDeclaration(node) {
             switch (node.kind) {
-                case 260 /* ImportEqualsDeclaration */:
-                    return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol);
-                case 262 /* ImportClause */:
-                case 263 /* NamespaceImport */:
-                case 265 /* ImportSpecifier */:
-                case 270 /* ExportSpecifier */:
-                    var symbol = getSymbolOfNode(node) || unknownSymbol;
-                    return isAliasResolvedToValue(symbol) && !getTypeOnlyAliasDeclaration(symbol);
-                case 267 /* ExportDeclaration */:
+                case 264 /* ImportEqualsDeclaration */:
+                    return isAliasResolvedToValue(getSymbolOfNode(node));
+                case 266 /* ImportClause */:
+                case 267 /* NamespaceImport */:
+                case 269 /* ImportSpecifier */:
+                case 274 /* ExportSpecifier */:
+                    var symbol = getSymbolOfNode(node);
+                    return !!symbol && isAliasResolvedToValue(symbol) && !getTypeOnlyAliasDeclaration(symbol);
+                case 271 /* ExportDeclaration */:
                     var exportClause = node.exportClause;
                     return !!exportClause && (ts.isNamespaceExport(exportClause) ||
                         ts.some(exportClause.elements, isValueAliasDeclaration));
-                case 266 /* ExportAssignment */:
-                    return node.expression && node.expression.kind === 78 /* Identifier */ ?
-                        isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol) :
+                case 270 /* ExportAssignment */:
+                    return node.expression && node.expression.kind === 79 /* Identifier */ ?
+                        isAliasResolvedToValue(getSymbolOfNode(node)) :
                         true;
             }
             return false;
         }
         function isTopLevelValueImportEqualsWithEntityName(nodeIn) {
             var node = ts.getParseTreeNode(nodeIn, ts.isImportEqualsDeclaration);
-            if (node === undefined || node.parent.kind !== 297 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) {
+            if (node === undefined || node.parent.kind !== 303 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) {
                 // parent is not source file or it is not reference to internal module
                 return false;
             }
@@ -78924,6 +84408,9 @@ var ts;
             return isValue && node.moduleReference && !ts.nodeIsMissing(node.moduleReference);
         }
         function isAliasResolvedToValue(symbol) {
+            if (!symbol) {
+                return false;
+            }
             var target = resolveAlias(symbol);
             if (target === unknownSymbol) {
                 return true;
@@ -78983,13 +84470,13 @@ var ts;
                 !isOptionalParameter(parameter) &&
                 !ts.isJSDocParameterTag(parameter) &&
                 !!parameter.initializer &&
-                !ts.hasSyntacticModifier(parameter, 92 /* ParameterPropertyModifier */);
+                !ts.hasSyntacticModifier(parameter, 16476 /* ParameterPropertyModifier */);
         }
         function isOptionalUninitializedParameterProperty(parameter) {
             return strictNullChecks &&
                 isOptionalParameter(parameter) &&
                 !parameter.initializer &&
-                ts.hasSyntacticModifier(parameter, 92 /* ParameterPropertyModifier */);
+                ts.hasSyntacticModifier(parameter, 16476 /* ParameterPropertyModifier */);
         }
         function isOptionalUninitializedParameter(parameter) {
             return !!strictNullChecks &&
@@ -79016,7 +84503,11 @@ var ts;
             return symbol && getPropertiesOfType(getTypeOfSymbol(symbol)) || ts.emptyArray;
         }
         function getNodeCheckFlags(node) {
-            return getNodeLinks(node).flags || 0;
+            var _a;
+            var nodeId = node.id || 0;
+            if (nodeId < 0 || nodeId >= nodeLinks.length)
+                return 0;
+            return ((_a = nodeLinks[nodeId]) === null || _a === void 0 ? void 0 : _a.flags) || 0;
         }
         function getEnumMemberValue(node) {
             computeEnumMemberValues(node.parent);
@@ -79024,15 +84515,15 @@ var ts;
         }
         function canHaveConstantValue(node) {
             switch (node.kind) {
-                case 291 /* EnumMember */:
-                case 201 /* PropertyAccessExpression */:
-                case 202 /* ElementAccessExpression */:
+                case 297 /* EnumMember */:
+                case 205 /* PropertyAccessExpression */:
+                case 206 /* ElementAccessExpression */:
                     return true;
             }
             return false;
         }
         function getConstantValue(node) {
-            if (node.kind === 291 /* EnumMember */) {
+            if (node.kind === 297 /* EnumMember */) {
                 return getEnumMemberValue(node);
             }
             var symbol = getNodeLinks(node).resolvedSymbol;
@@ -79049,7 +84540,7 @@ var ts;
             return !!(type.flags & 524288 /* Object */) && getSignaturesOfType(type, 0 /* Call */).length > 0;
         }
         function getTypeReferenceSerializationKind(typeNameIn, location) {
-            var _a;
+            var _a, _b;
             // ensure both `typeName` and `location` are parse tree nodes.
             var typeName = ts.getParseTreeNode(typeNameIn, ts.isEntityName);
             if (!typeName)
@@ -79060,9 +84551,14 @@ var ts;
                     return ts.TypeReferenceSerializationKind.Unknown;
             }
             // Resolve the symbol as a value to ensure the type can be reached at runtime during emit.
+            var isTypeOnly = false;
+            if (ts.isQualifiedName(typeName)) {
+                var rootValueSymbol = resolveEntityName(ts.getFirstIdentifier(typeName), 111551 /* Value */, /*ignoreErrors*/ true, /*dontResolveAlias*/ true, location);
+                isTypeOnly = !!((_a = rootValueSymbol === null || rootValueSymbol === void 0 ? void 0 : rootValueSymbol.declarations) === null || _a === void 0 ? void 0 : _a.every(ts.isTypeOnlyImportOrExportDeclaration));
+            }
             var valueSymbol = resolveEntityName(typeName, 111551 /* Value */, /*ignoreErrors*/ true, /*dontResolveAlias*/ true, location);
-            var isTypeOnly = ((_a = valueSymbol === null || valueSymbol === void 0 ? void 0 : valueSymbol.declarations) === null || _a === void 0 ? void 0 : _a.every(ts.isTypeOnlyImportOrExportDeclaration)) || false;
             var resolvedSymbol = valueSymbol && valueSymbol.flags & 2097152 /* Alias */ ? resolveAlias(valueSymbol) : valueSymbol;
+            isTypeOnly || (isTypeOnly = !!((_b = valueSymbol === null || valueSymbol === void 0 ? void 0 : valueSymbol.declarations) === null || _b === void 0 ? void 0 : _b.every(ts.isTypeOnlyImportOrExportDeclaration)));
             // Resolve the symbol as a type so that we can provide a more useful hint for the type serializer.
             var typeSymbol = resolveEntityName(typeName, 788968 /* Type */, /*ignoreErrors*/ true, /*dontResolveAlias*/ false, location);
             if (resolvedSymbol && resolvedSymbol === typeSymbol) {
@@ -79080,7 +84576,7 @@ var ts;
                 return isTypeOnly ? ts.TypeReferenceSerializationKind.ObjectType : ts.TypeReferenceSerializationKind.Unknown;
             }
             var type = getDeclaredTypeOfSymbol(typeSymbol);
-            if (type === errorType) {
+            if (isErrorType(type)) {
                 return isTypeOnly ? ts.TypeReferenceSerializationKind.ObjectType : ts.TypeReferenceSerializationKind.Unknown;
             }
             else if (type.flags & 3 /* AnyOrUnknown */) {
@@ -79120,7 +84616,7 @@ var ts;
         function createTypeOfDeclaration(declarationIn, enclosingDeclaration, flags, tracker, addUndefined) {
             var declaration = ts.getParseTreeNode(declarationIn, ts.isVariableLikeOrAccessor);
             if (!declaration) {
-                return ts.factory.createToken(128 /* AnyKeyword */);
+                return ts.factory.createToken(130 /* AnyKeyword */);
             }
             // Get type of the symbol if this is the valid symbol otherwise get type at location
             var symbol = getSymbolOfNode(declaration);
@@ -79139,7 +84635,7 @@ var ts;
         function createReturnTypeOfSignatureDeclaration(signatureDeclarationIn, enclosingDeclaration, flags, tracker) {
             var signatureDeclaration = ts.getParseTreeNode(signatureDeclarationIn, ts.isFunctionLike);
             if (!signatureDeclaration) {
-                return ts.factory.createToken(128 /* AnyKeyword */);
+                return ts.factory.createToken(130 /* AnyKeyword */);
             }
             var signature = getSignatureFromDeclaration(signatureDeclaration);
             return nodeBuilder.typeToTypeNode(getReturnTypeOfSignature(signature), enclosingDeclaration, flags | 1024 /* MultilineObjectLiterals */, tracker);
@@ -79147,7 +84643,7 @@ var ts;
         function createTypeOfExpression(exprIn, enclosingDeclaration, flags, tracker) {
             var expr = ts.getParseTreeNode(exprIn, ts.isExpression);
             if (!expr) {
-                return ts.factory.createToken(128 /* AnyKeyword */);
+                return ts.factory.createToken(130 /* AnyKeyword */);
             }
             var type = getWidenedType(getRegularTypeOfExpression(expr));
             return nodeBuilder.typeToTypeNode(type, enclosingDeclaration, flags | 1024 /* MultilineObjectLiterals */, tracker);
@@ -79304,12 +84800,12 @@ var ts;
                 getJsxFragmentFactoryEntity: getJsxFragmentFactoryEntity,
                 getAllAccessorDeclarations: function (accessor) {
                     accessor = ts.getParseTreeNode(accessor, ts.isGetOrSetAccessorDeclaration); // TODO: GH#18217
-                    var otherKind = accessor.kind === 168 /* SetAccessor */ ? 167 /* GetAccessor */ : 168 /* SetAccessor */;
+                    var otherKind = accessor.kind === 172 /* SetAccessor */ ? 171 /* GetAccessor */ : 172 /* SetAccessor */;
                     var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(accessor), otherKind);
                     var firstAccessor = otherAccessor && (otherAccessor.pos < accessor.pos) ? otherAccessor : accessor;
                     var secondAccessor = otherAccessor && (otherAccessor.pos < accessor.pos) ? accessor : otherAccessor;
-                    var setAccessor = accessor.kind === 168 /* SetAccessor */ ? accessor : otherAccessor;
-                    var getAccessor = accessor.kind === 167 /* GetAccessor */ ? accessor : otherAccessor;
+                    var setAccessor = accessor.kind === 172 /* SetAccessor */ ? accessor : otherAccessor;
+                    var getAccessor = accessor.kind === 171 /* GetAccessor */ ? accessor : otherAccessor;
                     return {
                         firstAccessor: firstAccessor,
                         secondAccessor: secondAccessor,
@@ -79325,7 +84821,7 @@ var ts;
                 },
                 getDeclarationStatementsForSourceFile: function (node, flags, tracker, bundled) {
                     var n = ts.getParseTreeNode(node);
-                    ts.Debug.assert(n && n.kind === 297 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile");
+                    ts.Debug.assert(n && n.kind === 303 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile");
                     var sym = getSymbolOfNode(node);
                     if (!sym) {
                         return !node.locals ? [] : nodeBuilder.symbolTableToDeclarationStatements(node.locals, node, flags, tracker, bundled);
@@ -79348,11 +84844,13 @@ var ts;
                     var s = _a[_i];
                     if (s.mergeId) {
                         var merged = getMergedSymbol(s);
-                        for (var _b = 0, _c = merged.declarations; _b < _c.length; _b++) {
-                            var d = _c[_b];
-                            var declFile = ts.getSourceFileOfNode(d);
-                            if (declFile === importTarget) {
-                                return true;
+                        if (merged.declarations) {
+                            for (var _b = 0, _c = merged.declarations; _b < _c.length; _b++) {
+                                var d = _c[_b];
+                                var declFile = ts.getSourceFileOfNode(d);
+                                if (declFile === importTarget) {
+                                    return true;
+                                }
                             }
                         }
                     }
@@ -79360,7 +84858,7 @@ var ts;
                 return false;
             }
             function isInHeritageClause(node) {
-                return node.parent && node.parent.kind === 223 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 286 /* HeritageClause */;
+                return node.parent && node.parent.kind === 227 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 290 /* HeritageClause */;
             }
             // defined here to avoid outer scope pollution
             function getTypeReferenceDirectivesForEntityName(node) {
@@ -79372,7 +84870,7 @@ var ts;
                 // qualified names can only be used as types\namespaces
                 // identifiers are treated as values only if they appear in type queries
                 var meaning = 788968 /* Type */ | 1920 /* Namespace */;
-                if ((node.kind === 78 /* Identifier */ && isInTypeQuery(node)) || (node.kind === 201 /* PropertyAccessExpression */ && !isInHeritageClause(node))) {
+                if ((node.kind === 79 /* Identifier */ && isInTypeQuery(node)) || (node.kind === 205 /* PropertyAccessExpression */ && !isInHeritageClause(node))) {
                     meaning = 111551 /* Value */ | 1048576 /* ExportValue */;
                 }
                 var symbol = resolveEntityName(node, meaning, /*ignoreErrors*/ true);
@@ -79381,10 +84879,7 @@ var ts;
             // defined here to avoid outer scope pollution
             function getTypeReferenceDirectivesForSymbol(symbol, meaning) {
                 // program does not have any files with type reference directives - bail out
-                if (!fileToDirective) {
-                    return undefined;
-                }
-                if (!isSymbolFromTypeDeclarationFile(symbol)) {
+                if (!fileToDirective || !isSymbolFromTypeDeclarationFile(symbol)) {
                     return undefined;
                 }
                 // check what declarations in the symbol can contribute to the target meaning
@@ -79423,7 +84918,7 @@ var ts;
                         break;
                     }
                 }
-                if (current.valueDeclaration && current.valueDeclaration.kind === 297 /* SourceFile */ && current.flags & 512 /* ValueModule */) {
+                if (current.valueDeclaration && current.valueDeclaration.kind === 303 /* SourceFile */ && current.flags & 512 /* ValueModule */) {
                     return false;
                 }
                 // check that at least one declaration of top level symbol originates from type declaration file
@@ -79451,12 +84946,12 @@ var ts;
             }
         }
         function getExternalModuleFileFromDeclaration(declaration) {
-            var specifier = declaration.kind === 256 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration);
+            var specifier = declaration.kind === 260 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration);
             var moduleSymbol = resolveExternalModuleNameWorker(specifier, specifier, /*moduleNotFoundError*/ undefined); // TODO: GH#18217
             if (!moduleSymbol) {
                 return undefined;
             }
-            return ts.getDeclarationOfKind(moduleSymbol, 297 /* SourceFile */);
+            return ts.getDeclarationOfKind(moduleSymbol, 303 /* SourceFile */);
         }
         function initializeTypeChecker() {
             // Bind all source files and propagate errors
@@ -79476,7 +84971,7 @@ var ts;
                     // It is an error for a non-external-module (i.e. script) to declare its own `globalThis`.
                     // We can't use `builtinGlobals` for this due to synthetic expando-namespace generation in JS files.
                     var fileGlobalThisSymbol = file.locals.get("globalThis");
-                    if (fileGlobalThisSymbol) {
+                    if (fileGlobalThisSymbol === null || fileGlobalThisSymbol === void 0 ? void 0 : fileGlobalThisSymbol.declarations) {
                         for (var _d = 0, _e = fileGlobalThisSymbol.declarations; _d < _e.length; _d++) {
                             var declaration = _e[_d];
                             diagnostics.add(ts.createDiagnosticForNode(declaration, ts.Diagnostics.Declaration_name_conflicts_with_built_in_global_identifier_0, "globalThis"));
@@ -79542,7 +85037,7 @@ var ts;
             autoArrayType = createArrayType(autoType);
             if (autoArrayType === emptyObjectType) {
                 // autoArrayType is used as a marker, so even if global Array type is not defined, it needs to be a unique type
-                autoArrayType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);
+                autoArrayType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
             }
             globalReadonlyArrayType = getGlobalTypeOrUndefined("ReadonlyArray", /*arity*/ 1) || globalArrayType;
             anyReadonlyArrayType = globalReadonlyArrayType ? createTypeFromGenericGlobalType(globalReadonlyArrayType, [anyType]) : anyArrayType;
@@ -79593,13 +85088,28 @@ var ts;
                     var helpersModule = resolveHelpersModule(sourceFile, location);
                     if (helpersModule !== unknownSymbol) {
                         var uncheckedHelpers = helpers & ~requestedExternalEmitHelpers;
-                        for (var helper = 1 /* FirstEmitHelper */; helper <= 2097152 /* LastEmitHelper */; helper <<= 1) {
+                        for (var helper = 1 /* FirstEmitHelper */; helper <= 4194304 /* LastEmitHelper */; helper <<= 1) {
                             if (uncheckedHelpers & helper) {
                                 var name = getHelperName(helper);
                                 var symbol = getSymbol(helpersModule.exports, ts.escapeLeadingUnderscores(name), 111551 /* Value */);
                                 if (!symbol) {
                                     error(location, ts.Diagnostics.This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0, ts.externalHelpersModuleNameText, name);
                                 }
+                                else if (helper & 524288 /* ClassPrivateFieldGet */) {
+                                    if (!ts.some(getSignaturesOfSymbol(symbol), function (signature) { return getParameterCount(signature) > 3; })) {
+                                        error(location, ts.Diagnostics.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, ts.externalHelpersModuleNameText, name, 4);
+                                    }
+                                }
+                                else if (helper & 1048576 /* ClassPrivateFieldSet */) {
+                                    if (!ts.some(getSignaturesOfSymbol(symbol), function (signature) { return getParameterCount(signature) > 4; })) {
+                                        error(location, ts.Diagnostics.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, ts.externalHelpersModuleNameText, name, 5);
+                                    }
+                                }
+                                else if (helper & 1024 /* SpreadArray */) {
+                                    if (!ts.some(getSignaturesOfSymbol(symbol), function (signature) { return getParameterCount(signature) > 2; })) {
+                                        error(location, ts.Diagnostics.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, ts.externalHelpersModuleNameText, name, 3);
+                                    }
+                                }
                             }
                         }
                     }
@@ -79630,7 +85140,8 @@ var ts;
                 case 262144 /* MakeTemplateObject */: return "__makeTemplateObject";
                 case 524288 /* ClassPrivateFieldGet */: return "__classPrivateFieldGet";
                 case 1048576 /* ClassPrivateFieldSet */: return "__classPrivateFieldSet";
-                case 2097152 /* CreateBinding */: return "__createBinding";
+                case 2097152 /* ClassPrivateFieldIn */: return "__classPrivateFieldIn";
+                case 4194304 /* CreateBinding */: return "__createBinding";
                 default: return ts.Debug.fail("Unrecognized helper");
             }
         }
@@ -79649,14 +85160,14 @@ var ts;
                 return false;
             }
             if (!ts.nodeCanBeDecorated(node, node.parent, node.parent.parent)) {
-                if (node.kind === 165 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) {
+                if (node.kind === 168 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) {
                     return grammarErrorOnFirstToken(node, ts.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload);
                 }
                 else {
                     return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here);
                 }
             }
-            else if (node.kind === 167 /* GetAccessor */ || node.kind === 168 /* SetAccessor */) {
+            else if (node.kind === 171 /* GetAccessor */ || node.kind === 172 /* SetAccessor */) {
                 var accessors = ts.getAllAccessorDeclarations(node.parent.members, node);
                 if (accessors.firstAccessor.decorators && node === accessors.secondAccessor) {
                     return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name);
@@ -79669,31 +85180,51 @@ var ts;
             if (quickResult !== undefined) {
                 return quickResult;
             }
-            var lastStatic, lastDeclare, lastAsync, lastReadonly;
+            var lastStatic, lastDeclare, lastAsync, lastReadonly, lastOverride;
             var flags = 0 /* None */;
             for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) {
                 var modifier = _a[_i];
-                if (modifier.kind !== 142 /* ReadonlyKeyword */) {
-                    if (node.kind === 162 /* PropertySignature */ || node.kind === 164 /* MethodSignature */) {
+                if (modifier.kind !== 144 /* ReadonlyKeyword */) {
+                    if (node.kind === 165 /* PropertySignature */ || node.kind === 167 /* MethodSignature */) {
                         return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_type_member, ts.tokenToString(modifier.kind));
                     }
-                    if (node.kind === 171 /* IndexSignature */) {
+                    if (node.kind === 175 /* IndexSignature */ && (modifier.kind !== 124 /* StaticKeyword */ || !ts.isClassLike(node.parent))) {
                         return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_an_index_signature, ts.tokenToString(modifier.kind));
                     }
                 }
                 switch (modifier.kind) {
-                    case 84 /* ConstKeyword */:
-                        if (node.kind !== 255 /* EnumDeclaration */) {
-                            return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(84 /* ConstKeyword */));
+                    case 85 /* ConstKeyword */:
+                        if (node.kind !== 259 /* EnumDeclaration */) {
+                            return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(85 /* ConstKeyword */));
+                        }
+                        break;
+                    case 158 /* OverrideKeyword */:
+                        // If node.kind === SyntaxKind.Parameter, checkParameter reports an error if it's not a parameter property.
+                        if (flags & 16384 /* Override */) {
+                            return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "override");
                         }
+                        else if (flags & 2 /* Ambient */) {
+                            return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "override", "declare");
+                        }
+                        else if (flags & 64 /* Readonly */) {
+                            return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "override", "readonly");
+                        }
+                        else if (flags & 256 /* Async */) {
+                            return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "override", "async");
+                        }
+                        flags |= 16384 /* Override */;
+                        lastOverride = modifier;
                         break;
-                    case 122 /* PublicKeyword */:
-                    case 121 /* ProtectedKeyword */:
-                    case 120 /* PrivateKeyword */:
+                    case 123 /* PublicKeyword */:
+                    case 122 /* ProtectedKeyword */:
+                    case 121 /* PrivateKeyword */:
                         var text = visibilityToString(ts.modifierToFlag(modifier.kind));
                         if (flags & 28 /* AccessibilityModifier */) {
                             return grammarErrorOnNode(modifier, ts.Diagnostics.Accessibility_modifier_already_seen);
                         }
+                        else if (flags & 16384 /* Override */) {
+                            return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "override");
+                        }
                         else if (flags & 32 /* Static */) {
                             return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "static");
                         }
@@ -79703,23 +85234,23 @@ var ts;
                         else if (flags & 256 /* Async */) {
                             return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async");
                         }
-                        else if (node.parent.kind === 257 /* ModuleBlock */ || node.parent.kind === 297 /* SourceFile */) {
+                        else if (node.parent.kind === 261 /* ModuleBlock */ || node.parent.kind === 303 /* SourceFile */) {
                             return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text);
                         }
                         else if (flags & 128 /* Abstract */) {
-                            if (modifier.kind === 120 /* PrivateKeyword */) {
+                            if (modifier.kind === 121 /* PrivateKeyword */) {
                                 return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_with_1_modifier, text, "abstract");
                             }
                             else {
                                 return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "abstract");
                             }
                         }
-                        else if (ts.isPrivateIdentifierPropertyDeclaration(node)) {
+                        else if (ts.isPrivateIdentifierClassElementDeclaration(node)) {
                             return grammarErrorOnNode(modifier, ts.Diagnostics.An_accessibility_modifier_cannot_be_used_with_a_private_identifier);
                         }
                         flags |= ts.modifierToFlag(modifier.kind);
                         break;
-                    case 123 /* StaticKeyword */:
+                    case 124 /* StaticKeyword */:
                         if (flags & 32 /* Static */) {
                             return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "static");
                         }
@@ -79729,33 +85260,33 @@ var ts;
                         else if (flags & 256 /* Async */) {
                             return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async");
                         }
-                        else if (node.parent.kind === 257 /* ModuleBlock */ || node.parent.kind === 297 /* SourceFile */) {
+                        else if (node.parent.kind === 261 /* ModuleBlock */ || node.parent.kind === 303 /* SourceFile */) {
                             return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static");
                         }
-                        else if (node.kind === 160 /* Parameter */) {
+                        else if (node.kind === 163 /* Parameter */) {
                             return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static");
                         }
                         else if (flags & 128 /* Abstract */) {
                             return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "static", "abstract");
                         }
-                        else if (ts.isPrivateIdentifierPropertyDeclaration(node)) {
-                            return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "static");
+                        else if (flags & 16384 /* Override */) {
+                            return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "override");
                         }
                         flags |= 32 /* Static */;
                         lastStatic = modifier;
                         break;
-                    case 142 /* ReadonlyKeyword */:
+                    case 144 /* ReadonlyKeyword */:
                         if (flags & 64 /* Readonly */) {
                             return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "readonly");
                         }
-                        else if (node.kind !== 163 /* PropertyDeclaration */ && node.kind !== 162 /* PropertySignature */ && node.kind !== 171 /* IndexSignature */ && node.kind !== 160 /* Parameter */) {
-                            // If node.kind === SyntaxKind.Parameter, checkParameter report an error if it's not a parameter property.
+                        else if (node.kind !== 166 /* PropertyDeclaration */ && node.kind !== 165 /* PropertySignature */ && node.kind !== 175 /* IndexSignature */ && node.kind !== 163 /* Parameter */) {
+                            // If node.kind === SyntaxKind.Parameter, checkParameter reports an error if it's not a parameter property.
                             return grammarErrorOnNode(modifier, ts.Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature);
                         }
                         flags |= 64 /* Readonly */;
                         lastReadonly = modifier;
                         break;
-                    case 92 /* ExportKeyword */:
+                    case 93 /* ExportKeyword */:
                         if (flags & 1 /* Export */) {
                             return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "export");
                         }
@@ -79771,53 +85302,59 @@ var ts;
                         else if (ts.isClassLike(node.parent)) {
                             return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "export");
                         }
-                        else if (node.kind === 160 /* Parameter */) {
+                        else if (node.kind === 163 /* Parameter */) {
                             return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export");
                         }
                         flags |= 1 /* Export */;
                         break;
-                    case 87 /* DefaultKeyword */:
-                        var container = node.parent.kind === 297 /* SourceFile */ ? node.parent : node.parent.parent;
-                        if (container.kind === 256 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) {
+                    case 88 /* DefaultKeyword */:
+                        var container = node.parent.kind === 303 /* SourceFile */ ? node.parent : node.parent.parent;
+                        if (container.kind === 260 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) {
                             return grammarErrorOnNode(modifier, ts.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module);
                         }
+                        else if (!(flags & 1 /* Export */)) {
+                            return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "default");
+                        }
                         flags |= 512 /* Default */;
                         break;
-                    case 133 /* DeclareKeyword */:
+                    case 135 /* DeclareKeyword */:
                         if (flags & 2 /* Ambient */) {
                             return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "declare");
                         }
                         else if (flags & 256 /* Async */) {
                             return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async");
                         }
+                        else if (flags & 16384 /* Override */) {
+                            return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "override");
+                        }
                         else if (ts.isClassLike(node.parent) && !ts.isPropertyDeclaration(node)) {
                             return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "declare");
                         }
-                        else if (node.kind === 160 /* Parameter */) {
+                        else if (node.kind === 163 /* Parameter */) {
                             return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare");
                         }
-                        else if ((node.parent.flags & 8388608 /* Ambient */) && node.parent.kind === 257 /* ModuleBlock */) {
+                        else if ((node.parent.flags & 8388608 /* Ambient */) && node.parent.kind === 261 /* ModuleBlock */) {
                             return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context);
                         }
-                        else if (ts.isPrivateIdentifierPropertyDeclaration(node)) {
+                        else if (ts.isPrivateIdentifierClassElementDeclaration(node)) {
                             return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "declare");
                         }
                         flags |= 2 /* Ambient */;
                         lastDeclare = modifier;
                         break;
-                    case 125 /* AbstractKeyword */:
+                    case 126 /* AbstractKeyword */:
                         if (flags & 128 /* Abstract */) {
                             return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract");
                         }
-                        if (node.kind !== 252 /* ClassDeclaration */ &&
-                            node.kind !== 175 /* ConstructorType */) {
-                            if (node.kind !== 165 /* MethodDeclaration */ &&
-                                node.kind !== 163 /* PropertyDeclaration */ &&
-                                node.kind !== 167 /* GetAccessor */ &&
-                                node.kind !== 168 /* SetAccessor */) {
+                        if (node.kind !== 256 /* ClassDeclaration */ &&
+                            node.kind !== 179 /* ConstructorType */) {
+                            if (node.kind !== 168 /* MethodDeclaration */ &&
+                                node.kind !== 166 /* PropertyDeclaration */ &&
+                                node.kind !== 171 /* GetAccessor */ &&
+                                node.kind !== 172 /* SetAccessor */) {
                                 return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration);
                             }
-                            if (!(node.parent.kind === 252 /* ClassDeclaration */ && ts.hasSyntacticModifier(node.parent, 128 /* Abstract */))) {
+                            if (!(node.parent.kind === 256 /* ClassDeclaration */ && ts.hasSyntacticModifier(node.parent, 128 /* Abstract */))) {
                                 return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class);
                             }
                             if (flags & 32 /* Static */) {
@@ -79829,20 +85366,23 @@ var ts;
                             if (flags & 256 /* Async */ && lastAsync) {
                                 return grammarErrorOnNode(lastAsync, ts.Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract");
                             }
+                            if (flags & 16384 /* Override */) {
+                                return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "abstract", "override");
+                            }
                         }
-                        if (ts.isNamedDeclaration(node) && node.name.kind === 79 /* PrivateIdentifier */) {
+                        if (ts.isNamedDeclaration(node) && node.name.kind === 80 /* PrivateIdentifier */) {
                             return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "abstract");
                         }
                         flags |= 128 /* Abstract */;
                         break;
-                    case 129 /* AsyncKeyword */:
+                    case 131 /* AsyncKeyword */:
                         if (flags & 256 /* Async */) {
                             return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "async");
                         }
                         else if (flags & 2 /* Ambient */ || node.parent.flags & 8388608 /* Ambient */) {
                             return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async");
                         }
-                        else if (node.kind === 160 /* Parameter */) {
+                        else if (node.kind === 163 /* Parameter */) {
                             return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async");
                         }
                         if (flags & 128 /* Abstract */) {
@@ -79853,13 +85393,16 @@ var ts;
                         break;
                 }
             }
-            if (node.kind === 166 /* Constructor */) {
+            if (node.kind === 170 /* Constructor */) {
                 if (flags & 32 /* Static */) {
                     return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static");
                 }
                 if (flags & 128 /* Abstract */) {
                     return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "abstract"); // TODO: GH#18217
                 }
+                if (flags & 16384 /* Override */) {
+                    return grammarErrorOnNode(lastOverride, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "override"); // TODO: GH#18217
+                }
                 else if (flags & 256 /* Async */) {
                     return grammarErrorOnNode(lastAsync, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "async");
                 }
@@ -79868,13 +85411,13 @@ var ts;
                 }
                 return false;
             }
-            else if ((node.kind === 261 /* ImportDeclaration */ || node.kind === 260 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) {
+            else if ((node.kind === 265 /* ImportDeclaration */ || node.kind === 264 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) {
                 return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare");
             }
-            else if (node.kind === 160 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) {
+            else if (node.kind === 163 /* Parameter */ && (flags & 16476 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) {
                 return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern);
             }
-            else if (node.kind === 160 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) {
+            else if (node.kind === 163 /* Parameter */ && (flags & 16476 /* ParameterPropertyModifier */) && node.dotDotDotToken) {
                 return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter);
             }
             if (flags & 256 /* Async */) {
@@ -79895,39 +85438,40 @@ var ts;
         }
         function shouldReportBadModifier(node) {
             switch (node.kind) {
-                case 167 /* GetAccessor */:
-                case 168 /* SetAccessor */:
-                case 166 /* Constructor */:
-                case 163 /* PropertyDeclaration */:
-                case 162 /* PropertySignature */:
-                case 165 /* MethodDeclaration */:
-                case 164 /* MethodSignature */:
-                case 171 /* IndexSignature */:
-                case 256 /* ModuleDeclaration */:
-                case 261 /* ImportDeclaration */:
-                case 260 /* ImportEqualsDeclaration */:
-                case 267 /* ExportDeclaration */:
-                case 266 /* ExportAssignment */:
-                case 208 /* FunctionExpression */:
-                case 209 /* ArrowFunction */:
-                case 160 /* Parameter */:
+                case 171 /* GetAccessor */:
+                case 172 /* SetAccessor */:
+                case 170 /* Constructor */:
+                case 166 /* PropertyDeclaration */:
+                case 165 /* PropertySignature */:
+                case 168 /* MethodDeclaration */:
+                case 167 /* MethodSignature */:
+                case 175 /* IndexSignature */:
+                case 260 /* ModuleDeclaration */:
+                case 265 /* ImportDeclaration */:
+                case 264 /* ImportEqualsDeclaration */:
+                case 271 /* ExportDeclaration */:
+                case 270 /* ExportAssignment */:
+                case 212 /* FunctionExpression */:
+                case 213 /* ArrowFunction */:
+                case 163 /* Parameter */:
                     return false;
                 default:
-                    if (node.parent.kind === 257 /* ModuleBlock */ || node.parent.kind === 297 /* SourceFile */) {
+                    if (node.parent.kind === 261 /* ModuleBlock */ || node.parent.kind === 303 /* SourceFile */) {
                         return false;
                     }
                     switch (node.kind) {
-                        case 251 /* FunctionDeclaration */:
-                            return nodeHasAnyModifiersExcept(node, 129 /* AsyncKeyword */);
-                        case 252 /* ClassDeclaration */:
-                        case 175 /* ConstructorType */:
-                            return nodeHasAnyModifiersExcept(node, 125 /* AbstractKeyword */);
-                        case 253 /* InterfaceDeclaration */:
-                        case 232 /* VariableStatement */:
-                        case 254 /* TypeAliasDeclaration */:
+                        case 255 /* FunctionDeclaration */:
+                            return nodeHasAnyModifiersExcept(node, 131 /* AsyncKeyword */);
+                        case 256 /* ClassDeclaration */:
+                        case 179 /* ConstructorType */:
+                            return nodeHasAnyModifiersExcept(node, 126 /* AbstractKeyword */);
+                        case 257 /* InterfaceDeclaration */:
+                        case 236 /* VariableStatement */:
+                        case 258 /* TypeAliasDeclaration */:
+                        case 169 /* ClassStaticBlockDeclaration */:
                             return true;
-                        case 255 /* EnumDeclaration */:
-                            return nodeHasAnyModifiersExcept(node, 84 /* ConstKeyword */);
+                        case 259 /* EnumDeclaration */:
+                            return nodeHasAnyModifiersExcept(node, 85 /* ConstKeyword */);
                         default:
                             ts.Debug.fail();
                     }
@@ -79938,10 +85482,10 @@ var ts;
         }
         function checkGrammarAsyncModifier(node, asyncModifier) {
             switch (node.kind) {
-                case 165 /* MethodDeclaration */:
-                case 251 /* FunctionDeclaration */:
-                case 208 /* FunctionExpression */:
-                case 209 /* ArrowFunction */:
+                case 168 /* MethodDeclaration */:
+                case 255 /* FunctionDeclaration */:
+                case 212 /* FunctionExpression */:
+                case 213 /* ArrowFunction */:
                     return false;
             }
             return grammarErrorOnNode(asyncModifier, ts.Diagnostics._0_modifier_cannot_be_used_here, "async");
@@ -80004,7 +85548,7 @@ var ts;
                             ts.addRelatedInfo(error(parameter, ts.Diagnostics.This_parameter_is_not_allowed_with_use_strict_directive), ts.createDiagnosticForNode(useStrictDirective_1, ts.Diagnostics.use_strict_directive_used_here));
                         });
                         var diagnostics_2 = nonSimpleParameters.map(function (parameter, index) { return (index === 0 ? ts.createDiagnosticForNode(parameter, ts.Diagnostics.Non_simple_parameter_declared_here) : ts.createDiagnosticForNode(parameter, ts.Diagnostics.and_here)); });
-                        ts.addRelatedInfo.apply(void 0, __spreadArray([error(useStrictDirective_1, ts.Diagnostics.use_strict_directive_cannot_be_used_with_non_simple_parameter_list)], diagnostics_2));
+                        ts.addRelatedInfo.apply(void 0, __spreadArray([error(useStrictDirective_1, ts.Diagnostics.use_strict_directive_cannot_be_used_with_non_simple_parameter_list)], diagnostics_2, false));
                         return true;
                     }
                 }
@@ -80029,6 +85573,11 @@ var ts;
             if (!ts.isArrowFunction(node)) {
                 return false;
             }
+            if (node.typeParameters && !(ts.length(node.typeParameters) > 1 || node.typeParameters.hasTrailingComma || node.typeParameters[0].constraint)) {
+                if (file && ts.fileExtensionIsOneOf(file.fileName, [".mts" /* Mts */, ".cts" /* Cts */])) {
+                    grammarErrorOnNode(node.typeParameters[0], ts.Diagnostics.This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_constraint);
+                }
+            }
             var equalsGreaterThanToken = node.equalsGreaterThanToken;
             var startLine = ts.getLineAndCharacterOfPosition(file, equalsGreaterThanToken.pos).line;
             var endLine = ts.getLineAndCharacterOfPosition(file, equalsGreaterThanToken.end).line;
@@ -80060,15 +85609,12 @@ var ts;
             if (!parameter.type) {
                 return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation);
             }
-            if (parameter.type.kind !== 147 /* StringKeyword */ && parameter.type.kind !== 144 /* NumberKeyword */) {
-                var type = getTypeFromTypeNode(parameter.type);
-                if (type.flags & 4 /* String */ || type.flags & 8 /* Number */) {
-                    return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead, ts.getTextOfNode(parameter.name), typeToString(type), typeToString(node.type ? getTypeFromTypeNode(node.type) : anyType));
-                }
-                if (type.flags & 1048576 /* Union */ && allTypesAssignableToKind(type, 384 /* StringOrNumberLiteral */, /*strict*/ true)) {
-                    return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead);
-                }
-                return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_either_string_or_number);
+            var type = getTypeFromTypeNode(parameter.type);
+            if (someType(type, function (t) { return !!(t.flags & 8576 /* StringOrNumberLiteralOrUnique */); }) || isGenericType(type)) {
+                return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead);
+            }
+            if (!everyType(type, isValidIndexKeyType)) {
+                return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type);
             }
             if (!node.type) {
                 return grammarErrorOnNode(node, ts.Diagnostics.An_index_signature_must_have_a_type_annotation);
@@ -80102,7 +85648,7 @@ var ts;
             if (args) {
                 for (var _i = 0, args_4 = args; _i < args_4.length; _i++) {
                     var arg = args_4[_i];
-                    if (arg.kind === 222 /* OmittedExpression */) {
+                    if (arg.kind === 226 /* OmittedExpression */) {
                         return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected);
                     }
                 }
@@ -80132,7 +85678,7 @@ var ts;
             if (!checkGrammarDecoratorsAndModifiers(node) && node.heritageClauses) {
                 for (var _i = 0, _a = node.heritageClauses; _i < _a.length; _i++) {
                     var heritageClause = _a[_i];
-                    if (heritageClause.token === 93 /* ExtendsKeyword */) {
+                    if (heritageClause.token === 94 /* ExtendsKeyword */) {
                         if (seenExtendsClause) {
                             return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.extends_clause_already_seen);
                         }
@@ -80145,7 +85691,7 @@ var ts;
                         seenExtendsClause = true;
                     }
                     else {
-                        ts.Debug.assert(heritageClause.token === 116 /* ImplementsKeyword */);
+                        ts.Debug.assert(heritageClause.token === 117 /* ImplementsKeyword */);
                         if (seenImplementsClause) {
                             return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.implements_clause_already_seen);
                         }
@@ -80161,14 +85707,14 @@ var ts;
             if (node.heritageClauses) {
                 for (var _i = 0, _a = node.heritageClauses; _i < _a.length; _i++) {
                     var heritageClause = _a[_i];
-                    if (heritageClause.token === 93 /* ExtendsKeyword */) {
+                    if (heritageClause.token === 94 /* ExtendsKeyword */) {
                         if (seenExtendsClause) {
                             return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.extends_clause_already_seen);
                         }
                         seenExtendsClause = true;
                     }
                     else {
-                        ts.Debug.assert(heritageClause.token === 116 /* ImplementsKeyword */);
+                        ts.Debug.assert(heritageClause.token === 117 /* ImplementsKeyword */);
                         return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.Interface_declaration_cannot_have_implements_clause);
                     }
                     // Grammar checking heritageClause inside class declaration
@@ -80179,20 +85725,20 @@ var ts;
         }
         function checkGrammarComputedPropertyName(node) {
             // If node is not a computedPropertyName, just skip the grammar checking
-            if (node.kind !== 158 /* ComputedPropertyName */) {
+            if (node.kind !== 161 /* ComputedPropertyName */) {
                 return false;
             }
             var computedPropertyName = node;
-            if (computedPropertyName.expression.kind === 216 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 27 /* CommaToken */) {
+            if (computedPropertyName.expression.kind === 220 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 27 /* CommaToken */) {
                 return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name);
             }
             return false;
         }
         function checkGrammarForGenerator(node) {
             if (node.asteriskToken) {
-                ts.Debug.assert(node.kind === 251 /* FunctionDeclaration */ ||
-                    node.kind === 208 /* FunctionExpression */ ||
-                    node.kind === 165 /* MethodDeclaration */);
+                ts.Debug.assert(node.kind === 255 /* FunctionDeclaration */ ||
+                    node.kind === 212 /* FunctionExpression */ ||
+                    node.kind === 168 /* MethodDeclaration */);
                 if (node.flags & 8388608 /* Ambient */) {
                     return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context);
                 }
@@ -80211,7 +85757,7 @@ var ts;
             var seen = new ts.Map();
             for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {
                 var prop = _a[_i];
-                if (prop.kind === 290 /* SpreadAssignment */) {
+                if (prop.kind === 296 /* SpreadAssignment */) {
                     if (inDestructuring) {
                         // a rest property cannot be destructured any further
                         var expression = ts.skipParentheses(prop.expression);
@@ -80222,24 +85768,24 @@ var ts;
                     continue;
                 }
                 var name = prop.name;
-                if (name.kind === 158 /* ComputedPropertyName */) {
+                if (name.kind === 161 /* ComputedPropertyName */) {
                     // If the name is not a ComputedPropertyName, the grammar checking will skip it
                     checkGrammarComputedPropertyName(name);
                 }
-                if (prop.kind === 289 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) {
+                if (prop.kind === 295 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) {
                     // having objectAssignmentInitializer is only valid in ObjectAssignmentPattern
                     // outside of destructuring it is a syntax error
                     return grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.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);
                 }
-                if (name.kind === 79 /* PrivateIdentifier */) {
-                    return grammarErrorOnNode(name, ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);
+                if (name.kind === 80 /* PrivateIdentifier */) {
+                    grammarErrorOnNode(name, ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);
                 }
                 // Modifiers are never allowed on properties except for 'async' on a method declaration
                 if (prop.modifiers) {
                     // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
                     for (var _b = 0, _c = prop.modifiers; _b < _c.length; _b++) { // TODO: GH#19955
                         var mod = _c[_b];
-                        if (mod.kind !== 129 /* AsyncKeyword */ || prop.kind !== 165 /* MethodDeclaration */) {
+                        if (mod.kind !== 131 /* AsyncKeyword */ || prop.kind !== 168 /* MethodDeclaration */) {
                             grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod));
                         }
                     }
@@ -80254,10 +85800,10 @@ var ts;
                 // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields
                 var currentKind = void 0;
                 switch (prop.kind) {
-                    case 289 /* ShorthandPropertyAssignment */:
+                    case 295 /* ShorthandPropertyAssignment */:
                         checkGrammarForInvalidExclamationToken(prop.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context);
                     // falls through
-                    case 288 /* PropertyAssignment */:
+                    case 294 /* PropertyAssignment */:
                         // Grammar checking for computedPropertyName and shorthandPropertyAssignment
                         checkGrammarForInvalidQuestionMark(prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional);
                         if (name.kind === 8 /* NumericLiteral */) {
@@ -80265,13 +85811,13 @@ var ts;
                         }
                         currentKind = 4 /* PropertyAssignment */;
                         break;
-                    case 165 /* MethodDeclaration */:
+                    case 168 /* MethodDeclaration */:
                         currentKind = 8 /* Method */;
                         break;
-                    case 167 /* GetAccessor */:
+                    case 171 /* GetAccessor */:
                         currentKind = 1 /* GetAccessor */;
                         break;
-                    case 168 /* SetAccessor */:
+                    case 172 /* SetAccessor */:
                         currentKind = 2 /* SetAccessor */;
                         break;
                     default:
@@ -80306,11 +85852,12 @@ var ts;
             }
         }
         function checkGrammarJsxElement(node) {
+            checkGrammarJsxName(node.tagName);
             checkGrammarTypeArguments(node, node.typeArguments);
             var seen = new ts.Map();
             for (var _i = 0, _a = node.attributes.properties; _i < _a.length; _i++) {
                 var attr = _a[_i];
-                if (attr.kind === 282 /* JsxSpreadAttribute */) {
+                if (attr.kind === 286 /* JsxSpreadAttribute */) {
                     continue;
                 }
                 var name = attr.name, initializer = attr.initializer;
@@ -80320,11 +85867,32 @@ var ts;
                 else {
                     return grammarErrorOnNode(name, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name);
                 }
-                if (initializer && initializer.kind === 283 /* JsxExpression */ && !initializer.expression) {
+                if (initializer && initializer.kind === 287 /* JsxExpression */ && !initializer.expression) {
                     return grammarErrorOnNode(initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression);
                 }
             }
         }
+        function checkGrammarJsxName(node) {
+            if (ts.isPropertyAccessExpression(node)) {
+                var propName = node;
+                do {
+                    var check_1 = checkGrammarJsxNestedIdentifier(propName.name);
+                    if (check_1) {
+                        return check_1;
+                    }
+                    propName = propName.expression;
+                } while (ts.isPropertyAccessExpression(propName));
+                var check = checkGrammarJsxNestedIdentifier(propName);
+                if (check) {
+                    return check;
+                }
+            }
+            function checkGrammarJsxNestedIdentifier(name) {
+                if (ts.isIdentifier(name) && ts.idText(name).indexOf(":") !== -1) {
+                    return grammarErrorOnNode(name, ts.Diagnostics.JSX_property_access_expressions_cannot_include_JSX_namespace_names);
+                }
+            }
+        }
         function checkGrammarJsxExpression(node) {
             if (node.expression && ts.isCommaSequence(node.expression)) {
                 return grammarErrorOnNode(node.expression, ts.Diagnostics.JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array);
@@ -80334,7 +85902,7 @@ var ts;
             if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) {
                 return true;
             }
-            if (forInOrOfStatement.kind === 239 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) {
+            if (forInOrOfStatement.kind === 243 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) {
                 if (!(forInOrOfStatement.flags & 32768 /* AwaitContext */)) {
                     var sourceFile = ts.getSourceFileOfNode(forInOrOfStatement);
                     if (ts.isInTopLevelContext(forInOrOfStatement)) {
@@ -80342,8 +85910,8 @@ var ts;
                             if (!ts.isEffectiveExternalModule(sourceFile, compilerOptions)) {
                                 diagnostics.add(ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.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));
                             }
-                            if ((moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.System) || languageVersion < 4 /* ES2017 */) {
-                                diagnostics.add(ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_esnext_or_system_and_the_target_option_is_set_to_es2017_or_higher));
+                            if ((moduleKind !== ts.ModuleKind.ES2022 && moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.System && !(moduleKind === ts.ModuleKind.NodeNext && ts.getSourceFileOfNode(forInOrOfStatement).impliedNodeFormat === ts.ModuleKind.ESNext)) || languageVersion < 4 /* ES2017 */) {
+                                diagnostics.add(ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher));
                             }
                         }
                     }
@@ -80352,7 +85920,7 @@ var ts;
                         if (!hasParseDiagnostics(sourceFile)) {
                             var diagnostic = ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules);
                             var func = ts.getContainingFunction(forInOrOfStatement);
-                            if (func && func.kind !== 166 /* Constructor */) {
+                            if (func && func.kind !== 170 /* Constructor */) {
                                 ts.Debug.assert((ts.getFunctionFlags(func) & 2 /* Async */) === 0, "Enclosing function should never be an async function.");
                                 var relatedInfo = ts.createDiagnosticForNode(func, ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async);
                                 ts.addRelatedInfo(diagnostic, relatedInfo);
@@ -80364,7 +85932,12 @@ var ts;
                     return false;
                 }
             }
-            if (forInOrOfStatement.initializer.kind === 250 /* VariableDeclarationList */) {
+            if (ts.isForOfStatement(forInOrOfStatement) && !(forInOrOfStatement.flags & 32768 /* AwaitContext */) &&
+                ts.isIdentifier(forInOrOfStatement.initializer) && forInOrOfStatement.initializer.escapedText === "async") {
+                grammarErrorOnNode(forInOrOfStatement.initializer, ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_may_not_be_async);
+                return false;
+            }
+            if (forInOrOfStatement.initializer.kind === 254 /* VariableDeclarationList */) {
                 var variableList = forInOrOfStatement.initializer;
                 if (!checkGrammarVariableDeclarationList(variableList)) {
                     var declarations = variableList.declarations;
@@ -80379,20 +85952,20 @@ var ts;
                         return false;
                     }
                     if (declarations.length > 1) {
-                        var diagnostic = forInOrOfStatement.kind === 238 /* ForInStatement */
+                        var diagnostic = forInOrOfStatement.kind === 242 /* ForInStatement */
                             ? ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement
                             : ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement;
                         return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic);
                     }
                     var firstDeclaration = declarations[0];
                     if (firstDeclaration.initializer) {
-                        var diagnostic = forInOrOfStatement.kind === 238 /* ForInStatement */
+                        var diagnostic = forInOrOfStatement.kind === 242 /* ForInStatement */
                             ? ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer
                             : ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer;
                         return grammarErrorOnNode(firstDeclaration.name, diagnostic);
                     }
                     if (firstDeclaration.type) {
-                        var diagnostic = forInOrOfStatement.kind === 238 /* ForInStatement */
+                        var diagnostic = forInOrOfStatement.kind === 242 /* ForInStatement */
                             ? ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation
                             : ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation;
                         return grammarErrorOnNode(firstDeclaration, diagnostic);
@@ -80402,26 +85975,34 @@ var ts;
             return false;
         }
         function checkGrammarAccessor(accessor) {
-            if (!(accessor.flags & 8388608 /* Ambient */)) {
+            if (!(accessor.flags & 8388608 /* Ambient */) && (accessor.parent.kind !== 181 /* TypeLiteral */) && (accessor.parent.kind !== 257 /* InterfaceDeclaration */)) {
                 if (languageVersion < 1 /* ES5 */) {
                     return grammarErrorOnNode(accessor.name, ts.Diagnostics.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher);
                 }
+                if (languageVersion < 2 /* ES2015 */ && ts.isPrivateIdentifier(accessor.name)) {
+                    return grammarErrorOnNode(accessor.name, ts.Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher);
+                }
                 if (accessor.body === undefined && !ts.hasSyntacticModifier(accessor, 128 /* Abstract */)) {
                     return grammarErrorAtPos(accessor, accessor.end - 1, ";".length, ts.Diagnostics._0_expected, "{");
                 }
             }
-            if (accessor.body && ts.hasSyntacticModifier(accessor, 128 /* Abstract */)) {
-                return grammarErrorOnNode(accessor, ts.Diagnostics.An_abstract_accessor_cannot_have_an_implementation);
+            if (accessor.body) {
+                if (ts.hasSyntacticModifier(accessor, 128 /* Abstract */)) {
+                    return grammarErrorOnNode(accessor, ts.Diagnostics.An_abstract_accessor_cannot_have_an_implementation);
+                }
+                if (accessor.parent.kind === 181 /* TypeLiteral */ || accessor.parent.kind === 257 /* InterfaceDeclaration */) {
+                    return grammarErrorOnNode(accessor.body, ts.Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts);
+                }
             }
             if (accessor.typeParameters) {
                 return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters);
             }
             if (!doesAccessorHaveCorrectParameterCount(accessor)) {
-                return grammarErrorOnNode(accessor.name, accessor.kind === 167 /* GetAccessor */ ?
+                return grammarErrorOnNode(accessor.name, accessor.kind === 171 /* GetAccessor */ ?
                     ts.Diagnostics.A_get_accessor_cannot_have_parameters :
                     ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter);
             }
-            if (accessor.kind === 168 /* SetAccessor */) {
+            if (accessor.kind === 172 /* SetAccessor */) {
                 if (accessor.type) {
                     return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation);
                 }
@@ -80443,17 +86024,17 @@ var ts;
          * A set accessor has one parameter or a `this` parameter and one more parameter.
          */
         function doesAccessorHaveCorrectParameterCount(accessor) {
-            return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 167 /* GetAccessor */ ? 0 : 1);
+            return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 171 /* GetAccessor */ ? 0 : 1);
         }
         function getAccessorThisParameter(accessor) {
-            if (accessor.parameters.length === (accessor.kind === 167 /* GetAccessor */ ? 1 : 2)) {
+            if (accessor.parameters.length === (accessor.kind === 171 /* GetAccessor */ ? 1 : 2)) {
                 return ts.getThisParameter(accessor);
             }
         }
         function checkGrammarTypeOperatorNode(node) {
-            if (node.operator === 151 /* UniqueKeyword */) {
-                if (node.type.kind !== 148 /* SymbolKeyword */) {
-                    return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(148 /* SymbolKeyword */));
+            if (node.operator === 153 /* UniqueKeyword */) {
+                if (node.type.kind !== 150 /* SymbolKeyword */) {
+                    return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(150 /* SymbolKeyword */));
                 }
                 var parent = ts.walkUpParenthesizedTypes(node.parent);
                 if (ts.isInJSFile(parent) && ts.isJSDocTypeExpression(parent)) {
@@ -80464,9 +86045,9 @@ var ts;
                     }
                 }
                 switch (parent.kind) {
-                    case 249 /* VariableDeclaration */:
+                    case 253 /* VariableDeclaration */:
                         var decl = parent;
-                        if (decl.name.kind !== 78 /* Identifier */) {
+                        if (decl.name.kind !== 79 /* Identifier */) {
                             return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name);
                         }
                         if (!ts.isVariableDeclarationInVariableStatement(decl)) {
@@ -80476,13 +86057,13 @@ var ts;
                             return grammarErrorOnNode(parent.name, ts.Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const);
                         }
                         break;
-                    case 163 /* PropertyDeclaration */:
-                        if (!ts.hasSyntacticModifier(parent, 32 /* Static */) ||
-                            !ts.hasEffectiveModifier(parent, 64 /* Readonly */)) {
+                    case 166 /* PropertyDeclaration */:
+                        if (!ts.isStatic(parent) ||
+                            !ts.hasEffectiveReadonlyModifier(parent)) {
                             return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly);
                         }
                         break;
-                    case 162 /* PropertySignature */:
+                    case 165 /* PropertySignature */:
                         if (!ts.hasSyntacticModifier(parent, 64 /* Readonly */)) {
                             return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly);
                         }
@@ -80491,9 +86072,9 @@ var ts;
                         return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_are_not_allowed_here);
                 }
             }
-            else if (node.operator === 142 /* ReadonlyKeyword */) {
-                if (node.type.kind !== 178 /* ArrayType */ && node.type.kind !== 179 /* TupleType */) {
-                    return grammarErrorOnFirstToken(node, ts.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, ts.tokenToString(148 /* SymbolKeyword */));
+            else if (node.operator === 144 /* ReadonlyKeyword */) {
+                if (node.type.kind !== 182 /* ArrayType */ && node.type.kind !== 183 /* TupleType */) {
+                    return grammarErrorOnFirstToken(node, ts.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, ts.tokenToString(150 /* SymbolKeyword */));
                 }
             }
         }
@@ -80506,10 +86087,10 @@ var ts;
             if (checkGrammarFunctionLikeDeclaration(node)) {
                 return true;
             }
-            if (node.kind === 165 /* MethodDeclaration */) {
-                if (node.parent.kind === 200 /* ObjectLiteralExpression */) {
+            if (node.kind === 168 /* MethodDeclaration */) {
+                if (node.parent.kind === 204 /* ObjectLiteralExpression */) {
                     // We only disallow modifier on a method declaration if it is a property of object-literal-expression
-                    if (node.modifiers && !(node.modifiers.length === 1 && ts.first(node.modifiers).kind === 129 /* AsyncKeyword */)) {
+                    if (node.modifiers && !(node.modifiers.length === 1 && ts.first(node.modifiers).kind === 131 /* AsyncKeyword */)) {
                         return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here);
                     }
                     else if (checkGrammarForInvalidQuestionMark(node.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional)) {
@@ -80527,6 +86108,9 @@ var ts;
                 }
             }
             if (ts.isClassLike(node.parent)) {
+                if (languageVersion < 2 /* ES2015 */ && ts.isPrivateIdentifier(node.name)) {
+                    return grammarErrorOnNode(node.name, ts.Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher);
+                }
                 // Technically, computed properties in ambient contexts is disallowed
                 // for property declarations and accessors too, not just methods.
                 // However, property declarations disallow computed names in general,
@@ -80535,29 +86119,29 @@ var ts;
                 if (node.flags & 8388608 /* Ambient */) {
                     return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);
                 }
-                else if (node.kind === 165 /* MethodDeclaration */ && !node.body) {
+                else if (node.kind === 168 /* MethodDeclaration */ && !node.body) {
                     return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.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 (node.parent.kind === 253 /* InterfaceDeclaration */) {
+            else if (node.parent.kind === 257 /* InterfaceDeclaration */) {
                 return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);
             }
-            else if (node.parent.kind === 177 /* TypeLiteral */) {
+            else if (node.parent.kind === 181 /* TypeLiteral */) {
                 return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.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 checkGrammarBreakOrContinueStatement(node) {
             var current = node;
             while (current) {
-                if (ts.isFunctionLike(current)) {
+                if (ts.isFunctionLikeOrClassStaticBlockDeclaration(current)) {
                     return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary);
                 }
                 switch (current.kind) {
-                    case 245 /* LabeledStatement */:
+                    case 249 /* LabeledStatement */:
                         if (node.label && current.label.escapedText === node.label.escapedText) {
                             // found matching label - verify that label usage is correct
                             // continue can only target labels that are on iteration statements
-                            var isMisplacedContinueLabel = node.kind === 240 /* ContinueStatement */
+                            var isMisplacedContinueLabel = node.kind === 244 /* ContinueStatement */
                                 && !ts.isIterationStatement(current.statement, /*lookInLabeledStatement*/ true);
                             if (isMisplacedContinueLabel) {
                                 return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement);
@@ -80565,8 +86149,8 @@ var ts;
                             return false;
                         }
                         break;
-                    case 244 /* SwitchStatement */:
-                        if (node.kind === 241 /* BreakStatement */ && !node.label) {
+                    case 248 /* SwitchStatement */:
+                        if (node.kind === 245 /* BreakStatement */ && !node.label) {
                             // unlabeled break within switch statement - ok
                             return false;
                         }
@@ -80581,13 +86165,13 @@ var ts;
                 current = current.parent;
             }
             if (node.label) {
-                var message = node.kind === 241 /* BreakStatement */
+                var message = node.kind === 245 /* BreakStatement */
                     ? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement
                     : ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement;
                 return grammarErrorOnNode(node, message);
             }
             else {
-                var message = node.kind === 241 /* BreakStatement */
+                var message = node.kind === 245 /* BreakStatement */
                     ? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement
                     : ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement;
                 return grammarErrorOnNode(node, message);
@@ -80611,12 +86195,12 @@ var ts;
         }
         function isStringOrNumberLiteralExpression(expr) {
             return ts.isStringOrNumericLiteralLike(expr) ||
-                expr.kind === 214 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ &&
+                expr.kind === 218 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ &&
                     expr.operand.kind === 8 /* NumericLiteral */;
         }
         function isBigIntLiteralExpression(expr) {
             return expr.kind === 9 /* BigIntLiteral */ ||
-                expr.kind === 214 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ &&
+                expr.kind === 218 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ &&
                     expr.operand.kind === 9 /* BigIntLiteral */;
         }
         function isSimpleLiteralEnumReference(expr) {
@@ -80630,7 +86214,7 @@ var ts;
             if (initializer) {
                 var isInvalidInitializer = !(isStringOrNumberLiteralExpression(initializer) ||
                     isSimpleLiteralEnumReference(initializer) ||
-                    initializer.kind === 109 /* TrueKeyword */ || initializer.kind === 94 /* FalseKeyword */ ||
+                    initializer.kind === 110 /* TrueKeyword */ || initializer.kind === 95 /* FalseKeyword */ ||
                     isBigIntLiteralExpression(initializer));
                 var isConstOrReadonly = ts.isDeclarationReadonly(node) || ts.isVariableDeclaration(node) && ts.isVarConst(node);
                 if (isConstOrReadonly && !node.type) {
@@ -80647,7 +86231,7 @@ var ts;
             }
         }
         function checkGrammarVariableDeclaration(node) {
-            if (node.parent.parent.kind !== 238 /* ForInStatement */ && node.parent.parent.kind !== 239 /* ForOfStatement */) {
+            if (node.parent.parent.kind !== 242 /* ForInStatement */ && node.parent.parent.kind !== 243 /* ForOfStatement */) {
                 if (node.flags & 8388608 /* Ambient */) {
                     checkAmbientInitializer(node);
                 }
@@ -80660,7 +86244,7 @@ var ts;
                     }
                 }
             }
-            if (node.exclamationToken && (node.parent.parent.kind !== 232 /* VariableStatement */ || !node.type || node.initializer || node.flags & 8388608 /* Ambient */)) {
+            if (node.exclamationToken && (node.parent.parent.kind !== 236 /* VariableStatement */ || !node.type || node.initializer || node.flags & 8388608 /* Ambient */)) {
                 var message = node.initializer
                     ? ts.Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions
                     : !node.type
@@ -80668,8 +86252,7 @@ var ts;
                         : ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context;
                 return grammarErrorOnNode(node.exclamationToken, message);
             }
-            var moduleKind = ts.getEmitModuleKind(compilerOptions);
-            if (moduleKind < ts.ModuleKind.ES2015 && moduleKind !== ts.ModuleKind.System &&
+            if ((moduleKind < ts.ModuleKind.ES2015 || ts.getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.CommonJS) && moduleKind !== ts.ModuleKind.System &&
                 !(node.parent.parent.flags & 8388608 /* Ambient */) && ts.hasSyntacticModifier(node.parent.parent, 1 /* Export */)) {
                 checkESModuleMarker(node.name);
             }
@@ -80683,7 +86266,7 @@ var ts;
             return checkLetConstNames && checkGrammarNameInLetOrConstDeclarations(node.name);
         }
         function checkESModuleMarker(name) {
-            if (name.kind === 78 /* Identifier */) {
+            if (name.kind === 79 /* Identifier */) {
                 if (ts.idText(name) === "__esModule") {
                     return grammarErrorOnNodeSkippedOn("noEmit", name, ts.Diagnostics.Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules);
                 }
@@ -80700,8 +86283,8 @@ var ts;
             return false;
         }
         function checkGrammarNameInLetOrConstDeclarations(name) {
-            if (name.kind === 78 /* Identifier */) {
-                if (name.originalKeywordKind === 118 /* LetKeyword */) {
+            if (name.kind === 79 /* Identifier */) {
+                if (name.originalKeywordKind === 119 /* LetKeyword */) {
                     return grammarErrorOnNode(name, ts.Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations);
                 }
             }
@@ -80728,15 +86311,15 @@ var ts;
         }
         function allowLetAndConstDeclarations(parent) {
             switch (parent.kind) {
-                case 234 /* IfStatement */:
-                case 235 /* DoStatement */:
-                case 236 /* WhileStatement */:
-                case 243 /* WithStatement */:
-                case 237 /* ForStatement */:
-                case 238 /* ForInStatement */:
-                case 239 /* ForOfStatement */:
+                case 238 /* IfStatement */:
+                case 239 /* DoStatement */:
+                case 240 /* WhileStatement */:
+                case 247 /* WithStatement */:
+                case 241 /* ForStatement */:
+                case 242 /* ForInStatement */:
+                case 243 /* ForOfStatement */:
                     return false;
-                case 245 /* LabeledStatement */:
+                case 249 /* LabeledStatement */:
                     return allowLetAndConstDeclarations(parent.parent);
             }
             return true;
@@ -80754,12 +86337,12 @@ var ts;
         function checkGrammarMetaProperty(node) {
             var escapedText = node.name.escapedText;
             switch (node.keywordToken) {
-                case 102 /* NewKeyword */:
+                case 103 /* NewKeyword */:
                     if (escapedText !== "target") {
                         return grammarErrorOnNode(node.name, ts.Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2, node.name.escapedText, ts.tokenToString(node.keywordToken), "target");
                     }
                     break;
-                case 99 /* ImportKeyword */:
+                case 100 /* ImportKeyword */:
                     if (escapedText !== "meta") {
                         return grammarErrorOnNode(node.name, ts.Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2, node.name.escapedText, ts.tokenToString(node.keywordToken), "meta");
                     }
@@ -80817,18 +86400,21 @@ var ts;
             }
         }
         function checkGrammarProperty(node) {
+            if (ts.isComputedPropertyName(node.name) && ts.isBinaryExpression(node.name.expression) && node.name.expression.operatorToken.kind === 101 /* InKeyword */) {
+                return grammarErrorOnNode(node.parent.members[0], ts.Diagnostics.A_mapped_type_may_not_declare_properties_or_methods);
+            }
             if (ts.isClassLike(node.parent)) {
                 if (ts.isStringLiteral(node.name) && node.name.text === "constructor") {
                     return grammarErrorOnNode(node.name, ts.Diagnostics.Classes_may_not_have_a_field_named_constructor);
                 }
-                if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_class_property_declaration_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) {
+                if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_class_property_declaration_must_have_a_simple_literal_type_or_a_unique_symbol_type)) {
                     return true;
                 }
                 if (languageVersion < 2 /* ES2015 */ && ts.isPrivateIdentifier(node.name)) {
                     return grammarErrorOnNode(node.name, ts.Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher);
                 }
             }
-            else if (node.parent.kind === 253 /* InterfaceDeclaration */) {
+            else if (node.parent.kind === 257 /* InterfaceDeclaration */) {
                 if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) {
                     return true;
                 }
@@ -80836,7 +86422,7 @@ var ts;
                     return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer);
                 }
             }
-            else if (node.parent.kind === 177 /* TypeLiteral */) {
+            else if (ts.isTypeLiteralNode(node.parent)) {
                 if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.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 true;
                 }
@@ -80848,7 +86434,7 @@ var ts;
                 checkAmbientInitializer(node);
             }
             if (ts.isPropertyDeclaration(node) && node.exclamationToken && (!ts.isClassLike(node.parent) || !node.type || node.initializer ||
-                node.flags & 8388608 /* Ambient */ || ts.hasSyntacticModifier(node, 32 /* Static */ | 128 /* Abstract */))) {
+                node.flags & 8388608 /* Ambient */ || ts.isStatic(node) || ts.hasAbstractModifier(node))) {
                 var message = node.initializer
                     ? ts.Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions
                     : !node.type
@@ -80870,13 +86456,13 @@ var ts;
             //     export_opt   AmbientDeclaration
             //
             // TODO: The spec needs to be amended to reflect this grammar.
-            if (node.kind === 253 /* InterfaceDeclaration */ ||
-                node.kind === 254 /* TypeAliasDeclaration */ ||
-                node.kind === 261 /* ImportDeclaration */ ||
-                node.kind === 260 /* ImportEqualsDeclaration */ ||
-                node.kind === 267 /* ExportDeclaration */ ||
-                node.kind === 266 /* ExportAssignment */ ||
-                node.kind === 259 /* NamespaceExportDeclaration */ ||
+            if (node.kind === 257 /* InterfaceDeclaration */ ||
+                node.kind === 258 /* TypeAliasDeclaration */ ||
+                node.kind === 265 /* ImportDeclaration */ ||
+                node.kind === 264 /* ImportEqualsDeclaration */ ||
+                node.kind === 271 /* ExportDeclaration */ ||
+                node.kind === 270 /* ExportAssignment */ ||
+                node.kind === 263 /* NamespaceExportDeclaration */ ||
                 ts.hasSyntacticModifier(node, 2 /* Ambient */ | 1 /* Export */ | 512 /* Default */)) {
                 return false;
             }
@@ -80885,7 +86471,7 @@ var ts;
         function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) {
             for (var _i = 0, _a = file.statements; _i < _a.length; _i++) {
                 var decl = _a[_i];
-                if (ts.isDeclaration(decl) || decl.kind === 232 /* VariableStatement */) {
+                if (ts.isDeclaration(decl) || decl.kind === 236 /* VariableStatement */) {
                     if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) {
                         return true;
                     }
@@ -80908,7 +86494,7 @@ var ts;
                 // to prevent noisiness.  So use a bit on the block to indicate if
                 // this has already been reported, and don't report if it has.
                 //
-                if (node.parent.kind === 230 /* Block */ || node.parent.kind === 257 /* ModuleBlock */ || node.parent.kind === 297 /* SourceFile */) {
+                if (node.parent.kind === 234 /* Block */ || node.parent.kind === 261 /* ModuleBlock */ || node.parent.kind === 303 /* SourceFile */) {
                     var links_2 = getNodeLinks(node.parent);
                     // Check if the containing block ever report this error
                     if (!links_2.hasReportedStatementInAmbientContext) {
@@ -80930,10 +86516,10 @@ var ts;
                 if (languageVersion >= 1 /* ES5 */) {
                     diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0;
                 }
-                else if (ts.isChildOfNodeWithKind(node, 191 /* LiteralType */)) {
+                else if (ts.isChildOfNodeWithKind(node, 195 /* LiteralType */)) {
                     diagnosticMessage = ts.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0;
                 }
-                else if (ts.isChildOfNodeWithKind(node, 291 /* EnumMember */)) {
+                else if (ts.isChildOfNodeWithKind(node, 297 /* EnumMember */)) {
                     diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0;
                 }
                 if (diagnosticMessage) {
@@ -80997,27 +86583,48 @@ var ts;
             return ambientModulesCache;
         }
         function checkGrammarImportClause(node) {
+            var _a;
             if (node.isTypeOnly && node.name && node.namedBindings) {
                 return grammarErrorOnNode(node, ts.Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both);
             }
+            if (node.isTypeOnly && ((_a = node.namedBindings) === null || _a === void 0 ? void 0 : _a.kind) === 268 /* NamedImports */) {
+                return checkGrammarNamedImportsOrExports(node.namedBindings);
+            }
             return false;
         }
+        function checkGrammarNamedImportsOrExports(namedBindings) {
+            return !!ts.forEach(namedBindings.elements, function (specifier) {
+                if (specifier.isTypeOnly) {
+                    return grammarErrorOnFirstToken(specifier, specifier.kind === 269 /* ImportSpecifier */
+                        ? ts.Diagnostics.The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement
+                        : ts.Diagnostics.The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement);
+                }
+            });
+        }
         function checkGrammarImportCallExpression(node) {
             if (moduleKind === ts.ModuleKind.ES2015) {
-                return grammarErrorOnNode(node, ts.Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_esnext_commonjs_amd_system_or_umd);
+                return grammarErrorOnNode(node, ts.Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node12_or_nodenext);
             }
             if (node.typeArguments) {
                 return grammarErrorOnNode(node, ts.Diagnostics.Dynamic_import_cannot_have_type_arguments);
             }
             var nodeArguments = node.arguments;
-            if (nodeArguments.length !== 1) {
-                return grammarErrorOnNode(node, ts.Diagnostics.Dynamic_import_must_have_one_specifier_as_an_argument);
+            if (moduleKind !== ts.ModuleKind.ESNext) {
+                // We are allowed trailing comma after proposal-import-assertions.
+                checkGrammarForDisallowedTrailingComma(nodeArguments);
+                if (nodeArguments.length > 1) {
+                    var assertionArgument = nodeArguments[1];
+                    return grammarErrorOnNode(assertionArgument, ts.Diagnostics.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext);
+                }
+            }
+            if (nodeArguments.length === 0 || nodeArguments.length > 2) {
+                return grammarErrorOnNode(node, ts.Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments);
             }
-            checkGrammarForDisallowedTrailingComma(nodeArguments);
             // see: parseArgumentOrArrayLiteralElement...we use this function which parse arguments of callExpression to parse specifier for dynamic import.
             // parseArgumentOrArrayLiteralElement allows spread element to be in an argument list which is not allowed as specifier in dynamic import.
-            if (ts.isSpreadElement(nodeArguments[0])) {
-                return grammarErrorOnNode(nodeArguments[0], ts.Diagnostics.Specifier_of_dynamic_import_cannot_be_spread_element);
+            var spreadElement = ts.find(nodeArguments, ts.isSpreadElement);
+            if (spreadElement) {
+                return grammarErrorOnNode(spreadElement, ts.Diagnostics.Argument_of_dynamic_import_cannot_be_spread_element);
             }
             return false;
         }
@@ -81039,7 +86646,7 @@ var ts;
             }
         }
         function findBestTypeForObjectLiteral(source, unionTarget) {
-            if (ts.getObjectFlags(source) & 128 /* ObjectLiteral */ && forEachType(unionTarget, isArrayLikeType)) {
+            if (ts.getObjectFlags(source) & 128 /* ObjectLiteral */ && someType(unionTarget, isArrayLikeType)) {
                 return ts.find(unionTarget.types, function (t) { return !isArrayLikeType(t); });
             }
         }
@@ -81091,6 +86698,10 @@ var ts;
         // Keep this up-to-date with the same logic within `getApparentTypeOfContextualType`, since they should behave similarly
         function findMatchingDiscriminantType(source, target, isRelatedTo, skipPartial) {
             if (target.flags & 1048576 /* Union */ && source.flags & (2097152 /* Intersection */ | 524288 /* Object */)) {
+                var match = getMatchingUnionConstituentForType(target, source);
+                if (match) {
+                    return match;
+                }
                 var sourceProperties = getPropertiesOfType(source);
                 if (sourceProperties) {
                     var sourcePropertiesFiltered = findDiscriminantProperties(sourceProperties, target);
@@ -81108,33 +86719,19 @@ var ts;
         return !ts.isAccessor(declaration);
     }
     function isNotOverload(declaration) {
-        return (declaration.kind !== 251 /* FunctionDeclaration */ && declaration.kind !== 165 /* MethodDeclaration */) ||
+        return (declaration.kind !== 255 /* FunctionDeclaration */ && declaration.kind !== 168 /* MethodDeclaration */) ||
             !!declaration.body;
     }
     /** Like 'isDeclarationName', but returns true for LHS of `import { x as y }` or `export { x as y }`. */
     function isDeclarationNameOrImportPropertyName(name) {
         switch (name.parent.kind) {
-            case 265 /* ImportSpecifier */:
-            case 270 /* ExportSpecifier */:
+            case 269 /* ImportSpecifier */:
+            case 274 /* ExportSpecifier */:
                 return ts.isIdentifier(name);
             default:
                 return ts.isDeclarationName(name);
         }
     }
-    function isSomeImportDeclaration(decl) {
-        switch (decl.kind) {
-            case 262 /* ImportClause */: // For default import
-            case 260 /* ImportEqualsDeclaration */:
-            case 263 /* NamespaceImport */:
-            case 265 /* ImportSpecifier */: // For rename import `x as y`
-                return true;
-            case 78 /* Identifier */:
-                // For regular import, `decl` is an Identifier under the ImportSpecifier.
-                return decl.parent.kind === 265 /* ImportSpecifier */;
-            default:
-                return false;
-        }
-    }
     var JsxNames;
     (function (JsxNames) {
         JsxNames.JSX = "JSX";
@@ -81165,7 +86762,6 @@ var ts;
 })(ts || (ts = {}));
 var ts;
 (function (ts) {
-    var isTypeNodeOrTypeParameterDeclaration = ts.or(ts.isTypeNode, ts.isTypeParameterDeclaration);
     function visitNode(node, visitor, test, lift) {
         if (node === undefined || visitor === undefined) {
             return node;
@@ -81354,6 +86950,24 @@ var ts;
         return updated;
     }
     ts.visitFunctionBody = visitFunctionBody;
+    /**
+     * Visits an iteration body, adding any block-scoped variables required by the transformation.
+     */
+    function visitIterationBody(body, visitor, context) {
+        context.startBlockScope();
+        var updated = visitNode(body, visitor, ts.isStatement, context.factory.liftToBlock);
+        var declarations = context.endBlockScope();
+        if (ts.some(declarations)) {
+            if (ts.isBlock(updated)) {
+                declarations.push.apply(declarations, updated.statements);
+                return context.factory.updateBlock(updated, declarations);
+            }
+            declarations.push(updated);
+            return context.factory.createBlock(declarations);
+        }
+        return updated;
+    }
+    ts.visitIterationBody = visitIterationBody;
     function visitEachChild(node, visitor, context, nodesVisitor, tokenVisitor, nodeVisitor) {
         if (nodesVisitor === void 0) { nodesVisitor = visitNodes; }
         if (nodeVisitor === void 0) { nodeVisitor = visitNode; }
@@ -81362,299 +86976,444 @@ var ts;
         }
         var kind = node.kind;
         // No need to visit nodes with no children.
-        if ((kind > 0 /* FirstToken */ && kind <= 156 /* LastToken */) || kind === 187 /* ThisType */) {
+        if ((kind > 0 /* FirstToken */ && kind <= 159 /* LastToken */) || kind === 191 /* ThisType */) {
             return node;
         }
         var factory = context.factory;
         switch (kind) {
             // Names
-            case 78 /* Identifier */:
-                return factory.updateIdentifier(node, nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration));
-            case 157 /* QualifiedName */:
+            case 79 /* Identifier */:
+                ts.Debug.type(node);
+                return factory.updateIdentifier(node, nodesVisitor(node.typeArguments, visitor, ts.isTypeNodeOrTypeParameterDeclaration));
+            case 160 /* QualifiedName */:
+                ts.Debug.type(node);
                 return factory.updateQualifiedName(node, nodeVisitor(node.left, visitor, ts.isEntityName), nodeVisitor(node.right, visitor, ts.isIdentifier));
-            case 158 /* ComputedPropertyName */:
+            case 161 /* ComputedPropertyName */:
+                ts.Debug.type(node);
                 return factory.updateComputedPropertyName(node, nodeVisitor(node.expression, visitor, ts.isExpression));
             // Signature elements
-            case 159 /* TypeParameter */:
+            case 162 /* TypeParameter */:
+                ts.Debug.type(node);
                 return factory.updateTypeParameterDeclaration(node, nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.constraint, visitor, ts.isTypeNode), nodeVisitor(node.default, visitor, ts.isTypeNode));
-            case 160 /* Parameter */:
-                return factory.updateParameterDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.dotDotDotToken, tokenVisitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isBindingName), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.initializer, visitor, ts.isExpression));
-            case 161 /* Decorator */:
+            case 163 /* Parameter */:
+                ts.Debug.type(node);
+                return factory.updateParameterDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.dotDotDotToken, tokenVisitor, ts.isDotDotDotToken), nodeVisitor(node.name, visitor, ts.isBindingName), nodeVisitor(node.questionToken, tokenVisitor, ts.isQuestionToken), nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.initializer, visitor, ts.isExpression));
+            case 164 /* Decorator */:
+                ts.Debug.type(node);
                 return factory.updateDecorator(node, nodeVisitor(node.expression, visitor, ts.isExpression));
             // Type elements
-            case 162 /* PropertySignature */:
-                return factory.updatePropertySignature(node, nodesVisitor(node.modifiers, visitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode));
-            case 163 /* PropertyDeclaration */:
+            case 165 /* PropertySignature */:
+                ts.Debug.type(node);
+                return factory.updatePropertySignature(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode));
+            case 166 /* PropertyDeclaration */:
+                ts.Debug.type(node);
                 return factory.updatePropertyDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isPropertyName), 
                 // QuestionToken and ExclamationToken is uniqued in Property Declaration and the signature of 'updateProperty' is that too
-                nodeVisitor(node.questionToken || node.exclamationToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.initializer, visitor, ts.isExpression));
-            case 164 /* MethodSignature */:
-                return factory.updateMethodSignature(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode));
-            case 165 /* MethodDeclaration */:
-                return factory.updateMethodDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.asteriskToken, tokenVisitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context, nodeVisitor));
-            case 166 /* Constructor */:
+                nodeVisitor(node.questionToken || node.exclamationToken, tokenVisitor, ts.isQuestionOrExclamationToken), nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.initializer, visitor, ts.isExpression));
+            case 167 /* MethodSignature */:
+                ts.Debug.type(node);
+                return factory.updateMethodSignature(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.questionToken, tokenVisitor, ts.isQuestionToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode));
+            case 168 /* MethodDeclaration */:
+                ts.Debug.type(node);
+                return factory.updateMethodDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.asteriskToken, tokenVisitor, ts.isAsteriskToken), nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.questionToken, tokenVisitor, ts.isQuestionToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context, nodeVisitor));
+            case 170 /* Constructor */:
+                ts.Debug.type(node);
                 return factory.updateConstructorDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context, nodeVisitor));
-            case 167 /* GetAccessor */:
+            case 171 /* GetAccessor */:
+                ts.Debug.type(node);
                 return factory.updateGetAccessorDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context, nodeVisitor));
-            case 168 /* SetAccessor */:
+            case 172 /* SetAccessor */:
+                ts.Debug.type(node);
                 return factory.updateSetAccessorDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context, nodeVisitor));
-            case 169 /* CallSignature */:
+            case 169 /* ClassStaticBlockDeclaration */:
+                ts.Debug.type(node);
+                context.startLexicalEnvironment();
+                context.suspendLexicalEnvironment();
+                return factory.updateClassStaticBlockDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitFunctionBody(node.body, visitor, context, nodeVisitor));
+            case 173 /* CallSignature */:
+                ts.Debug.type(node);
                 return factory.updateCallSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode));
-            case 170 /* ConstructSignature */:
+            case 174 /* ConstructSignature */:
+                ts.Debug.type(node);
                 return factory.updateConstructSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode));
-            case 171 /* IndexSignature */:
+            case 175 /* IndexSignature */:
+                ts.Debug.type(node);
                 return factory.updateIndexSignature(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode));
             // Types
-            case 172 /* TypePredicate */:
-                return factory.updateTypePredicateNode(node, nodeVisitor(node.assertsModifier, visitor), nodeVisitor(node.parameterName, visitor), nodeVisitor(node.type, visitor, ts.isTypeNode));
-            case 173 /* TypeReference */:
+            case 176 /* TypePredicate */:
+                ts.Debug.type(node);
+                return factory.updateTypePredicateNode(node, nodeVisitor(node.assertsModifier, visitor, ts.isAssertsKeyword), nodeVisitor(node.parameterName, visitor, ts.isIdentifierOrThisTypeNode), nodeVisitor(node.type, visitor, ts.isTypeNode));
+            case 177 /* TypeReference */:
+                ts.Debug.type(node);
                 return factory.updateTypeReferenceNode(node, nodeVisitor(node.typeName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode));
-            case 174 /* FunctionType */:
+            case 178 /* FunctionType */:
+                ts.Debug.type(node);
                 return factory.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode));
-            case 175 /* ConstructorType */:
+            case 179 /* ConstructorType */:
+                ts.Debug.type(node);
                 return factory.updateConstructorTypeNode(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode));
-            case 176 /* TypeQuery */:
+            case 180 /* TypeQuery */:
+                ts.Debug.type(node);
                 return factory.updateTypeQueryNode(node, nodeVisitor(node.exprName, visitor, ts.isEntityName));
-            case 177 /* TypeLiteral */:
+            case 181 /* TypeLiteral */:
+                ts.Debug.type(node);
                 return factory.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts.isTypeElement));
-            case 178 /* ArrayType */:
+            case 182 /* ArrayType */:
+                ts.Debug.type(node);
                 return factory.updateArrayTypeNode(node, nodeVisitor(node.elementType, visitor, ts.isTypeNode));
-            case 179 /* TupleType */:
+            case 183 /* TupleType */:
+                ts.Debug.type(node);
                 return factory.updateTupleTypeNode(node, nodesVisitor(node.elements, visitor, ts.isTypeNode));
-            case 180 /* OptionalType */:
+            case 184 /* OptionalType */:
+                ts.Debug.type(node);
                 return factory.updateOptionalTypeNode(node, nodeVisitor(node.type, visitor, ts.isTypeNode));
-            case 181 /* RestType */:
+            case 185 /* RestType */:
+                ts.Debug.type(node);
                 return factory.updateRestTypeNode(node, nodeVisitor(node.type, visitor, ts.isTypeNode));
-            case 182 /* UnionType */:
+            case 186 /* UnionType */:
+                ts.Debug.type(node);
                 return factory.updateUnionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode));
-            case 183 /* IntersectionType */:
+            case 187 /* IntersectionType */:
+                ts.Debug.type(node);
                 return factory.updateIntersectionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode));
-            case 184 /* ConditionalType */:
+            case 188 /* ConditionalType */:
+                ts.Debug.type(node);
                 return factory.updateConditionalTypeNode(node, nodeVisitor(node.checkType, visitor, ts.isTypeNode), nodeVisitor(node.extendsType, visitor, ts.isTypeNode), nodeVisitor(node.trueType, visitor, ts.isTypeNode), nodeVisitor(node.falseType, visitor, ts.isTypeNode));
-            case 185 /* InferType */:
+            case 189 /* InferType */:
+                ts.Debug.type(node);
                 return factory.updateInferTypeNode(node, nodeVisitor(node.typeParameter, visitor, ts.isTypeParameterDeclaration));
-            case 195 /* ImportType */:
+            case 199 /* ImportType */:
+                ts.Debug.type(node);
                 return factory.updateImportTypeNode(node, nodeVisitor(node.argument, visitor, ts.isTypeNode), nodeVisitor(node.qualifier, visitor, ts.isEntityName), visitNodes(node.typeArguments, visitor, ts.isTypeNode), node.isTypeOf);
-            case 192 /* NamedTupleMember */:
-                return factory.updateNamedTupleMember(node, visitNode(node.dotDotDotToken, visitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.questionToken, visitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode));
-            case 186 /* ParenthesizedType */:
+            case 196 /* NamedTupleMember */:
+                ts.Debug.type(node);
+                return factory.updateNamedTupleMember(node, visitNode(node.dotDotDotToken, visitor, ts.isDotDotDotToken), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.questionToken, visitor, ts.isQuestionToken), visitNode(node.type, visitor, ts.isTypeNode));
+            case 190 /* ParenthesizedType */:
+                ts.Debug.type(node);
                 return factory.updateParenthesizedType(node, nodeVisitor(node.type, visitor, ts.isTypeNode));
-            case 188 /* TypeOperator */:
+            case 192 /* TypeOperator */:
+                ts.Debug.type(node);
                 return factory.updateTypeOperatorNode(node, nodeVisitor(node.type, visitor, ts.isTypeNode));
-            case 189 /* IndexedAccessType */:
+            case 193 /* IndexedAccessType */:
+                ts.Debug.type(node);
                 return factory.updateIndexedAccessTypeNode(node, nodeVisitor(node.objectType, visitor, ts.isTypeNode), nodeVisitor(node.indexType, visitor, ts.isTypeNode));
-            case 190 /* MappedType */:
-                return factory.updateMappedTypeNode(node, nodeVisitor(node.readonlyToken, tokenVisitor, ts.isToken), nodeVisitor(node.typeParameter, visitor, ts.isTypeParameterDeclaration), nodeVisitor(node.nameType, visitor, ts.isTypeNode), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode));
-            case 191 /* LiteralType */:
+            case 194 /* MappedType */:
+                ts.Debug.type(node);
+                return factory.updateMappedTypeNode(node, nodeVisitor(node.readonlyToken, tokenVisitor, ts.isReadonlyKeywordOrPlusOrMinusToken), nodeVisitor(node.typeParameter, visitor, ts.isTypeParameterDeclaration), nodeVisitor(node.nameType, visitor, ts.isTypeNode), nodeVisitor(node.questionToken, tokenVisitor, ts.isQuestionOrPlusOrMinusToken), nodeVisitor(node.type, visitor, ts.isTypeNode), nodesVisitor(node.members, visitor, ts.isTypeElement));
+            case 195 /* LiteralType */:
+                ts.Debug.type(node);
                 return factory.updateLiteralTypeNode(node, nodeVisitor(node.literal, visitor, ts.isExpression));
-            case 193 /* TemplateLiteralType */:
+            case 197 /* TemplateLiteralType */:
+                ts.Debug.type(node);
                 return factory.updateTemplateLiteralType(node, nodeVisitor(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateLiteralTypeSpan));
-            case 194 /* TemplateLiteralTypeSpan */:
+            case 198 /* TemplateLiteralTypeSpan */:
+                ts.Debug.type(node);
                 return factory.updateTemplateLiteralTypeSpan(node, nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail));
             // Binding patterns
-            case 196 /* ObjectBindingPattern */:
+            case 200 /* ObjectBindingPattern */:
+                ts.Debug.type(node);
                 return factory.updateObjectBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isBindingElement));
-            case 197 /* ArrayBindingPattern */:
+            case 201 /* ArrayBindingPattern */:
+                ts.Debug.type(node);
                 return factory.updateArrayBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isArrayBindingElement));
-            case 198 /* BindingElement */:
-                return factory.updateBindingElement(node, nodeVisitor(node.dotDotDotToken, tokenVisitor, ts.isToken), nodeVisitor(node.propertyName, visitor, ts.isPropertyName), nodeVisitor(node.name, visitor, ts.isBindingName), nodeVisitor(node.initializer, visitor, ts.isExpression));
+            case 202 /* BindingElement */:
+                ts.Debug.type(node);
+                return factory.updateBindingElement(node, nodeVisitor(node.dotDotDotToken, tokenVisitor, ts.isDotDotDotToken), nodeVisitor(node.propertyName, visitor, ts.isPropertyName), nodeVisitor(node.name, visitor, ts.isBindingName), nodeVisitor(node.initializer, visitor, ts.isExpression));
             // Expression
-            case 199 /* ArrayLiteralExpression */:
+            case 203 /* ArrayLiteralExpression */:
+                ts.Debug.type(node);
                 return factory.updateArrayLiteralExpression(node, nodesVisitor(node.elements, visitor, ts.isExpression));
-            case 200 /* ObjectLiteralExpression */:
+            case 204 /* ObjectLiteralExpression */:
+                ts.Debug.type(node);
                 return factory.updateObjectLiteralExpression(node, nodesVisitor(node.properties, visitor, ts.isObjectLiteralElementLike));
-            case 201 /* PropertyAccessExpression */:
+            case 205 /* PropertyAccessExpression */:
                 if (node.flags & 32 /* OptionalChain */) {
-                    return factory.updatePropertyAccessChain(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.questionDotToken, tokenVisitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isIdentifier));
+                    ts.Debug.type(node);
+                    return factory.updatePropertyAccessChain(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.questionDotToken, tokenVisitor, ts.isQuestionDotToken), nodeVisitor(node.name, visitor, ts.isMemberName));
                 }
-                return factory.updatePropertyAccessExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.name, visitor, ts.isIdentifierOrPrivateIdentifier));
-            case 202 /* ElementAccessExpression */:
+                ts.Debug.type(node);
+                return factory.updatePropertyAccessExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.name, visitor, ts.isMemberName));
+            case 206 /* ElementAccessExpression */:
                 if (node.flags & 32 /* OptionalChain */) {
-                    return factory.updateElementAccessChain(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.questionDotToken, tokenVisitor, ts.isToken), nodeVisitor(node.argumentExpression, visitor, ts.isExpression));
+                    ts.Debug.type(node);
+                    return factory.updateElementAccessChain(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.questionDotToken, tokenVisitor, ts.isQuestionDotToken), nodeVisitor(node.argumentExpression, visitor, ts.isExpression));
                 }
+                ts.Debug.type(node);
                 return factory.updateElementAccessExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.argumentExpression, visitor, ts.isExpression));
-            case 203 /* CallExpression */:
+            case 207 /* CallExpression */:
                 if (node.flags & 32 /* OptionalChain */) {
-                    return factory.updateCallChain(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.questionDotToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression));
+                    ts.Debug.type(node);
+                    return factory.updateCallChain(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.questionDotToken, tokenVisitor, ts.isQuestionDotToken), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression));
                 }
+                ts.Debug.type(node);
                 return factory.updateCallExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression));
-            case 204 /* NewExpression */:
+            case 208 /* NewExpression */:
+                ts.Debug.type(node);
                 return factory.updateNewExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression));
-            case 205 /* TaggedTemplateExpression */:
-                return factory.updateTaggedTemplateExpression(node, nodeVisitor(node.tag, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isExpression), nodeVisitor(node.template, visitor, ts.isTemplateLiteral));
-            case 206 /* TypeAssertionExpression */:
+            case 209 /* TaggedTemplateExpression */:
+                ts.Debug.type(node);
+                return factory.updateTaggedTemplateExpression(node, nodeVisitor(node.tag, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isTypeNode), nodeVisitor(node.template, visitor, ts.isTemplateLiteral));
+            case 210 /* TypeAssertionExpression */:
+                ts.Debug.type(node);
                 return factory.updateTypeAssertion(node, nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.expression, visitor, ts.isExpression));
-            case 207 /* ParenthesizedExpression */:
+            case 211 /* ParenthesizedExpression */:
+                ts.Debug.type(node);
                 return factory.updateParenthesizedExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression));
-            case 208 /* FunctionExpression */:
-                return factory.updateFunctionExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.asteriskToken, tokenVisitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context, nodeVisitor));
-            case 209 /* ArrowFunction */:
-                return factory.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.equalsGreaterThanToken, tokenVisitor, ts.isToken), visitFunctionBody(node.body, visitor, context, nodeVisitor));
-            case 210 /* DeleteExpression */:
+            case 212 /* FunctionExpression */:
+                ts.Debug.type(node);
+                return factory.updateFunctionExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.asteriskToken, tokenVisitor, ts.isAsteriskToken), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context, nodeVisitor));
+            case 213 /* ArrowFunction */:
+                ts.Debug.type(node);
+                return factory.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.equalsGreaterThanToken, tokenVisitor, ts.isEqualsGreaterThanToken), visitFunctionBody(node.body, visitor, context, nodeVisitor));
+            case 214 /* DeleteExpression */:
+                ts.Debug.type(node);
                 return factory.updateDeleteExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression));
-            case 211 /* TypeOfExpression */:
+            case 215 /* TypeOfExpression */:
+                ts.Debug.type(node);
                 return factory.updateTypeOfExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression));
-            case 212 /* VoidExpression */:
+            case 216 /* VoidExpression */:
+                ts.Debug.type(node);
                 return factory.updateVoidExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression));
-            case 213 /* AwaitExpression */:
+            case 217 /* AwaitExpression */:
+                ts.Debug.type(node);
                 return factory.updateAwaitExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression));
-            case 214 /* PrefixUnaryExpression */:
+            case 218 /* PrefixUnaryExpression */:
+                ts.Debug.type(node);
                 return factory.updatePrefixUnaryExpression(node, nodeVisitor(node.operand, visitor, ts.isExpression));
-            case 215 /* PostfixUnaryExpression */:
+            case 219 /* PostfixUnaryExpression */:
+                ts.Debug.type(node);
                 return factory.updatePostfixUnaryExpression(node, nodeVisitor(node.operand, visitor, ts.isExpression));
-            case 216 /* BinaryExpression */:
-                return factory.updateBinaryExpression(node, nodeVisitor(node.left, visitor, ts.isExpression), nodeVisitor(node.operatorToken, tokenVisitor, ts.isToken), nodeVisitor(node.right, visitor, ts.isExpression));
-            case 217 /* ConditionalExpression */:
-                return factory.updateConditionalExpression(node, nodeVisitor(node.condition, visitor, ts.isExpression), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodeVisitor(node.whenTrue, visitor, ts.isExpression), nodeVisitor(node.colonToken, tokenVisitor, ts.isToken), nodeVisitor(node.whenFalse, visitor, ts.isExpression));
-            case 218 /* TemplateExpression */:
+            case 220 /* BinaryExpression */:
+                ts.Debug.type(node);
+                return factory.updateBinaryExpression(node, nodeVisitor(node.left, visitor, ts.isExpression), nodeVisitor(node.operatorToken, tokenVisitor, ts.isBinaryOperatorToken), nodeVisitor(node.right, visitor, ts.isExpression));
+            case 221 /* ConditionalExpression */:
+                ts.Debug.type(node);
+                return factory.updateConditionalExpression(node, nodeVisitor(node.condition, visitor, ts.isExpression), nodeVisitor(node.questionToken, tokenVisitor, ts.isQuestionToken), nodeVisitor(node.whenTrue, visitor, ts.isExpression), nodeVisitor(node.colonToken, tokenVisitor, ts.isColonToken), nodeVisitor(node.whenFalse, visitor, ts.isExpression));
+            case 222 /* TemplateExpression */:
+                ts.Debug.type(node);
                 return factory.updateTemplateExpression(node, nodeVisitor(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateSpan));
-            case 219 /* YieldExpression */:
-                return factory.updateYieldExpression(node, nodeVisitor(node.asteriskToken, tokenVisitor, ts.isToken), nodeVisitor(node.expression, visitor, ts.isExpression));
-            case 220 /* SpreadElement */:
+            case 223 /* YieldExpression */:
+                ts.Debug.type(node);
+                return factory.updateYieldExpression(node, nodeVisitor(node.asteriskToken, tokenVisitor, ts.isAsteriskToken), nodeVisitor(node.expression, visitor, ts.isExpression));
+            case 224 /* SpreadElement */:
+                ts.Debug.type(node);
                 return factory.updateSpreadElement(node, nodeVisitor(node.expression, visitor, ts.isExpression));
-            case 221 /* ClassExpression */:
+            case 225 /* ClassExpression */:
+                ts.Debug.type(node);
                 return factory.updateClassExpression(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement));
-            case 223 /* ExpressionWithTypeArguments */:
+            case 227 /* ExpressionWithTypeArguments */:
+                ts.Debug.type(node);
                 return factory.updateExpressionWithTypeArguments(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode));
-            case 224 /* AsExpression */:
+            case 228 /* AsExpression */:
+                ts.Debug.type(node);
                 return factory.updateAsExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.type, visitor, ts.isTypeNode));
-            case 225 /* NonNullExpression */:
+            case 229 /* NonNullExpression */:
                 if (node.flags & 32 /* OptionalChain */) {
+                    ts.Debug.type(node);
                     return factory.updateNonNullChain(node, nodeVisitor(node.expression, visitor, ts.isExpression));
                 }
+                ts.Debug.type(node);
                 return factory.updateNonNullExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression));
-            case 226 /* MetaProperty */:
+            case 230 /* MetaProperty */:
+                ts.Debug.type(node);
                 return factory.updateMetaProperty(node, nodeVisitor(node.name, visitor, ts.isIdentifier));
             // Misc
-            case 228 /* TemplateSpan */:
+            case 232 /* TemplateSpan */:
+                ts.Debug.type(node);
                 return factory.updateTemplateSpan(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail));
             // Element
-            case 230 /* Block */:
+            case 234 /* Block */:
+                ts.Debug.type(node);
                 return factory.updateBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement));
-            case 232 /* VariableStatement */:
+            case 236 /* VariableStatement */:
+                ts.Debug.type(node);
                 return factory.updateVariableStatement(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.declarationList, visitor, ts.isVariableDeclarationList));
-            case 233 /* ExpressionStatement */:
+            case 237 /* ExpressionStatement */:
+                ts.Debug.type(node);
                 return factory.updateExpressionStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression));
-            case 234 /* IfStatement */:
+            case 238 /* IfStatement */:
+                ts.Debug.type(node);
                 return factory.updateIfStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.thenStatement, visitor, ts.isStatement, factory.liftToBlock), nodeVisitor(node.elseStatement, visitor, ts.isStatement, factory.liftToBlock));
-            case 235 /* DoStatement */:
-                return factory.updateDoStatement(node, nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock), nodeVisitor(node.expression, visitor, ts.isExpression));
-            case 236 /* WhileStatement */:
-                return factory.updateWhileStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock));
-            case 237 /* ForStatement */:
-                return factory.updateForStatement(node, nodeVisitor(node.initializer, visitor, ts.isForInitializer), nodeVisitor(node.condition, visitor, ts.isExpression), nodeVisitor(node.incrementor, visitor, ts.isExpression), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock));
-            case 238 /* ForInStatement */:
-                return factory.updateForInStatement(node, nodeVisitor(node.initializer, visitor, ts.isForInitializer), nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock));
-            case 239 /* ForOfStatement */:
-                return factory.updateForOfStatement(node, nodeVisitor(node.awaitModifier, tokenVisitor, ts.isToken), nodeVisitor(node.initializer, visitor, ts.isForInitializer), nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock));
-            case 240 /* ContinueStatement */:
+            case 239 /* DoStatement */:
+                ts.Debug.type(node);
+                return factory.updateDoStatement(node, visitIterationBody(node.statement, visitor, context), nodeVisitor(node.expression, visitor, ts.isExpression));
+            case 240 /* WhileStatement */:
+                ts.Debug.type(node);
+                return factory.updateWhileStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression), visitIterationBody(node.statement, visitor, context));
+            case 241 /* ForStatement */:
+                ts.Debug.type(node);
+                return factory.updateForStatement(node, nodeVisitor(node.initializer, visitor, ts.isForInitializer), nodeVisitor(node.condition, visitor, ts.isExpression), nodeVisitor(node.incrementor, visitor, ts.isExpression), visitIterationBody(node.statement, visitor, context));
+            case 242 /* ForInStatement */:
+                ts.Debug.type(node);
+                return factory.updateForInStatement(node, nodeVisitor(node.initializer, visitor, ts.isForInitializer), nodeVisitor(node.expression, visitor, ts.isExpression), visitIterationBody(node.statement, visitor, context));
+            case 243 /* ForOfStatement */:
+                ts.Debug.type(node);
+                return factory.updateForOfStatement(node, nodeVisitor(node.awaitModifier, tokenVisitor, ts.isAwaitKeyword), nodeVisitor(node.initializer, visitor, ts.isForInitializer), nodeVisitor(node.expression, visitor, ts.isExpression), visitIterationBody(node.statement, visitor, context));
+            case 244 /* ContinueStatement */:
+                ts.Debug.type(node);
                 return factory.updateContinueStatement(node, nodeVisitor(node.label, visitor, ts.isIdentifier));
-            case 241 /* BreakStatement */:
+            case 245 /* BreakStatement */:
+                ts.Debug.type(node);
                 return factory.updateBreakStatement(node, nodeVisitor(node.label, visitor, ts.isIdentifier));
-            case 242 /* ReturnStatement */:
+            case 246 /* ReturnStatement */:
+                ts.Debug.type(node);
                 return factory.updateReturnStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression));
-            case 243 /* WithStatement */:
+            case 247 /* WithStatement */:
+                ts.Debug.type(node);
                 return factory.updateWithStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock));
-            case 244 /* SwitchStatement */:
+            case 248 /* SwitchStatement */:
+                ts.Debug.type(node);
                 return factory.updateSwitchStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.caseBlock, visitor, ts.isCaseBlock));
-            case 245 /* LabeledStatement */:
+            case 249 /* LabeledStatement */:
+                ts.Debug.type(node);
                 return factory.updateLabeledStatement(node, nodeVisitor(node.label, visitor, ts.isIdentifier), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock));
-            case 246 /* ThrowStatement */:
+            case 250 /* ThrowStatement */:
+                ts.Debug.type(node);
                 return factory.updateThrowStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression));
-            case 247 /* TryStatement */:
+            case 251 /* TryStatement */:
+                ts.Debug.type(node);
                 return factory.updateTryStatement(node, nodeVisitor(node.tryBlock, visitor, ts.isBlock), nodeVisitor(node.catchClause, visitor, ts.isCatchClause), nodeVisitor(node.finallyBlock, visitor, ts.isBlock));
-            case 249 /* VariableDeclaration */:
-                return factory.updateVariableDeclaration(node, nodeVisitor(node.name, visitor, ts.isBindingName), nodeVisitor(node.exclamationToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.initializer, visitor, ts.isExpression));
-            case 250 /* VariableDeclarationList */:
+            case 253 /* VariableDeclaration */:
+                ts.Debug.type(node);
+                return factory.updateVariableDeclaration(node, nodeVisitor(node.name, visitor, ts.isBindingName), nodeVisitor(node.exclamationToken, tokenVisitor, ts.isExclamationToken), nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.initializer, visitor, ts.isExpression));
+            case 254 /* VariableDeclarationList */:
+                ts.Debug.type(node);
                 return factory.updateVariableDeclarationList(node, nodesVisitor(node.declarations, visitor, ts.isVariableDeclaration));
-            case 251 /* FunctionDeclaration */:
-                return factory.updateFunctionDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.asteriskToken, tokenVisitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context, nodeVisitor));
-            case 252 /* ClassDeclaration */:
+            case 255 /* FunctionDeclaration */:
+                ts.Debug.type(node);
+                return factory.updateFunctionDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.asteriskToken, tokenVisitor, ts.isAsteriskToken), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context, nodeVisitor));
+            case 256 /* ClassDeclaration */:
+                ts.Debug.type(node);
                 return factory.updateClassDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement));
-            case 253 /* InterfaceDeclaration */:
+            case 257 /* InterfaceDeclaration */:
+                ts.Debug.type(node);
                 return factory.updateInterfaceDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isTypeElement));
-            case 254 /* TypeAliasDeclaration */:
+            case 258 /* TypeAliasDeclaration */:
+                ts.Debug.type(node);
                 return factory.updateTypeAliasDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode));
-            case 255 /* EnumDeclaration */:
+            case 259 /* EnumDeclaration */:
+                ts.Debug.type(node);
                 return factory.updateEnumDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.members, visitor, ts.isEnumMember));
-            case 256 /* ModuleDeclaration */:
-                return factory.updateModuleDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.body, visitor, ts.isModuleBody));
-            case 257 /* ModuleBlock */:
+            case 260 /* ModuleDeclaration */:
+                ts.Debug.type(node);
+                return factory.updateModuleDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isModuleName), nodeVisitor(node.body, visitor, ts.isModuleBody));
+            case 261 /* ModuleBlock */:
+                ts.Debug.type(node);
                 return factory.updateModuleBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement));
-            case 258 /* CaseBlock */:
+            case 262 /* CaseBlock */:
+                ts.Debug.type(node);
                 return factory.updateCaseBlock(node, nodesVisitor(node.clauses, visitor, ts.isCaseOrDefaultClause));
-            case 259 /* NamespaceExportDeclaration */:
+            case 263 /* NamespaceExportDeclaration */:
+                ts.Debug.type(node);
                 return factory.updateNamespaceExportDeclaration(node, nodeVisitor(node.name, visitor, ts.isIdentifier));
-            case 260 /* ImportEqualsDeclaration */:
+            case 264 /* ImportEqualsDeclaration */:
+                ts.Debug.type(node);
                 return factory.updateImportEqualsDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), node.isTypeOnly, nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.moduleReference, visitor, ts.isModuleReference));
-            case 261 /* ImportDeclaration */:
-                return factory.updateImportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.importClause, visitor, ts.isImportClause), nodeVisitor(node.moduleSpecifier, visitor, ts.isExpression));
-            case 262 /* ImportClause */:
+            case 265 /* ImportDeclaration */:
+                ts.Debug.type(node);
+                return factory.updateImportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.importClause, visitor, ts.isImportClause), nodeVisitor(node.moduleSpecifier, visitor, ts.isExpression), nodeVisitor(node.assertClause, visitor, ts.isAssertClause));
+            case 292 /* AssertClause */:
+                ts.Debug.type(node);
+                return factory.updateAssertClause(node, nodesVisitor(node.elements, visitor, ts.isAssertEntry), node.multiLine);
+            case 293 /* AssertEntry */:
+                ts.Debug.type(node);
+                return factory.updateAssertEntry(node, nodeVisitor(node.name, visitor, ts.isAssertionKey), nodeVisitor(node.value, visitor, ts.isStringLiteral));
+            case 266 /* ImportClause */:
+                ts.Debug.type(node);
                 return factory.updateImportClause(node, node.isTypeOnly, nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.namedBindings, visitor, ts.isNamedImportBindings));
-            case 263 /* NamespaceImport */:
+            case 267 /* NamespaceImport */:
+                ts.Debug.type(node);
                 return factory.updateNamespaceImport(node, nodeVisitor(node.name, visitor, ts.isIdentifier));
-            case 269 /* NamespaceExport */:
+            case 273 /* NamespaceExport */:
+                ts.Debug.type(node);
                 return factory.updateNamespaceExport(node, nodeVisitor(node.name, visitor, ts.isIdentifier));
-            case 264 /* NamedImports */:
+            case 268 /* NamedImports */:
+                ts.Debug.type(node);
                 return factory.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier));
-            case 265 /* ImportSpecifier */:
-                return factory.updateImportSpecifier(node, nodeVisitor(node.propertyName, visitor, ts.isIdentifier), nodeVisitor(node.name, visitor, ts.isIdentifier));
-            case 266 /* ExportAssignment */:
+            case 269 /* ImportSpecifier */:
+                ts.Debug.type(node);
+                return factory.updateImportSpecifier(node, node.isTypeOnly, nodeVisitor(node.propertyName, visitor, ts.isIdentifier), nodeVisitor(node.name, visitor, ts.isIdentifier));
+            case 270 /* ExportAssignment */:
+                ts.Debug.type(node);
                 return factory.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.expression, visitor, ts.isExpression));
-            case 267 /* ExportDeclaration */:
-                return factory.updateExportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), node.isTypeOnly, nodeVisitor(node.exportClause, visitor, ts.isNamedExportBindings), nodeVisitor(node.moduleSpecifier, visitor, ts.isExpression));
-            case 268 /* NamedExports */:
+            case 271 /* ExportDeclaration */:
+                ts.Debug.type(node);
+                return factory.updateExportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), node.isTypeOnly, nodeVisitor(node.exportClause, visitor, ts.isNamedExportBindings), nodeVisitor(node.moduleSpecifier, visitor, ts.isExpression), nodeVisitor(node.assertClause, visitor, ts.isAssertClause));
+            case 272 /* NamedExports */:
+                ts.Debug.type(node);
                 return factory.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier));
-            case 270 /* ExportSpecifier */:
-                return factory.updateExportSpecifier(node, nodeVisitor(node.propertyName, visitor, ts.isIdentifier), nodeVisitor(node.name, visitor, ts.isIdentifier));
+            case 274 /* ExportSpecifier */:
+                ts.Debug.type(node);
+                return factory.updateExportSpecifier(node, node.isTypeOnly, nodeVisitor(node.propertyName, visitor, ts.isIdentifier), nodeVisitor(node.name, visitor, ts.isIdentifier));
             // Module references
-            case 272 /* ExternalModuleReference */:
+            case 276 /* ExternalModuleReference */:
+                ts.Debug.type(node);
                 return factory.updateExternalModuleReference(node, nodeVisitor(node.expression, visitor, ts.isExpression));
             // JSX
-            case 273 /* JsxElement */:
+            case 277 /* JsxElement */:
+                ts.Debug.type(node);
                 return factory.updateJsxElement(node, nodeVisitor(node.openingElement, visitor, ts.isJsxOpeningElement), nodesVisitor(node.children, visitor, ts.isJsxChild), nodeVisitor(node.closingElement, visitor, ts.isJsxClosingElement));
-            case 274 /* JsxSelfClosingElement */:
+            case 278 /* JsxSelfClosingElement */:
+                ts.Debug.type(node);
                 return factory.updateJsxSelfClosingElement(node, nodeVisitor(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodeVisitor(node.attributes, visitor, ts.isJsxAttributes));
-            case 275 /* JsxOpeningElement */:
+            case 279 /* JsxOpeningElement */:
+                ts.Debug.type(node);
                 return factory.updateJsxOpeningElement(node, nodeVisitor(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodeVisitor(node.attributes, visitor, ts.isJsxAttributes));
-            case 276 /* JsxClosingElement */:
+            case 280 /* JsxClosingElement */:
+                ts.Debug.type(node);
                 return factory.updateJsxClosingElement(node, nodeVisitor(node.tagName, visitor, ts.isJsxTagNameExpression));
-            case 277 /* JsxFragment */:
+            case 281 /* JsxFragment */:
+                ts.Debug.type(node);
                 return factory.updateJsxFragment(node, nodeVisitor(node.openingFragment, visitor, ts.isJsxOpeningFragment), nodesVisitor(node.children, visitor, ts.isJsxChild), nodeVisitor(node.closingFragment, visitor, ts.isJsxClosingFragment));
-            case 280 /* JsxAttribute */:
+            case 284 /* JsxAttribute */:
+                ts.Debug.type(node);
                 return factory.updateJsxAttribute(node, nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.initializer, visitor, ts.isStringLiteralOrJsxExpression));
-            case 281 /* JsxAttributes */:
+            case 285 /* JsxAttributes */:
+                ts.Debug.type(node);
                 return factory.updateJsxAttributes(node, nodesVisitor(node.properties, visitor, ts.isJsxAttributeLike));
-            case 282 /* JsxSpreadAttribute */:
+            case 286 /* JsxSpreadAttribute */:
+                ts.Debug.type(node);
                 return factory.updateJsxSpreadAttribute(node, nodeVisitor(node.expression, visitor, ts.isExpression));
-            case 283 /* JsxExpression */:
+            case 287 /* JsxExpression */:
+                ts.Debug.type(node);
                 return factory.updateJsxExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression));
             // Clauses
-            case 284 /* CaseClause */:
+            case 288 /* CaseClause */:
+                ts.Debug.type(node);
                 return factory.updateCaseClause(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodesVisitor(node.statements, visitor, ts.isStatement));
-            case 285 /* DefaultClause */:
+            case 289 /* DefaultClause */:
+                ts.Debug.type(node);
                 return factory.updateDefaultClause(node, nodesVisitor(node.statements, visitor, ts.isStatement));
-            case 286 /* HeritageClause */:
+            case 290 /* HeritageClause */:
+                ts.Debug.type(node);
                 return factory.updateHeritageClause(node, nodesVisitor(node.types, visitor, ts.isExpressionWithTypeArguments));
-            case 287 /* CatchClause */:
+            case 291 /* CatchClause */:
+                ts.Debug.type(node);
                 return factory.updateCatchClause(node, nodeVisitor(node.variableDeclaration, visitor, ts.isVariableDeclaration), nodeVisitor(node.block, visitor, ts.isBlock));
             // Property assignments
-            case 288 /* PropertyAssignment */:
+            case 294 /* PropertyAssignment */:
+                ts.Debug.type(node);
                 return factory.updatePropertyAssignment(node, nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.initializer, visitor, ts.isExpression));
-            case 289 /* ShorthandPropertyAssignment */:
+            case 295 /* ShorthandPropertyAssignment */:
+                ts.Debug.type(node);
                 return factory.updateShorthandPropertyAssignment(node, nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.objectAssignmentInitializer, visitor, ts.isExpression));
-            case 290 /* SpreadAssignment */:
+            case 296 /* SpreadAssignment */:
+                ts.Debug.type(node);
                 return factory.updateSpreadAssignment(node, nodeVisitor(node.expression, visitor, ts.isExpression));
             // Enum
-            case 291 /* EnumMember */:
+            case 297 /* EnumMember */:
+                ts.Debug.type(node);
                 return factory.updateEnumMember(node, nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.initializer, visitor, ts.isExpression));
             // Top-level nodes
-            case 297 /* SourceFile */:
+            case 303 /* SourceFile */:
+                ts.Debug.type(node);
                 return factory.updateSourceFile(node, visitLexicalEnvironment(node.statements, visitor, context));
             // Transformation nodes
-            case 336 /* PartiallyEmittedExpression */:
+            case 348 /* PartiallyEmittedExpression */:
+                ts.Debug.type(node);
                 return factory.updatePartiallyEmittedExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression));
-            case 337 /* CommaListExpression */:
+            case 349 /* CommaListExpression */:
+                ts.Debug.type(node);
                 return factory.updateCommaListExpression(node, nodesVisitor(node.elements, visitor, ts.isExpression));
             default:
                 // No need to visit nodes with no children.
@@ -81686,6 +87445,7 @@ var ts;
         var sourcesContent;
         var names = [];
         var nameToNameIndexMap;
+        var mappingCharCodes = [];
         var mappings = "";
         // Last recorded and encoded mappings
         var lastGeneratedLine = 0;
@@ -81860,6 +87620,14 @@ var ts;
                 || lastSourceCharacter !== pendingSourceCharacter
                 || lastNameIndex !== pendingNameIndex;
         }
+        function appendMappingCharCode(charCode) {
+            mappingCharCodes.push(charCode);
+            // String.fromCharCode accepts its arguments on the stack, so we have to chunk the input,
+            // otherwise we can get stack overflows for large source maps
+            if (mappingCharCodes.length >= 1024) {
+                flushMappingBuffer();
+            }
+        }
         function commitPendingMapping() {
             if (!hasPending || !shouldCommitMapping()) {
                 return;
@@ -81869,42 +87637,50 @@ var ts;
             if (lastGeneratedLine < pendingGeneratedLine) {
                 // Emit line delimiters
                 do {
-                    mappings += ";";
+                    appendMappingCharCode(59 /* semicolon */);
                     lastGeneratedLine++;
-                    lastGeneratedCharacter = 0;
                 } while (lastGeneratedLine < pendingGeneratedLine);
+                // Only need to set this once
+                lastGeneratedCharacter = 0;
             }
             else {
                 ts.Debug.assertEqual(lastGeneratedLine, pendingGeneratedLine, "generatedLine cannot backtrack");
                 // Emit comma to separate the entry
                 if (hasLast) {
-                    mappings += ",";
+                    appendMappingCharCode(44 /* comma */);
                 }
             }
             // 1. Relative generated character
-            mappings += base64VLQFormatEncode(pendingGeneratedCharacter - lastGeneratedCharacter);
+            appendBase64VLQ(pendingGeneratedCharacter - lastGeneratedCharacter);
             lastGeneratedCharacter = pendingGeneratedCharacter;
             if (hasPendingSource) {
                 // 2. Relative sourceIndex
-                mappings += base64VLQFormatEncode(pendingSourceIndex - lastSourceIndex);
+                appendBase64VLQ(pendingSourceIndex - lastSourceIndex);
                 lastSourceIndex = pendingSourceIndex;
                 // 3. Relative source line
-                mappings += base64VLQFormatEncode(pendingSourceLine - lastSourceLine);
+                appendBase64VLQ(pendingSourceLine - lastSourceLine);
                 lastSourceLine = pendingSourceLine;
                 // 4. Relative source character
-                mappings += base64VLQFormatEncode(pendingSourceCharacter - lastSourceCharacter);
+                appendBase64VLQ(pendingSourceCharacter - lastSourceCharacter);
                 lastSourceCharacter = pendingSourceCharacter;
                 if (hasPendingName) {
                     // 5. Relative nameIndex
-                    mappings += base64VLQFormatEncode(pendingNameIndex - lastNameIndex);
+                    appendBase64VLQ(pendingNameIndex - lastNameIndex);
                     lastNameIndex = pendingNameIndex;
                 }
             }
             hasLast = true;
             exit();
         }
+        function flushMappingBuffer() {
+            if (mappingCharCodes.length > 0) {
+                mappings += String.fromCharCode.apply(undefined, mappingCharCodes);
+                mappingCharCodes.length = 0;
+            }
+        }
         function toJSON() {
             commitPendingMapping();
+            flushMappingBuffer();
             return {
                 version: 3,
                 file: file,
@@ -81915,10 +87691,33 @@ var ts;
                 sourcesContent: sourcesContent,
             };
         }
+        function appendBase64VLQ(inValue) {
+            // Add a new least significant bit that has the sign of the value.
+            // if negative number the least significant bit that gets added to the number has value 1
+            // else least significant bit value that gets added is 0
+            // eg. -1 changes to binary : 01 [1] => 3
+            //     +1 changes to binary : 01 [0] => 2
+            if (inValue < 0) {
+                inValue = ((-inValue) << 1) + 1;
+            }
+            else {
+                inValue = inValue << 1;
+            }
+            // Encode 5 bits at a time starting from least significant bits
+            do {
+                var currentDigit = inValue & 31; // 11111
+                inValue = inValue >> 5;
+                if (inValue > 0) {
+                    // There are still more digits to decode, set the msb (6th bit)
+                    currentDigit = currentDigit | 32;
+                }
+                appendMappingCharCode(base64FormatEncode(currentDigit));
+            } while (inValue > 0);
+        }
     }
     ts.createSourceMapGenerator = createSourceMapGenerator;
     // Sometimes tools can see the following line as a source mapping url comment, so we mangle it a bit (the [M])
-    var sourceMapCommentRegExp = /^\/\/[@#] source[M]appingURL=(.+)\s*$/;
+    var sourceMapCommentRegExp = /^\/\/[@#] source[M]appingURL=(.+)\r?\n?$/;
     var whitespaceOrMapCommentRegExp = /^\s*(\/\/[@#] .*)?$/;
     function getLineInfo(text, lineStarts) {
         return {
@@ -81935,7 +87734,7 @@ var ts;
             var line = lineInfo.getLineText(index);
             var comment = sourceMapCommentRegExp.exec(line);
             if (comment) {
-                return comment[1];
+                return ts.trimStringEnd(comment[1]);
             }
             // If we see a non-whitespace/map comment-like line, break, to avoid scanning up the entire file
             else if (!line.match(whitespaceOrMapCommentRegExp)) {
@@ -82131,7 +87930,7 @@ var ts;
                 value >= 52 && value < 62 ? 48 /* _0 */ + value - 52 :
                     value === 62 ? 43 /* plus */ :
                         value === 63 ? 47 /* slash */ :
-                            ts.Debug.fail(value + ": not a base64 value");
+                            ts.Debug.fail("".concat(value, ": not a base64 value"));
     }
     function base64FormatDecode(ch) {
         return ch >= 65 /* A */ && ch <= 90 /* Z */ ? ch - 65 /* A */ :
@@ -82141,31 +87940,6 @@ var ts;
                         ch === 47 /* slash */ ? 63 :
                             -1;
     }
-    function base64VLQFormatEncode(inValue) {
-        // Add a new least significant bit that has the sign of the value.
-        // if negative number the least significant bit that gets added to the number has value 1
-        // else least significant bit value that gets added is 0
-        // eg. -1 changes to binary : 01 [1] => 3
-        //     +1 changes to binary : 01 [0] => 2
-        if (inValue < 0) {
-            inValue = ((-inValue) << 1) + 1;
-        }
-        else {
-            inValue = inValue << 1;
-        }
-        // Encode 5 bits at a time starting from least significant bits
-        var encodedStr = "";
-        do {
-            var currentDigit = inValue & 31; // 11111
-            inValue = inValue >> 5;
-            if (inValue > 0) {
-                // There are still more digits to decode, set the msb (6th bit)
-                currentDigit = currentDigit | 32;
-            }
-            encodedStr = encodedStr + String.fromCharCode(base64FormatEncode(currentDigit));
-        } while (inValue > 0);
-        return encodedStr;
-    }
     function isSourceMappedPosition(value) {
         return value.sourceIndex !== undefined
             && value.sourcePosition !== undefined;
@@ -82231,7 +88005,7 @@ var ts;
                 var mappings = ts.arrayFrom(decoder, processMapping);
                 if (decoder.error !== undefined) {
                     if (host.log) {
-                        host.log("Encountered error while decoding sourcemap: " + decoder.error);
+                        host.log("Encountered error while decoding sourcemap: ".concat(decoder.error));
                     }
                     decodedMappings = ts.emptyArray;
                 }
@@ -82329,7 +88103,7 @@ var ts;
     function chainBundle(context, transformSourceFile) {
         return transformSourceFileOrBundle;
         function transformSourceFileOrBundle(node) {
-            return node.kind === 297 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node);
+            return node.kind === 303 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node);
         }
         function transformBundle(node) {
             return context.factory.createBundle(ts.map(node.sourceFiles, transformSourceFile), node.prepends);
@@ -82380,7 +88154,7 @@ var ts;
         for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) {
             var node = _a[_i];
             switch (node.kind) {
-                case 261 /* ImportDeclaration */:
+                case 265 /* ImportDeclaration */:
                     // import "mod"
                     // import x from "mod"
                     // import * as x from "mod"
@@ -82393,13 +88167,13 @@ var ts;
                         hasImportDefault = true;
                     }
                     break;
-                case 260 /* ImportEqualsDeclaration */:
-                    if (node.moduleReference.kind === 272 /* ExternalModuleReference */) {
+                case 264 /* ImportEqualsDeclaration */:
+                    if (node.moduleReference.kind === 276 /* ExternalModuleReference */) {
                         // import x = require("mod")
                         externalImports.push(node);
                     }
                     break;
-                case 267 /* ExportDeclaration */:
+                case 271 /* ExportDeclaration */:
                     if (node.moduleSpecifier) {
                         if (!node.exportClause) {
                             // export * from "mod"
@@ -82430,13 +88204,13 @@ var ts;
                         addExportedNamesForExportDeclaration(node);
                     }
                     break;
-                case 266 /* ExportAssignment */:
+                case 270 /* ExportAssignment */:
                     if (node.isExportEquals && !exportEquals) {
                         // export = x
                         exportEquals = node;
                     }
                     break;
-                case 232 /* VariableStatement */:
+                case 236 /* VariableStatement */:
                     if (ts.hasSyntacticModifier(node, 1 /* Export */)) {
                         for (var _b = 0, _c = node.declarationList.declarations; _b < _c.length; _b++) {
                             var decl = _c[_b];
@@ -82444,7 +88218,7 @@ var ts;
                         }
                     }
                     break;
-                case 251 /* FunctionDeclaration */:
+                case 255 /* FunctionDeclaration */:
                     if (ts.hasSyntacticModifier(node, 1 /* Export */)) {
                         if (ts.hasSyntacticModifier(node, 512 /* Default */)) {
                             // export default function() { }
@@ -82464,7 +88238,7 @@ var ts;
                         }
                     }
                     break;
-                case 252 /* ClassDeclaration */:
+                case 256 /* ClassDeclaration */:
                     if (ts.hasSyntacticModifier(node, 1 /* Export */)) {
                         if (ts.hasSyntacticModifier(node, 512 /* Default */)) {
                             // export default class { }
@@ -82558,32 +88332,31 @@ var ts;
      * any such locations
      */
     function isSimpleInlineableExpression(expression) {
-        return !ts.isIdentifier(expression) && isSimpleCopiableExpression(expression) ||
-            ts.isWellKnownSymbolSyntactically(expression);
+        return !ts.isIdentifier(expression) && isSimpleCopiableExpression(expression);
     }
     ts.isSimpleInlineableExpression = isSimpleInlineableExpression;
     function isCompoundAssignment(kind) {
-        return kind >= 63 /* FirstCompoundAssignment */
-            && kind <= 77 /* LastCompoundAssignment */;
+        return kind >= 64 /* FirstCompoundAssignment */
+            && kind <= 78 /* LastCompoundAssignment */;
     }
     ts.isCompoundAssignment = isCompoundAssignment;
     function getNonAssignmentOperatorForCompoundAssignment(kind) {
         switch (kind) {
-            case 63 /* PlusEqualsToken */: return 39 /* PlusToken */;
-            case 64 /* MinusEqualsToken */: return 40 /* MinusToken */;
-            case 65 /* AsteriskEqualsToken */: return 41 /* AsteriskToken */;
-            case 66 /* AsteriskAsteriskEqualsToken */: return 42 /* AsteriskAsteriskToken */;
-            case 67 /* SlashEqualsToken */: return 43 /* SlashToken */;
-            case 68 /* PercentEqualsToken */: return 44 /* PercentToken */;
-            case 69 /* LessThanLessThanEqualsToken */: return 47 /* LessThanLessThanToken */;
-            case 70 /* GreaterThanGreaterThanEqualsToken */: return 48 /* GreaterThanGreaterThanToken */;
-            case 71 /* GreaterThanGreaterThanGreaterThanEqualsToken */: return 49 /* GreaterThanGreaterThanGreaterThanToken */;
-            case 72 /* AmpersandEqualsToken */: return 50 /* AmpersandToken */;
-            case 73 /* BarEqualsToken */: return 51 /* BarToken */;
-            case 77 /* CaretEqualsToken */: return 52 /* CaretToken */;
-            case 74 /* BarBarEqualsToken */: return 56 /* BarBarToken */;
-            case 75 /* AmpersandAmpersandEqualsToken */: return 55 /* AmpersandAmpersandToken */;
-            case 76 /* QuestionQuestionEqualsToken */: return 60 /* QuestionQuestionToken */;
+            case 64 /* PlusEqualsToken */: return 39 /* PlusToken */;
+            case 65 /* MinusEqualsToken */: return 40 /* MinusToken */;
+            case 66 /* AsteriskEqualsToken */: return 41 /* AsteriskToken */;
+            case 67 /* AsteriskAsteriskEqualsToken */: return 42 /* AsteriskAsteriskToken */;
+            case 68 /* SlashEqualsToken */: return 43 /* SlashToken */;
+            case 69 /* PercentEqualsToken */: return 44 /* PercentToken */;
+            case 70 /* LessThanLessThanEqualsToken */: return 47 /* LessThanLessThanToken */;
+            case 71 /* GreaterThanGreaterThanEqualsToken */: return 48 /* GreaterThanGreaterThanToken */;
+            case 72 /* GreaterThanGreaterThanGreaterThanEqualsToken */: return 49 /* GreaterThanGreaterThanGreaterThanToken */;
+            case 73 /* AmpersandEqualsToken */: return 50 /* AmpersandToken */;
+            case 74 /* BarEqualsToken */: return 51 /* BarToken */;
+            case 78 /* CaretEqualsToken */: return 52 /* CaretToken */;
+            case 75 /* BarBarEqualsToken */: return 56 /* BarBarToken */;
+            case 76 /* AmpersandAmpersandEqualsToken */: return 55 /* AmpersandAmpersandToken */;
+            case 77 /* QuestionQuestionEqualsToken */: return 60 /* QuestionQuestionToken */;
         }
     }
     ts.getNonAssignmentOperatorForCompoundAssignment = getNonAssignmentOperatorForCompoundAssignment;
@@ -82620,6 +88393,13 @@ var ts;
         return ts.filter(node.members, function (m) { return isInitializedOrStaticProperty(m, requireInitializer, isStatic); });
     }
     ts.getProperties = getProperties;
+    function isStaticPropertyDeclarationOrClassStaticBlockDeclaration(element) {
+        return isStaticPropertyDeclaration(element) || ts.isClassStaticBlockDeclaration(element);
+    }
+    function getStaticPropertiesAndClassStaticBlock(node) {
+        return ts.filter(node.members, isStaticPropertyDeclarationOrClassStaticBlockDeclaration);
+    }
+    ts.getStaticPropertiesAndClassStaticBlock = getStaticPropertiesAndClassStaticBlock;
     /**
      * Is a class element either a static or an instance property declaration with an initializer?
      *
@@ -82631,6 +88411,9 @@ var ts;
             && (!!member.initializer || !requireInitializer)
             && ts.hasStaticModifier(member) === isStatic;
     }
+    function isStaticPropertyDeclaration(member) {
+        return ts.isPropertyDeclaration(member) && ts.hasStaticModifier(member);
+    }
     /**
      * Gets a value indicating whether a class element is either a static or an instance property declaration with an initializer.
      *
@@ -82638,10 +88421,19 @@ var ts;
      * @param isStatic A value indicating whether the member should be a static or instance member.
      */
     function isInitializedProperty(member) {
-        return member.kind === 163 /* PropertyDeclaration */
+        return member.kind === 166 /* PropertyDeclaration */
             && member.initializer !== undefined;
     }
     ts.isInitializedProperty = isInitializedProperty;
+    /**
+     * Gets a value indicating whether a class element is a private instance method or accessor.
+     *
+     * @param member The class element node.
+     */
+    function isNonStaticMethodOrAccessorWithPrivateName(member) {
+        return !ts.isStatic(member) && ts.isMethodOrAccessor(member) && ts.isPrivateIdentifier(member.name);
+    }
+    ts.isNonStaticMethodOrAccessorWithPrivateName = isNonStaticMethodOrAccessorWithPrivateName;
 })(ts || (ts = {}));
 /*@internal*/
 var ts;
@@ -82915,8 +88707,8 @@ var ts;
             if (!ts.getRestIndicatorOfBindingOrAssignmentElement(element)) {
                 var propertyName = ts.getPropertyNameOfBindingOrAssignmentElement(element);
                 if (flattenContext.level >= 1 /* ObjectRest */
-                    && !(element.transformFlags & (8192 /* ContainsRestOrSpread */ | 16384 /* ContainsObjectRestOrSpread */))
-                    && !(ts.getTargetOfBindingOrAssignmentElement(element).transformFlags & (8192 /* ContainsRestOrSpread */ | 16384 /* ContainsObjectRestOrSpread */))
+                    && !(element.transformFlags & (16384 /* ContainsRestOrSpread */ | 32768 /* ContainsObjectRestOrSpread */))
+                    && !(ts.getTargetOfBindingOrAssignmentElement(element).transformFlags & (16384 /* ContainsRestOrSpread */ | 32768 /* ContainsObjectRestOrSpread */))
                     && !ts.isComputedPropertyName(propertyName)) {
                     bindingElements = ts.append(bindingElements, ts.visitNode(element, flattenContext.visitor));
                 }
@@ -82982,7 +88774,7 @@ var ts;
             if (flattenContext.level >= 1 /* ObjectRest */) {
                 // If an array pattern contains an ObjectRest, we must cache the result so that we
                 // can perform the ObjectRest destructuring in a different declaration
-                if (element.transformFlags & 16384 /* ContainsObjectRestOrSpread */ || flattenContext.hasTransformedPriorElement && !isSimpleBindingOrAssignmentElement(element)) {
+                if (element.transformFlags & 32768 /* ContainsObjectRestOrSpread */ || flattenContext.hasTransformedPriorElement && !isSimpleBindingOrAssignmentElement(element)) {
                     flattenContext.hasTransformedPriorElement = true;
                     var temp = flattenContext.context.factory.createTempVariable(/*recordTempVariable*/ undefined);
                     if (flattenContext.hoistTempVariables) {
@@ -83179,6 +88971,7 @@ var ts;
         // Examples: `\n` is converted to "\\n", a template string with a newline to "\n".
         var text = node.rawText;
         if (text === undefined) {
+            ts.Debug.assertIsDefined(currentSourceFile, "Template literal node is missing 'rawText' and does not have a source file. Possibly bad transform.");
             text = ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, node);
             // text contains the original source, it will also contain quotes ("`"), dolar signs and braces ("${" and "}"),
             // thus we need to remove those characters.
@@ -83240,8 +89033,8 @@ var ts;
         context.onEmitNode = onEmitNode;
         context.onSubstituteNode = onSubstituteNode;
         // Enable substitution for property/element access to emit const enum values.
-        context.enableSubstitution(201 /* PropertyAccessExpression */);
-        context.enableSubstitution(202 /* ElementAccessExpression */);
+        context.enableSubstitution(205 /* PropertyAccessExpression */);
+        context.enableSubstitution(206 /* ElementAccessExpression */);
         // These variables contain state that changes as we descend into the tree.
         var currentSourceFile;
         var currentNamespace;
@@ -83267,14 +89060,14 @@ var ts;
         var applicableSubstitutions;
         return transformSourceFileOrBundle;
         function transformSourceFileOrBundle(node) {
-            if (node.kind === 298 /* Bundle */) {
+            if (node.kind === 304 /* Bundle */) {
                 return transformBundle(node);
             }
             return transformSourceFile(node);
         }
         function transformBundle(node) {
             return factory.createBundle(node.sourceFiles.map(transformSourceFile), ts.mapDefined(node.prepends, function (prepend) {
-                if (prepend.kind === 300 /* InputFiles */) {
+                if (prepend.kind === 306 /* InputFiles */) {
                     return ts.createUnparsedSourceFile(prepend, "js");
                 }
                 return prepend;
@@ -83325,16 +89118,16 @@ var ts;
          */
         function onBeforeVisitNode(node) {
             switch (node.kind) {
-                case 297 /* SourceFile */:
-                case 258 /* CaseBlock */:
-                case 257 /* ModuleBlock */:
-                case 230 /* Block */:
+                case 303 /* SourceFile */:
+                case 262 /* CaseBlock */:
+                case 261 /* ModuleBlock */:
+                case 234 /* Block */:
                     currentLexicalScope = node;
                     currentNameScope = undefined;
                     currentScopeFirstDeclarationsOfName = undefined;
                     break;
-                case 252 /* ClassDeclaration */:
-                case 251 /* FunctionDeclaration */:
+                case 256 /* ClassDeclaration */:
+                case 255 /* FunctionDeclaration */:
                     if (ts.hasSyntacticModifier(node, 2 /* Ambient */)) {
                         break;
                     }
@@ -83346,7 +89139,7 @@ var ts;
                         // These nodes should always have names unless they are default-exports;
                         // however, class declaration parsing allows for undefined names, so syntactically invalid
                         // programs may also have an undefined name.
-                        ts.Debug.assert(node.kind === 252 /* ClassDeclaration */ || ts.hasSyntacticModifier(node, 512 /* Default */));
+                        ts.Debug.assert(node.kind === 256 /* ClassDeclaration */ || ts.hasSyntacticModifier(node, 512 /* Default */));
                     }
                     if (ts.isClassDeclaration(node)) {
                         // XXX: should probably also cover interfaces and type aliases that can have type variables?
@@ -83389,10 +89182,10 @@ var ts;
          */
         function sourceElementVisitorWorker(node) {
             switch (node.kind) {
-                case 261 /* ImportDeclaration */:
-                case 260 /* ImportEqualsDeclaration */:
-                case 266 /* ExportAssignment */:
-                case 267 /* ExportDeclaration */:
+                case 265 /* ImportDeclaration */:
+                case 264 /* ImportEqualsDeclaration */:
+                case 270 /* ExportAssignment */:
+                case 271 /* ExportDeclaration */:
                     return visitElidableStatement(node);
                 default:
                     return visitorWorker(node);
@@ -83413,13 +89206,13 @@ var ts;
                 return node;
             }
             switch (node.kind) {
-                case 261 /* ImportDeclaration */:
+                case 265 /* ImportDeclaration */:
                     return visitImportDeclaration(node);
-                case 260 /* ImportEqualsDeclaration */:
+                case 264 /* ImportEqualsDeclaration */:
                     return visitImportEqualsDeclaration(node);
-                case 266 /* ExportAssignment */:
+                case 270 /* ExportAssignment */:
                     return visitExportAssignment(node);
-                case 267 /* ExportDeclaration */:
+                case 271 /* ExportDeclaration */:
                     return visitExportDeclaration(node);
                 default:
                     ts.Debug.fail("Unhandled ellided statement");
@@ -83439,11 +89232,11 @@ var ts;
          * @param node The node to visit.
          */
         function namespaceElementVisitorWorker(node) {
-            if (node.kind === 267 /* ExportDeclaration */ ||
-                node.kind === 261 /* ImportDeclaration */ ||
-                node.kind === 262 /* ImportClause */ ||
-                (node.kind === 260 /* ImportEqualsDeclaration */ &&
-                    node.moduleReference.kind === 272 /* ExternalModuleReference */)) {
+            if (node.kind === 271 /* ExportDeclaration */ ||
+                node.kind === 265 /* ImportDeclaration */ ||
+                node.kind === 266 /* ImportClause */ ||
+                (node.kind === 264 /* ImportEqualsDeclaration */ &&
+                    node.moduleReference.kind === 276 /* ExternalModuleReference */)) {
                 // do not emit ES6 imports and exports since they are illegal inside a namespace
                 return undefined;
             }
@@ -83467,29 +89260,30 @@ var ts;
          */
         function classElementVisitorWorker(node) {
             switch (node.kind) {
-                case 166 /* Constructor */:
+                case 170 /* Constructor */:
                     return visitConstructor(node);
-                case 163 /* PropertyDeclaration */:
+                case 166 /* PropertyDeclaration */:
                     // Property declarations are not TypeScript syntax, but they must be visited
                     // for the decorator transformation.
                     return visitPropertyDeclaration(node);
-                case 171 /* IndexSignature */:
-                case 167 /* GetAccessor */:
-                case 168 /* SetAccessor */:
-                case 165 /* MethodDeclaration */:
+                case 175 /* IndexSignature */:
+                case 171 /* GetAccessor */:
+                case 172 /* SetAccessor */:
+                case 168 /* MethodDeclaration */:
+                case 169 /* ClassStaticBlockDeclaration */:
                     // Fallback to the default visit behavior.
                     return visitorWorker(node);
-                case 229 /* SemicolonClassElement */:
+                case 233 /* SemicolonClassElement */:
                     return node;
                 default:
                     return ts.Debug.failBadSyntaxKind(node);
             }
         }
         function modifierVisitor(node) {
-            if (ts.modifierToFlag(node.kind) & 2270 /* TypeScriptModifier */) {
+            if (ts.modifierToFlag(node.kind) & 18654 /* TypeScriptModifier */) {
                 return undefined;
             }
-            else if (currentNamespace && node.kind === 92 /* ExportKeyword */) {
+            else if (currentNamespace && node.kind === 93 /* ExportKeyword */) {
                 return undefined;
             }
             return node;
@@ -83506,71 +89300,72 @@ var ts;
                 return factory.createNotEmittedStatement(node);
             }
             switch (node.kind) {
-                case 92 /* ExportKeyword */:
-                case 87 /* DefaultKeyword */:
+                case 93 /* ExportKeyword */:
+                case 88 /* DefaultKeyword */:
                     // ES6 export and default modifiers are elided when inside a namespace.
                     return currentNamespace ? undefined : node;
-                case 122 /* PublicKeyword */:
-                case 120 /* PrivateKeyword */:
-                case 121 /* ProtectedKeyword */:
-                case 125 /* AbstractKeyword */:
-                case 84 /* ConstKeyword */:
-                case 133 /* DeclareKeyword */:
-                case 142 /* ReadonlyKeyword */:
+                case 123 /* PublicKeyword */:
+                case 121 /* PrivateKeyword */:
+                case 122 /* ProtectedKeyword */:
+                case 126 /* AbstractKeyword */:
+                case 158 /* OverrideKeyword */:
+                case 85 /* ConstKeyword */:
+                case 135 /* DeclareKeyword */:
+                case 144 /* ReadonlyKeyword */:
                 // TypeScript accessibility and readonly modifiers are elided
                 // falls through
-                case 178 /* ArrayType */:
-                case 179 /* TupleType */:
-                case 180 /* OptionalType */:
-                case 181 /* RestType */:
-                case 177 /* TypeLiteral */:
-                case 172 /* TypePredicate */:
-                case 159 /* TypeParameter */:
-                case 128 /* AnyKeyword */:
-                case 152 /* UnknownKeyword */:
-                case 131 /* BooleanKeyword */:
-                case 147 /* StringKeyword */:
-                case 144 /* NumberKeyword */:
-                case 141 /* NeverKeyword */:
-                case 113 /* VoidKeyword */:
-                case 148 /* SymbolKeyword */:
-                case 175 /* ConstructorType */:
-                case 174 /* FunctionType */:
-                case 176 /* TypeQuery */:
-                case 173 /* TypeReference */:
-                case 182 /* UnionType */:
-                case 183 /* IntersectionType */:
-                case 184 /* ConditionalType */:
-                case 186 /* ParenthesizedType */:
-                case 187 /* ThisType */:
-                case 188 /* TypeOperator */:
-                case 189 /* IndexedAccessType */:
-                case 190 /* MappedType */:
-                case 191 /* LiteralType */:
+                case 182 /* ArrayType */:
+                case 183 /* TupleType */:
+                case 184 /* OptionalType */:
+                case 185 /* RestType */:
+                case 181 /* TypeLiteral */:
+                case 176 /* TypePredicate */:
+                case 162 /* TypeParameter */:
+                case 130 /* AnyKeyword */:
+                case 154 /* UnknownKeyword */:
+                case 133 /* BooleanKeyword */:
+                case 149 /* StringKeyword */:
+                case 146 /* NumberKeyword */:
+                case 143 /* NeverKeyword */:
+                case 114 /* VoidKeyword */:
+                case 150 /* SymbolKeyword */:
+                case 179 /* ConstructorType */:
+                case 178 /* FunctionType */:
+                case 180 /* TypeQuery */:
+                case 177 /* TypeReference */:
+                case 186 /* UnionType */:
+                case 187 /* IntersectionType */:
+                case 188 /* ConditionalType */:
+                case 190 /* ParenthesizedType */:
+                case 191 /* ThisType */:
+                case 192 /* TypeOperator */:
+                case 193 /* IndexedAccessType */:
+                case 194 /* MappedType */:
+                case 195 /* LiteralType */:
                 // TypeScript type nodes are elided.
                 // falls through
-                case 171 /* IndexSignature */:
+                case 175 /* IndexSignature */:
                 // TypeScript index signatures are elided.
                 // falls through
-                case 161 /* Decorator */:
-                // TypeScript decorators are elided. They will be emitted as part of visitClassDeclaration.
-                // falls through
-                case 254 /* TypeAliasDeclaration */:
-                    // TypeScript type-only declarations are elided.
+                case 164 /* Decorator */:
+                    // TypeScript decorators are elided. They will be emitted as part of visitClassDeclaration.
                     return undefined;
-                case 163 /* PropertyDeclaration */:
+                case 258 /* TypeAliasDeclaration */:
+                    // TypeScript type-only declarations are elided.
+                    return factory.createNotEmittedStatement(node);
+                case 166 /* PropertyDeclaration */:
                     // TypeScript property declarations are elided. However their names are still visited, and can potentially be retained if they could have sideeffects
                     return visitPropertyDeclaration(node);
-                case 259 /* NamespaceExportDeclaration */:
+                case 263 /* NamespaceExportDeclaration */:
                     // TypeScript namespace export declarations are elided.
                     return undefined;
-                case 166 /* Constructor */:
+                case 170 /* Constructor */:
                     return visitConstructor(node);
-                case 253 /* InterfaceDeclaration */:
+                case 257 /* InterfaceDeclaration */:
                     // TypeScript interfaces are elided, but some comments may be preserved.
                     // See the implementation of `getLeadingComments` in comments.ts for more details.
                     return factory.createNotEmittedStatement(node);
-                case 252 /* ClassDeclaration */:
+                case 256 /* ClassDeclaration */:
                     // This may be a class declaration with TypeScript syntax extensions.
                     //
                     // TypeScript class syntax extensions include:
@@ -83580,7 +89375,7 @@ var ts;
                     // - index signatures
                     // - method overload signatures
                     return visitClassDeclaration(node);
-                case 221 /* ClassExpression */:
+                case 225 /* ClassExpression */:
                     // This may be a class expression with TypeScript syntax extensions.
                     //
                     // TypeScript class syntax extensions include:
@@ -83590,35 +89385,35 @@ var ts;
                     // - index signatures
                     // - method overload signatures
                     return visitClassExpression(node);
-                case 286 /* HeritageClause */:
+                case 290 /* HeritageClause */:
                     // This may be a heritage clause with TypeScript syntax extensions.
                     //
                     // TypeScript heritage clause extensions include:
                     // - `implements` clause
                     return visitHeritageClause(node);
-                case 223 /* ExpressionWithTypeArguments */:
+                case 227 /* ExpressionWithTypeArguments */:
                     // TypeScript supports type arguments on an expression in an `extends` heritage clause.
                     return visitExpressionWithTypeArguments(node);
-                case 165 /* MethodDeclaration */:
+                case 168 /* MethodDeclaration */:
                     // TypeScript method declarations may have decorators, modifiers
                     // or type annotations.
                     return visitMethodDeclaration(node);
-                case 167 /* GetAccessor */:
+                case 171 /* GetAccessor */:
                     // Get Accessors can have TypeScript modifiers, decorators, and type annotations.
                     return visitGetAccessor(node);
-                case 168 /* SetAccessor */:
+                case 172 /* SetAccessor */:
                     // Set Accessors can have TypeScript modifiers and type annotations.
                     return visitSetAccessor(node);
-                case 251 /* FunctionDeclaration */:
+                case 255 /* FunctionDeclaration */:
                     // Typescript function declarations can have modifiers, decorators, and type annotations.
                     return visitFunctionDeclaration(node);
-                case 208 /* FunctionExpression */:
+                case 212 /* FunctionExpression */:
                     // TypeScript function expressions can have modifiers and type annotations.
                     return visitFunctionExpression(node);
-                case 209 /* ArrowFunction */:
+                case 213 /* ArrowFunction */:
                     // TypeScript arrow functions can have modifiers and type annotations.
                     return visitArrowFunction(node);
-                case 160 /* Parameter */:
+                case 163 /* Parameter */:
                     // This may be a parameter declaration with TypeScript syntax extensions.
                     //
                     // TypeScript parameter declaration syntax extensions include:
@@ -83628,40 +89423,40 @@ var ts;
                     // - type annotations
                     // - this parameters
                     return visitParameter(node);
-                case 207 /* ParenthesizedExpression */:
+                case 211 /* ParenthesizedExpression */:
                     // ParenthesizedExpressions are TypeScript if their expression is a
                     // TypeAssertion or AsExpression
                     return visitParenthesizedExpression(node);
-                case 206 /* TypeAssertionExpression */:
-                case 224 /* AsExpression */:
+                case 210 /* TypeAssertionExpression */:
+                case 228 /* AsExpression */:
                     // TypeScript type assertions are removed, but their subtrees are preserved.
                     return visitAssertionExpression(node);
-                case 203 /* CallExpression */:
+                case 207 /* CallExpression */:
                     return visitCallExpression(node);
-                case 204 /* NewExpression */:
+                case 208 /* NewExpression */:
                     return visitNewExpression(node);
-                case 205 /* TaggedTemplateExpression */:
+                case 209 /* TaggedTemplateExpression */:
                     return visitTaggedTemplateExpression(node);
-                case 225 /* NonNullExpression */:
+                case 229 /* NonNullExpression */:
                     // TypeScript non-null expressions are removed, but their subtrees are preserved.
                     return visitNonNullExpression(node);
-                case 255 /* EnumDeclaration */:
+                case 259 /* EnumDeclaration */:
                     // TypeScript enum declarations do not exist in ES6 and must be rewritten.
                     return visitEnumDeclaration(node);
-                case 232 /* VariableStatement */:
+                case 236 /* VariableStatement */:
                     // TypeScript namespace exports for variable statements must be transformed.
                     return visitVariableStatement(node);
-                case 249 /* VariableDeclaration */:
+                case 253 /* VariableDeclaration */:
                     return visitVariableDeclaration(node);
-                case 256 /* ModuleDeclaration */:
+                case 260 /* ModuleDeclaration */:
                     // TypeScript namespace declarations must be transformed.
                     return visitModuleDeclaration(node);
-                case 260 /* ImportEqualsDeclaration */:
+                case 264 /* ImportEqualsDeclaration */:
                     // TypeScript namespace or external module import.
                     return visitImportEqualsDeclaration(node);
-                case 274 /* JsxSelfClosingElement */:
+                case 278 /* JsxSelfClosingElement */:
                     return visitJsxSelfClosingElement(node);
-                case 275 /* JsxOpeningElement */:
+                case 279 /* JsxOpeningElement */:
                     return visitJsxJsxOpeningElement(node);
                 default:
                     // node contains some other TypeScript syntax
@@ -83674,33 +89469,14 @@ var ts;
                 !ts.isJsonSourceFile(node);
             return factory.updateSourceFile(node, ts.visitLexicalEnvironment(node.statements, sourceElementVisitor, context, /*start*/ 0, alwaysStrict));
         }
-        /**
-         * Tests whether we should emit a __decorate call for a class declaration.
-         */
-        function shouldEmitDecorateCallForClass(node) {
-            if (node.decorators && node.decorators.length > 0) {
-                return true;
-            }
-            var constructor = ts.getFirstConstructorWithBody(node);
-            if (constructor) {
-                return ts.forEach(constructor.parameters, shouldEmitDecorateCallForParameter);
-            }
-            return false;
-        }
-        /**
-         * Tests whether we should emit a __decorate call for a parameter declaration.
-         */
-        function shouldEmitDecorateCallForParameter(parameter) {
-            return parameter.decorators !== undefined && parameter.decorators.length > 0;
-        }
         function getClassFacts(node, staticProperties) {
             var facts = 0 /* None */;
             if (ts.some(staticProperties))
                 facts |= 1 /* HasStaticInitializedProperties */;
             var extendsClauseElement = ts.getEffectiveBaseTypeNode(node);
-            if (extendsClauseElement && ts.skipOuterExpressions(extendsClauseElement.expression).kind !== 103 /* NullKeyword */)
+            if (extendsClauseElement && ts.skipOuterExpressions(extendsClauseElement.expression).kind !== 104 /* NullKeyword */)
                 facts |= 64 /* IsDerivedClass */;
-            if (shouldEmitDecorateCallForClass(node))
+            if (ts.classOrConstructorParameterIsDecorated(node))
                 facts |= 2 /* HasConstructorDecorators */;
             if (ts.childIsDecorated(node))
                 facts |= 4 /* HasMemberDecorators */;
@@ -83715,7 +89491,7 @@ var ts;
             return facts;
         }
         function hasTypeScriptClassSyntax(node) {
-            return !!(node.transformFlags & 2048 /* ContainsTypeScriptClassSyntax */);
+            return !!(node.transformFlags & 4096 /* ContainsTypeScriptClassSyntax */);
         }
         function isClassLikeDeclarationWithTypeScriptSyntax(node) {
             return ts.some(node.decorators)
@@ -83921,7 +89697,11 @@ var ts;
             //
             var location = ts.moveRangePastDecorators(node);
             var classAlias = getClassAliasIfNeeded(node);
-            var declName = factory.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true);
+            // When we transform to ES5/3 this will be moved inside an IIFE and should reference the name
+            // without any block-scoped variable collision handling
+            var declName = languageVersion <= 2 /* ES2015 */ ?
+                factory.getInternalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true) :
+                factory.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true);
             //  ... = class ${name} ${heritageClauses} {
             //      ${members}
             //  }
@@ -83999,7 +89779,7 @@ var ts;
          * @param member The class member.
          */
         function isStaticDecoratedClassElement(member, parent) {
-            return isDecoratedClassElement(member, /*isStatic*/ true, parent);
+            return isDecoratedClassElement(member, /*isStaticElement*/ true, parent);
         }
         /**
          * Determines whether a class member is an instance member of a class that is decorated,
@@ -84008,7 +89788,7 @@ var ts;
          * @param member The class member.
          */
         function isInstanceDecoratedClassElement(member, parent) {
-            return isDecoratedClassElement(member, /*isStatic*/ false, parent);
+            return isDecoratedClassElement(member, /*isStaticElement*/ false, parent);
         }
         /**
          * Determines whether a class member is either a static or an instance member of a class
@@ -84016,9 +89796,9 @@ var ts;
          *
          * @param member The class member.
          */
-        function isDecoratedClassElement(member, isStatic, parent) {
+        function isDecoratedClassElement(member, isStaticElement, parent) {
             return ts.nodeOrChildIsDecorated(member, parent)
-                && isStatic === ts.hasSyntacticModifier(member, 32 /* Static */);
+                && isStaticElement === ts.isStatic(member);
         }
         /**
          * Gets an array of arrays of decorators for the parameters of a function-like node.
@@ -84070,12 +89850,12 @@ var ts;
          */
         function getAllDecoratorsOfClassElement(node, member) {
             switch (member.kind) {
-                case 167 /* GetAccessor */:
-                case 168 /* SetAccessor */:
+                case 171 /* GetAccessor */:
+                case 172 /* SetAccessor */:
                     return getAllDecoratorsOfAccessors(node, member);
-                case 165 /* MethodDeclaration */:
+                case 168 /* MethodDeclaration */:
                     return getAllDecoratorsOfMethod(member);
-                case 163 /* PropertyDeclaration */:
+                case 166 /* PropertyDeclaration */:
                     return getAllDecoratorsOfProperty(member);
                 default:
                     return undefined;
@@ -84228,7 +90008,7 @@ var ts;
             var prefix = getClassMemberPrefix(node, member);
             var memberName = getExpressionForPropertyName(member, /*generateNameForComputedPropertyName*/ true);
             var descriptor = languageVersion > 0 /* ES3 */
-                ? member.kind === 163 /* PropertyDeclaration */
+                ? member.kind === 166 /* PropertyDeclaration */
                     // We emit `void 0` here to indicate to `__decorate` that it can invoke `Object.defineProperty` directly, but that it
                     // should not invoke `Object.getOwnPropertyDescriptor`.
                     ? factory.createVoidZero()
@@ -84264,7 +90044,11 @@ var ts;
                 return undefined;
             }
             var classAlias = classAliases && classAliases[ts.getOriginalNodeId(node)];
-            var localName = factory.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true);
+            // When we transform to ES5/3 this will be moved inside an IIFE and should reference the name
+            // without any block-scoped variable collision handling
+            var localName = languageVersion <= 2 /* ES2015 */ ?
+                factory.getInternalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true) :
+                factory.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true);
             var decorate = emitHelpers().createDecorateHelper(decoratorExpressions, localName);
             var expression = factory.createAssignment(localName, classAlias ? factory.createAssignment(classAlias, decorate) : decorate);
             ts.setEmitFlags(expression, 1536 /* NoComments */);
@@ -84352,10 +90136,10 @@ var ts;
          */
         function shouldAddTypeMetadata(node) {
             var kind = node.kind;
-            return kind === 165 /* MethodDeclaration */
-                || kind === 167 /* GetAccessor */
-                || kind === 168 /* SetAccessor */
-                || kind === 163 /* PropertyDeclaration */;
+            return kind === 168 /* MethodDeclaration */
+                || kind === 171 /* GetAccessor */
+                || kind === 172 /* SetAccessor */
+                || kind === 166 /* PropertyDeclaration */;
         }
         /**
          * Determines whether to emit the "design:returntype" metadata based on the node's kind.
@@ -84365,7 +90149,7 @@ var ts;
          * @param node The node to test.
          */
         function shouldAddReturnTypeMetadata(node) {
-            return node.kind === 165 /* MethodDeclaration */;
+            return node.kind === 168 /* MethodDeclaration */;
         }
         /**
          * Determines whether to emit the "design:paramtypes" metadata based on the node's kind.
@@ -84376,12 +90160,12 @@ var ts;
          */
         function shouldAddParamTypesMetadata(node) {
             switch (node.kind) {
-                case 252 /* ClassDeclaration */:
-                case 221 /* ClassExpression */:
+                case 256 /* ClassDeclaration */:
+                case 225 /* ClassExpression */:
                     return ts.getFirstConstructorWithBody(node) !== undefined;
-                case 165 /* MethodDeclaration */:
-                case 167 /* GetAccessor */:
-                case 168 /* SetAccessor */:
+                case 168 /* MethodDeclaration */:
+                case 171 /* GetAccessor */:
+                case 172 /* SetAccessor */:
                     return true;
             }
             return false;
@@ -84398,15 +90182,15 @@ var ts;
          */
         function serializeTypeOfNode(node) {
             switch (node.kind) {
-                case 163 /* PropertyDeclaration */:
-                case 160 /* Parameter */:
+                case 166 /* PropertyDeclaration */:
+                case 163 /* Parameter */:
                     return serializeTypeNode(node.type);
-                case 168 /* SetAccessor */:
-                case 167 /* GetAccessor */:
+                case 172 /* SetAccessor */:
+                case 171 /* GetAccessor */:
                     return serializeTypeNode(getAccessorTypeNode(node));
-                case 252 /* ClassDeclaration */:
-                case 221 /* ClassExpression */:
-                case 165 /* MethodDeclaration */:
+                case 256 /* ClassDeclaration */:
+                case 225 /* ClassExpression */:
+                case 168 /* MethodDeclaration */:
                     return factory.createIdentifier("Function");
                 default:
                     return factory.createVoidZero();
@@ -84443,7 +90227,7 @@ var ts;
             return factory.createArrayLiteralExpression(expressions);
         }
         function getParametersOfDecoratedDeclaration(node, container) {
-            if (container && node.kind === 167 /* GetAccessor */) {
+            if (container && node.kind === 171 /* GetAccessor */) {
                 var setAccessor = ts.getAllAccessorDeclarations(container.members, node).setAccessor;
                 if (setAccessor) {
                     return setAccessor.parameters;
@@ -84488,82 +90272,82 @@ var ts;
                 return factory.createIdentifier("Object");
             }
             switch (node.kind) {
-                case 113 /* VoidKeyword */:
-                case 150 /* UndefinedKeyword */:
-                case 141 /* NeverKeyword */:
+                case 114 /* VoidKeyword */:
+                case 152 /* UndefinedKeyword */:
+                case 143 /* NeverKeyword */:
                     return factory.createVoidZero();
-                case 186 /* ParenthesizedType */:
+                case 190 /* ParenthesizedType */:
                     return serializeTypeNode(node.type);
-                case 174 /* FunctionType */:
-                case 175 /* ConstructorType */:
+                case 178 /* FunctionType */:
+                case 179 /* ConstructorType */:
                     return factory.createIdentifier("Function");
-                case 178 /* ArrayType */:
-                case 179 /* TupleType */:
+                case 182 /* ArrayType */:
+                case 183 /* TupleType */:
                     return factory.createIdentifier("Array");
-                case 172 /* TypePredicate */:
-                case 131 /* BooleanKeyword */:
+                case 176 /* TypePredicate */:
+                case 133 /* BooleanKeyword */:
                     return factory.createIdentifier("Boolean");
-                case 147 /* StringKeyword */:
+                case 149 /* StringKeyword */:
                     return factory.createIdentifier("String");
-                case 145 /* ObjectKeyword */:
+                case 147 /* ObjectKeyword */:
                     return factory.createIdentifier("Object");
-                case 191 /* LiteralType */:
+                case 195 /* LiteralType */:
                     switch (node.literal.kind) {
                         case 10 /* StringLiteral */:
                         case 14 /* NoSubstitutionTemplateLiteral */:
                             return factory.createIdentifier("String");
-                        case 214 /* PrefixUnaryExpression */:
+                        case 218 /* PrefixUnaryExpression */:
                         case 8 /* NumericLiteral */:
                             return factory.createIdentifier("Number");
                         case 9 /* BigIntLiteral */:
                             return getGlobalBigIntNameWithFallback();
-                        case 109 /* TrueKeyword */:
-                        case 94 /* FalseKeyword */:
+                        case 110 /* TrueKeyword */:
+                        case 95 /* FalseKeyword */:
                             return factory.createIdentifier("Boolean");
-                        case 103 /* NullKeyword */:
+                        case 104 /* NullKeyword */:
                             return factory.createVoidZero();
                         default:
                             return ts.Debug.failBadSyntaxKind(node.literal);
                     }
-                case 144 /* NumberKeyword */:
+                case 146 /* NumberKeyword */:
                     return factory.createIdentifier("Number");
-                case 155 /* BigIntKeyword */:
+                case 157 /* BigIntKeyword */:
                     return getGlobalBigIntNameWithFallback();
-                case 148 /* SymbolKeyword */:
+                case 150 /* SymbolKeyword */:
                     return languageVersion < 2 /* ES2015 */
                         ? getGlobalSymbolNameWithFallback()
                         : factory.createIdentifier("Symbol");
-                case 173 /* TypeReference */:
+                case 177 /* TypeReference */:
                     return serializeTypeReferenceNode(node);
-                case 183 /* IntersectionType */:
-                case 182 /* UnionType */:
+                case 187 /* IntersectionType */:
+                case 186 /* UnionType */:
                     return serializeTypeList(node.types);
-                case 184 /* ConditionalType */:
+                case 188 /* ConditionalType */:
                     return serializeTypeList([node.trueType, node.falseType]);
-                case 188 /* TypeOperator */:
-                    if (node.operator === 142 /* ReadonlyKeyword */) {
+                case 192 /* TypeOperator */:
+                    if (node.operator === 144 /* ReadonlyKeyword */) {
                         return serializeTypeNode(node.type);
                     }
                     break;
-                case 176 /* TypeQuery */:
-                case 189 /* IndexedAccessType */:
-                case 190 /* MappedType */:
-                case 177 /* TypeLiteral */:
-                case 128 /* AnyKeyword */:
-                case 152 /* UnknownKeyword */:
-                case 187 /* ThisType */:
-                case 195 /* ImportType */:
+                case 180 /* TypeQuery */:
+                case 193 /* IndexedAccessType */:
+                case 194 /* MappedType */:
+                case 181 /* TypeLiteral */:
+                case 130 /* AnyKeyword */:
+                case 154 /* UnknownKeyword */:
+                case 191 /* ThisType */:
+                case 199 /* ImportType */:
                     break;
                 // handle JSDoc types from an invalid parse
-                case 303 /* JSDocAllType */:
-                case 304 /* JSDocUnknownType */:
-                case 308 /* JSDocFunctionType */:
-                case 309 /* JSDocVariadicType */:
-                case 310 /* JSDocNamepathType */:
+                case 310 /* JSDocAllType */:
+                case 311 /* JSDocUnknownType */:
+                case 315 /* JSDocFunctionType */:
+                case 316 /* JSDocVariadicType */:
+                case 317 /* JSDocNamepathType */:
                     break;
-                case 305 /* JSDocNullableType */:
-                case 306 /* JSDocNonNullableType */:
-                case 307 /* JSDocOptionalType */:
+                case 312 /* JSDocNullableType */:
+                case 313 /* JSDocNonNullableType */:
+                case 314 /* JSDocOptionalType */:
                     return serializeTypeNode(node.type);
                 default:
                     return ts.Debug.failBadSyntaxKind(node);
@@ -84574,15 +90358,15 @@ var ts;
             // Note when updating logic here also update getEntityNameForDecoratorMetadata
             // so that aliases can be marked as referenced
             var serializedUnion;
-            for (var _i = 0, types_24 = types; _i < types_24.length; _i++) {
-                var typeNode = types_24[_i];
-                while (typeNode.kind === 186 /* ParenthesizedType */) {
+            for (var _i = 0, types_23 = types; _i < types_23.length; _i++) {
+                var typeNode = types_23[_i];
+                while (typeNode.kind === 190 /* ParenthesizedType */) {
                     typeNode = typeNode.type; // Skip parens if need be
                 }
-                if (typeNode.kind === 141 /* NeverKeyword */) {
+                if (typeNode.kind === 143 /* NeverKeyword */) {
                     continue; // Always elide `never` from the union/intersection if possible
                 }
-                if (!strictNullChecks && (typeNode.kind === 191 /* LiteralType */ && typeNode.literal.kind === 103 /* NullKeyword */ || typeNode.kind === 150 /* UndefinedKeyword */)) {
+                if (!strictNullChecks && (typeNode.kind === 195 /* LiteralType */ && typeNode.literal.kind === 104 /* NullKeyword */ || typeNode.kind === 152 /* UndefinedKeyword */)) {
                     continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks
                 }
                 var serializedIndividual = serializeTypeNode(typeNode);
@@ -84664,12 +90448,12 @@ var ts;
          * @param node The entity name to serialize.
          */
         function serializeEntityNameAsExpressionFallback(node) {
-            if (node.kind === 78 /* Identifier */) {
+            if (node.kind === 79 /* Identifier */) {
                 // A -> typeof A !== undefined && A
                 var copied = serializeEntityNameAsExpression(node);
                 return createCheckedValue(copied, copied);
             }
-            if (node.left.kind === 78 /* Identifier */) {
+            if (node.left.kind === 79 /* Identifier */) {
                 // A.B -> typeof A !== undefined && A.B
                 return createCheckedValue(serializeEntityNameAsExpression(node.left), serializeEntityNameAsExpression(node));
             }
@@ -84685,14 +90469,14 @@ var ts;
          */
         function serializeEntityNameAsExpression(node) {
             switch (node.kind) {
-                case 78 /* Identifier */:
+                case 79 /* Identifier */:
                     // Create a clone of the name with a new parent, and treat it as if it were
                     // a source tree node for the purposes of the checker.
                     var name = ts.setParent(ts.setTextRange(ts.parseNodeFactory.cloneNode(node), node), node.parent);
                     name.original = undefined;
                     ts.setParent(name, ts.getParseTreeNode(currentLexicalScope)); // ensure the parent is set to a parse tree node.
                     return name;
-                case 157 /* QualifiedName */:
+                case 160 /* QualifiedName */:
                     return serializeQualifiedNameAsExpression(node);
             }
         }
@@ -84783,7 +90567,7 @@ var ts;
          * @param node The HeritageClause to transform.
          */
         function visitHeritageClause(node) {
-            if (node.token === 116 /* ImplementsKeyword */) {
+            if (node.token === 117 /* ImplementsKeyword */) {
                 // implements clauses are elided
                 return undefined;
             }
@@ -85225,6 +91009,7 @@ var ts;
                 || (isExternalModuleExport(node)
                     && moduleKind !== ts.ModuleKind.ES2015
                     && moduleKind !== ts.ModuleKind.ES2020
+                    && moduleKind !== ts.ModuleKind.ES2022
                     && moduleKind !== ts.ModuleKind.ESNext
                     && moduleKind !== ts.ModuleKind.System);
         }
@@ -85265,12 +91050,12 @@ var ts;
             // enums in any other scope are emitted as a `let` declaration.
             var statement = factory.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), factory.createVariableDeclarationList([
                 factory.createVariableDeclaration(factory.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true))
-            ], currentLexicalScope.kind === 297 /* SourceFile */ ? 0 /* None */ : 1 /* Let */));
+            ], currentLexicalScope.kind === 303 /* SourceFile */ ? 0 /* None */ : 1 /* Let */));
             ts.setOriginalNode(statement, node);
             recordEmittedDeclarationInScope(node);
             if (isFirstEmittedDeclarationInScope(node)) {
                 // Adjust the source map emit to match the old emitter.
-                if (node.kind === 255 /* EnumDeclaration */) {
+                if (node.kind === 259 /* EnumDeclaration */) {
                     ts.setSourceMapRange(statement.declarationList, node);
                 }
                 else {
@@ -85395,7 +91180,7 @@ var ts;
             var statementsLocation;
             var blockLocation;
             if (node.body) {
-                if (node.body.kind === 257 /* ModuleBlock */) {
+                if (node.body.kind === 261 /* ModuleBlock */) {
                     saveStateAndInvoke(node.body, function (body) { return ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement)); });
                     statementsLocation = node.body.statements;
                     blockLocation = node.body;
@@ -85442,19 +91227,19 @@ var ts;
             //     })(hi = hello.hi || (hello.hi = {}));
             // })(hello || (hello = {}));
             // We only want to emit comment on the namespace which contains block body itself, not the containing namespaces.
-            if (!node.body || node.body.kind !== 257 /* ModuleBlock */) {
+            if (!node.body || node.body.kind !== 261 /* ModuleBlock */) {
                 ts.setEmitFlags(block, ts.getEmitFlags(block) | 1536 /* NoComments */);
             }
             return block;
         }
         function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) {
-            if (moduleDeclaration.body.kind === 256 /* ModuleDeclaration */) {
+            if (moduleDeclaration.body.kind === 260 /* ModuleDeclaration */) {
                 var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body);
                 return recursiveInnerModule || moduleDeclaration.body;
             }
         }
         /**
-         * Visits an import declaration, eliding it if it is not referenced and `importsNotUsedAsValues` is not 'preserve'.
+         * Visits an import declaration, eliding it if it is type-only or if it has an import clause that may be elided.
          *
          * @param node The import declaration node.
          */
@@ -85475,47 +91260,46 @@ var ts;
                 compilerOptions.importsNotUsedAsValues === 2 /* Error */
                 ? factory.updateImportDeclaration(node, 
                 /*decorators*/ undefined, 
-                /*modifiers*/ undefined, importClause, node.moduleSpecifier)
+                /*modifiers*/ undefined, importClause, node.moduleSpecifier, node.assertClause)
                 : undefined;
         }
         /**
-         * Visits an import clause, eliding it if it is not referenced.
+         * Visits an import clause, eliding it if its `name` and `namedBindings` may both be elided.
          *
          * @param node The import clause node.
          */
         function visitImportClause(node) {
-            if (node.isTypeOnly) {
-                return undefined;
-            }
+            ts.Debug.assert(!node.isTypeOnly);
             // Elide the import clause if we elide both its name and its named bindings.
-            var name = resolver.isReferencedAliasDeclaration(node) ? node.name : undefined;
+            var name = shouldEmitAliasDeclaration(node) ? node.name : undefined;
             var namedBindings = ts.visitNode(node.namedBindings, visitNamedImportBindings, ts.isNamedImportBindings);
             return (name || namedBindings) ? factory.updateImportClause(node, /*isTypeOnly*/ false, name, namedBindings) : undefined;
         }
         /**
-         * Visits named import bindings, eliding it if it is not referenced.
+         * Visits named import bindings, eliding them if their targets, their references, and the compilation settings allow.
          *
          * @param node The named import bindings node.
          */
         function visitNamedImportBindings(node) {
-            if (node.kind === 263 /* NamespaceImport */) {
+            if (node.kind === 267 /* NamespaceImport */) {
                 // Elide a namespace import if it is not referenced.
-                return resolver.isReferencedAliasDeclaration(node) ? node : undefined;
+                return shouldEmitAliasDeclaration(node) ? node : undefined;
             }
             else {
-                // Elide named imports if all of its import specifiers are elided.
+                // Elide named imports if all of its import specifiers are elided and settings allow.
+                var allowEmpty = compilerOptions.preserveValueImports && (compilerOptions.importsNotUsedAsValues === 1 /* Preserve */ ||
+                    compilerOptions.importsNotUsedAsValues === 2 /* Error */);
                 var elements = ts.visitNodes(node.elements, visitImportSpecifier, ts.isImportSpecifier);
-                return ts.some(elements) ? factory.updateNamedImports(node, elements) : undefined;
+                return allowEmpty || ts.some(elements) ? factory.updateNamedImports(node, elements) : undefined;
             }
         }
         /**
-         * Visits an import specifier, eliding it if it is not referenced.
+         * Visits an import specifier, eliding it if its target, its references, and the compilation settings allow.
          *
          * @param node The import specifier node.
          */
         function visitImportSpecifier(node) {
-            // Elide an import specifier if it is not referenced.
-            return resolver.isReferencedAliasDeclaration(node) ? node : undefined;
+            return !node.isTypeOnly && shouldEmitAliasDeclaration(node) ? node : undefined;
         }
         /**
          * Visits an export assignment, eliding it if it does not contain a clause that resolves
@@ -85530,8 +91314,7 @@ var ts;
                 : undefined;
         }
         /**
-         * Visits an export declaration, eliding it if it does not contain a clause that resolves
-         * to a value.
+         * Visits an export declaration, eliding it if it does not contain a clause that resolves to a value.
          *
          * @param node The export declaration node.
          */
@@ -85545,16 +91328,14 @@ var ts;
                 // type checker doesn't know about any exports
                 return node;
             }
-            if (!resolver.isValueAliasDeclaration(node)) {
-                // Elide the export declaration if it does not export a value.
-                return undefined;
-            }
             // Elide the export declaration if all of its named exports are elided.
-            var exportClause = ts.visitNode(node.exportClause, visitNamedExportBindings, ts.isNamedExportBindings);
+            var allowEmpty = !!node.moduleSpecifier && (compilerOptions.importsNotUsedAsValues === 1 /* Preserve */ ||
+                compilerOptions.importsNotUsedAsValues === 2 /* Error */);
+            var exportClause = ts.visitNode(node.exportClause, function (bindings) { return visitNamedExportBindings(bindings, allowEmpty); }, ts.isNamedExportBindings);
             return exportClause
                 ? factory.updateExportDeclaration(node, 
                 /*decorators*/ undefined, 
-                /*modifiers*/ undefined, node.isTypeOnly, exportClause, node.moduleSpecifier)
+                /*modifiers*/ undefined, node.isTypeOnly, exportClause, node.moduleSpecifier, node.assertClause)
                 : undefined;
         }
         /**
@@ -85563,16 +91344,16 @@ var ts;
          *
          * @param node The named exports node.
          */
-        function visitNamedExports(node) {
+        function visitNamedExports(node, allowEmpty) {
             // Elide the named exports if all of its export specifiers were elided.
             var elements = ts.visitNodes(node.elements, visitExportSpecifier, ts.isExportSpecifier);
-            return ts.some(elements) ? factory.updateNamedExports(node, elements) : undefined;
+            return allowEmpty || ts.some(elements) ? factory.updateNamedExports(node, elements) : undefined;
         }
         function visitNamespaceExports(node) {
             return factory.updateNamespaceExport(node, ts.visitNode(node.name, visitor, ts.isIdentifier));
         }
-        function visitNamedExportBindings(node) {
-            return ts.isNamespaceExport(node) ? visitNamespaceExports(node) : visitNamedExports(node);
+        function visitNamedExportBindings(node, allowEmpty) {
+            return ts.isNamespaceExport(node) ? visitNamespaceExports(node) : visitNamedExports(node, allowEmpty);
         }
         /**
          * Visits an export specifier, eliding it if it does not resolve to a value.
@@ -85581,7 +91362,7 @@ var ts;
          */
         function visitExportSpecifier(node) {
             // Elide an export specifier if it does not reference a value.
-            return resolver.isValueAliasDeclaration(node) ? node : undefined;
+            return !node.isTypeOnly && resolver.isValueAliasDeclaration(node) ? node : undefined;
         }
         /**
          * Determines whether to emit an import equals declaration.
@@ -85592,7 +91373,7 @@ var ts;
             // preserve old compiler's behavior: emit 'var' for import declaration (even if we do not consider them referenced) when
             // - current file is not external module
             // - import declaration is top level and target is value imported by entity name
-            return resolver.isReferencedAliasDeclaration(node)
+            return shouldEmitAliasDeclaration(node)
                 || (!ts.isExternalModule(currentSourceFile)
                     && resolver.isTopLevelValueImportEqualsWithEntityName(node));
         }
@@ -85607,13 +91388,14 @@ var ts;
                 return undefined;
             }
             if (ts.isExternalModuleImportEqualsDeclaration(node)) {
-                var isReferenced = resolver.isReferencedAliasDeclaration(node);
+                var isReferenced = shouldEmitAliasDeclaration(node);
                 // If the alias is unreferenced but we want to keep the import, replace with 'import "mod"'.
                 if (!isReferenced && compilerOptions.importsNotUsedAsValues === 1 /* Preserve */) {
                     return ts.setOriginalNode(ts.setTextRange(factory.createImportDeclaration(
                     /*decorators*/ undefined, 
                     /*modifiers*/ undefined, 
-                    /*importClause*/ undefined, node.moduleReference.expression), node), node);
+                    /*importClause*/ undefined, node.moduleReference.expression, 
+                    /*assertClause*/ undefined), node), node);
                 }
                 return isReferenced ? ts.visitEachChild(node, visitor, context) : undefined;
             }
@@ -85725,14 +91507,14 @@ var ts;
             return factory.createPropertyAccessExpression(factory.getDeclarationName(node), "prototype");
         }
         function getClassMemberPrefix(node, member) {
-            return ts.hasSyntacticModifier(member, 32 /* Static */)
+            return ts.isStatic(member)
                 ? factory.getDeclarationName(node)
                 : getClassPrototype(node);
         }
         function enableSubstitutionForNonQualifiedEnumMembers() {
             if ((enabledSubstitutions & 8 /* NonQualifiedEnumMembers */) === 0) {
                 enabledSubstitutions |= 8 /* NonQualifiedEnumMembers */;
-                context.enableSubstitution(78 /* Identifier */);
+                context.enableSubstitution(79 /* Identifier */);
             }
         }
         function enableSubstitutionForClassAliases() {
@@ -85740,7 +91522,7 @@ var ts;
                 enabledSubstitutions |= 1 /* ClassAliases */;
                 // We need to enable substitutions for identifiers. This allows us to
                 // substitute class names inside of a class declaration.
-                context.enableSubstitution(78 /* Identifier */);
+                context.enableSubstitution(79 /* Identifier */);
                 // Keep track of class aliases.
                 classAliases = [];
             }
@@ -85750,17 +91532,17 @@ var ts;
                 enabledSubstitutions |= 2 /* NamespaceExports */;
                 // We need to enable substitutions for identifiers and shorthand property assignments. This allows us to
                 // substitute the names of exported members of a namespace.
-                context.enableSubstitution(78 /* Identifier */);
-                context.enableSubstitution(289 /* ShorthandPropertyAssignment */);
+                context.enableSubstitution(79 /* Identifier */);
+                context.enableSubstitution(295 /* ShorthandPropertyAssignment */);
                 // We need to be notified when entering and exiting namespaces.
-                context.enableEmitNotification(256 /* ModuleDeclaration */);
+                context.enableEmitNotification(260 /* ModuleDeclaration */);
             }
         }
         function isTransformedModuleDeclaration(node) {
-            return ts.getOriginalNode(node).kind === 256 /* ModuleDeclaration */;
+            return ts.getOriginalNode(node).kind === 260 /* ModuleDeclaration */;
         }
         function isTransformedEnumDeclaration(node) {
-            return ts.getOriginalNode(node).kind === 255 /* EnumDeclaration */;
+            return ts.getOriginalNode(node).kind === 259 /* EnumDeclaration */;
         }
         /**
          * Hook for node emit.
@@ -85819,11 +91601,11 @@ var ts;
         }
         function substituteExpression(node) {
             switch (node.kind) {
-                case 78 /* Identifier */:
+                case 79 /* Identifier */:
                     return substituteExpressionIdentifier(node);
-                case 201 /* PropertyAccessExpression */:
+                case 205 /* PropertyAccessExpression */:
                     return substitutePropertyAccessExpression(node);
-                case 202 /* ElementAccessExpression */:
+                case 206 /* ElementAccessExpression */:
                     return substituteElementAccessExpression(node);
             }
             return node;
@@ -85845,10 +91627,10 @@ var ts;
                     if (declaration) {
                         var classAlias = classAliases[declaration.id]; // TODO: GH#18217
                         if (classAlias) {
-                            var clone_1 = factory.cloneNode(classAlias);
-                            ts.setSourceMapRange(clone_1, node);
-                            ts.setCommentRange(clone_1, node);
-                            return clone_1;
+                            var clone_2 = factory.cloneNode(classAlias);
+                            ts.setSourceMapRange(clone_2, node);
+                            ts.setCommentRange(clone_2, node);
+                            return clone_2;
                         }
                     }
                 }
@@ -85861,9 +91643,9 @@ var ts;
                 // If we are nested within a namespace declaration, we may need to qualifiy
                 // an identifier that is exported from a merged namespace.
                 var container = resolver.getReferencedExportContainer(node, /*prefixLocals*/ false);
-                if (container && container.kind !== 297 /* SourceFile */) {
-                    var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 256 /* ModuleDeclaration */) ||
-                        (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 255 /* EnumDeclaration */);
+                if (container && container.kind !== 303 /* SourceFile */) {
+                    var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 260 /* ModuleDeclaration */) ||
+                        (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 259 /* EnumDeclaration */);
                     if (substitute) {
                         return ts.setTextRange(factory.createPropertyAccessExpression(factory.getGeneratedNameForNode(container), node), 
                         /*location*/ node);
@@ -85889,7 +91671,7 @@ var ts;
                     var propertyName = ts.isPropertyAccessExpression(originalNode)
                         ? ts.declarationNameToString(originalNode.name)
                         : ts.getTextOfNode(originalNode.argumentExpression);
-                    ts.addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, " " + propertyName + " ");
+                    ts.addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, " ".concat(propertyName, " "));
                 }
                 return substitute;
             }
@@ -85901,6 +91683,11 @@ var ts;
             }
             return ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node) ? resolver.getConstantValue(node) : undefined;
         }
+        function shouldEmitAliasDeclaration(node) {
+            return compilerOptions.preserveValueImports
+                ? resolver.isValueAliasDeclaration(node)
+                : resolver.isReferencedAliasDeclaration(node);
+        }
     }
     ts.transformTypeScript = transformTypeScript;
 })(ts || (ts = {}));
@@ -85914,11 +91701,26 @@ var ts;
          * which have initializers that reference the class name.
          */
         ClassPropertySubstitutionFlags[ClassPropertySubstitutionFlags["ClassAliases"] = 1] = "ClassAliases";
+        /**
+         * Enables substitutions for class expressions with static fields
+         * which have initializers that reference the 'this' or 'super'.
+         */
+        ClassPropertySubstitutionFlags[ClassPropertySubstitutionFlags["ClassStaticThisOrSuperReference"] = 2] = "ClassStaticThisOrSuperReference";
     })(ClassPropertySubstitutionFlags || (ClassPropertySubstitutionFlags = {}));
-    var PrivateIdentifierPlacement;
-    (function (PrivateIdentifierPlacement) {
-        PrivateIdentifierPlacement[PrivateIdentifierPlacement["InstanceField"] = 0] = "InstanceField";
-    })(PrivateIdentifierPlacement || (PrivateIdentifierPlacement = {}));
+    var PrivateIdentifierKind;
+    (function (PrivateIdentifierKind) {
+        PrivateIdentifierKind["Field"] = "f";
+        PrivateIdentifierKind["Method"] = "m";
+        PrivateIdentifierKind["Accessor"] = "a";
+    })(PrivateIdentifierKind = ts.PrivateIdentifierKind || (ts.PrivateIdentifierKind = {}));
+    var ClassFacts;
+    (function (ClassFacts) {
+        ClassFacts[ClassFacts["None"] = 0] = "None";
+        ClassFacts[ClassFacts["ClassWasDecorated"] = 1] = "ClassWasDecorated";
+        ClassFacts[ClassFacts["NeedsClassConstructorReference"] = 2] = "NeedsClassConstructorReference";
+        ClassFacts[ClassFacts["NeedsClassSuperReference"] = 4] = "NeedsClassSuperReference";
+        ClassFacts[ClassFacts["NeedsSubstitutionForThisInClassStaticField"] = 8] = "NeedsSubstitutionForThisInClassStaticField";
+    })(ClassFacts || (ClassFacts = {}));
     /**
      * Transforms ECMAScript Class Syntax.
      * TypeScript parameter property syntax is transformed in the TypeScript transformer.
@@ -85927,13 +91729,20 @@ var ts;
      * When --useDefineForClassFields is on, this transforms to ECMAScript semantics, with Object.defineProperty.
      */
     function transformClassFields(context) {
-        var factory = context.factory, hoistVariableDeclaration = context.hoistVariableDeclaration, endLexicalEnvironment = context.endLexicalEnvironment, resumeLexicalEnvironment = context.resumeLexicalEnvironment;
+        var factory = context.factory, hoistVariableDeclaration = context.hoistVariableDeclaration, endLexicalEnvironment = context.endLexicalEnvironment, startLexicalEnvironment = context.startLexicalEnvironment, resumeLexicalEnvironment = context.resumeLexicalEnvironment, addBlockScopedVariable = context.addBlockScopedVariable;
         var resolver = context.getEmitResolver();
         var compilerOptions = context.getCompilerOptions();
         var languageVersion = ts.getEmitScriptTarget(compilerOptions);
-        var shouldTransformPrivateFields = languageVersion < 99 /* ESNext */;
+        var useDefineForClassFields = ts.getUseDefineForClassFields(compilerOptions);
+        var shouldTransformPrivateElementsOrClassStaticBlocks = languageVersion < 99 /* ESNext */;
+        // We don't need to transform `super` property access when targeting ES5, ES3 because
+        // the es2015 transformation handles those.
+        var shouldTransformSuperInStaticInitializers = (languageVersion <= 8 /* ES2021 */ || !useDefineForClassFields) && languageVersion >= 2 /* ES2015 */;
+        var shouldTransformThisInStaticInitializers = languageVersion <= 8 /* ES2021 */ || !useDefineForClassFields;
         var previousOnSubstituteNode = context.onSubstituteNode;
         context.onSubstituteNode = onSubstituteNode;
+        var previousOnEmitNode = context.onEmitNode;
+        context.onEmitNode = onEmitNode;
         var enabledSubstitutions;
         var classAliases;
         /**
@@ -85946,55 +91755,96 @@ var ts;
          * emitted at the next execution site, in document order (for decorated classes).
          */
         var pendingStatements;
-        var privateIdentifierEnvironmentStack = [];
-        var currentPrivateIdentifierEnvironment;
+        var classLexicalEnvironmentStack = [];
+        var classLexicalEnvironmentMap = new ts.Map();
+        var currentClassLexicalEnvironment;
+        var currentComputedPropertyNameClassLexicalEnvironment;
+        var currentStaticPropertyDeclarationOrStaticBlock;
         return ts.chainBundle(context, transformSourceFile);
         function transformSourceFile(node) {
             var options = context.getCompilerOptions();
             if (node.isDeclarationFile
-                || options.useDefineForClassFields && options.target === 99 /* ESNext */) {
+                || useDefineForClassFields && ts.getEmitScriptTarget(options) === 99 /* ESNext */) {
                 return node;
             }
             var visited = ts.visitEachChild(node, visitor, context);
             ts.addEmitHelpers(visited, context.readEmitHelpers());
             return visited;
         }
+        function visitorWorker(node, valueIsDiscarded) {
+            if (node.transformFlags & 8388608 /* ContainsClassFields */) {
+                switch (node.kind) {
+                    case 225 /* ClassExpression */:
+                    case 256 /* ClassDeclaration */:
+                        return visitClassLike(node);
+                    case 166 /* PropertyDeclaration */:
+                        return visitPropertyDeclaration(node);
+                    case 236 /* VariableStatement */:
+                        return visitVariableStatement(node);
+                    case 80 /* PrivateIdentifier */:
+                        return visitPrivateIdentifier(node);
+                    case 169 /* ClassStaticBlockDeclaration */:
+                        return visitClassStaticBlockDeclaration(node);
+                }
+            }
+            if (node.transformFlags & 8388608 /* ContainsClassFields */ ||
+                node.transformFlags & 33554432 /* ContainsLexicalSuper */ &&
+                    shouldTransformSuperInStaticInitializers &&
+                    currentStaticPropertyDeclarationOrStaticBlock &&
+                    currentClassLexicalEnvironment) {
+                switch (node.kind) {
+                    case 218 /* PrefixUnaryExpression */:
+                    case 219 /* PostfixUnaryExpression */:
+                        return visitPreOrPostfixUnaryExpression(node, valueIsDiscarded);
+                    case 220 /* BinaryExpression */:
+                        return visitBinaryExpression(node, valueIsDiscarded);
+                    case 207 /* CallExpression */:
+                        return visitCallExpression(node);
+                    case 209 /* TaggedTemplateExpression */:
+                        return visitTaggedTemplateExpression(node);
+                    case 205 /* PropertyAccessExpression */:
+                        return visitPropertyAccessExpression(node);
+                    case 206 /* ElementAccessExpression */:
+                        return visitElementAccessExpression(node);
+                    case 237 /* ExpressionStatement */:
+                        return visitExpressionStatement(node);
+                    case 241 /* ForStatement */:
+                        return visitForStatement(node);
+                    case 255 /* FunctionDeclaration */:
+                    case 212 /* FunctionExpression */:
+                    case 170 /* Constructor */:
+                    case 168 /* MethodDeclaration */:
+                    case 171 /* GetAccessor */:
+                    case 172 /* SetAccessor */: {
+                        var savedCurrentStaticPropertyDeclarationOrStaticBlock = currentStaticPropertyDeclarationOrStaticBlock;
+                        currentStaticPropertyDeclarationOrStaticBlock = undefined;
+                        var result = ts.visitEachChild(node, visitor, context);
+                        currentStaticPropertyDeclarationOrStaticBlock = savedCurrentStaticPropertyDeclarationOrStaticBlock;
+                        return result;
+                    }
+                }
+            }
+            return ts.visitEachChild(node, visitor, context);
+        }
+        function discardedValueVisitor(node) {
+            return visitorWorker(node, /*valueIsDiscarded*/ true);
+        }
         function visitor(node) {
-            if (!(node.transformFlags & 4194304 /* ContainsClassFields */))
-                return node;
+            return visitorWorker(node, /*valueIsDiscarded*/ false);
+        }
+        function heritageClauseVisitor(node) {
             switch (node.kind) {
-                case 221 /* ClassExpression */:
-                case 252 /* ClassDeclaration */:
-                    return visitClassLike(node);
-                case 163 /* PropertyDeclaration */:
-                    return visitPropertyDeclaration(node);
-                case 232 /* VariableStatement */:
-                    return visitVariableStatement(node);
-                case 201 /* PropertyAccessExpression */:
-                    return visitPropertyAccessExpression(node);
-                case 214 /* PrefixUnaryExpression */:
-                    return visitPrefixUnaryExpression(node);
-                case 215 /* PostfixUnaryExpression */:
-                    return visitPostfixUnaryExpression(node, /*valueIsDiscarded*/ false);
-                case 203 /* CallExpression */:
-                    return visitCallExpression(node);
-                case 216 /* BinaryExpression */:
-                    return visitBinaryExpression(node);
-                case 79 /* PrivateIdentifier */:
-                    return visitPrivateIdentifier(node);
-                case 233 /* ExpressionStatement */:
-                    return visitExpressionStatement(node);
-                case 237 /* ForStatement */:
-                    return visitForStatement(node);
-                case 205 /* TaggedTemplateExpression */:
-                    return visitTaggedTemplateExpression(node);
+                case 290 /* HeritageClause */:
+                    return ts.visitEachChild(node, heritageClauseVisitor, context);
+                case 227 /* ExpressionWithTypeArguments */:
+                    return visitExpressionWithTypeArguments(node);
             }
-            return ts.visitEachChild(node, visitor, context);
+            return visitor(node);
         }
         function visitorDestructuringTarget(node) {
             switch (node.kind) {
-                case 200 /* ObjectLiteralExpression */:
-                case 199 /* ArrayLiteralExpression */:
+                case 204 /* ObjectLiteralExpression */:
+                case 203 /* ArrayLiteralExpression */:
                     return visitAssignmentPattern(node);
                 default:
                     return visitor(node);
@@ -86002,14 +91852,37 @@ var ts;
         }
         /**
          * If we visit a private name, this means it is an undeclared private name.
-         * Replace it with an empty identifier to indicate a problem with the code.
+         * Replace it with an empty identifier to indicate a problem with the code,
+         * unless we are in a statement position - otherwise this will not trigger
+         * a SyntaxError.
          */
         function visitPrivateIdentifier(node) {
-            if (!shouldTransformPrivateFields) {
+            if (!shouldTransformPrivateElementsOrClassStaticBlocks) {
+                return node;
+            }
+            if (ts.isStatement(node.parent)) {
                 return node;
             }
             return ts.setOriginalNode(factory.createIdentifier(""), node);
         }
+        /**
+         * Visits `#id in expr`
+         */
+        function visitPrivateIdentifierInInExpression(node) {
+            if (!shouldTransformPrivateElementsOrClassStaticBlocks) {
+                return node;
+            }
+            var privId = node.left;
+            ts.Debug.assertNode(privId, ts.isPrivateIdentifier);
+            ts.Debug.assert(node.operatorToken.kind === 101 /* InKeyword */);
+            var info = accessPrivateIdentifier(privId);
+            if (info) {
+                var receiver = ts.visitNode(node.right, visitor, ts.isExpression);
+                return ts.setOriginalNode(context.getEmitHelperFactory().createClassPrivateFieldInHelper(info.brandCheckIdentifier, receiver), node);
+            }
+            // Private name has not been declared. Subsequent transformers will handle this error
+            return ts.visitEachChild(node, visitor, context);
+        }
         /**
          * Visits the members of a class that has fields.
          *
@@ -86017,20 +91890,19 @@ var ts;
          */
         function classElementVisitor(node) {
             switch (node.kind) {
-                case 166 /* Constructor */:
+                case 170 /* Constructor */:
                     // Constructors for classes using class fields are transformed in
                     // `visitClassDeclaration` or `visitClassExpression`.
                     return undefined;
-                case 167 /* GetAccessor */:
-                case 168 /* SetAccessor */:
-                case 165 /* MethodDeclaration */:
-                    // Visit the name of the member (if it's a computed property name).
-                    return ts.visitEachChild(node, classElementVisitor, context);
-                case 163 /* PropertyDeclaration */:
+                case 171 /* GetAccessor */:
+                case 172 /* SetAccessor */:
+                case 168 /* MethodDeclaration */:
+                    return visitMethodOrAccessorDeclaration(node);
+                case 166 /* PropertyDeclaration */:
                     return visitPropertyDeclaration(node);
-                case 158 /* ComputedPropertyName */:
+                case 161 /* ComputedPropertyName */:
                     return visitComputedPropertyName(node);
-                case 229 /* SemicolonClassElement */:
+                case 233 /* SemicolonClassElement */:
                     return node;
                 default:
                     return visitor(node);
@@ -86040,7 +91912,7 @@ var ts;
             var savedPendingStatements = pendingStatements;
             pendingStatements = [];
             var visitedNode = ts.visitEachChild(node, visitor, context);
-            var statement = ts.some(pendingStatements) ? __spreadArray([visitedNode], pendingStatements) :
+            var statement = ts.some(pendingStatements) ? __spreadArray([visitedNode], pendingStatements, true) :
                 visitedNode;
             pendingStatements = savedPendingStatements;
             return statement;
@@ -86055,88 +91927,210 @@ var ts;
             }
             return node;
         }
+        function visitMethodOrAccessorDeclaration(node) {
+            ts.Debug.assert(!ts.some(node.decorators));
+            if (!shouldTransformPrivateElementsOrClassStaticBlocks || !ts.isPrivateIdentifier(node.name)) {
+                return ts.visitEachChild(node, classElementVisitor, context);
+            }
+            // leave invalid code untransformed
+            var info = accessPrivateIdentifier(node.name);
+            ts.Debug.assert(info, "Undeclared private name for property declaration.");
+            if (!info.isValid) {
+                return node;
+            }
+            var functionName = getHoistedFunctionName(node);
+            if (functionName) {
+                getPendingExpressions().push(factory.createAssignment(functionName, factory.createFunctionExpression(ts.filter(node.modifiers, function (m) { return !ts.isStaticModifier(m); }), node.asteriskToken, functionName, 
+                /* typeParameters */ undefined, ts.visitParameterList(node.parameters, classElementVisitor, context), 
+                /* type */ undefined, ts.visitFunctionBody(node.body, classElementVisitor, context))));
+            }
+            // remove method declaration from class
+            return undefined;
+        }
+        function getHoistedFunctionName(node) {
+            ts.Debug.assert(ts.isPrivateIdentifier(node.name));
+            var info = accessPrivateIdentifier(node.name);
+            ts.Debug.assert(info, "Undeclared private name for property declaration.");
+            if (info.kind === "m" /* Method */) {
+                return info.methodName;
+            }
+            if (info.kind === "a" /* Accessor */) {
+                if (ts.isGetAccessor(node)) {
+                    return info.getterName;
+                }
+                if (ts.isSetAccessor(node)) {
+                    return info.setterName;
+                }
+            }
+        }
         function visitPropertyDeclaration(node) {
             ts.Debug.assert(!ts.some(node.decorators));
-            if (!shouldTransformPrivateFields && ts.isPrivateIdentifier(node.name)) {
-                // Initializer is elided as the field is initialized in transformConstructor.
-                return factory.updatePropertyDeclaration(node, 
-                /*decorators*/ undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.name, 
-                /*questionOrExclamationToken*/ undefined, 
-                /*type*/ undefined, 
-                /*initializer*/ undefined);
+            if (ts.isPrivateIdentifier(node.name)) {
+                if (!shouldTransformPrivateElementsOrClassStaticBlocks) {
+                    // Initializer is elided as the field is initialized in transformConstructor.
+                    return factory.updatePropertyDeclaration(node, 
+                    /*decorators*/ undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.name, 
+                    /*questionOrExclamationToken*/ undefined, 
+                    /*type*/ undefined, 
+                    /*initializer*/ undefined);
+                }
+                // leave invalid code untransformed
+                var info = accessPrivateIdentifier(node.name);
+                ts.Debug.assert(info, "Undeclared private name for property declaration.");
+                if (!info.isValid) {
+                    return node;
+                }
             }
             // Create a temporary variable to store a computed property name (if necessary).
             // If it's not inlineable, then we emit an expression after the class which assigns
             // the property name to the temporary variable.
-            var expr = getPropertyNameExpressionIfNeeded(node.name, !!node.initializer || !!context.getCompilerOptions().useDefineForClassFields);
+            var expr = getPropertyNameExpressionIfNeeded(node.name, !!node.initializer || useDefineForClassFields);
             if (expr && !ts.isSimpleInlineableExpression(expr)) {
                 getPendingExpressions().push(expr);
             }
             return undefined;
         }
         function createPrivateIdentifierAccess(info, receiver) {
-            receiver = ts.visitNode(receiver, visitor, ts.isExpression);
-            switch (info.placement) {
-                case 0 /* InstanceField */:
-                    return context.getEmitHelperFactory().createClassPrivateFieldGetHelper(ts.nodeIsSynthesized(receiver) ? receiver : factory.cloneNode(receiver), info.weakMapName);
-                default: return ts.Debug.fail("Unexpected private identifier placement");
+            return createPrivateIdentifierAccessHelper(info, ts.visitNode(receiver, visitor, ts.isExpression));
+        }
+        function createPrivateIdentifierAccessHelper(info, receiver) {
+            ts.setCommentRange(receiver, ts.moveRangePos(receiver, -1));
+            switch (info.kind) {
+                case "a" /* Accessor */:
+                    return context.getEmitHelperFactory().createClassPrivateFieldGetHelper(receiver, info.brandCheckIdentifier, info.kind, info.getterName);
+                case "m" /* Method */:
+                    return context.getEmitHelperFactory().createClassPrivateFieldGetHelper(receiver, info.brandCheckIdentifier, info.kind, info.methodName);
+                case "f" /* Field */:
+                    return context.getEmitHelperFactory().createClassPrivateFieldGetHelper(receiver, info.brandCheckIdentifier, info.kind, info.variableName);
+                default:
+                    ts.Debug.assertNever(info, "Unknown private element type");
             }
         }
         function visitPropertyAccessExpression(node) {
-            if (shouldTransformPrivateFields && ts.isPrivateIdentifier(node.name)) {
+            if (shouldTransformPrivateElementsOrClassStaticBlocks && ts.isPrivateIdentifier(node.name)) {
                 var privateIdentifierInfo = accessPrivateIdentifier(node.name);
                 if (privateIdentifierInfo) {
-                    return ts.setOriginalNode(createPrivateIdentifierAccess(privateIdentifierInfo, node.expression), node);
+                    return ts.setTextRange(ts.setOriginalNode(createPrivateIdentifierAccess(privateIdentifierInfo, node.expression), node), node);
+                }
+            }
+            if (shouldTransformSuperInStaticInitializers &&
+                ts.isSuperProperty(node) &&
+                ts.isIdentifier(node.name) &&
+                currentStaticPropertyDeclarationOrStaticBlock &&
+                currentClassLexicalEnvironment) {
+                var classConstructor = currentClassLexicalEnvironment.classConstructor, superClassReference = currentClassLexicalEnvironment.superClassReference, facts = currentClassLexicalEnvironment.facts;
+                if (facts & 1 /* ClassWasDecorated */) {
+                    return visitInvalidSuperProperty(node);
+                }
+                if (classConstructor && superClassReference) {
+                    // converts `super.x` into `Reflect.get(_baseTemp, "x", _classTemp)`
+                    var superProperty = factory.createReflectGetCall(superClassReference, factory.createStringLiteralFromNode(node.name), classConstructor);
+                    ts.setOriginalNode(superProperty, node.expression);
+                    ts.setTextRange(superProperty, node.expression);
+                    return superProperty;
                 }
             }
             return ts.visitEachChild(node, visitor, context);
         }
-        function visitPrefixUnaryExpression(node) {
-            if (shouldTransformPrivateFields && ts.isPrivateIdentifierPropertyAccessExpression(node.operand)) {
-                var operator = node.operator === 45 /* PlusPlusToken */ ?
-                    39 /* PlusToken */ : node.operator === 46 /* MinusMinusToken */ ?
-                    40 /* MinusToken */ : undefined;
-                var info = void 0;
-                if (operator && (info = accessPrivateIdentifier(node.operand.name))) {
-                    var receiver = ts.visitNode(node.operand.expression, visitor, ts.isExpression);
-                    var _a = createCopiableReceiverExpr(receiver), readExpression = _a.readExpression, initializeExpression = _a.initializeExpression;
-                    var existingValue = factory.createPrefixUnaryExpression(39 /* PlusToken */, createPrivateIdentifierAccess(info, readExpression));
-                    return ts.setOriginalNode(createPrivateIdentifierAssignment(info, initializeExpression || readExpression, factory.createBinaryExpression(existingValue, operator, factory.createNumericLiteral(1)), 62 /* EqualsToken */), node);
+        function visitElementAccessExpression(node) {
+            if (shouldTransformSuperInStaticInitializers &&
+                ts.isSuperProperty(node) &&
+                currentStaticPropertyDeclarationOrStaticBlock &&
+                currentClassLexicalEnvironment) {
+                var classConstructor = currentClassLexicalEnvironment.classConstructor, superClassReference = currentClassLexicalEnvironment.superClassReference, facts = currentClassLexicalEnvironment.facts;
+                if (facts & 1 /* ClassWasDecorated */) {
+                    return visitInvalidSuperProperty(node);
+                }
+                if (classConstructor && superClassReference) {
+                    // converts `super[x]` into `Reflect.get(_baseTemp, x, _classTemp)`
+                    var superProperty = factory.createReflectGetCall(superClassReference, ts.visitNode(node.argumentExpression, visitor, ts.isExpression), classConstructor);
+                    ts.setOriginalNode(superProperty, node.expression);
+                    ts.setTextRange(superProperty, node.expression);
+                    return superProperty;
                 }
             }
             return ts.visitEachChild(node, visitor, context);
         }
-        function visitPostfixUnaryExpression(node, valueIsDiscarded) {
-            if (shouldTransformPrivateFields && ts.isPrivateIdentifierPropertyAccessExpression(node.operand)) {
-                var operator = node.operator === 45 /* PlusPlusToken */ ?
-                    39 /* PlusToken */ : node.operator === 46 /* MinusMinusToken */ ?
-                    40 /* MinusToken */ : undefined;
-                var info = void 0;
-                if (operator && (info = accessPrivateIdentifier(node.operand.name))) {
-                    var receiver = ts.visitNode(node.operand.expression, visitor, ts.isExpression);
-                    var _a = createCopiableReceiverExpr(receiver), readExpression = _a.readExpression, initializeExpression = _a.initializeExpression;
-                    var existingValue = factory.createPrefixUnaryExpression(39 /* PlusToken */, createPrivateIdentifierAccess(info, readExpression));
-                    // Create a temporary variable to store the value returned by the expression.
-                    var returnValue = valueIsDiscarded ? undefined : factory.createTempVariable(hoistVariableDeclaration);
-                    return ts.setOriginalNode(factory.inlineExpressions(ts.compact([
-                        createPrivateIdentifierAssignment(info, initializeExpression || readExpression, factory.createBinaryExpression(returnValue ? factory.createAssignment(returnValue, existingValue) : existingValue, operator, factory.createNumericLiteral(1)), 62 /* EqualsToken */),
-                        returnValue
-                    ])), node);
+        function visitPreOrPostfixUnaryExpression(node, valueIsDiscarded) {
+            if (node.operator === 45 /* PlusPlusToken */ || node.operator === 46 /* MinusMinusToken */) {
+                if (shouldTransformPrivateElementsOrClassStaticBlocks && ts.isPrivateIdentifierPropertyAccessExpression(node.operand)) {
+                    var info = void 0;
+                    if (info = accessPrivateIdentifier(node.operand.name)) {
+                        var receiver = ts.visitNode(node.operand.expression, visitor, ts.isExpression);
+                        var _a = createCopiableReceiverExpr(receiver), readExpression = _a.readExpression, initializeExpression = _a.initializeExpression;
+                        var expression = createPrivateIdentifierAccess(info, readExpression);
+                        var temp = ts.isPrefixUnaryExpression(node) || valueIsDiscarded ? undefined : factory.createTempVariable(hoistVariableDeclaration);
+                        expression = ts.expandPreOrPostfixIncrementOrDecrementExpression(factory, node, expression, hoistVariableDeclaration, temp);
+                        expression = createPrivateIdentifierAssignment(info, initializeExpression || readExpression, expression, 63 /* EqualsToken */);
+                        ts.setOriginalNode(expression, node);
+                        ts.setTextRange(expression, node);
+                        if (temp) {
+                            expression = factory.createComma(expression, temp);
+                            ts.setTextRange(expression, node);
+                        }
+                        return expression;
+                    }
+                }
+                else if (shouldTransformSuperInStaticInitializers &&
+                    ts.isSuperProperty(node.operand) &&
+                    currentStaticPropertyDeclarationOrStaticBlock &&
+                    currentClassLexicalEnvironment) {
+                    // converts `++super.a` into `(Reflect.set(_baseTemp, "a", (_a = Reflect.get(_baseTemp, "a", _classTemp), _b = ++_a), _classTemp), _b)`
+                    // converts `++super[f()]` into `(Reflect.set(_baseTemp, _a = f(), (_b = Reflect.get(_baseTemp, _a, _classTemp), _c = ++_b), _classTemp), _c)`
+                    // converts `--super.a` into `(Reflect.set(_baseTemp, "a", (_a = Reflect.get(_baseTemp, "a", _classTemp), _b = --_a), _classTemp), _b)`
+                    // converts `--super[f()]` into `(Reflect.set(_baseTemp, _a = f(), (_b = Reflect.get(_baseTemp, _a, _classTemp), _c = --_b), _classTemp), _c)`
+                    // converts `super.a++` into `(Reflect.set(_baseTemp, "a", (_a = Reflect.get(_baseTemp, "a", _classTemp), _b = _a++), _classTemp), _b)`
+                    // converts `super[f()]++` into `(Reflect.set(_baseTemp, _a = f(), (_b = Reflect.get(_baseTemp, _a, _classTemp), _c = _b++), _classTemp), _c)`
+                    // converts `super.a--` into `(Reflect.set(_baseTemp, "a", (_a = Reflect.get(_baseTemp, "a", _classTemp), _b = _a--), _classTemp), _b)`
+                    // converts `super[f()]--` into `(Reflect.set(_baseTemp, _a = f(), (_b = Reflect.get(_baseTemp, _a, _classTemp), _c = _b--), _classTemp), _c)`
+                    var classConstructor = currentClassLexicalEnvironment.classConstructor, superClassReference = currentClassLexicalEnvironment.superClassReference, facts = currentClassLexicalEnvironment.facts;
+                    if (facts & 1 /* ClassWasDecorated */) {
+                        var operand = visitInvalidSuperProperty(node.operand);
+                        return ts.isPrefixUnaryExpression(node) ?
+                            factory.updatePrefixUnaryExpression(node, operand) :
+                            factory.updatePostfixUnaryExpression(node, operand);
+                    }
+                    if (classConstructor && superClassReference) {
+                        var setterName = void 0;
+                        var getterName = void 0;
+                        if (ts.isPropertyAccessExpression(node.operand)) {
+                            if (ts.isIdentifier(node.operand.name)) {
+                                getterName = setterName = factory.createStringLiteralFromNode(node.operand.name);
+                            }
+                        }
+                        else {
+                            if (ts.isSimpleInlineableExpression(node.operand.argumentExpression)) {
+                                getterName = setterName = node.operand.argumentExpression;
+                            }
+                            else {
+                                getterName = factory.createTempVariable(hoistVariableDeclaration);
+                                setterName = factory.createAssignment(getterName, ts.visitNode(node.operand.argumentExpression, visitor, ts.isExpression));
+                            }
+                        }
+                        if (setterName && getterName) {
+                            var expression = factory.createReflectGetCall(superClassReference, getterName, classConstructor);
+                            ts.setTextRange(expression, node.operand);
+                            var temp = valueIsDiscarded ? undefined : factory.createTempVariable(hoistVariableDeclaration);
+                            expression = ts.expandPreOrPostfixIncrementOrDecrementExpression(factory, node, expression, hoistVariableDeclaration, temp);
+                            expression = factory.createReflectSetCall(superClassReference, setterName, expression, classConstructor);
+                            ts.setOriginalNode(expression, node);
+                            ts.setTextRange(expression, node);
+                            if (temp) {
+                                expression = factory.createComma(expression, temp);
+                                ts.setTextRange(expression, node);
+                            }
+                            return expression;
+                        }
+                    }
                 }
             }
             return ts.visitEachChild(node, visitor, context);
         }
         function visitForStatement(node) {
-            if (node.incrementor && ts.isPostfixUnaryExpression(node.incrementor)) {
-                return factory.updateForStatement(node, ts.visitNode(node.initializer, visitor, ts.isForInitializer), ts.visitNode(node.condition, visitor, ts.isExpression), visitPostfixUnaryExpression(node.incrementor, /*valueIsDiscarded*/ true), ts.visitNode(node.statement, visitor, ts.isStatement));
-            }
-            return ts.visitEachChild(node, visitor, context);
+            return factory.updateForStatement(node, ts.visitNode(node.initializer, discardedValueVisitor, ts.isForInitializer), ts.visitNode(node.condition, visitor, ts.isExpression), ts.visitNode(node.incrementor, discardedValueVisitor, ts.isExpression), ts.visitIterationBody(node.statement, visitor, context));
         }
         function visitExpressionStatement(node) {
-            if (ts.isPostfixUnaryExpression(node.expression)) {
-                return factory.updateExpressionStatement(node, visitPostfixUnaryExpression(node.expression, /*valueIsDiscarded*/ true));
-            }
-            return ts.visitEachChild(node, visitor, context);
+            return factory.updateExpressionStatement(node, ts.visitNode(node.expression, discardedValueVisitor, ts.isExpression));
         }
         function createCopiableReceiverExpr(receiver) {
             var clone = ts.nodeIsSynthesized(receiver) ? receiver : factory.cloneNode(receiver);
@@ -86148,101 +92142,258 @@ var ts;
             return { readExpression: readExpression, initializeExpression: initializeExpression };
         }
         function visitCallExpression(node) {
-            if (shouldTransformPrivateFields && ts.isPrivateIdentifierPropertyAccessExpression(node.expression)) {
+            if (shouldTransformPrivateElementsOrClassStaticBlocks && ts.isPrivateIdentifierPropertyAccessExpression(node.expression)) {
                 // Transform call expressions of private names to properly bind the `this` parameter.
                 var _a = factory.createCallBinding(node.expression, hoistVariableDeclaration, languageVersion), thisArg = _a.thisArg, target = _a.target;
                 if (ts.isCallChain(node)) {
                     return factory.updateCallChain(node, factory.createPropertyAccessChain(ts.visitNode(target, visitor), node.questionDotToken, "call"), 
                     /*questionDotToken*/ undefined, 
-                    /*typeArguments*/ undefined, __spreadArray([ts.visitNode(thisArg, visitor, ts.isExpression)], ts.visitNodes(node.arguments, visitor, ts.isExpression)));
+                    /*typeArguments*/ undefined, __spreadArray([ts.visitNode(thisArg, visitor, ts.isExpression)], ts.visitNodes(node.arguments, visitor, ts.isExpression), true));
                 }
                 return factory.updateCallExpression(node, factory.createPropertyAccessExpression(ts.visitNode(target, visitor), "call"), 
-                /*typeArguments*/ undefined, __spreadArray([ts.visitNode(thisArg, visitor, ts.isExpression)], ts.visitNodes(node.arguments, visitor, ts.isExpression)));
+                /*typeArguments*/ undefined, __spreadArray([ts.visitNode(thisArg, visitor, ts.isExpression)], ts.visitNodes(node.arguments, visitor, ts.isExpression), true));
+            }
+            if (shouldTransformSuperInStaticInitializers &&
+                ts.isSuperProperty(node.expression) &&
+                currentStaticPropertyDeclarationOrStaticBlock &&
+                (currentClassLexicalEnvironment === null || currentClassLexicalEnvironment === void 0 ? void 0 : currentClassLexicalEnvironment.classConstructor)) {
+                // converts `super.f(...)` into `Reflect.get(_baseTemp, "f", _classTemp).call(_classTemp, ...)`
+                var invocation = factory.createFunctionCallCall(ts.visitNode(node.expression, visitor, ts.isExpression), currentClassLexicalEnvironment.classConstructor, ts.visitNodes(node.arguments, visitor, ts.isExpression));
+                ts.setOriginalNode(invocation, node);
+                ts.setTextRange(invocation, node);
+                return invocation;
             }
             return ts.visitEachChild(node, visitor, context);
         }
         function visitTaggedTemplateExpression(node) {
-            if (shouldTransformPrivateFields && ts.isPrivateIdentifierPropertyAccessExpression(node.tag)) {
+            if (shouldTransformPrivateElementsOrClassStaticBlocks && ts.isPrivateIdentifierPropertyAccessExpression(node.tag)) {
                 // Bind the `this` correctly for tagged template literals when the tag is a private identifier property access.
                 var _a = factory.createCallBinding(node.tag, hoistVariableDeclaration, languageVersion), thisArg = _a.thisArg, target = _a.target;
                 return factory.updateTaggedTemplateExpression(node, factory.createCallExpression(factory.createPropertyAccessExpression(ts.visitNode(target, visitor), "bind"), 
                 /*typeArguments*/ undefined, [ts.visitNode(thisArg, visitor, ts.isExpression)]), 
                 /*typeArguments*/ undefined, ts.visitNode(node.template, visitor, ts.isTemplateLiteral));
             }
+            if (shouldTransformSuperInStaticInitializers &&
+                ts.isSuperProperty(node.tag) &&
+                currentStaticPropertyDeclarationOrStaticBlock &&
+                (currentClassLexicalEnvironment === null || currentClassLexicalEnvironment === void 0 ? void 0 : currentClassLexicalEnvironment.classConstructor)) {
+                // converts `` super.f`x` `` into `` Reflect.get(_baseTemp, "f", _classTemp).bind(_classTemp)`x` ``
+                var invocation = factory.createFunctionBindCall(ts.visitNode(node.tag, visitor, ts.isExpression), currentClassLexicalEnvironment.classConstructor, []);
+                ts.setOriginalNode(invocation, node);
+                ts.setTextRange(invocation, node);
+                return factory.updateTaggedTemplateExpression(node, invocation, 
+                /*typeArguments*/ undefined, ts.visitNode(node.template, visitor, ts.isTemplateLiteral));
+            }
             return ts.visitEachChild(node, visitor, context);
         }
-        function visitBinaryExpression(node) {
-            if (shouldTransformPrivateFields) {
-                if (ts.isDestructuringAssignment(node)) {
-                    var savedPendingExpressions = pendingExpressions;
-                    pendingExpressions = undefined;
-                    node = factory.updateBinaryExpression(node, ts.visitNode(node.left, visitorDestructuringTarget), node.operatorToken, ts.visitNode(node.right, visitor));
-                    var expr = ts.some(pendingExpressions) ?
-                        factory.inlineExpressions(ts.compact(__spreadArray(__spreadArray([], pendingExpressions), [node]))) :
-                        node;
-                    pendingExpressions = savedPendingExpressions;
-                    return expr;
-                }
-                if (ts.isAssignmentExpression(node) && ts.isPrivateIdentifierPropertyAccessExpression(node.left)) {
+        function transformClassStaticBlockDeclaration(node) {
+            if (shouldTransformPrivateElementsOrClassStaticBlocks) {
+                if (currentClassLexicalEnvironment) {
+                    classLexicalEnvironmentMap.set(ts.getOriginalNodeId(node), currentClassLexicalEnvironment);
+                }
+                startLexicalEnvironment();
+                var savedCurrentStaticPropertyDeclarationOrStaticBlock = currentStaticPropertyDeclarationOrStaticBlock;
+                currentStaticPropertyDeclarationOrStaticBlock = node;
+                var statements = ts.visitNodes(node.body.statements, visitor, ts.isStatement);
+                statements = factory.mergeLexicalEnvironment(statements, endLexicalEnvironment());
+                currentStaticPropertyDeclarationOrStaticBlock = savedCurrentStaticPropertyDeclarationOrStaticBlock;
+                var iife = factory.createImmediatelyInvokedArrowFunction(statements);
+                ts.setOriginalNode(iife, node);
+                ts.setTextRange(iife, node);
+                ts.addEmitFlags(iife, 2 /* AdviseOnEmitNode */);
+                return iife;
+            }
+        }
+        function visitBinaryExpression(node, valueIsDiscarded) {
+            if (ts.isDestructuringAssignment(node)) {
+                var savedPendingExpressions = pendingExpressions;
+                pendingExpressions = undefined;
+                node = factory.updateBinaryExpression(node, ts.visitNode(node.left, visitorDestructuringTarget), node.operatorToken, ts.visitNode(node.right, visitor));
+                var expr = ts.some(pendingExpressions) ?
+                    factory.inlineExpressions(ts.compact(__spreadArray(__spreadArray([], pendingExpressions, true), [node], false))) :
+                    node;
+                pendingExpressions = savedPendingExpressions;
+                return expr;
+            }
+            if (ts.isAssignmentExpression(node)) {
+                if (shouldTransformPrivateElementsOrClassStaticBlocks && ts.isPrivateIdentifierPropertyAccessExpression(node.left)) {
                     var info = accessPrivateIdentifier(node.left.name);
                     if (info) {
-                        return ts.setOriginalNode(createPrivateIdentifierAssignment(info, node.left.expression, node.right, node.operatorToken.kind), node);
+                        return ts.setTextRange(ts.setOriginalNode(createPrivateIdentifierAssignment(info, node.left.expression, node.right, node.operatorToken.kind), node), node);
+                    }
+                }
+                else if (shouldTransformSuperInStaticInitializers &&
+                    ts.isSuperProperty(node.left) &&
+                    currentStaticPropertyDeclarationOrStaticBlock &&
+                    currentClassLexicalEnvironment) {
+                    var classConstructor = currentClassLexicalEnvironment.classConstructor, superClassReference = currentClassLexicalEnvironment.superClassReference, facts = currentClassLexicalEnvironment.facts;
+                    if (facts & 1 /* ClassWasDecorated */) {
+                        return factory.updateBinaryExpression(node, visitInvalidSuperProperty(node.left), node.operatorToken, ts.visitNode(node.right, visitor, ts.isExpression));
+                    }
+                    if (classConstructor && superClassReference) {
+                        var setterName = ts.isElementAccessExpression(node.left) ? ts.visitNode(node.left.argumentExpression, visitor, ts.isExpression) :
+                            ts.isIdentifier(node.left.name) ? factory.createStringLiteralFromNode(node.left.name) :
+                                undefined;
+                        if (setterName) {
+                            // converts `super.x = 1` into `(Reflect.set(_baseTemp, "x", _a = 1, _classTemp), _a)`
+                            // converts `super[f()] = 1` into `(Reflect.set(_baseTemp, f(), _a = 1, _classTemp), _a)`
+                            // converts `super.x += 1` into `(Reflect.set(_baseTemp, "x", _a = Reflect.get(_baseTemp, "x", _classtemp) + 1, _classTemp), _a)`
+                            // converts `super[f()] += 1` into `(Reflect.set(_baseTemp, _a = f(), _b = Reflect.get(_baseTemp, _a, _classtemp) + 1, _classTemp), _b)`
+                            var expression = ts.visitNode(node.right, visitor, ts.isExpression);
+                            if (ts.isCompoundAssignment(node.operatorToken.kind)) {
+                                var getterName = setterName;
+                                if (!ts.isSimpleInlineableExpression(setterName)) {
+                                    getterName = factory.createTempVariable(hoistVariableDeclaration);
+                                    setterName = factory.createAssignment(getterName, setterName);
+                                }
+                                var superPropertyGet = factory.createReflectGetCall(superClassReference, getterName, classConstructor);
+                                ts.setOriginalNode(superPropertyGet, node.left);
+                                ts.setTextRange(superPropertyGet, node.left);
+                                expression = factory.createBinaryExpression(superPropertyGet, ts.getNonAssignmentOperatorForCompoundAssignment(node.operatorToken.kind), expression);
+                                ts.setTextRange(expression, node);
+                            }
+                            var temp = valueIsDiscarded ? undefined : factory.createTempVariable(hoistVariableDeclaration);
+                            if (temp) {
+                                expression = factory.createAssignment(temp, expression);
+                                ts.setTextRange(temp, node);
+                            }
+                            expression = factory.createReflectSetCall(superClassReference, setterName, expression, classConstructor);
+                            ts.setOriginalNode(expression, node);
+                            ts.setTextRange(expression, node);
+                            if (temp) {
+                                expression = factory.createComma(expression, temp);
+                                ts.setTextRange(expression, node);
+                            }
+                            return expression;
+                        }
                     }
                 }
             }
+            if (node.operatorToken.kind === 101 /* InKeyword */ && ts.isPrivateIdentifier(node.left)) {
+                return visitPrivateIdentifierInInExpression(node);
+            }
             return ts.visitEachChild(node, visitor, context);
         }
         function createPrivateIdentifierAssignment(info, receiver, right, operator) {
-            switch (info.placement) {
-                case 0 /* InstanceField */: {
-                    return createPrivateIdentifierInstanceFieldAssignment(info, receiver, right, operator);
-                }
-                default: return ts.Debug.fail("Unexpected private identifier placement");
-            }
-        }
-        function createPrivateIdentifierInstanceFieldAssignment(info, receiver, right, operator) {
             receiver = ts.visitNode(receiver, visitor, ts.isExpression);
             right = ts.visitNode(right, visitor, ts.isExpression);
             if (ts.isCompoundAssignment(operator)) {
                 var _a = createCopiableReceiverExpr(receiver), readExpression = _a.readExpression, initializeExpression = _a.initializeExpression;
-                return context.getEmitHelperFactory().createClassPrivateFieldSetHelper(initializeExpression || readExpression, info.weakMapName, factory.createBinaryExpression(context.getEmitHelperFactory().createClassPrivateFieldGetHelper(readExpression, info.weakMapName), ts.getNonAssignmentOperatorForCompoundAssignment(operator), right));
-            }
-            else {
-                return context.getEmitHelperFactory().createClassPrivateFieldSetHelper(receiver, info.weakMapName, right);
+                receiver = initializeExpression || readExpression;
+                right = factory.createBinaryExpression(createPrivateIdentifierAccessHelper(info, readExpression), ts.getNonAssignmentOperatorForCompoundAssignment(operator), right);
+            }
+            ts.setCommentRange(receiver, ts.moveRangePos(receiver, -1));
+            switch (info.kind) {
+                case "a" /* Accessor */:
+                    return context.getEmitHelperFactory().createClassPrivateFieldSetHelper(receiver, info.brandCheckIdentifier, right, info.kind, info.setterName);
+                case "m" /* Method */:
+                    return context.getEmitHelperFactory().createClassPrivateFieldSetHelper(receiver, info.brandCheckIdentifier, right, info.kind, 
+                    /* f */ undefined);
+                case "f" /* Field */:
+                    return context.getEmitHelperFactory().createClassPrivateFieldSetHelper(receiver, info.brandCheckIdentifier, right, info.kind, info.variableName);
+                default:
+                    ts.Debug.assertNever(info, "Unknown private element type");
             }
         }
         /**
          * Set up the environment for a class.
          */
         function visitClassLike(node) {
+            if (!ts.forEach(node.members, doesClassElementNeedTransform)) {
+                return ts.visitEachChild(node, visitor, context);
+            }
             var savedPendingExpressions = pendingExpressions;
             pendingExpressions = undefined;
-            if (shouldTransformPrivateFields) {
-                startPrivateIdentifierEnvironment();
+            startClassLexicalEnvironment();
+            if (shouldTransformPrivateElementsOrClassStaticBlocks) {
+                var name = ts.getNameOfDeclaration(node);
+                if (name && ts.isIdentifier(name)) {
+                    getPrivateIdentifierEnvironment().className = ts.idText(name);
+                }
+                var privateInstanceMethodsAndAccessors = getPrivateInstanceMethodsAndAccessors(node);
+                if (ts.some(privateInstanceMethodsAndAccessors)) {
+                    getPrivateIdentifierEnvironment().weakSetName = createHoistedVariableForClass("instances", privateInstanceMethodsAndAccessors[0].name);
+                }
             }
             var result = ts.isClassDeclaration(node) ?
                 visitClassDeclaration(node) :
                 visitClassExpression(node);
-            if (shouldTransformPrivateFields) {
-                endPrivateIdentifierEnvironment();
-            }
+            endClassLexicalEnvironment();
             pendingExpressions = savedPendingExpressions;
             return result;
         }
         function doesClassElementNeedTransform(node) {
-            return ts.isPropertyDeclaration(node) || (shouldTransformPrivateFields && node.name && ts.isPrivateIdentifier(node.name));
+            return ts.isPropertyDeclaration(node) || ts.isClassStaticBlockDeclaration(node) || (shouldTransformPrivateElementsOrClassStaticBlocks && node.name && ts.isPrivateIdentifier(node.name));
+        }
+        function getPrivateInstanceMethodsAndAccessors(node) {
+            return ts.filter(node.members, ts.isNonStaticMethodOrAccessorWithPrivateName);
+        }
+        function getClassFacts(node) {
+            var facts = 0 /* None */;
+            var original = ts.getOriginalNode(node);
+            if (ts.isClassDeclaration(original) && ts.classOrConstructorParameterIsDecorated(original)) {
+                facts |= 1 /* ClassWasDecorated */;
+            }
+            for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
+                var member = _a[_i];
+                if (!ts.isStatic(member))
+                    continue;
+                if (member.name && ts.isPrivateIdentifier(member.name) && shouldTransformPrivateElementsOrClassStaticBlocks) {
+                    facts |= 2 /* NeedsClassConstructorReference */;
+                }
+                if (ts.isPropertyDeclaration(member) || ts.isClassStaticBlockDeclaration(member)) {
+                    if (shouldTransformThisInStaticInitializers && member.transformFlags & 8192 /* ContainsLexicalThis */) {
+                        facts |= 8 /* NeedsSubstitutionForThisInClassStaticField */;
+                        if (!(facts & 1 /* ClassWasDecorated */)) {
+                            facts |= 2 /* NeedsClassConstructorReference */;
+                        }
+                    }
+                    if (shouldTransformSuperInStaticInitializers && member.transformFlags & 33554432 /* ContainsLexicalSuper */) {
+                        if (!(facts & 1 /* ClassWasDecorated */)) {
+                            facts |= 2 /* NeedsClassConstructorReference */ | 4 /* NeedsClassSuperReference */;
+                        }
+                    }
+                }
+            }
+            return facts;
+        }
+        function visitExpressionWithTypeArguments(node) {
+            var facts = (currentClassLexicalEnvironment === null || currentClassLexicalEnvironment === void 0 ? void 0 : currentClassLexicalEnvironment.facts) || 0 /* None */;
+            if (facts & 4 /* NeedsClassSuperReference */) {
+                var temp = factory.createTempVariable(hoistVariableDeclaration, /*reserveInNestedScopes*/ true);
+                getClassLexicalEnvironment().superClassReference = temp;
+                return factory.updateExpressionWithTypeArguments(node, factory.createAssignment(temp, ts.visitNode(node.expression, visitor, ts.isExpression)), 
+                /*typeArguments*/ undefined);
+            }
+            return ts.visitEachChild(node, visitor, context);
         }
         function visitClassDeclaration(node) {
-            if (!ts.forEach(node.members, doesClassElementNeedTransform)) {
-                return ts.visitEachChild(node, visitor, context);
+            var facts = getClassFacts(node);
+            if (facts) {
+                getClassLexicalEnvironment().facts = facts;
+            }
+            if (facts & 8 /* NeedsSubstitutionForThisInClassStaticField */) {
+                enableSubstitutionForClassStaticThisOrSuperReference();
+            }
+            var staticProperties = ts.getStaticPropertiesAndClassStaticBlock(node);
+            // If a class has private static fields, or a static field has a `this` or `super` reference,
+            // then we need to allocate a temp variable to hold on to that reference.
+            var pendingClassReferenceAssignment;
+            if (facts & 2 /* NeedsClassConstructorReference */) {
+                var temp = factory.createTempVariable(hoistVariableDeclaration, /*reservedInNestedScopes*/ true);
+                getClassLexicalEnvironment().classConstructor = factory.cloneNode(temp);
+                pendingClassReferenceAssignment = factory.createAssignment(temp, factory.getInternalName(node));
             }
             var extendsClauseElement = ts.getEffectiveBaseTypeNode(node);
-            var isDerivedClass = !!(extendsClauseElement && ts.skipOuterExpressions(extendsClauseElement.expression).kind !== 103 /* NullKeyword */);
+            var isDerivedClass = !!(extendsClauseElement && ts.skipOuterExpressions(extendsClauseElement.expression).kind !== 104 /* NullKeyword */);
             var statements = [
                 factory.updateClassDeclaration(node, 
                 /*decorators*/ undefined, node.modifiers, node.name, 
-                /*typeParameters*/ undefined, ts.visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), transformClassMembers(node, isDerivedClass))
+                /*typeParameters*/ undefined, ts.visitNodes(node.heritageClauses, heritageClauseVisitor, ts.isHeritageClause), transformClassMembers(node, isDerivedClass))
             ];
+            if (pendingClassReferenceAssignment) {
+                getPendingExpressions().unshift(pendingClassReferenceAssignment);
+            }
             // Write any pending expressions from elided or moved computed property names
             if (ts.some(pendingExpressions)) {
                 statements.push(factory.createExpressionStatement(factory.inlineExpressions(pendingExpressions)));
@@ -86252,15 +92403,18 @@ var ts;
             // From ES6 specification:
             //      HasLexicalDeclaration (N) : Determines if the argument identifier has a binding in this environment record that was created using
             //                                  a lexical declaration such as a LexicalDeclaration or a ClassDeclaration.
-            var staticProperties = ts.getProperties(node, /*requireInitializer*/ true, /*isStatic*/ true);
             if (ts.some(staticProperties)) {
-                addPropertyStatements(statements, staticProperties, factory.getInternalName(node));
+                addPropertyOrClassStaticBlockStatements(statements, staticProperties, factory.getInternalName(node));
             }
             return statements;
         }
         function visitClassExpression(node) {
-            if (!ts.forEach(node.members, doesClassElementNeedTransform)) {
-                return ts.visitEachChild(node, visitor, context);
+            var facts = getClassFacts(node);
+            if (facts) {
+                getClassLexicalEnvironment().facts = facts;
+            }
+            if (facts & 8 /* NeedsSubstitutionForThisInClassStaticField */) {
+                enableSubstitutionForClassStaticThisOrSuperReference();
             }
             // If this class expression is a transformation of a decorated class declaration,
             // then we want to output the pendingExpressions as statements, not as inlined
@@ -86269,28 +92423,43 @@ var ts;
             // In this case, we use pendingStatements to produce the same output as the
             // class declaration transformation. The VariableStatement visitor will insert
             // these statements after the class expression variable statement.
-            var isDecoratedClassDeclaration = ts.isClassDeclaration(ts.getOriginalNode(node));
-            var staticProperties = ts.getProperties(node, /*requireInitializer*/ true, /*isStatic*/ true);
+            var isDecoratedClassDeclaration = !!(facts & 1 /* ClassWasDecorated */);
+            var staticPropertiesOrClassStaticBlocks = ts.getStaticPropertiesAndClassStaticBlock(node);
             var extendsClauseElement = ts.getEffectiveBaseTypeNode(node);
-            var isDerivedClass = !!(extendsClauseElement && ts.skipOuterExpressions(extendsClauseElement.expression).kind !== 103 /* NullKeyword */);
+            var isDerivedClass = !!(extendsClauseElement && ts.skipOuterExpressions(extendsClauseElement.expression).kind !== 104 /* NullKeyword */);
+            var isClassWithConstructorReference = resolver.getNodeCheckFlags(node) & 16777216 /* ClassWithConstructorReference */;
+            var temp;
+            function createClassTempVar() {
+                var classCheckFlags = resolver.getNodeCheckFlags(node);
+                var isClassWithConstructorReference = classCheckFlags & 16777216 /* ClassWithConstructorReference */;
+                var requiresBlockScopedVar = classCheckFlags & 524288 /* BlockScopedBindingInLoop */;
+                return factory.createTempVariable(requiresBlockScopedVar ? addBlockScopedVariable : hoistVariableDeclaration, !!isClassWithConstructorReference);
+            }
+            if (facts & 2 /* NeedsClassConstructorReference */) {
+                temp = createClassTempVar();
+                getClassLexicalEnvironment().classConstructor = factory.cloneNode(temp);
+            }
             var classExpression = factory.updateClassExpression(node, ts.visitNodes(node.decorators, visitor, ts.isDecorator), node.modifiers, node.name, 
-            /*typeParameters*/ undefined, ts.visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), transformClassMembers(node, isDerivedClass));
-            if (ts.some(staticProperties) || ts.some(pendingExpressions)) {
+            /*typeParameters*/ undefined, ts.visitNodes(node.heritageClauses, heritageClauseVisitor, ts.isHeritageClause), transformClassMembers(node, isDerivedClass));
+            var hasTransformableStatics = ts.some(staticPropertiesOrClassStaticBlocks, function (p) { return ts.isClassStaticBlockDeclaration(p) || !!p.initializer || (shouldTransformPrivateElementsOrClassStaticBlocks && ts.isPrivateIdentifier(p.name)); });
+            if (hasTransformableStatics || ts.some(pendingExpressions)) {
                 if (isDecoratedClassDeclaration) {
                     ts.Debug.assertIsDefined(pendingStatements, "Decorated classes transformed by TypeScript are expected to be within a variable declaration.");
                     // Write any pending expressions from elided or moved computed property names
                     if (pendingStatements && pendingExpressions && ts.some(pendingExpressions)) {
                         pendingStatements.push(factory.createExpressionStatement(factory.inlineExpressions(pendingExpressions)));
                     }
-                    if (pendingStatements && ts.some(staticProperties)) {
-                        addPropertyStatements(pendingStatements, staticProperties, factory.getInternalName(node));
+                    if (pendingStatements && ts.some(staticPropertiesOrClassStaticBlocks)) {
+                        addPropertyOrClassStaticBlockStatements(pendingStatements, staticPropertiesOrClassStaticBlocks, factory.getInternalName(node));
+                    }
+                    if (temp) {
+                        return factory.inlineExpressions([factory.createAssignment(temp, classExpression), temp]);
                     }
                     return classExpression;
                 }
                 else {
                     var expressions = [];
-                    var isClassWithConstructorReference = resolver.getNodeCheckFlags(node) & 16777216 /* ClassWithConstructorReference */;
-                    var temp = factory.createTempVariable(hoistVariableDeclaration, !!isClassWithConstructorReference);
+                    temp || (temp = createClassTempVar());
                     if (isClassWithConstructorReference) {
                         // record an alias as the class name is not in scope for statics.
                         enableSubstitutionForClassAliases();
@@ -86304,22 +92473,32 @@ var ts;
                     expressions.push(ts.startOnNewLine(factory.createAssignment(temp, classExpression)));
                     // Add any pending expressions leftover from elided or relocated computed property names
                     ts.addRange(expressions, ts.map(pendingExpressions, ts.startOnNewLine));
-                    ts.addRange(expressions, generateInitializedPropertyExpressions(staticProperties, temp));
+                    ts.addRange(expressions, generateInitializedPropertyExpressionsOrClassStaticBlock(staticPropertiesOrClassStaticBlocks, temp));
                     expressions.push(ts.startOnNewLine(temp));
                     return factory.inlineExpressions(expressions);
                 }
             }
             return classExpression;
         }
+        function visitClassStaticBlockDeclaration(node) {
+            if (!shouldTransformPrivateElementsOrClassStaticBlocks) {
+                return ts.visitEachChild(node, classElementVisitor, context);
+            }
+            // ClassStaticBlockDeclaration for classes are transformed in `visitClassDeclaration` or `visitClassExpression`.
+            return undefined;
+        }
         function transformClassMembers(node, isDerivedClass) {
-            if (shouldTransformPrivateFields) {
+            if (shouldTransformPrivateElementsOrClassStaticBlocks) {
                 // Declare private names.
                 for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
                     var member = _a[_i];
-                    if (ts.isPrivateIdentifierPropertyDeclaration(member)) {
-                        addPrivateIdentifierToEnvironment(member.name);
+                    if (ts.isPrivateIdentifierClassElementDeclaration(member)) {
+                        addPrivateIdentifierToEnvironment(member);
                     }
                 }
+                if (ts.some(getPrivateInstanceMethodsAndAccessors(node))) {
+                    createBrandCheckWeakSetForPrivateMethods();
+                }
             }
             var members = [];
             var constructor = transformConstructor(node, isDerivedClass);
@@ -86329,21 +92508,27 @@ var ts;
             ts.addRange(members, ts.visitNodes(node.members, classElementVisitor, ts.isClassElement));
             return ts.setTextRange(factory.createNodeArray(members), /*location*/ node.members);
         }
-        function isPropertyDeclarationThatRequiresConstructorStatement(member) {
-            if (!ts.isPropertyDeclaration(member) || ts.hasStaticModifier(member) || ts.hasSyntacticModifier(ts.getOriginalNode(member), 128 /* Abstract */)) {
+        function createBrandCheckWeakSetForPrivateMethods() {
+            var weakSetName = getPrivateIdentifierEnvironment().weakSetName;
+            ts.Debug.assert(weakSetName, "weakSetName should be set in private identifier environment");
+            getPendingExpressions().push(factory.createAssignment(weakSetName, factory.createNewExpression(factory.createIdentifier("WeakSet"), 
+            /*typeArguments*/ undefined, [])));
+        }
+        function isClassElementThatRequiresConstructorStatement(member) {
+            if (ts.isStatic(member) || ts.hasSyntacticModifier(ts.getOriginalNode(member), 128 /* Abstract */)) {
                 return false;
             }
-            if (context.getCompilerOptions().useDefineForClassFields) {
+            if (useDefineForClassFields) {
                 // If we are using define semantics and targeting ESNext or higher,
                 // then we don't need to transform any class properties.
                 return languageVersion < 99 /* ESNext */;
             }
-            return ts.isInitializedProperty(member) || shouldTransformPrivateFields && ts.isPrivateIdentifierPropertyDeclaration(member);
+            return ts.isInitializedProperty(member) || shouldTransformPrivateElementsOrClassStaticBlocks && ts.isPrivateIdentifierClassElementDeclaration(member);
         }
         function transformConstructor(node, isDerivedClass) {
             var constructor = ts.visitNode(ts.getFirstConstructorWithBody(node), visitor, ts.isConstructorDeclaration);
-            var properties = node.members.filter(isPropertyDeclarationThatRequiresConstructorStatement);
-            if (!ts.some(properties)) {
+            var elements = node.members.filter(isClassElementThatRequiresConstructorStatement);
+            if (!ts.some(elements)) {
                 return constructor;
             }
             var parameters = ts.visitParameterList(constructor ? constructor.parameters : undefined, visitor, context);
@@ -86356,13 +92541,14 @@ var ts;
             /*modifiers*/ undefined, parameters !== null && parameters !== void 0 ? parameters : [], body), constructor || node), constructor));
         }
         function transformConstructorBody(node, constructor, isDerivedClass) {
-            var useDefineForClassFields = context.getCompilerOptions().useDefineForClassFields;
             var properties = ts.getProperties(node, /*requireInitializer*/ false, /*isStatic*/ false);
             if (!useDefineForClassFields) {
                 properties = ts.filter(properties, function (property) { return !!property.initializer || ts.isPrivateIdentifier(property.name); });
             }
+            var privateMethodsAndAccessors = getPrivateInstanceMethodsAndAccessors(node);
+            var needsConstructorBody = ts.some(properties) || ts.some(privateMethodsAndAccessors);
             // Only generate synthetic constructor when there are property initializers to move.
-            if (!constructor && !ts.some(properties)) {
+            if (!constructor && !needsConstructorBody) {
                 return ts.visitFunctionBody(/*node*/ undefined, visitor, context);
             }
             resumeLexicalEnvironment();
@@ -86401,7 +92587,10 @@ var ts;
                     indexOfFirstStatement = afterParameterProperties;
                 }
             }
-            addPropertyStatements(statements, properties, factory.createThis());
+            var receiver = factory.createThis();
+            // private methods can be called in property initializers, they should execute first.
+            addMethodStatements(statements, privateMethodsAndAccessors, receiver);
+            addPropertyOrClassStaticBlockStatements(statements, properties, receiver);
             // Add existing statements, skipping the initial super call.
             if (constructor) {
                 ts.addRange(statements, ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, indexOfFirstStatement));
@@ -86418,10 +92607,12 @@ var ts;
          * @param properties An array of property declarations to transform.
          * @param receiver The receiver on which each property should be assigned.
          */
-        function addPropertyStatements(statements, properties, receiver) {
+        function addPropertyOrClassStaticBlockStatements(statements, properties, receiver) {
             for (var _i = 0, properties_7 = properties; _i < properties_7.length; _i++) {
                 var property = properties_7[_i];
-                var expression = transformProperty(property, receiver);
+                var expression = ts.isClassStaticBlockDeclaration(property) ?
+                    transformClassStaticBlockDeclaration(property) :
+                    transformProperty(property, receiver);
                 if (!expression) {
                     continue;
                 }
@@ -86435,14 +92626,14 @@ var ts;
         /**
          * Generates assignment expressions for property initializers.
          *
-         * @param properties An array of property declarations to transform.
+         * @param propertiesOrClassStaticBlocks An array of property declarations to transform.
          * @param receiver The receiver on which each property should be assigned.
          */
-        function generateInitializedPropertyExpressions(properties, receiver) {
+        function generateInitializedPropertyExpressionsOrClassStaticBlock(propertiesOrClassStaticBlocks, receiver) {
             var expressions = [];
-            for (var _i = 0, properties_8 = properties; _i < properties_8.length; _i++) {
-                var property = properties_8[_i];
-                var expression = transformProperty(property, receiver);
+            for (var _i = 0, propertiesOrClassStaticBlocks_1 = propertiesOrClassStaticBlocks; _i < propertiesOrClassStaticBlocks_1.length; _i++) {
+                var property = propertiesOrClassStaticBlocks_1[_i];
+                var expression = ts.isClassStaticBlockDeclaration(property) ? transformClassStaticBlockDeclaration(property) : transformProperty(property, receiver);
                 if (!expression) {
                     continue;
                 }
@@ -86461,29 +92652,47 @@ var ts;
          * @param receiver The object receiving the property assignment.
          */
         function transformProperty(property, receiver) {
+            var savedCurrentStaticPropertyDeclarationOrStaticBlock = currentStaticPropertyDeclarationOrStaticBlock;
+            var transformed = transformPropertyWorker(property, receiver);
+            if (transformed && ts.hasStaticModifier(property) && (currentClassLexicalEnvironment === null || currentClassLexicalEnvironment === void 0 ? void 0 : currentClassLexicalEnvironment.facts)) {
+                // capture the lexical environment for the member
+                ts.setOriginalNode(transformed, property);
+                ts.addEmitFlags(transformed, 2 /* AdviseOnEmitNode */);
+                classLexicalEnvironmentMap.set(ts.getOriginalNodeId(transformed), currentClassLexicalEnvironment);
+            }
+            currentStaticPropertyDeclarationOrStaticBlock = savedCurrentStaticPropertyDeclarationOrStaticBlock;
+            return transformed;
+        }
+        function transformPropertyWorker(property, receiver) {
             var _a;
             // We generate a name here in order to reuse the value cached by the relocated computed name expression (which uses the same generated name)
-            var emitAssignment = !context.getCompilerOptions().useDefineForClassFields;
+            var emitAssignment = !useDefineForClassFields;
             var propertyName = ts.isComputedPropertyName(property.name) && !ts.isSimpleInlineableExpression(property.name.expression)
                 ? factory.updateComputedPropertyName(property.name, factory.getGeneratedNameForNode(property.name))
                 : property.name;
-            if (shouldTransformPrivateFields && ts.isPrivateIdentifier(propertyName)) {
+            if (ts.hasStaticModifier(property)) {
+                currentStaticPropertyDeclarationOrStaticBlock = property;
+            }
+            if (shouldTransformPrivateElementsOrClassStaticBlocks && ts.isPrivateIdentifier(propertyName)) {
                 var privateIdentifierInfo = accessPrivateIdentifier(propertyName);
                 if (privateIdentifierInfo) {
-                    switch (privateIdentifierInfo.placement) {
-                        case 0 /* InstanceField */: {
-                            return createPrivateInstanceFieldInitializer(receiver, ts.visitNode(property.initializer, visitor, ts.isExpression), privateIdentifierInfo.weakMapName);
+                    if (privateIdentifierInfo.kind === "f" /* Field */) {
+                        if (!privateIdentifierInfo.isStatic) {
+                            return createPrivateInstanceFieldInitializer(receiver, ts.visitNode(property.initializer, visitor, ts.isExpression), privateIdentifierInfo.brandCheckIdentifier);
                         }
+                        else {
+                            return createPrivateStaticFieldInitializer(privateIdentifierInfo.variableName, ts.visitNode(property.initializer, visitor, ts.isExpression));
+                        }
+                    }
+                    else {
+                        return undefined;
                     }
                 }
                 else {
                     ts.Debug.fail("Undeclared private name for property declaration.");
                 }
             }
-            if (ts.isPrivateIdentifier(propertyName) && !property.initializer) {
-                return undefined;
-            }
-            if (ts.isPrivateIdentifier(propertyName) && !property.initializer) {
+            if ((ts.isPrivateIdentifier(propertyName) || ts.hasStaticModifier(property)) && !property.initializer) {
                 return undefined;
             }
             var propertyOriginalNode = ts.getOriginalNode(property);
@@ -86510,11 +92719,108 @@ var ts;
                 enabledSubstitutions |= 1 /* ClassAliases */;
                 // We need to enable substitutions for identifiers. This allows us to
                 // substitute class names inside of a class declaration.
-                context.enableSubstitution(78 /* Identifier */);
+                context.enableSubstitution(79 /* Identifier */);
                 // Keep track of class aliases.
                 classAliases = [];
             }
         }
+        function enableSubstitutionForClassStaticThisOrSuperReference() {
+            if ((enabledSubstitutions & 2 /* ClassStaticThisOrSuperReference */) === 0) {
+                enabledSubstitutions |= 2 /* ClassStaticThisOrSuperReference */;
+                // substitute `this` in a static field initializer
+                context.enableSubstitution(108 /* ThisKeyword */);
+                // these push a new lexical environment that is not the class lexical environment
+                context.enableEmitNotification(255 /* FunctionDeclaration */);
+                context.enableEmitNotification(212 /* FunctionExpression */);
+                context.enableEmitNotification(170 /* Constructor */);
+                // these push a new lexical environment that is not the class lexical environment, except
+                // when they have a computed property name
+                context.enableEmitNotification(171 /* GetAccessor */);
+                context.enableEmitNotification(172 /* SetAccessor */);
+                context.enableEmitNotification(168 /* MethodDeclaration */);
+                context.enableEmitNotification(166 /* PropertyDeclaration */);
+                // class lexical environments are restored when entering a computed property name
+                context.enableEmitNotification(161 /* ComputedPropertyName */);
+            }
+        }
+        /**
+         * Generates brand-check initializer for private methods.
+         *
+         * @param statements Statement list that should be used to append new statements.
+         * @param methods An array of method declarations.
+         * @param receiver The receiver on which each method should be assigned.
+         */
+        function addMethodStatements(statements, methods, receiver) {
+            if (!shouldTransformPrivateElementsOrClassStaticBlocks || !ts.some(methods)) {
+                return;
+            }
+            var weakSetName = getPrivateIdentifierEnvironment().weakSetName;
+            ts.Debug.assert(weakSetName, "weakSetName should be set in private identifier environment");
+            statements.push(factory.createExpressionStatement(createPrivateInstanceMethodInitializer(receiver, weakSetName)));
+        }
+        function visitInvalidSuperProperty(node) {
+            return ts.isPropertyAccessExpression(node) ?
+                factory.updatePropertyAccessExpression(node, factory.createVoidZero(), node.name) :
+                factory.updateElementAccessExpression(node, factory.createVoidZero(), ts.visitNode(node.argumentExpression, visitor, ts.isExpression));
+        }
+        function onEmitNode(hint, node, emitCallback) {
+            var original = ts.getOriginalNode(node);
+            if (original.id) {
+                var classLexicalEnvironment = classLexicalEnvironmentMap.get(original.id);
+                if (classLexicalEnvironment) {
+                    var savedClassLexicalEnvironment = currentClassLexicalEnvironment;
+                    var savedCurrentComputedPropertyNameClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment;
+                    currentClassLexicalEnvironment = classLexicalEnvironment;
+                    currentComputedPropertyNameClassLexicalEnvironment = classLexicalEnvironment;
+                    previousOnEmitNode(hint, node, emitCallback);
+                    currentClassLexicalEnvironment = savedClassLexicalEnvironment;
+                    currentComputedPropertyNameClassLexicalEnvironment = savedCurrentComputedPropertyNameClassLexicalEnvironment;
+                    return;
+                }
+            }
+            switch (node.kind) {
+                case 212 /* FunctionExpression */:
+                    if (ts.isArrowFunction(original) || ts.getEmitFlags(node) & 262144 /* AsyncFunctionBody */) {
+                        break;
+                    }
+                // falls through
+                case 255 /* FunctionDeclaration */:
+                case 170 /* Constructor */: {
+                    var savedClassLexicalEnvironment = currentClassLexicalEnvironment;
+                    var savedCurrentComputedPropertyNameClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment;
+                    currentClassLexicalEnvironment = undefined;
+                    currentComputedPropertyNameClassLexicalEnvironment = undefined;
+                    previousOnEmitNode(hint, node, emitCallback);
+                    currentClassLexicalEnvironment = savedClassLexicalEnvironment;
+                    currentComputedPropertyNameClassLexicalEnvironment = savedCurrentComputedPropertyNameClassLexicalEnvironment;
+                    return;
+                }
+                case 171 /* GetAccessor */:
+                case 172 /* SetAccessor */:
+                case 168 /* MethodDeclaration */:
+                case 166 /* PropertyDeclaration */: {
+                    var savedClassLexicalEnvironment = currentClassLexicalEnvironment;
+                    var savedCurrentComputedPropertyNameClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment;
+                    currentComputedPropertyNameClassLexicalEnvironment = currentClassLexicalEnvironment;
+                    currentClassLexicalEnvironment = undefined;
+                    previousOnEmitNode(hint, node, emitCallback);
+                    currentClassLexicalEnvironment = savedClassLexicalEnvironment;
+                    currentComputedPropertyNameClassLexicalEnvironment = savedCurrentComputedPropertyNameClassLexicalEnvironment;
+                    return;
+                }
+                case 161 /* ComputedPropertyName */: {
+                    var savedClassLexicalEnvironment = currentClassLexicalEnvironment;
+                    var savedCurrentComputedPropertyNameClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment;
+                    currentClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment;
+                    currentComputedPropertyNameClassLexicalEnvironment = undefined;
+                    previousOnEmitNode(hint, node, emitCallback);
+                    currentClassLexicalEnvironment = savedClassLexicalEnvironment;
+                    currentComputedPropertyNameClassLexicalEnvironment = savedCurrentComputedPropertyNameClassLexicalEnvironment;
+                    return;
+                }
+            }
+            previousOnEmitNode(hint, node, emitCallback);
+        }
         /**
          * Hooks node substitutions.
          *
@@ -86530,8 +92836,22 @@ var ts;
         }
         function substituteExpression(node) {
             switch (node.kind) {
-                case 78 /* Identifier */:
+                case 79 /* Identifier */:
                     return substituteExpressionIdentifier(node);
+                case 108 /* ThisKeyword */:
+                    return substituteThisExpression(node);
+            }
+            return node;
+        }
+        function substituteThisExpression(node) {
+            if (enabledSubstitutions & 2 /* ClassStaticThisOrSuperReference */ && currentClassLexicalEnvironment) {
+                var facts = currentClassLexicalEnvironment.facts, classConstructor = currentClassLexicalEnvironment.classConstructor;
+                if (facts & 1 /* ClassWasDecorated */) {
+                    return factory.createParenthesizedExpression(factory.createVoidZero());
+                }
+                if (classConstructor) {
+                    return ts.setTextRange(ts.setOriginalNode(factory.cloneNode(classConstructor), node), node);
+                }
             }
             return node;
         }
@@ -86550,10 +92870,10 @@ var ts;
                     if (declaration) {
                         var classAlias = classAliases[declaration.id]; // TODO: GH#18217
                         if (classAlias) {
-                            var clone_2 = factory.cloneNode(classAlias);
-                            ts.setSourceMapRange(clone_2, node);
-                            ts.setCommentRange(clone_2, node);
-                            return clone_2;
+                            var clone_3 = factory.cloneNode(classAlias);
+                            ts.setSourceMapRange(clone_3, node);
+                            ts.setCommentRange(clone_3, node);
+                            return clone_3;
                         }
                     }
                 }
@@ -86573,46 +92893,203 @@ var ts;
                 var alreadyTransformed = ts.isAssignmentExpression(innerExpression) && ts.isGeneratedIdentifier(innerExpression.left);
                 if (!alreadyTransformed && !inlinable && shouldHoist) {
                     var generatedName = factory.getGeneratedNameForNode(name);
-                    hoistVariableDeclaration(generatedName);
+                    if (resolver.getNodeCheckFlags(name) & 524288 /* BlockScopedBindingInLoop */) {
+                        addBlockScopedVariable(generatedName);
+                    }
+                    else {
+                        hoistVariableDeclaration(generatedName);
+                    }
                     return factory.createAssignment(generatedName, expression);
                 }
                 return (inlinable || ts.isIdentifier(innerExpression)) ? undefined : expression;
             }
         }
-        function startPrivateIdentifierEnvironment() {
-            privateIdentifierEnvironmentStack.push(currentPrivateIdentifierEnvironment);
-            currentPrivateIdentifierEnvironment = undefined;
+        function startClassLexicalEnvironment() {
+            classLexicalEnvironmentStack.push(currentClassLexicalEnvironment);
+            currentClassLexicalEnvironment = undefined;
+        }
+        function endClassLexicalEnvironment() {
+            currentClassLexicalEnvironment = classLexicalEnvironmentStack.pop();
         }
-        function endPrivateIdentifierEnvironment() {
-            currentPrivateIdentifierEnvironment = privateIdentifierEnvironmentStack.pop();
+        function getClassLexicalEnvironment() {
+            return currentClassLexicalEnvironment || (currentClassLexicalEnvironment = {
+                facts: 0 /* None */,
+                classConstructor: undefined,
+                superClassReference: undefined,
+                privateIdentifierEnvironment: undefined,
+            });
         }
         function getPrivateIdentifierEnvironment() {
-            return currentPrivateIdentifierEnvironment || (currentPrivateIdentifierEnvironment = new ts.Map());
+            var lex = getClassLexicalEnvironment();
+            lex.privateIdentifierEnvironment || (lex.privateIdentifierEnvironment = {
+                className: "",
+                identifiers: new ts.Map()
+            });
+            return lex.privateIdentifierEnvironment;
         }
         function getPendingExpressions() {
             return pendingExpressions || (pendingExpressions = []);
         }
-        function addPrivateIdentifierToEnvironment(name) {
-            var text = ts.getTextOfPropertyName(name);
-            var weakMapName = factory.createUniqueName("_" + text.substring(1), 16 /* Optimistic */ | 8 /* ReservedInNestedScopes */);
-            hoistVariableDeclaration(weakMapName);
-            getPrivateIdentifierEnvironment().set(name.escapedText, { placement: 0 /* InstanceField */, weakMapName: weakMapName });
-            getPendingExpressions().push(factory.createAssignment(weakMapName, factory.createNewExpression(factory.createIdentifier("WeakMap"), 
-            /*typeArguments*/ undefined, [])));
+        function addPrivateIdentifierToEnvironment(node) {
+            var _a;
+            var text = ts.getTextOfPropertyName(node.name);
+            var lex = getClassLexicalEnvironment();
+            var classConstructor = lex.classConstructor;
+            var privateEnv = getPrivateIdentifierEnvironment();
+            var weakSetName = privateEnv.weakSetName;
+            var assignmentExpressions = [];
+            var privateName = node.name.escapedText;
+            var previousInfo = privateEnv.identifiers.get(privateName);
+            var isValid = !isReservedPrivateName(node.name) && previousInfo === undefined;
+            if (ts.hasStaticModifier(node)) {
+                ts.Debug.assert(classConstructor, "weakSetName should be set in private identifier environment");
+                if (ts.isPropertyDeclaration(node)) {
+                    var variableName = createHoistedVariableForPrivateName(text, node);
+                    privateEnv.identifiers.set(privateName, {
+                        kind: "f" /* Field */,
+                        variableName: variableName,
+                        brandCheckIdentifier: classConstructor,
+                        isStatic: true,
+                        isValid: isValid,
+                    });
+                }
+                else if (ts.isMethodDeclaration(node)) {
+                    var functionName = createHoistedVariableForPrivateName(text, node);
+                    privateEnv.identifiers.set(privateName, {
+                        kind: "m" /* Method */,
+                        methodName: functionName,
+                        brandCheckIdentifier: classConstructor,
+                        isStatic: true,
+                        isValid: isValid,
+                    });
+                }
+                else if (ts.isGetAccessorDeclaration(node)) {
+                    var getterName = createHoistedVariableForPrivateName(text + "_get", node);
+                    if ((previousInfo === null || previousInfo === void 0 ? void 0 : previousInfo.kind) === "a" /* Accessor */ && previousInfo.isStatic && !previousInfo.getterName) {
+                        previousInfo.getterName = getterName;
+                    }
+                    else {
+                        privateEnv.identifiers.set(privateName, {
+                            kind: "a" /* Accessor */,
+                            getterName: getterName,
+                            setterName: undefined,
+                            brandCheckIdentifier: classConstructor,
+                            isStatic: true,
+                            isValid: isValid,
+                        });
+                    }
+                }
+                else if (ts.isSetAccessorDeclaration(node)) {
+                    var setterName = createHoistedVariableForPrivateName(text + "_set", node);
+                    if ((previousInfo === null || previousInfo === void 0 ? void 0 : previousInfo.kind) === "a" /* Accessor */ && previousInfo.isStatic && !previousInfo.setterName) {
+                        previousInfo.setterName = setterName;
+                    }
+                    else {
+                        privateEnv.identifiers.set(privateName, {
+                            kind: "a" /* Accessor */,
+                            getterName: undefined,
+                            setterName: setterName,
+                            brandCheckIdentifier: classConstructor,
+                            isStatic: true,
+                            isValid: isValid,
+                        });
+                    }
+                }
+                else {
+                    ts.Debug.assertNever(node, "Unknown class element type.");
+                }
+            }
+            else if (ts.isPropertyDeclaration(node)) {
+                var weakMapName = createHoistedVariableForPrivateName(text, node);
+                privateEnv.identifiers.set(privateName, {
+                    kind: "f" /* Field */,
+                    brandCheckIdentifier: weakMapName,
+                    isStatic: false,
+                    variableName: undefined,
+                    isValid: isValid,
+                });
+                assignmentExpressions.push(factory.createAssignment(weakMapName, factory.createNewExpression(factory.createIdentifier("WeakMap"), 
+                /*typeArguments*/ undefined, [])));
+            }
+            else if (ts.isMethodDeclaration(node)) {
+                ts.Debug.assert(weakSetName, "weakSetName should be set in private identifier environment");
+                privateEnv.identifiers.set(privateName, {
+                    kind: "m" /* Method */,
+                    methodName: createHoistedVariableForPrivateName(text, node),
+                    brandCheckIdentifier: weakSetName,
+                    isStatic: false,
+                    isValid: isValid,
+                });
+            }
+            else if (ts.isAccessor(node)) {
+                ts.Debug.assert(weakSetName, "weakSetName should be set in private identifier environment");
+                if (ts.isGetAccessor(node)) {
+                    var getterName = createHoistedVariableForPrivateName(text + "_get", node);
+                    if ((previousInfo === null || previousInfo === void 0 ? void 0 : previousInfo.kind) === "a" /* Accessor */ && !previousInfo.isStatic && !previousInfo.getterName) {
+                        previousInfo.getterName = getterName;
+                    }
+                    else {
+                        privateEnv.identifiers.set(privateName, {
+                            kind: "a" /* Accessor */,
+                            getterName: getterName,
+                            setterName: undefined,
+                            brandCheckIdentifier: weakSetName,
+                            isStatic: false,
+                            isValid: isValid,
+                        });
+                    }
+                }
+                else {
+                    var setterName = createHoistedVariableForPrivateName(text + "_set", node);
+                    if ((previousInfo === null || previousInfo === void 0 ? void 0 : previousInfo.kind) === "a" /* Accessor */ && !previousInfo.isStatic && !previousInfo.setterName) {
+                        previousInfo.setterName = setterName;
+                    }
+                    else {
+                        privateEnv.identifiers.set(privateName, {
+                            kind: "a" /* Accessor */,
+                            getterName: undefined,
+                            setterName: setterName,
+                            brandCheckIdentifier: weakSetName,
+                            isStatic: false,
+                            isValid: isValid,
+                        });
+                    }
+                }
+            }
+            else {
+                ts.Debug.assertNever(node, "Unknown class element type.");
+            }
+            (_a = getPendingExpressions()).push.apply(_a, assignmentExpressions);
+        }
+        function createHoistedVariableForClass(name, node) {
+            var className = getPrivateIdentifierEnvironment().className;
+            var prefix = className ? "_".concat(className) : "";
+            var identifier = factory.createUniqueName("".concat(prefix, "_").concat(name), 16 /* Optimistic */);
+            if (resolver.getNodeCheckFlags(node) & 524288 /* BlockScopedBindingInLoop */) {
+                addBlockScopedVariable(identifier);
+            }
+            else {
+                hoistVariableDeclaration(identifier);
+            }
+            return identifier;
+        }
+        function createHoistedVariableForPrivateName(privateName, node) {
+            return createHoistedVariableForClass(privateName.substring(1), node.name);
         }
         function accessPrivateIdentifier(name) {
-            if (currentPrivateIdentifierEnvironment) {
-                var info = currentPrivateIdentifierEnvironment.get(name.escapedText);
+            var _a;
+            if (currentClassLexicalEnvironment === null || currentClassLexicalEnvironment === void 0 ? void 0 : currentClassLexicalEnvironment.privateIdentifierEnvironment) {
+                var info = currentClassLexicalEnvironment.privateIdentifierEnvironment.identifiers.get(name.escapedText);
                 if (info) {
                     return info;
                 }
             }
-            for (var i = privateIdentifierEnvironmentStack.length - 1; i >= 0; --i) {
-                var env = privateIdentifierEnvironmentStack[i];
+            for (var i = classLexicalEnvironmentStack.length - 1; i >= 0; --i) {
+                var env = classLexicalEnvironmentStack[i];
                 if (!env) {
                     continue;
                 }
-                var info = env.get(name.escapedText);
+                var info = (_a = env.privateIdentifierEnvironment) === null || _a === void 0 ? void 0 : _a.identifiers.get(name.escapedText);
                 if (info) {
                     return info;
                 }
@@ -86630,53 +93107,93 @@ var ts;
             // differently inside the function.
             if (ts.isThisProperty(node) || ts.isSuperProperty(node) || !ts.isSimpleCopiableExpression(node.expression)) {
                 receiver = factory.createTempVariable(hoistVariableDeclaration, /*reservedInNestedScopes*/ true);
-                getPendingExpressions().push(factory.createBinaryExpression(receiver, 62 /* EqualsToken */, node.expression));
+                getPendingExpressions().push(factory.createBinaryExpression(receiver, 63 /* EqualsToken */, ts.visitNode(node.expression, visitor, ts.isExpression)));
             }
-            return factory.createPropertyAccessExpression(
-            // Explicit parens required because of v8 regression (https://bugs.chromium.org/p/v8/issues/detail?id=9560)
-            factory.createParenthesizedExpression(factory.createObjectLiteralExpression([
-                factory.createSetAccessorDeclaration(
-                /*decorators*/ undefined, 
-                /*modifiers*/ undefined, "value", [factory.createParameterDeclaration(
-                    /*decorators*/ undefined, 
-                    /*modifiers*/ undefined, 
-                    /*dotDotDotToken*/ undefined, parameter, 
-                    /*questionToken*/ undefined, 
-                    /*type*/ undefined, 
-                    /*initializer*/ undefined)], factory.createBlock([factory.createExpressionStatement(createPrivateIdentifierAssignment(info, receiver, parameter, 62 /* EqualsToken */))]))
-            ])), "value");
+            return factory.createAssignmentTargetWrapper(parameter, createPrivateIdentifierAssignment(info, receiver, parameter, 63 /* EqualsToken */));
         }
         function visitArrayAssignmentTarget(node) {
             var target = ts.getTargetOfBindingOrAssignmentElement(node);
-            if (target && ts.isPrivateIdentifierPropertyAccessExpression(target)) {
-                var wrapped = wrapPrivateIdentifierForDestructuringTarget(target);
-                if (ts.isAssignmentExpression(node)) {
-                    return factory.updateBinaryExpression(node, wrapped, node.operatorToken, ts.visitNode(node.right, visitor, ts.isExpression));
-                }
-                else if (ts.isSpreadElement(node)) {
-                    return factory.updateSpreadElement(node, wrapped);
+            if (target) {
+                var wrapped = void 0;
+                if (ts.isPrivateIdentifierPropertyAccessExpression(target)) {
+                    wrapped = wrapPrivateIdentifierForDestructuringTarget(target);
+                }
+                else if (shouldTransformSuperInStaticInitializers &&
+                    ts.isSuperProperty(target) &&
+                    currentStaticPropertyDeclarationOrStaticBlock &&
+                    currentClassLexicalEnvironment) {
+                    var classConstructor = currentClassLexicalEnvironment.classConstructor, superClassReference = currentClassLexicalEnvironment.superClassReference, facts = currentClassLexicalEnvironment.facts;
+                    if (facts & 1 /* ClassWasDecorated */) {
+                        wrapped = visitInvalidSuperProperty(target);
+                    }
+                    else if (classConstructor && superClassReference) {
+                        var name = ts.isElementAccessExpression(target) ? ts.visitNode(target.argumentExpression, visitor, ts.isExpression) :
+                            ts.isIdentifier(target.name) ? factory.createStringLiteralFromNode(target.name) :
+                                undefined;
+                        if (name) {
+                            var temp = factory.createTempVariable(/*recordTempVariable*/ undefined);
+                            wrapped = factory.createAssignmentTargetWrapper(temp, factory.createReflectSetCall(superClassReference, name, temp, classConstructor));
+                        }
+                    }
                 }
-                else {
-                    return wrapped;
+                if (wrapped) {
+                    if (ts.isAssignmentExpression(node)) {
+                        return factory.updateBinaryExpression(node, wrapped, node.operatorToken, ts.visitNode(node.right, visitor, ts.isExpression));
+                    }
+                    else if (ts.isSpreadElement(node)) {
+                        return factory.updateSpreadElement(node, wrapped);
+                    }
+                    else {
+                        return wrapped;
+                    }
                 }
             }
             return ts.visitNode(node, visitorDestructuringTarget);
         }
         function visitObjectAssignmentTarget(node) {
-            if (ts.isPropertyAssignment(node)) {
+            if (ts.isObjectBindingOrAssignmentElement(node) && !ts.isShorthandPropertyAssignment(node)) {
                 var target = ts.getTargetOfBindingOrAssignmentElement(node);
-                if (target && ts.isPrivateIdentifierPropertyAccessExpression(target)) {
+                var wrapped = void 0;
+                if (target) {
+                    if (ts.isPrivateIdentifierPropertyAccessExpression(target)) {
+                        wrapped = wrapPrivateIdentifierForDestructuringTarget(target);
+                    }
+                    else if (shouldTransformSuperInStaticInitializers &&
+                        ts.isSuperProperty(target) &&
+                        currentStaticPropertyDeclarationOrStaticBlock &&
+                        currentClassLexicalEnvironment) {
+                        var classConstructor = currentClassLexicalEnvironment.classConstructor, superClassReference = currentClassLexicalEnvironment.superClassReference, facts = currentClassLexicalEnvironment.facts;
+                        if (facts & 1 /* ClassWasDecorated */) {
+                            wrapped = visitInvalidSuperProperty(target);
+                        }
+                        else if (classConstructor && superClassReference) {
+                            var name = ts.isElementAccessExpression(target) ? ts.visitNode(target.argumentExpression, visitor, ts.isExpression) :
+                                ts.isIdentifier(target.name) ? factory.createStringLiteralFromNode(target.name) :
+                                    undefined;
+                            if (name) {
+                                var temp = factory.createTempVariable(/*recordTempVariable*/ undefined);
+                                wrapped = factory.createAssignmentTargetWrapper(temp, factory.createReflectSetCall(superClassReference, name, temp, classConstructor));
+                            }
+                        }
+                    }
+                }
+                if (ts.isPropertyAssignment(node)) {
                     var initializer = ts.getInitializerOfBindingOrAssignmentElement(node);
-                    var wrapped = wrapPrivateIdentifierForDestructuringTarget(target);
-                    return factory.updatePropertyAssignment(node, ts.visitNode(node.name, visitor), initializer ? factory.createAssignment(wrapped, ts.visitNode(initializer, visitor)) : wrapped);
+                    return factory.updatePropertyAssignment(node, ts.visitNode(node.name, visitor, ts.isPropertyName), wrapped ?
+                        initializer ? factory.createAssignment(wrapped, ts.visitNode(initializer, visitor)) : wrapped :
+                        ts.visitNode(node.initializer, visitorDestructuringTarget, ts.isExpression));
                 }
-                return factory.updatePropertyAssignment(node, ts.visitNode(node.name, visitor), ts.visitNode(node.initializer, visitorDestructuringTarget));
+                if (ts.isSpreadAssignment(node)) {
+                    return factory.updateSpreadAssignment(node, wrapped || ts.visitNode(node.expression, visitorDestructuringTarget, ts.isExpression));
+                }
+                ts.Debug.assert(wrapped === undefined, "Should not have generated a wrapped target");
             }
             return ts.visitNode(node, visitor);
         }
         function visitAssignmentPattern(node) {
             if (ts.isArrayLiteralExpression(node)) {
                 // Transforms private names in destructuring assignment array bindings.
+                // Transforms SuperProperty assignments in destructuring assignment array bindings in static initializers.
                 //
                 // Source:
                 // ([ this.#myProp ] = [ "hello" ]);
@@ -86687,6 +93204,7 @@ var ts;
             }
             else {
                 // Transforms private names in destructuring assignment object bindings.
+                // Transforms SuperProperty assignments in destructuring assignment object bindings in static initializers.
                 //
                 // Source:
                 // ({ stringProperty: this.#myProp } = { stringProperty: "hello" });
@@ -86698,10 +93216,22 @@ var ts;
         }
     }
     ts.transformClassFields = transformClassFields;
+    function createPrivateStaticFieldInitializer(variableName, initializer) {
+        return ts.factory.createAssignment(variableName, ts.factory.createObjectLiteralExpression([
+            ts.factory.createPropertyAssignment("value", initializer || ts.factory.createVoidZero())
+        ]));
+    }
     function createPrivateInstanceFieldInitializer(receiver, initializer, weakMapName) {
         return ts.factory.createCallExpression(ts.factory.createPropertyAccessExpression(weakMapName, "set"), 
         /*typeArguments*/ undefined, [receiver, initializer || ts.factory.createVoidZero()]);
     }
+    function createPrivateInstanceMethodInitializer(receiver, weakSetName) {
+        return ts.factory.createCallExpression(ts.factory.createPropertyAccessExpression(weakSetName, "add"), 
+        /*typeArguments*/ undefined, [receiver]);
+    }
+    function isReservedPrivateName(node) {
+        return node.escapedText === "#constructor";
+    }
 })(ts || (ts = {}));
 /*@internal*/
 var ts;
@@ -86784,38 +93314,38 @@ var ts;
             return ts.visitEachChild(node, visitor, context);
         }
         function visitor(node) {
-            if ((node.transformFlags & 64 /* ContainsES2017 */) === 0) {
+            if ((node.transformFlags & 128 /* ContainsES2017 */) === 0) {
                 return node;
             }
             switch (node.kind) {
-                case 129 /* AsyncKeyword */:
+                case 131 /* AsyncKeyword */:
                     // ES2017 async modifier should be elided for targets < ES2017
                     return undefined;
-                case 213 /* AwaitExpression */:
+                case 217 /* AwaitExpression */:
                     return visitAwaitExpression(node);
-                case 165 /* MethodDeclaration */:
+                case 168 /* MethodDeclaration */:
                     return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitMethodDeclaration, node);
-                case 251 /* FunctionDeclaration */:
+                case 255 /* FunctionDeclaration */:
                     return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionDeclaration, node);
-                case 208 /* FunctionExpression */:
+                case 212 /* FunctionExpression */:
                     return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionExpression, node);
-                case 209 /* ArrowFunction */:
+                case 213 /* ArrowFunction */:
                     return doWithContext(1 /* NonTopLevel */, visitArrowFunction, node);
-                case 201 /* PropertyAccessExpression */:
-                    if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 105 /* SuperKeyword */) {
+                case 205 /* PropertyAccessExpression */:
+                    if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 106 /* SuperKeyword */) {
                         capturedSuperProperties.add(node.name.escapedText);
                     }
                     return ts.visitEachChild(node, visitor, context);
-                case 202 /* ElementAccessExpression */:
-                    if (capturedSuperProperties && node.expression.kind === 105 /* SuperKeyword */) {
+                case 206 /* ElementAccessExpression */:
+                    if (capturedSuperProperties && node.expression.kind === 106 /* SuperKeyword */) {
                         hasSuperElementAccess = true;
                     }
                     return ts.visitEachChild(node, visitor, context);
-                case 167 /* GetAccessor */:
-                case 168 /* SetAccessor */:
-                case 166 /* Constructor */:
-                case 252 /* ClassDeclaration */:
-                case 221 /* ClassExpression */:
+                case 171 /* GetAccessor */:
+                case 172 /* SetAccessor */:
+                case 170 /* Constructor */:
+                case 256 /* ClassDeclaration */:
+                case 225 /* ClassExpression */:
                     return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitDefault, node);
                 default:
                     return ts.visitEachChild(node, visitor, context);
@@ -86824,27 +93354,27 @@ var ts;
         function asyncBodyVisitor(node) {
             if (ts.isNodeWithPossibleHoistedDeclaration(node)) {
                 switch (node.kind) {
-                    case 232 /* VariableStatement */:
+                    case 236 /* VariableStatement */:
                         return visitVariableStatementInAsyncBody(node);
-                    case 237 /* ForStatement */:
+                    case 241 /* ForStatement */:
                         return visitForStatementInAsyncBody(node);
-                    case 238 /* ForInStatement */:
+                    case 242 /* ForInStatement */:
                         return visitForInStatementInAsyncBody(node);
-                    case 239 /* ForOfStatement */:
+                    case 243 /* ForOfStatement */:
                         return visitForOfStatementInAsyncBody(node);
-                    case 287 /* CatchClause */:
+                    case 291 /* CatchClause */:
                         return visitCatchClauseInAsyncBody(node);
-                    case 230 /* Block */:
-                    case 244 /* SwitchStatement */:
-                    case 258 /* CaseBlock */:
-                    case 284 /* CaseClause */:
-                    case 285 /* DefaultClause */:
-                    case 247 /* TryStatement */:
-                    case 235 /* DoStatement */:
-                    case 236 /* WhileStatement */:
-                    case 234 /* IfStatement */:
-                    case 243 /* WithStatement */:
-                    case 245 /* LabeledStatement */:
+                    case 234 /* Block */:
+                    case 248 /* SwitchStatement */:
+                    case 262 /* CaseBlock */:
+                    case 288 /* CaseClause */:
+                    case 289 /* DefaultClause */:
+                    case 251 /* TryStatement */:
+                    case 239 /* DoStatement */:
+                    case 240 /* WhileStatement */:
+                    case 238 /* IfStatement */:
+                    case 247 /* WithStatement */:
+                    case 249 /* LabeledStatement */:
                         return ts.visitEachChild(node, asyncBodyVisitor, context);
                     default:
                         return ts.Debug.assertNever(node, "Unhandled node.");
@@ -86886,18 +93416,18 @@ var ts;
         function visitForInStatementInAsyncBody(node) {
             return factory.updateForInStatement(node, isVariableDeclarationListWithCollidingName(node.initializer)
                 ? visitVariableDeclarationListWithCollidingNames(node.initializer, /*hasReceiver*/ true)
-                : ts.visitNode(node.initializer, visitor, ts.isForInitializer), ts.visitNode(node.expression, visitor, ts.isExpression), ts.visitNode(node.statement, asyncBodyVisitor, ts.isStatement, factory.liftToBlock));
+                : ts.visitNode(node.initializer, visitor, ts.isForInitializer), ts.visitNode(node.expression, visitor, ts.isExpression), ts.visitIterationBody(node.statement, asyncBodyVisitor, context));
         }
         function visitForOfStatementInAsyncBody(node) {
             return factory.updateForOfStatement(node, ts.visitNode(node.awaitModifier, visitor, ts.isToken), isVariableDeclarationListWithCollidingName(node.initializer)
                 ? visitVariableDeclarationListWithCollidingNames(node.initializer, /*hasReceiver*/ true)
-                : ts.visitNode(node.initializer, visitor, ts.isForInitializer), ts.visitNode(node.expression, visitor, ts.isExpression), ts.visitNode(node.statement, asyncBodyVisitor, ts.isStatement, factory.liftToBlock));
+                : ts.visitNode(node.initializer, visitor, ts.isForInitializer), ts.visitNode(node.expression, visitor, ts.isExpression), ts.visitIterationBody(node.statement, asyncBodyVisitor, context));
         }
         function visitForStatementInAsyncBody(node) {
             var initializer = node.initializer; // TODO: GH#18217
             return factory.updateForStatement(node, isVariableDeclarationListWithCollidingName(initializer)
                 ? visitVariableDeclarationListWithCollidingNames(initializer, /*hasReceiver*/ false)
-                : ts.visitNode(node.initializer, visitor, ts.isForInitializer), ts.visitNode(node.condition, visitor, ts.isExpression), ts.visitNode(node.incrementor, visitor, ts.isExpression), ts.visitNode(node.statement, asyncBodyVisitor, ts.isStatement, factory.liftToBlock));
+                : ts.visitNode(node.initializer, visitor, ts.isForInitializer), ts.visitNode(node.condition, visitor, ts.isExpression), ts.visitNode(node.incrementor, visitor, ts.isExpression), ts.visitIterationBody(node.statement, asyncBodyVisitor, context));
         }
         /**
          * Visits an AwaitExpression node.
@@ -87049,7 +93579,7 @@ var ts;
             var original = ts.getOriginalNode(node, ts.isFunctionLike);
             var nodeType = original.type;
             var promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : undefined;
-            var isArrowFunction = node.kind === 209 /* ArrowFunction */;
+            var isArrowFunction = node.kind === 213 /* ArrowFunction */;
             var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192 /* CaptureArguments */) !== 0;
             // An async function is emit as an outer function that calls an inner
             // generator function. To preserve lexical bindings, we pass the current
@@ -87140,17 +93670,17 @@ var ts;
                 enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */;
                 // We need to enable substitutions for call, property access, and element access
                 // if we need to rewrite super calls.
-                context.enableSubstitution(203 /* CallExpression */);
-                context.enableSubstitution(201 /* PropertyAccessExpression */);
-                context.enableSubstitution(202 /* ElementAccessExpression */);
+                context.enableSubstitution(207 /* CallExpression */);
+                context.enableSubstitution(205 /* PropertyAccessExpression */);
+                context.enableSubstitution(206 /* ElementAccessExpression */);
                 // We need to be notified when entering and exiting declarations that bind super.
-                context.enableEmitNotification(252 /* ClassDeclaration */);
-                context.enableEmitNotification(165 /* MethodDeclaration */);
-                context.enableEmitNotification(167 /* GetAccessor */);
-                context.enableEmitNotification(168 /* SetAccessor */);
-                context.enableEmitNotification(166 /* Constructor */);
+                context.enableEmitNotification(256 /* ClassDeclaration */);
+                context.enableEmitNotification(168 /* MethodDeclaration */);
+                context.enableEmitNotification(171 /* GetAccessor */);
+                context.enableEmitNotification(172 /* SetAccessor */);
+                context.enableEmitNotification(170 /* Constructor */);
                 // We need to be notified when entering the generated accessor arrow functions.
-                context.enableEmitNotification(232 /* VariableStatement */);
+                context.enableEmitNotification(236 /* VariableStatement */);
             }
         }
         /**
@@ -87198,23 +93728,23 @@ var ts;
         }
         function substituteExpression(node) {
             switch (node.kind) {
-                case 201 /* PropertyAccessExpression */:
+                case 205 /* PropertyAccessExpression */:
                     return substitutePropertyAccessExpression(node);
-                case 202 /* ElementAccessExpression */:
+                case 206 /* ElementAccessExpression */:
                     return substituteElementAccessExpression(node);
-                case 203 /* CallExpression */:
+                case 207 /* CallExpression */:
                     return substituteCallExpression(node);
             }
             return node;
         }
         function substitutePropertyAccessExpression(node) {
-            if (node.expression.kind === 105 /* SuperKeyword */) {
+            if (node.expression.kind === 106 /* SuperKeyword */) {
                 return ts.setTextRange(factory.createPropertyAccessExpression(factory.createUniqueName("_super", 16 /* Optimistic */ | 32 /* FileLevel */), node.name), node);
             }
             return node;
         }
         function substituteElementAccessExpression(node) {
-            if (node.expression.kind === 105 /* SuperKeyword */) {
+            if (node.expression.kind === 106 /* SuperKeyword */) {
                 return createSuperElementAccessInAsyncMethod(node.argumentExpression, node);
             }
             return node;
@@ -87228,17 +93758,17 @@ var ts;
                 return factory.createCallExpression(factory.createPropertyAccessExpression(argumentExpression, "call"), 
                 /*typeArguments*/ undefined, __spreadArray([
                     factory.createThis()
-                ], node.arguments));
+                ], node.arguments, true));
             }
             return node;
         }
         function isSuperContainer(node) {
             var kind = node.kind;
-            return kind === 252 /* ClassDeclaration */
-                || kind === 166 /* Constructor */
-                || kind === 165 /* MethodDeclaration */
-                || kind === 167 /* GetAccessor */
-                || kind === 168 /* SetAccessor */;
+            return kind === 256 /* ClassDeclaration */
+                || kind === 170 /* Constructor */
+                || kind === 168 /* MethodDeclaration */
+                || kind === 171 /* GetAccessor */
+                || kind === 172 /* SetAccessor */;
         }
         function createSuperElementAccessInAsyncMethod(argumentExpression, location) {
             if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) {
@@ -87395,7 +93925,7 @@ var ts;
             return visitorWorker(node, /*expressionResultIsUnused*/ true);
         }
         function visitorNoAsyncModifier(node) {
-            if (node.kind === 129 /* AsyncKeyword */) {
+            if (node.kind === 131 /* AsyncKeyword */) {
                 return undefined;
             }
             return node;
@@ -87417,74 +93947,74 @@ var ts;
          * expression of an `ExpressionStatement`).
          */
         function visitorWorker(node, expressionResultIsUnused) {
-            if ((node.transformFlags & 32 /* ContainsES2018 */) === 0) {
+            if ((node.transformFlags & 64 /* ContainsES2018 */) === 0) {
                 return node;
             }
             switch (node.kind) {
-                case 213 /* AwaitExpression */:
+                case 217 /* AwaitExpression */:
                     return visitAwaitExpression(node);
-                case 219 /* YieldExpression */:
+                case 223 /* YieldExpression */:
                     return visitYieldExpression(node);
-                case 242 /* ReturnStatement */:
+                case 246 /* ReturnStatement */:
                     return visitReturnStatement(node);
-                case 245 /* LabeledStatement */:
+                case 249 /* LabeledStatement */:
                     return visitLabeledStatement(node);
-                case 200 /* ObjectLiteralExpression */:
+                case 204 /* ObjectLiteralExpression */:
                     return visitObjectLiteralExpression(node);
-                case 216 /* BinaryExpression */:
+                case 220 /* BinaryExpression */:
                     return visitBinaryExpression(node, expressionResultIsUnused);
-                case 337 /* CommaListExpression */:
+                case 349 /* CommaListExpression */:
                     return visitCommaListExpression(node, expressionResultIsUnused);
-                case 287 /* CatchClause */:
+                case 291 /* CatchClause */:
                     return visitCatchClause(node);
-                case 232 /* VariableStatement */:
+                case 236 /* VariableStatement */:
                     return visitVariableStatement(node);
-                case 249 /* VariableDeclaration */:
+                case 253 /* VariableDeclaration */:
                     return visitVariableDeclaration(node);
-                case 235 /* DoStatement */:
-                case 236 /* WhileStatement */:
-                case 238 /* ForInStatement */:
+                case 239 /* DoStatement */:
+                case 240 /* WhileStatement */:
+                case 242 /* ForInStatement */:
                     return doWithHierarchyFacts(visitDefault, node, 0 /* IterationStatementExcludes */, 2 /* IterationStatementIncludes */);
-                case 239 /* ForOfStatement */:
+                case 243 /* ForOfStatement */:
                     return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined);
-                case 237 /* ForStatement */:
+                case 241 /* ForStatement */:
                     return doWithHierarchyFacts(visitForStatement, node, 0 /* IterationStatementExcludes */, 2 /* IterationStatementIncludes */);
-                case 212 /* VoidExpression */:
+                case 216 /* VoidExpression */:
                     return visitVoidExpression(node);
-                case 166 /* Constructor */:
+                case 170 /* Constructor */:
                     return doWithHierarchyFacts(visitConstructorDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */);
-                case 165 /* MethodDeclaration */:
+                case 168 /* MethodDeclaration */:
                     return doWithHierarchyFacts(visitMethodDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */);
-                case 167 /* GetAccessor */:
+                case 171 /* GetAccessor */:
                     return doWithHierarchyFacts(visitGetAccessorDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */);
-                case 168 /* SetAccessor */:
+                case 172 /* SetAccessor */:
                     return doWithHierarchyFacts(visitSetAccessorDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */);
-                case 251 /* FunctionDeclaration */:
+                case 255 /* FunctionDeclaration */:
                     return doWithHierarchyFacts(visitFunctionDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */);
-                case 208 /* FunctionExpression */:
+                case 212 /* FunctionExpression */:
                     return doWithHierarchyFacts(visitFunctionExpression, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */);
-                case 209 /* ArrowFunction */:
+                case 213 /* ArrowFunction */:
                     return doWithHierarchyFacts(visitArrowFunction, node, 2 /* ArrowFunctionExcludes */, 0 /* ArrowFunctionIncludes */);
-                case 160 /* Parameter */:
+                case 163 /* Parameter */:
                     return visitParameter(node);
-                case 233 /* ExpressionStatement */:
+                case 237 /* ExpressionStatement */:
                     return visitExpressionStatement(node);
-                case 207 /* ParenthesizedExpression */:
+                case 211 /* ParenthesizedExpression */:
                     return visitParenthesizedExpression(node, expressionResultIsUnused);
-                case 205 /* TaggedTemplateExpression */:
+                case 209 /* TaggedTemplateExpression */:
                     return visitTaggedTemplateExpression(node);
-                case 201 /* PropertyAccessExpression */:
-                    if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 105 /* SuperKeyword */) {
+                case 205 /* PropertyAccessExpression */:
+                    if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 106 /* SuperKeyword */) {
                         capturedSuperProperties.add(node.name.escapedText);
                     }
                     return ts.visitEachChild(node, visitor, context);
-                case 202 /* ElementAccessExpression */:
-                    if (capturedSuperProperties && node.expression.kind === 105 /* SuperKeyword */) {
+                case 206 /* ElementAccessExpression */:
+                    if (capturedSuperProperties && node.expression.kind === 106 /* SuperKeyword */) {
                         hasSuperElementAccess = true;
                     }
                     return ts.visitEachChild(node, visitor, context);
-                case 252 /* ClassDeclaration */:
-                case 221 /* ClassExpression */:
+                case 256 /* ClassDeclaration */:
+                case 225 /* ClassExpression */:
                     return doWithHierarchyFacts(visitDefault, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */);
                 default:
                     return ts.visitEachChild(node, visitor, context);
@@ -87520,7 +94050,7 @@ var ts;
         function visitLabeledStatement(node) {
             if (enclosingFunctionFlags & 2 /* Async */) {
                 var statement = ts.unwrapInnermostStatementOfLabel(node);
-                if (statement.kind === 239 /* ForOfStatement */ && statement.awaitModifier) {
+                if (statement.kind === 243 /* ForOfStatement */ && statement.awaitModifier) {
                     return visitForOfStatement(statement, node);
                 }
                 return factory.restoreEnclosingLabel(ts.visitNode(statement, visitor, ts.isStatement, factory.liftToBlock), node);
@@ -87532,7 +94062,7 @@ var ts;
             var objects = [];
             for (var _i = 0, elements_4 = elements; _i < elements_4.length; _i++) {
                 var e = elements_4[_i];
-                if (e.kind === 290 /* SpreadAssignment */) {
+                if (e.kind === 296 /* SpreadAssignment */) {
                     if (chunkObject) {
                         objects.push(factory.createObjectLiteralExpression(chunkObject));
                         chunkObject = undefined;
@@ -87541,7 +94071,7 @@ var ts;
                     objects.push(ts.visitNode(target, visitor, ts.isExpression));
                 }
                 else {
-                    chunkObject = ts.append(chunkObject, e.kind === 288 /* PropertyAssignment */
+                    chunkObject = ts.append(chunkObject, e.kind === 294 /* PropertyAssignment */
                         ? factory.createPropertyAssignment(e.name, ts.visitNode(e.initializer, visitor, ts.isExpression))
                         : ts.visitNode(e, visitor, ts.isObjectLiteralElementLike));
                 }
@@ -87552,7 +94082,7 @@ var ts;
             return objects;
         }
         function visitObjectLiteralExpression(node) {
-            if (node.transformFlags & 16384 /* ContainsObjectRestOrSpread */) {
+            if (node.transformFlags & 32768 /* ContainsObjectRestOrSpread */) {
                 // spread elements emit like so:
                 // non-spread elements are chunked together into object literals, and then all are passed to __assign:
                 //     { a, ...o, b } => __assign(__assign({a}, o), {b});
@@ -87575,7 +94105,7 @@ var ts;
                 // If we translate the above to `__assign({}, k, l)`, the `l` will evaluate before `k` is spread and we
                 // end up with `{ a: 1, b: 2, c: 3 }`
                 var objects = chunkObjectLiteralElements(node.properties);
-                if (objects.length && objects[0].kind !== 200 /* ObjectLiteralExpression */) {
+                if (objects.length && objects[0].kind !== 204 /* ObjectLiteralExpression */) {
                     objects.unshift(factory.createObjectLiteralExpression());
                 }
                 var expression = objects[0];
@@ -87625,7 +94155,7 @@ var ts;
          * expression of an `ExpressionStatement`).
          */
         function visitBinaryExpression(node, expressionResultIsUnused) {
-            if (ts.isDestructuringAssignment(node) && node.left.transformFlags & 16384 /* ContainsObjectRestOrSpread */) {
+            if (ts.isDestructuringAssignment(node) && node.left.transformFlags & 32768 /* ContainsObjectRestOrSpread */) {
                 return ts.flattenDestructuringAssignment(node, visitor, context, 1 /* ObjectRest */, !expressionResultIsUnused);
             }
             if (node.operatorToken.kind === 27 /* CommaToken */) {
@@ -87656,7 +94186,7 @@ var ts;
         function visitCatchClause(node) {
             if (node.variableDeclaration &&
                 ts.isBindingPattern(node.variableDeclaration.name) &&
-                node.variableDeclaration.name.transformFlags & 16384 /* ContainsObjectRestOrSpread */) {
+                node.variableDeclaration.name.transformFlags & 32768 /* ContainsObjectRestOrSpread */) {
                 var name = factory.getGeneratedNameForNode(node.variableDeclaration.name);
                 var updatedDecl = factory.updateVariableDeclaration(node.variableDeclaration, node.variableDeclaration.name, /*exclamationToken*/ undefined, /*type*/ undefined, name);
                 var visitedBindings = ts.flattenDestructuringBinding(updatedDecl, visitor, context, 1 /* ObjectRest */);
@@ -87664,7 +94194,7 @@ var ts;
                 if (ts.some(visitedBindings)) {
                     block = factory.updateBlock(block, __spreadArray([
                         factory.createVariableStatement(/*modifiers*/ undefined, visitedBindings)
-                    ], block.statements));
+                    ], block.statements, true));
                 }
                 return factory.updateCatchClause(node, factory.updateVariableDeclaration(node.variableDeclaration, name, /*exclamationToken*/ undefined, /*type*/ undefined, /*initializer*/ undefined), block);
             }
@@ -87697,14 +94227,14 @@ var ts;
         }
         function visitVariableDeclarationWorker(node, exportedVariableStatement) {
             // If we are here it is because the name contains a binding pattern with a rest somewhere in it.
-            if (ts.isBindingPattern(node.name) && node.name.transformFlags & 16384 /* ContainsObjectRestOrSpread */) {
+            if (ts.isBindingPattern(node.name) && node.name.transformFlags & 32768 /* ContainsObjectRestOrSpread */) {
                 return ts.flattenDestructuringBinding(node, visitor, context, 1 /* ObjectRest */, 
                 /*rval*/ undefined, exportedVariableStatement);
             }
             return ts.visitEachChild(node, visitor, context);
         }
         function visitForStatement(node) {
-            return factory.updateForStatement(node, ts.visitNode(node.initializer, visitorWithUnusedExpressionResult, ts.isForInitializer), ts.visitNode(node.condition, visitor, ts.isExpression), ts.visitNode(node.incrementor, visitorWithUnusedExpressionResult, ts.isExpression), ts.visitNode(node.statement, visitor, ts.isStatement));
+            return factory.updateForStatement(node, ts.visitNode(node.initializer, visitorWithUnusedExpressionResult, ts.isForInitializer), ts.visitNode(node.condition, visitor, ts.isExpression), ts.visitNode(node.incrementor, visitorWithUnusedExpressionResult, ts.isExpression), ts.visitIterationBody(node.statement, visitor, context));
         }
         function visitVoidExpression(node) {
             return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context);
@@ -87716,7 +94246,7 @@ var ts;
          */
         function visitForOfStatement(node, outermostLabeledStatement) {
             var ancestorFacts = enterSubtree(0 /* IterationStatementExcludes */, 2 /* IterationStatementIncludes */);
-            if (node.initializer.transformFlags & 16384 /* ContainsObjectRestOrSpread */) {
+            if (node.initializer.transformFlags & 32768 /* ContainsObjectRestOrSpread */) {
                 node = transformForOfStatementWithObjectRest(node);
             }
             var result = node.awaitModifier ?
@@ -87754,7 +94284,7 @@ var ts;
             var bodyLocation;
             var statementsLocation;
             var statements = [ts.visitNode(binding, visitor, ts.isStatement)];
-            var statement = ts.visitNode(node.statement, visitor, ts.isStatement);
+            var statement = ts.visitIterationBody(node.statement, visitor, context);
             if (ts.isBlock(statement)) {
                 ts.addRange(statements, statement.statements);
                 bodyLocation = statement;
@@ -87816,7 +94346,7 @@ var ts;
             ]));
         }
         function visitParameter(node) {
-            if (node.transformFlags & 16384 /* ContainsObjectRestOrSpread */) {
+            if (node.transformFlags & 32768 /* ContainsObjectRestOrSpread */) {
                 // Binding patterns are converted into a generated name and are
                 // evaluated inside the function body.
                 return factory.updateParameterDeclaration(node, 
@@ -87968,7 +94498,7 @@ var ts;
         function appendObjectRestAssignmentsIfNeeded(statements, node) {
             for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) {
                 var parameter = _a[_i];
-                if (parameter.transformFlags & 16384 /* ContainsObjectRestOrSpread */) {
+                if (parameter.transformFlags & 32768 /* ContainsObjectRestOrSpread */) {
                     var temp = factory.getGeneratedNameForNode(parameter);
                     var declarations = ts.flattenDestructuringBinding(parameter, visitor, context, 1 /* ObjectRest */, temp, 
                     /*doNotRecordTempVariablesInLine*/ false, 
@@ -87988,17 +94518,17 @@ var ts;
                 enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */;
                 // We need to enable substitutions for call, property access, and element access
                 // if we need to rewrite super calls.
-                context.enableSubstitution(203 /* CallExpression */);
-                context.enableSubstitution(201 /* PropertyAccessExpression */);
-                context.enableSubstitution(202 /* ElementAccessExpression */);
+                context.enableSubstitution(207 /* CallExpression */);
+                context.enableSubstitution(205 /* PropertyAccessExpression */);
+                context.enableSubstitution(206 /* ElementAccessExpression */);
                 // We need to be notified when entering and exiting declarations that bind super.
-                context.enableEmitNotification(252 /* ClassDeclaration */);
-                context.enableEmitNotification(165 /* MethodDeclaration */);
-                context.enableEmitNotification(167 /* GetAccessor */);
-                context.enableEmitNotification(168 /* SetAccessor */);
-                context.enableEmitNotification(166 /* Constructor */);
+                context.enableEmitNotification(256 /* ClassDeclaration */);
+                context.enableEmitNotification(168 /* MethodDeclaration */);
+                context.enableEmitNotification(171 /* GetAccessor */);
+                context.enableEmitNotification(172 /* SetAccessor */);
+                context.enableEmitNotification(170 /* Constructor */);
                 // We need to be notified when entering the generated accessor arrow functions.
-                context.enableEmitNotification(232 /* VariableStatement */);
+                context.enableEmitNotification(236 /* VariableStatement */);
             }
         }
         /**
@@ -88046,23 +94576,23 @@ var ts;
         }
         function substituteExpression(node) {
             switch (node.kind) {
-                case 201 /* PropertyAccessExpression */:
+                case 205 /* PropertyAccessExpression */:
                     return substitutePropertyAccessExpression(node);
-                case 202 /* ElementAccessExpression */:
+                case 206 /* ElementAccessExpression */:
                     return substituteElementAccessExpression(node);
-                case 203 /* CallExpression */:
+                case 207 /* CallExpression */:
                     return substituteCallExpression(node);
             }
             return node;
         }
         function substitutePropertyAccessExpression(node) {
-            if (node.expression.kind === 105 /* SuperKeyword */) {
+            if (node.expression.kind === 106 /* SuperKeyword */) {
                 return ts.setTextRange(factory.createPropertyAccessExpression(factory.createUniqueName("_super", 16 /* Optimistic */ | 32 /* FileLevel */), node.name), node);
             }
             return node;
         }
         function substituteElementAccessExpression(node) {
-            if (node.expression.kind === 105 /* SuperKeyword */) {
+            if (node.expression.kind === 106 /* SuperKeyword */) {
                 return createSuperElementAccessInAsyncMethod(node.argumentExpression, node);
             }
             return node;
@@ -88076,17 +94606,17 @@ var ts;
                 return factory.createCallExpression(factory.createPropertyAccessExpression(argumentExpression, "call"), 
                 /*typeArguments*/ undefined, __spreadArray([
                     factory.createThis()
-                ], node.arguments));
+                ], node.arguments, true));
             }
             return node;
         }
         function isSuperContainer(node) {
             var kind = node.kind;
-            return kind === 252 /* ClassDeclaration */
-                || kind === 166 /* Constructor */
-                || kind === 165 /* MethodDeclaration */
-                || kind === 167 /* GetAccessor */
-                || kind === 168 /* SetAccessor */;
+            return kind === 256 /* ClassDeclaration */
+                || kind === 170 /* Constructor */
+                || kind === 168 /* MethodDeclaration */
+                || kind === 171 /* GetAccessor */
+                || kind === 172 /* SetAccessor */;
         }
         function createSuperElementAccessInAsyncMethod(argumentExpression, location) {
             if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) {
@@ -88114,11 +94644,11 @@ var ts;
             return ts.visitEachChild(node, visitor, context);
         }
         function visitor(node) {
-            if ((node.transformFlags & 16 /* ContainsES2019 */) === 0) {
+            if ((node.transformFlags & 32 /* ContainsES2019 */) === 0) {
                 return node;
             }
             switch (node.kind) {
-                case 287 /* CatchClause */:
+                case 291 /* CatchClause */:
                     return visitCatchClause(node);
                 default:
                     return ts.visitEachChild(node, visitor, context);
@@ -88146,25 +94676,29 @@ var ts;
             return ts.visitEachChild(node, visitor, context);
         }
         function visitor(node) {
-            if ((node.transformFlags & 8 /* ContainsES2020 */) === 0) {
+            if ((node.transformFlags & 16 /* ContainsES2020 */) === 0) {
                 return node;
             }
             switch (node.kind) {
-                case 201 /* PropertyAccessExpression */:
-                case 202 /* ElementAccessExpression */:
-                case 203 /* CallExpression */:
-                    if (node.flags & 32 /* OptionalChain */) {
+                case 207 /* CallExpression */: {
+                    var updated = visitNonOptionalCallExpression(node, /*captureThisArg*/ false);
+                    ts.Debug.assertNotNode(updated, ts.isSyntheticReference);
+                    return updated;
+                }
+                case 205 /* PropertyAccessExpression */:
+                case 206 /* ElementAccessExpression */:
+                    if (ts.isOptionalChain(node)) {
                         var updated = visitOptionalExpression(node, /*captureThisArg*/ false, /*isDelete*/ false);
                         ts.Debug.assertNotNode(updated, ts.isSyntheticReference);
                         return updated;
                     }
                     return ts.visitEachChild(node, visitor, context);
-                case 216 /* BinaryExpression */:
+                case 220 /* BinaryExpression */:
                     if (node.operatorToken.kind === 60 /* QuestionQuestionToken */) {
                         return transformNullishCoalescingExpression(node);
                     }
                     return ts.visitEachChild(node, visitor, context);
-                case 210 /* DeleteExpression */:
+                case 214 /* DeleteExpression */:
                     return visitDeleteExpression(node);
                 default:
                     return ts.visitEachChild(node, visitor, context);
@@ -88206,7 +94740,7 @@ var ts;
                     thisArg = expression;
                 }
             }
-            expression = node.kind === 201 /* PropertyAccessExpression */
+            expression = node.kind === 205 /* PropertyAccessExpression */
                 ? factory.updatePropertyAccessExpression(node, expression, ts.visitNode(node.name, visitor, ts.isIdentifier))
                 : factory.updateElementAccessExpression(node, expression, ts.visitNode(node.argumentExpression, visitor, ts.isExpression));
             return thisArg ? factory.createSyntheticReferenceExpression(expression, thisArg) : expression;
@@ -88216,14 +94750,23 @@ var ts;
                 // If `node` is an optional chain, then it is the outermost chain of an optional expression.
                 return visitOptionalExpression(node, captureThisArg, /*isDelete*/ false);
             }
+            if (ts.isParenthesizedExpression(node.expression) && ts.isOptionalChain(ts.skipParentheses(node.expression))) {
+                // capture thisArg for calls of parenthesized optional chains like `(foo?.bar)()`
+                var expression = visitNonOptionalParenthesizedExpression(node.expression, /*captureThisArg*/ true, /*isDelete*/ false);
+                var args = ts.visitNodes(node.arguments, visitor, ts.isExpression);
+                if (ts.isSyntheticReference(expression)) {
+                    return ts.setTextRange(factory.createFunctionCallCall(expression.expression, expression.thisArg, args), node);
+                }
+                return factory.updateCallExpression(node, expression, /*typeArguments*/ undefined, args);
+            }
             return ts.visitEachChild(node, visitor, context);
         }
         function visitNonOptionalExpression(node, captureThisArg, isDelete) {
             switch (node.kind) {
-                case 207 /* ParenthesizedExpression */: return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete);
-                case 201 /* PropertyAccessExpression */:
-                case 202 /* ElementAccessExpression */: return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete);
-                case 203 /* CallExpression */: return visitNonOptionalCallExpression(node, captureThisArg);
+                case 211 /* ParenthesizedExpression */: return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete);
+                case 205 /* PropertyAccessExpression */:
+                case 206 /* ElementAccessExpression */: return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete);
+                case 207 /* CallExpression */: return visitNonOptionalCallExpression(node, captureThisArg);
                 default: return ts.visitNode(node, visitor, ts.isExpression);
             }
         }
@@ -88242,8 +94785,8 @@ var ts;
             for (var i = 0; i < chain.length; i++) {
                 var segment = chain[i];
                 switch (segment.kind) {
-                    case 201 /* PropertyAccessExpression */:
-                    case 202 /* ElementAccessExpression */:
+                    case 205 /* PropertyAccessExpression */:
+                    case 206 /* ElementAccessExpression */:
                         if (i === chain.length - 1 && captureThisArg) {
                             if (!ts.isSimpleCopiableExpression(rightExpression)) {
                                 thisArg = factory.createTempVariable(hoistVariableDeclaration);
@@ -88253,13 +94796,13 @@ var ts;
                                 thisArg = rightExpression;
                             }
                         }
-                        rightExpression = segment.kind === 201 /* PropertyAccessExpression */
+                        rightExpression = segment.kind === 205 /* PropertyAccessExpression */
                             ? factory.createPropertyAccessExpression(rightExpression, ts.visitNode(segment.name, visitor, ts.isIdentifier))
                             : factory.createElementAccessExpression(rightExpression, ts.visitNode(segment.argumentExpression, visitor, ts.isExpression));
                         break;
-                    case 203 /* CallExpression */:
+                    case 207 /* CallExpression */:
                         if (i === 0 && leftThisArg) {
-                            rightExpression = factory.createFunctionCallCall(rightExpression, leftThisArg.kind === 105 /* SuperKeyword */ ? factory.createThis() : leftThisArg, ts.visitNodes(segment.arguments, visitor, ts.isExpression));
+                            rightExpression = factory.createFunctionCallCall(rightExpression, leftThisArg.kind === 106 /* SuperKeyword */ ? factory.createThis() : leftThisArg, ts.visitNodes(segment.arguments, visitor, ts.isExpression));
                         }
                         else {
                             rightExpression = factory.createCallExpression(rightExpression, 
@@ -88300,7 +94843,7 @@ var ts;
 /*@internal*/
 var ts;
 (function (ts) {
-    function transformESNext(context) {
+    function transformES2021(context) {
         var hoistVariableDeclaration = context.hoistVariableDeclaration, factory = context.factory;
         return ts.chainBundle(context, transformSourceFile);
         function transformSourceFile(node) {
@@ -88310,11 +94853,11 @@ var ts;
             return ts.visitEachChild(node, visitor, context);
         }
         function visitor(node) {
-            if ((node.transformFlags & 4 /* ContainsESNext */) === 0) {
+            if ((node.transformFlags & 8 /* ContainsES2021 */) === 0) {
                 return node;
             }
             switch (node.kind) {
-                case 216 /* BinaryExpression */:
+                case 220 /* BinaryExpression */:
                     var binaryExpression = node;
                     if (ts.isLogicalOrCoalescingAssignmentExpression(binaryExpression)) {
                         return transformLogicalAssignment(binaryExpression);
@@ -88350,6 +94893,29 @@ var ts;
             return factory.createBinaryExpression(left, nonAssignmentOperator, factory.createParenthesizedExpression(factory.createAssignment(assignmentTarget, right)));
         }
     }
+    ts.transformES2021 = transformES2021;
+})(ts || (ts = {}));
+/*@internal*/
+var ts;
+(function (ts) {
+    function transformESNext(context) {
+        return ts.chainBundle(context, transformSourceFile);
+        function transformSourceFile(node) {
+            if (node.isDeclarationFile) {
+                return node;
+            }
+            return ts.visitEachChild(node, visitor, context);
+        }
+        function visitor(node) {
+            if ((node.transformFlags & 4 /* ContainsESNext */) === 0) {
+                return node;
+            }
+            switch (node.kind) {
+                default:
+                    return ts.visitEachChild(node, visitor, context);
+            }
+        }
+    }
     ts.transformESNext = transformESNext;
 })(ts || (ts = {}));
 /*@internal*/
@@ -88369,11 +94935,11 @@ var ts;
             currentFileState.filenameDeclaration = declaration;
             return currentFileState.filenameDeclaration.name;
         }
-        function getJsxFactoryCalleePrimitive(childrenLength) {
-            return compilerOptions.jsx === 5 /* ReactJSXDev */ ? "jsxDEV" : childrenLength > 1 ? "jsxs" : "jsx";
+        function getJsxFactoryCalleePrimitive(isStaticChildren) {
+            return compilerOptions.jsx === 5 /* ReactJSXDev */ ? "jsxDEV" : isStaticChildren ? "jsxs" : "jsx";
         }
-        function getJsxFactoryCallee(childrenLength) {
-            var type = getJsxFactoryCalleePrimitive(childrenLength);
+        function getJsxFactoryCallee(isStaticChildren) {
+            var type = getJsxFactoryCalleePrimitive(isStaticChildren);
             return getImplicitImportForName(type);
         }
         function getImplicitJsxFragmentReference() {
@@ -88396,8 +94962,8 @@ var ts;
                 specifierSourceImports = ts.createMap();
                 currentFileState.utilizedImplicitRuntimeImports.set(importSource, specifierSourceImports);
             }
-            var generatedName = factory.createUniqueName("_" + name, 16 /* Optimistic */ | 32 /* FileLevel */ | 64 /* AllowNameSubstitution */);
-            var specifier = factory.createImportSpecifier(factory.createIdentifier(name), generatedName);
+            var generatedName = factory.createUniqueName("_".concat(name), 16 /* Optimistic */ | 32 /* FileLevel */ | 64 /* AllowNameSubstitution */);
+            var specifier = factory.createImportSpecifier(/*isTypeOnly*/ false, factory.createIdentifier(name), generatedName);
             generatedName.generatedImportReference = specifier;
             specifierSourceImports.set(name, specifier);
             return generatedName;
@@ -88425,7 +94991,7 @@ var ts;
                     var _b = _a[_i], importSource = _b[0], importSpecifiersMap = _b[1];
                     if (ts.isExternalModule(node)) {
                         // Add `import` statement
-                        var importStatement = factory.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, factory.createImportClause(/*typeOnly*/ false, /*name*/ undefined, factory.createNamedImports(ts.arrayFrom(importSpecifiersMap.values()))), factory.createStringLiteral(importSource));
+                        var importStatement = factory.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, factory.createImportClause(/*typeOnly*/ false, /*name*/ undefined, factory.createNamedImports(ts.arrayFrom(importSpecifiersMap.values()))), factory.createStringLiteral(importSource), /*assertClause*/ undefined);
                         ts.setParentRecursive(importStatement, /*incremental*/ false);
                         statements = ts.insertStatementAfterCustomPrologue(statements.slice(), importStatement);
                     }
@@ -88460,13 +95026,13 @@ var ts;
         }
         function visitorWorker(node) {
             switch (node.kind) {
-                case 273 /* JsxElement */:
+                case 277 /* JsxElement */:
                     return visitJsxElement(node, /*isChild*/ false);
-                case 274 /* JsxSelfClosingElement */:
+                case 278 /* JsxSelfClosingElement */:
                     return visitJsxSelfClosingElement(node, /*isChild*/ false);
-                case 277 /* JsxFragment */:
+                case 281 /* JsxFragment */:
                     return visitJsxFragment(node, /*isChild*/ false);
-                case 283 /* JsxExpression */:
+                case 287 /* JsxExpression */:
                     return visitJsxExpression(node);
                 default:
                     return ts.visitEachChild(node, visitor, context);
@@ -88476,13 +95042,13 @@ var ts;
             switch (node.kind) {
                 case 11 /* JsxText */:
                     return visitJsxText(node);
-                case 283 /* JsxExpression */:
+                case 287 /* JsxExpression */:
                     return visitJsxExpression(node);
-                case 273 /* JsxElement */:
+                case 277 /* JsxElement */:
                     return visitJsxElement(node, /*isChild*/ true);
-                case 274 /* JsxSelfClosingElement */:
+                case 278 /* JsxSelfClosingElement */:
                     return visitJsxSelfClosingElement(node, /*isChild*/ true);
-                case 277 /* JsxFragment */:
+                case 281 /* JsxFragment */:
                     return visitJsxFragment(node, /*isChild*/ true);
                 default:
                     return ts.Debug.failBadSyntaxKind(node);
@@ -88520,60 +95086,37 @@ var ts;
             return tagTransform(node.openingFragment, node.children, isChild, /*location*/ node);
         }
         function convertJsxChildrenToChildrenPropObject(children) {
+            var prop = convertJsxChildrenToChildrenPropAssignment(children);
+            return prop && factory.createObjectLiteralExpression([prop]);
+        }
+        function convertJsxChildrenToChildrenPropAssignment(children) {
             var nonWhitespaceChildren = ts.getSemanticJsxChildren(children);
-            if (ts.length(nonWhitespaceChildren) === 1) {
-                var result_13 = transformJsxChildToExpression(nonWhitespaceChildren[0]);
-                return result_13 && factory.createObjectLiteralExpression([
-                    factory.createPropertyAssignment("children", result_13)
-                ]);
+            if (ts.length(nonWhitespaceChildren) === 1 && !nonWhitespaceChildren[0].dotDotDotToken) {
+                var result_12 = transformJsxChildToExpression(nonWhitespaceChildren[0]);
+                return result_12 && factory.createPropertyAssignment("children", result_12);
             }
             var result = ts.mapDefined(children, transformJsxChildToExpression);
-            return !result.length ? undefined : factory.createObjectLiteralExpression([
-                factory.createPropertyAssignment("children", factory.createArrayLiteralExpression(result))
-            ]);
+            return ts.length(result) ? factory.createPropertyAssignment("children", factory.createArrayLiteralExpression(result)) : undefined;
         }
         function visitJsxOpeningLikeElementJSX(node, children, isChild, location) {
             var tagName = getTagName(node);
-            var objectProperties;
+            var childrenProp = children && children.length ? convertJsxChildrenToChildrenPropAssignment(children) : undefined;
             var keyAttr = ts.find(node.attributes.properties, function (p) { return !!p.name && ts.isIdentifier(p.name) && p.name.escapedText === "key"; });
             var attrs = keyAttr ? ts.filter(node.attributes.properties, function (p) { return p !== keyAttr; }) : node.attributes.properties;
-            var segments = [];
-            if (attrs.length) {
-                // Map spans of JsxAttribute nodes into object literals and spans
-                // of JsxSpreadAttribute nodes into expressions.
-                segments = ts.flatten(ts.spanMap(attrs, ts.isJsxSpreadAttribute, function (attrs, isSpread) { return isSpread
-                    ? ts.map(attrs, transformJsxSpreadAttributeToExpression)
-                    : factory.createObjectLiteralExpression(ts.map(attrs, transformJsxAttributeToObjectLiteralElement)); }));
-                if (ts.isJsxSpreadAttribute(attrs[0])) {
-                    // We must always emit at least one object literal before a spread
-                    // argument.factory.createObjectLiteral
-                    segments.unshift(factory.createObjectLiteralExpression());
-                }
-            }
-            if (children && children.length) {
-                var result = convertJsxChildrenToChildrenPropObject(children);
-                if (result) {
-                    segments.push(result);
-                }
-            }
-            if (segments.length === 0) {
-                objectProperties = factory.createObjectLiteralExpression([]);
-                // When there are no attributes, React wants {}
-            }
-            else {
-                // Either emit one big object literal (no spread attribs), or
-                // a call to the __assign helper.
-                objectProperties = ts.singleOrUndefined(segments) || emitHelpers().createAssignHelper(segments);
-            }
-            return visitJsxOpeningLikeElementOrFragmentJSX(tagName, objectProperties, keyAttr, ts.length(ts.getSemanticJsxChildren(children || ts.emptyArray)), isChild, location);
+            var objectProperties = ts.length(attrs) ? transformJsxAttributesToObjectProps(attrs, childrenProp) :
+                factory.createObjectLiteralExpression(childrenProp ? [childrenProp] : ts.emptyArray); // When there are no attributes, React wants {}
+            return visitJsxOpeningLikeElementOrFragmentJSX(tagName, objectProperties, keyAttr, children || ts.emptyArray, isChild, location);
         }
-        function visitJsxOpeningLikeElementOrFragmentJSX(tagName, objectProperties, keyAttr, childrenLength, isChild, location) {
+        function visitJsxOpeningLikeElementOrFragmentJSX(tagName, objectProperties, keyAttr, children, isChild, location) {
+            var _a;
+            var nonWhitespaceChildren = ts.getSemanticJsxChildren(children);
+            var isStaticChildren = ts.length(nonWhitespaceChildren) > 1 || !!((_a = nonWhitespaceChildren[0]) === null || _a === void 0 ? void 0 : _a.dotDotDotToken);
             var args = [tagName, objectProperties, !keyAttr ? factory.createVoidZero() : transformJsxAttributeInitializer(keyAttr.initializer)];
             if (compilerOptions.jsx === 5 /* ReactJSXDev */) {
                 var originalFile = ts.getOriginalNode(currentSourceFile);
                 if (originalFile && ts.isSourceFile(originalFile)) {
                     // isStaticChildren development flag
-                    args.push(childrenLength > 1 ? factory.createTrue() : factory.createFalse());
+                    args.push(isStaticChildren ? factory.createTrue() : factory.createFalse());
                     // __source development flag
                     var lineCol = ts.getLineAndCharacterOfPosition(originalFile, location.pos);
                     args.push(factory.createObjectLiteralExpression([
@@ -88585,7 +95128,7 @@ var ts;
                     args.push(factory.createThis());
                 }
             }
-            var element = ts.setTextRange(factory.createCallExpression(getJsxFactoryCallee(childrenLength), /*typeArguments*/ undefined, args), location);
+            var element = ts.setTextRange(factory.createCallExpression(getJsxFactoryCallee(isStaticChildren), /*typeArguments*/ undefined, args), location);
             if (isChild) {
                 ts.startOnNewLine(element);
             }
@@ -88593,30 +95136,9 @@ var ts;
         }
         function visitJsxOpeningLikeElementCreateElement(node, children, isChild, location) {
             var tagName = getTagName(node);
-            var objectProperties;
             var attrs = node.attributes.properties;
-            if (attrs.length === 0) {
-                objectProperties = factory.createNull();
-                // When there are no attributes, React wants "null"
-            }
-            else {
-                // Map spans of JsxAttribute nodes into object literals and spans
-                // of JsxSpreadAttribute nodes into expressions.
-                var segments = ts.flatten(ts.spanMap(attrs, ts.isJsxSpreadAttribute, function (attrs, isSpread) { return isSpread
-                    ? ts.map(attrs, transformJsxSpreadAttributeToExpression)
-                    : factory.createObjectLiteralExpression(ts.map(attrs, transformJsxAttributeToObjectLiteralElement)); }));
-                if (ts.isJsxSpreadAttribute(attrs[0])) {
-                    // We must always emit at least one object literal before a spread
-                    // argument.factory.createObjectLiteral
-                    segments.unshift(factory.createObjectLiteralExpression());
-                }
-                // Either emit one big object literal (no spread attribs), or
-                // a call to the __assign helper.
-                objectProperties = ts.singleOrUndefined(segments);
-                if (!objectProperties) {
-                    objectProperties = emitHelpers().createAssignHelper(segments);
-                }
-            }
+            var objectProperties = ts.length(attrs) ? transformJsxAttributesToObjectProps(attrs) :
+                factory.createNull(); // When there are no attributes, React wants "null"
             var callee = currentFileState.importSpecifier === undefined
                 ? ts.createJsxFactoryExpression(factory, context.getEmitResolver().getJsxFactoryEntity(currentSourceFile), compilerOptions.reactNamespace, // TODO: GH#18217
                 node)
@@ -88636,7 +95158,7 @@ var ts;
                 }
             }
             return visitJsxOpeningLikeElementOrFragmentJSX(getImplicitJsxFragmentReference(), childrenProps || factory.createObjectLiteralExpression([]), 
-            /*keyAttr*/ undefined, ts.length(ts.getSemanticJsxChildren(children)), isChild, location);
+            /*keyAttr*/ undefined, children, isChild, location);
         }
         function visitJsxOpeningFragmentCreateElement(node, children, isChild, location) {
             var element = ts.createExpressionForJsxFragment(factory, context.getEmitResolver().getJsxFactoryEntity(currentSourceFile), context.getEmitResolver().getJsxFragmentFactoryEntity(currentSourceFile), compilerOptions.reactNamespace, // TODO: GH#18217
@@ -88646,6 +95168,39 @@ var ts;
             }
             return element;
         }
+        function transformJsxSpreadAttributeToSpreadAssignment(node) {
+            return factory.createSpreadAssignment(ts.visitNode(node.expression, visitor, ts.isExpression));
+        }
+        function transformJsxAttributesToObjectProps(attrs, children) {
+            var target = ts.getEmitScriptTarget(compilerOptions);
+            return target && target >= 5 /* ES2018 */ ? factory.createObjectLiteralExpression(transformJsxAttributesToProps(attrs, children)) :
+                transformJsxAttributesToExpression(attrs, children);
+        }
+        function transformJsxAttributesToProps(attrs, children) {
+            var props = ts.flatten(ts.spanMap(attrs, ts.isJsxSpreadAttribute, function (attrs, isSpread) {
+                return ts.map(attrs, function (attr) { return isSpread ? transformJsxSpreadAttributeToSpreadAssignment(attr) : transformJsxAttributeToObjectLiteralElement(attr); });
+            }));
+            if (children) {
+                props.push(children);
+            }
+            return props;
+        }
+        function transformJsxAttributesToExpression(attrs, children) {
+            // Map spans of JsxAttribute nodes into object literals and spans
+            // of JsxSpreadAttribute nodes into expressions.
+            var expressions = ts.flatten(ts.spanMap(attrs, ts.isJsxSpreadAttribute, function (attrs, isSpread) { return isSpread
+                ? ts.map(attrs, transformJsxSpreadAttributeToExpression)
+                : factory.createObjectLiteralExpression(ts.map(attrs, transformJsxAttributeToObjectLiteralElement)); }));
+            if (ts.isJsxSpreadAttribute(attrs[0])) {
+                // We must always emit at least one object literal before a spread
+                // argument.factory.createObjectLiteral
+                expressions.unshift(factory.createObjectLiteralExpression());
+            }
+            if (children) {
+                expressions.push(factory.createObjectLiteralExpression([children]));
+            }
+            return ts.singleOrUndefined(expressions) || emitHelpers().createAssignHelper(expressions);
+        }
         function transformJsxSpreadAttributeToExpression(node) {
             return ts.visitNode(node.expression, visitor, ts.isExpression);
         }
@@ -88665,7 +95220,7 @@ var ts;
                 var literal = factory.createStringLiteral(tryDecodeEntities(node.text) || node.text, singleQuote);
                 return ts.setTextRange(literal, node);
             }
-            else if (node.kind === 283 /* JsxExpression */) {
+            else if (node.kind === 287 /* JsxExpression */) {
                 if (node.expression === undefined) {
                     return factory.createTrue();
                 }
@@ -88759,7 +95314,7 @@ var ts;
             return decoded === text ? undefined : decoded;
         }
         function getTagName(node) {
-            if (node.kind === 273 /* JsxElement */) {
+            if (node.kind === 277 /* JsxElement */) {
                 return getTagName(node.openingElement);
             }
             else {
@@ -88788,7 +95343,8 @@ var ts;
             }
         }
         function visitJsxExpression(node) {
-            return ts.visitNode(node.expression, visitor, ts.isExpression);
+            var expression = ts.visitNode(node.expression, visitor, ts.isExpression);
+            return node.dotDotDotToken ? factory.createSpreadElement(expression) : expression;
         }
     }
     ts.transformJsx = transformJsx;
@@ -89061,11 +95617,11 @@ var ts;
             return ts.visitEachChild(node, visitor, context);
         }
         function visitor(node) {
-            if ((node.transformFlags & 128 /* ContainsES2016 */) === 0) {
+            if ((node.transformFlags & 256 /* ContainsES2016 */) === 0) {
                 return node;
             }
             switch (node.kind) {
-                case 216 /* BinaryExpression */:
+                case 220 /* BinaryExpression */:
                     return visitBinaryExpression(node);
                 default:
                     return ts.visitEachChild(node, visitor, context);
@@ -89073,7 +95629,7 @@ var ts;
         }
         function visitBinaryExpression(node) {
             switch (node.operatorToken.kind) {
-                case 66 /* AsteriskAsteriskEqualsToken */:
+                case 67 /* AsteriskAsteriskEqualsToken */:
                     return visitExponentiationAssignmentExpression(node);
                 case 42 /* AsteriskAsteriskToken */:
                     return visitExponentiationExpression(node);
@@ -89162,12 +95718,13 @@ var ts;
         HierarchyFacts[HierarchyFacts["ForStatement"] = 2048] = "ForStatement";
         HierarchyFacts[HierarchyFacts["ForInOrForOfStatement"] = 4096] = "ForInOrForOfStatement";
         HierarchyFacts[HierarchyFacts["ConstructorWithCapturedSuper"] = 8192] = "ConstructorWithCapturedSuper";
+        HierarchyFacts[HierarchyFacts["StaticInitializer"] = 16384] = "StaticInitializer";
         // NOTE: do not add more ancestor flags without also updating AncestorFactsMask below.
         // NOTE: when adding a new ancestor flag, be sure to update the subtree flags below.
         //
         // Ancestor masks
         //
-        HierarchyFacts[HierarchyFacts["AncestorFactsMask"] = 16383] = "AncestorFactsMask";
+        HierarchyFacts[HierarchyFacts["AncestorFactsMask"] = 32767] = "AncestorFactsMask";
         // We are always in *some* kind of block scope, but only specific block-scope containers are
         // top-level or Blocks.
         HierarchyFacts[HierarchyFacts["BlockScopeIncludes"] = 0] = "BlockScopeIncludes";
@@ -89177,16 +95734,16 @@ var ts;
         HierarchyFacts[HierarchyFacts["SourceFileExcludes"] = 8064] = "SourceFileExcludes";
         // Functions, methods, and accessors are both new lexical scopes and new block scopes.
         HierarchyFacts[HierarchyFacts["FunctionIncludes"] = 65] = "FunctionIncludes";
-        HierarchyFacts[HierarchyFacts["FunctionExcludes"] = 16286] = "FunctionExcludes";
+        HierarchyFacts[HierarchyFacts["FunctionExcludes"] = 32670] = "FunctionExcludes";
         HierarchyFacts[HierarchyFacts["AsyncFunctionBodyIncludes"] = 69] = "AsyncFunctionBodyIncludes";
-        HierarchyFacts[HierarchyFacts["AsyncFunctionBodyExcludes"] = 16278] = "AsyncFunctionBodyExcludes";
+        HierarchyFacts[HierarchyFacts["AsyncFunctionBodyExcludes"] = 32662] = "AsyncFunctionBodyExcludes";
         // Arrow functions are lexically scoped to their container, but are new block scopes.
         HierarchyFacts[HierarchyFacts["ArrowFunctionIncludes"] = 66] = "ArrowFunctionIncludes";
         HierarchyFacts[HierarchyFacts["ArrowFunctionExcludes"] = 15232] = "ArrowFunctionExcludes";
         // Constructors are both new lexical scopes and new block scopes. Constructors are also
         // always considered non-static members of a class.
         HierarchyFacts[HierarchyFacts["ConstructorIncludes"] = 73] = "ConstructorIncludes";
-        HierarchyFacts[HierarchyFacts["ConstructorExcludes"] = 16278] = "ConstructorExcludes";
+        HierarchyFacts[HierarchyFacts["ConstructorExcludes"] = 32662] = "ConstructorExcludes";
         // 'do' and 'while' statements are not block scopes. We track that the subtree is contained
         // within an IterationStatement to indicate whether the embedded statement is an
         // IterationStatementBlock.
@@ -89204,18 +95761,29 @@ var ts;
         HierarchyFacts[HierarchyFacts["BlockExcludes"] = 6976] = "BlockExcludes";
         HierarchyFacts[HierarchyFacts["IterationStatementBlockIncludes"] = 512] = "IterationStatementBlockIncludes";
         HierarchyFacts[HierarchyFacts["IterationStatementBlockExcludes"] = 7104] = "IterationStatementBlockExcludes";
+        HierarchyFacts[HierarchyFacts["StaticInitializerIncludes"] = 16449] = "StaticInitializerIncludes";
+        HierarchyFacts[HierarchyFacts["StaticInitializerExcludes"] = 32670] = "StaticInitializerExcludes";
         //
         // Subtree facts
         //
-        HierarchyFacts[HierarchyFacts["NewTarget"] = 16384] = "NewTarget";
-        HierarchyFacts[HierarchyFacts["CapturedLexicalThis"] = 32768] = "CapturedLexicalThis";
+        HierarchyFacts[HierarchyFacts["NewTarget"] = 32768] = "NewTarget";
+        HierarchyFacts[HierarchyFacts["CapturedLexicalThis"] = 65536] = "CapturedLexicalThis";
         //
         // Subtree masks
         //
-        HierarchyFacts[HierarchyFacts["SubtreeFactsMask"] = -16384] = "SubtreeFactsMask";
+        HierarchyFacts[HierarchyFacts["SubtreeFactsMask"] = -32768] = "SubtreeFactsMask";
         HierarchyFacts[HierarchyFacts["ArrowFunctionSubtreeExcludes"] = 0] = "ArrowFunctionSubtreeExcludes";
-        HierarchyFacts[HierarchyFacts["FunctionSubtreeExcludes"] = 49152] = "FunctionSubtreeExcludes";
+        HierarchyFacts[HierarchyFacts["FunctionSubtreeExcludes"] = 98304] = "FunctionSubtreeExcludes";
     })(HierarchyFacts || (HierarchyFacts = {}));
+    var SpreadSegmentKind;
+    (function (SpreadSegmentKind) {
+        SpreadSegmentKind[SpreadSegmentKind["None"] = 0] = "None";
+        SpreadSegmentKind[SpreadSegmentKind["UnpackedSpread"] = 1] = "UnpackedSpread";
+        SpreadSegmentKind[SpreadSegmentKind["PackedSpread"] = 2] = "PackedSpread";
+    })(SpreadSegmentKind || (SpreadSegmentKind = {}));
+    function createSpreadSegment(kind, expression) {
+        return { kind: kind, expression: expression };
+    }
     function transformES2015(context) {
         var factory = context.factory, emitHelpers = context.getEmitHelperFactory, startLexicalEnvironment = context.startLexicalEnvironment, resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistVariableDeclaration = context.hoistVariableDeclaration;
         var compilerOptions = context.getCompilerOptions();
@@ -89263,7 +95831,7 @@ var ts;
          */
         function enterSubtree(excludeFacts, includeFacts) {
             var ancestorFacts = hierarchyFacts;
-            hierarchyFacts = (hierarchyFacts & ~excludeFacts | includeFacts) & 16383 /* AncestorFactsMask */;
+            hierarchyFacts = (hierarchyFacts & ~excludeFacts | includeFacts) & 32767 /* AncestorFactsMask */;
             return ancestorFacts;
         }
         /**
@@ -89274,15 +95842,15 @@ var ts;
          * @param includeFacts The new `HierarchyFacts` of the subtree that should be propagated.
          */
         function exitSubtree(ancestorFacts, excludeFacts, includeFacts) {
-            hierarchyFacts = (hierarchyFacts & ~excludeFacts | includeFacts) & -16384 /* SubtreeFactsMask */ | ancestorFacts;
+            hierarchyFacts = (hierarchyFacts & ~excludeFacts | includeFacts) & -32768 /* SubtreeFactsMask */ | ancestorFacts;
         }
         function isReturnVoidStatementInConstructorWithCapturedSuper(node) {
             return (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */) !== 0
-                && node.kind === 242 /* ReturnStatement */
+                && node.kind === 246 /* ReturnStatement */
                 && !node.expression;
         }
         function isOrMayContainReturnCompletion(node) {
-            return node.transformFlags & 1048576 /* ContainsHoistedDeclarationOrCompletion */
+            return node.transformFlags & 2097152 /* ContainsHoistedDeclarationOrCompletion */
                 && (ts.isReturnStatement(node)
                     || ts.isIfStatement(node)
                     || ts.isWithStatement(node)
@@ -89297,7 +95865,7 @@ var ts;
                     || ts.isBlock(node));
         }
         function shouldVisitNode(node) {
-            return (node.transformFlags & 256 /* ContainsES2015 */) !== 0
+            return (node.transformFlags & 512 /* ContainsES2015 */) !== 0
                 || convertedLoopState !== undefined
                 || (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */ && isOrMayContainReturnCompletion(node))
                 || (ts.isIterationStatement(node, /*lookInLabeledStatements*/ false) && shouldConvertIterationStatement(node))
@@ -89309,75 +95877,88 @@ var ts;
         function visitorWithUnusedExpressionResult(node) {
             return shouldVisitNode(node) ? visitorWorker(node, /*expressionResultIsUnused*/ true) : node;
         }
+        function classWrapperStatementVisitor(node) {
+            if (shouldVisitNode(node)) {
+                var original = ts.getOriginalNode(node);
+                if (ts.isPropertyDeclaration(original) && ts.hasStaticModifier(original)) {
+                    var ancestorFacts = enterSubtree(32670 /* StaticInitializerExcludes */, 16449 /* StaticInitializerIncludes */);
+                    var result = visitorWorker(node, /*expressionResultIsUnused*/ false);
+                    exitSubtree(ancestorFacts, 98304 /* FunctionSubtreeExcludes */, 0 /* None */);
+                    return result;
+                }
+                return visitorWorker(node, /*expressionResultIsUnused*/ false);
+            }
+            return node;
+        }
         function callExpressionVisitor(node) {
-            if (node.kind === 105 /* SuperKeyword */) {
+            if (node.kind === 106 /* SuperKeyword */) {
                 return visitSuperKeyword(/*isExpressionOfCall*/ true);
             }
             return visitor(node);
         }
         function visitorWorker(node, expressionResultIsUnused) {
             switch (node.kind) {
-                case 123 /* StaticKeyword */:
+                case 124 /* StaticKeyword */:
                     return undefined; // elide static keyword
-                case 252 /* ClassDeclaration */:
+                case 256 /* ClassDeclaration */:
                     return visitClassDeclaration(node);
-                case 221 /* ClassExpression */:
+                case 225 /* ClassExpression */:
                     return visitClassExpression(node);
-                case 160 /* Parameter */:
+                case 163 /* Parameter */:
                     return visitParameter(node);
-                case 251 /* FunctionDeclaration */:
+                case 255 /* FunctionDeclaration */:
                     return visitFunctionDeclaration(node);
-                case 209 /* ArrowFunction */:
+                case 213 /* ArrowFunction */:
                     return visitArrowFunction(node);
-                case 208 /* FunctionExpression */:
+                case 212 /* FunctionExpression */:
                     return visitFunctionExpression(node);
-                case 249 /* VariableDeclaration */:
+                case 253 /* VariableDeclaration */:
                     return visitVariableDeclaration(node);
-                case 78 /* Identifier */:
+                case 79 /* Identifier */:
                     return visitIdentifier(node);
-                case 250 /* VariableDeclarationList */:
+                case 254 /* VariableDeclarationList */:
                     return visitVariableDeclarationList(node);
-                case 244 /* SwitchStatement */:
+                case 248 /* SwitchStatement */:
                     return visitSwitchStatement(node);
-                case 258 /* CaseBlock */:
+                case 262 /* CaseBlock */:
                     return visitCaseBlock(node);
-                case 230 /* Block */:
+                case 234 /* Block */:
                     return visitBlock(node, /*isFunctionBody*/ false);
-                case 241 /* BreakStatement */:
-                case 240 /* ContinueStatement */:
+                case 245 /* BreakStatement */:
+                case 244 /* ContinueStatement */:
                     return visitBreakOrContinueStatement(node);
-                case 245 /* LabeledStatement */:
+                case 249 /* LabeledStatement */:
                     return visitLabeledStatement(node);
-                case 235 /* DoStatement */:
-                case 236 /* WhileStatement */:
+                case 239 /* DoStatement */:
+                case 240 /* WhileStatement */:
                     return visitDoOrWhileStatement(node, /*outermostLabeledStatement*/ undefined);
-                case 237 /* ForStatement */:
+                case 241 /* ForStatement */:
                     return visitForStatement(node, /*outermostLabeledStatement*/ undefined);
-                case 238 /* ForInStatement */:
+                case 242 /* ForInStatement */:
                     return visitForInStatement(node, /*outermostLabeledStatement*/ undefined);
-                case 239 /* ForOfStatement */:
+                case 243 /* ForOfStatement */:
                     return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined);
-                case 233 /* ExpressionStatement */:
+                case 237 /* ExpressionStatement */:
                     return visitExpressionStatement(node);
-                case 200 /* ObjectLiteralExpression */:
+                case 204 /* ObjectLiteralExpression */:
                     return visitObjectLiteralExpression(node);
-                case 287 /* CatchClause */:
+                case 291 /* CatchClause */:
                     return visitCatchClause(node);
-                case 289 /* ShorthandPropertyAssignment */:
+                case 295 /* ShorthandPropertyAssignment */:
                     return visitShorthandPropertyAssignment(node);
-                case 158 /* ComputedPropertyName */:
+                case 161 /* ComputedPropertyName */:
                     return visitComputedPropertyName(node);
-                case 199 /* ArrayLiteralExpression */:
+                case 203 /* ArrayLiteralExpression */:
                     return visitArrayLiteralExpression(node);
-                case 203 /* CallExpression */:
+                case 207 /* CallExpression */:
                     return visitCallExpression(node);
-                case 204 /* NewExpression */:
+                case 208 /* NewExpression */:
                     return visitNewExpression(node);
-                case 207 /* ParenthesizedExpression */:
+                case 211 /* ParenthesizedExpression */:
                     return visitParenthesizedExpression(node, expressionResultIsUnused);
-                case 216 /* BinaryExpression */:
+                case 220 /* BinaryExpression */:
                     return visitBinaryExpression(node, expressionResultIsUnused);
-                case 337 /* CommaListExpression */:
+                case 349 /* CommaListExpression */:
                     return visitCommaListExpression(node, expressionResultIsUnused);
                 case 14 /* NoSubstitutionTemplateLiteral */:
                 case 15 /* TemplateHead */:
@@ -89388,30 +95969,30 @@ var ts;
                     return visitStringLiteral(node);
                 case 8 /* NumericLiteral */:
                     return visitNumericLiteral(node);
-                case 205 /* TaggedTemplateExpression */:
+                case 209 /* TaggedTemplateExpression */:
                     return visitTaggedTemplateExpression(node);
-                case 218 /* TemplateExpression */:
+                case 222 /* TemplateExpression */:
                     return visitTemplateExpression(node);
-                case 219 /* YieldExpression */:
+                case 223 /* YieldExpression */:
                     return visitYieldExpression(node);
-                case 220 /* SpreadElement */:
+                case 224 /* SpreadElement */:
                     return visitSpreadElement(node);
-                case 105 /* SuperKeyword */:
+                case 106 /* SuperKeyword */:
                     return visitSuperKeyword(/*isExpressionOfCall*/ false);
-                case 107 /* ThisKeyword */:
+                case 108 /* ThisKeyword */:
                     return visitThisKeyword(node);
-                case 226 /* MetaProperty */:
+                case 230 /* MetaProperty */:
                     return visitMetaProperty(node);
-                case 165 /* MethodDeclaration */:
+                case 168 /* MethodDeclaration */:
                     return visitMethodDeclaration(node);
-                case 167 /* GetAccessor */:
-                case 168 /* SetAccessor */:
+                case 171 /* GetAccessor */:
+                case 172 /* SetAccessor */:
                     return visitAccessorDeclaration(node);
-                case 232 /* VariableStatement */:
+                case 236 /* VariableStatement */:
                     return visitVariableStatement(node);
-                case 242 /* ReturnStatement */:
+                case 246 /* ReturnStatement */:
                     return visitReturnStatement(node);
-                case 212 /* VoidExpression */:
+                case 216 /* VoidExpression */:
                     return visitVoidExpression(node);
                 default:
                     return ts.visitEachChild(node, visitor, context);
@@ -89470,8 +96051,8 @@ var ts;
             return ts.visitEachChild(node, visitor, context);
         }
         function visitThisKeyword(node) {
-            if (hierarchyFacts & 2 /* ArrowFunction */) {
-                hierarchyFacts |= 32768 /* CapturedLexicalThis */;
+            if (hierarchyFacts & 2 /* ArrowFunction */ && !(hierarchyFacts & 16384 /* StaticInitializer */)) {
+                hierarchyFacts |= 65536 /* CapturedLexicalThis */;
             }
             if (convertedLoopState) {
                 if (hierarchyFacts & 2 /* ArrowFunction */) {
@@ -89501,14 +96082,14 @@ var ts;
                 // it is possible if either
                 //   - break/continue is labeled and label is located inside the converted loop
                 //   - break/continue is non-labeled and located in non-converted loop/switch statement
-                var jump = node.kind === 241 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */;
+                var jump = node.kind === 245 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */;
                 var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels.get(ts.idText(node.label))) ||
                     (!node.label && (convertedLoopState.allowedNonLabeledJumps & jump));
                 if (!canUseBreakOrContinue) {
                     var labelMarker = void 0;
                     var label = node.label;
                     if (!label) {
-                        if (node.kind === 241 /* BreakStatement */) {
+                        if (node.kind === 245 /* BreakStatement */) {
                             convertedLoopState.nonLocalJumps |= 2 /* Break */;
                             labelMarker = "break";
                         }
@@ -89519,12 +96100,12 @@ var ts;
                         }
                     }
                     else {
-                        if (node.kind === 241 /* BreakStatement */) {
-                            labelMarker = "break-" + label.escapedText;
+                        if (node.kind === 245 /* BreakStatement */) {
+                            labelMarker = "break-".concat(label.escapedText);
                             setLabeledJump(convertedLoopState, /*isBreak*/ true, ts.idText(label), labelMarker);
                         }
                         else {
-                            labelMarker = "continue-" + label.escapedText;
+                            labelMarker = "continue-".concat(label.escapedText);
                             setLabeledJump(convertedLoopState, /*isBreak*/ false, ts.idText(label), labelMarker);
                         }
                     }
@@ -89716,7 +96297,7 @@ var ts;
         function addConstructor(statements, node, name, extendsClauseElement) {
             var savedConvertedLoopState = convertedLoopState;
             convertedLoopState = undefined;
-            var ancestorFacts = enterSubtree(16278 /* ConstructorExcludes */, 73 /* ConstructorIncludes */);
+            var ancestorFacts = enterSubtree(32662 /* ConstructorExcludes */, 73 /* ConstructorIncludes */);
             var constructor = ts.getFirstConstructorWithBody(node);
             var hasSynthesizedSuper = hasSynthesizedDefaultSuperCall(constructor, extendsClauseElement !== undefined);
             var constructorFunction = factory.createFunctionDeclaration(
@@ -89730,7 +96311,7 @@ var ts;
                 ts.setEmitFlags(constructorFunction, 8 /* CapturesThis */);
             }
             statements.push(constructorFunction);
-            exitSubtree(ancestorFacts, 49152 /* FunctionSubtreeExcludes */, 0 /* None */);
+            exitSubtree(ancestorFacts, 98304 /* FunctionSubtreeExcludes */, 0 /* None */);
             convertedLoopState = savedConvertedLoopState;
         }
         /**
@@ -89779,7 +96360,7 @@ var ts;
         function transformConstructorBody(constructor, node, extendsClauseElement, hasSynthesizedSuper) {
             // determine whether the class is known syntactically to be a derived class (e.g. a
             // class that extends a value that is not syntactically known to be `null`).
-            var isDerivedClass = !!extendsClauseElement && ts.skipOuterExpressions(extendsClauseElement.expression).kind !== 103 /* NullKeyword */;
+            var isDerivedClass = !!extendsClauseElement && ts.skipOuterExpressions(extendsClauseElement.expression).kind !== 104 /* NullKeyword */;
             // When the subclass does not have a constructor, we synthesize a *default* constructor using the following
             // representation:
             //
@@ -89831,7 +96412,7 @@ var ts;
             factory.mergeLexicalEnvironment(prologue, endLexicalEnvironment());
             insertCaptureNewTargetIfNeeded(prologue, constructor, /*copyOnWrite*/ false);
             if (isDerivedClass) {
-                if (superCallExpression && statementOffset === constructor.body.statements.length && !(constructor.body.transformFlags & 4096 /* ContainsLexicalThis */)) {
+                if (superCallExpression && statementOffset === constructor.body.statements.length && !(constructor.body.transformFlags & 8192 /* ContainsLexicalThis */)) {
                     // If the subclass constructor does *not* contain `this` and *ends* with a `super()` call, we will use the
                     // following representation:
                     //
@@ -89917,11 +96498,11 @@ var ts;
          */
         function isSufficientlyCoveredByReturnStatements(statement) {
             // A return statement is considered covered.
-            if (statement.kind === 242 /* ReturnStatement */) {
+            if (statement.kind === 246 /* ReturnStatement */) {
                 return true;
             }
             // An if-statement with two covered branches is covered.
-            else if (statement.kind === 234 /* IfStatement */) {
+            else if (statement.kind === 238 /* IfStatement */) {
                 var ifStatement = statement;
                 if (ifStatement.elseStatement) {
                     return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) &&
@@ -89929,7 +96510,7 @@ var ts;
                 }
             }
             // A block is covered if it has a last statement which is covered.
-            else if (statement.kind === 230 /* Block */) {
+            else if (statement.kind === 234 /* Block */) {
                 var lastStatement = ts.lastOrUndefined(statement.statements);
                 if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) {
                     return true;
@@ -90087,10 +96668,10 @@ var ts;
             }
             // `declarationName` is the name of the local declaration for the parameter.
             // TODO(rbuckton): Does this need to be parented?
-            var declarationName = parameter.name.kind === 78 /* Identifier */ ? ts.setParent(ts.setTextRange(factory.cloneNode(parameter.name), parameter.name), parameter.name.parent) : factory.createTempVariable(/*recordTempVariable*/ undefined);
+            var declarationName = parameter.name.kind === 79 /* Identifier */ ? ts.setParent(ts.setTextRange(factory.cloneNode(parameter.name), parameter.name), parameter.name.parent) : factory.createTempVariable(/*recordTempVariable*/ undefined);
             ts.setEmitFlags(declarationName, 48 /* NoSourceMap */);
             // `expressionName` is the name of the parameter used in expressions.
-            var expressionName = parameter.name.kind === 78 /* Identifier */ ? factory.cloneNode(parameter.name) : declarationName;
+            var expressionName = parameter.name.kind === 79 /* Identifier */ ? factory.cloneNode(parameter.name) : declarationName;
             var restIndex = node.parameters.length - 1;
             var temp = factory.createLoopVariable();
             // var param = [];
@@ -90115,7 +96696,7 @@ var ts;
             ts.setEmitFlags(forStatement, 1048576 /* CustomPrologue */);
             ts.startOnNewLine(forStatement);
             prologueStatements.push(forStatement);
-            if (parameter.name.kind !== 78 /* Identifier */) {
+            if (parameter.name.kind !== 79 /* Identifier */) {
                 // do the actual destructuring of the rest parameter if necessary
                 prologueStatements.push(ts.setEmitFlags(ts.setTextRange(factory.createVariableStatement(
                 /*modifiers*/ undefined, factory.createVariableDeclarationList(ts.flattenDestructuringBinding(parameter, visitor, context, 0 /* All */, expressionName))), parameter), 1048576 /* CustomPrologue */));
@@ -90131,7 +96712,7 @@ var ts;
          * @param node A node.
          */
         function insertCaptureThisForNodeIfNeeded(statements, node) {
-            if (hierarchyFacts & 32768 /* CapturedLexicalThis */ && node.kind !== 209 /* ArrowFunction */) {
+            if (hierarchyFacts & 65536 /* CapturedLexicalThis */ && node.kind !== 213 /* ArrowFunction */) {
                 insertCaptureThisForNode(statements, node, factory.createThis());
                 return true;
             }
@@ -90150,28 +96731,28 @@ var ts;
             ts.insertStatementAfterCustomPrologue(statements, captureThisStatement);
         }
         function insertCaptureNewTargetIfNeeded(statements, node, copyOnWrite) {
-            if (hierarchyFacts & 16384 /* NewTarget */) {
+            if (hierarchyFacts & 32768 /* NewTarget */) {
                 var newTarget = void 0;
                 switch (node.kind) {
-                    case 209 /* ArrowFunction */:
+                    case 213 /* ArrowFunction */:
                         return statements;
-                    case 165 /* MethodDeclaration */:
-                    case 167 /* GetAccessor */:
-                    case 168 /* SetAccessor */:
+                    case 168 /* MethodDeclaration */:
+                    case 171 /* GetAccessor */:
+                    case 172 /* SetAccessor */:
                         // Methods and accessors cannot be constructors, so 'new.target' will
                         // always return 'undefined'.
                         newTarget = factory.createVoidZero();
                         break;
-                    case 166 /* Constructor */:
+                    case 170 /* Constructor */:
                         // Class constructors can only be called with `new`, so `this.constructor`
                         // should be relatively safe to use.
                         newTarget = factory.createPropertyAccessExpression(ts.setEmitFlags(factory.createThis(), 4 /* NoSubstitution */), "constructor");
                         break;
-                    case 251 /* FunctionDeclaration */:
-                    case 208 /* FunctionExpression */:
+                    case 255 /* FunctionDeclaration */:
+                    case 212 /* FunctionExpression */:
                         // Functions can be called or constructed, and may have a `this` due to
                         // being a member or when calling an imported function via `other_1.f()`.
-                        newTarget = factory.createConditionalExpression(factory.createLogicalAnd(ts.setEmitFlags(factory.createThis(), 4 /* NoSubstitution */), factory.createBinaryExpression(ts.setEmitFlags(factory.createThis(), 4 /* NoSubstitution */), 101 /* InstanceOfKeyword */, factory.getLocalName(node))), 
+                        newTarget = factory.createConditionalExpression(factory.createLogicalAnd(ts.setEmitFlags(factory.createThis(), 4 /* NoSubstitution */), factory.createBinaryExpression(ts.setEmitFlags(factory.createThis(), 4 /* NoSubstitution */), 102 /* InstanceOfKeyword */, factory.getLocalName(node))), 
                         /*questionToken*/ undefined, factory.createPropertyAccessExpression(ts.setEmitFlags(factory.createThis(), 4 /* NoSubstitution */), "constructor"), 
                         /*colonToken*/ undefined, factory.createVoidZero());
                         break;
@@ -90203,20 +96784,21 @@ var ts;
             for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
                 var member = _a[_i];
                 switch (member.kind) {
-                    case 229 /* SemicolonClassElement */:
+                    case 233 /* SemicolonClassElement */:
                         statements.push(transformSemicolonClassElementToStatement(member));
                         break;
-                    case 165 /* MethodDeclaration */:
+                    case 168 /* MethodDeclaration */:
                         statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node));
                         break;
-                    case 167 /* GetAccessor */:
-                    case 168 /* SetAccessor */:
+                    case 171 /* GetAccessor */:
+                    case 172 /* SetAccessor */:
                         var accessors = ts.getAllAccessorDeclarations(node.members, member);
                         if (member === accessors.firstAccessor) {
                             statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node));
                         }
                         break;
-                    case 166 /* Constructor */:
+                    case 170 /* Constructor */:
+                    case 169 /* ClassStaticBlockDeclaration */:
                         // Constructors are handled in visitClassExpression/visitClassDeclaration
                         break;
                     default:
@@ -90245,7 +96827,7 @@ var ts;
             var memberFunction = transformFunctionLikeToExpression(member, /*location*/ member, /*name*/ undefined, container);
             var propertyName = ts.visitNode(member.name, visitor, ts.isPropertyName);
             var e;
-            if (!ts.isPrivateIdentifier(propertyName) && context.getCompilerOptions().useDefineForClassFields) {
+            if (!ts.isPrivateIdentifier(propertyName) && ts.getUseDefineForClassFields(context.getCompilerOptions())) {
                 var name = ts.isComputedPropertyName(propertyName) ? propertyName.expression
                     : ts.isIdentifier(propertyName) ? factory.createStringLiteral(ts.unescapeLeadingUnderscores(propertyName.escapedText))
                         : propertyName;
@@ -90337,8 +96919,8 @@ var ts;
          * @param node An ArrowFunction node.
          */
         function visitArrowFunction(node) {
-            if (node.transformFlags & 4096 /* ContainsLexicalThis */) {
-                hierarchyFacts |= 32768 /* CapturedLexicalThis */;
+            if (node.transformFlags & 8192 /* ContainsLexicalThis */ && !(hierarchyFacts & 16384 /* StaticInitializer */)) {
+                hierarchyFacts |= 65536 /* CapturedLexicalThis */;
             }
             var savedConvertedLoopState = convertedLoopState;
             convertedLoopState = undefined;
@@ -90352,9 +96934,6 @@ var ts;
             ts.setTextRange(func, node);
             ts.setOriginalNode(func, node);
             ts.setEmitFlags(func, 8 /* CapturesThis */);
-            if (hierarchyFacts & 32768 /* CapturedLexicalThis */) {
-                enableSubstitutionsForCapturedThis();
-            }
             // If an arrow function contains
             exitSubtree(ancestorFacts, 0 /* ArrowFunctionSubtreeExcludes */, 0 /* None */);
             convertedLoopState = savedConvertedLoopState;
@@ -90367,16 +96946,16 @@ var ts;
          */
         function visitFunctionExpression(node) {
             var ancestorFacts = ts.getEmitFlags(node) & 262144 /* AsyncFunctionBody */
-                ? enterSubtree(16278 /* AsyncFunctionBodyExcludes */, 69 /* AsyncFunctionBodyIncludes */)
-                : enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */);
+                ? enterSubtree(32662 /* AsyncFunctionBodyExcludes */, 69 /* AsyncFunctionBodyIncludes */)
+                : enterSubtree(32670 /* FunctionExcludes */, 65 /* FunctionIncludes */);
             var savedConvertedLoopState = convertedLoopState;
             convertedLoopState = undefined;
             var parameters = ts.visitParameterList(node.parameters, visitor, context);
             var body = transformFunctionBody(node);
-            var name = hierarchyFacts & 16384 /* NewTarget */
+            var name = hierarchyFacts & 32768 /* NewTarget */
                 ? factory.getLocalName(node)
                 : node.name;
-            exitSubtree(ancestorFacts, 49152 /* FunctionSubtreeExcludes */, 0 /* None */);
+            exitSubtree(ancestorFacts, 98304 /* FunctionSubtreeExcludes */, 0 /* None */);
             convertedLoopState = savedConvertedLoopState;
             return factory.updateFunctionExpression(node, 
             /*modifiers*/ undefined, node.asteriskToken, name, 
@@ -90391,13 +96970,13 @@ var ts;
         function visitFunctionDeclaration(node) {
             var savedConvertedLoopState = convertedLoopState;
             convertedLoopState = undefined;
-            var ancestorFacts = enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */);
+            var ancestorFacts = enterSubtree(32670 /* FunctionExcludes */, 65 /* FunctionIncludes */);
             var parameters = ts.visitParameterList(node.parameters, visitor, context);
             var body = transformFunctionBody(node);
-            var name = hierarchyFacts & 16384 /* NewTarget */
+            var name = hierarchyFacts & 32768 /* NewTarget */
                 ? factory.getLocalName(node)
                 : node.name;
-            exitSubtree(ancestorFacts, 49152 /* FunctionSubtreeExcludes */, 0 /* None */);
+            exitSubtree(ancestorFacts, 98304 /* FunctionSubtreeExcludes */, 0 /* None */);
             convertedLoopState = savedConvertedLoopState;
             return factory.updateFunctionDeclaration(node, 
             /*decorators*/ undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.asteriskToken, name, 
@@ -90414,15 +96993,15 @@ var ts;
         function transformFunctionLikeToExpression(node, location, name, container) {
             var savedConvertedLoopState = convertedLoopState;
             convertedLoopState = undefined;
-            var ancestorFacts = container && ts.isClassLike(container) && !ts.hasSyntacticModifier(node, 32 /* Static */)
-                ? enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */ | 8 /* NonStaticClassElement */)
-                : enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */);
+            var ancestorFacts = container && ts.isClassLike(container) && !ts.isStatic(node)
+                ? enterSubtree(32670 /* FunctionExcludes */, 65 /* FunctionIncludes */ | 8 /* NonStaticClassElement */)
+                : enterSubtree(32670 /* FunctionExcludes */, 65 /* FunctionIncludes */);
             var parameters = ts.visitParameterList(node.parameters, visitor, context);
             var body = transformFunctionBody(node);
-            if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 251 /* FunctionDeclaration */ || node.kind === 208 /* FunctionExpression */)) {
+            if (hierarchyFacts & 32768 /* NewTarget */ && !name && (node.kind === 255 /* FunctionDeclaration */ || node.kind === 212 /* FunctionExpression */)) {
                 name = factory.getGeneratedNameForNode(node);
             }
-            exitSubtree(ancestorFacts, 49152 /* FunctionSubtreeExcludes */, 0 /* None */);
+            exitSubtree(ancestorFacts, 98304 /* FunctionSubtreeExcludes */, 0 /* None */);
             convertedLoopState = savedConvertedLoopState;
             return ts.setOriginalNode(ts.setTextRange(factory.createFunctionExpression(
             /*modifiers*/ undefined, node.asteriskToken, name, 
@@ -90465,7 +97044,7 @@ var ts;
                 }
             }
             else {
-                ts.Debug.assert(node.kind === 209 /* ArrowFunction */);
+                ts.Debug.assert(node.kind === 213 /* ArrowFunction */);
                 // To align with the old emitter, we use a synthetic end position on the location
                 // for the statement list we synthesize when we down-level an arrow function with
                 // an expression function body. This prevents both comments and source maps from
@@ -90600,7 +97179,7 @@ var ts;
                             assignment = ts.flattenDestructuringAssignment(decl, visitor, context, 0 /* All */);
                         }
                         else {
-                            assignment = factory.createBinaryExpression(decl.name, 62 /* EqualsToken */, ts.visitNode(decl.initializer, visitor, ts.isExpression));
+                            assignment = factory.createBinaryExpression(decl.name, 63 /* EqualsToken */, ts.visitNode(decl.initializer, visitor, ts.isExpression));
                             ts.setTextRange(assignment, decl);
                         }
                         assignments = ts.append(assignments, assignment);
@@ -90626,7 +97205,7 @@ var ts;
          * @param node A VariableDeclarationList node.
          */
         function visitVariableDeclarationList(node) {
-            if (node.flags & 3 /* BlockScoped */ || node.transformFlags & 131072 /* ContainsBindingPattern */) {
+            if (node.flags & 3 /* BlockScoped */ || node.transformFlags & 262144 /* ContainsBindingPattern */) {
                 if (node.flags & 3 /* BlockScoped */) {
                     enableSubstitutionsForBlockScopedBindings();
                 }
@@ -90639,7 +97218,7 @@ var ts;
                 ts.setCommentRange(declarationList, node);
                 // If the first or last declaration is a binding pattern, we need to modify
                 // the source map range for the declaration list.
-                if (node.transformFlags & 131072 /* ContainsBindingPattern */
+                if (node.transformFlags & 262144 /* ContainsBindingPattern */
                     && (ts.isBindingPattern(node.declarations[0].name) || ts.isBindingPattern(ts.last(node.declarations).name))) {
                     ts.setSourceMapRange(declarationList, getRangeUnion(declarations));
                 }
@@ -90651,8 +97230,8 @@ var ts;
             // declarations may not be sorted by position.
             // pos should be the minimum* position over all nodes (that's not -1), end should be the maximum end over all nodes.
             var pos = -1, end = -1;
-            for (var _i = 0, declarations_10 = declarations; _i < declarations_10.length; _i++) {
-                var node = declarations_10[_i];
+            for (var _i = 0, declarations_9 = declarations; _i < declarations_9.length; _i++) {
+                var node = declarations_9[_i];
                 pos = pos === -1 ? node.pos : node.pos === -1 ? pos : Math.min(pos, node.pos);
                 end = Math.max(end, node.end);
             }
@@ -90772,14 +97351,14 @@ var ts;
         }
         function visitIterationStatement(node, outermostLabeledStatement) {
             switch (node.kind) {
-                case 235 /* DoStatement */:
-                case 236 /* WhileStatement */:
+                case 239 /* DoStatement */:
+                case 240 /* WhileStatement */:
                     return visitDoOrWhileStatement(node, outermostLabeledStatement);
-                case 237 /* ForStatement */:
+                case 241 /* ForStatement */:
                     return visitForStatement(node, outermostLabeledStatement);
-                case 238 /* ForInStatement */:
+                case 242 /* ForInStatement */:
                     return visitForInStatement(node, outermostLabeledStatement);
-                case 239 /* ForOfStatement */:
+                case 243 /* ForOfStatement */:
                     return visitForOfStatement(node, outermostLabeledStatement);
             }
         }
@@ -90963,9 +97542,9 @@ var ts;
             var numInitialProperties = -1, hasComputed = false;
             for (var i = 0; i < properties.length; i++) {
                 var property = properties[i];
-                if ((property.transformFlags & 262144 /* ContainsYield */ &&
+                if ((property.transformFlags & 524288 /* ContainsYield */ &&
                     hierarchyFacts & 4 /* AsyncFunctionBody */)
-                    || (hasComputed = ts.Debug.checkDefined(property.name).kind === 158 /* ComputedPropertyName */)) {
+                    || (hasComputed = ts.Debug.checkDefined(property.name).kind === 161 /* ComputedPropertyName */)) {
                     numInitialProperties = i;
                     break;
                 }
@@ -91017,7 +97596,7 @@ var ts;
             }
             visit(node.name);
             function visit(node) {
-                if (node.kind === 78 /* Identifier */) {
+                if (node.kind === 79 /* Identifier */) {
                     state.hoistedLocalVariables.push(node);
                 }
                 else {
@@ -91068,24 +97647,24 @@ var ts;
                     loop = convert(node, outermostLabeledStatement, bodyFunction.part, ancestorFacts);
                 }
                 else {
-                    var clone_3 = convertIterationStatementCore(node, initializerFunction, factory.createBlock(bodyFunction.part, /*multiLine*/ true));
-                    loop = factory.restoreEnclosingLabel(clone_3, outermostLabeledStatement, convertedLoopState && resetLabel);
+                    var clone_4 = convertIterationStatementCore(node, initializerFunction, factory.createBlock(bodyFunction.part, /*multiLine*/ true));
+                    loop = factory.restoreEnclosingLabel(clone_4, outermostLabeledStatement, convertedLoopState && resetLabel);
                 }
             }
             else {
-                var clone_4 = convertIterationStatementCore(node, initializerFunction, ts.visitNode(node.statement, visitor, ts.isStatement, factory.liftToBlock));
-                loop = factory.restoreEnclosingLabel(clone_4, outermostLabeledStatement, convertedLoopState && resetLabel);
+                var clone_5 = convertIterationStatementCore(node, initializerFunction, ts.visitNode(node.statement, visitor, ts.isStatement, factory.liftToBlock));
+                loop = factory.restoreEnclosingLabel(clone_5, outermostLabeledStatement, convertedLoopState && resetLabel);
             }
             statements.push(loop);
             return statements;
         }
         function convertIterationStatementCore(node, initializerFunction, convertedLoopBody) {
             switch (node.kind) {
-                case 237 /* ForStatement */: return convertForStatement(node, initializerFunction, convertedLoopBody);
-                case 238 /* ForInStatement */: return convertForInStatement(node, convertedLoopBody);
-                case 239 /* ForOfStatement */: return convertForOfStatement(node, convertedLoopBody);
-                case 235 /* DoStatement */: return convertDoStatement(node, convertedLoopBody);
-                case 236 /* WhileStatement */: return convertWhileStatement(node, convertedLoopBody);
+                case 241 /* ForStatement */: return convertForStatement(node, initializerFunction, convertedLoopBody);
+                case 242 /* ForInStatement */: return convertForInStatement(node, convertedLoopBody);
+                case 243 /* ForOfStatement */: return convertForOfStatement(node, convertedLoopBody);
+                case 239 /* DoStatement */: return convertDoStatement(node, convertedLoopBody);
+                case 240 /* WhileStatement */: return convertWhileStatement(node, convertedLoopBody);
                 default: return ts.Debug.failBadSyntaxKind(node, "IterationStatement expected");
             }
         }
@@ -91110,11 +97689,11 @@ var ts;
         function createConvertedLoopState(node) {
             var loopInitializer;
             switch (node.kind) {
-                case 237 /* ForStatement */:
-                case 238 /* ForInStatement */:
-                case 239 /* ForOfStatement */:
+                case 241 /* ForStatement */:
+                case 242 /* ForInStatement */:
+                case 243 /* ForOfStatement */:
                     var initializer = node.initializer;
-                    if (initializer && initializer.kind === 250 /* VariableDeclarationList */) {
+                    if (initializer && initializer.kind === 254 /* VariableDeclarationList */) {
                         loopInitializer = initializer;
                     }
                     break;
@@ -91234,7 +97813,7 @@ var ts;
          */
         function createFunctionForInitializerOfForStatement(node, currentState) {
             var functionName = factory.createUniqueName("_loop_init");
-            var containsYield = (node.initializer.transformFlags & 262144 /* ContainsYield */) !== 0;
+            var containsYield = (node.initializer.transformFlags & 524288 /* ContainsYield */) !== 0;
             var emitFlags = 0 /* None */;
             if (currentState.containsLexicalThis)
                 emitFlags |= 8 /* CapturesThis */;
@@ -91349,7 +97928,7 @@ var ts;
             var loopBody = factory.createBlock(statements, /*multiLine*/ true);
             if (ts.isBlock(statement))
                 ts.setOriginalNode(loopBody, statement);
-            var containsYield = (node.statement.transformFlags & 262144 /* ContainsYield */) !== 0;
+            var containsYield = (node.statement.transformFlags & 524288 /* ContainsYield */) !== 0;
             var emitFlags = 524288 /* ReuseTempVariableScope */;
             if (currentState.containsLexicalThis)
                 emitFlags |= 8 /* CapturesThis */;
@@ -91385,7 +97964,7 @@ var ts;
         function copyOutParameter(outParam, copyDirection) {
             var source = copyDirection === 0 /* ToOriginal */ ? outParam.outParamName : outParam.originalName;
             var target = copyDirection === 0 /* ToOriginal */ ? outParam.originalName : outParam.outParamName;
-            return factory.createBinaryExpression(target, 62 /* EqualsToken */, source);
+            return factory.createBinaryExpression(target, 63 /* EqualsToken */, source);
         }
         function copyOutParameters(outParams, partFlags, copyDirection, statements) {
             for (var _i = 0, outParams_1 = outParams; _i < outParams_1.length; _i++) {
@@ -91522,20 +98101,20 @@ var ts;
             for (var i = start; i < numProperties; i++) {
                 var property = properties[i];
                 switch (property.kind) {
-                    case 167 /* GetAccessor */:
-                    case 168 /* SetAccessor */:
+                    case 171 /* GetAccessor */:
+                    case 172 /* SetAccessor */:
                         var accessors = ts.getAllAccessorDeclarations(node.properties, property);
                         if (property === accessors.firstAccessor) {
                             expressions.push(transformAccessorsToExpression(receiver, accessors, node, !!node.multiLine));
                         }
                         break;
-                    case 165 /* MethodDeclaration */:
+                    case 168 /* MethodDeclaration */:
                         expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine));
                         break;
-                    case 288 /* PropertyAssignment */:
+                    case 294 /* PropertyAssignment */:
                         expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine));
                         break;
-                    case 289 /* ShorthandPropertyAssignment */:
+                    case 295 /* ShorthandPropertyAssignment */:
                         expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine));
                         break;
                     default:
@@ -91611,7 +98190,7 @@ var ts;
         }
         function addStatementToStartOfBlock(block, statement) {
             var transformedStatements = ts.visitNodes(block.statements, visitor, ts.isStatement);
-            return factory.updateBlock(block, __spreadArray([statement], transformedStatements));
+            return factory.updateBlock(block, __spreadArray([statement], transformedStatements, true));
         }
         /**
          * Visits a MethodDeclaration of an ObjectLiteralExpression and transforms it into a
@@ -91638,17 +98217,17 @@ var ts;
             ts.Debug.assert(!ts.isComputedPropertyName(node.name));
             var savedConvertedLoopState = convertedLoopState;
             convertedLoopState = undefined;
-            var ancestorFacts = enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */);
+            var ancestorFacts = enterSubtree(32670 /* FunctionExcludes */, 65 /* FunctionIncludes */);
             var updated;
             var parameters = ts.visitParameterList(node.parameters, visitor, context);
             var body = transformFunctionBody(node);
-            if (node.kind === 167 /* GetAccessor */) {
+            if (node.kind === 171 /* GetAccessor */) {
                 updated = factory.updateGetAccessorDeclaration(node, node.decorators, node.modifiers, node.name, parameters, node.type, body);
             }
             else {
                 updated = factory.updateSetAccessorDeclaration(node, node.decorators, node.modifiers, node.name, parameters, body);
             }
-            exitSubtree(ancestorFacts, 49152 /* FunctionSubtreeExcludes */, 0 /* None */);
+            exitSubtree(ancestorFacts, 98304 /* FunctionSubtreeExcludes */, 0 /* None */);
             convertedLoopState = savedConvertedLoopState;
             return updated;
         }
@@ -91681,7 +98260,7 @@ var ts;
         function visitArrayLiteralExpression(node) {
             if (ts.some(node.elements, ts.isSpreadElement)) {
                 // We are here because we contain a SpreadElementExpression.
-                return transformAndSpreadElements(node.elements, /*needsUniqueCopy*/ true, !!node.multiLine, /*hasTrailingComma*/ !!node.elements.hasTrailingComma);
+                return transformAndSpreadElements(node.elements, /*isArgumentList*/ false, !!node.multiLine, /*hasTrailingComma*/ !!node.elements.hasTrailingComma);
             }
             return ts.visitEachChild(node, visitor, context);
         }
@@ -91695,7 +98274,7 @@ var ts;
                 return visitTypeScriptClassWrapper(node);
             }
             var expression = ts.skipOuterExpressions(node.expression);
-            if (expression.kind === 105 /* SuperKeyword */ ||
+            if (expression.kind === 106 /* SuperKeyword */ ||
                 ts.isSuperProperty(expression) ||
                 ts.some(node.arguments, ts.isSpreadElement)) {
                 return visitCallExpressionWithPotentialCapturedThisAssignment(node, /*assignToCapturedThis*/ true);
@@ -91743,7 +98322,7 @@ var ts;
             // visit the class body statements outside of any converted loop body.
             var savedConvertedLoopState = convertedLoopState;
             convertedLoopState = undefined;
-            var bodyStatements = ts.visitNodes(body.statements, visitor, ts.isStatement);
+            var bodyStatements = ts.visitNodes(body.statements, classWrapperStatementVisitor, ts.isStatement);
             convertedLoopState = savedConvertedLoopState;
             var classStatements = ts.filter(bodyStatements, isVariableStatementWithInitializer);
             var remainingStatements = ts.filter(bodyStatements, function (stmt) { return !isVariableStatementWithInitializer(stmt); });
@@ -91768,6 +98347,9 @@ var ts;
             //  }())
             //
             var aliasAssignment = ts.tryCast(initializer, ts.isAssignmentExpression);
+            if (!aliasAssignment && ts.isBinaryExpression(initializer) && initializer.operatorToken.kind === 27 /* CommaToken */) {
+                aliasAssignment = ts.tryCast(initializer.left, ts.isAssignmentExpression);
+            }
             // The underlying call (3) is another IIFE that may contain a '_super' argument.
             var call = ts.cast(aliasAssignment ? ts.skipOuterExpressions(aliasAssignment.right) : initializer, ts.isCallExpression);
             var func = ts.cast(ts.skipOuterExpressions(call.expression), ts.isFunctionExpression);
@@ -91822,15 +98404,15 @@ var ts;
         function visitCallExpressionWithPotentialCapturedThisAssignment(node, assignToCapturedThis) {
             // We are here either because SuperKeyword was used somewhere in the expression, or
             // because we contain a SpreadElementExpression.
-            if (node.transformFlags & 8192 /* ContainsRestOrSpread */ ||
-                node.expression.kind === 105 /* SuperKeyword */ ||
+            if (node.transformFlags & 16384 /* ContainsRestOrSpread */ ||
+                node.expression.kind === 106 /* SuperKeyword */ ||
                 ts.isSuperProperty(ts.skipOuterExpressions(node.expression))) {
                 var _a = factory.createCallBinding(node.expression, hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg;
-                if (node.expression.kind === 105 /* SuperKeyword */) {
+                if (node.expression.kind === 106 /* SuperKeyword */) {
                     ts.setEmitFlags(thisArg, 4 /* NoSubstitution */);
                 }
                 var resultingCall = void 0;
-                if (node.transformFlags & 8192 /* ContainsRestOrSpread */) {
+                if (node.transformFlags & 16384 /* ContainsRestOrSpread */) {
                     // [source]
                     //      f(...a, b)
                     //      x.m(...a, b)
@@ -91844,7 +98426,7 @@ var ts;
                     //      _super.apply(this, a.concat([b]))
                     //      _super.m.apply(this, a.concat([b]))
                     //      _super.prototype.m.apply(this, a.concat([b]))
-                    resultingCall = factory.createFunctionApplyCall(ts.visitNode(target, callExpressionVisitor, ts.isExpression), node.expression.kind === 105 /* SuperKeyword */ ? thisArg : ts.visitNode(thisArg, visitor, ts.isExpression), transformAndSpreadElements(node.arguments, /*needsUniqueCopy*/ false, /*multiLine*/ false, /*hasTrailingComma*/ false));
+                    resultingCall = factory.createFunctionApplyCall(ts.visitNode(target, callExpressionVisitor, ts.isExpression), node.expression.kind === 106 /* SuperKeyword */ ? thisArg : ts.visitNode(thisArg, visitor, ts.isExpression), transformAndSpreadElements(node.arguments, /*isArgumentList*/ true, /*multiLine*/ false, /*hasTrailingComma*/ false));
                 }
                 else {
                     // [source]
@@ -91856,9 +98438,9 @@ var ts;
                     //      _super.call(this, a)
                     //      _super.m.call(this, a)
                     //      _super.prototype.m.call(this, a)
-                    resultingCall = ts.setTextRange(factory.createFunctionCallCall(ts.visitNode(target, callExpressionVisitor, ts.isExpression), node.expression.kind === 105 /* SuperKeyword */ ? thisArg : ts.visitNode(thisArg, visitor, ts.isExpression), ts.visitNodes(node.arguments, visitor, ts.isExpression)), node);
+                    resultingCall = ts.setTextRange(factory.createFunctionCallCall(ts.visitNode(target, callExpressionVisitor, ts.isExpression), node.expression.kind === 106 /* SuperKeyword */ ? thisArg : ts.visitNode(thisArg, visitor, ts.isExpression), ts.visitNodes(node.arguments, visitor, ts.isExpression)), node);
                 }
-                if (node.expression.kind === 105 /* SuperKeyword */) {
+                if (node.expression.kind === 106 /* SuperKeyword */) {
                     var initializer = factory.createLogicalOr(resultingCall, createActualThis());
                     resultingCall = assignToCapturedThis
                         ? factory.createAssignment(factory.createUniqueName("_this", 16 /* Optimistic */ | 32 /* FileLevel */), initializer)
@@ -91882,7 +98464,7 @@ var ts;
                 // [output]
                 //      new ((_a = C).bind.apply(_a, [void 0].concat(a)))()
                 var _a = factory.createCallBinding(factory.createPropertyAccessExpression(node.expression, "bind"), hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg;
-                return factory.createNewExpression(factory.createFunctionApplyCall(ts.visitNode(target, visitor, ts.isExpression), thisArg, transformAndSpreadElements(factory.createNodeArray(__spreadArray([factory.createVoidZero()], node.arguments)), /*needsUniqueCopy*/ false, /*multiLine*/ false, /*hasTrailingComma*/ false)), 
+                return factory.createNewExpression(factory.createFunctionApplyCall(ts.visitNode(target, visitor, ts.isExpression), thisArg, transformAndSpreadElements(factory.createNodeArray(__spreadArray([factory.createVoidZero()], node.arguments, true)), /*isArgumentList*/ true, /*multiLine*/ false, /*hasTrailingComma*/ false)), 
                 /*typeArguments*/ undefined, []);
             }
             return ts.visitEachChild(node, visitor, context);
@@ -91891,12 +98473,12 @@ var ts;
          * Transforms an array of Expression nodes that contains a SpreadExpression.
          *
          * @param elements The array of Expression nodes.
-         * @param needsUniqueCopy A value indicating whether to ensure that the result is a fresh array.
-         * This should be `true` when spreading into an `ArrayLiteral`, and `false` when spreading into an
+         * @param isArgumentList A value indicating whether to ensure that the result is a fresh array.
+         * This should be `false` when spreading into an `ArrayLiteral`, and `true` when spreading into an
          * argument list.
          * @param multiLine A value indicating whether the result should be emitted on multiple lines.
          */
-        function transformAndSpreadElements(elements, needsUniqueCopy, multiLine, hasTrailingComma) {
+        function transformAndSpreadElements(elements, isArgumentList, multiLine, hasTrailingComma) {
             // When there is no leading SpreadElement:
             //
             // [source]
@@ -91930,7 +98512,11 @@ var ts;
             // Map spans of spread expressions into their expressions and spans of other
             // expressions into an array literal.
             var numElements = elements.length;
-            var segments = ts.flatten(ts.spanMap(elements, partitionSpread, function (partition, visitPartition, _start, end) {
+            var segments = ts.flatten(
+            // 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]`
+            ts.spanMap(elements, partitionSpread, function (partition, visitPartition, _start, end) {
                 return visitPartition(partition, multiLine, hasTrailingComma && end === numElements);
             }));
             if (segments.length === 1) {
@@ -91939,20 +98525,20 @@ var ts;
                 // a CallExpression or NewExpression. When using `--downlevelIteration`, we need
                 // to coerce this into an array for use with `apply`, so we will use the code path
                 // that follows instead.
-                if (!needsUniqueCopy && !compilerOptions.downlevelIteration
-                    || ts.isPackedArrayLiteral(firstSegment) // see NOTE (above)
-                    || ts.isCallToHelper(firstSegment, "___spreadArray")) {
-                    return segments[0];
+                if (isArgumentList && !compilerOptions.downlevelIteration
+                    || ts.isPackedArrayLiteral(firstSegment.expression) // see NOTE (above)
+                    || ts.isCallToHelper(firstSegment.expression, "___spreadArray")) {
+                    return firstSegment.expression;
                 }
             }
             var helpers = emitHelpers();
-            var startsWithSpread = ts.isSpreadElement(elements[0]);
+            var startsWithSpread = segments[0].kind !== 0 /* None */;
             var expression = startsWithSpread ? factory.createArrayLiteralExpression() :
-                segments[0];
+                segments[0].expression;
             for (var i = startsWithSpread ? 0 : 1; i < segments.length; i++) {
-                expression = helpers.createSpreadArrayHelper(expression, compilerOptions.downlevelIteration && !ts.isPackedArrayLiteral(segments[i]) ? // see NOTE (above)
-                    helpers.createReadHelper(segments[i], /*count*/ undefined) :
-                    segments[i]);
+                var segment = segments[i];
+                // If this is for an argument list, it doesn't matter if the array is packed or sparse
+                expression = helpers.createSpreadArrayHelper(expression, segment.expression, segment.kind === 1 /* UnpackedSpread */ && !isArgumentList);
             }
             return expression;
         }
@@ -91964,20 +98550,28 @@ var ts;
         function visitSpanOfSpreads(chunk) {
             return ts.map(chunk, visitExpressionOfSpread);
         }
+        function visitExpressionOfSpread(node) {
+            var expression = ts.visitNode(node.expression, visitor, ts.isExpression);
+            // We don't need to pack already packed array literals, or existing calls to the `__read` helper.
+            var isCallToReadHelper = ts.isCallToHelper(expression, "___read");
+            var kind = isCallToReadHelper || ts.isPackedArrayLiteral(expression) ? 2 /* PackedSpread */ : 1 /* UnpackedSpread */;
+            // We don't need the `__read` helper for array literals. Array packing will be performed by `__spreadArray`.
+            if (compilerOptions.downlevelIteration && kind === 1 /* UnpackedSpread */ && !ts.isArrayLiteralExpression(expression) && !isCallToReadHelper) {
+                expression = emitHelpers().createReadHelper(expression, /*count*/ undefined);
+                // the `__read` helper returns a packed array, so we don't need to ensure a packed array
+                kind = 2 /* PackedSpread */;
+            }
+            return createSpreadSegment(kind, expression);
+        }
         function visitSpanOfNonSpreads(chunk, multiLine, hasTrailingComma) {
-            return factory.createArrayLiteralExpression(ts.visitNodes(factory.createNodeArray(chunk, hasTrailingComma), visitor, ts.isExpression), multiLine);
+            var expression = factory.createArrayLiteralExpression(ts.visitNodes(factory.createNodeArray(chunk, hasTrailingComma), visitor, ts.isExpression), multiLine);
+            // We do not pack non-spread segments, this is so that `[1, , ...[2, , 3], , 4]` is properly downleveled to
+            // `[1, , 2, undefined, 3, , 4]`. See the NOTE in `transformAndSpreadElements`
+            return createSpreadSegment(0 /* None */, expression);
         }
         function visitSpreadElement(node) {
             return ts.visitNode(node.expression, visitor, ts.isExpression);
         }
-        /**
-         * Transforms the expression of a SpreadExpression node.
-         *
-         * @param node A SpreadExpression node.
-         */
-        function visitExpressionOfSpread(node) {
-            return ts.visitNode(node.expression, visitor, ts.isExpression);
-        }
         /**
          * Visits a template literal.
          *
@@ -92022,78 +98616,17 @@ var ts;
          * @param node A TemplateExpression node.
          */
         function visitTemplateExpression(node) {
-            var expressions = [];
-            addTemplateHead(expressions, node);
-            addTemplateSpans(expressions, node);
-            // createAdd will check if each expression binds less closely than binary '+'.
-            // If it does, it wraps the expression in parentheses. Otherwise, something like
-            //    `abc${ 1 << 2 }`
-            // becomes
-            //    "abc" + 1 << 2 + ""
-            // which is really
-            //    ("abc" + 1) << (2 + "")
-            // rather than
-            //    "abc" + (1 << 2) + ""
-            var expression = ts.reduceLeft(expressions, factory.createAdd);
-            if (ts.nodeIsSynthesized(expression)) {
-                ts.setTextRange(expression, node);
-            }
-            return expression;
-        }
-        /**
-         * Gets a value indicating whether we need to include the head of a TemplateExpression.
-         *
-         * @param node A TemplateExpression node.
-         */
-        function shouldAddTemplateHead(node) {
-            // If this expression has an empty head literal and the first template span has a non-empty
-            // literal, then emitting the empty head literal is not necessary.
-            //     `${ foo } and ${ bar }`
-            // can be emitted as
-            //     foo + " and " + bar
-            // This is because it is only required that one of the first two operands in the emit
-            // output must be a string literal, so that the other operand and all following operands
-            // are forced into strings.
-            //
-            // If the first template span has an empty literal, then the head must still be emitted.
-            //     `${ foo }${ bar }`
-            // must still be emitted as
-            //     "" + foo + bar
-            // There is always atleast one templateSpan in this code path, since
-            // NoSubstitutionTemplateLiterals are directly emitted via emitLiteral()
-            ts.Debug.assert(node.templateSpans.length !== 0);
-            return node.head.text.length !== 0 || node.templateSpans[0].literal.text.length === 0;
-        }
-        /**
-         * Adds the head of a TemplateExpression to an array of expressions.
-         *
-         * @param expressions An array of expressions.
-         * @param node A TemplateExpression node.
-         */
-        function addTemplateHead(expressions, node) {
-            if (!shouldAddTemplateHead(node)) {
-                return;
-            }
-            expressions.push(factory.createStringLiteral(node.head.text));
-        }
-        /**
-         * Visits and adds the template spans of a TemplateExpression to an array of expressions.
-         *
-         * @param expressions An array of expressions.
-         * @param node A TemplateExpression node.
-         */
-        function addTemplateSpans(expressions, node) {
+            var expression = factory.createStringLiteral(node.head.text);
             for (var _i = 0, _a = node.templateSpans; _i < _a.length; _i++) {
                 var span = _a[_i];
-                expressions.push(ts.visitNode(span.expression, visitor, ts.isExpression));
-                // Only emit if the literal is non-empty.
-                // The binary '+' operator is left-associative, so the first string concatenation
-                // with the head will force the result up to this point to be a string.
-                // Emitting a '+ ""' has no semantic effect for middles and tails.
-                if (span.literal.text.length !== 0) {
-                    expressions.push(factory.createStringLiteral(span.literal.text));
+                var args = [ts.visitNode(span.expression, visitor, ts.isExpression)];
+                if (span.literal.text.length > 0) {
+                    args.push(factory.createStringLiteral(span.literal.text));
                 }
+                expression = factory.createCallExpression(factory.createPropertyAccessExpression(expression, "concat"), 
+                /*typeArguments*/ undefined, args);
             }
+            return ts.setTextRange(expression, node);
         }
         /**
          * Visits the `super` keyword
@@ -92105,8 +98638,8 @@ var ts;
                 : factory.createUniqueName("_super", 16 /* Optimistic */ | 32 /* FileLevel */);
         }
         function visitMetaProperty(node) {
-            if (node.keywordToken === 102 /* NewKeyword */ && node.name.escapedText === "target") {
-                hierarchyFacts |= 16384 /* NewTarget */;
+            if (node.keywordToken === 103 /* NewKeyword */ && node.name.escapedText === "target") {
+                hierarchyFacts |= 32768 /* NewTarget */;
                 return factory.createUniqueName("_newTarget", 16 /* Optimistic */ | 32 /* FileLevel */);
             }
             return node;
@@ -92121,7 +98654,7 @@ var ts;
         function onEmitNode(hint, node, emitCallback) {
             if (enabledSubstitutions & 1 /* CapturedThis */ && ts.isFunctionLike(node)) {
                 // If we are tracking a captured `this`, keep track of the enclosing function.
-                var ancestorFacts = enterSubtree(16286 /* FunctionExcludes */, ts.getEmitFlags(node) & 8 /* CapturesThis */
+                var ancestorFacts = enterSubtree(32670 /* FunctionExcludes */, ts.getEmitFlags(node) & 8 /* CapturesThis */
                     ? 65 /* FunctionIncludes */ | 16 /* CapturesThis */
                     : 65 /* FunctionIncludes */);
                 previousOnEmitNode(hint, node, emitCallback);
@@ -92137,7 +98670,7 @@ var ts;
         function enableSubstitutionsForBlockScopedBindings() {
             if ((enabledSubstitutions & 2 /* BlockScopedBindings */) === 0) {
                 enabledSubstitutions |= 2 /* BlockScopedBindings */;
-                context.enableSubstitution(78 /* Identifier */);
+                context.enableSubstitution(79 /* Identifier */);
             }
         }
         /**
@@ -92147,14 +98680,14 @@ var ts;
         function enableSubstitutionsForCapturedThis() {
             if ((enabledSubstitutions & 1 /* CapturedThis */) === 0) {
                 enabledSubstitutions |= 1 /* CapturedThis */;
-                context.enableSubstitution(107 /* ThisKeyword */);
-                context.enableEmitNotification(166 /* Constructor */);
-                context.enableEmitNotification(165 /* MethodDeclaration */);
-                context.enableEmitNotification(167 /* GetAccessor */);
-                context.enableEmitNotification(168 /* SetAccessor */);
-                context.enableEmitNotification(209 /* ArrowFunction */);
-                context.enableEmitNotification(208 /* FunctionExpression */);
-                context.enableEmitNotification(251 /* FunctionDeclaration */);
+                context.enableSubstitution(108 /* ThisKeyword */);
+                context.enableEmitNotification(170 /* Constructor */);
+                context.enableEmitNotification(168 /* MethodDeclaration */);
+                context.enableEmitNotification(171 /* GetAccessor */);
+                context.enableEmitNotification(172 /* SetAccessor */);
+                context.enableEmitNotification(213 /* ArrowFunction */);
+                context.enableEmitNotification(212 /* FunctionExpression */);
+                context.enableEmitNotification(255 /* FunctionDeclaration */);
             }
         }
         /**
@@ -92195,10 +98728,10 @@ var ts;
          */
         function isNameOfDeclarationWithCollidingName(node) {
             switch (node.parent.kind) {
-                case 198 /* BindingElement */:
-                case 252 /* ClassDeclaration */:
-                case 255 /* EnumDeclaration */:
-                case 249 /* VariableDeclaration */:
+                case 202 /* BindingElement */:
+                case 256 /* ClassDeclaration */:
+                case 259 /* EnumDeclaration */:
+                case 253 /* VariableDeclaration */:
                     return node.parent.name === node
                         && resolver.isDeclarationWithCollidingName(node.parent);
             }
@@ -92211,9 +98744,9 @@ var ts;
          */
         function substituteExpression(node) {
             switch (node.kind) {
-                case 78 /* Identifier */:
+                case 79 /* Identifier */:
                     return substituteExpressionIdentifier(node);
-                case 107 /* ThisKeyword */:
+                case 108 /* ThisKeyword */:
                     return substituteThisKeyword(node);
             }
             return node;
@@ -92268,7 +98801,7 @@ var ts;
             return node;
         }
         function getClassMemberPrefix(node, member) {
-            return ts.hasSyntacticModifier(member, 32 /* Static */)
+            return ts.isStatic(member)
                 ? factory.getInternalName(node)
                 : factory.createPropertyAccessExpression(factory.getInternalName(node), "prototype");
         }
@@ -92280,19 +98813,19 @@ var ts;
                 return false;
             }
             var statement = ts.firstOrUndefined(constructor.body.statements);
-            if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 233 /* ExpressionStatement */) {
+            if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 237 /* ExpressionStatement */) {
                 return false;
             }
             var statementExpression = statement.expression;
-            if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 203 /* CallExpression */) {
+            if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 207 /* CallExpression */) {
                 return false;
             }
             var callTarget = statementExpression.expression;
-            if (!ts.nodeIsSynthesized(callTarget) || callTarget.kind !== 105 /* SuperKeyword */) {
+            if (!ts.nodeIsSynthesized(callTarget) || callTarget.kind !== 106 /* SuperKeyword */) {
                 return false;
             }
             var callArgument = ts.singleOrUndefined(statementExpression.arguments);
-            if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 220 /* SpreadElement */) {
+            if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 224 /* SpreadElement */) {
                 return false;
             }
             var expression = callArgument.expression;
@@ -92318,15 +98851,15 @@ var ts;
         if (compilerOptions.jsx === 1 /* Preserve */ || compilerOptions.jsx === 3 /* ReactNative */) {
             previousOnEmitNode = context.onEmitNode;
             context.onEmitNode = onEmitNode;
-            context.enableEmitNotification(275 /* JsxOpeningElement */);
-            context.enableEmitNotification(276 /* JsxClosingElement */);
-            context.enableEmitNotification(274 /* JsxSelfClosingElement */);
+            context.enableEmitNotification(279 /* JsxOpeningElement */);
+            context.enableEmitNotification(280 /* JsxClosingElement */);
+            context.enableEmitNotification(278 /* JsxSelfClosingElement */);
             noSubstitution = [];
         }
         var previousOnSubstituteNode = context.onSubstituteNode;
         context.onSubstituteNode = onSubstituteNode;
-        context.enableSubstitution(201 /* PropertyAccessExpression */);
-        context.enableSubstitution(288 /* PropertyAssignment */);
+        context.enableSubstitution(205 /* PropertyAccessExpression */);
+        context.enableSubstitution(294 /* PropertyAssignment */);
         return ts.chainBundle(context, transformSourceFile);
         /**
          * Transforms an ES5 source file to ES3.
@@ -92345,9 +98878,9 @@ var ts;
          */
         function onEmitNode(hint, node, emitCallback) {
             switch (node.kind) {
-                case 275 /* JsxOpeningElement */:
-                case 276 /* JsxClosingElement */:
-                case 274 /* JsxSelfClosingElement */:
+                case 279 /* JsxOpeningElement */:
+                case 280 /* JsxClosingElement */:
+                case 278 /* JsxSelfClosingElement */:
                     var tagName = node.tagName;
                     noSubstitution[ts.getOriginalNodeId(tagName)] = true;
                     break;
@@ -92407,7 +98940,7 @@ var ts;
          */
         function trySubstituteReservedName(name) {
             var token = name.originalKeywordKind || (ts.nodeIsSynthesized(name) ? ts.stringToToken(ts.idText(name)) : undefined);
-            if (token !== undefined && token >= 80 /* FirstReservedWord */ && token <= 115 /* LastReservedWord */) {
+            if (token !== undefined && token >= 81 /* FirstReservedWord */ && token <= 116 /* LastReservedWord */) {
                 return ts.setTextRange(factory.createStringLiteralFromNode(name), name);
             }
             return undefined;
@@ -92645,7 +99178,7 @@ var ts;
         var withBlockStack; // A stack containing `with` blocks.
         return ts.chainBundle(context, transformSourceFile);
         function transformSourceFile(node) {
-            if (node.isDeclarationFile || (node.transformFlags & 512 /* ContainsGenerator */) === 0) {
+            if (node.isDeclarationFile || (node.transformFlags & 1024 /* ContainsGenerator */) === 0) {
                 return node;
             }
             var visited = ts.visitEachChild(node, visitor, context);
@@ -92668,7 +99201,7 @@ var ts;
             else if (ts.isFunctionLikeDeclaration(node) && node.asteriskToken) {
                 return visitGenerator(node);
             }
-            else if (transformFlags & 512 /* ContainsGenerator */) {
+            else if (transformFlags & 1024 /* ContainsGenerator */) {
                 return ts.visitEachChild(node, visitor, context);
             }
             else {
@@ -92682,13 +99215,13 @@ var ts;
          */
         function visitJavaScriptInStatementContainingYield(node) {
             switch (node.kind) {
-                case 235 /* DoStatement */:
+                case 239 /* DoStatement */:
                     return visitDoStatement(node);
-                case 236 /* WhileStatement */:
+                case 240 /* WhileStatement */:
                     return visitWhileStatement(node);
-                case 244 /* SwitchStatement */:
+                case 248 /* SwitchStatement */:
                     return visitSwitchStatement(node);
-                case 245 /* LabeledStatement */:
+                case 249 /* LabeledStatement */:
                     return visitLabeledStatement(node);
                 default:
                     return visitJavaScriptInGeneratorFunctionBody(node);
@@ -92701,30 +99234,30 @@ var ts;
          */
         function visitJavaScriptInGeneratorFunctionBody(node) {
             switch (node.kind) {
-                case 251 /* FunctionDeclaration */:
+                case 255 /* FunctionDeclaration */:
                     return visitFunctionDeclaration(node);
-                case 208 /* FunctionExpression */:
+                case 212 /* FunctionExpression */:
                     return visitFunctionExpression(node);
-                case 167 /* GetAccessor */:
-                case 168 /* SetAccessor */:
+                case 171 /* GetAccessor */:
+                case 172 /* SetAccessor */:
                     return visitAccessorDeclaration(node);
-                case 232 /* VariableStatement */:
+                case 236 /* VariableStatement */:
                     return visitVariableStatement(node);
-                case 237 /* ForStatement */:
+                case 241 /* ForStatement */:
                     return visitForStatement(node);
-                case 238 /* ForInStatement */:
+                case 242 /* ForInStatement */:
                     return visitForInStatement(node);
-                case 241 /* BreakStatement */:
+                case 245 /* BreakStatement */:
                     return visitBreakStatement(node);
-                case 240 /* ContinueStatement */:
+                case 244 /* ContinueStatement */:
                     return visitContinueStatement(node);
-                case 242 /* ReturnStatement */:
+                case 246 /* ReturnStatement */:
                     return visitReturnStatement(node);
                 default:
-                    if (node.transformFlags & 262144 /* ContainsYield */) {
+                    if (node.transformFlags & 524288 /* ContainsYield */) {
                         return visitJavaScriptContainingYield(node);
                     }
-                    else if (node.transformFlags & (512 /* ContainsGenerator */ | 1048576 /* ContainsHoistedDeclarationOrCompletion */)) {
+                    else if (node.transformFlags & (1024 /* ContainsGenerator */ | 2097152 /* ContainsHoistedDeclarationOrCompletion */)) {
                         return ts.visitEachChild(node, visitor, context);
                     }
                     else {
@@ -92739,23 +99272,23 @@ var ts;
          */
         function visitJavaScriptContainingYield(node) {
             switch (node.kind) {
-                case 216 /* BinaryExpression */:
+                case 220 /* BinaryExpression */:
                     return visitBinaryExpression(node);
-                case 337 /* CommaListExpression */:
+                case 349 /* CommaListExpression */:
                     return visitCommaListExpression(node);
-                case 217 /* ConditionalExpression */:
+                case 221 /* ConditionalExpression */:
                     return visitConditionalExpression(node);
-                case 219 /* YieldExpression */:
+                case 223 /* YieldExpression */:
                     return visitYieldExpression(node);
-                case 199 /* ArrayLiteralExpression */:
+                case 203 /* ArrayLiteralExpression */:
                     return visitArrayLiteralExpression(node);
-                case 200 /* ObjectLiteralExpression */:
+                case 204 /* ObjectLiteralExpression */:
                     return visitObjectLiteralExpression(node);
-                case 202 /* ElementAccessExpression */:
+                case 206 /* ElementAccessExpression */:
                     return visitElementAccessExpression(node);
-                case 203 /* CallExpression */:
+                case 207 /* CallExpression */:
                     return visitCallExpression(node);
-                case 204 /* NewExpression */:
+                case 208 /* NewExpression */:
                     return visitNewExpression(node);
                 default:
                     return ts.visitEachChild(node, visitor, context);
@@ -92768,9 +99301,9 @@ var ts;
          */
         function visitGenerator(node) {
             switch (node.kind) {
-                case 251 /* FunctionDeclaration */:
+                case 255 /* FunctionDeclaration */:
                     return visitFunctionDeclaration(node);
-                case 208 /* FunctionExpression */:
+                case 212 /* FunctionExpression */:
                     return visitFunctionExpression(node);
                 default:
                     return ts.Debug.failBadSyntaxKind(node);
@@ -92929,7 +99462,7 @@ var ts;
          * @param node The node to visit.
          */
         function visitVariableStatement(node) {
-            if (node.transformFlags & 262144 /* ContainsYield */) {
+            if (node.transformFlags & 524288 /* ContainsYield */) {
                 transformAndEmitVariableDeclarationList(node.declarationList);
                 return undefined;
             }
@@ -92978,7 +99511,7 @@ var ts;
             if (containsYield(right)) {
                 var target = void 0;
                 switch (left.kind) {
-                    case 201 /* PropertyAccessExpression */:
+                    case 205 /* PropertyAccessExpression */:
                         // [source]
                         //      a.b = yield;
                         //
@@ -92990,7 +99523,7 @@ var ts;
                         //      _a.b = %sent%;
                         target = factory.updatePropertyAccessExpression(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), left.name);
                         break;
-                    case 202 /* ElementAccessExpression */:
+                    case 206 /* ElementAccessExpression */:
                         // [source]
                         //      a[b] = yield;
                         //
@@ -93237,13 +99770,13 @@ var ts;
                 temp = declareLocal();
                 var initialElements = ts.visitNodes(elements, visitor, ts.isExpression, 0, numInitialElements);
                 emitAssignment(temp, factory.createArrayLiteralExpression(leadingElement
-                    ? __spreadArray([leadingElement], initialElements) : initialElements));
+                    ? __spreadArray([leadingElement], initialElements, true) : initialElements));
                 leadingElement = undefined;
             }
             var expressions = ts.reduceLeft(elements, reduceElement, [], numInitialElements);
             return temp
                 ? factory.createArrayConcatCall(temp, [factory.createArrayLiteralExpression(expressions, multiLine)])
-                : ts.setTextRange(factory.createArrayLiteralExpression(leadingElement ? __spreadArray([leadingElement], expressions) : expressions, multiLine), location);
+                : ts.setTextRange(factory.createArrayLiteralExpression(leadingElement ? __spreadArray([leadingElement], expressions, true) : expressions, multiLine), location);
             function reduceElement(expressions, element) {
                 if (containsYield(element) && expressions.length > 0) {
                     var hasAssignedTemp = temp !== undefined;
@@ -93252,7 +99785,7 @@ var ts;
                     }
                     emitAssignment(temp, hasAssignedTemp
                         ? factory.createArrayConcatCall(temp, [factory.createArrayLiteralExpression(expressions, multiLine)])
-                        : factory.createArrayLiteralExpression(leadingElement ? __spreadArray([leadingElement], expressions) : expressions, multiLine));
+                        : factory.createArrayLiteralExpression(leadingElement ? __spreadArray([leadingElement], expressions, true) : expressions, multiLine));
                     leadingElement = undefined;
                     expressions = [];
                 }
@@ -93384,35 +99917,35 @@ var ts;
         }
         function transformAndEmitStatementWorker(node) {
             switch (node.kind) {
-                case 230 /* Block */:
+                case 234 /* Block */:
                     return transformAndEmitBlock(node);
-                case 233 /* ExpressionStatement */:
+                case 237 /* ExpressionStatement */:
                     return transformAndEmitExpressionStatement(node);
-                case 234 /* IfStatement */:
+                case 238 /* IfStatement */:
                     return transformAndEmitIfStatement(node);
-                case 235 /* DoStatement */:
+                case 239 /* DoStatement */:
                     return transformAndEmitDoStatement(node);
-                case 236 /* WhileStatement */:
+                case 240 /* WhileStatement */:
                     return transformAndEmitWhileStatement(node);
-                case 237 /* ForStatement */:
+                case 241 /* ForStatement */:
                     return transformAndEmitForStatement(node);
-                case 238 /* ForInStatement */:
+                case 242 /* ForInStatement */:
                     return transformAndEmitForInStatement(node);
-                case 240 /* ContinueStatement */:
+                case 244 /* ContinueStatement */:
                     return transformAndEmitContinueStatement(node);
-                case 241 /* BreakStatement */:
+                case 245 /* BreakStatement */:
                     return transformAndEmitBreakStatement(node);
-                case 242 /* ReturnStatement */:
+                case 246 /* ReturnStatement */:
                     return transformAndEmitReturnStatement(node);
-                case 243 /* WithStatement */:
+                case 247 /* WithStatement */:
                     return transformAndEmitWithStatement(node);
-                case 244 /* SwitchStatement */:
+                case 248 /* SwitchStatement */:
                     return transformAndEmitSwitchStatement(node);
-                case 245 /* LabeledStatement */:
+                case 249 /* LabeledStatement */:
                     return transformAndEmitLabeledStatement(node);
-                case 246 /* ThrowStatement */:
+                case 250 /* ThrowStatement */:
                     return transformAndEmitThrowStatement(node);
-                case 247 /* TryStatement */:
+                case 251 /* TryStatement */:
                     return transformAndEmitTryStatement(node);
                 default:
                     return emitStatement(ts.visitNode(node, visitor, ts.isStatement));
@@ -93632,7 +100165,7 @@ var ts;
                 var variables = ts.getInitializedVariables(initializer);
                 node = factory.updateForStatement(node, variables.length > 0
                     ? factory.inlineExpressions(ts.map(variables, transformInitializedVariable))
-                    : undefined, ts.visitNode(node.condition, visitor, ts.isExpression), ts.visitNode(node.incrementor, visitor, ts.isExpression), ts.visitNode(node.statement, visitor, ts.isStatement, factory.liftToBlock));
+                    : undefined, ts.visitNode(node.condition, visitor, ts.isExpression), ts.visitNode(node.incrementor, visitor, ts.isExpression), ts.visitIterationBody(node.statement, visitor, context));
             }
             else {
                 node = ts.visitEachChild(node, visitor, context);
@@ -93842,7 +100375,7 @@ var ts;
                 for (var i = 0; i < numClauses; i++) {
                     var clause = caseBlock.clauses[i];
                     clauseLabels.push(defineLabel());
-                    if (clause.kind === 285 /* DefaultClause */ && defaultClauseIndex === -1) {
+                    if (clause.kind === 289 /* DefaultClause */ && defaultClauseIndex === -1) {
                         defaultClauseIndex = i;
                     }
                 }
@@ -93855,7 +100388,7 @@ var ts;
                     var defaultClausesSkipped = 0;
                     for (var i = clausesWritten; i < numClauses; i++) {
                         var clause = caseBlock.clauses[i];
-                        if (clause.kind === 284 /* CaseClause */) {
+                        if (clause.kind === 288 /* CaseClause */) {
                             if (containsYield(clause.expression) && pendingClauses.length > 0) {
                                 break;
                             }
@@ -93987,7 +100520,7 @@ var ts;
             }
         }
         function containsYield(node) {
-            return !!node && (node.transformFlags & 262144 /* ContainsYield */) !== 0;
+            return !!node && (node.transformFlags & 524288 /* ContainsYield */) !== 0;
         }
         function countInitialNodesWithoutYield(nodes) {
             var numNodes = nodes.length;
@@ -94020,10 +100553,10 @@ var ts;
                         var name = renamedCatchVariableDeclarations[ts.getOriginalNodeId(declaration)];
                         if (name) {
                             // TODO(rbuckton): Does this need to be parented?
-                            var clone_5 = ts.setParent(ts.setTextRange(factory.cloneNode(name), name), name.parent);
-                            ts.setSourceMapRange(clone_5, node);
-                            ts.setCommentRange(clone_5, node);
-                            return clone_5;
+                            var clone_6 = ts.setParent(ts.setTextRange(factory.cloneNode(name), name), name.parent);
+                            ts.setSourceMapRange(clone_6, node);
+                            ts.setCommentRange(clone_6, node);
+                            return clone_6;
                         }
                     }
                 }
@@ -94169,7 +100702,7 @@ var ts;
                 if (!renamedCatchVariables) {
                     renamedCatchVariables = new ts.Map();
                     renamedCatchVariableDeclarations = [];
-                    context.enableSubstitution(78 /* Identifier */);
+                    context.enableSubstitution(79 /* Identifier */);
                 }
                 renamedCatchVariables.set(text, true);
                 renamedCatchVariableDeclarations[ts.getOriginalNodeId(variable)] = name;
@@ -95015,17 +101548,17 @@ var ts;
         var previousOnEmitNode = context.onEmitNode;
         context.onSubstituteNode = onSubstituteNode;
         context.onEmitNode = onEmitNode;
-        context.enableSubstitution(78 /* Identifier */); // Substitutes expression identifiers with imported/exported symbols.
-        context.enableSubstitution(216 /* BinaryExpression */); // Substitutes assignments to exported symbols.
-        context.enableSubstitution(214 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols.
-        context.enableSubstitution(215 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols.
-        context.enableSubstitution(289 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols.
-        context.enableEmitNotification(297 /* SourceFile */); // Restore state when substituting nodes in a file.
+        context.enableSubstitution(207 /* CallExpression */); // Substitute calls to imported/exported symbols to avoid incorrect `this`.
+        context.enableSubstitution(209 /* TaggedTemplateExpression */); // Substitute calls to imported/exported symbols to avoid incorrect `this`.
+        context.enableSubstitution(79 /* Identifier */); // Substitutes expression identifiers with imported/exported symbols.
+        context.enableSubstitution(220 /* BinaryExpression */); // Substitutes assignments to exported symbols.
+        context.enableSubstitution(295 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols.
+        context.enableEmitNotification(303 /* SourceFile */); // Restore state when substituting nodes in a file.
         var moduleInfoMap = []; // The ExternalModuleInfo for each file.
         var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found.
         var currentSourceFile; // The current file.
         var currentModuleInfo; // The ExternalModuleInfo for the current file.
-        var noSubstitution; // Set of nodes for which substitution rules should be ignored.
+        var noSubstitution = []; // Set of nodes for which substitution rules should be ignored.
         var needUMDDynamicImportHelper;
         return ts.chainBundle(context, transformSourceFile);
         /**
@@ -95036,7 +101569,7 @@ var ts;
         function transformSourceFile(node) {
             if (node.isDeclarationFile ||
                 !(ts.isEffectiveExternalModule(node, compilerOptions) ||
-                    node.transformFlags & 2097152 /* ContainsDynamicImport */ ||
+                    node.transformFlags & 4194304 /* ContainsDynamicImport */ ||
                     (ts.isJsonSourceFile(node) && ts.hasJsonModuleEmitEnabled(compilerOptions) && ts.outFile(compilerOptions)))) {
                 return node;
             }
@@ -95066,7 +101599,7 @@ var ts;
             startLexicalEnvironment();
             var statements = [];
             var ensureUseStrict = ts.getStrictOptionValue(compilerOptions, "alwaysStrict") || (!compilerOptions.noImplicitUseStrict && ts.isExternalModule(currentSourceFile));
-            var statementOffset = factory.copyPrologue(node.statements, statements, ensureUseStrict && !ts.isJsonSourceFile(node), sourceElementVisitor);
+            var statementOffset = factory.copyPrologue(node.statements, statements, ensureUseStrict && !ts.isJsonSourceFile(node), topLevelVisitor);
             if (shouldEmitUnderscoreUnderscoreESModule()) {
                 ts.append(statements, createUnderscoreUnderscoreESModule());
             }
@@ -95076,8 +101609,8 @@ var ts;
                     ts.append(statements, factory.createExpressionStatement(ts.reduceLeft(currentModuleInfo.exportedNames.slice(i, i + chunkSize), function (prev, nextId) { return factory.createAssignment(factory.createPropertyAccessExpression(factory.createIdentifier("exports"), factory.createIdentifier(ts.idText(nextId))), prev); }, factory.createVoidZero())));
                 }
             }
-            ts.append(statements, ts.visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement));
-            ts.addRange(statements, ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset));
+            ts.append(statements, ts.visitNode(currentModuleInfo.externalHelpersImportDeclaration, topLevelVisitor, ts.isStatement));
+            ts.addRange(statements, ts.visitNodes(node.statements, topLevelVisitor, ts.isStatement, statementOffset));
             addExportEqualsIfNeeded(statements, /*emitAsReturn*/ false);
             ts.insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment());
             var updated = factory.updateSourceFile(node, ts.setTextRange(factory.createNodeArray(statements), node.statements));
@@ -95119,14 +101652,14 @@ var ts;
             //     define(mofactory.updateSourceFile", "module2"], function ...
             var updated = factory.updateSourceFile(node, ts.setTextRange(factory.createNodeArray([
                 factory.createExpressionStatement(factory.createCallExpression(define, 
-                /*typeArguments*/ undefined, __spreadArray(__spreadArray([], (moduleName ? [moduleName] : [])), [
+                /*typeArguments*/ undefined, __spreadArray(__spreadArray([], (moduleName ? [moduleName] : []), true), [
                     // Add the dependency array argument:
                     //
                     //     ["require", "exports", module1", "module2", ...]
                     factory.createArrayLiteralExpression(jsonSourceFile ? ts.emptyArray : __spreadArray(__spreadArray([
                         factory.createStringLiteral("require"),
                         factory.createStringLiteral("exports")
-                    ], aliasedModuleNames), unaliasedModuleNames)),
+                    ], aliasedModuleNames, true), unaliasedModuleNames, true)),
                     // Add the module body function argument:
                     //
                     //     function (require, exports, module1, module2) ...
@@ -95139,9 +101672,9 @@ var ts;
                         /*typeParameters*/ undefined, __spreadArray([
                             factory.createParameterDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "require"),
                             factory.createParameterDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "exports")
-                        ], importAliasNames), 
+                        ], importAliasNames, true), 
                         /*type*/ undefined, transformAsynchronousModuleBody(node))
-                ])))
+                ], false)))
             ]), 
             /*location*/ node.statements));
             ts.addEmitHelpers(updated, context.readEmitHelpers());
@@ -95175,13 +101708,13 @@ var ts;
                     ts.setEmitFlags(factory.createIfStatement(factory.createStrictInequality(factory.createIdentifier("v"), factory.createIdentifier("undefined")), factory.createExpressionStatement(factory.createAssignment(factory.createPropertyAccessExpression(factory.createIdentifier("module"), "exports"), factory.createIdentifier("v")))), 1 /* SingleLine */)
                 ]), factory.createIfStatement(factory.createLogicalAnd(factory.createTypeCheck(factory.createIdentifier("define"), "function"), factory.createPropertyAccessExpression(factory.createIdentifier("define"), "amd")), factory.createBlock([
                     factory.createExpressionStatement(factory.createCallExpression(factory.createIdentifier("define"), 
-                    /*typeArguments*/ undefined, __spreadArray(__spreadArray([], (moduleName ? [moduleName] : [])), [
+                    /*typeArguments*/ undefined, __spreadArray(__spreadArray([], (moduleName ? [moduleName] : []), true), [
                         factory.createArrayLiteralExpression(__spreadArray(__spreadArray([
                             factory.createStringLiteral("require"),
                             factory.createStringLiteral("exports")
-                        ], aliasedModuleNames), unaliasedModuleNames)),
+                        ], aliasedModuleNames, true), unaliasedModuleNames, true)),
                         factory.createIdentifier("factory")
-                    ])))
+                    ], false)))
                 ])))
             ], 
             /*multiLine*/ true), 
@@ -95210,7 +101743,7 @@ var ts;
                     /*typeParameters*/ undefined, __spreadArray([
                         factory.createParameterDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "require"),
                         factory.createParameterDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "exports")
-                    ], importAliasNames), 
+                    ], importAliasNames, true), 
                     /*type*/ undefined, transformAsynchronousModuleBody(node))
                 ]))
             ]), 
@@ -95287,7 +101820,7 @@ var ts;
         function transformAsynchronousModuleBody(node) {
             startLexicalEnvironment();
             var statements = [];
-            var statementOffset = factory.copyPrologue(node.statements, statements, /*ensureUseStrict*/ !compilerOptions.noImplicitUseStrict, sourceElementVisitor);
+            var statementOffset = factory.copyPrologue(node.statements, statements, /*ensureUseStrict*/ !compilerOptions.noImplicitUseStrict, topLevelVisitor);
             if (shouldEmitUnderscoreUnderscoreESModule()) {
                 ts.append(statements, createUnderscoreUnderscoreESModule());
             }
@@ -95295,11 +101828,11 @@ var ts;
                 ts.append(statements, factory.createExpressionStatement(ts.reduceLeft(currentModuleInfo.exportedNames, function (prev, nextId) { return factory.createAssignment(factory.createPropertyAccessExpression(factory.createIdentifier("exports"), factory.createIdentifier(ts.idText(nextId))), prev); }, factory.createVoidZero())));
             }
             // Visit each statement of the module body.
-            ts.append(statements, ts.visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement));
+            ts.append(statements, ts.visitNode(currentModuleInfo.externalHelpersImportDeclaration, topLevelVisitor, ts.isStatement));
             if (moduleKind === ts.ModuleKind.AMD) {
                 ts.addRange(statements, ts.mapDefined(currentModuleInfo.externalImports, getAMDImportExpressionForImport));
             }
-            ts.addRange(statements, ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset));
+            ts.addRange(statements, ts.visitNodes(node.statements, topLevelVisitor, ts.isStatement, statementOffset));
             // Append the 'export =' statement if provided.
             addExportEqualsIfNeeded(statements, /*emitAsReturn*/ true);
             // End the lexical environment for the module body
@@ -95321,7 +101854,7 @@ var ts;
          */
         function addExportEqualsIfNeeded(statements, emitAsReturn) {
             if (currentModuleInfo.exportEquals) {
-                var expressionResult = ts.visitNode(currentModuleInfo.exportEquals.expression, moduleExpressionElementVisitor);
+                var expressionResult = ts.visitNode(currentModuleInfo.exportEquals.expression, visitor);
                 if (expressionResult) {
                     if (emitAsReturn) {
                         var statement = factory.createReturnStatement(expressionResult);
@@ -95346,69 +101879,90 @@ var ts;
          *
          * @param node The node to visit.
          */
-        function sourceElementVisitor(node) {
+        function topLevelVisitor(node) {
             switch (node.kind) {
-                case 261 /* ImportDeclaration */:
+                case 265 /* ImportDeclaration */:
                     return visitImportDeclaration(node);
-                case 260 /* ImportEqualsDeclaration */:
+                case 264 /* ImportEqualsDeclaration */:
                     return visitImportEqualsDeclaration(node);
-                case 267 /* ExportDeclaration */:
+                case 271 /* ExportDeclaration */:
                     return visitExportDeclaration(node);
-                case 266 /* ExportAssignment */:
+                case 270 /* ExportAssignment */:
                     return visitExportAssignment(node);
-                case 232 /* VariableStatement */:
+                case 236 /* VariableStatement */:
                     return visitVariableStatement(node);
-                case 251 /* FunctionDeclaration */:
+                case 255 /* FunctionDeclaration */:
                     return visitFunctionDeclaration(node);
-                case 252 /* ClassDeclaration */:
+                case 256 /* ClassDeclaration */:
                     return visitClassDeclaration(node);
-                case 338 /* MergeDeclarationMarker */:
+                case 350 /* MergeDeclarationMarker */:
                     return visitMergeDeclarationMarker(node);
-                case 339 /* EndOfDeclarationMarker */:
+                case 351 /* EndOfDeclarationMarker */:
                     return visitEndOfDeclarationMarker(node);
                 default:
-                    return ts.visitEachChild(node, moduleExpressionElementVisitor, context);
+                    return visitor(node);
             }
         }
-        function moduleExpressionElementVisitor(node) {
-            // This visitor does not need to descend into the tree if there is no dynamic import or destructuring assignment,
+        function visitorWorker(node, valueIsDiscarded) {
+            // This visitor does not need to descend into the tree if there is no dynamic import, destructuring assignment, or update expression
             // as export/import statements are only transformed at the top level of a file.
-            if (!(node.transformFlags & 2097152 /* ContainsDynamicImport */) && !(node.transformFlags & 1024 /* ContainsDestructuringAssignment */)) {
+            if (!(node.transformFlags & (4194304 /* ContainsDynamicImport */ | 2048 /* ContainsDestructuringAssignment */ | 67108864 /* ContainsUpdateExpressionForIdentifier */))) {
                 return node;
             }
-            if (ts.isImportCall(node)) {
-                return visitImportCallExpression(node);
-            }
-            else if (ts.isDestructuringAssignment(node)) {
-                return visitDestructuringAssignment(node);
-            }
-            else {
-                return ts.visitEachChild(node, moduleExpressionElementVisitor, context);
+            switch (node.kind) {
+                case 241 /* ForStatement */:
+                    return visitForStatement(node);
+                case 237 /* ExpressionStatement */:
+                    return visitExpressionStatement(node);
+                case 211 /* ParenthesizedExpression */:
+                    return visitParenthesizedExpression(node, valueIsDiscarded);
+                case 348 /* PartiallyEmittedExpression */:
+                    return visitPartiallyEmittedExpression(node, valueIsDiscarded);
+                case 207 /* CallExpression */:
+                    if (ts.isImportCall(node) && currentSourceFile.impliedNodeFormat === undefined) {
+                        return visitImportCallExpression(node);
+                    }
+                    break;
+                case 220 /* BinaryExpression */:
+                    if (ts.isDestructuringAssignment(node)) {
+                        return visitDestructuringAssignment(node, valueIsDiscarded);
+                    }
+                    break;
+                case 218 /* PrefixUnaryExpression */:
+                case 219 /* PostfixUnaryExpression */:
+                    return visitPreOrPostfixUnaryExpression(node, valueIsDiscarded);
             }
+            return ts.visitEachChild(node, visitor, context);
+        }
+        function visitor(node) {
+            return visitorWorker(node, /*valueIsDiscarded*/ false);
+        }
+        function discardedValueVisitor(node) {
+            return visitorWorker(node, /*valueIsDiscarded*/ true);
         }
         function destructuringNeedsFlattening(node) {
             if (ts.isObjectLiteralExpression(node)) {
                 for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {
                     var elem = _a[_i];
                     switch (elem.kind) {
-                        case 288 /* PropertyAssignment */:
+                        case 294 /* PropertyAssignment */:
                             if (destructuringNeedsFlattening(elem.initializer)) {
                                 return true;
                             }
                             break;
-                        case 289 /* ShorthandPropertyAssignment */:
+                        case 295 /* ShorthandPropertyAssignment */:
                             if (destructuringNeedsFlattening(elem.name)) {
                                 return true;
                             }
                             break;
-                        case 290 /* SpreadAssignment */:
+                        case 296 /* SpreadAssignment */:
                             if (destructuringNeedsFlattening(elem.expression)) {
                                 return true;
                             }
                             break;
-                        case 165 /* MethodDeclaration */:
-                        case 167 /* GetAccessor */:
-                        case 168 /* SetAccessor */:
+                        case 168 /* MethodDeclaration */:
+                        case 171 /* GetAccessor */:
+                        case 172 /* SetAccessor */:
                             return false;
                         default: ts.Debug.assertNever(elem, "Unhandled object member kind");
                     }
@@ -95432,18 +101986,78 @@ var ts;
             }
             return false;
         }
-        function visitDestructuringAssignment(node) {
+        function visitDestructuringAssignment(node, valueIsDiscarded) {
             if (destructuringNeedsFlattening(node.left)) {
-                return ts.flattenDestructuringAssignment(node, moduleExpressionElementVisitor, context, 0 /* All */, /*needsValue*/ false, createAllExportExpressions);
+                return ts.flattenDestructuringAssignment(node, visitor, context, 0 /* All */, !valueIsDiscarded, createAllExportExpressions);
+            }
+            return ts.visitEachChild(node, visitor, context);
+        }
+        function visitForStatement(node) {
+            return factory.updateForStatement(node, ts.visitNode(node.initializer, discardedValueVisitor, ts.isForInitializer), ts.visitNode(node.condition, visitor, ts.isExpression), ts.visitNode(node.incrementor, discardedValueVisitor, ts.isExpression), ts.visitIterationBody(node.statement, visitor, context));
+        }
+        function visitExpressionStatement(node) {
+            return factory.updateExpressionStatement(node, ts.visitNode(node.expression, discardedValueVisitor, ts.isExpression));
+        }
+        function visitParenthesizedExpression(node, valueIsDiscarded) {
+            return factory.updateParenthesizedExpression(node, ts.visitNode(node.expression, valueIsDiscarded ? discardedValueVisitor : visitor, ts.isExpression));
+        }
+        function visitPartiallyEmittedExpression(node, valueIsDiscarded) {
+            return factory.updatePartiallyEmittedExpression(node, ts.visitNode(node.expression, valueIsDiscarded ? discardedValueVisitor : visitor, ts.isExpression));
+        }
+        function visitPreOrPostfixUnaryExpression(node, valueIsDiscarded) {
+            // When we see a prefix or postfix increment expression whose operand is an exported
+            // symbol, we should ensure all exports of that symbol are updated with the correct
+            // value.
+            //
+            // - We do not transform generated identifiers for any reason.
+            // - We do not transform identifiers tagged with the LocalName flag.
+            // - We do not transform identifiers that were originally the name of an enum or
+            //   namespace due to how they are transformed in TypeScript.
+            // - We only transform identifiers that are exported at the top level.
+            if ((node.operator === 45 /* PlusPlusToken */ || node.operator === 46 /* MinusMinusToken */)
+                && ts.isIdentifier(node.operand)
+                && !ts.isGeneratedIdentifier(node.operand)
+                && !ts.isLocalName(node.operand)
+                && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) {
+                var exportedNames = getExports(node.operand);
+                if (exportedNames) {
+                    var temp = void 0;
+                    var expression = ts.visitNode(node.operand, visitor, ts.isExpression);
+                    if (ts.isPrefixUnaryExpression(node)) {
+                        expression = factory.updatePrefixUnaryExpression(node, expression);
+                    }
+                    else {
+                        expression = factory.updatePostfixUnaryExpression(node, expression);
+                        if (!valueIsDiscarded) {
+                            temp = factory.createTempVariable(hoistVariableDeclaration);
+                            expression = factory.createAssignment(temp, expression);
+                            ts.setTextRange(expression, node);
+                        }
+                        expression = factory.createComma(expression, factory.cloneNode(node.operand));
+                        ts.setTextRange(expression, node);
+                    }
+                    for (var _i = 0, exportedNames_1 = exportedNames; _i < exportedNames_1.length; _i++) {
+                        var exportName = exportedNames_1[_i];
+                        noSubstitution[ts.getNodeId(expression)] = true;
+                        expression = createExportExpression(exportName, expression);
+                        ts.setTextRange(expression, node);
+                    }
+                    if (temp) {
+                        noSubstitution[ts.getNodeId(expression)] = true;
+                        expression = factory.createComma(expression, temp);
+                        ts.setTextRange(expression, node);
+                    }
+                    return expression;
+                }
             }
-            return ts.visitEachChild(node, moduleExpressionElementVisitor, context);
+            return ts.visitEachChild(node, visitor, context);
         }
         function visitImportCallExpression(node) {
             var externalModuleName = ts.getExternalModuleNameLiteral(factory, node, currentSourceFile, host, resolver, compilerOptions);
-            var firstArgument = ts.visitNode(ts.firstOrUndefined(node.arguments), moduleExpressionElementVisitor);
+            var firstArgument = ts.visitNode(ts.firstOrUndefined(node.arguments), visitor);
             // Only use the external module name if it differs from the first argument. This allows us to preserve the quote style of the argument on output.
             var argument = externalModuleName && (!firstArgument || !ts.isStringLiteral(firstArgument) || firstArgument.text !== externalModuleName.text) ? externalModuleName : firstArgument;
-            var containsLexicalThis = !!(node.transformFlags & 4096 /* ContainsLexicalThis */);
+            var containsLexicalThis = !!(node.transformFlags & 8192 /* ContainsLexicalThis */);
             switch (compilerOptions.module) {
                 case ts.ModuleKind.AMD:
                     return createImportCallExpressionAMD(argument, containsLexicalThis);
@@ -95528,7 +102142,7 @@ var ts;
                 }
             }
             var promise = factory.createNewExpression(factory.createIdentifier("Promise"), /*typeArguments*/ undefined, [func]);
-            if (compilerOptions.esModuleInterop) {
+            if (ts.getESModuleInterop(compilerOptions)) {
                 return factory.createCallExpression(factory.createPropertyAccessExpression(promise, factory.createIdentifier("then")), /*typeArguments*/ undefined, [emitHelpers().createImportStarCallbackHelper()]);
             }
             return promise;
@@ -95541,7 +102155,7 @@ var ts;
             // if we simply do require in resolve callback in Promise constructor. We will execute the loading immediately
             var promiseResolveCall = factory.createCallExpression(factory.createPropertyAccessExpression(factory.createIdentifier("Promise"), "resolve"), /*typeArguments*/ undefined, /*argumentsArray*/ []);
             var requireCall = factory.createCallExpression(factory.createIdentifier("require"), /*typeArguments*/ undefined, arg ? [arg] : []);
-            if (compilerOptions.esModuleInterop) {
+            if (ts.getESModuleInterop(compilerOptions)) {
                 requireCall = emitHelpers().createImportStarHelper(requireCall);
             }
             var func;
@@ -95571,7 +102185,7 @@ var ts;
             return factory.createCallExpression(factory.createPropertyAccessExpression(promiseResolveCall, "then"), /*typeArguments*/ undefined, [func]);
         }
         function getHelperExpressionForExport(node, innerExpr) {
-            if (!compilerOptions.esModuleInterop || ts.getEmitFlags(node) & 67108864 /* NeverApplyImportHelper */) {
+            if (!ts.getESModuleInterop(compilerOptions) || ts.getEmitFlags(node) & 67108864 /* NeverApplyImportHelper */) {
                 return innerExpr;
             }
             if (ts.getExportNeedsImportStarHelper(node)) {
@@ -95580,7 +102194,7 @@ var ts;
             return innerExpr;
         }
         function getHelperExpressionForImport(node, innerExpr) {
-            if (!compilerOptions.esModuleInterop || ts.getEmitFlags(node) & 67108864 /* NeverApplyImportHelper */) {
+            if (!ts.getESModuleInterop(compilerOptions) || ts.getEmitFlags(node) & 67108864 /* NeverApplyImportHelper */) {
                 return innerExpr;
             }
             if (ts.getImportNeedsImportStarHelper(node)) {
@@ -95734,7 +102348,7 @@ var ts;
                         statements.push(ts.setOriginalNode(ts.setTextRange(factory.createExpressionStatement(emitHelpers().createCreateBindingHelper(generatedName, factory.createStringLiteralFromNode(specifier.propertyName || specifier.name), specifier.propertyName ? factory.createStringLiteralFromNode(specifier.name) : undefined)), specifier), specifier));
                     }
                     else {
-                        var exportNeedsImportDefault = !!compilerOptions.esModuleInterop &&
+                        var exportNeedsImportDefault = !!ts.getESModuleInterop(compilerOptions) &&
                             !(ts.getEmitFlags(node) & 67108864 /* NeverApplyImportHelper */) &&
                             ts.idText(specifier.propertyName || specifier.name) === "default";
                         var exportedValue = factory.createPropertyAccessExpression(exportNeedsImportDefault ? emitHelpers().createImportDefaultHelper(generatedName) : generatedName, specifier.propertyName || specifier.name);
@@ -95772,10 +102386,10 @@ var ts;
             if (original && hasAssociatedEndOfDeclarationMarker(original)) {
                 // Defer exports until we encounter an EndOfDeclarationMarker node
                 var id = ts.getOriginalNodeId(node);
-                deferredExports[id] = appendExportStatement(deferredExports[id], factory.createIdentifier("default"), ts.visitNode(node.expression, moduleExpressionElementVisitor), /*location*/ node, /*allowComments*/ true);
+                deferredExports[id] = appendExportStatement(deferredExports[id], factory.createIdentifier("default"), ts.visitNode(node.expression, visitor), /*location*/ node, /*allowComments*/ true);
             }
             else {
-                statements = appendExportStatement(statements, factory.createIdentifier("default"), ts.visitNode(node.expression, moduleExpressionElementVisitor), /*location*/ node, /*allowComments*/ true);
+                statements = appendExportStatement(statements, factory.createIdentifier("default"), ts.visitNode(node.expression, visitor), /*location*/ node, /*allowComments*/ true);
             }
             return ts.singleOrMany(statements);
         }
@@ -95789,13 +102403,13 @@ var ts;
             if (ts.hasSyntacticModifier(node, 1 /* Export */)) {
                 statements = ts.append(statements, ts.setOriginalNode(ts.setTextRange(factory.createFunctionDeclaration(
                 /*decorators*/ undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, factory.getDeclarationName(node, /*allowComments*/ true, /*allowSourceMaps*/ true), 
-                /*typeParameters*/ undefined, ts.visitNodes(node.parameters, moduleExpressionElementVisitor), 
-                /*type*/ undefined, ts.visitEachChild(node.body, moduleExpressionElementVisitor, context)), 
+                /*typeParameters*/ undefined, ts.visitNodes(node.parameters, visitor), 
+                /*type*/ undefined, ts.visitEachChild(node.body, visitor, context)), 
                 /*location*/ node), 
                 /*original*/ node));
             }
             else {
-                statements = ts.append(statements, ts.visitEachChild(node, moduleExpressionElementVisitor, context));
+                statements = ts.append(statements, ts.visitEachChild(node, visitor, context));
             }
             if (hasAssociatedEndOfDeclarationMarker(node)) {
                 // Defer exports until we encounter an EndOfDeclarationMarker node
@@ -95817,10 +102431,10 @@ var ts;
             if (ts.hasSyntacticModifier(node, 1 /* Export */)) {
                 statements = ts.append(statements, ts.setOriginalNode(ts.setTextRange(factory.createClassDeclaration(
                 /*decorators*/ undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), factory.getDeclarationName(node, /*allowComments*/ true, /*allowSourceMaps*/ true), 
-                /*typeParameters*/ undefined, ts.visitNodes(node.heritageClauses, moduleExpressionElementVisitor), ts.visitNodes(node.members, moduleExpressionElementVisitor)), node), node));
+                /*typeParameters*/ undefined, ts.visitNodes(node.heritageClauses, visitor), ts.visitNodes(node.members, visitor)), node), node));
             }
             else {
-                statements = ts.append(statements, ts.visitEachChild(node, moduleExpressionElementVisitor, context));
+                statements = ts.append(statements, ts.visitEachChild(node, visitor, context));
             }
             if (hasAssociatedEndOfDeclarationMarker(node)) {
                 // Defer exports until we encounter an EndOfDeclarationMarker node
@@ -95857,7 +102471,7 @@ var ts;
                         if (!ts.isBindingPattern(variable.name) && (ts.isArrowFunction(variable.initializer) || ts.isFunctionExpression(variable.initializer) || ts.isClassExpression(variable.initializer))) {
                             var expression = factory.createAssignment(ts.setTextRange(factory.createPropertyAccessExpression(factory.createIdentifier("exports"), variable.name), 
                             /*location*/ variable.name), factory.createIdentifier(ts.getTextOfIdentifierOrLiteral(variable.name)));
-                            var updatedVariable = factory.createVariableDeclaration(variable.name, variable.exclamationToken, variable.type, ts.visitNode(variable.initializer, moduleExpressionElementVisitor));
+                            var updatedVariable = factory.createVariableDeclaration(variable.name, variable.exclamationToken, variable.type, ts.visitNode(variable.initializer, visitor));
                             variables = ts.append(variables, updatedVariable);
                             expressions = ts.append(expressions, expression);
                             removeCommentsOnExpressions = true;
@@ -95879,7 +102493,7 @@ var ts;
                 }
             }
             else {
-                statements = ts.append(statements, ts.visitEachChild(node, moduleExpressionElementVisitor, context));
+                statements = ts.append(statements, ts.visitEachChild(node, visitor, context));
             }
             if (hasAssociatedEndOfDeclarationMarker(node)) {
                 // Defer exports until we encounter an EndOfDeclarationMarker node
@@ -95896,8 +102510,8 @@ var ts;
             if (exportedNames) {
                 // For each additional export of the declaration, apply an export assignment.
                 var expression = ts.isExportName(name) ? value : factory.createAssignment(name, value);
-                for (var _i = 0, exportedNames_1 = exportedNames; _i < exportedNames_1.length; _i++) {
-                    var exportName = exportedNames_1[_i];
+                for (var _i = 0, exportedNames_2 = exportedNames; _i < exportedNames_2.length; _i++) {
+                    var exportName = exportedNames_2[_i];
                     // Mark the node to prevent triggering substitution.
                     ts.setEmitFlags(expression, 4 /* NoSubstitution */);
                     expression = createExportExpression(exportName, expression, /*location*/ location);
@@ -95913,13 +102527,13 @@ var ts;
          */
         function transformInitializedVariable(node) {
             if (ts.isBindingPattern(node.name)) {
-                return ts.flattenDestructuringAssignment(ts.visitNode(node, moduleExpressionElementVisitor), 
+                return ts.flattenDestructuringAssignment(ts.visitNode(node, visitor), 
                 /*visitor*/ undefined, context, 0 /* All */, 
                 /*needsValue*/ false, createAllExportExpressions);
             }
             else {
                 return factory.createAssignment(ts.setTextRange(factory.createPropertyAccessExpression(factory.createIdentifier("exports"), node.name), 
-                /*location*/ node.name), node.initializer ? ts.visitNode(node.initializer, moduleExpressionElementVisitor) : factory.createVoidZero());
+                /*location*/ node.name), node.initializer ? ts.visitNode(node.initializer, visitor) : factory.createVoidZero());
             }
         }
         /**
@@ -95936,7 +102550,7 @@ var ts;
             //
             // To balance the declaration, add the exports of the elided variable
             // statement.
-            if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 232 /* VariableStatement */) {
+            if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 236 /* VariableStatement */) {
                 var id = ts.getOriginalNodeId(node);
                 deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original);
             }
@@ -95991,10 +102605,10 @@ var ts;
             var namedBindings = importClause.namedBindings;
             if (namedBindings) {
                 switch (namedBindings.kind) {
-                    case 263 /* NamespaceImport */:
+                    case 267 /* NamespaceImport */:
                         statements = appendExportsOfDeclaration(statements, namedBindings);
                         break;
-                    case 264 /* NamedImports */:
+                    case 268 /* NamedImports */:
                         for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) {
                             var importBinding = _a[_i];
                             statements = appendExportsOfDeclaration(statements, importBinding, /* liveBinding */ true);
@@ -96190,8 +102804,8 @@ var ts;
         function modifierVisitor(node) {
             // Elide module-specific modifiers.
             switch (node.kind) {
-                case 92 /* ExportKeyword */:
-                case 87 /* DefaultKeyword */:
+                case 93 /* ExportKeyword */:
+                case 88 /* DefaultKeyword */:
                     return undefined;
             }
             return node;
@@ -96207,14 +102821,12 @@ var ts;
          * @param emit A callback used to emit the node in the printer.
          */
         function onEmitNode(hint, node, emitCallback) {
-            if (node.kind === 297 /* SourceFile */) {
+            if (node.kind === 303 /* SourceFile */) {
                 currentSourceFile = node;
                 currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(currentSourceFile)];
-                noSubstitution = [];
                 previousOnEmitNode(hint, node, emitCallback);
                 currentSourceFile = undefined;
                 currentModuleInfo = undefined;
-                noSubstitution = undefined;
             }
             else {
                 previousOnEmitNode(hint, node, emitCallback);
@@ -96269,13 +102881,36 @@ var ts;
          */
         function substituteExpression(node) {
             switch (node.kind) {
-                case 78 /* Identifier */:
+                case 79 /* Identifier */:
                     return substituteExpressionIdentifier(node);
-                case 216 /* BinaryExpression */:
+                case 207 /* CallExpression */:
+                    return substituteCallExpression(node);
+                case 209 /* TaggedTemplateExpression */:
+                    return substituteTaggedTemplateExpression(node);
+                case 220 /* BinaryExpression */:
                     return substituteBinaryExpression(node);
-                case 215 /* PostfixUnaryExpression */:
-                case 214 /* PrefixUnaryExpression */:
-                    return substituteUnaryExpression(node);
+            }
+            return node;
+        }
+        function substituteCallExpression(node) {
+            if (ts.isIdentifier(node.expression)) {
+                var expression = substituteExpressionIdentifier(node.expression);
+                noSubstitution[ts.getNodeId(expression)] = true;
+                if (!ts.isIdentifier(expression)) {
+                    return ts.addEmitFlags(factory.updateCallExpression(node, expression, 
+                    /*typeArguments*/ undefined, node.arguments), 536870912 /* IndirectCall */);
+                }
+            }
+            return node;
+        }
+        function substituteTaggedTemplateExpression(node) {
+            if (ts.isIdentifier(node.tag)) {
+                var tag = substituteExpressionIdentifier(node.tag);
+                noSubstitution[ts.getNodeId(tag)] = true;
+                if (!ts.isIdentifier(tag)) {
+                    return ts.addEmitFlags(factory.updateTaggedTemplateExpression(node, tag, 
+                    /*typeArguments*/ undefined, node.template), 536870912 /* IndirectCall */);
+                }
             }
             return node;
         }
@@ -96294,9 +102929,9 @@ var ts;
                 }
                 return node;
             }
-            if (!(ts.isGeneratedIdentifier(node) && !(node.autoGenerateFlags & 64 /* AllowNameSubstitution */)) && !ts.isLocalName(node)) {
+            else if (!(ts.isGeneratedIdentifier(node) && !(node.autoGenerateFlags & 64 /* AllowNameSubstitution */)) && !ts.isLocalName(node)) {
                 var exportContainer = resolver.getReferencedExportContainer(node, ts.isExportName(node));
-                if (exportContainer && exportContainer.kind === 297 /* SourceFile */) {
+                if (exportContainer && exportContainer.kind === 303 /* SourceFile */) {
                     return ts.setTextRange(factory.createPropertyAccessExpression(factory.createIdentifier("exports"), factory.cloneNode(node)), 
                     /*location*/ node);
                 }
@@ -96338,48 +102973,11 @@ var ts;
                 if (exportedNames) {
                     // For each additional export of the declaration, apply an export assignment.
                     var expression = node;
-                    for (var _i = 0, exportedNames_2 = exportedNames; _i < exportedNames_2.length; _i++) {
-                        var exportName = exportedNames_2[_i];
-                        // Mark the node to prevent triggering this rule again.
-                        noSubstitution[ts.getNodeId(expression)] = true;
-                        expression = createExportExpression(exportName, expression, /*location*/ node);
-                    }
-                    return expression;
-                }
-            }
-            return node;
-        }
-        /**
-         * Substitution for a UnaryExpression that may contain an imported or exported symbol.
-         *
-         * @param node The node to substitute.
-         */
-        function substituteUnaryExpression(node) {
-            // When we see a prefix or postfix increment expression whose operand is an exported
-            // symbol, we should ensure all exports of that symbol are updated with the correct
-            // value.
-            //
-            // - We do not substitute generated identifiers for any reason.
-            // - We do not substitute identifiers tagged with the LocalName flag.
-            // - We do not substitute identifiers that were originally the name of an enum or
-            //   namespace due to how they are transformed in TypeScript.
-            // - We only substitute identifiers that are exported at the top level.
-            if ((node.operator === 45 /* PlusPlusToken */ || node.operator === 46 /* MinusMinusToken */)
-                && ts.isIdentifier(node.operand)
-                && !ts.isGeneratedIdentifier(node.operand)
-                && !ts.isLocalName(node.operand)
-                && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) {
-                var exportedNames = getExports(node.operand);
-                if (exportedNames) {
-                    var expression = node.kind === 215 /* PostfixUnaryExpression */
-                        ? ts.setTextRange(factory.createBinaryExpression(node.operand, factory.createToken(node.operator === 45 /* PlusPlusToken */ ? 63 /* PlusEqualsToken */ : 64 /* MinusEqualsToken */), factory.createNumericLiteral(1)), 
-                        /*location*/ node)
-                        : node;
                     for (var _i = 0, exportedNames_3 = exportedNames; _i < exportedNames_3.length; _i++) {
                         var exportName = exportedNames_3[_i];
                         // Mark the node to prevent triggering this rule again.
                         noSubstitution[ts.getNodeId(expression)] = true;
-                        expression = factory.createParenthesizedExpression(createExportExpression(exportName, expression));
+                        expression = createExportExpression(exportName, expression, /*location*/ node);
                     }
                     return expression;
                 }
@@ -96422,13 +103020,11 @@ var ts;
         var previousOnEmitNode = context.onEmitNode;
         context.onSubstituteNode = onSubstituteNode;
         context.onEmitNode = onEmitNode;
-        context.enableSubstitution(78 /* Identifier */); // Substitutes expression identifiers for imported symbols.
-        context.enableSubstitution(289 /* ShorthandPropertyAssignment */); // Substitutes expression identifiers for imported symbols
-        context.enableSubstitution(216 /* BinaryExpression */); // Substitutes assignments to exported symbols.
-        context.enableSubstitution(214 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols.
-        context.enableSubstitution(215 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols.
-        context.enableSubstitution(226 /* MetaProperty */); // Substitutes 'import.meta'
-        context.enableEmitNotification(297 /* SourceFile */); // Restore state when substituting nodes in a file.
+        context.enableSubstitution(79 /* Identifier */); // Substitutes expression identifiers for imported symbols.
+        context.enableSubstitution(295 /* ShorthandPropertyAssignment */); // Substitutes expression identifiers for imported symbols
+        context.enableSubstitution(220 /* BinaryExpression */); // Substitutes assignments to exported symbols.
+        context.enableSubstitution(230 /* MetaProperty */); // Substitutes 'import.meta'
+        context.enableEmitNotification(303 /* SourceFile */); // Restore state when substituting nodes in a file.
         var moduleInfoMap = []; // The ExternalModuleInfo for each file.
         var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found.
         var exportFunctionsMap = []; // The export function associated with a source file.
@@ -96448,7 +103044,7 @@ var ts;
          * @param node The SourceFile node.
          */
         function transformSourceFile(node) {
-            if (node.isDeclarationFile || !(ts.isEffectiveExternalModule(node, compilerOptions) || node.transformFlags & 2097152 /* ContainsDynamicImport */)) {
+            if (node.isDeclarationFile || !(ts.isEffectiveExternalModule(node, compilerOptions) || node.transformFlags & 4194304 /* ContainsDynamicImport */)) {
                 return node;
             }
             var id = ts.getOriginalNodeId(node);
@@ -96594,7 +103190,7 @@ var ts;
             startLexicalEnvironment();
             // Add any prologue directives.
             var ensureUseStrict = ts.getStrictOptionValue(compilerOptions, "alwaysStrict") || (!compilerOptions.noImplicitUseStrict && ts.isExternalModule(currentSourceFile));
-            var statementOffset = factory.copyPrologue(node.statements, statements, ensureUseStrict, sourceElementVisitor);
+            var statementOffset = factory.copyPrologue(node.statements, statements, ensureUseStrict, topLevelVisitor);
             // var __moduleName = context_1 && context_1.id;
             statements.push(factory.createVariableStatement(
             /*modifiers*/ undefined, factory.createVariableDeclarationList([
@@ -96603,13 +103199,13 @@ var ts;
                 /*type*/ undefined, factory.createLogicalAnd(contextObject, factory.createPropertyAccessExpression(contextObject, "id")))
             ])));
             // Visit the synthetic external helpers import declaration if present
-            ts.visitNode(moduleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement);
+            ts.visitNode(moduleInfo.externalHelpersImportDeclaration, topLevelVisitor, ts.isStatement);
             // Visit the statements of the source file, emitting any transformations into
             // the `executeStatements` array. We do this *before* we fill the `setters` array
             // as we both emit transformations as well as aggregate some data used when creating
             // setters. This allows us to reduce the number of times we need to loop through the
             // statements of the source file.
-            var executeStatements = ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset);
+            var executeStatements = ts.visitNodes(node.statements, topLevelVisitor, ts.isStatement, statementOffset);
             // Emit early exports for function declarations.
             ts.addRange(statements, hoistedStatements);
             // We emit hoisted variables early to align roughly with our previous emit output.
@@ -96617,7 +103213,7 @@ var ts;
             // - Temporary variables will appear at the top rather than at the bottom of the file
             ts.insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment());
             var exportStarFunction = addExportStarIfNeeded(statements); // TODO: GH#18217
-            var modifiers = node.transformFlags & 524288 /* ContainsAwait */ ?
+            var modifiers = node.transformFlags & 1048576 /* ContainsAwait */ ?
                 factory.createModifiersFromModifierFlags(256 /* Async */) :
                 undefined;
             var moduleObject = factory.createObjectLiteralExpression([
@@ -96652,7 +103248,7 @@ var ts;
                 var hasExportDeclarationWithExportClause = false;
                 for (var _i = 0, _a = moduleInfo.externalImports; _i < _a.length; _i++) {
                     var externalImport = _a[_i];
-                    if (externalImport.kind === 267 /* ExportDeclaration */ && externalImport.exportClause) {
+                    if (externalImport.kind === 271 /* ExportDeclaration */ && externalImport.exportClause) {
                         hasExportDeclarationWithExportClause = true;
                         break;
                     }
@@ -96742,19 +103338,19 @@ var ts;
                     var entry = _b[_a];
                     var importVariableName = ts.getLocalNameForExternalImport(factory, entry, currentSourceFile); // TODO: GH#18217
                     switch (entry.kind) {
-                        case 261 /* ImportDeclaration */:
+                        case 265 /* ImportDeclaration */:
                             if (!entry.importClause) {
                                 // 'import "..."' case
                                 // module is imported only for side-effects, no emit required
                                 break;
                             }
                         // falls through
-                        case 260 /* ImportEqualsDeclaration */:
+                        case 264 /* ImportEqualsDeclaration */:
                             ts.Debug.assert(importVariableName !== undefined);
                             // save import into the local
                             statements.push(factory.createExpressionStatement(factory.createAssignment(importVariableName, parameterName)));
                             break;
-                        case 267 /* ExportDeclaration */:
+                        case 271 /* ExportDeclaration */:
                             ts.Debug.assert(importVariableName !== undefined);
                             if (entry.exportClause) {
                                 if (ts.isNamedExports(entry.exportClause)) {
@@ -96811,18 +103407,18 @@ var ts;
          *
          * @param node The node to visit.
          */
-        function sourceElementVisitor(node) {
+        function topLevelVisitor(node) {
             switch (node.kind) {
-                case 261 /* ImportDeclaration */:
+                case 265 /* ImportDeclaration */:
                     return visitImportDeclaration(node);
-                case 260 /* ImportEqualsDeclaration */:
+                case 264 /* ImportEqualsDeclaration */:
                     return visitImportEqualsDeclaration(node);
-                case 267 /* ExportDeclaration */:
+                case 271 /* ExportDeclaration */:
                     return visitExportDeclaration(node);
-                case 266 /* ExportAssignment */:
+                case 270 /* ExportAssignment */:
                     return visitExportAssignment(node);
                 default:
-                    return nestedElementVisitor(node);
+                    return topLevelNestedVisitor(node);
             }
         }
         /**
@@ -96878,7 +103474,7 @@ var ts;
                 // Elide `export=` as it is illegal in a SystemJS module.
                 return undefined;
             }
-            var expression = ts.visitNode(node.expression, destructuringAndImportCallVisitor, ts.isExpression);
+            var expression = ts.visitNode(node.expression, visitor, ts.isExpression);
             var original = node.original;
             if (original && hasAssociatedEndOfDeclarationMarker(original)) {
                 // Defer exports until we encounter an EndOfDeclarationMarker node
@@ -96897,11 +103493,11 @@ var ts;
         function visitFunctionDeclaration(node) {
             if (ts.hasSyntacticModifier(node, 1 /* Export */)) {
                 hoistedStatements = ts.append(hoistedStatements, factory.updateFunctionDeclaration(node, node.decorators, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, factory.getDeclarationName(node, /*allowComments*/ true, /*allowSourceMaps*/ true), 
-                /*typeParameters*/ undefined, ts.visitNodes(node.parameters, destructuringAndImportCallVisitor, ts.isParameterDeclaration), 
-                /*type*/ undefined, ts.visitNode(node.body, destructuringAndImportCallVisitor, ts.isBlock)));
+                /*typeParameters*/ undefined, ts.visitNodes(node.parameters, visitor, ts.isParameterDeclaration), 
+                /*type*/ undefined, ts.visitNode(node.body, visitor, ts.isBlock)));
             }
             else {
-                hoistedStatements = ts.append(hoistedStatements, ts.visitEachChild(node, destructuringAndImportCallVisitor, context));
+                hoistedStatements = ts.append(hoistedStatements, ts.visitEachChild(node, visitor, context));
             }
             if (hasAssociatedEndOfDeclarationMarker(node)) {
                 // Defer exports until we encounter an EndOfDeclarationMarker node
@@ -96924,9 +103520,9 @@ var ts;
             var name = factory.getLocalName(node);
             hoistVariableDeclaration(name);
             // Rewrite the class declaration into an assignment of a class expression.
-            statements = ts.append(statements, ts.setTextRange(factory.createExpressionStatement(factory.createAssignment(name, ts.setTextRange(factory.createClassExpression(ts.visitNodes(node.decorators, destructuringAndImportCallVisitor, ts.isDecorator), 
+            statements = ts.append(statements, ts.setTextRange(factory.createExpressionStatement(factory.createAssignment(name, ts.setTextRange(factory.createClassExpression(ts.visitNodes(node.decorators, visitor, ts.isDecorator), 
             /*modifiers*/ undefined, node.name, 
-            /*typeParameters*/ undefined, ts.visitNodes(node.heritageClauses, destructuringAndImportCallVisitor, ts.isHeritageClause), ts.visitNodes(node.members, destructuringAndImportCallVisitor, ts.isClassElement)), node))), node));
+            /*typeParameters*/ undefined, ts.visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), ts.visitNodes(node.members, visitor, ts.isClassElement)), node))), node));
             if (hasAssociatedEndOfDeclarationMarker(node)) {
                 // Defer exports until we encounter an EndOfDeclarationMarker node
                 var id = ts.getOriginalNodeId(node);
@@ -96945,7 +103541,7 @@ var ts;
          */
         function visitVariableStatement(node) {
             if (!shouldHoistVariableDeclarationList(node.declarationList)) {
-                return ts.visitNode(node, destructuringAndImportCallVisitor, ts.isStatement);
+                return ts.visitNode(node, visitor, ts.isStatement);
             }
             var expressions;
             var isExportedDeclaration = ts.hasSyntacticModifier(node, 1 /* Export */);
@@ -96999,7 +103595,7 @@ var ts;
         function shouldHoistVariableDeclarationList(node) {
             // hoist only non-block scoped declarations or block scoped declarations parented by source file
             return (ts.getEmitFlags(node) & 2097152 /* NoHoisting */) === 0
-                && (enclosingBlockScopedContainer.kind === 297 /* SourceFile */
+                && (enclosingBlockScopedContainer.kind === 303 /* SourceFile */
                     || (ts.getOriginalNode(node).flags & 3 /* BlockScoped */) === 0);
         }
         /**
@@ -97011,9 +103607,9 @@ var ts;
         function transformInitializedVariable(node, isExportedDeclaration) {
             var createAssignment = isExportedDeclaration ? createExportedVariableAssignment : createNonExportedVariableAssignment;
             return ts.isBindingPattern(node.name)
-                ? ts.flattenDestructuringAssignment(node, destructuringAndImportCallVisitor, context, 0 /* All */, 
+                ? ts.flattenDestructuringAssignment(node, visitor, context, 0 /* All */, 
                 /*needsValue*/ false, createAssignment)
-                : node.initializer ? createAssignment(node.name, ts.visitNode(node.initializer, destructuringAndImportCallVisitor, ts.isExpression)) : node.name;
+                : node.initializer ? createAssignment(node.name, ts.visitNode(node.initializer, visitor, ts.isExpression)) : node.name;
         }
         /**
          * Creates an assignment expression for an exported variable declaration.
@@ -97063,7 +103659,7 @@ var ts;
             //
             // To balance the declaration, we defer the exports of the elided variable
             // statement until we visit this declaration's `EndOfDeclarationMarker`.
-            if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 232 /* VariableStatement */) {
+            if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 236 /* VariableStatement */) {
                 var id = ts.getOriginalNodeId(node);
                 var isExportedDeclaration = ts.hasSyntacticModifier(node.original, 1 /* Export */);
                 deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original, isExportedDeclaration);
@@ -97125,10 +103721,10 @@ var ts;
             var namedBindings = importClause.namedBindings;
             if (namedBindings) {
                 switch (namedBindings.kind) {
-                    case 263 /* NamespaceImport */:
+                    case 267 /* NamespaceImport */:
                         statements = appendExportsOfDeclaration(statements, namedBindings);
                         break;
-                    case 264 /* NamedImports */:
+                    case 268 /* NamedImports */:
                         for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) {
                             var importBinding = _a[_i];
                             statements = appendExportsOfDeclaration(statements, importBinding);
@@ -97306,48 +103902,48 @@ var ts;
          *
          * @param node The node to visit.
          */
-        function nestedElementVisitor(node) {
+        function topLevelNestedVisitor(node) {
             switch (node.kind) {
-                case 232 /* VariableStatement */:
+                case 236 /* VariableStatement */:
                     return visitVariableStatement(node);
-                case 251 /* FunctionDeclaration */:
+                case 255 /* FunctionDeclaration */:
                     return visitFunctionDeclaration(node);
-                case 252 /* ClassDeclaration */:
+                case 256 /* ClassDeclaration */:
                     return visitClassDeclaration(node);
-                case 237 /* ForStatement */:
-                    return visitForStatement(node);
-                case 238 /* ForInStatement */:
+                case 241 /* ForStatement */:
+                    return visitForStatement(node, /*isTopLevel*/ true);
+                case 242 /* ForInStatement */:
                     return visitForInStatement(node);
-                case 239 /* ForOfStatement */:
+                case 243 /* ForOfStatement */:
                     return visitForOfStatement(node);
-                case 235 /* DoStatement */:
+                case 239 /* DoStatement */:
                     return visitDoStatement(node);
-                case 236 /* WhileStatement */:
+                case 240 /* WhileStatement */:
                     return visitWhileStatement(node);
-                case 245 /* LabeledStatement */:
+                case 249 /* LabeledStatement */:
                     return visitLabeledStatement(node);
-                case 243 /* WithStatement */:
+                case 247 /* WithStatement */:
                     return visitWithStatement(node);
-                case 244 /* SwitchStatement */:
+                case 248 /* SwitchStatement */:
                     return visitSwitchStatement(node);
-                case 258 /* CaseBlock */:
+                case 262 /* CaseBlock */:
                     return visitCaseBlock(node);
-                case 284 /* CaseClause */:
+                case 288 /* CaseClause */:
                     return visitCaseClause(node);
-                case 285 /* DefaultClause */:
+                case 289 /* DefaultClause */:
                     return visitDefaultClause(node);
-                case 247 /* TryStatement */:
+                case 251 /* TryStatement */:
                     return visitTryStatement(node);
-                case 287 /* CatchClause */:
+                case 291 /* CatchClause */:
                     return visitCatchClause(node);
-                case 230 /* Block */:
+                case 234 /* Block */:
                     return visitBlock(node);
-                case 338 /* MergeDeclarationMarker */:
+                case 350 /* MergeDeclarationMarker */:
                     return visitMergeDeclarationMarker(node);
-                case 339 /* EndOfDeclarationMarker */:
+                case 351 /* EndOfDeclarationMarker */:
                     return visitEndOfDeclarationMarker(node);
                 default:
-                    return destructuringAndImportCallVisitor(node);
+                    return visitor(node);
             }
         }
         /**
@@ -97355,10 +103951,10 @@ var ts;
          *
          * @param node The node to visit.
          */
-        function visitForStatement(node) {
+        function visitForStatement(node, isTopLevel) {
             var savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer;
             enclosingBlockScopedContainer = node;
-            node = factory.updateForStatement(node, node.initializer && visitForInitializer(node.initializer), ts.visitNode(node.condition, destructuringAndImportCallVisitor, ts.isExpression), ts.visitNode(node.incrementor, destructuringAndImportCallVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement));
+            node = factory.updateForStatement(node, ts.visitNode(node.initializer, isTopLevel ? visitForInitializer : discardedValueVisitor, ts.isForInitializer), ts.visitNode(node.condition, visitor, ts.isExpression), ts.visitNode(node.incrementor, discardedValueVisitor, ts.isExpression), ts.visitIterationBody(node.statement, isTopLevel ? topLevelNestedVisitor : visitor, context));
             enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer;
             return node;
         }
@@ -97370,7 +103966,7 @@ var ts;
         function visitForInStatement(node) {
             var savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer;
             enclosingBlockScopedContainer = node;
-            node = factory.updateForInStatement(node, visitForInitializer(node.initializer), ts.visitNode(node.expression, destructuringAndImportCallVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, factory.liftToBlock));
+            node = factory.updateForInStatement(node, visitForInitializer(node.initializer), ts.visitNode(node.expression, visitor, ts.isExpression), ts.visitIterationBody(node.statement, topLevelNestedVisitor, context));
             enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer;
             return node;
         }
@@ -97382,7 +103978,7 @@ var ts;
         function visitForOfStatement(node) {
             var savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer;
             enclosingBlockScopedContainer = node;
-            node = factory.updateForOfStatement(node, node.awaitModifier, visitForInitializer(node.initializer), ts.visitNode(node.expression, destructuringAndImportCallVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, factory.liftToBlock));
+            node = factory.updateForOfStatement(node, node.awaitModifier, visitForInitializer(node.initializer), ts.visitNode(node.expression, visitor, ts.isExpression), ts.visitIterationBody(node.statement, topLevelNestedVisitor, context));
             enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer;
             return node;
         }
@@ -97414,7 +104010,7 @@ var ts;
                 return expressions ? factory.inlineExpressions(expressions) : factory.createOmittedExpression();
             }
             else {
-                return ts.visitEachChild(node, nestedElementVisitor, context);
+                return ts.visitNode(node, discardedValueVisitor, ts.isExpression);
             }
         }
         /**
@@ -97423,7 +104019,7 @@ var ts;
          * @param node The node to visit.
          */
         function visitDoStatement(node) {
-            return factory.updateDoStatement(node, ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, factory.liftToBlock), ts.visitNode(node.expression, destructuringAndImportCallVisitor, ts.isExpression));
+            return factory.updateDoStatement(node, ts.visitIterationBody(node.statement, topLevelNestedVisitor, context), ts.visitNode(node.expression, visitor, ts.isExpression));
         }
         /**
          * Visits the body of a WhileStatement to hoist declarations.
@@ -97431,7 +104027,7 @@ var ts;
          * @param node The node to visit.
          */
         function visitWhileStatement(node) {
-            return factory.updateWhileStatement(node, ts.visitNode(node.expression, destructuringAndImportCallVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, factory.liftToBlock));
+            return factory.updateWhileStatement(node, ts.visitNode(node.expression, visitor, ts.isExpression), ts.visitIterationBody(node.statement, topLevelNestedVisitor, context));
         }
         /**
          * Visits the body of a LabeledStatement to hoist declarations.
@@ -97439,7 +104035,7 @@ var ts;
          * @param node The node to visit.
          */
         function visitLabeledStatement(node) {
-            return factory.updateLabeledStatement(node, node.label, ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, factory.liftToBlock));
+            return factory.updateLabeledStatement(node, node.label, ts.visitNode(node.statement, topLevelNestedVisitor, ts.isStatement, factory.liftToBlock));
         }
         /**
          * Visits the body of a WithStatement to hoist declarations.
@@ -97447,7 +104043,7 @@ var ts;
          * @param node The node to visit.
          */
         function visitWithStatement(node) {
-            return factory.updateWithStatement(node, ts.visitNode(node.expression, destructuringAndImportCallVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, factory.liftToBlock));
+            return factory.updateWithStatement(node, ts.visitNode(node.expression, visitor, ts.isExpression), ts.visitNode(node.statement, topLevelNestedVisitor, ts.isStatement, factory.liftToBlock));
         }
         /**
          * Visits the body of a SwitchStatement to hoist declarations.
@@ -97455,7 +104051,7 @@ var ts;
          * @param node The node to visit.
          */
         function visitSwitchStatement(node) {
-            return factory.updateSwitchStatement(node, ts.visitNode(node.expression, destructuringAndImportCallVisitor, ts.isExpression), ts.visitNode(node.caseBlock, nestedElementVisitor, ts.isCaseBlock));
+            return factory.updateSwitchStatement(node, ts.visitNode(node.expression, visitor, ts.isExpression), ts.visitNode(node.caseBlock, topLevelNestedVisitor, ts.isCaseBlock));
         }
         /**
          * Visits the body of a CaseBlock to hoist declarations.
@@ -97465,7 +104061,7 @@ var ts;
         function visitCaseBlock(node) {
             var savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer;
             enclosingBlockScopedContainer = node;
-            node = factory.updateCaseBlock(node, ts.visitNodes(node.clauses, nestedElementVisitor, ts.isCaseOrDefaultClause));
+            node = factory.updateCaseBlock(node, ts.visitNodes(node.clauses, topLevelNestedVisitor, ts.isCaseOrDefaultClause));
             enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer;
             return node;
         }
@@ -97475,7 +104071,7 @@ var ts;
          * @param node The node to visit.
          */
         function visitCaseClause(node) {
-            return factory.updateCaseClause(node, ts.visitNode(node.expression, destructuringAndImportCallVisitor, ts.isExpression), ts.visitNodes(node.statements, nestedElementVisitor, ts.isStatement));
+            return factory.updateCaseClause(node, ts.visitNode(node.expression, visitor, ts.isExpression), ts.visitNodes(node.statements, topLevelNestedVisitor, ts.isStatement));
         }
         /**
          * Visits the body of a DefaultClause to hoist declarations.
@@ -97483,7 +104079,7 @@ var ts;
          * @param node The node to visit.
          */
         function visitDefaultClause(node) {
-            return ts.visitEachChild(node, nestedElementVisitor, context);
+            return ts.visitEachChild(node, topLevelNestedVisitor, context);
         }
         /**
          * Visits the body of a TryStatement to hoist declarations.
@@ -97491,7 +104087,7 @@ var ts;
          * @param node The node to visit.
          */
         function visitTryStatement(node) {
-            return ts.visitEachChild(node, nestedElementVisitor, context);
+            return ts.visitEachChild(node, topLevelNestedVisitor, context);
         }
         /**
          * Visits the body of a CatchClause to hoist declarations.
@@ -97501,7 +104097,7 @@ var ts;
         function visitCatchClause(node) {
             var savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer;
             enclosingBlockScopedContainer = node;
-            node = factory.updateCatchClause(node, node.variableDeclaration, ts.visitNode(node.block, nestedElementVisitor, ts.isBlock));
+            node = factory.updateCatchClause(node, node.variableDeclaration, ts.visitNode(node.block, topLevelNestedVisitor, ts.isBlock));
             enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer;
             return node;
         }
@@ -97513,7 +104109,7 @@ var ts;
         function visitBlock(node) {
             var savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer;
             enclosingBlockScopedContainer = node;
-            node = ts.visitEachChild(node, nestedElementVisitor, context);
+            node = ts.visitEachChild(node, topLevelNestedVisitor, context);
             enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer;
             return node;
         }
@@ -97525,19 +104121,54 @@ var ts;
          *
          * @param node The node to visit.
          */
-        function destructuringAndImportCallVisitor(node) {
-            if (ts.isDestructuringAssignment(node)) {
-                return visitDestructuringAssignment(node);
-            }
-            else if (ts.isImportCall(node)) {
-                return visitImportCallExpression(node);
-            }
-            else if ((node.transformFlags & 1024 /* ContainsDestructuringAssignment */) || (node.transformFlags & 2097152 /* ContainsDynamicImport */)) {
-                return ts.visitEachChild(node, destructuringAndImportCallVisitor, context);
-            }
-            else {
+        function visitorWorker(node, valueIsDiscarded) {
+            if (!(node.transformFlags & (2048 /* ContainsDestructuringAssignment */ | 4194304 /* ContainsDynamicImport */ | 67108864 /* ContainsUpdateExpressionForIdentifier */))) {
                 return node;
             }
+            switch (node.kind) {
+                case 241 /* ForStatement */:
+                    return visitForStatement(node, /*isTopLevel*/ false);
+                case 237 /* ExpressionStatement */:
+                    return visitExpressionStatement(node);
+                case 211 /* ParenthesizedExpression */:
+                    return visitParenthesizedExpression(node, valueIsDiscarded);
+                case 348 /* PartiallyEmittedExpression */:
+                    return visitPartiallyEmittedExpression(node, valueIsDiscarded);
+                case 220 /* BinaryExpression */:
+                    if (ts.isDestructuringAssignment(node)) {
+                        return visitDestructuringAssignment(node, valueIsDiscarded);
+                    }
+                    break;
+                case 207 /* CallExpression */:
+                    if (ts.isImportCall(node)) {
+                        return visitImportCallExpression(node);
+                    }
+                    break;
+                case 218 /* PrefixUnaryExpression */:
+                case 219 /* PostfixUnaryExpression */:
+                    return visitPrefixOrPostfixUnaryExpression(node, valueIsDiscarded);
+            }
+            return ts.visitEachChild(node, visitor, context);
+        }
+        /**
+         * Visit nodes to flatten destructuring assignments to exported symbols.
+         *
+         * @param node The node to visit.
+         */
+        function visitor(node) {
+            return visitorWorker(node, /*valueIsDiscarded*/ false);
+        }
+        function discardedValueVisitor(node) {
+            return visitorWorker(node, /*valueIsDiscarded*/ true);
+        }
+        function visitExpressionStatement(node) {
+            return factory.updateExpressionStatement(node, ts.visitNode(node.expression, discardedValueVisitor, ts.isExpression));
+        }
+        function visitParenthesizedExpression(node, valueIsDiscarded) {
+            return factory.updateParenthesizedExpression(node, ts.visitNode(node.expression, valueIsDiscarded ? discardedValueVisitor : visitor, ts.isExpression));
+        }
+        function visitPartiallyEmittedExpression(node, valueIsDiscarded) {
+            return factory.updatePartiallyEmittedExpression(node, ts.visitNode(node.expression, valueIsDiscarded ? discardedValueVisitor : visitor, ts.isExpression));
         }
         function visitImportCallExpression(node) {
             // import("./blah")
@@ -97551,7 +104182,7 @@ var ts;
             //     };
             // });
             var externalModuleName = ts.getExternalModuleNameLiteral(factory, node, currentSourceFile, host, resolver, compilerOptions);
-            var firstArgument = ts.visitNode(ts.firstOrUndefined(node.arguments), destructuringAndImportCallVisitor);
+            var firstArgument = ts.visitNode(ts.firstOrUndefined(node.arguments), visitor);
             // Only use the external module name if it differs from the first argument. This allows us to preserve the quote style of the argument on output.
             var argument = externalModuleName && (!firstArgument || !ts.isStringLiteral(firstArgument) || firstArgument.text !== externalModuleName.text) ? externalModuleName : firstArgument;
             return factory.createCallExpression(factory.createPropertyAccessExpression(contextObject, factory.createIdentifier("import")), 
@@ -97562,15 +104193,14 @@ var ts;
          *
          * @param node The node to visit.
          */
-        function visitDestructuringAssignment(node) {
+        function visitDestructuringAssignment(node, valueIsDiscarded) {
             if (hasExportedReferenceInDestructuringTarget(node.left)) {
-                return ts.flattenDestructuringAssignment(node, destructuringAndImportCallVisitor, context, 0 /* All */, 
-                /*needsValue*/ true);
+                return ts.flattenDestructuringAssignment(node, visitor, context, 0 /* All */, !valueIsDiscarded);
             }
-            return ts.visitEachChild(node, destructuringAndImportCallVisitor, context);
+            return ts.visitEachChild(node, visitor, context);
         }
         /**
-         * Determines whether the target of a destructuring assigment refers to an exported symbol.
+         * Determines whether the target of a destructuring assignment refers to an exported symbol.
          *
          * @param node The destructuring target.
          */
@@ -97595,12 +104225,57 @@ var ts;
             }
             else if (ts.isIdentifier(node)) {
                 var container = resolver.getReferencedExportContainer(node);
-                return container !== undefined && container.kind === 297 /* SourceFile */;
+                return container !== undefined && container.kind === 303 /* SourceFile */;
             }
             else {
                 return false;
             }
         }
+        function visitPrefixOrPostfixUnaryExpression(node, valueIsDiscarded) {
+            // When we see a prefix or postfix increment expression whose operand is an exported
+            // symbol, we should ensure all exports of that symbol are updated with the correct
+            // value.
+            //
+            // - We do not transform generated identifiers for any reason.
+            // - We do not transform identifiers tagged with the LocalName flag.
+            // - We do not transform identifiers that were originally the name of an enum or
+            //   namespace due to how they are transformed in TypeScript.
+            // - We only transform identifiers that are exported at the top level.
+            if ((node.operator === 45 /* PlusPlusToken */ || node.operator === 46 /* MinusMinusToken */)
+                && ts.isIdentifier(node.operand)
+                && !ts.isGeneratedIdentifier(node.operand)
+                && !ts.isLocalName(node.operand)
+                && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) {
+                var exportedNames = getExports(node.operand);
+                if (exportedNames) {
+                    var temp = void 0;
+                    var expression = ts.visitNode(node.operand, visitor, ts.isExpression);
+                    if (ts.isPrefixUnaryExpression(node)) {
+                        expression = factory.updatePrefixUnaryExpression(node, expression);
+                    }
+                    else {
+                        expression = factory.updatePostfixUnaryExpression(node, expression);
+                        if (!valueIsDiscarded) {
+                            temp = factory.createTempVariable(hoistVariableDeclaration);
+                            expression = factory.createAssignment(temp, expression);
+                            ts.setTextRange(expression, node);
+                        }
+                        expression = factory.createComma(expression, factory.cloneNode(node.operand));
+                        ts.setTextRange(expression, node);
+                    }
+                    for (var _i = 0, exportedNames_4 = exportedNames; _i < exportedNames_4.length; _i++) {
+                        var exportName = exportedNames_4[_i];
+                        expression = createExportExpression(exportName, preventSubstitution(expression));
+                    }
+                    if (temp) {
+                        expression = factory.createComma(expression, temp);
+                        ts.setTextRange(expression, node);
+                    }
+                    return expression;
+                }
+            }
+            return ts.visitEachChild(node, visitor, context);
+        }
         //
         // Modifier Visitors
         //
@@ -97611,8 +104286,8 @@ var ts;
          */
         function modifierVisitor(node) {
             switch (node.kind) {
-                case 92 /* ExportKeyword */:
-                case 87 /* DefaultKeyword */:
+                case 93 /* ExportKeyword */:
+                case 88 /* DefaultKeyword */:
                     return undefined;
             }
             return node;
@@ -97628,7 +104303,7 @@ var ts;
          * @param emitCallback A callback used to emit the node in the printer.
          */
         function onEmitNode(hint, node, emitCallback) {
-            if (node.kind === 297 /* SourceFile */) {
+            if (node.kind === 303 /* SourceFile */) {
                 var id = ts.getOriginalNodeId(node);
                 currentSourceFile = node;
                 moduleInfo = moduleInfoMap[id];
@@ -97678,7 +104353,7 @@ var ts;
          */
         function substituteUnspecified(node) {
             switch (node.kind) {
-                case 289 /* ShorthandPropertyAssignment */:
+                case 295 /* ShorthandPropertyAssignment */:
                     return substituteShorthandPropertyAssignment(node);
             }
             return node;
@@ -97713,14 +104388,11 @@ var ts;
          */
         function substituteExpression(node) {
             switch (node.kind) {
-                case 78 /* Identifier */:
+                case 79 /* Identifier */:
                     return substituteExpressionIdentifier(node);
-                case 216 /* BinaryExpression */:
+                case 220 /* BinaryExpression */:
                     return substituteBinaryExpression(node);
-                case 214 /* PrefixUnaryExpression */:
-                case 215 /* PostfixUnaryExpression */:
-                    return substituteUnaryExpression(node);
-                case 226 /* MetaProperty */:
+                case 230 /* MetaProperty */:
                     return substituteMetaProperty(node);
             }
             return node;
@@ -97783,49 +104455,10 @@ var ts;
                 if (exportedNames) {
                     // For each additional export of the declaration, apply an export assignment.
                     var expression = node;
-                    for (var _i = 0, exportedNames_4 = exportedNames; _i < exportedNames_4.length; _i++) {
-                        var exportName = exportedNames_4[_i];
-                        expression = createExportExpression(exportName, preventSubstitution(expression));
-                    }
-                    return expression;
-                }
-            }
-            return node;
-        }
-        /**
-         * Substitution for a UnaryExpression that may contain an imported or exported symbol.
-         *
-         * @param node The node to substitute.
-         */
-        function substituteUnaryExpression(node) {
-            // When we see a prefix or postfix increment expression whose operand is an exported
-            // symbol, we should ensure all exports of that symbol are updated with the correct
-            // value.
-            //
-            // - We do not substitute generated identifiers for any reason.
-            // - We do not substitute identifiers tagged with the LocalName flag.
-            // - We do not substitute identifiers that were originally the name of an enum or
-            //   namespace due to how they are transformed in TypeScript.
-            // - We only substitute identifiers that are exported at the top level.
-            if ((node.operator === 45 /* PlusPlusToken */ || node.operator === 46 /* MinusMinusToken */)
-                && ts.isIdentifier(node.operand)
-                && !ts.isGeneratedIdentifier(node.operand)
-                && !ts.isLocalName(node.operand)
-                && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) {
-                var exportedNames = getExports(node.operand);
-                if (exportedNames) {
-                    var expression = node.kind === 215 /* PostfixUnaryExpression */
-                        ? ts.setTextRange(factory.createPrefixUnaryExpression(node.operator, node.operand), node)
-                        : node;
                     for (var _i = 0, exportedNames_5 = exportedNames; _i < exportedNames_5.length; _i++) {
                         var exportName = exportedNames_5[_i];
                         expression = createExportExpression(exportName, preventSubstitution(expression));
                     }
-                    if (node.kind === 215 /* PostfixUnaryExpression */) {
-                        expression = node.operator === 45 /* PlusPlusToken */
-                            ? factory.createSubtract(preventSubstitution(expression), factory.createNumericLiteral(1))
-                            : factory.createAdd(preventSubstitution(expression), factory.createNumericLiteral(1));
-                    }
                     return expression;
                 }
             }
@@ -97849,7 +104482,7 @@ var ts;
                     || resolver.getReferencedValueDeclaration(name);
                 if (valueDeclaration) {
                     var exportContainer = resolver.getReferencedExportContainer(name, /*prefixLocals*/ false);
-                    if (exportContainer && exportContainer.kind === 297 /* SourceFile */) {
+                    if (exportContainer && exportContainer.kind === 303 /* SourceFile */) {
                         exportedNames = ts.append(exportedNames, factory.getDeclarationName(valueDeclaration));
                     }
                     exportedNames = ts.addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]);
@@ -97884,25 +104517,36 @@ var ts;
 (function (ts) {
     function transformECMAScriptModule(context) {
         var factory = context.factory, emitHelpers = context.getEmitHelperFactory;
+        var host = context.getEmitHost();
+        var resolver = context.getEmitResolver();
         var compilerOptions = context.getCompilerOptions();
+        var languageVersion = ts.getEmitScriptTarget(compilerOptions);
         var previousOnEmitNode = context.onEmitNode;
         var previousOnSubstituteNode = context.onSubstituteNode;
         context.onEmitNode = onEmitNode;
         context.onSubstituteNode = onSubstituteNode;
-        context.enableEmitNotification(297 /* SourceFile */);
-        context.enableSubstitution(78 /* Identifier */);
+        context.enableEmitNotification(303 /* SourceFile */);
+        context.enableSubstitution(79 /* Identifier */);
         var helperNameSubstitutions;
+        var currentSourceFile;
+        var importRequireStatements;
         return ts.chainBundle(context, transformSourceFile);
         function transformSourceFile(node) {
             if (node.isDeclarationFile) {
                 return node;
             }
             if (ts.isExternalModule(node) || compilerOptions.isolatedModules) {
+                currentSourceFile = node;
+                importRequireStatements = undefined;
                 var result = updateExternalModule(node);
+                currentSourceFile = undefined;
+                if (importRequireStatements) {
+                    result = factory.updateSourceFile(result, ts.setTextRange(factory.createNodeArray(ts.insertStatementsAfterCustomPrologue(result.statements.slice(), importRequireStatements)), result.statements));
+                }
                 if (!ts.isExternalModule(node) || ts.some(result.statements, ts.isExternalModuleIndicator)) {
                     return result;
                 }
-                return factory.updateSourceFile(result, ts.setTextRange(factory.createNodeArray(__spreadArray(__spreadArray([], result.statements), [ts.createEmptyExports(factory)])), result.statements));
+                return factory.updateSourceFile(result, ts.setTextRange(factory.createNodeArray(__spreadArray(__spreadArray([], result.statements, true), [ts.createEmptyExports(factory)], false)), result.statements));
             }
             return node;
         }
@@ -97921,17 +104565,81 @@ var ts;
         }
         function visitor(node) {
             switch (node.kind) {
-                case 260 /* ImportEqualsDeclaration */:
-                    // Elide `import=` as it is not legal with --module ES6
-                    return undefined;
-                case 266 /* ExportAssignment */:
+                case 264 /* ImportEqualsDeclaration */:
+                    // Though an error in es2020 modules, in node-flavor es2020 modules, we can helpfully transform this to a synthetic `require` call
+                    // To give easy access to a synchronous `require` in node-flavor esm. We do the transform even in scenarios where we error, but `import.meta.url`
+                    // is available, just because the output is reasonable for a node-like runtime.
+                    return ts.getEmitScriptTarget(compilerOptions) >= ts.ModuleKind.ES2020 ? visitImportEqualsDeclaration(node) : undefined;
+                case 270 /* ExportAssignment */:
                     return visitExportAssignment(node);
-                case 267 /* ExportDeclaration */:
+                case 271 /* ExportDeclaration */:
                     var exportDecl = node;
                     return visitExportDeclaration(exportDecl);
             }
             return node;
         }
+        /**
+         * Creates a `require()` call to import an external module.
+         *
+         * @param importNode The declaration to import.
+         */
+        function createRequireCall(importNode) {
+            var moduleName = ts.getExternalModuleNameLiteral(factory, importNode, ts.Debug.checkDefined(currentSourceFile), host, resolver, compilerOptions);
+            var args = [];
+            if (moduleName) {
+                args.push(moduleName);
+            }
+            if (!importRequireStatements) {
+                var createRequireName = factory.createUniqueName("_createRequire", 16 /* Optimistic */ | 32 /* FileLevel */);
+                var importStatement = factory.createImportDeclaration(
+                /*decorators*/ undefined, 
+                /*modifiers*/ undefined, factory.createImportClause(
+                /*isTypeOnly*/ false, 
+                /*name*/ undefined, factory.createNamedImports([
+                    factory.createImportSpecifier(/*isTypeOnly*/ false, factory.createIdentifier("createRequire"), createRequireName)
+                ])), factory.createStringLiteral("module"));
+                var requireHelperName = factory.createUniqueName("__require", 16 /* Optimistic */ | 32 /* FileLevel */);
+                var requireStatement = factory.createVariableStatement(
+                /*modifiers*/ undefined, factory.createVariableDeclarationList([
+                    factory.createVariableDeclaration(requireHelperName, 
+                    /*exclamationToken*/ undefined, 
+                    /*type*/ undefined, factory.createCallExpression(factory.cloneNode(createRequireName), /*typeArguments*/ undefined, [
+                        factory.createPropertyAccessExpression(factory.createMetaProperty(100 /* ImportKeyword */, factory.createIdentifier("meta")), factory.createIdentifier("url"))
+                    ]))
+                ], 
+                /*flags*/ languageVersion >= 2 /* ES2015 */ ? 2 /* Const */ : 0 /* None */));
+                importRequireStatements = [importStatement, requireStatement];
+            }
+            var name = importRequireStatements[1].declarationList.declarations[0].name;
+            ts.Debug.assertNode(name, ts.isIdentifier);
+            return factory.createCallExpression(factory.cloneNode(name), /*typeArguments*/ undefined, args);
+        }
+        /**
+         * Visits an ImportEqualsDeclaration node.
+         *
+         * @param node The node to visit.
+         */
+        function visitImportEqualsDeclaration(node) {
+            ts.Debug.assert(ts.isExternalModuleImportEqualsDeclaration(node), "import= for internal module references should be handled in an earlier transformer.");
+            var statements;
+            statements = ts.append(statements, ts.setOriginalNode(ts.setTextRange(factory.createVariableStatement(
+            /*modifiers*/ undefined, factory.createVariableDeclarationList([
+                factory.createVariableDeclaration(factory.cloneNode(node.name), 
+                /*exclamationToken*/ undefined, 
+                /*type*/ undefined, createRequireCall(node))
+            ], 
+            /*flags*/ languageVersion >= 2 /* ES2015 */ ? 2 /* Const */ : 0 /* None */)), node), node));
+            statements = appendExportsOfImportEqualsDeclaration(statements, node);
+            return ts.singleOrMany(statements);
+        }
+        function appendExportsOfImportEqualsDeclaration(statements, node) {
+            if (ts.hasSyntacticModifier(node, 1 /* Export */)) {
+                statements = ts.append(statements, factory.createExportDeclaration(
+                /*decorators*/ undefined, 
+                /*modifiers*/ undefined, node.isTypeOnly, factory.createNamedExports([factory.createExportSpecifier(/*isTypeOnly*/ false, /*propertyName*/ undefined, ts.idText(node.name))])));
+            }
+            return statements;
+        }
         function visitExportAssignment(node) {
             // Elide `export=` as it is not legal with --module ES6
             return node.isExportEquals ? undefined : node;
@@ -97951,12 +104659,12 @@ var ts;
             /*decorators*/ undefined, 
             /*modifiers*/ undefined, factory.createImportClause(
             /*isTypeOnly*/ false, 
-            /*name*/ undefined, factory.createNamespaceImport(synthName)), node.moduleSpecifier);
+            /*name*/ undefined, factory.createNamespaceImport(synthName)), node.moduleSpecifier, node.assertClause);
             ts.setOriginalNode(importDecl, node.exportClause);
             var exportDecl = ts.isExportNamespaceAsDefaultDeclaration(node) ? factory.createExportDefault(synthName) : factory.createExportDeclaration(
             /*decorators*/ undefined, 
             /*modifiers*/ undefined, 
-            /*isTypeOnly*/ false, factory.createNamedExports([factory.createExportSpecifier(synthName, oldIdentifier)]));
+            /*isTypeOnly*/ false, factory.createNamedExports([factory.createExportSpecifier(/*isTypeOnly*/ false, synthName, oldIdentifier)]));
             ts.setOriginalNode(exportDecl, node);
             return [importDecl, exportDecl];
         }
@@ -98009,6 +104717,78 @@ var ts;
     }
     ts.transformECMAScriptModule = transformECMAScriptModule;
 })(ts || (ts = {}));
+/*@internal*/
+var ts;
+(function (ts) {
+    function transformNodeModule(context) {
+        var previousOnSubstituteNode = context.onSubstituteNode;
+        var previousOnEmitNode = context.onEmitNode;
+        var esmTransform = ts.transformECMAScriptModule(context);
+        var esmOnSubstituteNode = context.onSubstituteNode;
+        var esmOnEmitNode = context.onEmitNode;
+        context.onSubstituteNode = previousOnSubstituteNode;
+        context.onEmitNode = previousOnEmitNode;
+        var cjsTransform = ts.transformModule(context);
+        var cjsOnSubstituteNode = context.onSubstituteNode;
+        var cjsOnEmitNode = context.onEmitNode;
+        context.onSubstituteNode = onSubstituteNode;
+        context.onEmitNode = onEmitNode;
+        context.enableSubstitution(303 /* SourceFile */);
+        context.enableEmitNotification(303 /* SourceFile */);
+        var currentSourceFile;
+        return transformSourceFileOrBundle;
+        function onSubstituteNode(hint, node) {
+            if (ts.isSourceFile(node)) {
+                currentSourceFile = node;
+                // Neither component transform wants substitution notifications for `SourceFile`s, and, in fact, relies on
+                // the source file emit notification to setup scope variables for substitutions (so we _cannot_ call their substitute
+                // functions on source files safely, as that context only gets setup in a later pipeline phase!)
+                return previousOnSubstituteNode(hint, node);
+            }
+            else {
+                if (!currentSourceFile) {
+                    return previousOnSubstituteNode(hint, node);
+                }
+                if (currentSourceFile.impliedNodeFormat === ts.ModuleKind.ESNext) {
+                    return esmOnSubstituteNode(hint, node);
+                }
+                return cjsOnSubstituteNode(hint, node);
+            }
+        }
+        function onEmitNode(hint, node, emitCallback) {
+            if (ts.isSourceFile(node)) {
+                currentSourceFile = node;
+            }
+            if (!currentSourceFile) {
+                return previousOnEmitNode(hint, node, emitCallback);
+            }
+            if (currentSourceFile.impliedNodeFormat === ts.ModuleKind.ESNext) {
+                return esmOnEmitNode(hint, node, emitCallback);
+            }
+            return cjsOnEmitNode(hint, node, emitCallback);
+        }
+        function getModuleTransformForFile(file) {
+            return file.impliedNodeFormat === ts.ModuleKind.ESNext ? esmTransform : cjsTransform;
+        }
+        function transformSourceFile(node) {
+            if (node.isDeclarationFile) {
+                return node;
+            }
+            currentSourceFile = node;
+            var result = getModuleTransformForFile(node)(node);
+            currentSourceFile = undefined;
+            ts.Debug.assert(ts.isSourceFile(result));
+            return result;
+        }
+        function transformSourceFileOrBundle(node) {
+            return node.kind === 303 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node);
+        }
+        function transformBundle(node) {
+            return context.factory.createBundle(ts.map(node.sourceFiles, transformSourceFile), node.prepends);
+        }
+    }
+    ts.transformNodeModule = transformNodeModule;
+})(ts || (ts = {}));
 /* @internal */
 var ts;
 (function (ts) {
@@ -98054,14 +104834,14 @@ var ts;
             } : undefined;
         }
         function getAccessorNameVisibilityDiagnosticMessage(symbolAccessibilityResult) {
-            if (ts.hasSyntacticModifier(node, 32 /* Static */)) {
+            if (ts.isStatic(node)) {
                 return symbolAccessibilityResult.errorModuleName ?
                     symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ?
                         ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :
                         ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 :
                     ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1;
             }
-            else if (node.parent.kind === 252 /* ClassDeclaration */) {
+            else if (node.parent.kind === 256 /* ClassDeclaration */) {
                 return symbolAccessibilityResult.errorModuleName ?
                     symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ?
                         ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :
@@ -98083,14 +104863,14 @@ var ts;
             } : undefined;
         }
         function getMethodNameVisibilityDiagnosticMessage(symbolAccessibilityResult) {
-            if (ts.hasSyntacticModifier(node, 32 /* Static */)) {
+            if (ts.isStatic(node)) {
                 return symbolAccessibilityResult.errorModuleName ?
                     symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ?
                         ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :
                         ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 :
                     ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1;
             }
-            else if (node.parent.kind === 252 /* ClassDeclaration */) {
+            else if (node.parent.kind === 256 /* ClassDeclaration */) {
                 return symbolAccessibilityResult.errorModuleName ?
                     symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ?
                         ts.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :
@@ -98134,10 +104914,10 @@ var ts;
             return getTypeAliasDeclarationVisibilityError;
         }
         else {
-            return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: " + ts.SyntaxKind[node.kind]);
+            return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: ".concat(ts.SyntaxKind[node.kind]));
         }
         function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
-            if (node.kind === 249 /* VariableDeclaration */ || node.kind === 198 /* BindingElement */) {
+            if (node.kind === 253 /* VariableDeclaration */ || node.kind === 202 /* BindingElement */) {
                 return symbolAccessibilityResult.errorModuleName ?
                     symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ?
                         ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :
@@ -98146,17 +104926,17 @@ var ts;
             }
             // This check is to ensure we don't report error on constructor parameter property as that error would be reported during parameter emit
             // The only exception here is if the constructor was marked as private. we are not emitting the constructor parameters at all.
-            else if (node.kind === 163 /* PropertyDeclaration */ || node.kind === 201 /* PropertyAccessExpression */ || node.kind === 162 /* PropertySignature */ ||
-                (node.kind === 160 /* Parameter */ && ts.hasSyntacticModifier(node.parent, 8 /* Private */))) {
+            else if (node.kind === 166 /* PropertyDeclaration */ || node.kind === 205 /* PropertyAccessExpression */ || node.kind === 165 /* PropertySignature */ ||
+                (node.kind === 163 /* Parameter */ && ts.hasSyntacticModifier(node.parent, 8 /* Private */))) {
                 // TODO(jfreeman): Deal with computed properties in error reporting.
-                if (ts.hasSyntacticModifier(node, 32 /* Static */)) {
+                if (ts.isStatic(node)) {
                     return symbolAccessibilityResult.errorModuleName ?
                         symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ?
                             ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :
                             ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 :
                         ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1;
                 }
-                else if (node.parent.kind === 252 /* ClassDeclaration */ || node.kind === 160 /* Parameter */) {
+                else if (node.parent.kind === 256 /* ClassDeclaration */ || node.kind === 163 /* Parameter */) {
                     return symbolAccessibilityResult.errorModuleName ?
                         symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ?
                             ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :
@@ -98181,10 +104961,10 @@ var ts;
         }
         function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) {
             var diagnosticMessage;
-            if (node.kind === 168 /* SetAccessor */) {
+            if (node.kind === 172 /* SetAccessor */) {
                 // Getters can infer the return type from the returned expression, but setters cannot, so the
                 // "_from_external_module_1_but_cannot_be_named" case cannot occur.
-                if (ts.hasSyntacticModifier(node, 32 /* Static */)) {
+                if (ts.isStatic(node)) {
                     diagnosticMessage = symbolAccessibilityResult.errorModuleName ?
                         ts.Diagnostics.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 :
                         ts.Diagnostics.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1;
@@ -98196,7 +104976,7 @@ var ts;
                 }
             }
             else {
-                if (ts.hasSyntacticModifier(node, 32 /* Static */)) {
+                if (ts.isStatic(node)) {
                     diagnosticMessage = symbolAccessibilityResult.errorModuleName ?
                         symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ?
                             ts.Diagnostics.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :
@@ -98220,34 +105000,34 @@ var ts;
         function getReturnTypeVisibilityError(symbolAccessibilityResult) {
             var diagnosticMessage;
             switch (node.kind) {
-                case 170 /* ConstructSignature */:
+                case 174 /* ConstructSignature */:
                     // Interfaces cannot have return types that cannot be named
                     diagnosticMessage = symbolAccessibilityResult.errorModuleName ?
                         ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 :
                         ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0;
                     break;
-                case 169 /* CallSignature */:
+                case 173 /* CallSignature */:
                     // Interfaces cannot have return types that cannot be named
                     diagnosticMessage = symbolAccessibilityResult.errorModuleName ?
                         ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 :
                         ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0;
                     break;
-                case 171 /* IndexSignature */:
+                case 175 /* IndexSignature */:
                     // Interfaces cannot have return types that cannot be named
                     diagnosticMessage = symbolAccessibilityResult.errorModuleName ?
                         ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 :
                         ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0;
                     break;
-                case 165 /* MethodDeclaration */:
-                case 164 /* MethodSignature */:
-                    if (ts.hasSyntacticModifier(node, 32 /* Static */)) {
+                case 168 /* MethodDeclaration */:
+                case 167 /* MethodSignature */:
+                    if (ts.isStatic(node)) {
                         diagnosticMessage = symbolAccessibilityResult.errorModuleName ?
                             symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ?
                                 ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named :
                                 ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 :
                             ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0;
                     }
-                    else if (node.parent.kind === 252 /* ClassDeclaration */) {
+                    else if (node.parent.kind === 256 /* ClassDeclaration */) {
                         diagnosticMessage = symbolAccessibilityResult.errorModuleName ?
                             symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ?
                                 ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named :
@@ -98261,7 +105041,7 @@ var ts;
                             ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0;
                     }
                     break;
-                case 251 /* FunctionDeclaration */:
+                case 255 /* FunctionDeclaration */:
                     diagnosticMessage = symbolAccessibilityResult.errorModuleName ?
                         symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ?
                             ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named :
@@ -98286,38 +105066,38 @@ var ts;
         }
         function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
             switch (node.parent.kind) {
-                case 166 /* Constructor */:
+                case 170 /* Constructor */:
                     return symbolAccessibilityResult.errorModuleName ?
                         symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ?
                             ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :
                             ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 :
                         ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1;
-                case 170 /* ConstructSignature */:
-                case 175 /* ConstructorType */:
+                case 174 /* ConstructSignature */:
+                case 179 /* ConstructorType */:
                     // Interfaces cannot have parameter types that cannot be named
                     return symbolAccessibilityResult.errorModuleName ?
                         ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 :
                         ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1;
-                case 169 /* CallSignature */:
+                case 173 /* CallSignature */:
                     // Interfaces cannot have parameter types that cannot be named
                     return symbolAccessibilityResult.errorModuleName ?
                         ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 :
                         ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1;
-                case 171 /* IndexSignature */:
+                case 175 /* IndexSignature */:
                     // Interfaces cannot have parameter types that cannot be named
                     return symbolAccessibilityResult.errorModuleName ?
                         ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 :
                         ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1;
-                case 165 /* MethodDeclaration */:
-                case 164 /* MethodSignature */:
-                    if (ts.hasSyntacticModifier(node.parent, 32 /* Static */)) {
+                case 168 /* MethodDeclaration */:
+                case 167 /* MethodSignature */:
+                    if (ts.isStatic(node.parent)) {
                         return symbolAccessibilityResult.errorModuleName ?
                             symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ?
                                 ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :
                                 ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 :
                             ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1;
                     }
-                    else if (node.parent.parent.kind === 252 /* ClassDeclaration */) {
+                    else if (node.parent.parent.kind === 256 /* ClassDeclaration */) {
                         return symbolAccessibilityResult.errorModuleName ?
                             symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ?
                                 ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :
@@ -98330,61 +105110,61 @@ var ts;
                             ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 :
                             ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1;
                     }
-                case 251 /* FunctionDeclaration */:
-                case 174 /* FunctionType */:
+                case 255 /* FunctionDeclaration */:
+                case 178 /* FunctionType */:
                     return symbolAccessibilityResult.errorModuleName ?
                         symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ?
                             ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :
                             ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 :
                         ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1;
-                case 168 /* SetAccessor */:
-                case 167 /* GetAccessor */:
+                case 172 /* SetAccessor */:
+                case 171 /* GetAccessor */:
                     return symbolAccessibilityResult.errorModuleName ?
                         symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ?
                             ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :
                             ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2 :
                         ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_private_name_1;
                 default:
-                    return ts.Debug.fail("Unknown parent for parameter: " + ts.SyntaxKind[node.parent.kind]);
+                    return ts.Debug.fail("Unknown parent for parameter: ".concat(ts.SyntaxKind[node.parent.kind]));
             }
         }
         function getTypeParameterConstraintVisibilityError() {
             // Type parameter constraints are named by user so we should always be able to name it
             var diagnosticMessage;
             switch (node.parent.kind) {
-                case 252 /* ClassDeclaration */:
+                case 256 /* ClassDeclaration */:
                     diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1;
                     break;
-                case 253 /* InterfaceDeclaration */:
+                case 257 /* InterfaceDeclaration */:
                     diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1;
                     break;
-                case 190 /* MappedType */:
+                case 194 /* MappedType */:
                     diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1;
                     break;
-                case 175 /* ConstructorType */:
-                case 170 /* ConstructSignature */:
+                case 179 /* ConstructorType */:
+                case 174 /* ConstructSignature */:
                     diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1;
                     break;
-                case 169 /* CallSignature */:
+                case 173 /* CallSignature */:
                     diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1;
                     break;
-                case 165 /* MethodDeclaration */:
-                case 164 /* MethodSignature */:
-                    if (ts.hasSyntacticModifier(node.parent, 32 /* Static */)) {
+                case 168 /* MethodDeclaration */:
+                case 167 /* MethodSignature */:
+                    if (ts.isStatic(node.parent)) {
                         diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1;
                     }
-                    else if (node.parent.parent.kind === 252 /* ClassDeclaration */) {
+                    else if (node.parent.parent.kind === 256 /* ClassDeclaration */) {
                         diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1;
                     }
                     else {
                         diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1;
                     }
                     break;
-                case 174 /* FunctionType */:
-                case 251 /* FunctionDeclaration */:
+                case 178 /* FunctionType */:
+                case 255 /* FunctionDeclaration */:
                     diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1;
                     break;
-                case 254 /* TypeAliasDeclaration */:
+                case 258 /* TypeAliasDeclaration */:
                     diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1;
                     break;
                 default:
@@ -98401,7 +105181,7 @@ var ts;
             // Heritage clause is written by user so it can always be named
             if (ts.isClassDeclaration(node.parent.parent)) {
                 // Class or Interface implemented/extended is inaccessible
-                diagnosticMessage = ts.isHeritageClause(node.parent) && node.parent.token === 116 /* ImplementsKeyword */ ?
+                diagnosticMessage = ts.isHeritageClause(node.parent) && node.parent.token === 117 /* ImplementsKeyword */ ?
                     ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 :
                     node.parent.parent.name ? ts.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1 :
                         ts.Diagnostics.extends_clause_of_exported_class_has_or_is_using_private_name_0;
@@ -98450,7 +105230,7 @@ var ts;
     }
     function isInternalDeclaration(node, currentSourceFile) {
         var parseTreeNode = ts.getParseTreeNode(node);
-        if (parseTreeNode && parseTreeNode.kind === 160 /* Parameter */) {
+        if (parseTreeNode && parseTreeNode.kind === 163 /* Parameter */) {
             var paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode);
             var previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : undefined;
             var text = currentSourceFile.text;
@@ -98509,7 +105289,8 @@ var ts;
             moduleResolverHost: host,
             trackReferencedAmbientModule: trackReferencedAmbientModule,
             trackExternalModuleSymbolOfImportTypeNode: trackExternalModuleSymbolOfImportTypeNode,
-            reportNonlocalAugmentation: reportNonlocalAugmentation
+            reportNonlocalAugmentation: reportNonlocalAugmentation,
+            reportNonSerializableProperty: reportNonSerializableProperty
         };
         var errorNameNode;
         var errorFallbackNode;
@@ -98567,8 +105348,10 @@ var ts;
                     else {
                         context.addDiagnostic(ts.createDiagnosticForNode(symbolAccessibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, symbolAccessibilityResult.errorSymbolName, symbolAccessibilityResult.errorModuleName));
                     }
+                    return true;
                 }
             }
+            return false;
         }
         function trackExternalModuleSymbolOfImportTypeNode(symbol) {
             if (!isBundledEmit) {
@@ -98577,33 +105360,40 @@ var ts;
         }
         function trackSymbol(symbol, enclosingDeclaration, meaning) {
             if (symbol.flags & 262144 /* TypeParameter */)
-                return;
-            handleSymbolAccessibilityError(resolver.isSymbolAccessible(symbol, enclosingDeclaration, meaning, /*shouldComputeAliasesToMakeVisible*/ true));
+                return false;
+            var issuedDiagnostic = handleSymbolAccessibilityError(resolver.isSymbolAccessible(symbol, enclosingDeclaration, meaning, /*shouldComputeAliasesToMakeVisible*/ true));
             recordTypeReferenceDirectivesIfNecessary(resolver.getTypeReferenceDirectivesForSymbol(symbol, meaning));
+            return issuedDiagnostic;
         }
         function reportPrivateInBaseOfClassExpression(propertyName) {
             if (errorNameNode || errorFallbackNode) {
                 context.addDiagnostic(ts.createDiagnosticForNode((errorNameNode || errorFallbackNode), ts.Diagnostics.Property_0_of_exported_class_expression_may_not_be_private_or_protected, propertyName));
             }
         }
+        function errorDeclarationNameWithFallback() {
+            return errorNameNode ? ts.declarationNameToString(errorNameNode) :
+                errorFallbackNode && ts.getNameOfDeclaration(errorFallbackNode) ? ts.declarationNameToString(ts.getNameOfDeclaration(errorFallbackNode)) :
+                    errorFallbackNode && ts.isExportAssignment(errorFallbackNode) ? errorFallbackNode.isExportEquals ? "export=" : "default" :
+                        "(Missing)"; // same fallback declarationNameToString uses when node is zero-width (ie, nameless)
+        }
         function reportInaccessibleUniqueSymbolError() {
-            if (errorNameNode) {
-                context.addDiagnostic(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary, ts.declarationNameToString(errorNameNode), "unique symbol"));
+            if (errorNameNode || errorFallbackNode) {
+                context.addDiagnostic(ts.createDiagnosticForNode((errorNameNode || errorFallbackNode), ts.Diagnostics.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary, errorDeclarationNameWithFallback(), "unique symbol"));
             }
         }
         function reportCyclicStructureError() {
-            if (errorNameNode) {
-                context.addDiagnostic(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary, ts.declarationNameToString(errorNameNode)));
+            if (errorNameNode || errorFallbackNode) {
+                context.addDiagnostic(ts.createDiagnosticForNode((errorNameNode || errorFallbackNode), ts.Diagnostics.The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary, errorDeclarationNameWithFallback()));
             }
         }
         function reportInaccessibleThisError() {
-            if (errorNameNode) {
-                context.addDiagnostic(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary, ts.declarationNameToString(errorNameNode), "this"));
+            if (errorNameNode || errorFallbackNode) {
+                context.addDiagnostic(ts.createDiagnosticForNode((errorNameNode || errorFallbackNode), ts.Diagnostics.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary, errorDeclarationNameWithFallback(), "this"));
             }
         }
         function reportLikelyUnsafeImportRequiredError(specifier) {
-            if (errorNameNode) {
-                context.addDiagnostic(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary, ts.declarationNameToString(errorNameNode), specifier));
+            if (errorNameNode || errorFallbackNode) {
+                context.addDiagnostic(ts.createDiagnosticForNode((errorNameNode || errorFallbackNode), ts.Diagnostics.The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary, errorDeclarationNameWithFallback(), specifier));
             }
         }
         function reportTruncationError() {
@@ -98612,11 +105402,19 @@ var ts;
             }
         }
         function reportNonlocalAugmentation(containingFile, parentSymbol, symbol) {
-            var primaryDeclaration = ts.find(parentSymbol.declarations, function (d) { return ts.getSourceFileOfNode(d) === containingFile; });
+            var _a;
+            var primaryDeclaration = (_a = parentSymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(function (d) { return ts.getSourceFileOfNode(d) === containingFile; });
             var augmentingDeclarations = ts.filter(symbol.declarations, function (d) { return ts.getSourceFileOfNode(d) !== containingFile; });
-            for (var _i = 0, augmentingDeclarations_1 = augmentingDeclarations; _i < augmentingDeclarations_1.length; _i++) {
-                var augmentations = augmentingDeclarations_1[_i];
-                context.addDiagnostic(ts.addRelatedInfo(ts.createDiagnosticForNode(augmentations, ts.Diagnostics.Declaration_augments_declaration_in_another_file_This_cannot_be_serialized), ts.createDiagnosticForNode(primaryDeclaration, ts.Diagnostics.This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_file)));
+            if (augmentingDeclarations) {
+                for (var _i = 0, augmentingDeclarations_1 = augmentingDeclarations; _i < augmentingDeclarations_1.length; _i++) {
+                    var augmentations = augmentingDeclarations_1[_i];
+                    context.addDiagnostic(ts.addRelatedInfo(ts.createDiagnosticForNode(augmentations, ts.Diagnostics.Declaration_augments_declaration_in_another_file_This_cannot_be_serialized), ts.createDiagnosticForNode(primaryDeclaration, ts.Diagnostics.This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_file)));
+                }
+            }
+        }
+        function reportNonSerializableProperty(propertyName) {
+            if (errorNameNode || errorFallbackNode) {
+                context.addDiagnostic(ts.createDiagnosticForNode((errorNameNode || errorFallbackNode), ts.Diagnostics.The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized, propertyName));
             }
         }
         function transformDeclarationsForJS(sourceFile, bundled) {
@@ -98632,10 +105430,10 @@ var ts;
             return result;
         }
         function transformRoot(node) {
-            if (node.kind === 297 /* SourceFile */ && node.isDeclarationFile) {
+            if (node.kind === 303 /* SourceFile */ && node.isDeclarationFile) {
                 return node;
             }
-            if (node.kind === 298 /* Bundle */) {
+            if (node.kind === 304 /* Bundle */) {
                 isBundledEmit = true;
                 refs = new ts.Map();
                 libs = new ts.Map();
@@ -98658,14 +105456,14 @@ var ts;
                         resultHasExternalModuleIndicator = false; // unused in external module bundle emit (all external modules are within module blocks, therefore are known to be modules)
                         needsDeclare = false;
                         var statements = ts.isSourceFileJS(sourceFile) ? factory.createNodeArray(transformDeclarationsForJS(sourceFile, /*bundled*/ true)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements);
-                        var newFile = factory.updateSourceFile(sourceFile, [factory.createModuleDeclaration([], [factory.createModifier(133 /* DeclareKeyword */)], factory.createStringLiteral(ts.getResolvedExternalModuleName(context.getEmitHost(), sourceFile)), factory.createModuleBlock(ts.setTextRange(factory.createNodeArray(transformAndReplaceLatePaintedStatements(statements)), sourceFile.statements)))], /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []);
+                        var newFile = factory.updateSourceFile(sourceFile, [factory.createModuleDeclaration([], [factory.createModifier(135 /* DeclareKeyword */)], factory.createStringLiteral(ts.getResolvedExternalModuleName(context.getEmitHost(), sourceFile)), factory.createModuleBlock(ts.setTextRange(factory.createNodeArray(transformAndReplaceLatePaintedStatements(statements)), sourceFile.statements)))], /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []);
                         return newFile;
                     }
                     needsDeclare = true;
                     var updated = ts.isSourceFileJS(sourceFile) ? factory.createNodeArray(transformDeclarationsForJS(sourceFile)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements);
                     return factory.updateSourceFile(sourceFile, transformAndReplaceLatePaintedStatements(updated), /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []);
                 }), ts.mapDefined(node.prepends, function (prepend) {
-                    if (prepend.kind === 300 /* InputFiles */) {
+                    if (prepend.kind === 306 /* InputFiles */) {
                         var sourceFile = ts.createUnparsedSourceFile(prepend, "dts", stripInternal);
                         hasNoDefaultLib_1 = hasNoDefaultLib_1 || !!sourceFile.hasNoDefaultLib;
                         collectReferences(sourceFile, refs);
@@ -98714,7 +105512,7 @@ var ts;
                 refs.forEach(referenceVisitor);
                 emittedImports = ts.filter(combinedStatements, ts.isAnyImportSyntax);
                 if (ts.isExternalModule(node) && (!resultHasExternalModuleIndicator || (needsScopeFixMarker && !resultHasScopeMarker))) {
-                    combinedStatements = ts.setTextRange(factory.createNodeArray(__spreadArray(__spreadArray([], combinedStatements), [ts.createEmptyExports(factory)])), combinedStatements);
+                    combinedStatements = ts.setTextRange(factory.createNodeArray(__spreadArray(__spreadArray([], combinedStatements, true), [ts.createEmptyExports(factory)], false)), combinedStatements);
                 }
             }
             var updated = factory.updateSourceFile(node, combinedStatements, /*isDeclarationFile*/ true, references, getFileReferencesForUsedTypeReferences(), node.hasNoDefaultLib, getLibReferences());
@@ -98757,8 +105555,7 @@ var ts;
                         declFileName = paths.declarationFilePath || paths.jsFilePath || file.fileName;
                     }
                     if (declFileName) {
-                        var specifier = ts.moduleSpecifiers.getModuleSpecifier(__assign(__assign({}, options), { baseUrl: options.baseUrl && ts.toPath(options.baseUrl, host.getCurrentDirectory(), host.getCanonicalFileName) }), currentSourceFile, ts.toPath(outputFilePath, host.getCurrentDirectory(), host.getCanonicalFileName), ts.toPath(declFileName, host.getCurrentDirectory(), host.getCanonicalFileName), host, 
-                        /*preferences*/ undefined);
+                        var specifier = ts.moduleSpecifiers.getModuleSpecifier(options, currentSourceFile, ts.toPath(outputFilePath, host.getCurrentDirectory(), host.getCanonicalFileName), ts.toPath(declFileName, host.getCurrentDirectory(), host.getCanonicalFileName), host);
                         if (!ts.pathIsRelative(specifier)) {
                             // If some compiler option/symlink/whatever allows access to the file containing the ambient module declaration
                             // via a non-relative name, emit a type reference directive to that non-relative name, rather than
@@ -98802,11 +105599,11 @@ var ts;
             return ret;
         }
         function filterBindingPatternInitializers(name) {
-            if (name.kind === 78 /* Identifier */) {
+            if (name.kind === 79 /* Identifier */) {
                 return name;
             }
             else {
-                if (name.kind === 197 /* ArrayBindingPattern */) {
+                if (name.kind === 201 /* ArrayBindingPattern */) {
                     return factory.updateArrayBindingPattern(name, ts.visitNodes(name.elements, visitBindingElement));
                 }
                 else {
@@ -98814,7 +105611,7 @@ var ts;
                 }
             }
             function visitBindingElement(elem) {
-                if (elem.kind === 222 /* OmittedExpression */) {
+                if (elem.kind === 226 /* OmittedExpression */) {
                     return elem;
                 }
                 return factory.updateBindingElement(elem, elem.dotDotDotToken, elem.propertyName, filterBindingPatternInitializers(elem.name), shouldPrintWithInitializer(elem) ? elem.initializer : undefined);
@@ -98852,19 +105649,19 @@ var ts;
                 // Literal const declarations will have an initializer ensured rather than a type
                 return;
             }
-            var shouldUseResolverType = node.kind === 160 /* Parameter */ &&
+            var shouldUseResolverType = node.kind === 163 /* Parameter */ &&
                 (resolver.isRequiredInitializedParameter(node) ||
                     resolver.isOptionalUninitializedParameterProperty(node));
             if (type && !shouldUseResolverType) {
                 return ts.visitNode(type, visitDeclarationSubtree);
             }
             if (!ts.getParseTreeNode(node)) {
-                return type ? ts.visitNode(type, visitDeclarationSubtree) : factory.createKeywordTypeNode(128 /* AnyKeyword */);
+                return type ? ts.visitNode(type, visitDeclarationSubtree) : factory.createKeywordTypeNode(130 /* AnyKeyword */);
             }
-            if (node.kind === 168 /* SetAccessor */) {
+            if (node.kind === 172 /* SetAccessor */) {
                 // Set accessors with no associated type node (from it's param or get accessor return) are `any` since they are never contextually typed right now
                 // (The inferred type here will be void, but the old declaration emitter printed `any`, so this replicates that)
-                return factory.createKeywordTypeNode(128 /* AnyKeyword */);
+                return factory.createKeywordTypeNode(130 /* AnyKeyword */);
             }
             errorNameNode = node.name;
             var oldDiag;
@@ -98872,12 +105669,12 @@ var ts;
                 oldDiag = getSymbolAccessibilityDiagnostic;
                 getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(node);
             }
-            if (node.kind === 249 /* VariableDeclaration */ || node.kind === 198 /* BindingElement */) {
+            if (node.kind === 253 /* VariableDeclaration */ || node.kind === 202 /* BindingElement */) {
                 return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker));
             }
-            if (node.kind === 160 /* Parameter */
-                || node.kind === 163 /* PropertyDeclaration */
-                || node.kind === 162 /* PropertySignature */) {
+            if (node.kind === 163 /* Parameter */
+                || node.kind === 166 /* PropertyDeclaration */
+                || node.kind === 165 /* PropertySignature */) {
                 if (!node.initializer)
                     return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType));
                 return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType) || resolver.createTypeOfExpression(node.initializer, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker));
@@ -98888,30 +105685,41 @@ var ts;
                 if (!suppressNewDiagnosticContexts) {
                     getSymbolAccessibilityDiagnostic = oldDiag;
                 }
-                return returnValue || factory.createKeywordTypeNode(128 /* AnyKeyword */);
+                return returnValue || factory.createKeywordTypeNode(130 /* AnyKeyword */);
             }
         }
         function isDeclarationAndNotVisible(node) {
             node = ts.getParseTreeNode(node);
             switch (node.kind) {
-                case 251 /* FunctionDeclaration */:
-                case 256 /* ModuleDeclaration */:
-                case 253 /* InterfaceDeclaration */:
-                case 252 /* ClassDeclaration */:
-                case 254 /* TypeAliasDeclaration */:
-                case 255 /* EnumDeclaration */:
+                case 255 /* FunctionDeclaration */:
+                case 260 /* ModuleDeclaration */:
+                case 257 /* InterfaceDeclaration */:
+                case 256 /* ClassDeclaration */:
+                case 258 /* TypeAliasDeclaration */:
+                case 259 /* EnumDeclaration */:
                     return !resolver.isDeclarationVisible(node);
                 // The following should be doing their own visibility checks based on filtering their members
-                case 249 /* VariableDeclaration */:
+                case 253 /* VariableDeclaration */:
                     return !getBindingNameVisible(node);
-                case 260 /* ImportEqualsDeclaration */:
-                case 261 /* ImportDeclaration */:
-                case 267 /* ExportDeclaration */:
-                case 266 /* ExportAssignment */:
+                case 264 /* ImportEqualsDeclaration */:
+                case 265 /* ImportDeclaration */:
+                case 271 /* ExportDeclaration */:
+                case 270 /* ExportAssignment */:
                     return false;
+                case 169 /* ClassStaticBlockDeclaration */:
+                    return true;
             }
             return false;
         }
+        // If the ExpandoFunctionDeclaration have multiple overloads, then we only need to emit properties for the last one.
+        function shouldEmitFunctionProperties(input) {
+            var _a;
+            if (input.body) {
+                return true;
+            }
+            var overloadSignatures = (_a = input.symbol.declarations) === null || _a === void 0 ? void 0 : _a.filter(function (decl) { return ts.isFunctionDeclaration(decl) && !decl.body; });
+            return !overloadSignatures || overloadSignatures.indexOf(input) === overloadSignatures.length - 1;
+        }
         function getBindingNameVisible(elem) {
             if (ts.isOmittedExpression(elem)) {
                 return false;
@@ -98988,7 +105796,7 @@ var ts;
         function rewriteModuleSpecifier(parent, input) {
             if (!input)
                 return undefined; // TODO: GH#18217
-            resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 256 /* ModuleDeclaration */ && parent.kind !== 195 /* ImportType */);
+            resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 260 /* ModuleDeclaration */ && parent.kind !== 199 /* ImportType */);
             if (ts.isStringLiteralLike(input)) {
                 if (isBundledEmit) {
                     var newName = ts.getExternalModuleNameFromDeclaration(context.getEmitHost(), resolver, parent);
@@ -99008,7 +105816,7 @@ var ts;
         function transformImportEqualsDeclaration(decl) {
             if (!resolver.isDeclarationVisible(decl))
                 return;
-            if (decl.moduleReference.kind === 272 /* ExternalModuleReference */) {
+            if (decl.moduleReference.kind === 276 /* ExternalModuleReference */) {
                 // Rewrite external module names if necessary
                 var specifier = ts.getExternalModuleImportEqualsDeclarationExpression(decl);
                 return factory.updateImportEqualsDeclaration(decl, 
@@ -99026,31 +105834,34 @@ var ts;
             if (!decl.importClause) {
                 // import "mod" - possibly needed for side effects? (global interface patches, module augmentations, etc)
                 return factory.updateImportDeclaration(decl, 
-                /*decorators*/ undefined, decl.modifiers, decl.importClause, rewriteModuleSpecifier(decl, decl.moduleSpecifier));
+                /*decorators*/ undefined, decl.modifiers, decl.importClause, rewriteModuleSpecifier(decl, decl.moduleSpecifier), 
+                /*assertClause*/ undefined);
             }
             // The `importClause` visibility corresponds to the default's visibility.
             var visibleDefaultBinding = decl.importClause && decl.importClause.name && resolver.isDeclarationVisible(decl.importClause) ? decl.importClause.name : undefined;
             if (!decl.importClause.namedBindings) {
                 // No named bindings (either namespace or list), meaning the import is just default or should be elided
                 return visibleDefaultBinding && factory.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, factory.updateImportClause(decl.importClause, decl.importClause.isTypeOnly, visibleDefaultBinding, 
-                /*namedBindings*/ undefined), rewriteModuleSpecifier(decl, decl.moduleSpecifier));
+                /*namedBindings*/ undefined), rewriteModuleSpecifier(decl, decl.moduleSpecifier), /*assertClause*/ undefined);
             }
-            if (decl.importClause.namedBindings.kind === 263 /* NamespaceImport */) {
+            if (decl.importClause.namedBindings.kind === 267 /* NamespaceImport */) {
                 // Namespace import (optionally with visible default)
                 var namedBindings = resolver.isDeclarationVisible(decl.importClause.namedBindings) ? decl.importClause.namedBindings : /*namedBindings*/ undefined;
-                return visibleDefaultBinding || namedBindings ? factory.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, factory.updateImportClause(decl.importClause, decl.importClause.isTypeOnly, visibleDefaultBinding, namedBindings), rewriteModuleSpecifier(decl, decl.moduleSpecifier)) : undefined;
+                return visibleDefaultBinding || namedBindings ? factory.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, factory.updateImportClause(decl.importClause, decl.importClause.isTypeOnly, visibleDefaultBinding, namedBindings), rewriteModuleSpecifier(decl, decl.moduleSpecifier), /*assertClause*/ undefined) : undefined;
             }
             // Named imports (optionally with visible default)
             var bindingList = ts.mapDefined(decl.importClause.namedBindings.elements, function (b) { return resolver.isDeclarationVisible(b) ? b : undefined; });
             if ((bindingList && bindingList.length) || visibleDefaultBinding) {
                 return factory.updateImportDeclaration(decl, 
-                /*decorators*/ undefined, decl.modifiers, factory.updateImportClause(decl.importClause, decl.importClause.isTypeOnly, visibleDefaultBinding, bindingList && bindingList.length ? factory.updateNamedImports(decl.importClause.namedBindings, bindingList) : undefined), rewriteModuleSpecifier(decl, decl.moduleSpecifier));
+                /*decorators*/ undefined, decl.modifiers, factory.updateImportClause(decl.importClause, decl.importClause.isTypeOnly, visibleDefaultBinding, bindingList && bindingList.length ? factory.updateNamedImports(decl.importClause.namedBindings, bindingList) : undefined), rewriteModuleSpecifier(decl, decl.moduleSpecifier), 
+                /*assertClause*/ undefined);
             }
             // Augmentation of export depends on import
             if (resolver.isImportRequiredByAugmentation(decl)) {
                 return factory.updateImportDeclaration(decl, 
                 /*decorators*/ undefined, decl.modifiers, 
-                /*importClause*/ undefined, rewriteModuleSpecifier(decl, decl.moduleSpecifier));
+                /*importClause*/ undefined, rewriteModuleSpecifier(decl, decl.moduleSpecifier), 
+                /*assertClause*/ undefined);
             }
             // Nothing visible
         }
@@ -99072,7 +105883,7 @@ var ts;
             while (ts.length(lateMarkedStatements)) {
                 var i = lateMarkedStatements.shift();
                 if (!ts.isLateVisibilityPaintedStatement(i)) {
-                    return ts.Debug.fail("Late replaced statement was found which is not handled by the declaration transformer!: " + (ts.SyntaxKind ? ts.SyntaxKind[i.kind] : i.kind));
+                    return ts.Debug.fail("Late replaced statement was found which is not handled by the declaration transformer!: ".concat(ts.SyntaxKind ? ts.SyntaxKind[i.kind] : i.kind));
                 }
                 var priorNeedsDeclare = needsDeclare;
                 needsDeclare = i.parent && ts.isSourceFile(i.parent) && !(ts.isExternalModule(i.parent) && isBundledEmit);
@@ -99130,7 +105941,7 @@ var ts;
             // We'd see a TDZ violation at runtime
             var canProduceDiagnostic = ts.canProduceDiagnostics(input);
             var oldWithinObjectLiteralType = suppressNewDiagnosticContexts;
-            var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 177 /* TypeLiteral */ || input.kind === 190 /* MappedType */) && input.parent.kind !== 254 /* TypeAliasDeclaration */);
+            var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 181 /* TypeLiteral */ || input.kind === 194 /* MappedType */) && input.parent.kind !== 258 /* TypeAliasDeclaration */);
             // Emit methods which are private as properties with no type information
             if (ts.isMethodDeclaration(input) || ts.isMethodSignature(input)) {
                 if (ts.hasEffectiveModifier(input, 8 /* Private */)) {
@@ -99151,21 +105962,21 @@ var ts;
             }
             if (isProcessedComponent(input)) {
                 switch (input.kind) {
-                    case 223 /* ExpressionWithTypeArguments */: {
+                    case 227 /* ExpressionWithTypeArguments */: {
                         if ((ts.isEntityName(input.expression) || ts.isEntityNameExpression(input.expression))) {
                             checkEntityNameVisibility(input.expression, enclosingDeclaration);
                         }
                         var node = ts.visitEachChild(input, visitDeclarationSubtree, context);
                         return cleanup(factory.updateExpressionWithTypeArguments(node, node.expression, node.typeArguments));
                     }
-                    case 173 /* TypeReference */: {
+                    case 177 /* TypeReference */: {
                         checkEntityNameVisibility(input.typeName, enclosingDeclaration);
                         var node = ts.visitEachChild(input, visitDeclarationSubtree, context);
                         return cleanup(factory.updateTypeReferenceNode(node, node.typeName, node.typeArguments));
                     }
-                    case 170 /* ConstructSignature */:
+                    case 174 /* ConstructSignature */:
                         return cleanup(factory.updateConstructSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type)));
-                    case 166 /* Constructor */: {
+                    case 170 /* Constructor */: {
                         // A constructor declaration may not have a type annotation
                         var ctor = factory.createConstructorDeclaration(
                         /*decorators*/ undefined, 
@@ -99173,7 +105984,7 @@ var ts;
                         /*body*/ undefined);
                         return cleanup(ctor);
                     }
-                    case 165 /* MethodDeclaration */: {
+                    case 168 /* MethodDeclaration */: {
                         if (ts.isPrivateIdentifier(input.name)) {
                             return cleanup(/*returnValue*/ undefined);
                         }
@@ -99183,7 +105994,7 @@ var ts;
                         /*body*/ undefined);
                         return cleanup(sig);
                     }
-                    case 167 /* GetAccessor */: {
+                    case 171 /* GetAccessor */: {
                         if (ts.isPrivateIdentifier(input.name)) {
                             return cleanup(/*returnValue*/ undefined);
                         }
@@ -99192,7 +106003,7 @@ var ts;
                         /*decorators*/ undefined, ensureModifiers(input), input.name, updateAccessorParamsList(input, ts.hasEffectiveModifier(input, 8 /* Private */)), ensureType(input, accessorType), 
                         /*body*/ undefined));
                     }
-                    case 168 /* SetAccessor */: {
+                    case 172 /* SetAccessor */: {
                         if (ts.isPrivateIdentifier(input.name)) {
                             return cleanup(/*returnValue*/ undefined);
                         }
@@ -99200,31 +106011,31 @@ var ts;
                         /*decorators*/ undefined, ensureModifiers(input), input.name, updateAccessorParamsList(input, ts.hasEffectiveModifier(input, 8 /* Private */)), 
                         /*body*/ undefined));
                     }
-                    case 163 /* PropertyDeclaration */:
+                    case 166 /* PropertyDeclaration */:
                         if (ts.isPrivateIdentifier(input.name)) {
                             return cleanup(/*returnValue*/ undefined);
                         }
                         return cleanup(factory.updatePropertyDeclaration(input, 
                         /*decorators*/ undefined, ensureModifiers(input), input.name, input.questionToken, ensureType(input, input.type), ensureNoInitializer(input)));
-                    case 162 /* PropertySignature */:
+                    case 165 /* PropertySignature */:
                         if (ts.isPrivateIdentifier(input.name)) {
                             return cleanup(/*returnValue*/ undefined);
                         }
                         return cleanup(factory.updatePropertySignature(input, ensureModifiers(input), input.name, input.questionToken, ensureType(input, input.type)));
-                    case 164 /* MethodSignature */: {
+                    case 167 /* MethodSignature */: {
                         if (ts.isPrivateIdentifier(input.name)) {
                             return cleanup(/*returnValue*/ undefined);
                         }
                         return cleanup(factory.updateMethodSignature(input, ensureModifiers(input), input.name, input.questionToken, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type)));
                     }
-                    case 169 /* CallSignature */: {
+                    case 173 /* CallSignature */: {
                         return cleanup(factory.updateCallSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type)));
                     }
-                    case 171 /* IndexSignature */: {
+                    case 175 /* IndexSignature */: {
                         return cleanup(factory.updateIndexSignature(input, 
-                        /*decorators*/ undefined, ensureModifiers(input), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree) || factory.createKeywordTypeNode(128 /* AnyKeyword */)));
+                        /*decorators*/ undefined, ensureModifiers(input), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree) || factory.createKeywordTypeNode(130 /* AnyKeyword */)));
                     }
-                    case 249 /* VariableDeclaration */: {
+                    case 253 /* VariableDeclaration */: {
                         if (ts.isBindingPattern(input.name)) {
                             return recreateBindingPattern(input.name);
                         }
@@ -99232,13 +106043,13 @@ var ts;
                         suppressNewDiagnosticContexts = true; // Variable declaration types also suppress new diagnostic contexts, provided the contexts wouldn't be made for binding pattern types
                         return cleanup(factory.updateVariableDeclaration(input, input.name, /*exclamationToken*/ undefined, ensureType(input, input.type), ensureNoInitializer(input)));
                     }
-                    case 159 /* TypeParameter */: {
+                    case 162 /* TypeParameter */: {
                         if (isPrivateMethodTypeParameter(input) && (input.default || input.constraint)) {
                             return cleanup(factory.updateTypeParameterDeclaration(input, input.name, /*constraint*/ undefined, /*defaultType*/ undefined));
                         }
                         return cleanup(ts.visitEachChild(input, visitDeclarationSubtree, context));
                     }
-                    case 184 /* ConditionalType */: {
+                    case 188 /* ConditionalType */: {
                         // We have to process conditional types in a special way because for visibility purposes we need to push a new enclosingDeclaration
                         // just for the `infer` types in the true branch. It's an implicit declaration scope that only applies to _part_ of the type.
                         var checkType = ts.visitNode(input.checkType, visitDeclarationSubtree);
@@ -99250,18 +106061,18 @@ var ts;
                         var falseType = ts.visitNode(input.falseType, visitDeclarationSubtree);
                         return cleanup(factory.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType));
                     }
-                    case 174 /* FunctionType */: {
+                    case 178 /* FunctionType */: {
                         return cleanup(factory.updateFunctionTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree)));
                     }
-                    case 175 /* ConstructorType */: {
+                    case 179 /* ConstructorType */: {
                         return cleanup(factory.updateConstructorTypeNode(input, ensureModifiers(input), ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree)));
                     }
-                    case 195 /* ImportType */: {
+                    case 199 /* ImportType */: {
                         if (!ts.isLiteralImportTypeNode(input))
                             return cleanup(input);
                         return cleanup(factory.updateImportTypeNode(input, factory.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)), input.qualifier, ts.visitNodes(input.typeArguments, visitDeclarationSubtree, ts.isTypeNode), input.isTypeOf));
                     }
-                    default: ts.Debug.assertNever(input, "Attempted to process unhandled node kind: " + ts.SyntaxKind[input.kind]);
+                    default: ts.Debug.assertNever(input, "Attempted to process unhandled node kind: ".concat(ts.SyntaxKind[input.kind]));
                 }
             }
             if (ts.isTupleTypeNode(input) && (ts.getLineAndCharacterOfPosition(currentSourceFile, input.pos).line === ts.getLineAndCharacterOfPosition(currentSourceFile, input.end).line)) {
@@ -99288,7 +106099,7 @@ var ts;
             }
         }
         function isPrivateMethodTypeParameter(node) {
-            return node.parent.kind === 165 /* MethodDeclaration */ && ts.hasEffectiveModifier(node.parent, 8 /* Private */);
+            return node.parent.kind === 168 /* MethodDeclaration */ && ts.hasEffectiveModifier(node.parent, 8 /* Private */);
         }
         function visitDeclarationStatements(input) {
             if (!isPreservedDeclarationStatement(input)) {
@@ -99298,7 +106109,7 @@ var ts;
             if (shouldStripInternal(input))
                 return;
             switch (input.kind) {
-                case 267 /* ExportDeclaration */: {
+                case 271 /* ExportDeclaration */: {
                     if (ts.isSourceFile(input.parent)) {
                         resultHasExternalModuleIndicator = true;
                     }
@@ -99306,15 +106117,16 @@ var ts;
                     // Always visible if the parent node isn't dropped for being not visible
                     // Rewrite external module names if necessary
                     return factory.updateExportDeclaration(input, 
-                    /*decorators*/ undefined, input.modifiers, input.isTypeOnly, input.exportClause, rewriteModuleSpecifier(input, input.moduleSpecifier));
+                    /*decorators*/ undefined, input.modifiers, input.isTypeOnly, input.exportClause, rewriteModuleSpecifier(input, input.moduleSpecifier), 
+                    /*assertClause*/ undefined);
                 }
-                case 266 /* ExportAssignment */: {
+                case 270 /* ExportAssignment */: {
                     // Always visible if the parent node isn't dropped for being not visible
                     if (ts.isSourceFile(input.parent)) {
                         resultHasExternalModuleIndicator = true;
                     }
                     resultHasScopeMarker = true;
-                    if (input.expression.kind === 78 /* Identifier */) {
+                    if (input.expression.kind === 79 /* Identifier */) {
                         return input;
                     }
                     else {
@@ -99326,7 +106138,7 @@ var ts;
                         errorFallbackNode = input;
                         var varDecl = factory.createVariableDeclaration(newId, /*exclamationToken*/ undefined, resolver.createTypeOfExpression(input.expression, input, declarationEmitNodeBuilderFlags, symbolTracker), /*initializer*/ undefined);
                         errorFallbackNode = undefined;
-                        var statement = factory.createVariableStatement(needsDeclare ? [factory.createModifier(133 /* DeclareKeyword */)] : [], factory.createVariableDeclarationList([varDecl], 2 /* Const */));
+                        var statement = factory.createVariableStatement(needsDeclare ? [factory.createModifier(135 /* DeclareKeyword */)] : [], factory.createVariableDeclarationList([varDecl], 2 /* Const */));
                         return [statement, factory.updateExportAssignment(input, input.decorators, input.modifiers, newId)];
                     }
                 }
@@ -99342,17 +106154,17 @@ var ts;
                 // Likewise, `export default` classes and the like and just be `default`, so we preserve their `export` modifiers, too
                 return statement;
             }
-            var modifiers = factory.createModifiersFromModifierFlags(ts.getEffectiveModifierFlags(statement) & (11263 /* All */ ^ 1 /* Export */));
+            var modifiers = factory.createModifiersFromModifierFlags(ts.getEffectiveModifierFlags(statement) & (27647 /* All */ ^ 1 /* Export */));
             return factory.updateModifiers(statement, modifiers);
         }
         function transformTopLevelDeclaration(input) {
             if (shouldStripInternal(input))
                 return;
             switch (input.kind) {
-                case 260 /* ImportEqualsDeclaration */: {
+                case 264 /* ImportEqualsDeclaration */: {
                     return transformImportEqualsDeclaration(input);
                 }
-                case 261 /* ImportDeclaration */: {
+                case 265 /* ImportDeclaration */: {
                     return transformImportDeclaration(input);
                 }
             }
@@ -99373,20 +106185,20 @@ var ts;
             }
             var previousNeedsDeclare = needsDeclare;
             switch (input.kind) {
-                case 254 /* TypeAliasDeclaration */: // Type aliases get `declare`d if need be (for legacy support), but that's all
+                case 258 /* TypeAliasDeclaration */: // Type aliases get `declare`d if need be (for legacy support), but that's all
                     return cleanup(factory.updateTypeAliasDeclaration(input, 
                     /*decorators*/ undefined, ensureModifiers(input), input.name, ts.visitNodes(input.typeParameters, visitDeclarationSubtree, ts.isTypeParameterDeclaration), ts.visitNode(input.type, visitDeclarationSubtree, ts.isTypeNode)));
-                case 253 /* InterfaceDeclaration */: {
+                case 257 /* InterfaceDeclaration */: {
                     return cleanup(factory.updateInterfaceDeclaration(input, 
                     /*decorators*/ undefined, ensureModifiers(input), input.name, ensureTypeParams(input, input.typeParameters), transformHeritageClauses(input.heritageClauses), ts.visitNodes(input.members, visitDeclarationSubtree)));
                 }
-                case 251 /* FunctionDeclaration */: {
+                case 255 /* FunctionDeclaration */: {
                     // Generators lose their generator-ness, excepting their return type
                     var clean = cleanup(factory.updateFunctionDeclaration(input, 
                     /*decorators*/ undefined, ensureModifiers(input), 
                     /*asteriskToken*/ undefined, input.name, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type), 
                     /*body*/ undefined));
-                    if (clean && resolver.isExpandoFunctionDeclaration(input)) {
+                    if (clean && resolver.isExpandoFunctionDeclaration(input) && shouldEmitFunctionProperties(input)) {
                         var props = resolver.getPropertiesOfContainerFunction(input);
                         // Use parseNodeFactory so it is usable as an enclosing declaration
                         var fakespace_1 = ts.parseNodeFactory.createModuleDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, clean.name || factory.createIdentifier("_default"), factory.createModuleBlock([]), 16 /* Namespace */);
@@ -99395,7 +106207,7 @@ var ts;
                         fakespace_1.symbol = props[0].parent;
                         var exportMappings_1 = [];
                         var declarations = ts.mapDefined(props, function (p) {
-                            if (!ts.isPropertyAccessExpression(p.valueDeclaration)) {
+                            if (!p.valueDeclaration || !ts.isPropertyAccessExpression(p.valueDeclaration)) {
                                 return undefined; // TODO GH#33569: Handle element access expressions that created late bound names (rather than silently omitting them)
                             }
                             getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(p.valueDeclaration);
@@ -99408,7 +106220,7 @@ var ts;
                                 exportMappings_1.push([name, nameStr]);
                             }
                             var varDecl = factory.createVariableDeclaration(name, /*exclamationToken*/ undefined, type, /*initializer*/ undefined);
-                            return factory.createVariableStatement(isNonContextualKeywordName ? undefined : [factory.createToken(92 /* ExportKeyword */)], factory.createVariableDeclarationList([varDecl]));
+                            return factory.createVariableStatement(isNonContextualKeywordName ? undefined : [factory.createToken(93 /* ExportKeyword */)], factory.createVariableDeclarationList([varDecl]));
                         });
                         if (!exportMappings_1.length) {
                             declarations = ts.mapDefined(declarations, function (declaration) { return factory.updateModifiers(declaration, 0 /* None */); });
@@ -99419,7 +106231,7 @@ var ts;
                             /*modifiers*/ undefined, 
                             /*isTypeOnly*/ false, factory.createNamedExports(ts.map(exportMappings_1, function (_a) {
                                 var gen = _a[0], exp = _a[1];
-                                return factory.createExportSpecifier(gen, exp);
+                                return factory.createExportSpecifier(/*isTypeOnly*/ false, gen, exp);
                             }))));
                         }
                         var namespaceDecl = factory.createModuleDeclaration(/*decorators*/ undefined, ensureModifiers(input), input.name, factory.createModuleBlock(declarations), 16 /* Namespace */);
@@ -99447,10 +106259,10 @@ var ts;
                         return clean;
                     }
                 }
-                case 256 /* ModuleDeclaration */: {
+                case 260 /* ModuleDeclaration */: {
                     needsDeclare = false;
                     var inner = input.body;
-                    if (inner && inner.kind === 257 /* ModuleBlock */) {
+                    if (inner && inner.kind === 261 /* ModuleBlock */) {
                         var oldNeedsScopeFix = needsScopeFixMarker;
                         var oldHasScopeFix = resultHasScopeMarker;
                         resultHasScopeMarker = false;
@@ -99466,7 +106278,7 @@ var ts;
                         // 3. Some things are exported, some are not, and there's no marker - add an empty marker
                         if (!ts.isGlobalScopeAugmentation(input) && !hasScopeMarker(lateStatements) && !resultHasScopeMarker) {
                             if (needsScopeFixMarker) {
-                                lateStatements = factory.createNodeArray(__spreadArray(__spreadArray([], lateStatements), [ts.createEmptyExports(factory)]));
+                                lateStatements = factory.createNodeArray(__spreadArray(__spreadArray([], lateStatements, true), [ts.createEmptyExports(factory)], false));
                             }
                             else {
                                 lateStatements = ts.visitNodes(lateStatements, stripExportModifiers);
@@ -99493,7 +106305,7 @@ var ts;
                         /*decorators*/ undefined, mods, input.name, body));
                     }
                 }
-                case 252 /* ClassDeclaration */: {
+                case 256 /* ClassDeclaration */: {
                     errorNameNode = input.name;
                     errorFallbackNode = input;
                     var modifiers = factory.createNodeArray(ensureModifiers(input));
@@ -99503,10 +106315,10 @@ var ts;
                     if (ctor) {
                         var oldDiag_1 = getSymbolAccessibilityDiagnostic;
                         parameterProperties = ts.compact(ts.flatMap(ctor.parameters, function (param) {
-                            if (!ts.hasSyntacticModifier(param, 92 /* ParameterPropertyModifier */) || shouldStripInternal(param))
+                            if (!ts.hasSyntacticModifier(param, 16476 /* ParameterPropertyModifier */) || shouldStripInternal(param))
                                 return;
                             getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(param);
-                            if (param.name.kind === 78 /* Identifier */) {
+                            if (param.name.kind === 79 /* Identifier */) {
                                 return preserveJsDoc(factory.createPropertyDeclaration(
                                 /*decorators*/ undefined, ensureModifiers(param), param.name, param.questionToken, ensureType(param, param.type), ensureNoInitializer(param)), param);
                             }
@@ -99548,26 +106360,26 @@ var ts;
                     var memberNodes = ts.concatenate(ts.concatenate(privateIdentifier, parameterProperties), ts.visitNodes(input.members, visitDeclarationSubtree));
                     var members = factory.createNodeArray(memberNodes);
                     var extendsClause_1 = ts.getEffectiveBaseTypeNode(input);
-                    if (extendsClause_1 && !ts.isEntityNameExpression(extendsClause_1.expression) && extendsClause_1.expression.kind !== 103 /* NullKeyword */) {
+                    if (extendsClause_1 && !ts.isEntityNameExpression(extendsClause_1.expression) && extendsClause_1.expression.kind !== 104 /* NullKeyword */) {
                         // We must add a temporary declaration for the extends clause expression
                         var oldId = input.name ? ts.unescapeLeadingUnderscores(input.name.escapedText) : "default";
-                        var newId_1 = factory.createUniqueName(oldId + "_base", 16 /* Optimistic */);
+                        var newId_1 = factory.createUniqueName("".concat(oldId, "_base"), 16 /* Optimistic */);
                         getSymbolAccessibilityDiagnostic = function () { return ({
                             diagnosticMessage: ts.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1,
                             errorNode: extendsClause_1,
                             typeName: input.name
                         }); };
                         var varDecl = factory.createVariableDeclaration(newId_1, /*exclamationToken*/ undefined, resolver.createTypeOfExpression(extendsClause_1.expression, input, declarationEmitNodeBuilderFlags, symbolTracker), /*initializer*/ undefined);
-                        var statement = factory.createVariableStatement(needsDeclare ? [factory.createModifier(133 /* DeclareKeyword */)] : [], factory.createVariableDeclarationList([varDecl], 2 /* Const */));
+                        var statement = factory.createVariableStatement(needsDeclare ? [factory.createModifier(135 /* DeclareKeyword */)] : [], factory.createVariableDeclarationList([varDecl], 2 /* Const */));
                         var heritageClauses = factory.createNodeArray(ts.map(input.heritageClauses, function (clause) {
-                            if (clause.token === 93 /* ExtendsKeyword */) {
+                            if (clause.token === 94 /* ExtendsKeyword */) {
                                 var oldDiag_2 = getSymbolAccessibilityDiagnostic;
                                 getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(clause.types[0]);
                                 var newClause = factory.updateHeritageClause(clause, ts.map(clause.types, function (t) { return factory.updateExpressionWithTypeArguments(t, newId_1, ts.visitNodes(t.typeArguments, visitDeclarationSubtree)); }));
                                 getSymbolAccessibilityDiagnostic = oldDiag_2;
                                 return newClause;
                             }
-                            return factory.updateHeritageClause(clause, ts.visitNodes(factory.createNodeArray(ts.filter(clause.types, function (t) { return ts.isEntityNameExpression(t.expression) || t.expression.kind === 103 /* NullKeyword */; })), visitDeclarationSubtree));
+                            return factory.updateHeritageClause(clause, ts.visitNodes(factory.createNodeArray(ts.filter(clause.types, function (t) { return ts.isEntityNameExpression(t.expression) || t.expression.kind === 104 /* NullKeyword */; })), visitDeclarationSubtree));
                         }));
                         return [statement, cleanup(factory.updateClassDeclaration(input, 
                             /*decorators*/ undefined, modifiers, input.name, typeParameters, heritageClauses, members))]; // TODO: GH#18217
@@ -99578,10 +106390,10 @@ var ts;
                         /*decorators*/ undefined, modifiers, input.name, typeParameters, heritageClauses, members));
                     }
                 }
-                case 232 /* VariableStatement */: {
+                case 236 /* VariableStatement */: {
                     return cleanup(transformVariableStatement(input));
                 }
-                case 255 /* EnumDeclaration */: {
+                case 259 /* EnumDeclaration */: {
                     return cleanup(factory.updateEnumDeclaration(input, /*decorators*/ undefined, factory.createNodeArray(ensureModifiers(input)), input.name, factory.createNodeArray(ts.mapDefined(input.members, function (m) {
                         if (shouldStripInternal(m))
                             return;
@@ -99592,7 +106404,7 @@ var ts;
                 }
             }
             // Anything left unhandled is an error, so this should be unreachable
-            return ts.Debug.assertNever(input, "Unhandled top-level node in declaration emit: " + ts.SyntaxKind[input.kind]);
+            return ts.Debug.assertNever(input, "Unhandled top-level node in declaration emit: ".concat(ts.SyntaxKind[input.kind]));
             function cleanup(node) {
                 if (isEnclosingDeclaration(input)) {
                     enclosingDeclaration = previousEnclosingDeclaration;
@@ -99600,7 +106412,7 @@ var ts;
                 if (canProdiceDiagnostic) {
                     getSymbolAccessibilityDiagnostic = oldDiag;
                 }
-                if (input.kind === 256 /* ModuleDeclaration */) {
+                if (input.kind === 260 /* ModuleDeclaration */) {
                     needsDeclare = previousNeedsDeclare;
                 }
                 if (node === input) {
@@ -99623,7 +106435,7 @@ var ts;
             return ts.flatten(ts.mapDefined(d.elements, function (e) { return recreateBindingElement(e); }));
         }
         function recreateBindingElement(e) {
-            if (e.kind === 222 /* OmittedExpression */) {
+            if (e.kind === 226 /* OmittedExpression */) {
                 return;
             }
             if (e.name) {
@@ -99671,9 +106483,9 @@ var ts;
             return factory.createModifiersFromModifierFlags(newFlags);
         }
         function ensureModifierFlags(node) {
-            var mask = 11263 /* All */ ^ (4 /* Public */ | 256 /* Async */); // No async modifiers in declaration files
+            var mask = 27647 /* All */ ^ (4 /* Public */ | 256 /* Async */ | 16384 /* Override */); // No async and override modifiers in declaration files
             var additions = (needsDeclare && !isAlwaysType(node)) ? 2 /* Ambient */ : 0 /* None */;
-            var parentIsFile = node.parent.kind === 297 /* SourceFile */;
+            var parentIsFile = node.parent.kind === 303 /* SourceFile */;
             if (!parentIsFile || (isBundledEmit && parentIsFile && ts.isExternalModule(node.parent))) {
                 mask ^= 2 /* Ambient */;
                 additions = 0 /* None */;
@@ -99696,13 +106508,13 @@ var ts;
         }
         function transformHeritageClauses(nodes) {
             return factory.createNodeArray(ts.filter(ts.map(nodes, function (clause) { return factory.updateHeritageClause(clause, ts.visitNodes(factory.createNodeArray(ts.filter(clause.types, function (t) {
-                return ts.isEntityNameExpression(t.expression) || (clause.token === 93 /* ExtendsKeyword */ && t.expression.kind === 103 /* NullKeyword */);
+                return ts.isEntityNameExpression(t.expression) || (clause.token === 94 /* ExtendsKeyword */ && t.expression.kind === 104 /* NullKeyword */);
             })), visitDeclarationSubtree)); }), function (clause) { return clause.types && !!clause.types.length; }));
         }
     }
     ts.transformDeclarations = transformDeclarations;
     function isAlwaysType(node) {
-        if (node.kind === 253 /* InterfaceDeclaration */) {
+        if (node.kind === 257 /* InterfaceDeclaration */) {
             return true;
         }
         return false;
@@ -99712,7 +106524,7 @@ var ts;
         return ts.factory.createModifiersFromModifierFlags(maskModifierFlags(node, modifierMask, modifierAdditions));
     }
     function maskModifierFlags(node, modifierMask, modifierAdditions) {
-        if (modifierMask === void 0) { modifierMask = 11263 /* All */ ^ 4 /* Public */; }
+        if (modifierMask === void 0) { modifierMask = 27647 /* All */ ^ 4 /* Public */; }
         if (modifierAdditions === void 0) { modifierAdditions = 0 /* None */; }
         var flags = (ts.getEffectiveModifierFlags(node) & modifierMask) | modifierAdditions;
         if (flags & 512 /* Default */ && !(flags & 1 /* Export */)) {
@@ -99727,7 +106539,7 @@ var ts;
     }
     function getTypeAnnotationFromAccessor(accessor) {
         if (accessor) {
-            return accessor.kind === 167 /* GetAccessor */
+            return accessor.kind === 171 /* GetAccessor */
                 ? accessor.type // Getter - return type
                 : accessor.parameters.length > 0
                     ? accessor.parameters[0].type // Setter parameter type
@@ -99736,52 +106548,52 @@ var ts;
     }
     function canHaveLiteralInitializer(node) {
         switch (node.kind) {
-            case 163 /* PropertyDeclaration */:
-            case 162 /* PropertySignature */:
+            case 166 /* PropertyDeclaration */:
+            case 165 /* PropertySignature */:
                 return !ts.hasEffectiveModifier(node, 8 /* Private */);
-            case 160 /* Parameter */:
-            case 249 /* VariableDeclaration */:
+            case 163 /* Parameter */:
+            case 253 /* VariableDeclaration */:
                 return true;
         }
         return false;
     }
     function isPreservedDeclarationStatement(node) {
         switch (node.kind) {
-            case 251 /* FunctionDeclaration */:
-            case 256 /* ModuleDeclaration */:
-            case 260 /* ImportEqualsDeclaration */:
-            case 253 /* InterfaceDeclaration */:
-            case 252 /* ClassDeclaration */:
-            case 254 /* TypeAliasDeclaration */:
-            case 255 /* EnumDeclaration */:
-            case 232 /* VariableStatement */:
-            case 261 /* ImportDeclaration */:
-            case 267 /* ExportDeclaration */:
-            case 266 /* ExportAssignment */:
+            case 255 /* FunctionDeclaration */:
+            case 260 /* ModuleDeclaration */:
+            case 264 /* ImportEqualsDeclaration */:
+            case 257 /* InterfaceDeclaration */:
+            case 256 /* ClassDeclaration */:
+            case 258 /* TypeAliasDeclaration */:
+            case 259 /* EnumDeclaration */:
+            case 236 /* VariableStatement */:
+            case 265 /* ImportDeclaration */:
+            case 271 /* ExportDeclaration */:
+            case 270 /* ExportAssignment */:
                 return true;
         }
         return false;
     }
     function isProcessedComponent(node) {
         switch (node.kind) {
-            case 170 /* ConstructSignature */:
-            case 166 /* Constructor */:
-            case 165 /* MethodDeclaration */:
-            case 167 /* GetAccessor */:
-            case 168 /* SetAccessor */:
-            case 163 /* PropertyDeclaration */:
-            case 162 /* PropertySignature */:
-            case 164 /* MethodSignature */:
-            case 169 /* CallSignature */:
-            case 171 /* IndexSignature */:
-            case 249 /* VariableDeclaration */:
-            case 159 /* TypeParameter */:
-            case 223 /* ExpressionWithTypeArguments */:
-            case 173 /* TypeReference */:
-            case 184 /* ConditionalType */:
-            case 174 /* FunctionType */:
-            case 175 /* ConstructorType */:
-            case 195 /* ImportType */:
+            case 174 /* ConstructSignature */:
+            case 170 /* Constructor */:
+            case 168 /* MethodDeclaration */:
+            case 171 /* GetAccessor */:
+            case 172 /* SetAccessor */:
+            case 166 /* PropertyDeclaration */:
+            case 165 /* PropertySignature */:
+            case 167 /* MethodSignature */:
+            case 173 /* CallSignature */:
+            case 175 /* IndexSignature */:
+            case 253 /* VariableDeclaration */:
+            case 162 /* TypeParameter */:
+            case 227 /* ExpressionWithTypeArguments */:
+            case 177 /* TypeReference */:
+            case 188 /* ConditionalType */:
+            case 178 /* FunctionType */:
+            case 179 /* ConstructorType */:
+            case 199 /* ImportType */:
                 return true;
         }
         return false;
@@ -99793,11 +106605,15 @@ var ts;
     function getModuleTransformer(moduleKind) {
         switch (moduleKind) {
             case ts.ModuleKind.ESNext:
+            case ts.ModuleKind.ES2022:
             case ts.ModuleKind.ES2020:
             case ts.ModuleKind.ES2015:
                 return ts.transformECMAScriptModule;
             case ts.ModuleKind.System:
                 return ts.transformSystemModule;
+            case ts.ModuleKind.Node12:
+            case ts.ModuleKind.NodeNext:
+                return ts.transformNodeModule;
             default:
                 return ts.transformModule;
         }
@@ -99837,6 +106653,9 @@ var ts;
         if (languageVersion < 99 /* ESNext */) {
             transformers.push(ts.transformESNext);
         }
+        if (languageVersion < 8 /* ES2021 */) {
+            transformers.push(ts.transformES2021);
+        }
         if (languageVersion < 7 /* ES2020 */) {
             transformers.push(ts.transformES2020);
         }
@@ -99913,7 +106732,7 @@ var ts;
      * @param allowDtsFiles A value indicating whether to allow the transformation of .d.ts files.
      */
     function transformNodes(resolver, host, factory, options, nodes, transformers, allowDtsFiles) {
-        var enabledSyntaxKindFeatures = new Array(341 /* Count */);
+        var enabledSyntaxKindFeatures = new Array(353 /* Count */);
         var lexicalEnvironmentVariableDeclarations;
         var lexicalEnvironmentFunctionDeclarations;
         var lexicalEnvironmentStatements;
@@ -99924,6 +106743,9 @@ var ts;
         var lexicalEnvironmentFlagsStack = [];
         var lexicalEnvironmentStackOffset = 0;
         var lexicalEnvironmentSuspended = false;
+        var blockScopedVariableDeclarationsStack = [];
+        var blockScopeStackOffset = 0;
+        var blockScopedVariableDeclarations;
         var emitHelpers;
         var onSubstituteNode = noEmitSubstitution;
         var onEmitNode = noEmitNotification;
@@ -99946,6 +106768,9 @@ var ts;
             hoistVariableDeclaration: hoistVariableDeclaration,
             hoistFunctionDeclaration: hoistFunctionDeclaration,
             addInitializationStatement: addInitializationStatement,
+            startBlockScope: startBlockScope,
+            endBlockScope: endBlockScope,
+            addBlockScopedVariable: addBlockScopedVariable,
             requestEmitHelper: requestEmitHelper,
             readEmitHelpers: readEmitHelpers,
             enableSubstitution: enableSubstitution,
@@ -99989,7 +106814,7 @@ var ts;
         var transformed = [];
         for (var _a = 0, nodes_3 = nodes; _a < nodes_3.length; _a++) {
             var node = nodes_3[_a];
-            ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("emit" /* Emit */, "transformNodes", node.kind === 297 /* SourceFile */ ? { path: node.path } : { kind: node.kind, pos: node.pos, end: node.end });
+            ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("emit" /* Emit */, "transformNodes", node.kind === 303 /* SourceFile */ ? { path: node.path } : { kind: node.kind, pos: node.pos, end: node.end });
             transformed.push((allowDtsFiles ? transformation : transformRoot)(node));
             ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
         }
@@ -100162,7 +106987,7 @@ var ts;
                 lexicalEnvironmentFunctionDeclarations ||
                 lexicalEnvironmentStatements) {
                 if (lexicalEnvironmentFunctionDeclarations) {
-                    statements = __spreadArray([], lexicalEnvironmentFunctionDeclarations);
+                    statements = __spreadArray([], lexicalEnvironmentFunctionDeclarations, true);
                 }
                 if (lexicalEnvironmentVariableDeclarations) {
                     var statement = factory.createVariableStatement(
@@ -100177,10 +107002,10 @@ var ts;
                 }
                 if (lexicalEnvironmentStatements) {
                     if (!statements) {
-                        statements = __spreadArray([], lexicalEnvironmentStatements);
+                        statements = __spreadArray([], lexicalEnvironmentStatements, true);
                     }
                     else {
-                        statements = __spreadArray(__spreadArray([], statements), lexicalEnvironmentStatements);
+                        statements = __spreadArray(__spreadArray([], statements, true), lexicalEnvironmentStatements, true);
                     }
                 }
             }
@@ -100206,6 +107031,38 @@ var ts;
         function getLexicalEnvironmentFlags() {
             return lexicalEnvironmentFlags;
         }
+        /**
+         * Starts a block scope. Any existing block hoisted variables are pushed onto the stack and the related storage variables are reset.
+         */
+        function startBlockScope() {
+            ts.Debug.assert(state > 0 /* Uninitialized */, "Cannot start a block scope during initialization.");
+            ts.Debug.assert(state < 2 /* Completed */, "Cannot start a block scope after transformation has completed.");
+            blockScopedVariableDeclarationsStack[blockScopeStackOffset] = blockScopedVariableDeclarations;
+            blockScopeStackOffset++;
+            blockScopedVariableDeclarations = undefined;
+        }
+        /**
+         * Ends a block scope. The previous set of block hoisted variables are restored. Any hoisted declarations are returned.
+         */
+        function endBlockScope() {
+            ts.Debug.assert(state > 0 /* Uninitialized */, "Cannot end a block scope during initialization.");
+            ts.Debug.assert(state < 2 /* Completed */, "Cannot end a block scope after transformation has completed.");
+            var statements = ts.some(blockScopedVariableDeclarations) ?
+                [
+                    factory.createVariableStatement(
+                    /*modifiers*/ undefined, factory.createVariableDeclarationList(blockScopedVariableDeclarations.map(function (identifier) { return factory.createVariableDeclaration(identifier); }), 1 /* Let */))
+                ] : undefined;
+            blockScopeStackOffset--;
+            blockScopedVariableDeclarations = blockScopedVariableDeclarationsStack[blockScopeStackOffset];
+            if (blockScopeStackOffset === 0) {
+                blockScopedVariableDeclarationsStack = [];
+            }
+            return statements;
+        }
+        function addBlockScopedVariable(name) {
+            ts.Debug.assert(blockScopeStackOffset > 0, "Cannot add a block scoped variable outside of an iteration body.");
+            (blockScopedVariableDeclarations || (blockScopedVariableDeclarations = [])).push(name);
+        }
         function requestEmitHelper(helper) {
             ts.Debug.assert(state > 0 /* Uninitialized */, "Cannot modify the transformation context during initialization.");
             ts.Debug.assert(state < 2 /* Completed */, "Cannot modify the transformation context after transformation has completed.");
@@ -100247,35 +107104,37 @@ var ts;
     }
     ts.transformNodes = transformNodes;
     ts.nullTransformationContext = {
-        get factory() { return ts.factory; },
-        enableEmitNotification: ts.noop,
-        enableSubstitution: ts.noop,
-        endLexicalEnvironment: ts.returnUndefined,
+        factory: ts.factory,
         getCompilerOptions: function () { return ({}); },
-        getEmitHost: ts.notImplemented,
         getEmitResolver: ts.notImplemented,
+        getEmitHost: ts.notImplemented,
         getEmitHelperFactory: ts.notImplemented,
+        startLexicalEnvironment: ts.noop,
+        resumeLexicalEnvironment: ts.noop,
+        suspendLexicalEnvironment: ts.noop,
+        endLexicalEnvironment: ts.returnUndefined,
         setLexicalEnvironmentFlags: ts.noop,
         getLexicalEnvironmentFlags: function () { return 0; },
-        hoistFunctionDeclaration: ts.noop,
         hoistVariableDeclaration: ts.noop,
+        hoistFunctionDeclaration: ts.noop,
         addInitializationStatement: ts.noop,
-        isEmitNotificationEnabled: ts.notImplemented,
-        isSubstitutionEnabled: ts.notImplemented,
-        onEmitNode: ts.noop,
-        onSubstituteNode: ts.notImplemented,
-        readEmitHelpers: ts.notImplemented,
+        startBlockScope: ts.noop,
+        endBlockScope: ts.returnUndefined,
+        addBlockScopedVariable: ts.noop,
         requestEmitHelper: ts.noop,
-        resumeLexicalEnvironment: ts.noop,
-        startLexicalEnvironment: ts.noop,
-        suspendLexicalEnvironment: ts.noop,
+        readEmitHelpers: ts.notImplemented,
+        enableSubstitution: ts.noop,
+        enableEmitNotification: ts.noop,
+        isSubstitutionEnabled: ts.notImplemented,
+        isEmitNotificationEnabled: ts.notImplemented,
+        onSubstituteNode: noEmitSubstitution,
+        onEmitNode: noEmitNotification,
         addDiagnostic: ts.noop,
     };
 })(ts || (ts = {}));
 var ts;
 (function (ts) {
     var brackets = createBracketsMap();
-    var syntheticParent = { pos: -1, end: -1 };
     /*@internal*/
     function isBuildInfoFile(file) {
         return ts.fileExtensionIs(file, ".tsbuildinfo" /* TsBuildInfo */);
@@ -100361,11 +107220,11 @@ var ts;
     /*@internal*/
     function getOutputPathsFor(sourceFile, host, forceDtsPaths) {
         var options = host.getCompilerOptions();
-        if (sourceFile.kind === 298 /* Bundle */) {
+        if (sourceFile.kind === 304 /* Bundle */) {
             return getOutputPathsForBundle(options, forceDtsPaths);
         }
         else {
-            var ownOutputFilePath = ts.getOwnEmitOutputFilePath(sourceFile.fileName, host, getOutputExtension(sourceFile, options));
+            var ownOutputFilePath = ts.getOwnEmitOutputFilePath(sourceFile.fileName, host, getOutputExtension(sourceFile.fileName, options));
             var isJsonFile = ts.isJsonSourceFile(sourceFile);
             // If json file emits to the same location skip writing it, if emitDeclarationOnly skip writing it
             var isJsonEmittedToSameLocation = isJsonFile &&
@@ -100381,26 +107240,13 @@ var ts;
     function getSourceMapFilePath(jsFilePath, options) {
         return (options.sourceMap && !options.inlineSourceMap) ? jsFilePath + ".map" : undefined;
     }
-    // JavaScript files are always LanguageVariant.JSX, as JSX syntax is allowed in .js files also.
-    // So for JavaScript files, '.jsx' is only emitted if the input was '.jsx', and JsxEmit.Preserve.
-    // For TypeScript, the only time to emit with a '.jsx' extension, is on JSX input, and JsxEmit.Preserve
     /* @internal */
-    function getOutputExtension(sourceFile, options) {
-        if (ts.isJsonSourceFile(sourceFile)) {
-            return ".json" /* Json */;
-        }
-        if (options.jsx === 1 /* Preserve */) {
-            if (ts.isSourceFileJS(sourceFile)) {
-                if (ts.fileExtensionIs(sourceFile.fileName, ".jsx" /* Jsx */)) {
-                    return ".jsx" /* Jsx */;
-                }
-            }
-            else if (sourceFile.languageVariant === 1 /* JSX */) {
-                // TypeScript source file preserving JSX syntax
-                return ".jsx" /* Jsx */;
-            }
-        }
-        return ".js" /* Js */;
+    function getOutputExtension(fileName, options) {
+        return ts.fileExtensionIs(fileName, ".json" /* Json */) ? ".json" /* Json */ :
+            options.jsx === 1 /* Preserve */ && ts.fileExtensionIsOneOf(fileName, [".jsx" /* Jsx */, ".tsx" /* Tsx */]) ? ".jsx" /* Jsx */ :
+                ts.fileExtensionIsOneOf(fileName, [".mts" /* Mts */, ".mjs" /* Mjs */]) ? ".mjs" /* Mjs */ :
+                    ts.fileExtensionIsOneOf(fileName, [".cts" /* Cts */, ".cjs" /* Cjs */]) ? ".cjs" /* Cjs */ :
+                        ".js" /* Js */;
     }
     ts.getOutputExtension = getOutputExtension;
     function getOutputPathWithoutChangingExt(inputFileName, configFile, ignoreCase, outputDir, getCommonSourceDirectory) {
@@ -100410,19 +107256,14 @@ var ts;
     }
     /* @internal */
     function getOutputDeclarationFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory) {
-        ts.Debug.assert(!ts.fileExtensionIs(inputFileName, ".d.ts" /* Dts */) && !ts.fileExtensionIs(inputFileName, ".json" /* Json */));
-        return ts.changeExtension(getOutputPathWithoutChangingExt(inputFileName, configFile, ignoreCase, configFile.options.declarationDir || configFile.options.outDir, getCommonSourceDirectory), ".d.ts" /* Dts */);
+        return ts.changeExtension(getOutputPathWithoutChangingExt(inputFileName, configFile, ignoreCase, configFile.options.declarationDir || configFile.options.outDir, getCommonSourceDirectory), ts.getDeclarationEmitExtensionForPath(inputFileName));
     }
     ts.getOutputDeclarationFileName = getOutputDeclarationFileName;
     function getOutputJSFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory) {
         if (configFile.options.emitDeclarationOnly)
             return undefined;
         var isJsonFile = ts.fileExtensionIs(inputFileName, ".json" /* Json */);
-        var outputFileName = ts.changeExtension(getOutputPathWithoutChangingExt(inputFileName, configFile, ignoreCase, configFile.options.outDir, getCommonSourceDirectory), isJsonFile ?
-            ".json" /* Json */ :
-            configFile.options.jsx === 1 /* Preserve */ && (ts.fileExtensionIs(inputFileName, ".tsx" /* Tsx */) || ts.fileExtensionIs(inputFileName, ".jsx" /* Jsx */)) ?
-                ".jsx" /* Jsx */ :
-                ".js" /* Js */);
+        var outputFileName = ts.changeExtension(getOutputPathWithoutChangingExt(inputFileName, configFile, ignoreCase, configFile.options.outDir, getCommonSourceDirectory), getOutputExtension(inputFileName, configFile.options));
         return !isJsonFile || ts.comparePaths(inputFileName, outputFileName, ts.Debug.checkDefined(configFile.options.configFilePath), ignoreCase) !== 0 /* EqualTo */ ?
             outputFileName :
             undefined;
@@ -100455,13 +107296,13 @@ var ts;
         if (ts.fileExtensionIs(inputFileName, ".json" /* Json */))
             return;
         if (js && configFile.options.sourceMap) {
-            addOutput(js + ".map");
+            addOutput("".concat(js, ".map"));
         }
         if (ts.getEmitDeclarations(configFile.options)) {
             var dts = getOutputDeclarationFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory);
             addOutput(dts);
             if (configFile.options.declarationMap) {
-                addOutput(dts + ".map");
+                addOutput("".concat(dts, ".map"));
             }
         }
     }
@@ -100493,7 +107334,7 @@ var ts;
     /*@internal*/
     function getCommonSourceDirectoryOfConfig(_a, ignoreCase) {
         var options = _a.options, fileNames = _a.fileNames;
-        return getCommonSourceDirectory(options, function () { return ts.filter(fileNames, function (file) { return !(options.noEmitForJsFiles && ts.fileExtensionIsOneOf(file, ts.supportedJSExtensions)) && !ts.fileExtensionIs(file, ".d.ts" /* Dts */); }); }, ts.getDirectoryPath(ts.normalizeSlashes(ts.Debug.checkDefined(options.configFilePath))), ts.createGetCanonicalFileName(!ignoreCase));
+        return getCommonSourceDirectory(options, function () { return ts.filter(fileNames, function (file) { return !(options.noEmitForJsFiles && ts.fileExtensionIsOneOf(file, ts.supportedJSExtensionsFlat)) && !ts.fileExtensionIs(file, ".d.ts" /* Dts */); }); }, ts.getDirectoryPath(ts.normalizeSlashes(ts.Debug.checkDefined(options.configFilePath))), ts.createGetCanonicalFileName(!ignoreCase));
     }
     ts.getCommonSourceDirectoryOfConfig = getCommonSourceDirectoryOfConfig;
     /*@internal*/
@@ -100530,7 +107371,7 @@ var ts;
     function getFirstProjectOutput(configFile, ignoreCase) {
         if (ts.outFile(configFile.options)) {
             var jsFilePath = getOutputPathsForBundle(configFile.options, /*forceDtsPaths*/ false).jsFilePath;
-            return ts.Debug.checkDefined(jsFilePath, "project " + configFile.options.configFilePath + " expected to have at least one output");
+            return ts.Debug.checkDefined(jsFilePath, "project ".concat(configFile.options.configFilePath, " expected to have at least one output"));
         }
         var getCommonSourceDirectory = ts.memoize(function () { return getCommonSourceDirectoryOfConfig(configFile, ignoreCase); });
         for (var _a = 0, _b = configFile.fileNames; _a < _b.length; _a++) {
@@ -100549,7 +107390,7 @@ var ts;
         var buildInfoPath = getTsBuildInfoEmitOutputFilePath(configFile.options);
         if (buildInfoPath)
             return buildInfoPath;
-        return ts.Debug.fail("project " + configFile.options.configFilePath + " expected to have at least one output");
+        return ts.Debug.fail("project ".concat(configFile.options.configFilePath, " expected to have at least one output"));
     }
     ts.getFirstProjectOutput = getFirstProjectOutput;
     /*@internal*/
@@ -100722,13 +107563,13 @@ var ts;
             if (!declBlocked || forceDtsEmit) {
                 ts.Debug.assert(declarationTransform.transformed.length === 1, "Should only see one output from the decl transform");
                 printSourceFileOrBundle(declarationFilePath, declarationMapPath, declarationTransform.transformed[0], declarationPrinter, {
-                    sourceMap: compilerOptions.declarationMap,
+                    sourceMap: !forceDtsEmit && compilerOptions.declarationMap,
                     sourceRoot: compilerOptions.sourceRoot,
                     mapRoot: compilerOptions.mapRoot,
                     extendedDiagnostics: compilerOptions.extendedDiagnostics,
                     // Explicitly do not passthru either `inline` option
                 });
-                if (forceDtsEmit && declarationTransform.transformed[0].kind === 297 /* SourceFile */) {
+                if (forceDtsEmit && declarationTransform.transformed[0].kind === 303 /* SourceFile */) {
                     var sourceFile = declarationTransform.transformed[0];
                     exportedModulesFromDeclarationEmit = sourceFile.exportedModulesFromDeclarationEmit;
                 }
@@ -100739,7 +107580,7 @@ var ts;
         }
         function collectLinkedAliases(node) {
             if (ts.isExportAssignment(node)) {
-                if (node.expression.kind === 78 /* Identifier */) {
+                if (node.expression.kind === 79 /* Identifier */) {
                     resolver.collectLinkedAliases(node.expression, /*setVisibility*/ true);
                 }
                 return;
@@ -100751,8 +107592,8 @@ var ts;
             ts.forEachChild(node, collectLinkedAliases);
         }
         function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle, printer, mapOptions) {
-            var bundle = sourceFileOrBundle.kind === 298 /* Bundle */ ? sourceFileOrBundle : undefined;
-            var sourceFile = sourceFileOrBundle.kind === 297 /* SourceFile */ ? sourceFileOrBundle : undefined;
+            var bundle = sourceFileOrBundle.kind === 304 /* Bundle */ ? sourceFileOrBundle : undefined;
+            var sourceFile = sourceFileOrBundle.kind === 303 /* SourceFile */ ? sourceFileOrBundle : undefined;
             var sourceFiles = bundle ? bundle.sourceFiles : [sourceFile];
             var sourceMapGenerator;
             if (shouldEmitSourceMaps(mapOptions, sourceFileOrBundle)) {
@@ -100775,7 +107616,7 @@ var ts;
                 if (sourceMappingURL) {
                     if (!writer.isAtStartOfLine())
                         writer.rawWrite(newLine);
-                    writer.writeComment("//# " + "sourceMappingURL" + "=" + sourceMappingURL); // Tools can sometimes see this line as a source mapping url comment
+                    writer.writeComment("//# ".concat("sourceMappingURL", "=").concat(sourceMappingURL)); // Tools can sometimes see this line as a source mapping url comment
                 }
                 // Write the source map
                 if (sourceMapFilePath) {
@@ -100793,7 +107634,7 @@ var ts;
         }
         function shouldEmitSourceMaps(mapOptions, sourceFileOrBundle) {
             return (mapOptions.sourceMap || mapOptions.inlineSourceMap)
-                && (sourceFileOrBundle.kind !== 297 /* SourceFile */ || !ts.fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */));
+                && (sourceFileOrBundle.kind !== 303 /* SourceFile */ || !ts.fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */));
         }
         function getSourceRoot(mapOptions) {
             // Normalize source root and make sure it has trailing "/" so that it can be used to combine paths with the
@@ -100824,7 +107665,7 @@ var ts;
                 // Encode the sourceMap into the sourceMap url
                 var sourceMapText = sourceMapGenerator.toString();
                 var base64SourceMapText = ts.base64encode(ts.sys, sourceMapText);
-                return "data:application/json;base64," + base64SourceMapText;
+                return "data:application/json;base64,".concat(base64SourceMapText);
             }
             var sourceMapFile = ts.getBaseFileName(ts.normalizeSlashes(ts.Debug.checkDefined(sourceMapFilePath)));
             if (mapOptions.mapRoot) {
@@ -100852,7 +107693,7 @@ var ts;
     ts.emitFiles = emitFiles;
     /*@internal*/
     function getBuildInfoText(buildInfo) {
-        return JSON.stringify(buildInfo, undefined, 2);
+        return JSON.stringify(buildInfo);
     }
     ts.getBuildInfoText = getBuildInfoText;
     /*@internal*/
@@ -100959,7 +107800,7 @@ var ts;
         var prependNodes = ts.createPrependNodes(config.projectReferences, getCommandLine, function (f) { return host.readFile(f); });
         var sourceFilesForJsEmit = createSourceFilesFromBundleBuildInfo(buildInfo.bundle, buildInfoDirectory, host);
         var emitHost = {
-            getPrependNodes: ts.memoize(function () { return __spreadArray(__spreadArray([], prependNodes), [ownPrependInput]); }),
+            getPrependNodes: ts.memoize(function () { return __spreadArray(__spreadArray([], prependNodes, true), [ownPrependInput], false); }),
             getCanonicalFileName: host.getCanonicalFileName,
             getCommonSourceDirectory: function () { return ts.getNormalizedAbsolutePath(buildInfo.bundle.commonSourceDirectory, buildInfoDirectory); },
             getCompilerOptions: function () { return config.options; },
@@ -101004,7 +107845,7 @@ var ts;
                             return;
                         break;
                     default:
-                        ts.Debug.fail("Unexpected path: " + name);
+                        ts.Debug.fail("Unexpected path: ".concat(name));
                 }
                 outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark });
             },
@@ -101033,7 +107874,7 @@ var ts;
     function createPrinter(printerOptions, handlers) {
         if (printerOptions === void 0) { printerOptions = {}; }
         if (handlers === void 0) { handlers = {}; }
-        var hasGlobalName = handlers.hasGlobalName, _a = handlers.onEmitNode, onEmitNode = _a === void 0 ? ts.noEmitNotification : _a, isEmitNotificationEnabled = handlers.isEmitNotificationEnabled, _b = handlers.substituteNode, substituteNode = _b === void 0 ? ts.noEmitSubstitution : _b, onBeforeEmitNodeArray = handlers.onBeforeEmitNodeArray, onAfterEmitNodeArray = handlers.onAfterEmitNodeArray, onBeforeEmitToken = handlers.onBeforeEmitToken, onAfterEmitToken = handlers.onAfterEmitToken;
+        var hasGlobalName = handlers.hasGlobalName, _a = handlers.onEmitNode, onEmitNode = _a === void 0 ? ts.noEmitNotification : _a, isEmitNotificationEnabled = handlers.isEmitNotificationEnabled, _b = handlers.substituteNode, substituteNode = _b === void 0 ? ts.noEmitSubstitution : _b, onBeforeEmitNode = handlers.onBeforeEmitNode, onAfterEmitNode = handlers.onAfterEmitNode, onBeforeEmitNodeArray = handlers.onBeforeEmitNodeArray, onAfterEmitNodeArray = handlers.onAfterEmitNodeArray, onBeforeEmitToken = handlers.onBeforeEmitToken, onAfterEmitToken = handlers.onAfterEmitToken;
         var extendedDiagnostics = !!printerOptions.extendedDiagnostics;
         var newLine = ts.getNewLineCharacter(printerOptions);
         var moduleKind = ts.getEmitModuleKind(printerOptions);
@@ -101072,9 +107913,11 @@ var ts;
         var detachedCommentsInfo;
         var hasWrittenComment = false;
         var commentsDisabled = !!printerOptions.removeComments;
-        var lastNode;
         var lastSubstitution;
+        var currentParenthesizerRule;
         var _c = ts.performance.createTimerIf(extendedDiagnostics, "commentTime", "beforeComment", "afterComment"), enterComment = _c.enter, exitComment = _c.exit;
+        var parenthesizer = ts.factory.parenthesizer;
+        var emitBinaryExpression = createEmitBinaryExpression();
         reset();
         return {
             // public API
@@ -101102,9 +107945,9 @@ var ts;
                     break;
             }
             switch (node.kind) {
-                case 297 /* SourceFile */: return printFile(node);
-                case 298 /* Bundle */: return printBundle(node);
-                case 299 /* UnparsedSource */: return printUnparsedSource(node);
+                case 303 /* SourceFile */: return printFile(node);
+                case 304 /* Bundle */: return printBundle(node);
+                case 305 /* UnparsedSource */: return printUnparsedSource(node);
             }
             writeNode(hint, node, sourceFile, beginPrint());
             return endPrint();
@@ -101138,7 +107981,7 @@ var ts;
             if (sourceFile) {
                 setSourceFile(sourceFile);
             }
-            emitList(syntheticParent, nodes, format);
+            emitList(/*parentNode*/ undefined, nodes, format);
             reset();
             writer = previousWriter;
         }
@@ -101273,7 +108116,7 @@ var ts;
             if (sourceFile) {
                 setSourceFile(sourceFile);
             }
-            pipelineEmit(hint, node);
+            pipelineEmit(hint, node, /*parenthesizerRule*/ undefined);
         }
         function setSourceFile(sourceFile) {
             currentSourceFile = sourceFile;
@@ -101301,51 +108144,54 @@ var ts;
             currentSourceFile = undefined;
             currentLineMap = undefined;
             detachedCommentsInfo = undefined;
-            lastNode = undefined;
-            lastSubstitution = undefined;
             setWriter(/*output*/ undefined, /*_sourceMapGenerator*/ undefined);
         }
         function getCurrentLineMap() {
             return currentLineMap || (currentLineMap = ts.getLineStarts(currentSourceFile));
         }
-        function emit(node) {
+        function emit(node, parenthesizerRule) {
             if (node === undefined)
                 return;
             var prevSourceFileTextKind = recordBundleFileInternalSectionStart(node);
-            var substitute = pipelineEmit(4 /* Unspecified */, node);
+            pipelineEmit(4 /* Unspecified */, node, parenthesizerRule);
             recordBundleFileInternalSectionEnd(prevSourceFileTextKind);
-            return substitute;
         }
         function emitIdentifierName(node) {
             if (node === undefined)
                 return;
-            return pipelineEmit(2 /* IdentifierName */, node);
+            pipelineEmit(2 /* IdentifierName */, node, /*parenthesizerRule*/ undefined);
         }
-        function emitExpression(node) {
+        function emitExpression(node, parenthesizerRule) {
             if (node === undefined)
                 return;
-            return pipelineEmit(1 /* Expression */, node);
+            pipelineEmit(1 /* Expression */, node, parenthesizerRule);
         }
         function emitJsxAttributeValue(node) {
-            return pipelineEmit(ts.isStringLiteral(node) ? 6 /* JsxAttributeValue */ : 4 /* Unspecified */, node);
+            pipelineEmit(ts.isStringLiteral(node) ? 6 /* JsxAttributeValue */ : 4 /* Unspecified */, node);
         }
-        function pipelineEmit(emitHint, node) {
-            var savedLastNode = lastNode;
-            var savedLastSubstitution = lastSubstitution;
-            var savedPreserveSourceNewlines = preserveSourceNewlines;
-            lastNode = node;
-            lastSubstitution = undefined;
-            if (preserveSourceNewlines && !!(ts.getEmitFlags(node) & 134217728 /* IgnoreSourceNewlines */)) {
+        function beforeEmitNode(node) {
+            if (preserveSourceNewlines && (ts.getEmitFlags(node) & 134217728 /* IgnoreSourceNewlines */)) {
                 preserveSourceNewlines = false;
             }
+        }
+        function afterEmitNode(savedPreserveSourceNewlines) {
+            preserveSourceNewlines = savedPreserveSourceNewlines;
+        }
+        function pipelineEmit(emitHint, node, parenthesizerRule) {
+            currentParenthesizerRule = parenthesizerRule;
             var pipelinePhase = getPipelinePhase(0 /* Notification */, emitHint, node);
             pipelinePhase(emitHint, node);
-            ts.Debug.assert(lastNode === node);
-            var substitute = lastSubstitution;
-            lastNode = savedLastNode;
-            lastSubstitution = savedLastSubstitution;
-            preserveSourceNewlines = savedPreserveSourceNewlines;
-            return substitute || node;
+            currentParenthesizerRule = undefined;
+        }
+        function shouldEmitComments(node) {
+            return !commentsDisabled && !ts.isSourceFile(node);
+        }
+        function shouldEmitSourceMaps(node) {
+            return !sourceMapsDisabled &&
+                !ts.isSourceFile(node) &&
+                !ts.isInJsonFile(node) &&
+                !ts.isUnparsedSource(node) &&
+                !ts.isUnparsedPrepend(node);
         }
         function getPipelinePhase(phase, emitHint, node) {
             switch (phase) {
@@ -101355,18 +108201,21 @@ var ts;
                     }
                 // falls through
                 case 1 /* Substitution */:
-                    if (substituteNode !== ts.noEmitSubstitution && (lastSubstitution = substituteNode(emitHint, node)) !== node) {
+                    if (substituteNode !== ts.noEmitSubstitution && (lastSubstitution = substituteNode(emitHint, node) || node) !== node) {
+                        if (currentParenthesizerRule) {
+                            lastSubstitution = currentParenthesizerRule(lastSubstitution);
+                        }
                         return pipelineEmitWithSubstitution;
                     }
                 // falls through
                 case 2 /* Comments */:
-                    if (!commentsDisabled && node.kind !== 297 /* SourceFile */) {
+                    if (shouldEmitComments(node)) {
                         return pipelineEmitWithComments;
                     }
                 // falls through
                 case 3 /* SourceMaps */:
-                    if (!sourceMapsDisabled && node.kind !== 297 /* SourceFile */ && !ts.isInJsonFile(node)) {
-                        return pipelineEmitWithSourceMap;
+                    if (shouldEmitSourceMaps(node)) {
+                        return pipelineEmitWithSourceMaps;
                     }
                 // falls through
                 case 4 /* Emit */:
@@ -101379,13 +108228,32 @@ var ts;
             return getPipelinePhase(currentPhase + 1, emitHint, node);
         }
         function pipelineEmitWithNotification(hint, node) {
-            ts.Debug.assert(lastNode === node);
             var pipelinePhase = getNextPipelinePhase(0 /* Notification */, hint, node);
             onEmitNode(hint, node, pipelinePhase);
-            ts.Debug.assert(lastNode === node);
         }
         function pipelineEmitWithHint(hint, node) {
-            ts.Debug.assert(lastNode === node || lastSubstitution === node);
+            onBeforeEmitNode === null || onBeforeEmitNode === void 0 ? void 0 : onBeforeEmitNode(node);
+            if (preserveSourceNewlines) {
+                var savedPreserveSourceNewlines = preserveSourceNewlines;
+                beforeEmitNode(node);
+                pipelineEmitWithHintWorker(hint, node);
+                afterEmitNode(savedPreserveSourceNewlines);
+            }
+            else {
+                pipelineEmitWithHintWorker(hint, node);
+            }
+            onAfterEmitNode === null || onAfterEmitNode === void 0 ? void 0 : onAfterEmitNode(node);
+            // clear the parenthesizer rule as we ascend
+            currentParenthesizerRule = undefined;
+        }
+        function pipelineEmitWithHintWorker(hint, node, allowSnippets) {
+            if (allowSnippets === void 0) { allowSnippets = true; }
+            if (allowSnippets) {
+                var snippet = ts.getSnippetElement(node);
+                if (snippet) {
+                    return emitSnippetNode(hint, node, snippet);
+                }
+            }
             if (hint === 0 /* SourceFile */)
                 return emitSourceFile(ts.cast(node, ts.isSourceFile));
             if (hint === 2 /* IdentifierName */)
@@ -101399,308 +108267,343 @@ var ts;
                 return emitEmptyStatement(/*isEmbeddedStatement*/ true);
             }
             if (hint === 4 /* Unspecified */) {
-                if (ts.isKeyword(node.kind))
-                    return writeTokenNode(node, writeKeyword);
                 switch (node.kind) {
                     // Pseudo-literals
                     case 15 /* TemplateHead */:
                     case 16 /* TemplateMiddle */:
                     case 17 /* TemplateTail */:
                         return emitLiteral(node, /*jsxAttributeEscape*/ false);
-                    case 299 /* UnparsedSource */:
-                    case 293 /* UnparsedPrepend */:
-                        return emitUnparsedSourceOrPrepend(node);
-                    case 292 /* UnparsedPrologue */:
-                        return writeUnparsedNode(node);
-                    case 294 /* UnparsedText */:
-                    case 295 /* UnparsedInternalText */:
-                        return emitUnparsedTextLike(node);
-                    case 296 /* UnparsedSyntheticReference */:
-                        return emitUnparsedSyntheticReference(node);
                     // Identifiers
-                    case 78 /* Identifier */:
+                    case 79 /* Identifier */:
                         return emitIdentifier(node);
                     // PrivateIdentifiers
-                    case 79 /* PrivateIdentifier */:
+                    case 80 /* PrivateIdentifier */:
                         return emitPrivateIdentifier(node);
                     // Parse tree nodes
                     // Names
-                    case 157 /* QualifiedName */:
+                    case 160 /* QualifiedName */:
                         return emitQualifiedName(node);
-                    case 158 /* ComputedPropertyName */:
+                    case 161 /* ComputedPropertyName */:
                         return emitComputedPropertyName(node);
                     // Signature elements
-                    case 159 /* TypeParameter */:
+                    case 162 /* TypeParameter */:
                         return emitTypeParameter(node);
-                    case 160 /* Parameter */:
+                    case 163 /* Parameter */:
                         return emitParameter(node);
-                    case 161 /* Decorator */:
+                    case 164 /* Decorator */:
                         return emitDecorator(node);
                     // Type members
-                    case 162 /* PropertySignature */:
+                    case 165 /* PropertySignature */:
                         return emitPropertySignature(node);
-                    case 163 /* PropertyDeclaration */:
+                    case 166 /* PropertyDeclaration */:
                         return emitPropertyDeclaration(node);
-                    case 164 /* MethodSignature */:
+                    case 167 /* MethodSignature */:
                         return emitMethodSignature(node);
-                    case 165 /* MethodDeclaration */:
+                    case 168 /* MethodDeclaration */:
                         return emitMethodDeclaration(node);
-                    case 166 /* Constructor */:
+                    case 169 /* ClassStaticBlockDeclaration */:
+                        return emitClassStaticBlockDeclaration(node);
+                    case 170 /* Constructor */:
                         return emitConstructor(node);
-                    case 167 /* GetAccessor */:
-                    case 168 /* SetAccessor */:
+                    case 171 /* GetAccessor */:
+                    case 172 /* SetAccessor */:
                         return emitAccessorDeclaration(node);
-                    case 169 /* CallSignature */:
+                    case 173 /* CallSignature */:
                         return emitCallSignature(node);
-                    case 170 /* ConstructSignature */:
+                    case 174 /* ConstructSignature */:
                         return emitConstructSignature(node);
-                    case 171 /* IndexSignature */:
+                    case 175 /* IndexSignature */:
                         return emitIndexSignature(node);
-                    case 194 /* TemplateLiteralTypeSpan */:
-                        return emitTemplateTypeSpan(node);
                     // Types
-                    case 172 /* TypePredicate */:
+                    case 176 /* TypePredicate */:
                         return emitTypePredicate(node);
-                    case 173 /* TypeReference */:
+                    case 177 /* TypeReference */:
                         return emitTypeReference(node);
-                    case 174 /* FunctionType */:
+                    case 178 /* FunctionType */:
                         return emitFunctionType(node);
-                    case 308 /* JSDocFunctionType */:
-                        return emitJSDocFunctionType(node);
-                    case 175 /* ConstructorType */:
+                    case 179 /* ConstructorType */:
                         return emitConstructorType(node);
-                    case 176 /* TypeQuery */:
+                    case 180 /* TypeQuery */:
                         return emitTypeQuery(node);
-                    case 177 /* TypeLiteral */:
+                    case 181 /* TypeLiteral */:
                         return emitTypeLiteral(node);
-                    case 178 /* ArrayType */:
+                    case 182 /* ArrayType */:
                         return emitArrayType(node);
-                    case 179 /* TupleType */:
+                    case 183 /* TupleType */:
                         return emitTupleType(node);
-                    case 180 /* OptionalType */:
+                    case 184 /* OptionalType */:
                         return emitOptionalType(node);
-                    case 182 /* UnionType */:
+                    // SyntaxKind.RestType is handled below
+                    case 186 /* UnionType */:
                         return emitUnionType(node);
-                    case 183 /* IntersectionType */:
+                    case 187 /* IntersectionType */:
                         return emitIntersectionType(node);
-                    case 184 /* ConditionalType */:
+                    case 188 /* ConditionalType */:
                         return emitConditionalType(node);
-                    case 185 /* InferType */:
+                    case 189 /* InferType */:
                         return emitInferType(node);
-                    case 186 /* ParenthesizedType */:
+                    case 190 /* ParenthesizedType */:
                         return emitParenthesizedType(node);
-                    case 223 /* ExpressionWithTypeArguments */:
+                    case 227 /* ExpressionWithTypeArguments */:
                         return emitExpressionWithTypeArguments(node);
-                    case 187 /* ThisType */:
+                    case 191 /* ThisType */:
                         return emitThisType();
-                    case 188 /* TypeOperator */:
+                    case 192 /* TypeOperator */:
                         return emitTypeOperator(node);
-                    case 189 /* IndexedAccessType */:
+                    case 193 /* IndexedAccessType */:
                         return emitIndexedAccessType(node);
-                    case 190 /* MappedType */:
+                    case 194 /* MappedType */:
                         return emitMappedType(node);
-                    case 191 /* LiteralType */:
+                    case 195 /* LiteralType */:
                         return emitLiteralType(node);
-                    case 193 /* TemplateLiteralType */:
+                    case 196 /* NamedTupleMember */:
+                        return emitNamedTupleMember(node);
+                    case 197 /* TemplateLiteralType */:
                         return emitTemplateType(node);
-                    case 195 /* ImportType */:
+                    case 198 /* TemplateLiteralTypeSpan */:
+                        return emitTemplateTypeSpan(node);
+                    case 199 /* ImportType */:
                         return emitImportTypeNode(node);
-                    case 303 /* JSDocAllType */:
-                        writePunctuation("*");
-                        return;
-                    case 304 /* JSDocUnknownType */:
-                        writePunctuation("?");
-                        return;
-                    case 305 /* JSDocNullableType */:
-                        return emitJSDocNullableType(node);
-                    case 306 /* JSDocNonNullableType */:
-                        return emitJSDocNonNullableType(node);
-                    case 307 /* JSDocOptionalType */:
-                        return emitJSDocOptionalType(node);
-                    case 181 /* RestType */:
-                    case 309 /* JSDocVariadicType */:
-                        return emitRestOrJSDocVariadicType(node);
-                    case 192 /* NamedTupleMember */:
-                        return emitNamedTupleMember(node);
                     // Binding patterns
-                    case 196 /* ObjectBindingPattern */:
+                    case 200 /* ObjectBindingPattern */:
                         return emitObjectBindingPattern(node);
-                    case 197 /* ArrayBindingPattern */:
+                    case 201 /* ArrayBindingPattern */:
                         return emitArrayBindingPattern(node);
-                    case 198 /* BindingElement */:
+                    case 202 /* BindingElement */:
                         return emitBindingElement(node);
                     // Misc
-                    case 228 /* TemplateSpan */:
+                    case 232 /* TemplateSpan */:
                         return emitTemplateSpan(node);
-                    case 229 /* SemicolonClassElement */:
+                    case 233 /* SemicolonClassElement */:
                         return emitSemicolonClassElement();
                     // Statements
-                    case 230 /* Block */:
+                    case 234 /* Block */:
                         return emitBlock(node);
-                    case 232 /* VariableStatement */:
+                    case 236 /* VariableStatement */:
                         return emitVariableStatement(node);
-                    case 231 /* EmptyStatement */:
+                    case 235 /* EmptyStatement */:
                         return emitEmptyStatement(/*isEmbeddedStatement*/ false);
-                    case 233 /* ExpressionStatement */:
+                    case 237 /* ExpressionStatement */:
                         return emitExpressionStatement(node);
-                    case 234 /* IfStatement */:
+                    case 238 /* IfStatement */:
                         return emitIfStatement(node);
-                    case 235 /* DoStatement */:
+                    case 239 /* DoStatement */:
                         return emitDoStatement(node);
-                    case 236 /* WhileStatement */:
+                    case 240 /* WhileStatement */:
                         return emitWhileStatement(node);
-                    case 237 /* ForStatement */:
+                    case 241 /* ForStatement */:
                         return emitForStatement(node);
-                    case 238 /* ForInStatement */:
+                    case 242 /* ForInStatement */:
                         return emitForInStatement(node);
-                    case 239 /* ForOfStatement */:
+                    case 243 /* ForOfStatement */:
                         return emitForOfStatement(node);
-                    case 240 /* ContinueStatement */:
+                    case 244 /* ContinueStatement */:
                         return emitContinueStatement(node);
-                    case 241 /* BreakStatement */:
+                    case 245 /* BreakStatement */:
                         return emitBreakStatement(node);
-                    case 242 /* ReturnStatement */:
+                    case 246 /* ReturnStatement */:
                         return emitReturnStatement(node);
-                    case 243 /* WithStatement */:
+                    case 247 /* WithStatement */:
                         return emitWithStatement(node);
-                    case 244 /* SwitchStatement */:
+                    case 248 /* SwitchStatement */:
                         return emitSwitchStatement(node);
-                    case 245 /* LabeledStatement */:
+                    case 249 /* LabeledStatement */:
                         return emitLabeledStatement(node);
-                    case 246 /* ThrowStatement */:
+                    case 250 /* ThrowStatement */:
                         return emitThrowStatement(node);
-                    case 247 /* TryStatement */:
+                    case 251 /* TryStatement */:
                         return emitTryStatement(node);
-                    case 248 /* DebuggerStatement */:
+                    case 252 /* DebuggerStatement */:
                         return emitDebuggerStatement(node);
                     // Declarations
-                    case 249 /* VariableDeclaration */:
+                    case 253 /* VariableDeclaration */:
                         return emitVariableDeclaration(node);
-                    case 250 /* VariableDeclarationList */:
+                    case 254 /* VariableDeclarationList */:
                         return emitVariableDeclarationList(node);
-                    case 251 /* FunctionDeclaration */:
+                    case 255 /* FunctionDeclaration */:
                         return emitFunctionDeclaration(node);
-                    case 252 /* ClassDeclaration */:
+                    case 256 /* ClassDeclaration */:
                         return emitClassDeclaration(node);
-                    case 253 /* InterfaceDeclaration */:
+                    case 257 /* InterfaceDeclaration */:
                         return emitInterfaceDeclaration(node);
-                    case 254 /* TypeAliasDeclaration */:
+                    case 258 /* TypeAliasDeclaration */:
                         return emitTypeAliasDeclaration(node);
-                    case 255 /* EnumDeclaration */:
+                    case 259 /* EnumDeclaration */:
                         return emitEnumDeclaration(node);
-                    case 256 /* ModuleDeclaration */:
+                    case 260 /* ModuleDeclaration */:
                         return emitModuleDeclaration(node);
-                    case 257 /* ModuleBlock */:
+                    case 261 /* ModuleBlock */:
                         return emitModuleBlock(node);
-                    case 258 /* CaseBlock */:
+                    case 262 /* CaseBlock */:
                         return emitCaseBlock(node);
-                    case 259 /* NamespaceExportDeclaration */:
+                    case 263 /* NamespaceExportDeclaration */:
                         return emitNamespaceExportDeclaration(node);
-                    case 260 /* ImportEqualsDeclaration */:
+                    case 264 /* ImportEqualsDeclaration */:
                         return emitImportEqualsDeclaration(node);
-                    case 261 /* ImportDeclaration */:
+                    case 265 /* ImportDeclaration */:
                         return emitImportDeclaration(node);
-                    case 262 /* ImportClause */:
+                    case 266 /* ImportClause */:
                         return emitImportClause(node);
-                    case 263 /* NamespaceImport */:
+                    case 267 /* NamespaceImport */:
                         return emitNamespaceImport(node);
-                    case 269 /* NamespaceExport */:
+                    case 273 /* NamespaceExport */:
                         return emitNamespaceExport(node);
-                    case 264 /* NamedImports */:
+                    case 268 /* NamedImports */:
                         return emitNamedImports(node);
-                    case 265 /* ImportSpecifier */:
+                    case 269 /* ImportSpecifier */:
                         return emitImportSpecifier(node);
-                    case 266 /* ExportAssignment */:
+                    case 270 /* ExportAssignment */:
                         return emitExportAssignment(node);
-                    case 267 /* ExportDeclaration */:
+                    case 271 /* ExportDeclaration */:
                         return emitExportDeclaration(node);
-                    case 268 /* NamedExports */:
+                    case 272 /* NamedExports */:
                         return emitNamedExports(node);
-                    case 270 /* ExportSpecifier */:
+                    case 274 /* ExportSpecifier */:
                         return emitExportSpecifier(node);
-                    case 271 /* MissingDeclaration */:
+                    case 292 /* AssertClause */:
+                        return emitAssertClause(node);
+                    case 293 /* AssertEntry */:
+                        return emitAssertEntry(node);
+                    case 275 /* MissingDeclaration */:
                         return;
                     // Module references
-                    case 272 /* ExternalModuleReference */:
+                    case 276 /* ExternalModuleReference */:
                         return emitExternalModuleReference(node);
                     // JSX (non-expression)
                     case 11 /* JsxText */:
                         return emitJsxText(node);
-                    case 275 /* JsxOpeningElement */:
-                    case 278 /* JsxOpeningFragment */:
+                    case 279 /* JsxOpeningElement */:
+                    case 282 /* JsxOpeningFragment */:
                         return emitJsxOpeningElementOrFragment(node);
-                    case 276 /* JsxClosingElement */:
-                    case 279 /* JsxClosingFragment */:
+                    case 280 /* JsxClosingElement */:
+                    case 283 /* JsxClosingFragment */:
                         return emitJsxClosingElementOrFragment(node);
-                    case 280 /* JsxAttribute */:
+                    case 284 /* JsxAttribute */:
                         return emitJsxAttribute(node);
-                    case 281 /* JsxAttributes */:
+                    case 285 /* JsxAttributes */:
                         return emitJsxAttributes(node);
-                    case 282 /* JsxSpreadAttribute */:
+                    case 286 /* JsxSpreadAttribute */:
                         return emitJsxSpreadAttribute(node);
-                    case 283 /* JsxExpression */:
+                    case 287 /* JsxExpression */:
                         return emitJsxExpression(node);
                     // Clauses
-                    case 284 /* CaseClause */:
+                    case 288 /* CaseClause */:
                         return emitCaseClause(node);
-                    case 285 /* DefaultClause */:
+                    case 289 /* DefaultClause */:
                         return emitDefaultClause(node);
-                    case 286 /* HeritageClause */:
+                    case 290 /* HeritageClause */:
                         return emitHeritageClause(node);
-                    case 287 /* CatchClause */:
+                    case 291 /* CatchClause */:
                         return emitCatchClause(node);
                     // Property assignments
-                    case 288 /* PropertyAssignment */:
+                    case 294 /* PropertyAssignment */:
                         return emitPropertyAssignment(node);
-                    case 289 /* ShorthandPropertyAssignment */:
+                    case 295 /* ShorthandPropertyAssignment */:
                         return emitShorthandPropertyAssignment(node);
-                    case 290 /* SpreadAssignment */:
+                    case 296 /* SpreadAssignment */:
                         return emitSpreadAssignment(node);
                     // Enum
-                    case 291 /* EnumMember */:
+                    case 297 /* EnumMember */:
                         return emitEnumMember(node);
+                    // Unparsed
+                    case 298 /* UnparsedPrologue */:
+                        return writeUnparsedNode(node);
+                    case 305 /* UnparsedSource */:
+                    case 299 /* UnparsedPrepend */:
+                        return emitUnparsedSourceOrPrepend(node);
+                    case 300 /* UnparsedText */:
+                    case 301 /* UnparsedInternalText */:
+                        return emitUnparsedTextLike(node);
+                    case 302 /* UnparsedSyntheticReference */:
+                        return emitUnparsedSyntheticReference(node);
+                    // Top-level nodes
+                    case 303 /* SourceFile */:
+                        return emitSourceFile(node);
+                    case 304 /* Bundle */:
+                        return ts.Debug.fail("Bundles should be printed using printBundle");
+                    // SyntaxKind.UnparsedSource (handled above)
+                    case 306 /* InputFiles */:
+                        return ts.Debug.fail("InputFiles should not be printed");
                     // JSDoc nodes (only used in codefixes currently)
-                    case 326 /* JSDocParameterTag */:
-                    case 333 /* JSDocPropertyTag */:
+                    case 307 /* JSDocTypeExpression */:
+                        return emitJSDocTypeExpression(node);
+                    case 308 /* JSDocNameReference */:
+                        return emitJSDocNameReference(node);
+                    case 310 /* JSDocAllType */:
+                        return writePunctuation("*");
+                    case 311 /* JSDocUnknownType */:
+                        return writePunctuation("?");
+                    case 312 /* JSDocNullableType */:
+                        return emitJSDocNullableType(node);
+                    case 313 /* JSDocNonNullableType */:
+                        return emitJSDocNonNullableType(node);
+                    case 314 /* JSDocOptionalType */:
+                        return emitJSDocOptionalType(node);
+                    case 315 /* JSDocFunctionType */:
+                        return emitJSDocFunctionType(node);
+                    case 185 /* RestType */:
+                    case 316 /* JSDocVariadicType */:
+                        return emitRestOrJSDocVariadicType(node);
+                    case 317 /* JSDocNamepathType */:
+                        return;
+                    case 318 /* JSDocComment */:
+                        return emitJSDoc(node);
+                    case 320 /* JSDocTypeLiteral */:
+                        return emitJSDocTypeLiteral(node);
+                    case 321 /* JSDocSignature */:
+                        return emitJSDocSignature(node);
+                    case 325 /* JSDocTag */:
+                    case 330 /* JSDocClassTag */:
+                        return emitJSDocSimpleTag(node);
+                    case 326 /* JSDocAugmentsTag */:
+                    case 327 /* JSDocImplementsTag */:
+                        return emitJSDocHeritageTag(node);
+                    case 328 /* JSDocAuthorTag */:
+                    case 329 /* JSDocDeprecatedTag */:
+                        return;
+                    // SyntaxKind.JSDocClassTag (see JSDocTag, above)
+                    case 331 /* JSDocPublicTag */:
+                    case 332 /* JSDocPrivateTag */:
+                    case 333 /* JSDocProtectedTag */:
+                    case 334 /* JSDocReadonlyTag */:
+                    case 335 /* JSDocOverrideTag */:
+                        return;
+                    case 336 /* JSDocCallbackTag */:
+                        return emitJSDocCallbackTag(node);
+                    // SyntaxKind.JSDocEnumTag (see below)
+                    case 338 /* JSDocParameterTag */:
+                    case 345 /* JSDocPropertyTag */:
                         return emitJSDocPropertyLikeTag(node);
-                    case 327 /* JSDocReturnTag */:
-                    case 329 /* JSDocTypeTag */:
-                    case 328 /* JSDocThisTag */:
-                    case 325 /* JSDocEnumTag */:
+                    case 337 /* JSDocEnumTag */:
+                    case 339 /* JSDocReturnTag */:
+                    case 340 /* JSDocThisTag */:
+                    case 341 /* JSDocTypeTag */:
                         return emitJSDocSimpleTypedTag(node);
-                    case 316 /* JSDocImplementsTag */:
-                    case 315 /* JSDocAugmentsTag */:
-                        return emitJSDocHeritageTag(node);
-                    case 330 /* JSDocTemplateTag */:
+                    case 342 /* JSDocTemplateTag */:
                         return emitJSDocTemplateTag(node);
-                    case 331 /* JSDocTypedefTag */:
+                    case 343 /* JSDocTypedefTag */:
                         return emitJSDocTypedefTag(node);
-                    case 324 /* JSDocCallbackTag */:
-                        return emitJSDocCallbackTag(node);
-                    case 313 /* JSDocSignature */:
-                        return emitJSDocSignature(node);
-                    case 312 /* JSDocTypeLiteral */:
-                        return emitJSDocTypeLiteral(node);
-                    case 319 /* JSDocClassTag */:
-                    case 314 /* JSDocTag */:
-                        return emitJSDocSimpleTag(node);
-                    case 332 /* JSDocSeeTag */:
+                    case 344 /* JSDocSeeTag */:
                         return emitJSDocSeeTag(node);
-                    case 302 /* JSDocNameReference */:
-                        return emitJSDocNameReference(node);
-                    case 311 /* JSDocComment */:
-                        return emitJSDoc(node);
-                    // Transformation nodes (ignored)
+                    // SyntaxKind.JSDocPropertyTag (see JSDocParameterTag, above)
+                    // Transformation nodes
+                    case 347 /* NotEmittedStatement */:
+                    case 351 /* EndOfDeclarationMarker */:
+                    case 350 /* MergeDeclarationMarker */:
+                        return;
                 }
                 if (ts.isExpression(node)) {
                     hint = 1 /* Expression */;
                     if (substituteNode !== ts.noEmitSubstitution) {
-                        lastSubstitution = node = substituteNode(hint, node);
+                        var substitute = substituteNode(hint, node) || node;
+                        if (substitute !== node) {
+                            node = substitute;
+                            if (currentParenthesizerRule) {
+                                node = currentParenthesizerRule(node);
+                            }
+                        }
                     }
                 }
-                else if (ts.isToken(node)) {
-                    return writeTokenNode(node, writePunctuation);
-                }
             }
             if (hint === 1 /* Expression */) {
                 switch (node.kind) {
@@ -101713,86 +108616,96 @@ var ts;
                     case 14 /* NoSubstitutionTemplateLiteral */:
                         return emitLiteral(node, /*jsxAttributeEscape*/ false);
                     // Identifiers
-                    case 78 /* Identifier */:
+                    case 79 /* Identifier */:
                         return emitIdentifier(node);
-                    // Reserved words
-                    case 94 /* FalseKeyword */:
-                    case 103 /* NullKeyword */:
-                    case 105 /* SuperKeyword */:
-                    case 109 /* TrueKeyword */:
-                    case 107 /* ThisKeyword */:
-                    case 99 /* ImportKeyword */:
-                        writeTokenNode(node, writeKeyword);
-                        return;
+                    case 80 /* PrivateIdentifier */:
+                        return emitPrivateIdentifier(node);
                     // Expressions
-                    case 199 /* ArrayLiteralExpression */:
+                    case 203 /* ArrayLiteralExpression */:
                         return emitArrayLiteralExpression(node);
-                    case 200 /* ObjectLiteralExpression */:
+                    case 204 /* ObjectLiteralExpression */:
                         return emitObjectLiteralExpression(node);
-                    case 201 /* PropertyAccessExpression */:
+                    case 205 /* PropertyAccessExpression */:
                         return emitPropertyAccessExpression(node);
-                    case 202 /* ElementAccessExpression */:
+                    case 206 /* ElementAccessExpression */:
                         return emitElementAccessExpression(node);
-                    case 203 /* CallExpression */:
+                    case 207 /* CallExpression */:
                         return emitCallExpression(node);
-                    case 204 /* NewExpression */:
+                    case 208 /* NewExpression */:
                         return emitNewExpression(node);
-                    case 205 /* TaggedTemplateExpression */:
+                    case 209 /* TaggedTemplateExpression */:
                         return emitTaggedTemplateExpression(node);
-                    case 206 /* TypeAssertionExpression */:
+                    case 210 /* TypeAssertionExpression */:
                         return emitTypeAssertionExpression(node);
-                    case 207 /* ParenthesizedExpression */:
+                    case 211 /* ParenthesizedExpression */:
                         return emitParenthesizedExpression(node);
-                    case 208 /* FunctionExpression */:
+                    case 212 /* FunctionExpression */:
                         return emitFunctionExpression(node);
-                    case 209 /* ArrowFunction */:
+                    case 213 /* ArrowFunction */:
                         return emitArrowFunction(node);
-                    case 210 /* DeleteExpression */:
+                    case 214 /* DeleteExpression */:
                         return emitDeleteExpression(node);
-                    case 211 /* TypeOfExpression */:
+                    case 215 /* TypeOfExpression */:
                         return emitTypeOfExpression(node);
-                    case 212 /* VoidExpression */:
+                    case 216 /* VoidExpression */:
                         return emitVoidExpression(node);
-                    case 213 /* AwaitExpression */:
+                    case 217 /* AwaitExpression */:
                         return emitAwaitExpression(node);
-                    case 214 /* PrefixUnaryExpression */:
+                    case 218 /* PrefixUnaryExpression */:
                         return emitPrefixUnaryExpression(node);
-                    case 215 /* PostfixUnaryExpression */:
+                    case 219 /* PostfixUnaryExpression */:
                         return emitPostfixUnaryExpression(node);
-                    case 216 /* BinaryExpression */:
+                    case 220 /* BinaryExpression */:
                         return emitBinaryExpression(node);
-                    case 217 /* ConditionalExpression */:
+                    case 221 /* ConditionalExpression */:
                         return emitConditionalExpression(node);
-                    case 218 /* TemplateExpression */:
+                    case 222 /* TemplateExpression */:
                         return emitTemplateExpression(node);
-                    case 219 /* YieldExpression */:
+                    case 223 /* YieldExpression */:
                         return emitYieldExpression(node);
-                    case 220 /* SpreadElement */:
-                        return emitSpreadExpression(node);
-                    case 221 /* ClassExpression */:
+                    case 224 /* SpreadElement */:
+                        return emitSpreadElement(node);
+                    case 225 /* ClassExpression */:
                         return emitClassExpression(node);
-                    case 222 /* OmittedExpression */:
+                    case 226 /* OmittedExpression */:
                         return;
-                    case 224 /* AsExpression */:
+                    case 228 /* AsExpression */:
                         return emitAsExpression(node);
-                    case 225 /* NonNullExpression */:
+                    case 229 /* NonNullExpression */:
                         return emitNonNullExpression(node);
-                    case 226 /* MetaProperty */:
+                    case 230 /* MetaProperty */:
                         return emitMetaProperty(node);
+                    case 231 /* SyntheticExpression */:
+                        return ts.Debug.fail("SyntheticExpression should never be printed.");
                     // JSX
-                    case 273 /* JsxElement */:
+                    case 277 /* JsxElement */:
                         return emitJsxElement(node);
-                    case 274 /* JsxSelfClosingElement */:
+                    case 278 /* JsxSelfClosingElement */:
                         return emitJsxSelfClosingElement(node);
-                    case 277 /* JsxFragment */:
+                    case 281 /* JsxFragment */:
                         return emitJsxFragment(node);
+                    // Synthesized list
+                    case 346 /* SyntaxList */:
+                        return ts.Debug.fail("SyntaxList should not be printed");
                     // Transformation nodes
-                    case 336 /* PartiallyEmittedExpression */:
+                    case 347 /* NotEmittedStatement */:
+                        return;
+                    case 348 /* PartiallyEmittedExpression */:
                         return emitPartiallyEmittedExpression(node);
-                    case 337 /* CommaListExpression */:
+                    case 349 /* CommaListExpression */:
                         return emitCommaList(node);
+                    case 350 /* MergeDeclarationMarker */:
+                    case 351 /* EndOfDeclarationMarker */:
+                        return;
+                    case 352 /* SyntheticReferenceExpression */:
+                        return ts.Debug.fail("SyntheticReferenceExpression should not be printed");
                 }
             }
+            if (ts.isKeyword(node.kind))
+                return writeTokenNode(node, writeKeyword);
+            if (ts.isTokenKind(node.kind))
+                return writeTokenNode(node, writePunctuation);
+            ts.Debug.fail("Unhandled SyntaxKind: ".concat(ts.Debug.formatSyntaxKind(node.kind), "."));
         }
         function emitMappedTypeParameter(node) {
             emit(node.name);
@@ -101802,10 +108715,11 @@ var ts;
             emit(node.constraint);
         }
         function pipelineEmitWithSubstitution(hint, node) {
-            ts.Debug.assert(lastNode === node || lastSubstitution === node);
             var pipelinePhase = getNextPipelinePhase(1 /* Substitution */, hint, node);
-            pipelinePhase(hint, lastSubstitution);
-            ts.Debug.assert(lastNode === node || lastSubstitution === node);
+            ts.Debug.assertIsDefined(lastSubstitution);
+            node = lastSubstitution;
+            lastSubstitution = undefined;
+            pipelinePhase(hint, node);
         }
         function getHelpersFromBundledSourceFiles(bundle) {
             var result;
@@ -101831,7 +108745,7 @@ var ts;
         }
         function emitHelpers(node) {
             var helpersEmitted = false;
-            var bundle = node.kind === 298 /* Bundle */ ? node : undefined;
+            var bundle = node.kind === 304 /* Bundle */ ? node : undefined;
             if (bundle && moduleKind === ts.ModuleKind.None) {
                 return;
             }
@@ -101931,7 +108845,7 @@ var ts;
             var pos = getTextPosWithWriteLine();
             writeUnparsedNode(unparsed);
             if (bundleFileInfo) {
-                updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind === 294 /* UnparsedText */ ?
+                updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind === 300 /* UnparsedText */ ?
                     "text" /* Text */ :
                     "internal" /* Internal */);
             }
@@ -101948,6 +108862,28 @@ var ts;
             }
         }
         //
+        // Snippet Elements
+        //
+        function emitSnippetNode(hint, node, snippet) {
+            switch (snippet.kind) {
+                case 1 /* Placeholder */:
+                    emitPlaceholder(hint, node, snippet);
+                    break;
+                case 0 /* TabStop */:
+                    emitTabStop(snippet);
+                    break;
+            }
+        }
+        function emitPlaceholder(hint, node, snippet) {
+            nonEscapingWrite("${".concat(snippet.order, ":")); // `${2:`
+            pipelineEmitWithHintWorker(hint, node, /*allowSnippets*/ false); // `...`
+            nonEscapingWrite("}"); // `}`
+            // `${2:...}`
+        }
+        function emitTabStop(snippet) {
+            nonEscapingWrite("$".concat(snippet.order));
+        }
+        //
         // Identifiers
         //
         function emitIdentifier(node) {
@@ -101968,7 +108904,7 @@ var ts;
             emit(node.right);
         }
         function emitEntityName(node) {
-            if (node.kind === 78 /* Identifier */) {
+            if (node.kind === 79 /* Identifier */) {
                 emitExpression(node);
             }
             else {
@@ -101977,7 +108913,7 @@ var ts;
         }
         function emitComputedPropertyName(node) {
             writePunctuation("[");
-            emitExpression(node.expression);
+            emitExpression(node.expression, parenthesizer.parenthesizeExpressionOfComputedPropertyName);
             writePunctuation("]");
         }
         //
@@ -102004,18 +108940,18 @@ var ts;
             emit(node.dotDotDotToken);
             emitNodeWithWriter(node.name, writeParameter);
             emit(node.questionToken);
-            if (node.parent && node.parent.kind === 308 /* JSDocFunctionType */ && !node.name) {
+            if (node.parent && node.parent.kind === 315 /* JSDocFunctionType */ && !node.name) {
                 emit(node.type);
             }
             else {
                 emitTypeAnnotation(node.type);
             }
             // The comment position has to fallback to any present node within the parameterdeclaration because as it turns out, the parser can make parameter declarations with _just_ an initializer.
-            emitInitializer(node.initializer, node.type ? node.type.end : node.questionToken ? node.questionToken.end : node.name ? node.name.end : node.modifiers ? node.modifiers.end : node.decorators ? node.decorators.end : node.pos, node);
+            emitInitializer(node.initializer, node.type ? node.type.end : node.questionToken ? node.questionToken.end : node.name ? node.name.end : node.modifiers ? node.modifiers.end : node.decorators ? node.decorators.end : node.pos, node, parenthesizer.parenthesizeExpressionForDisallowedComma);
         }
         function emitDecorator(decorator) {
             writePunctuation("@");
-            emitExpression(decorator.expression);
+            emitExpression(decorator.expression, parenthesizer.parenthesizeLeftSideOfAccess);
         }
         //
         // Type members
@@ -102058,6 +108994,12 @@ var ts;
             emit(node.questionToken);
             emitSignatureAndBody(node, emitSignatureHead);
         }
+        function emitClassStaticBlockDeclaration(node) {
+            emitDecorators(node, node.decorators);
+            emitModifiers(node, node.modifiers);
+            writeKeyword("static");
+            emitBlockFunctionBody(node.body);
+        }
         function emitConstructor(node) {
             emitModifiers(node, node.modifiers);
             writeKeyword("constructor");
@@ -102066,7 +109008,7 @@ var ts;
         function emitAccessorDeclaration(node) {
             emitDecorators(node, node.decorators);
             emitModifiers(node, node.modifiers);
-            writeKeyword(node.kind === 167 /* GetAccessor */ ? "get" : "set");
+            writeKeyword(node.kind === 171 /* GetAccessor */ ? "get" : "set");
             writeSpace();
             emit(node.name);
             emitSignatureAndBody(node, emitSignatureHead);
@@ -102180,7 +109122,7 @@ var ts;
             writePunctuation("}");
         }
         function emitArrayType(node) {
-            emit(node.elementType);
+            emit(node.elementType, parenthesizer.parenthesizeElementTypeOfArrayType);
             writePunctuation("[");
             writePunctuation("]");
         }
@@ -102203,21 +109145,21 @@ var ts;
             emit(node.type);
         }
         function emitOptionalType(node) {
-            emit(node.type);
+            emit(node.type, parenthesizer.parenthesizeElementTypeOfArrayType);
             writePunctuation("?");
         }
         function emitUnionType(node) {
-            emitList(node, node.types, 516 /* UnionTypeConstituents */);
+            emitList(node, node.types, 516 /* UnionTypeConstituents */, parenthesizer.parenthesizeMemberOfElementType);
         }
         function emitIntersectionType(node) {
-            emitList(node, node.types, 520 /* IntersectionTypeConstituents */);
+            emitList(node, node.types, 520 /* IntersectionTypeConstituents */, parenthesizer.parenthesizeMemberOfElementType);
         }
         function emitConditionalType(node) {
-            emit(node.checkType);
+            emit(node.checkType, parenthesizer.parenthesizeMemberOfConditionalType);
             writeSpace();
             writeKeyword("extends");
             writeSpace();
-            emit(node.extendsType);
+            emit(node.extendsType, parenthesizer.parenthesizeMemberOfConditionalType);
             writeSpace();
             writePunctuation("?");
             writeSpace();
@@ -102243,10 +109185,10 @@ var ts;
         function emitTypeOperator(node) {
             writeTokenText(node.operator, writeKeyword);
             writeSpace();
-            emit(node.type);
+            emit(node.type, parenthesizer.parenthesizeMemberOfElementType);
         }
         function emitIndexedAccessType(node) {
-            emit(node.objectType);
+            emit(node.objectType, parenthesizer.parenthesizeMemberOfElementType);
             writePunctuation("[");
             emit(node.indexType);
             writePunctuation("]");
@@ -102263,7 +109205,7 @@ var ts;
             }
             if (node.readonlyToken) {
                 emit(node.readonlyToken);
-                if (node.readonlyToken.kind !== 142 /* ReadonlyKeyword */) {
+                if (node.readonlyToken.kind !== 144 /* ReadonlyKeyword */) {
                     writeKeyword("readonly");
                 }
                 writeSpace();
@@ -102339,7 +109281,7 @@ var ts;
                 writeSpace();
             }
             emit(node.name);
-            emitInitializer(node.initializer, node.name.end, node);
+            emitInitializer(node.initializer, node.name.end, node, parenthesizer.parenthesizeExpressionForDisallowedComma);
         }
         //
         // Expressions
@@ -102347,7 +109289,7 @@ var ts;
         function emitArrayLiteralExpression(node) {
             var elements = node.elements;
             var preferNewLine = node.multiLine ? 65536 /* PreferNewLine */ : 0 /* None */;
-            emitExpressionList(node, elements, 8914 /* ArrayLiteralExpressionElements */ | preferNewLine);
+            emitExpressionList(node, elements, 8914 /* ArrayLiteralExpressionElements */ | preferNewLine, parenthesizer.parenthesizeExpressionForDisallowedComma);
         }
         function emitObjectLiteralExpression(node) {
             ts.forEach(node.properties, generateMemberNames);
@@ -102363,13 +109305,13 @@ var ts;
             }
         }
         function emitPropertyAccessExpression(node) {
-            var expression = ts.cast(emitExpression(node.expression), ts.isExpression);
+            emitExpression(node.expression, parenthesizer.parenthesizeLeftSideOfAccess);
             var token = node.questionDotToken || ts.setTextRangePosEnd(ts.factory.createToken(24 /* DotToken */), node.expression.end, node.name.pos);
             var linesBeforeDot = getLinesBetweenNodes(node, node.expression, token);
             var linesAfterDot = getLinesBetweenNodes(node, token, node.name);
             writeLinesAndIndent(linesBeforeDot, /*writeSpaceIfNotIndenting*/ false);
             var shouldEmitDotDot = token.kind !== 28 /* QuestionDotToken */ &&
-                mayNeedDotDotForPropertyAccess(expression) &&
+                mayNeedDotDotForPropertyAccess(node.expression) &&
                 !writer.hasTrailingComment() &&
                 !writer.hasTrailingWhitespace();
             if (shouldEmitDotDot) {
@@ -102405,27 +109347,47 @@ var ts;
             }
         }
         function emitElementAccessExpression(node) {
-            emitExpression(node.expression);
+            emitExpression(node.expression, parenthesizer.parenthesizeLeftSideOfAccess);
             emit(node.questionDotToken);
             emitTokenWithComment(22 /* OpenBracketToken */, node.expression.end, writePunctuation, node);
             emitExpression(node.argumentExpression);
             emitTokenWithComment(23 /* CloseBracketToken */, node.argumentExpression.end, writePunctuation, node);
         }
         function emitCallExpression(node) {
-            emitExpression(node.expression);
+            var indirectCall = ts.getEmitFlags(node) & 536870912 /* IndirectCall */;
+            if (indirectCall) {
+                writePunctuation("(");
+                writeLiteral("0");
+                writePunctuation(",");
+                writeSpace();
+            }
+            emitExpression(node.expression, parenthesizer.parenthesizeLeftSideOfAccess);
+            if (indirectCall) {
+                writePunctuation(")");
+            }
             emit(node.questionDotToken);
             emitTypeArguments(node, node.typeArguments);
-            emitExpressionList(node, node.arguments, 2576 /* CallExpressionArguments */);
+            emitExpressionList(node, node.arguments, 2576 /* CallExpressionArguments */, parenthesizer.parenthesizeExpressionForDisallowedComma);
         }
         function emitNewExpression(node) {
-            emitTokenWithComment(102 /* NewKeyword */, node.pos, writeKeyword, node);
+            emitTokenWithComment(103 /* NewKeyword */, node.pos, writeKeyword, node);
             writeSpace();
-            emitExpression(node.expression);
+            emitExpression(node.expression, parenthesizer.parenthesizeExpressionOfNew);
             emitTypeArguments(node, node.typeArguments);
-            emitExpressionList(node, node.arguments, 18960 /* NewExpressionArguments */);
+            emitExpressionList(node, node.arguments, 18960 /* NewExpressionArguments */, parenthesizer.parenthesizeExpressionForDisallowedComma);
         }
         function emitTaggedTemplateExpression(node) {
-            emitExpression(node.tag);
+            var indirectCall = ts.getEmitFlags(node) & 536870912 /* IndirectCall */;
+            if (indirectCall) {
+                writePunctuation("(");
+                writeLiteral("0");
+                writePunctuation(",");
+                writeSpace();
+            }
+            emitExpression(node.tag, parenthesizer.parenthesizeLeftSideOfAccess);
+            if (indirectCall) {
+                writePunctuation(")");
+            }
             emitTypeArguments(node, node.typeArguments);
             writeSpace();
             emitExpression(node.template);
@@ -102434,12 +109396,12 @@ var ts;
             writePunctuation("<");
             emit(node.type);
             writePunctuation(">");
-            emitExpression(node.expression);
+            emitExpression(node.expression, parenthesizer.parenthesizeOperandOfPrefixUnary);
         }
         function emitParenthesizedExpression(node) {
             var openParenPos = emitTokenWithComment(20 /* OpenParenToken */, node.pos, writePunctuation, node);
             var indented = writeLineSeparatorsAndIndentBefore(node.expression, node);
-            emitExpression(node.expression);
+            emitExpression(node.expression, /*parenthesizerRules*/ undefined);
             writeLineSeparatorsAfter(node.expression, node);
             decreaseIndentIf(indented);
             emitTokenWithComment(21 /* CloseParenToken */, node.expression ? node.expression.end : openParenPos, writePunctuation, node);
@@ -102461,31 +109423,31 @@ var ts;
             emit(node.equalsGreaterThanToken);
         }
         function emitDeleteExpression(node) {
-            emitTokenWithComment(88 /* DeleteKeyword */, node.pos, writeKeyword, node);
+            emitTokenWithComment(89 /* DeleteKeyword */, node.pos, writeKeyword, node);
             writeSpace();
-            emitExpression(node.expression);
+            emitExpression(node.expression, parenthesizer.parenthesizeOperandOfPrefixUnary);
         }
         function emitTypeOfExpression(node) {
-            emitTokenWithComment(111 /* TypeOfKeyword */, node.pos, writeKeyword, node);
+            emitTokenWithComment(112 /* TypeOfKeyword */, node.pos, writeKeyword, node);
             writeSpace();
-            emitExpression(node.expression);
+            emitExpression(node.expression, parenthesizer.parenthesizeOperandOfPrefixUnary);
         }
         function emitVoidExpression(node) {
-            emitTokenWithComment(113 /* VoidKeyword */, node.pos, writeKeyword, node);
+            emitTokenWithComment(114 /* VoidKeyword */, node.pos, writeKeyword, node);
             writeSpace();
-            emitExpression(node.expression);
+            emitExpression(node.expression, parenthesizer.parenthesizeOperandOfPrefixUnary);
         }
         function emitAwaitExpression(node) {
-            emitTokenWithComment(130 /* AwaitKeyword */, node.pos, writeKeyword, node);
+            emitTokenWithComment(132 /* AwaitKeyword */, node.pos, writeKeyword, node);
             writeSpace();
-            emitExpression(node.expression);
+            emitExpression(node.expression, parenthesizer.parenthesizeOperandOfPrefixUnary);
         }
         function emitPrefixUnaryExpression(node) {
             writeTokenText(node.operator, writeOperator);
             if (shouldEmitWhitespaceBeforeOperand(node)) {
                 writeSpace();
             }
-            emitExpression(node.operand);
+            emitExpression(node.operand, parenthesizer.parenthesizeOperandOfPrefixUnary);
         }
         function shouldEmitWhitespaceBeforeOperand(node) {
             // In some cases, we need to emit a space between the operator and the operand. One obvious case
@@ -102501,84 +109463,101 @@ var ts;
             // expression a prefix increment whose operand is a plus expression - (++(+x))
             // The same is true of minus of course.
             var operand = node.operand;
-            return operand.kind === 214 /* PrefixUnaryExpression */
+            return operand.kind === 218 /* PrefixUnaryExpression */
                 && ((node.operator === 39 /* PlusToken */ && (operand.operator === 39 /* PlusToken */ || operand.operator === 45 /* PlusPlusToken */))
                     || (node.operator === 40 /* MinusToken */ && (operand.operator === 40 /* MinusToken */ || operand.operator === 46 /* MinusMinusToken */)));
         }
         function emitPostfixUnaryExpression(node) {
-            emitExpression(node.operand);
+            emitExpression(node.operand, parenthesizer.parenthesizeOperandOfPostfixUnary);
             writeTokenText(node.operator, writeOperator);
         }
-        var EmitBinaryExpressionState;
-        (function (EmitBinaryExpressionState) {
-            EmitBinaryExpressionState[EmitBinaryExpressionState["EmitLeft"] = 0] = "EmitLeft";
-            EmitBinaryExpressionState[EmitBinaryExpressionState["EmitRight"] = 1] = "EmitRight";
-            EmitBinaryExpressionState[EmitBinaryExpressionState["FinishEmit"] = 2] = "FinishEmit";
-        })(EmitBinaryExpressionState || (EmitBinaryExpressionState = {}));
-        /**
-         * emitBinaryExpression includes an embedded work stack to attempt to handle as many nested binary expressions
-         * as possible without creating any additional stack frames. This can only be done when the emit pipeline does
-         * not require notification/substitution/comment/sourcemap decorations.
-         */
-        function emitBinaryExpression(node) {
-            var nodeStack = [node];
-            var stateStack = [0 /* EmitLeft */];
-            var stackIndex = 0;
-            while (stackIndex >= 0) {
-                node = nodeStack[stackIndex];
-                switch (stateStack[stackIndex]) {
-                    case 0 /* EmitLeft */: {
-                        maybePipelineEmitExpression(node.left);
-                        break;
-                    }
-                    case 1 /* EmitRight */: {
-                        var isCommaOperator = node.operatorToken.kind !== 27 /* CommaToken */;
-                        var linesBeforeOperator = getLinesBetweenNodes(node, node.left, node.operatorToken);
-                        var linesAfterOperator = getLinesBetweenNodes(node, node.operatorToken, node.right);
-                        writeLinesAndIndent(linesBeforeOperator, isCommaOperator);
-                        emitLeadingCommentsOfPosition(node.operatorToken.pos);
-                        writeTokenNode(node.operatorToken, node.operatorToken.kind === 100 /* InKeyword */ ? writeKeyword : writeOperator);
-                        emitTrailingCommentsOfPosition(node.operatorToken.end, /*prefixSpace*/ true); // Binary operators should have a space before the comment starts
-                        writeLinesAndIndent(linesAfterOperator, /*writeSpaceIfNotIndenting*/ true);
-                        maybePipelineEmitExpression(node.right);
-                        break;
-                    }
-                    case 2 /* FinishEmit */: {
-                        var linesBeforeOperator = getLinesBetweenNodes(node, node.left, node.operatorToken);
-                        var linesAfterOperator = getLinesBetweenNodes(node, node.operatorToken, node.right);
-                        decreaseIndentIf(linesBeforeOperator, linesAfterOperator);
-                        stackIndex--;
-                        break;
-                    }
-                    default: return ts.Debug.fail("Invalid state " + stateStack[stackIndex] + " for emitBinaryExpressionWorker");
+        function createEmitBinaryExpression() {
+            return ts.createBinaryExpressionTrampoline(onEnter, onLeft, onOperator, onRight, onExit, /*foldState*/ undefined);
+            function onEnter(node, state) {
+                if (state) {
+                    state.stackIndex++;
+                    state.preserveSourceNewlinesStack[state.stackIndex] = preserveSourceNewlines;
+                    state.containerPosStack[state.stackIndex] = containerPos;
+                    state.containerEndStack[state.stackIndex] = containerEnd;
+                    state.declarationListContainerEndStack[state.stackIndex] = declarationListContainerEnd;
+                    var emitComments_1 = state.shouldEmitCommentsStack[state.stackIndex] = shouldEmitComments(node);
+                    var emitSourceMaps = state.shouldEmitSourceMapsStack[state.stackIndex] = shouldEmitSourceMaps(node);
+                    onBeforeEmitNode === null || onBeforeEmitNode === void 0 ? void 0 : onBeforeEmitNode(node);
+                    if (emitComments_1)
+                        emitCommentsBeforeNode(node);
+                    if (emitSourceMaps)
+                        emitSourceMapsBeforeNode(node);
+                    beforeEmitNode(node);
                 }
-            }
-            function maybePipelineEmitExpression(next) {
-                // Advance the state of this unit of work,
-                stateStack[stackIndex]++;
-                // Then actually do the work of emitting the node `next` returned by the prior state
-                // The following section should be identical to `pipelineEmit` save it assumes EmitHint.Expression and offloads
-                // binary expression handling, where possible, to the contained work queue
-                // #region trampolinePipelineEmit
-                var savedLastNode = lastNode;
-                var savedLastSubstitution = lastSubstitution;
-                lastNode = next;
-                lastSubstitution = undefined;
+                else {
+                    state = {
+                        stackIndex: 0,
+                        preserveSourceNewlinesStack: [undefined],
+                        containerPosStack: [-1],
+                        containerEndStack: [-1],
+                        declarationListContainerEndStack: [-1],
+                        shouldEmitCommentsStack: [false],
+                        shouldEmitSourceMapsStack: [false],
+                    };
+                }
+                return state;
+            }
+            function onLeft(next, _workArea, parent) {
+                return maybeEmitExpression(next, parent, "left");
+            }
+            function onOperator(operatorToken, _state, node) {
+                var isCommaOperator = operatorToken.kind !== 27 /* CommaToken */;
+                var linesBeforeOperator = getLinesBetweenNodes(node, node.left, operatorToken);
+                var linesAfterOperator = getLinesBetweenNodes(node, operatorToken, node.right);
+                writeLinesAndIndent(linesBeforeOperator, isCommaOperator);
+                emitLeadingCommentsOfPosition(operatorToken.pos);
+                writeTokenNode(operatorToken, operatorToken.kind === 101 /* InKeyword */ ? writeKeyword : writeOperator);
+                emitTrailingCommentsOfPosition(operatorToken.end, /*prefixSpace*/ true); // Binary operators should have a space before the comment starts
+                writeLinesAndIndent(linesAfterOperator, /*writeSpaceIfNotIndenting*/ true);
+            }
+            function onRight(next, _workArea, parent) {
+                return maybeEmitExpression(next, parent, "right");
+            }
+            function onExit(node, state) {
+                var linesBeforeOperator = getLinesBetweenNodes(node, node.left, node.operatorToken);
+                var linesAfterOperator = getLinesBetweenNodes(node, node.operatorToken, node.right);
+                decreaseIndentIf(linesBeforeOperator, linesAfterOperator);
+                if (state.stackIndex > 0) {
+                    var savedPreserveSourceNewlines = state.preserveSourceNewlinesStack[state.stackIndex];
+                    var savedContainerPos = state.containerPosStack[state.stackIndex];
+                    var savedContainerEnd = state.containerEndStack[state.stackIndex];
+                    var savedDeclarationListContainerEnd = state.declarationListContainerEndStack[state.stackIndex];
+                    var shouldEmitComments_1 = state.shouldEmitCommentsStack[state.stackIndex];
+                    var shouldEmitSourceMaps_1 = state.shouldEmitSourceMapsStack[state.stackIndex];
+                    afterEmitNode(savedPreserveSourceNewlines);
+                    if (shouldEmitSourceMaps_1)
+                        emitSourceMapsAfterNode(node);
+                    if (shouldEmitComments_1)
+                        emitCommentsAfterNode(node, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd);
+                    onAfterEmitNode === null || onAfterEmitNode === void 0 ? void 0 : onAfterEmitNode(node);
+                    state.stackIndex--;
+                }
+            }
+            function maybeEmitExpression(next, parent, side) {
+                var parenthesizerRule = side === "left" ?
+                    parenthesizer.getParenthesizeLeftSideOfBinaryForOperator(parent.operatorToken.kind) :
+                    parenthesizer.getParenthesizeRightSideOfBinaryForOperator(parent.operatorToken.kind);
                 var pipelinePhase = getPipelinePhase(0 /* Notification */, 1 /* Expression */, next);
-                if (pipelinePhase === pipelineEmitWithHint && ts.isBinaryExpression(next)) {
-                    // If the target pipeline phase is emit directly, and the next node's also a binary expression,
-                    // skip all the intermediate indirection and push the expression directly onto the work stack
-                    stackIndex++;
-                    stateStack[stackIndex] = 0 /* EmitLeft */;
-                    nodeStack[stackIndex] = next;
+                if (pipelinePhase === pipelineEmitWithSubstitution) {
+                    ts.Debug.assertIsDefined(lastSubstitution);
+                    next = parenthesizerRule(ts.cast(lastSubstitution, ts.isExpression));
+                    pipelinePhase = getNextPipelinePhase(1 /* Substitution */, 1 /* Expression */, next);
+                    lastSubstitution = undefined;
                 }
-                else {
-                    pipelinePhase(1 /* Expression */, next);
+                if (pipelinePhase === pipelineEmitWithComments ||
+                    pipelinePhase === pipelineEmitWithSourceMaps ||
+                    pipelinePhase === pipelineEmitWithHint) {
+                    if (ts.isBinaryExpression(next)) {
+                        return next;
+                    }
                 }
-                ts.Debug.assert(lastNode === next);
-                lastNode = savedLastNode;
-                lastSubstitution = savedLastSubstitution;
-                // #endregion trampolinePipelineEmit
+                currentParenthesizerRule = parenthesizerRule;
+                pipelinePhase(1 /* Expression */, next);
             }
         }
         function emitConditionalExpression(node) {
@@ -102586,16 +109565,16 @@ var ts;
             var linesAfterQuestion = getLinesBetweenNodes(node, node.questionToken, node.whenTrue);
             var linesBeforeColon = getLinesBetweenNodes(node, node.whenTrue, node.colonToken);
             var linesAfterColon = getLinesBetweenNodes(node, node.colonToken, node.whenFalse);
-            emitExpression(node.condition);
+            emitExpression(node.condition, parenthesizer.parenthesizeConditionOfConditionalExpression);
             writeLinesAndIndent(linesBeforeQuestion, /*writeSpaceIfNotIndenting*/ true);
             emit(node.questionToken);
             writeLinesAndIndent(linesAfterQuestion, /*writeSpaceIfNotIndenting*/ true);
-            emitExpression(node.whenTrue);
+            emitExpression(node.whenTrue, parenthesizer.parenthesizeBranchOfConditionalExpression);
             decreaseIndentIf(linesBeforeQuestion, linesAfterQuestion);
             writeLinesAndIndent(linesBeforeColon, /*writeSpaceIfNotIndenting*/ true);
             emit(node.colonToken);
             writeLinesAndIndent(linesAfterColon, /*writeSpaceIfNotIndenting*/ true);
-            emitExpression(node.whenFalse);
+            emitExpression(node.whenFalse, parenthesizer.parenthesizeBranchOfConditionalExpression);
             decreaseIndentIf(linesBeforeColon, linesAfterColon);
         }
         function emitTemplateExpression(node) {
@@ -102603,24 +109582,24 @@ var ts;
             emitList(node, node.templateSpans, 262144 /* TemplateExpressionSpans */);
         }
         function emitYieldExpression(node) {
-            emitTokenWithComment(124 /* YieldKeyword */, node.pos, writeKeyword, node);
+            emitTokenWithComment(125 /* YieldKeyword */, node.pos, writeKeyword, node);
             emit(node.asteriskToken);
-            emitExpressionWithLeadingSpace(node.expression);
+            emitExpressionWithLeadingSpace(node.expression, parenthesizer.parenthesizeExpressionForDisallowedComma);
         }
-        function emitSpreadExpression(node) {
+        function emitSpreadElement(node) {
             emitTokenWithComment(25 /* DotDotDotToken */, node.pos, writePunctuation, node);
-            emitExpression(node.expression);
+            emitExpression(node.expression, parenthesizer.parenthesizeExpressionForDisallowedComma);
         }
         function emitClassExpression(node) {
             generateNameIfNeeded(node.name);
             emitClassDeclarationOrExpression(node);
         }
         function emitExpressionWithTypeArguments(node) {
-            emitExpression(node.expression);
+            emitExpression(node.expression, parenthesizer.parenthesizeLeftSideOfAccess);
             emitTypeArguments(node, node.typeArguments);
         }
         function emitAsExpression(node) {
-            emitExpression(node.expression);
+            emitExpression(node.expression, /*parenthesizerRules*/ undefined);
             if (node.type) {
                 writeSpace();
                 writeKeyword("as");
@@ -102629,7 +109608,7 @@ var ts;
             }
         }
         function emitNonNullExpression(node) {
-            emitExpression(node.expression);
+            emitExpression(node.expression, parenthesizer.parenthesizeLeftSideOfAccess);
             writeOperator("!");
         }
         function emitMetaProperty(node) {
@@ -102672,7 +109651,7 @@ var ts;
             }
         }
         function emitExpressionStatement(node) {
-            emitExpression(node.expression);
+            emitExpression(node.expression, parenthesizer.parenthesizeExpressionOfExpressionStatement);
             // Emit semicolon in non json files
             // or if json file that created synthesized expression(eg.define expression statement when --out and amd code generation)
             if (!ts.isJsonSourceFile(currentSourceFile) || ts.nodeIsSynthesized(node.expression)) {
@@ -102680,7 +109659,7 @@ var ts;
             }
         }
         function emitIfStatement(node) {
-            var openParenPos = emitTokenWithComment(98 /* IfKeyword */, node.pos, writeKeyword, node);
+            var openParenPos = emitTokenWithComment(99 /* IfKeyword */, node.pos, writeKeyword, node);
             writeSpace();
             emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node);
             emitExpression(node.expression);
@@ -102688,8 +109667,8 @@ var ts;
             emitEmbeddedStatement(node, node.thenStatement);
             if (node.elseStatement) {
                 writeLineOrSpace(node, node.thenStatement, node.elseStatement);
-                emitTokenWithComment(90 /* ElseKeyword */, node.thenStatement.end, writeKeyword, node);
-                if (node.elseStatement.kind === 234 /* IfStatement */) {
+                emitTokenWithComment(91 /* ElseKeyword */, node.thenStatement.end, writeKeyword, node);
+                if (node.elseStatement.kind === 238 /* IfStatement */) {
                     writeSpace();
                     emit(node.elseStatement);
                 }
@@ -102699,14 +109678,14 @@ var ts;
             }
         }
         function emitWhileClause(node, startPos) {
-            var openParenPos = emitTokenWithComment(114 /* WhileKeyword */, startPos, writeKeyword, node);
+            var openParenPos = emitTokenWithComment(115 /* WhileKeyword */, startPos, writeKeyword, node);
             writeSpace();
             emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node);
             emitExpression(node.expression);
             emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node);
         }
         function emitDoStatement(node) {
-            emitTokenWithComment(89 /* DoKeyword */, node.pos, writeKeyword, node);
+            emitTokenWithComment(90 /* DoKeyword */, node.pos, writeKeyword, node);
             emitEmbeddedStatement(node, node.statement);
             if (ts.isBlock(node.statement) && !preserveSourceNewlines) {
                 writeSpace();
@@ -102722,7 +109701,7 @@ var ts;
             emitEmbeddedStatement(node, node.statement);
         }
         function emitForStatement(node) {
-            var openParenPos = emitTokenWithComment(96 /* ForKeyword */, node.pos, writeKeyword, node);
+            var openParenPos = emitTokenWithComment(97 /* ForKeyword */, node.pos, writeKeyword, node);
             writeSpace();
             var pos = emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, /*contextNode*/ node);
             emitForBinding(node.initializer);
@@ -102734,25 +109713,25 @@ var ts;
             emitEmbeddedStatement(node, node.statement);
         }
         function emitForInStatement(node) {
-            var openParenPos = emitTokenWithComment(96 /* ForKeyword */, node.pos, writeKeyword, node);
+            var openParenPos = emitTokenWithComment(97 /* ForKeyword */, node.pos, writeKeyword, node);
             writeSpace();
             emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node);
             emitForBinding(node.initializer);
             writeSpace();
-            emitTokenWithComment(100 /* InKeyword */, node.initializer.end, writeKeyword, node);
+            emitTokenWithComment(101 /* InKeyword */, node.initializer.end, writeKeyword, node);
             writeSpace();
             emitExpression(node.expression);
             emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node);
             emitEmbeddedStatement(node, node.statement);
         }
         function emitForOfStatement(node) {
-            var openParenPos = emitTokenWithComment(96 /* ForKeyword */, node.pos, writeKeyword, node);
+            var openParenPos = emitTokenWithComment(97 /* ForKeyword */, node.pos, writeKeyword, node);
             writeSpace();
             emitWithTrailingSpace(node.awaitModifier);
             emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node);
             emitForBinding(node.initializer);
             writeSpace();
-            emitTokenWithComment(156 /* OfKeyword */, node.initializer.end, writeKeyword, node);
+            emitTokenWithComment(159 /* OfKeyword */, node.initializer.end, writeKeyword, node);
             writeSpace();
             emitExpression(node.expression);
             emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node);
@@ -102760,7 +109739,7 @@ var ts;
         }
         function emitForBinding(node) {
             if (node !== undefined) {
-                if (node.kind === 250 /* VariableDeclarationList */) {
+                if (node.kind === 254 /* VariableDeclarationList */) {
                     emit(node);
                 }
                 else {
@@ -102769,12 +109748,12 @@ var ts;
             }
         }
         function emitContinueStatement(node) {
-            emitTokenWithComment(85 /* ContinueKeyword */, node.pos, writeKeyword, node);
+            emitTokenWithComment(86 /* ContinueKeyword */, node.pos, writeKeyword, node);
             emitWithLeadingSpace(node.label);
             writeTrailingSemicolon();
         }
         function emitBreakStatement(node) {
-            emitTokenWithComment(80 /* BreakKeyword */, node.pos, writeKeyword, node);
+            emitTokenWithComment(81 /* BreakKeyword */, node.pos, writeKeyword, node);
             emitWithLeadingSpace(node.label);
             writeTrailingSemicolon();
         }
@@ -102797,18 +109776,18 @@ var ts;
             }
             pos = writeTokenText(token, writer, pos);
             if (isSimilarNode && contextNode.end !== pos) {
-                var isJsxExprContext = contextNode.kind === 283 /* JsxExpression */;
+                var isJsxExprContext = contextNode.kind === 287 /* JsxExpression */;
                 emitTrailingCommentsOfPosition(pos, /*prefixSpace*/ !isJsxExprContext, /*forceNoNewline*/ isJsxExprContext);
             }
             return pos;
         }
         function emitReturnStatement(node) {
-            emitTokenWithComment(104 /* ReturnKeyword */, node.pos, writeKeyword, /*contextNode*/ node);
+            emitTokenWithComment(105 /* ReturnKeyword */, node.pos, writeKeyword, /*contextNode*/ node);
             emitExpressionWithLeadingSpace(node.expression);
             writeTrailingSemicolon();
         }
         function emitWithStatement(node) {
-            var openParenPos = emitTokenWithComment(115 /* WithKeyword */, node.pos, writeKeyword, node);
+            var openParenPos = emitTokenWithComment(116 /* WithKeyword */, node.pos, writeKeyword, node);
             writeSpace();
             emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node);
             emitExpression(node.expression);
@@ -102816,7 +109795,7 @@ var ts;
             emitEmbeddedStatement(node, node.statement);
         }
         function emitSwitchStatement(node) {
-            var openParenPos = emitTokenWithComment(106 /* SwitchKeyword */, node.pos, writeKeyword, node);
+            var openParenPos = emitTokenWithComment(107 /* SwitchKeyword */, node.pos, writeKeyword, node);
             writeSpace();
             emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node);
             emitExpression(node.expression);
@@ -102831,12 +109810,12 @@ var ts;
             emit(node.statement);
         }
         function emitThrowStatement(node) {
-            emitTokenWithComment(108 /* ThrowKeyword */, node.pos, writeKeyword, node);
+            emitTokenWithComment(109 /* ThrowKeyword */, node.pos, writeKeyword, node);
             emitExpressionWithLeadingSpace(node.expression);
             writeTrailingSemicolon();
         }
         function emitTryStatement(node) {
-            emitTokenWithComment(110 /* TryKeyword */, node.pos, writeKeyword, node);
+            emitTokenWithComment(111 /* TryKeyword */, node.pos, writeKeyword, node);
             writeSpace();
             emit(node.tryBlock);
             if (node.catchClause) {
@@ -102845,13 +109824,13 @@ var ts;
             }
             if (node.finallyBlock) {
                 writeLineOrSpace(node, node.catchClause || node.tryBlock, node.finallyBlock);
-                emitTokenWithComment(95 /* FinallyKeyword */, (node.catchClause || node.tryBlock).end, writeKeyword, node);
+                emitTokenWithComment(96 /* FinallyKeyword */, (node.catchClause || node.tryBlock).end, writeKeyword, node);
                 writeSpace();
                 emit(node.finallyBlock);
             }
         }
         function emitDebuggerStatement(node) {
-            writeToken(86 /* DebuggerKeyword */, node.pos, writeKeyword);
+            writeToken(87 /* DebuggerKeyword */, node.pos, writeKeyword);
             writeTrailingSemicolon();
         }
         //
@@ -102861,7 +109840,7 @@ var ts;
             emit(node.name);
             emit(node.exclamationToken);
             emitTypeAnnotation(node.type);
-            emitInitializer(node.initializer, node.type ? node.type.end : node.name.end, node);
+            emitInitializer(node.initializer, node.type ? node.type.end : node.name.end, node, parenthesizer.parenthesizeExpressionForDisallowedComma);
         }
         function emitVariableDeclarationList(node) {
             writeKeyword(ts.isLet(node) ? "let" : ts.isVarConst(node) ? "const" : "var");
@@ -102880,9 +109859,6 @@ var ts;
             emitIdentifierName(node.name);
             emitSignatureAndBody(node, emitSignatureHead);
         }
-        function emitBlockCallback(_hint, body) {
-            emitBlockFunctionBody(body);
-        }
         function emitSignatureAndBody(node, emitSignatureHead) {
             var body = node.body;
             if (body) {
@@ -102895,12 +109871,7 @@ var ts;
                     ts.forEach(node.parameters, generateNames);
                     generateNames(node.body);
                     emitSignatureHead(node);
-                    if (onEmitNode) {
-                        onEmitNode(4 /* Unspecified */, body, emitBlockCallback);
-                    }
-                    else {
-                        emitBlockFunctionBody(body);
-                    }
+                    emitBlockFunctionBody(body);
                     popNameGenerationScope(node);
                     if (indentedFlag) {
                         decreaseIndent();
@@ -102909,7 +109880,7 @@ var ts;
                 else {
                     emitSignatureHead(node);
                     writeSpace();
-                    emitExpression(body);
+                    emitExpression(body, parenthesizer.parenthesizeConciseBodyOfArrowFunction);
                 }
             }
             else {
@@ -102953,6 +109924,7 @@ var ts;
             return true;
         }
         function emitBlockFunctionBody(body) {
+            onBeforeEmitNode === null || onBeforeEmitNode === void 0 ? void 0 : onBeforeEmitNode(body);
             writeSpace();
             writePunctuation("{");
             increaseIndent();
@@ -102967,6 +109939,7 @@ var ts;
             }
             decreaseIndent();
             writeToken(19 /* CloseBraceToken */, body.statements.end, writePunctuation, body);
+            onAfterEmitNode === null || onAfterEmitNode === void 0 ? void 0 : onAfterEmitNode(body);
         }
         function emitBlockFunctionBodyOnSingleLine(body) {
             emitBlockFunctionBodyWorker(body, /*emitBlockFunctionBodyOnSingleLine*/ true);
@@ -102982,7 +109955,7 @@ var ts;
                 increaseIndent();
             }
             else {
-                emitList(body, body.statements, 1 /* MultiLineFunctionBodyStatements */, statementOffset);
+                emitList(body, body.statements, 1 /* MultiLineFunctionBodyStatements */, /*parenthesizerRule*/ undefined, statementOffset);
             }
         }
         function emitClassDeclaration(node) {
@@ -103057,7 +110030,7 @@ var ts;
             var body = node.body;
             if (!body)
                 return writeTrailingSemicolon();
-            while (body.kind === 256 /* ModuleDeclaration */) {
+            while (body && ts.isModuleDeclaration(body)) {
                 writePunctuation(".");
                 emit(body.name);
                 body = body.body;
@@ -103078,21 +110051,21 @@ var ts;
         }
         function emitImportEqualsDeclaration(node) {
             emitModifiers(node, node.modifiers);
-            emitTokenWithComment(99 /* ImportKeyword */, node.modifiers ? node.modifiers.end : node.pos, writeKeyword, node);
+            emitTokenWithComment(100 /* ImportKeyword */, node.modifiers ? node.modifiers.end : node.pos, writeKeyword, node);
             writeSpace();
             if (node.isTypeOnly) {
-                emitTokenWithComment(149 /* TypeKeyword */, node.pos, writeKeyword, node);
+                emitTokenWithComment(151 /* TypeKeyword */, node.pos, writeKeyword, node);
                 writeSpace();
             }
             emit(node.name);
             writeSpace();
-            emitTokenWithComment(62 /* EqualsToken */, node.name.end, writePunctuation, node);
+            emitTokenWithComment(63 /* EqualsToken */, node.name.end, writePunctuation, node);
             writeSpace();
             emitModuleReference(node.moduleReference);
             writeTrailingSemicolon();
         }
         function emitModuleReference(node) {
-            if (node.kind === 78 /* Identifier */) {
+            if (node.kind === 79 /* Identifier */) {
                 emitExpression(node);
             }
             else {
@@ -103101,20 +110074,23 @@ var ts;
         }
         function emitImportDeclaration(node) {
             emitModifiers(node, node.modifiers);
-            emitTokenWithComment(99 /* ImportKeyword */, node.modifiers ? node.modifiers.end : node.pos, writeKeyword, node);
+            emitTokenWithComment(100 /* ImportKeyword */, node.modifiers ? node.modifiers.end : node.pos, writeKeyword, node);
             writeSpace();
             if (node.importClause) {
                 emit(node.importClause);
                 writeSpace();
-                emitTokenWithComment(153 /* FromKeyword */, node.importClause.end, writeKeyword, node);
+                emitTokenWithComment(155 /* FromKeyword */, node.importClause.end, writeKeyword, node);
                 writeSpace();
             }
             emitExpression(node.moduleSpecifier);
+            if (node.assertClause) {
+                emitWithLeadingSpace(node.assertClause);
+            }
             writeTrailingSemicolon();
         }
         function emitImportClause(node) {
             if (node.isTypeOnly) {
-                emitTokenWithComment(149 /* TypeKeyword */, node.pos, writeKeyword, node);
+                emitTokenWithComment(151 /* TypeKeyword */, node.pos, writeKeyword, node);
                 writeSpace();
             }
             emit(node.name);
@@ -103127,7 +110103,7 @@ var ts;
         function emitNamespaceImport(node) {
             var asPos = emitTokenWithComment(41 /* AsteriskToken */, node.pos, writePunctuation, node);
             writeSpace();
-            emitTokenWithComment(126 /* AsKeyword */, asPos, writeKeyword, node);
+            emitTokenWithComment(127 /* AsKeyword */, asPos, writeKeyword, node);
             writeSpace();
             emit(node.name);
         }
@@ -103138,23 +110114,25 @@ var ts;
             emitImportOrExportSpecifier(node);
         }
         function emitExportAssignment(node) {
-            var nextPos = emitTokenWithComment(92 /* ExportKeyword */, node.pos, writeKeyword, node);
+            var nextPos = emitTokenWithComment(93 /* ExportKeyword */, node.pos, writeKeyword, node);
             writeSpace();
             if (node.isExportEquals) {
-                emitTokenWithComment(62 /* EqualsToken */, nextPos, writeOperator, node);
+                emitTokenWithComment(63 /* EqualsToken */, nextPos, writeOperator, node);
             }
             else {
-                emitTokenWithComment(87 /* DefaultKeyword */, nextPos, writeKeyword, node);
+                emitTokenWithComment(88 /* DefaultKeyword */, nextPos, writeKeyword, node);
             }
             writeSpace();
-            emitExpression(node.expression);
+            emitExpression(node.expression, node.isExportEquals ?
+                parenthesizer.getParenthesizeRightSideOfBinaryForOperator(63 /* EqualsToken */) :
+                parenthesizer.parenthesizeExpressionOfExportDefault);
             writeTrailingSemicolon();
         }
         function emitExportDeclaration(node) {
-            var nextPos = emitTokenWithComment(92 /* ExportKeyword */, node.pos, writeKeyword, node);
+            var nextPos = emitTokenWithComment(93 /* ExportKeyword */, node.pos, writeKeyword, node);
             writeSpace();
             if (node.isTypeOnly) {
-                nextPos = emitTokenWithComment(149 /* TypeKeyword */, nextPos, writeKeyword, node);
+                nextPos = emitTokenWithComment(151 /* TypeKeyword */, nextPos, writeKeyword, node);
                 writeSpace();
             }
             if (node.exportClause) {
@@ -103166,18 +110144,39 @@ var ts;
             if (node.moduleSpecifier) {
                 writeSpace();
                 var fromPos = node.exportClause ? node.exportClause.end : nextPos;
-                emitTokenWithComment(153 /* FromKeyword */, fromPos, writeKeyword, node);
+                emitTokenWithComment(155 /* FromKeyword */, fromPos, writeKeyword, node);
                 writeSpace();
                 emitExpression(node.moduleSpecifier);
             }
+            if (node.assertClause) {
+                emitWithLeadingSpace(node.assertClause);
+            }
             writeTrailingSemicolon();
         }
+        function emitAssertClause(node) {
+            emitTokenWithComment(129 /* AssertKeyword */, node.pos, writeKeyword, node);
+            writeSpace();
+            var elements = node.elements;
+            emitList(node, elements, 526226 /* ImportClauseEntries */);
+        }
+        function emitAssertEntry(node) {
+            emit(node.name);
+            writePunctuation(":");
+            writeSpace();
+            var value = node.value;
+            /** @see {emitPropertyAssignment} */
+            if ((ts.getEmitFlags(value) & 512 /* NoLeadingComments */) === 0) {
+                var commentRange = ts.getCommentRange(value);
+                emitTrailingCommentsOfPosition(commentRange.pos);
+            }
+            emit(value);
+        }
         function emitNamespaceExportDeclaration(node) {
-            var nextPos = emitTokenWithComment(92 /* ExportKeyword */, node.pos, writeKeyword, node);
+            var nextPos = emitTokenWithComment(93 /* ExportKeyword */, node.pos, writeKeyword, node);
             writeSpace();
-            nextPos = emitTokenWithComment(126 /* AsKeyword */, nextPos, writeKeyword, node);
+            nextPos = emitTokenWithComment(127 /* AsKeyword */, nextPos, writeKeyword, node);
             writeSpace();
-            nextPos = emitTokenWithComment(140 /* NamespaceKeyword */, nextPos, writeKeyword, node);
+            nextPos = emitTokenWithComment(142 /* NamespaceKeyword */, nextPos, writeKeyword, node);
             writeSpace();
             emit(node.name);
             writeTrailingSemicolon();
@@ -103185,7 +110184,7 @@ var ts;
         function emitNamespaceExport(node) {
             var asPos = emitTokenWithComment(41 /* AsteriskToken */, node.pos, writePunctuation, node);
             writeSpace();
-            emitTokenWithComment(126 /* AsKeyword */, asPos, writeKeyword, node);
+            emitTokenWithComment(127 /* AsKeyword */, asPos, writeKeyword, node);
             writeSpace();
             emit(node.name);
         }
@@ -103201,10 +110200,14 @@ var ts;
             writePunctuation("}");
         }
         function emitImportOrExportSpecifier(node) {
+            if (node.isTypeOnly) {
+                writeKeyword("type");
+                writeSpace();
+            }
             if (node.propertyName) {
                 emit(node.propertyName);
                 writeSpace();
-                emitTokenWithComment(126 /* AsKeyword */, node.propertyName.end, writeKeyword, node);
+                emitTokenWithComment(127 /* AsKeyword */, node.propertyName.end, writeKeyword, node);
                 writeSpace();
             }
             emit(node.name);
@@ -103306,7 +110309,7 @@ var ts;
             }
         }
         function emitJsxTagName(node) {
-            if (node.kind === 78 /* Identifier */) {
+            if (node.kind === 79 /* Identifier */) {
                 emitExpression(node);
             }
             else {
@@ -103317,13 +110320,13 @@ var ts;
         // Clauses
         //
         function emitCaseClause(node) {
-            emitTokenWithComment(81 /* CaseKeyword */, node.pos, writeKeyword, node);
+            emitTokenWithComment(82 /* CaseKeyword */, node.pos, writeKeyword, node);
             writeSpace();
-            emitExpression(node.expression);
+            emitExpression(node.expression, parenthesizer.parenthesizeExpressionForDisallowedComma);
             emitCaseOrDefaultClauseRest(node, node.statements, node.expression.end);
         }
         function emitDefaultClause(node) {
-            var pos = emitTokenWithComment(87 /* DefaultKeyword */, node.pos, writeKeyword, node);
+            var pos = emitTokenWithComment(88 /* DefaultKeyword */, node.pos, writeKeyword, node);
             emitCaseOrDefaultClauseRest(node, node.statements, pos);
         }
         function emitCaseOrDefaultClauseRest(parentNode, statements, colonPos) {
@@ -103351,7 +110354,7 @@ var ts;
             emitList(node, node.types, 528 /* HeritageClauseTypes */);
         }
         function emitCatchClause(node) {
-            var openParenPos = emitTokenWithComment(82 /* CatchKeyword */, node.pos, writeKeyword, node);
+            var openParenPos = emitTokenWithComment(83 /* CatchKeyword */, node.pos, writeKeyword, node);
             writeSpace();
             if (node.variableDeclaration) {
                 emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node);
@@ -103380,7 +110383,7 @@ var ts;
                 var commentRange = ts.getCommentRange(initializer);
                 emitTrailingCommentsOfPosition(commentRange.pos);
             }
-            emitExpression(initializer);
+            emitExpression(initializer, parenthesizer.parenthesizeExpressionForDisallowedComma);
         }
         function emitShorthandPropertyAssignment(node) {
             emit(node.name);
@@ -103388,13 +110391,13 @@ var ts;
                 writeSpace();
                 writePunctuation("=");
                 writeSpace();
-                emitExpression(node.objectAssignmentInitializer);
+                emitExpression(node.objectAssignmentInitializer, parenthesizer.parenthesizeExpressionForDisallowedComma);
             }
         }
         function emitSpreadAssignment(node) {
             if (node.expression) {
                 emitTokenWithComment(25 /* DotDotDotToken */, node.pos, writePunctuation, node);
-                emitExpression(node.expression);
+                emitExpression(node.expression, parenthesizer.parenthesizeExpressionForDisallowedComma);
             }
         }
         //
@@ -103402,7 +110405,7 @@ var ts;
         //
         function emitEnumMember(node) {
             emit(node.name);
-            emitInitializer(node.initializer, node.name.end, node);
+            emitInitializer(node.initializer, node.name.end, node, parenthesizer.parenthesizeExpressionForDisallowedComma);
         }
         //
         // JSDoc
@@ -103410,18 +110413,21 @@ var ts;
         function emitJSDoc(node) {
             write("/**");
             if (node.comment) {
-                var lines = node.comment.split(/\r\n?|\n/g);
-                for (var _a = 0, lines_2 = lines; _a < lines_2.length; _a++) {
-                    var line = lines_2[_a];
-                    writeLine();
-                    writeSpace();
-                    writePunctuation("*");
-                    writeSpace();
-                    write(line);
+                var text = ts.getTextOfJSDocComment(node.comment);
+                if (text) {
+                    var lines = text.split(/\r\n?|\n/g);
+                    for (var _a = 0, lines_2 = lines; _a < lines_2.length; _a++) {
+                        var line = lines_2[_a];
+                        writeLine();
+                        writeSpace();
+                        writePunctuation("*");
+                        writeSpace();
+                        write(line);
+                    }
                 }
             }
             if (node.tags) {
-                if (node.tags.length === 1 && node.tags[0].kind === 329 /* JSDocTypeTag */ && !node.comment) {
+                if (node.tags.length === 1 && node.tags[0].kind === 341 /* JSDocTypeTag */ && !node.comment) {
                     writeSpace();
                     emit(node.tags[0]);
                 }
@@ -103466,7 +110472,7 @@ var ts;
         function emitJSDocTypedefTag(tag) {
             emitJSDocTagName(tag.tagName);
             if (tag.typeExpression) {
-                if (tag.typeExpression.kind === 301 /* JSDocTypeExpression */) {
+                if (tag.typeExpression.kind === 307 /* JSDocTypeExpression */) {
                     emitJSDocTypeExpression(tag.typeExpression);
                 }
                 else {
@@ -103485,7 +110491,7 @@ var ts;
                 emit(tag.fullName);
             }
             emitJSDocComment(tag.comment);
-            if (tag.typeExpression && tag.typeExpression.kind === 312 /* JSDocTypeLiteral */) {
+            if (tag.typeExpression && tag.typeExpression.kind === 320 /* JSDocTypeLiteral */) {
                 emitJSDocTypeLiteral(tag.typeExpression);
             }
         }
@@ -103538,9 +110544,10 @@ var ts;
             emit(tagName);
         }
         function emitJSDocComment(comment) {
-            if (comment) {
+            var text = ts.getTextOfJSDocComment(comment);
+            if (text) {
                 writeSpace();
-                write(comment);
+                write(text);
             }
         }
         function emitJSDocTypeExpression(typeExpression) {
@@ -103596,33 +110603,33 @@ var ts;
                 writeLine();
             }
             if (currentSourceFile && currentSourceFile.moduleName) {
-                writeComment("/// <amd-module name=\"" + currentSourceFile.moduleName + "\" />");
+                writeComment("/// <amd-module name=\"".concat(currentSourceFile.moduleName, "\" />"));
                 writeLine();
             }
             if (currentSourceFile && currentSourceFile.amdDependencies) {
                 for (var _a = 0, _b = currentSourceFile.amdDependencies; _a < _b.length; _a++) {
                     var dep = _b[_a];
                     if (dep.name) {
-                        writeComment("/// <amd-dependency name=\"" + dep.name + "\" path=\"" + dep.path + "\" />");
+                        writeComment("/// <amd-dependency name=\"".concat(dep.name, "\" path=\"").concat(dep.path, "\" />"));
                     }
                     else {
-                        writeComment("/// <amd-dependency path=\"" + dep.path + "\" />");
+                        writeComment("/// <amd-dependency path=\"".concat(dep.path, "\" />"));
                     }
                     writeLine();
                 }
             }
-            for (var _c = 0, files_1 = files; _c < files_1.length; _c++) {
-                var directive = files_1[_c];
+            for (var _c = 0, files_2 = files; _c < files_2.length; _c++) {
+                var directive = files_2[_c];
                 var pos = writer.getTextPos();
-                writeComment("/// <reference path=\"" + directive.fileName + "\" />");
+                writeComment("/// <reference path=\"".concat(directive.fileName, "\" />"));
                 if (bundleFileInfo)
                     bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "reference" /* Reference */, data: directive.fileName });
                 writeLine();
             }
-            for (var _d = 0, types_25 = types; _d < types_25.length; _d++) {
-                var directive = types_25[_d];
+            for (var _d = 0, types_24 = types; _d < types_24.length; _d++) {
+                var directive = types_24[_d];
                 var pos = writer.getTextPos();
-                writeComment("/// <reference types=\"" + directive.fileName + "\" />");
+                writeComment("/// <reference types=\"".concat(directive.fileName, "\" />"));
                 if (bundleFileInfo)
                     bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "type" /* Type */, data: directive.fileName });
                 writeLine();
@@ -103630,7 +110637,7 @@ var ts;
             for (var _e = 0, libs_1 = libs; _e < libs_1.length; _e++) {
                 var directive = libs_1[_e];
                 var pos = writer.getTextPos();
-                writeComment("/// <reference lib=\"" + directive.fileName + "\" />");
+                writeComment("/// <reference lib=\"".concat(directive.fileName, "\" />"));
                 if (bundleFileInfo)
                     bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "lib" /* Lib */, data: directive.fileName });
                 writeLine();
@@ -103643,7 +110650,7 @@ var ts;
             emitHelpers(node);
             var index = ts.findIndex(statements, function (statement) { return !ts.isPrologueDirective(statement); });
             emitTripleSlashDirectivesIfNeeded(node);
-            emitList(node, statements, 1 /* MultiLine */, index === -1 ? statements.length : index);
+            emitList(node, statements, 1 /* MultiLine */, /*parenthesizerRule*/ undefined, index === -1 ? statements.length : index);
             popNameGenerationScope(node);
         }
         // Transformation nodes
@@ -103651,7 +110658,7 @@ var ts;
             emitExpression(node.expression);
         }
         function emitCommaList(node) {
-            emitExpressionList(node, node.elements, 528 /* CommaListElements */);
+            emitExpressionList(node, node.elements, 528 /* CommaListElements */, /*parenthesizerRule*/ undefined);
         }
         /**
          * Emits any prologue directives at the start of a Statement list, returning the
@@ -103797,12 +110804,12 @@ var ts;
                 emit(node);
             }
         }
-        function emitInitializer(node, equalCommentStartPos, container) {
+        function emitInitializer(node, equalCommentStartPos, container, parenthesizerRule) {
             if (node) {
                 writeSpace();
-                emitTokenWithComment(62 /* EqualsToken */, equalCommentStartPos, writeOperator, container);
+                emitTokenWithComment(63 /* EqualsToken */, equalCommentStartPos, writeOperator, container);
                 writeSpace();
-                emitExpression(node);
+                emitExpression(node, parenthesizerRule);
             }
         }
         function emitNodeWithPrefix(prefix, prefixWriter, node, emit) {
@@ -103817,10 +110824,10 @@ var ts;
                 emit(node);
             }
         }
-        function emitExpressionWithLeadingSpace(node) {
+        function emitExpressionWithLeadingSpace(node, parenthesizerRule) {
             if (node) {
                 writeSpace();
-                emitExpression(node);
+                emitExpression(node, parenthesizerRule);
             }
         }
         function emitWithTrailingSpace(node) {
@@ -103850,7 +110857,7 @@ var ts;
             emitList(parentNode, decorators, 2146305 /* Decorators */);
         }
         function emitTypeArguments(parentNode, typeArguments) {
-            emitList(parentNode, typeArguments, 53776 /* TypeArguments */);
+            emitList(parentNode, typeArguments, 53776 /* TypeArguments */, parenthesizer.parenthesizeMemberOfElementType);
         }
         function emitTypeParameters(parentNode, typeParameters) {
             if (ts.isFunctionLike(parentNode) && parentNode.typeArguments) { // Quick info uses type arguments in place of type parameters on instantiated signatures
@@ -103889,12 +110896,6 @@ var ts;
         function emitParametersForIndexSignature(parentNode, parameters) {
             emitList(parentNode, parameters, 8848 /* IndexSignatureParameters */);
         }
-        function emitList(parentNode, children, format, start, count) {
-            emitNodeList(emit, parentNode, children, format, start, count);
-        }
-        function emitExpressionList(parentNode, children, format, start, count) {
-            emitNodeList(emitExpression, parentNode, children, format, start, count); // TODO: GH#18217
-        }
         function writeDelimiter(format) {
             switch (format & 60 /* DelimitersMask */) {
                 case 0 /* None */:
@@ -103917,7 +110918,13 @@ var ts;
                     break;
             }
         }
-        function emitNodeList(emit, parentNode, children, format, start, count) {
+        function emitList(parentNode, children, format, parenthesizerRule, start, count) {
+            emitNodeList(emit, parentNode, children, format, parenthesizerRule, start, count);
+        }
+        function emitExpressionList(parentNode, children, format, parenthesizerRule, start, count) {
+            emitNodeList(emitExpression, parentNode, children, format, parenthesizerRule, start, count);
+        }
+        function emitNodeList(emit, parentNode, children, format, parenthesizerRule, start, count) {
             if (start === void 0) { start = 0; }
             if (count === void 0) { count = children ? children.length - start : 0; }
             var isUndefined = children === undefined;
@@ -103936,8 +110943,7 @@ var ts;
             }
             if (format & 15360 /* BracketsMask */) {
                 writePunctuation(getOpeningBracket(format));
-                if (isEmpty && !isUndefined) {
-                    // TODO: GH#18217
+                if (isEmpty && children) {
                     emitTrailingCommentsOfPosition(children.pos, /*prefixSpace*/ true); // Emit comments within empty bracketed lists
                 }
             }
@@ -103946,7 +110952,7 @@ var ts;
             }
             if (isEmpty) {
                 // Write a line terminator if the parent node was multi-line
-                if (format & 1 /* MultiLine */ && !(preserveSourceNewlines && ts.rangeIsOnSingleLine(parentNode, currentSourceFile))) {
+                if (format & 1 /* MultiLine */ && !(preserveSourceNewlines && (!parentNode || ts.rangeIsOnSingleLine(parentNode, currentSourceFile)))) {
                     writeLine();
                 }
                 else if (format & 256 /* SpaceBetweenBraces */ && !(format & 524288 /* NoSpaceIfEmpty */)) {
@@ -103954,6 +110960,7 @@ var ts;
                 }
             }
             else {
+                ts.Debug.type(children);
                 // Write the opening line terminator or leading whitespace.
                 var mayEmitInterveningComments = (format & 262144 /* NoInterveningComments */) === 0;
                 var shouldEmitInterveningComments = mayEmitInterveningComments;
@@ -103988,7 +110995,7 @@ var ts;
                         //          a
                         //          /* End of parameter a */ -> this comment isn't considered to be trailing comment of parameter "a" due to newline
                         //          ,
-                        if (format & 60 /* DelimitersMask */ && previousSibling.end !== parentNode.end) {
+                        if (format & 60 /* DelimitersMask */ && previousSibling.end !== (parentNode ? parentNode.end : -1)) {
                             emitLeadingCommentsOfPosition(previousSibling.end);
                         }
                         writeDelimiter(format);
@@ -104021,7 +111028,12 @@ var ts;
                         shouldEmitInterveningComments = mayEmitInterveningComments;
                     }
                     nextListElementPos = child.pos;
-                    emit(child);
+                    if (emit.length === 1) {
+                        emit(child);
+                    }
+                    else {
+                        emit(child, parenthesizerRule);
+                    }
                     if (shouldDecreaseIndentAfterEmit) {
                         decreaseIndent();
                         shouldDecreaseIndentAfterEmit = false;
@@ -104046,7 +111058,7 @@ var ts;
                 //          2
                 //          /* end of element 2 */
                 //       ];
-                if (previousSibling && parentNode.end !== previousSibling.end && (format & 60 /* DelimitersMask */) && !skipTrailingComments) {
+                if (previousSibling && (parentNode ? parentNode.end : -1) !== previousSibling.end && (format & 60 /* DelimitersMask */) && !skipTrailingComments) {
                     emitLeadingCommentsOfPosition(hasTrailingComma && (children === null || children === void 0 ? void 0 : children.end) ? children.end : previousSibling.end);
                 }
                 // Decrease the indent, if requested.
@@ -104067,8 +111079,7 @@ var ts;
                 onAfterEmitNodeArray(children);
             }
             if (format & 15360 /* BracketsMask */) {
-                if (isEmpty && !isUndefined) {
-                    // TODO: GH#18217
+                if (isEmpty && children) {
                     emitLeadingCommentsOfPosition(children.end); // Emit leading comments within empty lists
                 }
                 writePunctuation(getClosingBracket(format));
@@ -104111,6 +111122,15 @@ var ts;
         function writeProperty(s) {
             writer.writeProperty(s);
         }
+        function nonEscapingWrite(s) {
+            // This should be defined in a snippet-escaping text writer.
+            if (writer.nonEscapingWrite) {
+                writer.nonEscapingWrite(s);
+            }
+            else {
+                writer.write(s);
+            }
+        }
         function writeLine(count) {
             if (count === void 0) { count = 1; }
             for (var i = 0; i < count; i++) {
@@ -104199,7 +111219,7 @@ var ts;
                 }
                 var firstChild_1 = children[0];
                 if (firstChild_1 === undefined) {
-                    return ts.rangeIsOnSingleLine(parentNode, currentSourceFile) ? 0 : 1;
+                    return !parentNode || ts.rangeIsOnSingleLine(parentNode, currentSourceFile) ? 0 : 1;
                 }
                 if (firstChild_1.pos === nextListElementPos) {
                     // If this child starts at the beginning of a list item in a parent list, its leading
@@ -104223,7 +111243,8 @@ var ts;
                     // JsxText will be written with its leading whitespace, so don't add more manually.
                     return 0;
                 }
-                if (!ts.positionIsSynthesized(parentNode.pos) &&
+                if (parentNode &&
+                    !ts.positionIsSynthesized(parentNode.pos) &&
                     !ts.nodeIsSynthesized(firstChild_1) &&
                     (!firstChild_1.parent || ts.getOriginalNode(firstChild_1.parent) === ts.getOriginalNode(parentNode))) {
                     if (preserveSourceNewlines) {
@@ -104246,11 +111267,21 @@ var ts;
                     // JsxText will be written with its leading whitespace, so don't add more manually.
                     return 0;
                 }
-                else if (!ts.nodeIsSynthesized(previousNode) && !ts.nodeIsSynthesized(nextNode) && previousNode.parent === nextNode.parent) {
-                    if (preserveSourceNewlines) {
+                else if (!ts.nodeIsSynthesized(previousNode) && !ts.nodeIsSynthesized(nextNode)) {
+                    if (preserveSourceNewlines && siblingNodePositionsAreComparable(previousNode, nextNode)) {
                         return getEffectiveLines(function (includeComments) { return ts.getLinesBetweenRangeEndAndRangeStart(previousNode, nextNode, currentSourceFile, includeComments); });
                     }
-                    return ts.rangeEndIsOnSameLineAsRangeStart(previousNode, nextNode, currentSourceFile) ? 0 : 1;
+                    // If `preserveSourceNewlines` is `false` we do not intend to preserve the effective lines between the
+                    // previous and next node. Instead we naively check whether nodes are on separate lines within the
+                    // same node parent. If so, we intend to preserve a single line terminator. This is less precise and
+                    // expensive than checking with `preserveSourceNewlines` as above, but the goal is not to preserve the
+                    // effective source lines between two sibling nodes.
+                    else if (!preserveSourceNewlines && originalNodesHaveSameParent(previousNode, nextNode)) {
+                        return ts.rangeEndIsOnSameLineAsRangeStart(previousNode, nextNode, currentSourceFile) ? 0 : 1;
+                    }
+                    // If the two nodes are not comparable, add a line terminator based on the format that can indicate
+                    // whether new lines are preferred or not.
+                    return format & 65536 /* PreferNewLine */ ? 1 : 0;
                 }
                 else if (synthesizedNodeStartsOnNewLine(previousNode, format) || synthesizedNodeStartsOnNewLine(nextNode, format)) {
                     return 1;
@@ -104268,9 +111299,9 @@ var ts;
                 }
                 var lastChild = ts.lastOrUndefined(children);
                 if (lastChild === undefined) {
-                    return ts.rangeIsOnSingleLine(parentNode, currentSourceFile) ? 0 : 1;
+                    return !parentNode || ts.rangeIsOnSingleLine(parentNode, currentSourceFile) ? 0 : 1;
                 }
-                if (!ts.positionIsSynthesized(parentNode.pos) && !ts.nodeIsSynthesized(lastChild) && (!lastChild.parent || lastChild.parent === parentNode)) {
+                if (parentNode && !ts.positionIsSynthesized(parentNode.pos) && !ts.nodeIsSynthesized(lastChild) && (!lastChild.parent || lastChild.parent === parentNode)) {
                     if (preserveSourceNewlines) {
                         var end_1 = ts.isNodeArray(children) && !ts.positionIsSynthesized(children.end) ? children.end : lastChild.end;
                         return getEffectiveLines(function (includeComments) { return ts.getLinesBetweenPositionAndNextNonWhitespaceCharacter(end_1, parentNode.end, currentSourceFile, includeComments); });
@@ -104356,7 +111387,7 @@ var ts;
                 && ts.rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile);
         }
         function skipSynthesizedParentheses(node) {
-            while (node.kind === 207 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) {
+            while (node.kind === 211 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) {
                 node = node.expression;
             }
             return node;
@@ -104381,9 +111412,9 @@ var ts;
                 var textSourceNode = node.textSourceNode;
                 if (ts.isIdentifier(textSourceNode) || ts.isNumericLiteral(textSourceNode)) {
                     var text = ts.isNumericLiteral(textSourceNode) ? textSourceNode.text : getTextOfNode(textSourceNode);
-                    return jsxAttributeEscape ? "\"" + ts.escapeJsxAttributeString(text) + "\"" :
-                        neverAsciiEscape || (ts.getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? "\"" + ts.escapeString(text) + "\"" :
-                            "\"" + ts.escapeNonAsciiString(text) + "\"";
+                    return jsxAttributeEscape ? "\"".concat(ts.escapeJsxAttributeString(text), "\"") :
+                        neverAsciiEscape || (ts.getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? "\"".concat(ts.escapeString(text), "\"") :
+                            "\"".concat(ts.escapeNonAsciiString(text), "\"");
                 }
                 else {
                     return getLiteralTextOfNode(textSourceNode, neverAsciiEscape, jsxAttributeEscape);
@@ -104426,84 +111457,84 @@ var ts;
             if (!node)
                 return;
             switch (node.kind) {
-                case 230 /* Block */:
+                case 234 /* Block */:
                     ts.forEach(node.statements, generateNames);
                     break;
-                case 245 /* LabeledStatement */:
-                case 243 /* WithStatement */:
-                case 235 /* DoStatement */:
-                case 236 /* WhileStatement */:
+                case 249 /* LabeledStatement */:
+                case 247 /* WithStatement */:
+                case 239 /* DoStatement */:
+                case 240 /* WhileStatement */:
                     generateNames(node.statement);
                     break;
-                case 234 /* IfStatement */:
+                case 238 /* IfStatement */:
                     generateNames(node.thenStatement);
                     generateNames(node.elseStatement);
                     break;
-                case 237 /* ForStatement */:
-                case 239 /* ForOfStatement */:
-                case 238 /* ForInStatement */:
+                case 241 /* ForStatement */:
+                case 243 /* ForOfStatement */:
+                case 242 /* ForInStatement */:
                     generateNames(node.initializer);
                     generateNames(node.statement);
                     break;
-                case 244 /* SwitchStatement */:
+                case 248 /* SwitchStatement */:
                     generateNames(node.caseBlock);
                     break;
-                case 258 /* CaseBlock */:
+                case 262 /* CaseBlock */:
                     ts.forEach(node.clauses, generateNames);
                     break;
-                case 284 /* CaseClause */:
-                case 285 /* DefaultClause */:
+                case 288 /* CaseClause */:
+                case 289 /* DefaultClause */:
                     ts.forEach(node.statements, generateNames);
                     break;
-                case 247 /* TryStatement */:
+                case 251 /* TryStatement */:
                     generateNames(node.tryBlock);
                     generateNames(node.catchClause);
                     generateNames(node.finallyBlock);
                     break;
-                case 287 /* CatchClause */:
+                case 291 /* CatchClause */:
                     generateNames(node.variableDeclaration);
                     generateNames(node.block);
                     break;
-                case 232 /* VariableStatement */:
+                case 236 /* VariableStatement */:
                     generateNames(node.declarationList);
                     break;
-                case 250 /* VariableDeclarationList */:
+                case 254 /* VariableDeclarationList */:
                     ts.forEach(node.declarations, generateNames);
                     break;
-                case 249 /* VariableDeclaration */:
-                case 160 /* Parameter */:
-                case 198 /* BindingElement */:
-                case 252 /* ClassDeclaration */:
+                case 253 /* VariableDeclaration */:
+                case 163 /* Parameter */:
+                case 202 /* BindingElement */:
+                case 256 /* ClassDeclaration */:
                     generateNameIfNeeded(node.name);
                     break;
-                case 251 /* FunctionDeclaration */:
+                case 255 /* FunctionDeclaration */:
                     generateNameIfNeeded(node.name);
                     if (ts.getEmitFlags(node) & 524288 /* ReuseTempVariableScope */) {
                         ts.forEach(node.parameters, generateNames);
                         generateNames(node.body);
                     }
                     break;
-                case 196 /* ObjectBindingPattern */:
-                case 197 /* ArrayBindingPattern */:
+                case 200 /* ObjectBindingPattern */:
+                case 201 /* ArrayBindingPattern */:
                     ts.forEach(node.elements, generateNames);
                     break;
-                case 261 /* ImportDeclaration */:
+                case 265 /* ImportDeclaration */:
                     generateNames(node.importClause);
                     break;
-                case 262 /* ImportClause */:
+                case 266 /* ImportClause */:
                     generateNameIfNeeded(node.name);
                     generateNames(node.namedBindings);
                     break;
-                case 263 /* NamespaceImport */:
+                case 267 /* NamespaceImport */:
                     generateNameIfNeeded(node.name);
                     break;
-                case 269 /* NamespaceExport */:
+                case 273 /* NamespaceExport */:
                     generateNameIfNeeded(node.name);
                     break;
-                case 264 /* NamedImports */:
+                case 268 /* NamedImports */:
                     ts.forEach(node.elements, generateNames);
                     break;
-                case 265 /* ImportSpecifier */:
+                case 269 /* ImportSpecifier */:
                     generateNameIfNeeded(node.propertyName || node.name);
                     break;
             }
@@ -104512,12 +111543,12 @@ var ts;
             if (!node)
                 return;
             switch (node.kind) {
-                case 288 /* PropertyAssignment */:
-                case 289 /* ShorthandPropertyAssignment */:
-                case 163 /* PropertyDeclaration */:
-                case 165 /* MethodDeclaration */:
-                case 167 /* GetAccessor */:
-                case 168 /* SetAccessor */:
+                case 294 /* PropertyAssignment */:
+                case 295 /* ShorthandPropertyAssignment */:
+                case 166 /* PropertyDeclaration */:
+                case 168 /* MethodDeclaration */:
+                case 171 /* GetAccessor */:
+                case 172 /* SetAccessor */:
                     generateNameIfNeeded(node.name);
                     break;
             }
@@ -104697,25 +111728,25 @@ var ts;
          */
         function generateNameForNode(node, flags) {
             switch (node.kind) {
-                case 78 /* Identifier */:
+                case 79 /* Identifier */:
                     return makeUniqueName(getTextOfNode(node), isUniqueName, !!(flags & 16 /* Optimistic */), !!(flags & 8 /* ReservedInNestedScopes */));
-                case 256 /* ModuleDeclaration */:
-                case 255 /* EnumDeclaration */:
+                case 260 /* ModuleDeclaration */:
+                case 259 /* EnumDeclaration */:
                     return generateNameForModuleOrEnum(node);
-                case 261 /* ImportDeclaration */:
-                case 267 /* ExportDeclaration */:
+                case 265 /* ImportDeclaration */:
+                case 271 /* ExportDeclaration */:
                     return generateNameForImportOrExportDeclaration(node);
-                case 251 /* FunctionDeclaration */:
-                case 252 /* ClassDeclaration */:
-                case 266 /* ExportAssignment */:
+                case 255 /* FunctionDeclaration */:
+                case 256 /* ClassDeclaration */:
+                case 270 /* ExportAssignment */:
                     return generateNameForExportDefault();
-                case 221 /* ClassExpression */:
+                case 225 /* ClassExpression */:
                     return generateNameForClassExpression();
-                case 165 /* MethodDeclaration */:
-                case 167 /* GetAccessor */:
-                case 168 /* SetAccessor */:
+                case 168 /* MethodDeclaration */:
+                case 171 /* GetAccessor */:
+                case 172 /* SetAccessor */:
                     return generateNameForMethodOrAccessor(node);
-                case 158 /* ComputedPropertyName */:
+                case 161 /* ComputedPropertyName */:
                     return makeTempVariableName(0 /* Auto */, /*reserveInNestedScopes*/ true);
                 default:
                     return makeTempVariableName(0 /* Auto */);
@@ -104758,25 +111789,45 @@ var ts;
         }
         // Comments
         function pipelineEmitWithComments(hint, node) {
-            ts.Debug.assert(lastNode === node || lastSubstitution === node);
+            var pipelinePhase = getNextPipelinePhase(2 /* Comments */, hint, node);
+            var savedContainerPos = containerPos;
+            var savedContainerEnd = containerEnd;
+            var savedDeclarationListContainerEnd = declarationListContainerEnd;
+            emitCommentsBeforeNode(node);
+            pipelinePhase(hint, node);
+            emitCommentsAfterNode(node, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd);
+        }
+        function emitCommentsBeforeNode(node) {
+            var emitFlags = ts.getEmitFlags(node);
+            var commentRange = ts.getCommentRange(node);
+            // Emit leading comments
+            emitLeadingCommentsOfNode(node, emitFlags, commentRange.pos, commentRange.end);
+            if (emitFlags & 2048 /* NoNestedComments */) {
+                commentsDisabled = true;
+            }
+        }
+        function emitCommentsAfterNode(node, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd) {
+            var emitFlags = ts.getEmitFlags(node);
+            var commentRange = ts.getCommentRange(node);
+            // Emit trailing comments
+            if (emitFlags & 2048 /* NoNestedComments */) {
+                commentsDisabled = false;
+            }
+            emitTrailingCommentsOfNode(node, emitFlags, commentRange.pos, commentRange.end, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd);
+        }
+        function emitLeadingCommentsOfNode(node, emitFlags, pos, end) {
             enterComment();
             hasWrittenComment = false;
-            var emitFlags = ts.getEmitFlags(node);
-            var _a = ts.getCommentRange(node), pos = _a.pos, end = _a.end;
-            var isEmittedNode = node.kind !== 335 /* NotEmittedStatement */;
             // We have to explicitly check that the node is JsxText because if the compilerOptions.jsx is "preserve" we will not do any transformation.
             // It is expensive to walk entire tree just to set one kind of node to have no comments.
             var skipLeadingComments = pos < 0 || (emitFlags & 512 /* NoLeadingComments */) !== 0 || node.kind === 11 /* JsxText */;
             var skipTrailingComments = end < 0 || (emitFlags & 1024 /* NoTrailingComments */) !== 0 || node.kind === 11 /* JsxText */;
             // Save current container state on the stack.
-            var savedContainerPos = containerPos;
-            var savedContainerEnd = containerEnd;
-            var savedDeclarationListContainerEnd = declarationListContainerEnd;
             if ((pos > 0 || end > 0) && pos !== end) {
                 // Emit leading comments if the position is not synthesized and the node
                 // has not opted out from emitting leading comments.
                 if (!skipLeadingComments) {
-                    emitLeadingComments(pos, isEmittedNode);
+                    emitLeadingComments(pos, /*isEmittedNode*/ node.kind !== 347 /* NotEmittedStatement */);
                 }
                 if (!skipLeadingComments || (pos >= 0 && (emitFlags & 512 /* NoLeadingComments */) !== 0)) {
                     // Advance the container position if comments get emitted or if they've been disabled explicitly using NoLeadingComments.
@@ -104787,23 +111838,17 @@ var ts;
                     containerEnd = end;
                     // To avoid invalid comment emit in a down-level binding pattern, we
                     // keep track of the last declaration list container's end
-                    if (node.kind === 250 /* VariableDeclarationList */) {
+                    if (node.kind === 254 /* VariableDeclarationList */) {
                         declarationListContainerEnd = end;
                     }
                 }
             }
             ts.forEach(ts.getSyntheticLeadingComments(node), emitLeadingSynthesizedComment);
             exitComment();
-            var pipelinePhase = getNextPipelinePhase(2 /* Comments */, hint, node);
-            if (emitFlags & 2048 /* NoNestedComments */) {
-                commentsDisabled = true;
-                pipelinePhase(hint, node);
-                commentsDisabled = false;
-            }
-            else {
-                pipelinePhase(hint, node);
-            }
+        }
+        function emitTrailingCommentsOfNode(node, emitFlags, pos, end, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd) {
             enterComment();
+            var skipTrailingComments = end < 0 || (emitFlags & 1024 /* NoTrailingComments */) !== 0 || node.kind === 11 /* JsxText */;
             ts.forEach(ts.getSyntheticTrailingComments(node), emitTrailingSynthesizedComment);
             if ((pos > 0 || end > 0) && pos !== end) {
                 // Restore previous container state.
@@ -104812,12 +111857,11 @@ var ts;
                 declarationListContainerEnd = savedDeclarationListContainerEnd;
                 // Emit trailing comments if the position is not synthesized and the node
                 // has not opted out from emitting leading comments and is an emitted node.
-                if (!skipTrailingComments && isEmittedNode) {
+                if (!skipTrailingComments && node.kind !== 347 /* NotEmittedStatement */) {
                     emitTrailingComments(end);
                 }
             }
             exitComment();
-            ts.Debug.assert(lastNode === node || lastSubstitution === node);
         }
         function emitLeadingSynthesizedComment(comment) {
             if (comment.hasLeadingNewline || comment.kind === 2 /* SingleLineCommentTrivia */) {
@@ -104847,8 +111891,8 @@ var ts;
         }
         function formatSynthesizedComment(comment) {
             return comment.kind === 3 /* MultiLineCommentTrivia */
-                ? "/*" + comment.text + "*/"
-                : "//" + comment.text;
+                ? "/*".concat(comment.text, "*/")
+                : "//".concat(comment.text);
         }
         function emitBodyWithDetachedComments(node, detachedRange, emitCallback) {
             enterComment();
@@ -104877,6 +111921,26 @@ var ts;
             }
             exitComment();
         }
+        function originalNodesHaveSameParent(nodeA, nodeB) {
+            nodeA = ts.getOriginalNode(nodeA);
+            // For performance, do not call `getOriginalNode` for `nodeB` if `nodeA` doesn't even
+            // have a parent node.
+            return nodeA.parent && nodeA.parent === ts.getOriginalNode(nodeB).parent;
+        }
+        function siblingNodePositionsAreComparable(previousNode, nextNode) {
+            if (nextNode.pos < previousNode.end) {
+                return false;
+            }
+            previousNode = ts.getOriginalNode(previousNode);
+            nextNode = ts.getOriginalNode(nextNode);
+            var parent = previousNode.parent;
+            if (!parent || parent !== nextNode.parent) {
+                return false;
+            }
+            var parentNodeArray = ts.getContainingNodeArray(previousNode);
+            var prevNodeIndex = parentNodeArray === null || parentNodeArray === void 0 ? void 0 : parentNodeArray.indexOf(previousNode);
+            return prevNodeIndex !== undefined && prevNodeIndex > -1 && parentNodeArray.indexOf(nextNode) === prevNodeIndex + 1;
+        }
         function emitLeadingComments(pos, isEmittedNode) {
             hasWrittenComment = false;
             if (isEmittedNode) {
@@ -105049,42 +112113,49 @@ var ts;
             }
             return node.parsedSourceMap || undefined;
         }
-        function pipelineEmitWithSourceMap(hint, node) {
-            ts.Debug.assert(lastNode === node || lastSubstitution === node);
+        function pipelineEmitWithSourceMaps(hint, node) {
             var pipelinePhase = getNextPipelinePhase(3 /* SourceMaps */, hint, node);
-            if (ts.isUnparsedSource(node) || ts.isUnparsedPrepend(node)) {
-                pipelinePhase(hint, node);
-            }
-            else if (ts.isUnparsedNode(node)) {
+            emitSourceMapsBeforeNode(node);
+            pipelinePhase(hint, node);
+            emitSourceMapsAfterNode(node);
+        }
+        function emitSourceMapsBeforeNode(node) {
+            var emitFlags = ts.getEmitFlags(node);
+            var sourceMapRange = ts.getSourceMapRange(node);
+            // Emit leading sourcemap
+            if (ts.isUnparsedNode(node)) {
+                ts.Debug.assertIsDefined(node.parent, "UnparsedNodes must have parent pointers");
                 var parsed = getParsedSourceMap(node.parent);
                 if (parsed && sourceMapGenerator) {
                     sourceMapGenerator.appendSourceMap(writer.getLine(), writer.getColumn(), parsed, node.parent.sourceMapPath, node.parent.getLineAndCharacterOfPosition(node.pos), node.parent.getLineAndCharacterOfPosition(node.end));
                 }
-                pipelinePhase(hint, node);
             }
             else {
-                var _a = ts.getSourceMapRange(node), pos = _a.pos, end = _a.end, _b = _a.source, source = _b === void 0 ? sourceMapSource : _b;
-                var emitFlags = ts.getEmitFlags(node);
-                if (node.kind !== 335 /* NotEmittedStatement */
+                var source = sourceMapRange.source || sourceMapSource;
+                if (node.kind !== 347 /* NotEmittedStatement */
                     && (emitFlags & 16 /* NoLeadingSourceMap */) === 0
-                    && pos >= 0) {
-                    emitSourcePos(source, skipSourceTrivia(source, pos));
+                    && sourceMapRange.pos >= 0) {
+                    emitSourcePos(sourceMapRange.source || sourceMapSource, skipSourceTrivia(source, sourceMapRange.pos));
                 }
                 if (emitFlags & 64 /* NoNestedSourceMaps */) {
                     sourceMapsDisabled = true;
-                    pipelinePhase(hint, node);
-                    sourceMapsDisabled = false;
                 }
-                else {
-                    pipelinePhase(hint, node);
+            }
+        }
+        function emitSourceMapsAfterNode(node) {
+            var emitFlags = ts.getEmitFlags(node);
+            var sourceMapRange = ts.getSourceMapRange(node);
+            // Emit trailing sourcemap
+            if (!ts.isUnparsedNode(node)) {
+                if (emitFlags & 64 /* NoNestedSourceMaps */) {
+                    sourceMapsDisabled = false;
                 }
-                if (node.kind !== 335 /* NotEmittedStatement */
+                if (node.kind !== 347 /* NotEmittedStatement */
                     && (emitFlags & 32 /* NoTrailingSourceMap */) === 0
-                    && end >= 0) {
-                    emitSourcePos(sourceend);
+                    && sourceMapRange.end >= 0) {
+                    emitSourcePos(sourceMapRange.source || sourceMapSource, sourceMapRange.end);
                 }
             }
-            ts.Debug.assert(lastNode === node || lastSubstitution === node);
         }
         /**
          * Skips trivia such as comments and white-space that can be optionally overridden by the source-map source
@@ -105236,12 +112307,22 @@ var ts;
             return ts.getBaseFileName(ts.normalizePath(fileName));
         }
         function createCachedFileSystemEntries(rootDir, rootDirPath) {
-            var resultFromHost = {
-                files: ts.map(host.readDirectory(rootDir, /*extensions*/ undefined, /*exclude*/ undefined, /*include*/ ["*.*"]), getBaseNameOfFileName) || [],
-                directories: host.getDirectories(rootDir) || []
-            };
-            cachedReadDirectoryResult.set(ts.ensureTrailingDirectorySeparator(rootDirPath), resultFromHost);
-            return resultFromHost;
+            var _a;
+            if (!host.realpath || ts.ensureTrailingDirectorySeparator(toPath(host.realpath(rootDir))) === rootDirPath) {
+                var resultFromHost = {
+                    files: ts.map(host.readDirectory(rootDir, /*extensions*/ undefined, /*exclude*/ undefined, /*include*/ ["*.*"]), getBaseNameOfFileName) || [],
+                    directories: host.getDirectories(rootDir) || []
+                };
+                cachedReadDirectoryResult.set(ts.ensureTrailingDirectorySeparator(rootDirPath), resultFromHost);
+                return resultFromHost;
+            }
+            // If the directory is symlink do not cache the result
+            if ((_a = host.directoryExists) === null || _a === void 0 ? void 0 : _a.call(host, rootDir)) {
+                cachedReadDirectoryResult.set(rootDirPath, false);
+                return false;
+            }
+            // Non existing directory
+            return undefined;
         }
         /**
          * If the readDirectory result was already cached, it returns that
@@ -105316,17 +112397,32 @@ var ts;
         }
         function readDirectory(rootDir, extensions, excludes, includes, depth) {
             var rootDirPath = toPath(rootDir);
-            var result = tryReadDirectory(rootDir, rootDirPath);
-            if (result) {
+            var rootResult = tryReadDirectory(rootDir, rootDirPath);
+            var rootSymLinkResult;
+            if (rootResult !== undefined) {
                 return ts.matchFiles(rootDir, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries, realpath);
             }
             return host.readDirectory(rootDir, extensions, excludes, includes, depth);
             function getFileSystemEntries(dir) {
                 var path = toPath(dir);
                 if (path === rootDirPath) {
-                    return result;
-                }
-                return tryReadDirectory(dir, path) || ts.emptyFileSystemEntries;
+                    return rootResult || getFileSystemEntriesFromHost(dir, path);
+                }
+                var result = tryReadDirectory(dir, path);
+                return result !== undefined ?
+                    result || getFileSystemEntriesFromHost(dir, path) :
+                    ts.emptyFileSystemEntries;
+            }
+            function getFileSystemEntriesFromHost(dir, path) {
+                if (rootSymLinkResult && path === rootDirPath)
+                    return rootSymLinkResult;
+                var result = {
+                    files: ts.map(host.readDirectory(dir, /*extensions*/ undefined, /*exclude*/ undefined, /*include*/ ["*.*"]), getBaseNameOfFileName) || ts.emptyArray,
+                    directories: host.getDirectories(dir) || ts.emptyArray
+                };
+                if (path === rootDirPath)
+                    rootSymLinkResult = result;
+                return result;
             }
         }
         function realpath(s) {
@@ -105334,7 +112430,7 @@ var ts;
         }
         function addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath) {
             var existingResult = getCachedFileSystemEntries(fileOrDirectoryPath);
-            if (existingResult) {
+            if (existingResult !== undefined) {
                 // Just clear the cache for now
                 // For now just clear the cache, since this could mean that multiple level entries might need to be re-evaluated
                 clearCache();
@@ -105394,9 +112490,9 @@ var ts;
     /**
      * Updates the map of shared extended config file watches with a new set of extended config files from a base config file of the project
      */
-    function updateSharedExtendedConfigFileWatcher(projectPath, parsed, extendedConfigFilesMap, createExtendedConfigFileWatch, toPath) {
+    function updateSharedExtendedConfigFileWatcher(projectPath, options, extendedConfigFilesMap, createExtendedConfigFileWatch, toPath) {
         var _a;
-        var extendedConfigs = ts.arrayToMap(((_a = parsed === null || parsed === void 0 ? void 0 : parsed.options.configFile) === null || _a === void 0 ? void 0 : _a.extendedSourceFiles) || ts.emptyArray, toPath);
+        var extendedConfigs = ts.arrayToMap(((_a = options === null || options === void 0 ? void 0 : options.configFile) === null || _a === void 0 ? void 0 : _a.extendedSourceFiles) || ts.emptyArray, toPath);
         // remove project from all unrelated watchers
         extendedConfigFilesMap.forEach(function (watcher, extendedConfigFilePath) {
             if (!extendedConfigs.has(extendedConfigFilePath)) {
@@ -105414,12 +112510,12 @@ var ts;
                 // start watching previously unseen extended config
                 extendedConfigFilesMap.set(extendedConfigFilePath, {
                     projects: new ts.Set([projectPath]),
-                    fileWatcher: createExtendedConfigFileWatch(extendedConfigFileName, extendedConfigFilePath),
+                    watcher: createExtendedConfigFileWatch(extendedConfigFileName, extendedConfigFilePath),
                     close: function () {
                         var existing = extendedConfigFilesMap.get(extendedConfigFilePath);
                         if (!existing || existing.projects.size !== 0)
                             return;
-                        existing.fileWatcher.close();
+                        existing.watcher.close();
                         extendedConfigFilesMap.delete(extendedConfigFilePath);
                     },
                 });
@@ -105427,6 +112523,42 @@ var ts;
         });
     }
     ts.updateSharedExtendedConfigFileWatcher = updateSharedExtendedConfigFileWatcher;
+    /**
+     * Remove the project from the extended config file watchers and close not needed watches
+     */
+    function clearSharedExtendedConfigFileWatcher(projectPath, extendedConfigFilesMap) {
+        extendedConfigFilesMap.forEach(function (watcher) {
+            if (watcher.projects.delete(projectPath))
+                watcher.close();
+        });
+    }
+    ts.clearSharedExtendedConfigFileWatcher = clearSharedExtendedConfigFileWatcher;
+    /**
+     * Clean the extendsConfigCache when extended config file has changed
+     */
+    function cleanExtendedConfigCache(extendedConfigCache, extendedConfigFilePath, toPath) {
+        if (!extendedConfigCache.delete(extendedConfigFilePath))
+            return;
+        extendedConfigCache.forEach(function (_a, key) {
+            var _b;
+            var extendedResult = _a.extendedResult;
+            if ((_b = extendedResult.extendedSourceFiles) === null || _b === void 0 ? void 0 : _b.some(function (extendedFile) { return toPath(extendedFile) === extendedConfigFilePath; })) {
+                cleanExtendedConfigCache(extendedConfigCache, key, toPath);
+            }
+        });
+    }
+    ts.cleanExtendedConfigCache = cleanExtendedConfigCache;
+    /**
+     * Updates watchers based on the package json files used in module resolution
+     */
+    function updatePackageJsonWatch(lookups, packageJsonWatches, createPackageJsonWatch) {
+        var newMap = new ts.Map(lookups);
+        ts.mutateMap(packageJsonWatches, newMap, {
+            createNewValue: createPackageJsonWatch,
+            onDeleteValue: ts.closeFileWatcher
+        });
+    }
+    ts.updatePackageJsonWatch = updatePackageJsonWatch;
     /**
      * Updates the existing missing file watches with the new set of missing files after new program is created
      */
@@ -105478,10 +112610,10 @@ var ts;
     ts.updateWatchingWildcardDirectories = updateWatchingWildcardDirectories;
     /* @internal */
     function isIgnoredFileFromWildCardWatching(_a) {
-        var watchedDirPath = _a.watchedDirPath, fileOrDirectory = _a.fileOrDirectory, fileOrDirectoryPath = _a.fileOrDirectoryPath, configFileName = _a.configFileName, options = _a.options, program = _a.program, extraFileExtensions = _a.extraFileExtensions, currentDirectory = _a.currentDirectory, useCaseSensitiveFileNames = _a.useCaseSensitiveFileNames, writeLog = _a.writeLog;
+        var watchedDirPath = _a.watchedDirPath, fileOrDirectory = _a.fileOrDirectory, fileOrDirectoryPath = _a.fileOrDirectoryPath, configFileName = _a.configFileName, options = _a.options, program = _a.program, extraFileExtensions = _a.extraFileExtensions, currentDirectory = _a.currentDirectory, useCaseSensitiveFileNames = _a.useCaseSensitiveFileNames, writeLog = _a.writeLog, toPath = _a.toPath;
         var newPath = ts.removeIgnoredPath(fileOrDirectoryPath);
         if (!newPath) {
-            writeLog("Project: " + configFileName + " Detected ignored path: " + fileOrDirectory);
+            writeLog("Project: ".concat(configFileName, " Detected ignored path: ").concat(fileOrDirectory));
             return true;
         }
         fileOrDirectoryPath = newPath;
@@ -105490,18 +112622,18 @@ var ts;
         // If the the added or created file or directory is not supported file name, ignore the file
         // But when watched directory is added/removed, we need to reload the file list
         if (ts.hasExtension(fileOrDirectoryPath) && !ts.isSupportedSourceFileName(fileOrDirectory, options, extraFileExtensions)) {
-            writeLog("Project: " + configFileName + " Detected file add/remove of non supported extension: " + fileOrDirectory);
+            writeLog("Project: ".concat(configFileName, " Detected file add/remove of non supported extension: ").concat(fileOrDirectory));
             return true;
         }
         if (ts.isExcludedFile(fileOrDirectory, options.configFile.configFileSpecs, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), currentDirectory), useCaseSensitiveFileNames, currentDirectory)) {
-            writeLog("Project: " + configFileName + " Detected excluded file: " + fileOrDirectory);
+            writeLog("Project: ".concat(configFileName, " Detected excluded file: ").concat(fileOrDirectory));
             return true;
         }
         if (!program)
             return false;
         // We want to ignore emit file check if file is not going to be emitted next to source file
         // In that case we follow config file inclusion rules
-        if (options.outFile || options.outDir)
+        if (ts.outFile(options) || options.outDir)
             return false;
         // File if emitted next to input needs to be ignored
         if (ts.fileExtensionIs(fileOrDirectoryPath, ".d.ts" /* Dts */)) {
@@ -105509,22 +112641,25 @@ var ts;
             if (options.declarationDir)
                 return false;
         }
-        else if (!ts.fileExtensionIsOneOf(fileOrDirectoryPath, ts.supportedJSExtensions)) {
+        else if (!ts.fileExtensionIsOneOf(fileOrDirectoryPath, ts.supportedJSExtensionsFlat)) {
             return false;
         }
         // just check if sourceFile with the name exists
         var filePathWithoutExtension = ts.removeFileExtension(fileOrDirectoryPath);
-        var realProgram = isBuilderProgram(program) ? program.getProgramOrUndefined() : program;
+        var realProgram = ts.isArray(program) ? undefined : isBuilderProgram(program) ? program.getProgramOrUndefined() : program;
+        var builderProgram = !realProgram && !ts.isArray(program) ? program : undefined;
         if (hasSourceFile((filePathWithoutExtension + ".ts" /* Ts */)) ||
             hasSourceFile((filePathWithoutExtension + ".tsx" /* Tsx */))) {
-            writeLog("Project: " + configFileName + " Detected output file: " + fileOrDirectory);
+            writeLog("Project: ".concat(configFileName, " Detected output file: ").concat(fileOrDirectory));
             return true;
         }
         return false;
         function hasSourceFile(file) {
             return realProgram ?
                 !!realProgram.getSourceFileByPath(file) :
-                program.getState().fileInfos.has(file);
+                builderProgram ?
+                    builderProgram.getState().fileInfos.has(file) :
+                    !!ts.find(program, function (rootFile) { return toPath(rootFile) === file; });
         }
     }
     ts.isIgnoredFileFromWildCardWatching = isIgnoredFileFromWildCardWatching;
@@ -105583,36 +112718,36 @@ var ts;
                 host.useCaseSensitiveFileNames();
         }
         function createExcludeWatcherWithLogging(file, flags, options, detailInfo1, detailInfo2) {
-            log("ExcludeWatcher:: Added:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
+            log("ExcludeWatcher:: Added:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)));
             return {
-                close: function () { return log("ExcludeWatcher:: Close:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)); }
+                close: function () { return log("ExcludeWatcher:: Close:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo))); }
             };
         }
         function createFileWatcherWithLogging(file, cb, flags, options, detailInfo1, detailInfo2) {
-            log("FileWatcher:: Added:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
+            log("FileWatcher:: Added:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)));
             var watcher = triggerInvokingFactory.watchFile(file, cb, flags, options, detailInfo1, detailInfo2);
             return {
                 close: function () {
-                    log("FileWatcher:: Close:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
+                    log("FileWatcher:: Close:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)));
                     watcher.close();
                 }
             };
         }
         function createDirectoryWatcherWithLogging(file, cb, flags, options, detailInfo1, detailInfo2) {
-            var watchInfo = "DirectoryWatcher:: Added:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo);
+            var watchInfo = "DirectoryWatcher:: Added:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
             log(watchInfo);
             var start = ts.timestamp();
             var watcher = triggerInvokingFactory.watchDirectory(file, cb, flags, options, detailInfo1, detailInfo2);
             var elapsed = ts.timestamp() - start;
-            log("Elapsed:: " + elapsed + "ms " + watchInfo);
+            log("Elapsed:: ".concat(elapsed, "ms ").concat(watchInfo));
             return {
                 close: function () {
-                    var watchInfo = "DirectoryWatcher:: Close:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo);
+                    var watchInfo = "DirectoryWatcher:: Close:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
                     log(watchInfo);
                     var start = ts.timestamp();
                     watcher.close();
                     var elapsed = ts.timestamp() - start;
-                    log("Elapsed:: " + elapsed + "ms " + watchInfo);
+                    log("Elapsed:: ".concat(elapsed, "ms ").concat(watchInfo));
                 }
             };
         }
@@ -105622,16 +112757,16 @@ var ts;
                 for (var _i = 0; _i < arguments.length; _i++) {
                     args[_i] = arguments[_i];
                 }
-                var triggerredInfo = (key === "watchFile" ? "FileWatcher" : "DirectoryWatcher") + ":: Triggered with " + args[0] + " " + (args[1] !== undefined ? args[1] : "") + ":: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo);
+                var triggerredInfo = "".concat(key === "watchFile" ? "FileWatcher" : "DirectoryWatcher", ":: Triggered with ").concat(args[0], " ").concat(args[1] !== undefined ? args[1] : "", ":: ").concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
                 log(triggerredInfo);
                 var start = ts.timestamp();
-                cb.call.apply(cb, __spreadArray([/*thisArg*/ undefined], args));
+                cb.call.apply(cb, __spreadArray([/*thisArg*/ undefined], args, false));
                 var elapsed = ts.timestamp() - start;
-                log("Elapsed:: " + elapsed + "ms " + triggerredInfo);
+                log("Elapsed:: ".concat(elapsed, "ms ").concat(triggerredInfo));
             }, flags, options, detailInfo1, detailInfo2); };
         }
         function getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo) {
-            return "WatchInfo: " + file + " " + flags + " " + JSON.stringify(options) + " " + (getDetailWatchInfo ? getDetailWatchInfo(detailInfo1, detailInfo2) : detailInfo2 === undefined ? detailInfo1 : detailInfo1 + " " + detailInfo2);
+            return "WatchInfo: ".concat(file, " ").concat(flags, " ").concat(JSON.stringify(options), " ").concat(getDetailWatchInfo ? getDetailWatchInfo(detailInfo1, detailInfo2) : detailInfo2 === undefined ? detailInfo1 : "".concat(detailInfo1, " ").concat(detailInfo2));
         }
     }
     ts.getWatchFactory = getWatchFactory;
@@ -105938,12 +113073,12 @@ var ts;
     }
     ts.formatDiagnostics = formatDiagnostics;
     function formatDiagnostic(diagnostic, host) {
-        var errorMessage = ts.diagnosticCategoryName(diagnostic) + " TS" + diagnostic.code + ": " + flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine()) + host.getNewLine();
+        var errorMessage = "".concat(ts.diagnosticCategoryName(diagnostic), " TS").concat(diagnostic.code, ": ").concat(flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine())).concat(host.getNewLine());
         if (diagnostic.file) {
             var _a = ts.getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start), line = _a.line, character = _a.character; // TODO: GH#18217
             var fileName = diagnostic.file.fileName;
             var relativeFileName = ts.convertToRelativePath(fileName, host.getCurrentDirectory(), function (fileName) { return host.getCanonicalFileName(fileName); });
-            return relativeFileName + "(" + (line + 1) + "," + (character + 1) + "): " + errorMessage;
+            return "".concat(relativeFileName, "(").concat(line + 1, ",").concat(character + 1, "): ") + errorMessage;
         }
         return errorMessage;
     }
@@ -105997,7 +113132,7 @@ var ts;
             var lineStart = ts.getPositionOfLineAndCharacter(file, i, 0);
             var lineEnd = i < lastLineInFile ? ts.getPositionOfLineAndCharacter(file, i + 1, 0) : file.text.length;
             var lineContent = file.text.slice(lineStart, lineEnd);
-            lineContent = lineContent.replace(/\s+$/g, ""); // trim from end
+            lineContent = ts.trimStringEnd(lineContent); // trim from end
             lineContent = lineContent.replace(/\t/g, " "); // convert tabs to single spaces
             // Output the gutter and the actual contents of the line.
             context += indent + formatColorAndReset(ts.padLeft(i + 1 + "", gutterWidth), gutterStyleSequence) + gutterSeparator;
@@ -106031,9 +113166,9 @@ var ts;
         var output = "";
         output += color(relativeFileName, ForegroundColorEscapeSequences.Cyan);
         output += ":";
-        output += color("" + (firstLine + 1), ForegroundColorEscapeSequences.Yellow);
+        output += color("".concat(firstLine + 1), ForegroundColorEscapeSequences.Yellow);
         output += ":";
-        output += color("" + (firstLineChar + 1), ForegroundColorEscapeSequences.Yellow);
+        output += color("".concat(firstLineChar + 1), ForegroundColorEscapeSequences.Yellow);
         return output;
     }
     ts.formatLocation = formatLocation;
@@ -106047,7 +113182,7 @@ var ts;
                 output += " - ";
             }
             output += formatColorAndReset(ts.diagnosticCategoryName(diagnostic), getCategoryFormat(diagnostic.category));
-            output += formatColorAndReset(" TS" + diagnostic.code + ": ", ForegroundColorEscapeSequences.Grey);
+            output += formatColorAndReset(" TS".concat(diagnostic.code, ": "), ForegroundColorEscapeSequences.Grey);
             output += flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine());
             if (diagnostic.file) {
                 output += host.getNewLine();
@@ -106118,6 +113253,56 @@ var ts;
         return resolutions;
     }
     ts.loadWithLocalCache = loadWithLocalCache;
+    ;
+    /* @internal */
+    function getModeForResolutionAtIndex(file, index) {
+        if (file.impliedNodeFormat === undefined)
+            return undefined;
+        // we ensure all elements of file.imports and file.moduleAugmentations have the relevant parent pointers set during program setup,
+        // so it's safe to use them even pre-bind
+        return getModeForUsageLocation(file, getModuleNameStringLiteralAt(file, index));
+    }
+    ts.getModeForResolutionAtIndex = getModeForResolutionAtIndex;
+    /* @internal */
+    function getModeForUsageLocation(file, usage) {
+        var _a;
+        if (file.impliedNodeFormat === undefined)
+            return undefined;
+        if (file.impliedNodeFormat !== ts.ModuleKind.ESNext) {
+            // in cjs files, import call expressions are esm format, otherwise everything is cjs
+            return ts.isImportCall(ts.walkUpParenthesizedExpressions(usage.parent)) ? ts.ModuleKind.ESNext : ts.ModuleKind.CommonJS;
+        }
+        // in esm files, import=require statements are cjs format, otherwise everything is esm
+        // imports are only parent'd up to their containing declaration/expression, so access farther parents with care
+        var exprParentParent = (_a = ts.walkUpParenthesizedExpressions(usage.parent)) === null || _a === void 0 ? void 0 : _a.parent;
+        return exprParentParent && ts.isImportEqualsDeclaration(exprParentParent) ? ts.ModuleKind.CommonJS : ts.ModuleKind.ESNext;
+    }
+    ts.getModeForUsageLocation = getModeForUsageLocation;
+    /* @internal */
+    function loadWithModeAwareCache(names, containingFile, containingFileName, redirectedReference, loader) {
+        if (names.length === 0) {
+            return [];
+        }
+        var resolutions = [];
+        var cache = new ts.Map();
+        var i = 0;
+        for (var _i = 0, names_3 = names; _i < names_3.length; _i++) {
+            var name = names_3[_i];
+            var result = void 0;
+            var mode = getModeForResolutionAtIndex(containingFile, i);
+            i++;
+            var cacheKey = mode !== undefined ? "".concat(mode, "|").concat(name) : name;
+            if (cache.has(cacheKey)) {
+                result = cache.get(cacheKey);
+            }
+            else {
+                cache.set(cacheKey, result = loader(name, mode, containingFileName, redirectedReference));
+            }
+            resolutions.push(result);
+        }
+        return resolutions;
+    }
+    ts.loadWithModeAwareCache = loadWithModeAwareCache;
     /* @internal */
     function forEachResolvedProjectReference(resolvedProjectReferences, cb) {
         return forEachProjectReference(/*projectReferences*/ undefined, resolvedProjectReferences, function (resolvedRef, parent) { return resolvedRef && cb(resolvedRef, parent); });
@@ -106130,9 +113315,8 @@ var ts;
             // Visit project references first
             if (cbRef) {
                 var result = cbRef(projectReferences, parent);
-                if (result) {
+                if (result)
                     return result;
-                }
             }
             return ts.forEach(resolvedProjectReferences, function (resolvedRef, index) {
                 if (resolvedRef && (seenResolvedRefs === null || seenResolvedRefs === void 0 ? void 0 : seenResolvedRefs.has(resolvedRef.sourceFile.path))) {
@@ -106177,7 +113361,7 @@ var ts;
         switch (kind) {
             case ts.FileIncludeKind.Import:
                 var importLiteral = getModuleNameStringLiteralAt(file, index);
-                packageId = (_e = (_d = file.resolvedModules) === null || _d === void 0 ? void 0 : _d.get(importLiteral.text)) === null || _e === void 0 ? void 0 : _e.packageId;
+                packageId = (_e = (_d = file.resolvedModules) === null || _d === void 0 ? void 0 : _d.get(importLiteral.text, getModeForResolutionAtIndex(file, index))) === null || _e === void 0 ? void 0 : _e.packageId;
                 if (importLiteral.pos === -1)
                     return { file: file, packageId: packageId, text: importLiteral.text };
                 pos = ts.skipTrivia(file.text, importLiteral.pos);
@@ -106188,7 +113372,7 @@ var ts;
                 break;
             case ts.FileIncludeKind.TypeReferenceDirective:
                 (_b = file.typeReferenceDirectives[index], pos = _b.pos, end = _b.end);
-                packageId = (_g = (_f = file.resolvedTypeReferenceDirectiveNames) === null || _f === void 0 ? void 0 : _f.get(ts.toFileNameLowerCase(file.typeReferenceDirectives[index].fileName))) === null || _g === void 0 ? void 0 : _g.packageId;
+                packageId = (_g = (_f = file.resolvedTypeReferenceDirectiveNames) === null || _f === void 0 ? void 0 : _f.get(ts.toFileNameLowerCase(file.typeReferenceDirectives[index].fileName), file.impliedNodeFormat)) === null || _g === void 0 ? void 0 : _g.packageId;
                 break;
             case ts.FileIncludeKind.LibReferenceDirective:
                 (_c = file.libReferenceDirectives[index], pos = _c.pos, end = _c.end);
@@ -106203,38 +113387,31 @@ var ts;
      * Determines if program structure is upto date or needs to be recreated
      */
     /* @internal */
-    function isProgramUptoDate(program, rootFileNames, newOptions, getSourceVersion, fileExists, hasInvalidatedResolution, hasChangedAutomaticTypeDirectiveNames, projectReferences) {
+    function isProgramUptoDate(program, rootFileNames, newOptions, getSourceVersion, fileExists, hasInvalidatedResolution, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences) {
         // If we haven't created a program yet or have changed automatic type directives, then it is not up-to-date
-        if (!program || (hasChangedAutomaticTypeDirectiveNames === null || hasChangedAutomaticTypeDirectiveNames === void 0 ? void 0 : hasChangedAutomaticTypeDirectiveNames())) {
+        if (!program || (hasChangedAutomaticTypeDirectiveNames === null || hasChangedAutomaticTypeDirectiveNames === void 0 ? void 0 : hasChangedAutomaticTypeDirectiveNames()))
             return false;
-        }
         // If root file names don't match
-        if (!ts.arrayIsEqualTo(program.getRootFileNames(), rootFileNames)) {
+        if (!ts.arrayIsEqualTo(program.getRootFileNames(), rootFileNames))
             return false;
-        }
         var seenResolvedRefs;
         // If project references don't match
-        if (!ts.arrayIsEqualTo(program.getProjectReferences(), projectReferences, projectReferenceUptoDate)) {
+        if (!ts.arrayIsEqualTo(program.getProjectReferences(), projectReferences, projectReferenceUptoDate))
             return false;
-        }
         // If any file is not up-to-date, then the whole program is not up-to-date
-        if (program.getSourceFiles().some(sourceFileNotUptoDate)) {
+        if (program.getSourceFiles().some(sourceFileNotUptoDate))
             return false;
-        }
         // If any of the missing file paths are now created
-        if (program.getMissingFilePaths().some(fileExists)) {
+        if (program.getMissingFilePaths().some(fileExists))
             return false;
-        }
         var currentOptions = program.getCompilerOptions();
         // If the compilation settings do no match, then the program is not up-to-date
-        if (!ts.compareDataObjects(currentOptions, newOptions)) {
+        if (!ts.compareDataObjects(currentOptions, newOptions))
             return false;
-        }
         // If everything matches but the text of config file is changed,
         // error locations can change for program options, so update the program
-        if (currentOptions.configFile && newOptions.configFile) {
+        if (currentOptions.configFile && newOptions.configFile)
             return currentOptions.configFile.text === newOptions.configFile.text;
-        }
         return true;
         function sourceFileNotUptoDate(sourceFile) {
             return !sourceFileVersionUptoDate(sourceFile) ||
@@ -106244,21 +113421,25 @@ var ts;
             return sourceFile.version === getSourceVersion(sourceFile.resolvedPath, sourceFile.fileName);
         }
         function projectReferenceUptoDate(oldRef, newRef, index) {
-            if (!ts.projectReferenceIsEqualTo(oldRef, newRef)) {
-                return false;
-            }
-            return resolvedProjectReferenceUptoDate(program.getResolvedProjectReferences()[index], oldRef);
+            return ts.projectReferenceIsEqualTo(oldRef, newRef) &&
+                resolvedProjectReferenceUptoDate(program.getResolvedProjectReferences()[index], oldRef);
         }
         function resolvedProjectReferenceUptoDate(oldResolvedRef, oldRef) {
             if (oldResolvedRef) {
-                if (ts.contains(seenResolvedRefs, oldResolvedRef)) {
-                    // Assume true
+                // Assume true
+                if (ts.contains(seenResolvedRefs, oldResolvedRef))
                     return true;
-                }
-                // If sourceFile for the oldResolvedRef existed, check the version for uptodate
-                if (!sourceFileVersionUptoDate(oldResolvedRef.sourceFile)) {
+                var refPath_1 = resolveProjectReferencePath(oldRef);
+                var newParsedCommandLine = getParsedCommandLine(refPath_1);
+                // Check if config file exists
+                if (!newParsedCommandLine)
+                    return false;
+                // If change in source file
+                if (oldResolvedRef.commandLine.options.configFile !== newParsedCommandLine.options.configFile)
+                    return false;
+                // check file names
+                if (!ts.arrayIsEqualTo(oldResolvedRef.commandLine.fileNames, newParsedCommandLine.fileNames))
                     return false;
-                }
                 // Add to seen before checking the referenced paths of this config file
                 (seenResolvedRefs || (seenResolvedRefs = [])).push(oldResolvedRef);
                 // If child project references are upto date, this project reference is uptodate
@@ -106268,15 +113449,43 @@ var ts;
             }
             // In old program, not able to resolve project reference path,
             // so if config file doesnt exist, it is uptodate.
-            return !fileExists(resolveProjectReferencePath(oldRef));
+            var refPath = resolveProjectReferencePath(oldRef);
+            return !getParsedCommandLine(refPath);
         }
     }
     ts.isProgramUptoDate = isProgramUptoDate;
     function getConfigFileParsingDiagnostics(configFileParseResult) {
-        return configFileParseResult.options.configFile ? __spreadArray(__spreadArray([], configFileParseResult.options.configFile.parseDiagnostics), configFileParseResult.errors) :
+        return configFileParseResult.options.configFile ? __spreadArray(__spreadArray([], configFileParseResult.options.configFile.parseDiagnostics, true), configFileParseResult.errors, true) :
             configFileParseResult.errors;
     }
     ts.getConfigFileParsingDiagnostics = getConfigFileParsingDiagnostics;
+    /**
+     * A function for determining if a given file is esm or cjs format, assuming modern node module resolution rules, as configured by the
+     * `options` parameter.
+     *
+     * @param fileName The normalized absolute path to check the format of (it need not exist on disk)
+     * @param [packageJsonInfoCache] A cache for package file lookups - it's best to have a cache when this function is called often
+     * @param host The ModuleResolutionHost which can perform the filesystem lookups for package json data
+     * @param options The compiler options to perform the analysis under - relevant options are `moduleResolution` and `traceResolution`
+     * @returns `undefined` if the path has no relevant implied format, `ModuleKind.ESNext` for esm format, and `ModuleKind.CommonJS` for cjs format
+     */
+    function getImpliedNodeFormatForFile(fileName, packageJsonInfoCache, host, options) {
+        switch (ts.getEmitModuleResolutionKind(options)) {
+            case ts.ModuleResolutionKind.Node12:
+            case ts.ModuleResolutionKind.NodeNext:
+                return ts.fileExtensionIsOneOf(fileName, [".d.mts" /* Dmts */, ".mts" /* Mts */, ".mjs" /* Mjs */]) ? ts.ModuleKind.ESNext :
+                    ts.fileExtensionIsOneOf(fileName, [".d.cts" /* Dcts */, ".cts" /* Cts */, ".cjs" /* Cjs */]) ? ts.ModuleKind.CommonJS :
+                        ts.fileExtensionIsOneOf(fileName, [".d.ts" /* Dts */, ".ts" /* Ts */, ".tsx" /* Tsx */, ".js" /* Js */, ".jsx" /* Jsx */]) ? lookupFromPackageJson() :
+                            undefined; // other extensions, like `json` or `tsbuildinfo`, are set as `undefined` here but they should never be fed through the transformer pipeline
+            default:
+                return undefined;
+        }
+        function lookupFromPackageJson() {
+            var scope = ts.getPackageScopeForPath(fileName, packageJsonInfoCache, host, options);
+            return (scope === null || scope === void 0 ? void 0 : scope.packageJsonContent.type) === "module" ? ts.ModuleKind.ESNext : ts.ModuleKind.CommonJS;
+        }
+    }
+    ts.getImpliedNodeFormatForFile = getImpliedNodeFormatForFile;
     /**
      * Determine if source file needs to be re-created even if its text hasn't changed
      */
@@ -106285,10 +113494,7 @@ var ts;
             return false;
         // If any compiler options change, we can't reuse old source file even if version match
         // The change in options like these could result in change in syntax tree or `sourceFile.bindDiagnostics`.
-        var oldOptions = program.getCompilerOptions();
-        return !!ts.sourceFileAffectingCompilerOptions.some(function (option) {
-            return !ts.isJsonEqual(ts.getCompilerOptionValue(oldOptions, option), ts.getCompilerOptionValue(newOptions, option));
-        });
+        return ts.optionsHaveChanges(program.getCompilerOptions(), newOptions, ts.sourceFileAffectingCompilerOptions);
     }
     function createCreateProgramOptions(rootNames, options, host, oldProgram, configFileParsingDiagnostics) {
         return {
@@ -106300,7 +113506,7 @@ var ts;
         };
     }
     function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) {
-        var _a, _b, _c;
+        var _a, _b, _c, _d;
         var createProgramOptions = ts.isArray(rootNamesOrOptions) ? createCreateProgramOptions(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) : rootNamesOrOptions; // TODO: GH#18217
         var rootNames = createProgramOptions.rootNames, options = createProgramOptions.options, configFileParsingDiagnostics = createProgramOptions.configFileParsingDiagnostics, projectReferences = createProgramOptions.projectReferences;
         var oldProgram = createProgramOptions.oldProgram;
@@ -106342,15 +113548,16 @@ var ts;
         var programDiagnostics = ts.createDiagnosticCollection();
         var currentDirectory = host.getCurrentDirectory();
         var supportedExtensions = ts.getSupportedExtensions(options);
-        var supportedExtensionsWithJsonIfResolveJsonModule = ts.getSuppoertedExtensionsWithJsonIfResolveJsonModule(options, supportedExtensions);
+        var supportedExtensionsWithJsonIfResolveJsonModule = ts.getSupportedExtensionsWithJsonIfResolveJsonModule(options, supportedExtensions);
         // Map storing if there is emit blocking diagnostics for given input
         var hasEmitBlockingDiagnostics = new ts.Map();
         var _compilerOptionsObjectLiteralSyntax;
         var moduleResolutionCache;
+        var typeReferenceDirectiveResolutionCache;
         var actualResolveModuleNamesWorker;
         var hasInvalidatedResolution = host.hasInvalidatedResolution || ts.returnFalse;
         if (host.resolveModuleNames) {
-            actualResolveModuleNamesWorker = function (moduleNames, containingFile, reusedNames, redirectedReference) { return host.resolveModuleNames(ts.Debug.checkEachDefined(moduleNames), containingFile, reusedNames, redirectedReference, options).map(function (resolved) {
+            actualResolveModuleNamesWorker = function (moduleNames, containingFile, containingFileName, reusedNames, redirectedReference) { return host.resolveModuleNames(ts.Debug.checkEachDefined(moduleNames), containingFileName, reusedNames, redirectedReference, options, containingFile).map(function (resolved) {
                 // An older host may have omitted extension, in which case we should infer it from the file extension of resolvedFileName.
                 if (!resolved || resolved.extension !== undefined) {
                     return resolved;
@@ -106359,18 +113566,20 @@ var ts;
                 withExtension.extension = ts.extensionFromPath(resolved.resolvedFileName);
                 return withExtension;
             }); };
+            moduleResolutionCache = (_a = host.getModuleResolutionCache) === null || _a === void 0 ? void 0 : _a.call(host);
         }
         else {
-            moduleResolutionCache = ts.createModuleResolutionCache(currentDirectory, function (x) { return host.getCanonicalFileName(x); }, options);
-            var loader_1 = function (moduleName, containingFile, redirectedReference) { return ts.resolveModuleName(moduleName, containingFile, options, host, moduleResolutionCache, redirectedReference).resolvedModule; }; // TODO: GH#18217
-            actualResolveModuleNamesWorker = function (moduleNames, containingFile, _reusedNames, redirectedReference) { return loadWithLocalCache(ts.Debug.checkEachDefined(moduleNames), containingFile, redirectedReference, loader_1); };
+            moduleResolutionCache = ts.createModuleResolutionCache(currentDirectory, getCanonicalFileName, options);
+            var loader_1 = function (moduleName, resolverMode, containingFileName, redirectedReference) { return ts.resolveModuleName(moduleName, containingFileName, options, host, moduleResolutionCache, redirectedReference, resolverMode).resolvedModule; }; // TODO: GH#18217
+            actualResolveModuleNamesWorker = function (moduleNames, containingFile, containingFileName, _reusedNames, redirectedReference) { return loadWithModeAwareCache(ts.Debug.checkEachDefined(moduleNames), containingFile, containingFileName, redirectedReference, loader_1); };
         }
         var actualResolveTypeReferenceDirectiveNamesWorker;
         if (host.resolveTypeReferenceDirectives) {
             actualResolveTypeReferenceDirectiveNamesWorker = function (typeDirectiveNames, containingFile, redirectedReference) { return host.resolveTypeReferenceDirectives(ts.Debug.checkEachDefined(typeDirectiveNames), containingFile, redirectedReference, options); };
         }
         else {
-            var loader_2 = function (typesRef, containingFile, redirectedReference) { return ts.resolveTypeReferenceDirective(typesRef, containingFile, options, host, redirectedReference).resolvedTypeReferenceDirective; }; // TODO: GH#18217
+            typeReferenceDirectiveResolutionCache = ts.createTypeReferenceDirectiveResolutionCache(currentDirectory, getCanonicalFileName, /*options*/ undefined, moduleResolutionCache === null || moduleResolutionCache === void 0 ? void 0 : moduleResolutionCache.getPackageJsonInfoCache());
+            var loader_2 = function (typesRef, containingFile, redirectedReference) { return ts.resolveTypeReferenceDirective(typesRef, containingFile, options, host, redirectedReference, typeReferenceDirectiveResolutionCache).resolvedTypeReferenceDirective; }; // TODO: GH#18217
             actualResolveTypeReferenceDirectiveNamesWorker = function (typeReferenceDirectiveNames, containingFile, redirectedReference) { return loadWithLocalCache(ts.Debug.checkEachDefined(typeReferenceDirectiveNames), containingFile, redirectedReference, loader_2); };
         }
         // Map from a stringified PackageId to the source file with that id.
@@ -106381,6 +113590,7 @@ var ts;
         var sourceFileToPackageName = new ts.Map();
         // Key is a file name. Value is the (non-empty, or undefined) list of files that redirect to it.
         var redirectTargetsMap = ts.createMultiMap();
+        var usesUriStyleNodeCoreModules = false;
         /**
          * map with
          * - SourceFile if present
@@ -106397,9 +113607,9 @@ var ts;
         var projectReferenceRedirects;
         var mapFromFileToProjectReferenceRedirects;
         var mapFromToProjectReferenceRedirectSource;
-        var useSourceOfProjectReferenceRedirect = !!((_a = host.useSourceOfProjectReferenceRedirect) === null || _a === void 0 ? void 0 : _a.call(host)) &&
+        var useSourceOfProjectReferenceRedirect = !!((_b = host.useSourceOfProjectReferenceRedirect) === null || _b === void 0 ? void 0 : _b.call(host)) &&
             !options.disableSourceOfProjectReferenceRedirect;
-        var _d = updateHostForUseSourceOfProjectReferenceRedirect({
+        var _e = updateHostForUseSourceOfProjectReferenceRedirect({
             compilerHost: host,
             getSymlinkCache: getSymlinkCache,
             useSourceOfProjectReferenceRedirect: useSourceOfProjectReferenceRedirect,
@@ -106407,7 +113617,8 @@ var ts;
             getResolvedProjectReferences: getResolvedProjectReferences,
             getSourceOfProjectReferenceRedirect: getSourceOfProjectReferenceRedirect,
             forEachResolvedProjectReference: forEachResolvedProjectReference
-        }), onProgramCreateComplete = _d.onProgramCreateComplete, fileExists = _d.fileExists, directoryExists = _d.directoryExists;
+        }), onProgramCreateComplete = _e.onProgramCreateComplete, fileExists = _e.fileExists, directoryExists = _e.directoryExists;
+        var readFile = host.readFile.bind(host);
         ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("program" /* Program */, "shouldProgramCreateNewSourceFiles", { hasOldProgram: !!oldProgram });
         var shouldCreateNewSourceFile = shouldProgramCreateNewSourceFiles(oldProgram, options);
         ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
@@ -106466,7 +113677,7 @@ var ts;
                 var containingFilename = ts.combinePaths(containingDirectory, ts.inferredTypesContainingFile);
                 var resolutions = resolveTypeReferenceDirectiveNamesWorker(typeReferences, containingFilename);
                 for (var i = 0; i < typeReferences.length; i++) {
-                    processTypeReferenceDirective(typeReferences[i], resolutions[i], { kind: ts.FileIncludeKind.AutomaticTypeDirectiveFile, typeReference: typeReferences[i], packageId: (_b = resolutions[i]) === null || _b === void 0 ? void 0 : _b.packageId });
+                    processTypeReferenceDirective(typeReferences[i], resolutions[i], { kind: ts.FileIncludeKind.AutomaticTypeDirectiveFile, typeReference: typeReferences[i], packageId: (_c = resolutions[i]) === null || _c === void 0 ? void 0 : _c.packageId });
                 }
                 ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
             }
@@ -106483,7 +113694,7 @@ var ts;
                 }
                 else {
                     ts.forEach(options.lib, function (libFileName, index) {
-                        processRootFile(ts.combinePaths(defaultLibraryPath, libFileName), /*isDefaultLib*/ true, /*ignoreNoDefaultLib*/ false, { kind: ts.FileIncludeKind.LibFile, index: index });
+                        processRootFile(pathForLibFile(libFileName), /*isDefaultLib*/ true, /*ignoreNoDefaultLib*/ false, { kind: ts.FileIncludeKind.LibFile, index: index });
                     });
                 }
             }
@@ -106509,12 +113720,25 @@ var ts;
                     host.onReleaseOldSourceFile(oldSourceFile, oldProgram.getCompilerOptions(), !!getSourceFileByPath(oldSourceFile.path));
                 }
             }
-            oldProgram.forEachResolvedProjectReference(function (resolvedProjectReference) {
-                if (!getResolvedProjectReferenceByPath(resolvedProjectReference.sourceFile.path)) {
-                    host.onReleaseOldSourceFile(resolvedProjectReference.sourceFile, oldProgram.getCompilerOptions(), /*hasSourceFileByPath*/ false);
+            if (!host.getParsedCommandLine) {
+                oldProgram.forEachResolvedProjectReference(function (resolvedProjectReference) {
+                    if (!getResolvedProjectReferenceByPath(resolvedProjectReference.sourceFile.path)) {
+                        host.onReleaseOldSourceFile(resolvedProjectReference.sourceFile, oldProgram.getCompilerOptions(), /*hasSourceFileByPath*/ false);
+                    }
+                });
+            }
+        }
+        // Release commandlines that new program does not use
+        if (oldProgram && host.onReleaseParsedCommandLine) {
+            forEachProjectReference(oldProgram.getProjectReferences(), oldProgram.getResolvedProjectReferences(), function (oldResolvedRef, parent, index) {
+                var oldReference = (parent === null || parent === void 0 ? void 0 : parent.commandLine.projectReferences[index]) || oldProgram.getProjectReferences()[index];
+                var oldRefPath = resolveProjectReferencePath(oldReference);
+                if (!(projectReferenceRedirects === null || projectReferenceRedirects === void 0 ? void 0 : projectReferenceRedirects.has(toPath(oldRefPath)))) {
+                    host.onReleaseParsedCommandLine(oldRefPath, oldResolvedRef, oldProgram.getCompilerOptions());
                 }
             });
         }
+        typeReferenceDirectiveResolutionCache = undefined;
         // unconditionally set oldProgram to undefined to prevent it from being captured in closure
         oldProgram = undefined;
         var program = {
@@ -106523,6 +113747,7 @@ var ts;
             getSourceFileByPath: getSourceFileByPath,
             getSourceFiles: function () { return files; },
             getMissingFilePaths: function () { return missingFilePaths; },
+            getModuleResolutionCache: function () { return moduleResolutionCache; },
             getFilesByNameMap: function () { return filesByName; },
             getCompilerOptions: function () { return options; },
             getSyntacticDiagnostics: getSyntacticDiagnostics,
@@ -106543,7 +113768,6 @@ var ts;
             getNodeCount: function () { return getDiagnosticsProducingTypeChecker().getNodeCount(); },
             getIdentifierCount: function () { return getDiagnosticsProducingTypeChecker().getIdentifierCount(); },
             getSymbolCount: function () { return getDiagnosticsProducingTypeChecker().getSymbolCount(); },
-            getTypeCatalog: function () { return getDiagnosticsProducingTypeChecker().getTypeCatalog(); },
             getTypeCount: function () { return getDiagnosticsProducingTypeChecker().getTypeCount(); },
             getInstantiationCount: function () { return getDiagnosticsProducingTypeChecker().getInstantiationCount(); },
             getRelationCacheSizes: function () { return getDiagnosticsProducingTypeChecker().getRelationCacheSizes(); },
@@ -106556,6 +113780,7 @@ var ts;
             getLibFileFromReference: getLibFileFromReference,
             sourceFileToPackageName: sourceFileToPackageName,
             redirectTargetsMap: redirectTargetsMap,
+            usesUriStyleNodeCoreModules: usesUriStyleNodeCoreModules,
             isEmittedFile: isEmittedFile,
             getConfigFileParsingDiagnostics: getConfigFileParsingDiagnostics,
             getResolvedModuleWithFailedLookupLocationsFromCache: getResolvedModuleWithFailedLookupLocationsFromCache,
@@ -106568,9 +113793,10 @@ var ts;
             isSourceOfProjectReferenceRedirect: isSourceOfProjectReferenceRedirect,
             emitBuildInfo: emitBuildInfo,
             fileExists: fileExists,
+            readFile: readFile,
             directoryExists: directoryExists,
             getSymlinkCache: getSymlinkCache,
-            realpath: (_c = host.realpath) === null || _c === void 0 ? void 0 : _c.bind(host),
+            realpath: (_d = host.realpath) === null || _d === void 0 ? void 0 : _d.bind(host),
             useCaseSensitiveFileNames: function () { return host.useCaseSensitiveFileNames(); },
             getFileIncludeReasons: function () { return fileReasons; },
             structureIsReused: structureIsReused,
@@ -106583,7 +113809,7 @@ var ts;
                     return programDiagnostics.add(createDiagnosticExplainingFile(diagnostic.file && getSourceFileByPath(diagnostic.file), diagnostic.fileProcessingReason, diagnostic.diagnostic, diagnostic.args || ts.emptyArray));
                 case 0 /* FilePreprocessingReferencedDiagnostic */:
                     var _a = getReferencedFileLocation(getSourceFileByPath, diagnostic.reason), file = _a.file, pos = _a.pos, end = _a.end;
-                    return programDiagnostics.add(ts.createFileDiagnostic.apply(void 0, __spreadArray([file, ts.Debug.checkDefined(pos), ts.Debug.checkDefined(end) - pos, diagnostic.diagnostic], diagnostic.args || ts.emptyArray)));
+                    return programDiagnostics.add(ts.createFileDiagnostic.apply(void 0, __spreadArray([file, ts.Debug.checkDefined(pos), ts.Debug.checkDefined(end) - pos, diagnostic.diagnostic], diagnostic.args || ts.emptyArray, false)));
                 default:
                     ts.Debug.assertNever(diagnostic);
             }
@@ -106600,7 +113826,7 @@ var ts;
             var redirectedReference = getRedirectReferenceForResolution(containingFile);
             ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("program" /* Program */, "resolveModuleNamesWorker", { containingFileName: containingFileName });
             ts.performance.mark("beforeResolveModule");
-            var result = actualResolveModuleNamesWorker(moduleNames, containingFileName, reusedNames, redirectedReference);
+            var result = actualResolveModuleNamesWorker(moduleNames, containingFile, containingFileName, reusedNames, redirectedReference);
             ts.performance.mark("afterResolveModule");
             ts.performance.measure("ResolveModule", "beforeResolveModule", "afterResolveModule");
             ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
@@ -106621,11 +113847,11 @@ var ts;
         }
         function getRedirectReferenceForResolution(file) {
             var redirect = getResolvedProjectReferenceToRedirect(file.originalFileName);
-            if (redirect || !ts.fileExtensionIs(file.originalFileName, ".d.ts" /* Dts */))
+            if (redirect || !ts.fileExtensionIsOneOf(file.originalFileName, [".d.ts" /* Dts */, ".d.cts" /* Dcts */, ".d.mts" /* Dmts */]))
                 return redirect;
             // The originalFileName could not be actual source file name if file found was d.ts from referecned project
             // So in this case try to look up if this is output from referenced project, if it is use the redirected project in that case
-            var resultFromDts = getRedirectReferenceForResolutionFromSourceOfProject(file.originalFileName, file.path);
+            var resultFromDts = getRedirectReferenceForResolutionFromSourceOfProject(file.path);
             if (resultFromDts)
                 return resultFromDts;
             // If preserveSymlinks is true, module resolution wont jump the symlink
@@ -106634,12 +113860,11 @@ var ts;
             // file is from node_modules to avoid having to run real path on all file paths
             if (!host.realpath || !options.preserveSymlinks || !ts.stringContains(file.originalFileName, ts.nodeModulesPathPart))
                 return undefined;
-            var realDeclarationFileName = host.realpath(file.originalFileName);
-            var realDeclarationPath = toPath(realDeclarationFileName);
-            return realDeclarationPath === file.path ? undefined : getRedirectReferenceForResolutionFromSourceOfProject(realDeclarationFileName, realDeclarationPath);
+            var realDeclarationPath = toPath(host.realpath(file.originalFileName));
+            return realDeclarationPath === file.path ? undefined : getRedirectReferenceForResolutionFromSourceOfProject(realDeclarationPath);
         }
-        function getRedirectReferenceForResolutionFromSourceOfProject(fileName, filePath) {
-            var source = getSourceOfProjectReferenceRedirect(fileName);
+        function getRedirectReferenceForResolutionFromSourceOfProject(filePath) {
+            var source = getSourceOfProjectReferenceRedirect(filePath);
             if (ts.isString(source))
                 return getResolvedProjectReferenceToRedirect(source);
             if (!source)
@@ -106667,8 +113892,8 @@ var ts;
             }
             return ts.libs.length + 2;
         }
-        function getResolvedModuleWithFailedLookupLocationsFromCache(moduleName, containingFile) {
-            return moduleResolutionCache && ts.resolveModuleNameFromCache(moduleName, containingFile, moduleResolutionCache);
+        function getResolvedModuleWithFailedLookupLocationsFromCache(moduleName, containingFile, mode) {
+            return moduleResolutionCache && ts.resolveModuleNameFromCache(moduleName, containingFile, moduleResolutionCache, mode);
         }
         function toPath(fileName) {
             return ts.toPath(fileName, currentDirectory, getCanonicalFileName);
@@ -106686,8 +113911,8 @@ var ts;
                 // Initialize a checker so that all our files are bound.
                 getTypeChecker();
                 classifiableNames = new ts.Set();
-                for (var _i = 0, files_2 = files; _i < files_2.length; _i++) {
-                    var sourceFile = files_2[_i];
+                for (var _i = 0, files_3 = files; _i < files_3.length; _i++) {
+                    var sourceFile = files_3[_i];
                     (_a = sourceFile.classifiableNames) === null || _a === void 0 ? void 0 : _a.forEach(function (value) { return classifiableNames.add(value); });
                 }
             }
@@ -106709,13 +113934,15 @@ var ts;
                 // which per above occurred during the current program creation.
                 // Since we assume the filesystem does not change during program creation,
                 // it is safe to reuse resolutions from the earlier call.
-                var result_14 = [];
+                var result_13 = [];
+                var i = 0;
                 for (var _i = 0, moduleNames_1 = moduleNames; _i < moduleNames_1.length; _i++) {
                     var moduleName = moduleNames_1[_i];
-                    var resolvedModule = file.resolvedModules.get(moduleName);
-                    result_14.push(resolvedModule);
+                    var resolvedModule = file.resolvedModules.get(moduleName, getModeForResolutionAtIndex(file, i));
+                    i++;
+                    result_13.push(resolvedModule);
                 }
-                return result_14;
+                return result_13;
             }
             // At this point, we know at least one of the following hold:
             // - file has local declarations for ambient modules
@@ -106740,10 +113967,12 @@ var ts;
                 var moduleName = moduleNames[i];
                 // If the source file is unchanged and doesnt have invalidated resolution, reuse the module resolutions
                 if (file === oldSourceFile && !hasInvalidatedResolution(oldSourceFile.path)) {
-                    var oldResolvedModule = ts.getResolvedModule(oldSourceFile, moduleName);
+                    var oldResolvedModule = ts.getResolvedModule(oldSourceFile, moduleName, getModeForResolutionAtIndex(oldSourceFile, i));
                     if (oldResolvedModule) {
                         if (ts.isTraceEnabled(options, host)) {
-                            ts.trace(host, ts.Diagnostics.Reusing_resolution_of_module_0_to_file_1_from_old_program, moduleName, ts.getNormalizedAbsolutePath(file.originalFileName, currentDirectory));
+                            ts.trace(host, oldResolvedModule.packageId ?
+                                ts.Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3 :
+                                ts.Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2, moduleName, ts.getNormalizedAbsolutePath(file.originalFileName, currentDirectory), oldResolvedModule.resolvedFileName, oldResolvedModule.packageId && ts.packageIdToString(oldResolvedModule.packageId));
                         }
                         (result || (result = new Array(moduleNames.length)))[i] = oldResolvedModule;
                         (reusedNames || (reusedNames = [])).push(moduleName);
@@ -106762,7 +113991,7 @@ var ts;
                     }
                 }
                 else {
-                    resolvesToAmbientModuleInNonModifiedFile = moduleNameResolvesToAmbientModuleInNonModifiedFile(moduleName);
+                    resolvesToAmbientModuleInNonModifiedFile = moduleNameResolvesToAmbientModuleInNonModifiedFile(moduleName, i);
                 }
                 if (resolvesToAmbientModuleInNonModifiedFile) {
                     (result || (result = new Array(moduleNames.length)))[i] = predictedToResolveToAmbientModuleMarker;
@@ -106799,8 +114028,10 @@ var ts;
             return result;
             // If we change our policy of rechecking failed lookups on each program create,
             // we should adjust the value returned here.
-            function moduleNameResolvesToAmbientModuleInNonModifiedFile(moduleName) {
-                var resolutionToFile = ts.getResolvedModule(oldSourceFile, moduleName);
+            function moduleNameResolvesToAmbientModuleInNonModifiedFile(moduleName, index) {
+                if (index >= ts.length(oldSourceFile === null || oldSourceFile === void 0 ? void 0 : oldSourceFile.imports) + ts.length(oldSourceFile === null || oldSourceFile === void 0 ? void 0 : oldSourceFile.moduleAugmentations))
+                    return false; // mode index out of bounds, don't reuse resolution
+                var resolutionToFile = ts.getResolvedModule(oldSourceFile, moduleName, oldSourceFile && getModeForResolutionAtIndex(oldSourceFile, index));
                 var resolvedFile = resolutionToFile && oldProgram.getSourceFile(resolutionToFile.resolvedFileName);
                 if (resolutionToFile && resolvedFile) {
                     // In the old program, we resolved to an ambient module that was in the same
@@ -106826,7 +114057,9 @@ var ts;
                 var newResolvedRef = parseProjectReferenceConfigFile(newRef);
                 if (oldResolvedRef) {
                     // Resolved project reference has gone missing or changed
-                    return !newResolvedRef || newResolvedRef.sourceFile !== oldResolvedRef.sourceFile;
+                    return !newResolvedRef ||
+                        newResolvedRef.sourceFile !== oldResolvedRef.sourceFile ||
+                        !ts.arrayIsEqualTo(oldResolvedRef.commandLine.fileNames, newResolvedRef.commandLine.fileNames);
                 }
                 else {
                     // A previously-unresolved reference may be resolved now
@@ -106854,9 +114087,6 @@ var ts;
             if (!ts.arrayIsEqualTo(oldRootNames, rootNames)) {
                 return 0 /* Not */;
             }
-            if (!ts.arrayIsEqualTo(options.types, oldOptions.types)) {
-                return 0 /* Not */;
-            }
             // Check if any referenced project tsconfig files are different
             if (!canReuseProjectReferences()) {
                 return 0 /* Not */;
@@ -106884,8 +114114,8 @@ var ts;
             for (var _i = 0, oldSourceFiles_2 = oldSourceFiles; _i < oldSourceFiles_2.length; _i++) {
                 var oldSourceFile = oldSourceFiles_2[_i];
                 var newSourceFile = host.getSourceFileByPath
-                    ? host.getSourceFileByPath(oldSourceFile.fileName, oldSourceFile.resolvedPath, options.target, /*onError*/ undefined, shouldCreateNewSourceFile)
-                    : host.getSourceFile(oldSourceFile.fileName, options.target, /*onError*/ undefined, shouldCreateNewSourceFile); // TODO: GH#18217
+                    ? host.getSourceFileByPath(oldSourceFile.fileName, oldSourceFile.resolvedPath, ts.getEmitScriptTarget(options), /*onError*/ undefined, shouldCreateNewSourceFile)
+                    : host.getSourceFile(oldSourceFile.fileName, ts.getEmitScriptTarget(options), /*onError*/ undefined, shouldCreateNewSourceFile); // TODO: GH#18217
                 if (!newSourceFile) {
                     return 0 /* Not */;
                 }
@@ -106931,7 +114161,7 @@ var ts;
                     // The `newSourceFile` object was created for the new program.
                     if (!ts.arrayIsEqualTo(oldSourceFile.libReferenceDirectives, newSourceFile.libReferenceDirectives, fileReferenceIsEqualTo)) {
                         // 'lib' references has changed. Matches behavior in changesAffectModuleResolution
-                        return 0 /* Not */;
+                        structureIsReused = 1 /* SafeModules */;
                     }
                     if (oldSourceFile.hasNoDefaultLib !== newSourceFile.hasNoDefaultLib) {
                         // value of no-default-lib has changed
@@ -106992,10 +114222,10 @@ var ts;
                 var moduleNames = getModuleNames(newSourceFile);
                 var resolutions = resolveModuleNamesReusingOldState(moduleNames, newSourceFile);
                 // ensure that module resolution results are still correct
-                var resolutionsChanged = ts.hasChangesInResolutions(moduleNames, resolutions, oldSourceFile.resolvedModules, ts.moduleResolutionIsEqualTo);
+                var resolutionsChanged = ts.hasChangesInResolutions(moduleNames, resolutions, oldSourceFile.resolvedModules, oldSourceFile, ts.moduleResolutionIsEqualTo);
                 if (resolutionsChanged) {
                     structureIsReused = 1 /* SafeModules */;
-                    newSourceFile.resolvedModules = ts.zipToMap(moduleNames, resolutions);
+                    newSourceFile.resolvedModules = ts.zipToModeAwareCache(newSourceFile, moduleNames, resolutions);
                 }
                 else {
                     newSourceFile.resolvedModules = oldSourceFile.resolvedModules;
@@ -107004,10 +114234,10 @@ var ts;
                 var typesReferenceDirectives = ts.map(newSourceFile.typeReferenceDirectives, function (ref) { return ts.toFileNameLowerCase(ref.fileName); });
                 var typeReferenceResolutions = resolveTypeReferenceDirectiveNamesWorker(typesReferenceDirectives, newSourceFile);
                 // ensure that types resolutions are still correct
-                var typeReferenceEesolutionsChanged = ts.hasChangesInResolutions(typesReferenceDirectives, typeReferenceResolutions, oldSourceFile.resolvedTypeReferenceDirectiveNames, ts.typeDirectiveIsEqualTo);
-                if (typeReferenceEesolutionsChanged) {
+                var typeReferenceResolutionsChanged = ts.hasChangesInResolutions(typesReferenceDirectives, typeReferenceResolutions, oldSourceFile.resolvedTypeReferenceDirectiveNames, oldSourceFile, ts.typeDirectiveIsEqualTo);
+                if (typeReferenceResolutionsChanged) {
                     structureIsReused = 1 /* SafeModules */;
-                    newSourceFile.resolvedTypeReferenceDirectiveNames = ts.zipToMap(typesReferenceDirectives, typeReferenceResolutions);
+                    newSourceFile.resolvedTypeReferenceDirectiveNames = ts.zipToModeAwareCache(newSourceFile, typesReferenceDirectives, typeReferenceResolutions);
                 }
                 else {
                     newSourceFile.resolvedTypeReferenceDirectiveNames = oldSourceFile.resolvedTypeReferenceDirectiveNames;
@@ -107016,7 +114246,7 @@ var ts;
             if (structureIsReused !== 2 /* Completely */) {
                 return structureIsReused;
             }
-            if ((_a = host.hasChangedAutomaticTypeDirectiveNames) === null || _a === void 0 ? void 0 : _a.call(host)) {
+            if (ts.changesAffectingProgramStructure(oldOptions, options) || ((_a = host.hasChangedAutomaticTypeDirectiveNames) === null || _a === void 0 ? void 0 : _a.call(host))) {
                 return 1 /* SafeModules */;
             }
             missingFilePaths = oldProgram.getMissingFilePaths();
@@ -107047,6 +114277,7 @@ var ts;
             resolvedTypeReferenceDirectives = oldProgram.getResolvedTypeReferenceDirectives();
             sourceFileToPackageName = oldProgram.sourceFileToPackageName;
             redirectTargetsMap = oldProgram.redirectTargetsMap;
+            usesUriStyleNodeCoreModules = oldProgram.usesUriStyleNodeCoreModules;
             return 2 /* Completely */;
         }
         function getEmitHost(writeFileCallback) {
@@ -107130,7 +114361,7 @@ var ts;
                 return equalityComparer(file.fileName, getDefaultLibraryFileName());
             }
             else {
-                return ts.some(options.lib, function (libFileName) { return equalityComparer(file.fileName, ts.combinePaths(defaultLibraryPath, libFileName)); });
+                return ts.some(options.lib, function (libFileName) { return equalityComparer(file.fileName, pathForLibFile(libFileName)); });
             }
         }
         function getDiagnosticsProducingTypeChecker() {
@@ -107259,7 +114490,7 @@ var ts;
             }
         }
         function getSemanticDiagnosticsForFile(sourceFile, cancellationToken) {
-            return ts.concatenate(filterSemanticDiagnotics(getBindAndCheckDiagnosticsForFile(sourceFile, cancellationToken), options), getProgramDiagnostics(sourceFile));
+            return ts.concatenate(filterSemanticDiagnostics(getBindAndCheckDiagnosticsForFile(sourceFile, cancellationToken), options), getProgramDiagnostics(sourceFile));
         }
         function getBindAndCheckDiagnosticsForFile(sourceFile, cancellationToken) {
             return getAndCacheDiagnostics(sourceFile, cancellationToken, cachedBindAndCheckDiagnosticsForFile, getBindAndCheckDiagnosticsForFileNoCache);
@@ -107274,8 +114505,8 @@ var ts;
                 var isCheckJs = ts.isCheckJsEnabledForFile(sourceFile, options);
                 var isTsNoCheck = !!sourceFile.checkJsDirective && sourceFile.checkJsDirective.enabled === false;
                 // By default, only type-check .ts, .tsx, 'Deferred' and 'External' files (external files are added by plugins)
-                var includeBindAndCheckDiagnostics = !isTsNoCheck && (sourceFile.scriptKind === 3 /* TS */ || sourceFile.scriptKind === 4 /* TSX */ ||
-                    sourceFile.scriptKind === 5 /* External */ || isCheckJs || sourceFile.scriptKind === 7 /* Deferred */);
+                var includeBindAndCheckDiagnostics = !isTsNoCheck && (sourceFile.scriptKind === 3 /* TS */ || sourceFile.scriptKind === 4 /* TSX */
+                    || sourceFile.scriptKind === 5 /* External */ || isCheckJs || sourceFile.scriptKind === 7 /* Deferred */);
                 var bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : ts.emptyArray;
                 var checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray;
                 return getMergedBindAndCheckDiagnostics(sourceFile, includeBindAndCheckDiagnostics, bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : undefined);
@@ -107349,22 +114580,22 @@ var ts;
                     // Return directly from the case if the given node doesnt want to visit each child
                     // Otherwise break to visit each child
                     switch (parent.kind) {
-                        case 160 /* Parameter */:
-                        case 163 /* PropertyDeclaration */:
-                        case 165 /* MethodDeclaration */:
+                        case 163 /* Parameter */:
+                        case 166 /* PropertyDeclaration */:
+                        case 168 /* MethodDeclaration */:
                             if (parent.questionToken === node) {
                                 diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, "?"));
                                 return "skip";
                             }
                         // falls through
-                        case 164 /* MethodSignature */:
-                        case 166 /* Constructor */:
-                        case 167 /* GetAccessor */:
-                        case 168 /* SetAccessor */:
-                        case 208 /* FunctionExpression */:
-                        case 251 /* FunctionDeclaration */:
-                        case 209 /* ArrowFunction */:
-                        case 249 /* VariableDeclaration */:
+                        case 167 /* MethodSignature */:
+                        case 170 /* Constructor */:
+                        case 171 /* GetAccessor */:
+                        case 172 /* SetAccessor */:
+                        case 212 /* FunctionExpression */:
+                        case 255 /* FunctionDeclaration */:
+                        case 213 /* ArrowFunction */:
+                        case 253 /* VariableDeclaration */:
                             // type annotation
                             if (parent.type === node) {
                                 diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Type_annotations_can_only_be_used_in_TypeScript_files));
@@ -107372,58 +114603,58 @@ var ts;
                             }
                     }
                     switch (node.kind) {
-                        case 262 /* ImportClause */:
+                        case 266 /* ImportClause */:
                             if (node.isTypeOnly) {
                                 diagnostics.push(createDiagnosticForNode(parent, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "import type"));
                                 return "skip";
                             }
                             break;
-                        case 267 /* ExportDeclaration */:
+                        case 271 /* ExportDeclaration */:
                             if (node.isTypeOnly) {
                                 diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "export type"));
                                 return "skip";
                             }
                             break;
-                        case 260 /* ImportEqualsDeclaration */:
+                        case 264 /* ImportEqualsDeclaration */:
                             diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_TypeScript_files));
                             return "skip";
-                        case 266 /* ExportAssignment */:
+                        case 270 /* ExportAssignment */:
                             if (node.isExportEquals) {
                                 diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_TypeScript_files));
                                 return "skip";
                             }
                             break;
-                        case 286 /* HeritageClause */:
+                        case 290 /* HeritageClause */:
                             var heritageClause = node;
-                            if (heritageClause.token === 116 /* ImplementsKeyword */) {
+                            if (heritageClause.token === 117 /* ImplementsKeyword */) {
                                 diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_TypeScript_files));
                                 return "skip";
                             }
                             break;
-                        case 253 /* InterfaceDeclaration */:
-                            var interfaceKeyword = ts.tokenToString(117 /* InterfaceKeyword */);
+                        case 257 /* InterfaceDeclaration */:
+                            var interfaceKeyword = ts.tokenToString(118 /* InterfaceKeyword */);
                             ts.Debug.assertIsDefined(interfaceKeyword);
                             diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, interfaceKeyword));
                             return "skip";
-                        case 256 /* ModuleDeclaration */:
-                            var moduleKeyword = node.flags & 16 /* Namespace */ ? ts.tokenToString(140 /* NamespaceKeyword */) : ts.tokenToString(139 /* ModuleKeyword */);
+                        case 260 /* ModuleDeclaration */:
+                            var moduleKeyword = node.flags & 16 /* Namespace */ ? ts.tokenToString(142 /* NamespaceKeyword */) : ts.tokenToString(141 /* ModuleKeyword */);
                             ts.Debug.assertIsDefined(moduleKeyword);
                             diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, moduleKeyword));
                             return "skip";
-                        case 254 /* TypeAliasDeclaration */:
+                        case 258 /* TypeAliasDeclaration */:
                             diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Type_aliases_can_only_be_used_in_TypeScript_files));
                             return "skip";
-                        case 255 /* EnumDeclaration */:
-                            var enumKeyword = ts.Debug.checkDefined(ts.tokenToString(91 /* EnumKeyword */));
+                        case 259 /* EnumDeclaration */:
+                            var enumKeyword = ts.Debug.checkDefined(ts.tokenToString(92 /* EnumKeyword */));
                             diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, enumKeyword));
                             return "skip";
-                        case 225 /* NonNullExpression */:
+                        case 229 /* NonNullExpression */:
                             diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Non_null_assertions_can_only_be_used_in_TypeScript_files));
                             return "skip";
-                        case 224 /* AsExpression */:
+                        case 228 /* AsExpression */:
                             diagnostics.push(createDiagnosticForNode(node.type, ts.Diagnostics.Type_assertion_expressions_can_only_be_used_in_TypeScript_files));
                             return "skip";
-                        case 206 /* TypeAssertionExpression */:
+                        case 210 /* TypeAssertionExpression */:
                             ts.Debug.fail(); // Won't parse these in a JS file anyway, as they are interpreted as JSX.
                     }
                 }
@@ -107432,53 +114663,53 @@ var ts;
                         diagnostics.push(createDiagnosticForNode(parent, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning));
                     }
                     switch (parent.kind) {
-                        case 252 /* ClassDeclaration */:
-                        case 221 /* ClassExpression */:
-                        case 165 /* MethodDeclaration */:
-                        case 166 /* Constructor */:
-                        case 167 /* GetAccessor */:
-                        case 168 /* SetAccessor */:
-                        case 208 /* FunctionExpression */:
-                        case 251 /* FunctionDeclaration */:
-                        case 209 /* ArrowFunction */:
+                        case 256 /* ClassDeclaration */:
+                        case 225 /* ClassExpression */:
+                        case 168 /* MethodDeclaration */:
+                        case 170 /* Constructor */:
+                        case 171 /* GetAccessor */:
+                        case 172 /* SetAccessor */:
+                        case 212 /* FunctionExpression */:
+                        case 255 /* FunctionDeclaration */:
+                        case 213 /* ArrowFunction */:
                             // Check type parameters
                             if (nodes === parent.typeParameters) {
                                 diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Type_parameter_declarations_can_only_be_used_in_TypeScript_files));
                                 return "skip";
                             }
                         // falls through
-                        case 232 /* VariableStatement */:
+                        case 236 /* VariableStatement */:
                             // Check modifiers
                             if (nodes === parent.modifiers) {
-                                checkModifiers(parent.modifiers, parent.kind === 232 /* VariableStatement */);
+                                checkModifiers(parent.modifiers, parent.kind === 236 /* VariableStatement */);
                                 return "skip";
                             }
                             break;
-                        case 163 /* PropertyDeclaration */:
+                        case 166 /* PropertyDeclaration */:
                             // Check modifiers of property declaration
                             if (nodes === parent.modifiers) {
                                 for (var _i = 0, _a = nodes; _i < _a.length; _i++) {
                                     var modifier = _a[_i];
-                                    if (modifier.kind !== 123 /* StaticKeyword */) {
+                                    if (modifier.kind !== 124 /* StaticKeyword */) {
                                         diagnostics.push(createDiagnosticForNode(modifier, ts.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, ts.tokenToString(modifier.kind)));
                                     }
                                 }
                                 return "skip";
                             }
                             break;
-                        case 160 /* Parameter */:
+                        case 163 /* Parameter */:
                             // Check modifiers of parameter declaration
                             if (nodes === parent.modifiers) {
                                 diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Parameter_modifiers_can_only_be_used_in_TypeScript_files));
                                 return "skip";
                             }
                             break;
-                        case 203 /* CallExpression */:
-                        case 204 /* NewExpression */:
-                        case 223 /* ExpressionWithTypeArguments */:
-                        case 274 /* JsxSelfClosingElement */:
-                        case 275 /* JsxOpeningElement */:
-                        case 205 /* TaggedTemplateExpression */:
+                        case 207 /* CallExpression */:
+                        case 208 /* NewExpression */:
+                        case 227 /* ExpressionWithTypeArguments */:
+                        case 278 /* JsxSelfClosingElement */:
+                        case 279 /* JsxOpeningElement */:
+                        case 209 /* TaggedTemplateExpression */:
                             // Check type arguments
                             if (nodes === parent.typeArguments) {
                                 diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Type_arguments_can_only_be_used_in_TypeScript_files));
@@ -107491,24 +114722,25 @@ var ts;
                     for (var _i = 0, modifiers_2 = modifiers; _i < modifiers_2.length; _i++) {
                         var modifier = modifiers_2[_i];
                         switch (modifier.kind) {
-                            case 84 /* ConstKeyword */:
+                            case 85 /* ConstKeyword */:
                                 if (isConstValid) {
                                     continue;
                                 }
                             // to report error,
                             // falls through
-                            case 122 /* PublicKeyword */:
-                            case 120 /* PrivateKeyword */:
-                            case 121 /* ProtectedKeyword */:
-                            case 142 /* ReadonlyKeyword */:
-                            case 133 /* DeclareKeyword */:
-                            case 125 /* AbstractKeyword */:
+                            case 123 /* PublicKeyword */:
+                            case 121 /* PrivateKeyword */:
+                            case 122 /* ProtectedKeyword */:
+                            case 144 /* ReadonlyKeyword */:
+                            case 135 /* DeclareKeyword */:
+                            case 126 /* AbstractKeyword */:
+                            case 158 /* OverrideKeyword */:
                                 diagnostics.push(createDiagnosticForNode(modifier, ts.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, ts.tokenToString(modifier.kind)));
                                 break;
                             // These are all legal modifiers.
-                            case 123 /* StaticKeyword */:
-                            case 92 /* ExportKeyword */:
-                            case 87 /* DefaultKeyword */:
+                            case 124 /* StaticKeyword */:
+                            case 93 /* ExportKeyword */:
+                            case 88 /* DefaultKeyword */:
                         }
                     }
                 }
@@ -107557,9 +114789,8 @@ var ts;
             return ts.sortAndDeduplicateDiagnostics(ts.concatenate(programDiagnostics.getGlobalDiagnostics(), getOptionsDiagnosticsOfConfigFile()));
         }
         function getOptionsDiagnosticsOfConfigFile() {
-            if (!options.configFile) {
+            if (!options.configFile)
                 return ts.emptyArray;
-            }
             var diagnostics = programDiagnostics.getDiagnostics(options.configFile.fileName);
             forEachResolvedProjectReference(function (resolvedRef) {
                 diagnostics = ts.concatenate(diagnostics, programDiagnostics.getDiagnostics(resolvedRef.sourceFile.fileName));
@@ -107579,13 +114810,13 @@ var ts;
             return a.fileName === b.fileName;
         }
         function moduleNameIsEqualTo(a, b) {
-            return a.kind === 78 /* Identifier */
-                ? b.kind === 78 /* Identifier */ && a.escapedText === b.escapedText
+            return a.kind === 79 /* Identifier */
+                ? b.kind === 79 /* Identifier */ && a.escapedText === b.escapedText
                 : b.kind === 10 /* StringLiteral */ && a.text === b.text;
         }
         function createSyntheticImport(text, file) {
             var externalHelpersModuleReference = ts.factory.createStringLiteral(text);
-            var importDecl = ts.factory.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*importClause*/ undefined, externalHelpersModuleReference);
+            var importDecl = ts.factory.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*importClause*/ undefined, externalHelpersModuleReference, /*assertClause*/ undefined);
             ts.addEmitFlags(importDecl, 67108864 /* NeverApplyImportHelper */);
             ts.setParent(externalHelpersModuleReference, importDecl);
             ts.setParent(importDecl, file);
@@ -107637,11 +114868,16 @@ var ts;
                     // An ExternalImportDeclaration in an AmbientExternalModuleDeclaration may reference other external modules
                     // only through top - level external module names. Relative external module names are not permitted.
                     if (moduleNameExpr && ts.isStringLiteral(moduleNameExpr) && moduleNameExpr.text && (!inAmbientModule || !ts.isExternalModuleNameRelative(moduleNameExpr.text))) {
+                        ts.setParentRecursive(node, /*incremental*/ false); // we need parent data on imports before the program is fully bound, so we ensure it's set here
                         imports = ts.append(imports, moduleNameExpr);
+                        if (!usesUriStyleNodeCoreModules && currentNodeModulesDepth === 0 && !file.isDeclarationFile) {
+                            usesUriStyleNodeCoreModules = ts.startsWith(moduleNameExpr.text, "node:");
+                        }
                     }
                 }
                 else if (ts.isModuleDeclaration(node)) {
                     if (ts.isAmbientModule(node) && (inAmbientModule || ts.hasSyntacticModifier(node, 2 /* Ambient */) || file.isDeclarationFile)) {
+                        node.name.parent = node;
                         var nameText = ts.getTextOfIdentifierOrLiteral(node.name);
                         // Ambient module declarations can be interpreted as augmentations for some existing external modules.
                         // This will happen in two cases:
@@ -107677,13 +114913,16 @@ var ts;
                 while (r.exec(file.text) !== null) { // eslint-disable-line no-null/no-null
                     var node = getNodeAtPosition(file, r.lastIndex);
                     if (isJavaScriptFile && ts.isRequireCall(node, /*checkArgumentIsStringLiteralLike*/ true)) {
+                        ts.setParentRecursive(node, /*incremental*/ false); // we need parent data on imports before the program is fully bound, so we ensure it's set here
                         imports = ts.append(imports, node.arguments[0]);
                     }
-                    // we have to check the argument list has length of 1. We will still have to process these even though we have parsing error.
-                    else if (ts.isImportCall(node) && node.arguments.length === 1 && ts.isStringLiteralLike(node.arguments[0])) {
+                    // we have to check the argument list has length of at least 1. We will still have to process these even though we have parsing error.
+                    else if (ts.isImportCall(node) && node.arguments.length >= 1 && ts.isStringLiteralLike(node.arguments[0])) {
+                        ts.setParentRecursive(node, /*incremental*/ false); // we need parent data on imports before the program is fully bound, so we ensure it's set here
                         imports = ts.append(imports, node.arguments[0]);
                     }
                     else if (ts.isLiteralImportTypeNode(node)) {
+                        ts.setParentRecursive(node, /*incremental*/ false); // we need parent data on imports before the program is fully bound, so we ensure it's set here
                         imports = ts.append(imports, node.argument.literal);
                     }
                 }
@@ -107709,7 +114948,7 @@ var ts;
             var libName = ts.toFileNameLowerCase(ref.fileName);
             var libFileName = ts.libMap.get(libName);
             if (libFileName) {
-                return getSourceFile(ts.combinePaths(defaultLibraryPath, libFileName));
+                return getSourceFile(pathForLibFile(libFileName));
             }
         }
         /** This should have similar behavior to 'processSourceFile' without diagnostics or mutation. */
@@ -107719,13 +114958,13 @@ var ts;
         function getSourceFileFromReferenceWorker(fileName, getSourceFile, fail, reason) {
             if (ts.hasExtension(fileName)) {
                 var canonicalFileName_1 = host.getCanonicalFileName(fileName);
-                if (!options.allowNonTsExtensions && !ts.forEach(supportedExtensionsWithJsonIfResolveJsonModule, function (extension) { return ts.fileExtensionIs(canonicalFileName_1, extension); })) {
+                if (!options.allowNonTsExtensions && !ts.forEach(ts.flatten(supportedExtensionsWithJsonIfResolveJsonModule), function (extension) { return ts.fileExtensionIs(canonicalFileName_1, extension); })) {
                     if (fail) {
                         if (ts.hasJSFileExtension(canonicalFileName_1)) {
                             fail(ts.Diagnostics.File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option, fileName);
                         }
                         else {
-                            fail(ts.Diagnostics.File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1, fileName, "'" + supportedExtensions.join("', '") + "'");
+                            fail(ts.Diagnostics.File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1, fileName, "'" + ts.flatten(supportedExtensions).join("', '") + "'");
                         }
                     }
                     return undefined;
@@ -107755,15 +114994,16 @@ var ts;
                     fail(ts.Diagnostics.File_0_not_found, fileName);
                     return undefined;
                 }
-                var sourceFileWithAddedExtension = ts.forEach(supportedExtensions, function (extension) { return getSourceFile(fileName + extension); });
+                // Only try adding extensions from the first supported group (which should be .ts/.tsx/.d.ts)
+                var sourceFileWithAddedExtension = ts.forEach(supportedExtensions[0], function (extension) { return getSourceFile(fileName + extension); });
                 if (fail && !sourceFileWithAddedExtension)
-                    fail(ts.Diagnostics.Could_not_resolve_the_path_0_with_the_extensions_Colon_1, fileName, "'" + supportedExtensions.join("', '") + "'");
+                    fail(ts.Diagnostics.Could_not_resolve_the_path_0_with_the_extensions_Colon_1, fileName, "'" + ts.flatten(supportedExtensions).join("', '") + "'");
                 return sourceFileWithAddedExtension;
             }
         }
         /** This has side effects through `findSourceFile`. */
         function processSourceFile(fileName, isDefaultLib, ignoreNoDefaultLib, packageId, reason) {
-            getSourceFileFromReferenceWorker(fileName, function (fileName) { return findSourceFile(fileName, toPath(fileName), isDefaultLib, ignoreNoDefaultLib, reason, packageId); }, // TODO: GH#18217
+            getSourceFileFromReferenceWorker(fileName, function (fileName) { return findSourceFile(fileName, isDefaultLib, ignoreNoDefaultLib, reason, packageId); }, // TODO: GH#18217
             function (diagnostic) {
                 var args = [];
                 for (var _i = 1; _i < arguments.length; _i++) {
@@ -107805,19 +115045,20 @@ var ts;
             return redirect;
         }
         // Get source file from normalized fileName
-        function findSourceFile(fileName, path, isDefaultLib, ignoreNoDefaultLib, reason, packageId) {
+        function findSourceFile(fileName, isDefaultLib, ignoreNoDefaultLib, reason, packageId) {
             ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("program" /* Program */, "findSourceFile", {
                 fileName: fileName,
                 isDefaultLib: isDefaultLib || undefined,
                 fileIncludeKind: ts.FileIncludeKind[reason.kind],
             });
-            var result = findSourceFileWorker(fileName, path, isDefaultLib, ignoreNoDefaultLib, reason, packageId);
+            var result = findSourceFileWorker(fileName, isDefaultLib, ignoreNoDefaultLib, reason, packageId);
             ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
             return result;
         }
-        function findSourceFileWorker(fileName, path, isDefaultLib, ignoreNoDefaultLib, reason, packageId) {
+        function findSourceFileWorker(fileName, isDefaultLib, ignoreNoDefaultLib, reason, packageId) {
+            var path = toPath(fileName);
             if (useSourceOfProjectReferenceRedirect) {
-                var source = getSourceOfProjectReferenceRedirect(fileName);
+                var source = getSourceOfProjectReferenceRedirect(path);
                 // If preserveSymlinks is true, module resolution wont jump the symlink
                 // but the resolved real path may be the .d.ts from project reference
                 // Note:: Currently we try the real path only if the
@@ -107827,13 +115068,13 @@ var ts;
                     options.preserveSymlinks &&
                     ts.isDeclarationFileName(fileName) &&
                     ts.stringContains(fileName, ts.nodeModulesPathPart)) {
-                    var realPath = host.realpath(fileName);
-                    if (realPath !== fileName)
+                    var realPath = toPath(host.realpath(fileName));
+                    if (realPath !== path)
                         source = getSourceOfProjectReferenceRedirect(realPath);
                 }
                 if (source) {
                     var file_1 = ts.isString(source) ?
-                        findSourceFile(source, toPath(source), isDefaultLib, ignoreNoDefaultLib, reason, packageId) :
+                        findSourceFile(source, isDefaultLib, ignoreNoDefaultLib, reason, packageId) :
                         undefined;
                     if (file_1)
                         addFileToFilesByName(file_1, path, /*redirectedPath*/ undefined);
@@ -107901,7 +115142,7 @@ var ts;
                 }
             }
             // We haven't looked for this file, do so now and cache result
-            var file = host.getSourceFile(fileName, options.target, function (hostErrorMessage) { return addFilePreprocessingFileExplainingDiagnostic(/*file*/ undefined, reason, ts.Diagnostics.Cannot_read_file_0_Colon_1, [fileName, hostErrorMessage]); }, shouldCreateNewSourceFile);
+            var file = host.getSourceFile(fileName, ts.getEmitScriptTarget(options), function (hostErrorMessage) { return addFilePreprocessingFileExplainingDiagnostic(/*file*/ undefined, reason, ts.Diagnostics.Cannot_read_file_0_Colon_1, [fileName, hostErrorMessage]); }, shouldCreateNewSourceFile);
             if (packageId) {
                 var packageIdKey = ts.packageIdToString(packageId);
                 var fileFromPackageId = packageIdToSourceFile.get(packageIdKey);
@@ -107929,6 +115170,10 @@ var ts;
                 file.path = path;
                 file.resolvedPath = toPath(fileName);
                 file.originalFileName = originalFileName;
+                // It's a _little odd_ that we can't set `impliedNodeFormat` until the program step - but it's the first and only time we have a resolution cache
+                // and a freshly made source file node on hand at the same time, and we need both to set the field. Persisting the resolution cache all the way
+                // to the check and emit steps would be bad - so we much prefer detecting and storing the format information on the source file node upfront.
+                file.impliedNodeFormat = getImpliedNodeFormatForFile(file.resolvedPath, moduleResolutionCache === null || moduleResolutionCache === void 0 ? void 0 : moduleResolutionCache.getPackageJsonInfoCache(), host, options);
                 addFileIncludeReason(file, reason);
                 if (host.useCaseSensitiveFileNames()) {
                     var pathLowerCase = ts.toFileNameLowerCase(path);
@@ -108013,8 +115258,8 @@ var ts;
         function forEachResolvedProjectReference(cb) {
             return ts.forEachResolvedProjectReference(resolvedProjectReferences, cb);
         }
-        function getSourceOfProjectReferenceRedirect(file) {
-            if (!ts.isDeclarationFileName(file))
+        function getSourceOfProjectReferenceRedirect(path) {
+            if (!ts.isDeclarationFileName(path))
                 return undefined;
             if (mapFromToProjectReferenceRedirectSource === undefined) {
                 mapFromToProjectReferenceRedirectSource = new ts.Map();
@@ -108036,7 +115281,7 @@ var ts;
                     }
                 });
             }
-            return mapFromToProjectReferenceRedirectSource.get(toPath(file));
+            return mapFromToProjectReferenceRedirectSource.get(path);
         }
         function isSourceOfProjectReferenceRedirect(fileName) {
             return useSourceOfProjectReferenceRedirect && !!getResolvedProjectReferenceToRedirect(fileName);
@@ -108119,13 +115364,31 @@ var ts;
                 resolvedTypeReferenceDirectives.set(typeReferenceDirective, resolvedTypeReferenceDirective);
             }
         }
+        function pathForLibFile(libFileName) {
+            // Support resolving to lib.dom.d.ts -> @typescript/lib-dom, and
+            //                      lib.dom.iterable.d.ts -> @typescript/lib-dom/iterable
+            //                      lib.es2015.symbol.wellknown.d.ts -> @typescript/lib-es2015/symbol-wellknown
+            var components = libFileName.split(".");
+            var path = components[1];
+            var i = 2;
+            while (components[i] && components[i] !== "d") {
+                path += (i === 2 ? "/" : "-") + components[i];
+                i++;
+            }
+            var resolveFrom = ts.combinePaths(currentDirectory, "__lib_node_modules_lookup_".concat(libFileName, "__.ts"));
+            var localOverrideModuleResult = ts.resolveModuleName("@typescript/lib-" + path, resolveFrom, { moduleResolution: ts.ModuleResolutionKind.NodeJs }, host, moduleResolutionCache);
+            if (localOverrideModuleResult === null || localOverrideModuleResult === void 0 ? void 0 : localOverrideModuleResult.resolvedModule) {
+                return localOverrideModuleResult.resolvedModule.resolvedFileName;
+            }
+            return ts.combinePaths(defaultLibraryPath, libFileName);
+        }
         function processLibReferenceDirectives(file) {
             ts.forEach(file.libReferenceDirectives, function (libReference, index) {
                 var libName = ts.toFileNameLowerCase(libReference.fileName);
                 var libFileName = ts.libMap.get(libName);
                 if (libFileName) {
                     // we ignore any 'no-default-lib' reference set on this file.
-                    processRootFile(ts.combinePaths(defaultLibraryPath, libFileName), /*isDefaultLib*/ true, /*ignoreNoDefaultLib*/ true, { kind: ts.FileIncludeKind.LibReferenceDirective, file: file.path, index: index, });
+                    processRootFile(pathForLibFile(libFileName), /*isDefaultLib*/ true, /*ignoreNoDefaultLib*/ true, { kind: ts.FileIncludeKind.LibReferenceDirective, file: file.path, index: index, });
                 }
                 else {
                     var unqualifiedLibName = ts.removeSuffix(ts.removePrefix(libName, "lib."), ".d.ts");
@@ -108144,15 +115407,17 @@ var ts;
             return host.getCanonicalFileName(fileName);
         }
         function processImportedModules(file) {
+            var _a;
             collectExternalModuleReferences(file);
             if (file.imports.length || file.moduleAugmentations.length) {
                 // Because global augmentation doesn't have string literal name, we can check for global augmentation as such.
                 var moduleNames = getModuleNames(file);
                 var resolutions = resolveModuleNamesReusingOldState(moduleNames, file);
                 ts.Debug.assert(resolutions.length === moduleNames.length);
+                var optionsForFile = (useSourceOfProjectReferenceRedirect ? (_a = getRedirectReferenceForResolution(file)) === null || _a === void 0 ? void 0 : _a.commandLine.options : undefined) || options;
                 for (var index = 0; index < moduleNames.length; index++) {
                     var resolution = resolutions[index];
-                    ts.setResolvedModule(file, moduleNames[index], resolution);
+                    ts.setResolvedModule(file, moduleNames[index], resolution, getModeForResolutionAtIndex(file, index));
                     if (!resolution) {
                         continue;
                     }
@@ -108172,18 +115437,17 @@ var ts;
                     // Don't add the file if it has a bad extension (e.g. 'tsx' if we don't have '--allowJs')
                     // This may still end up being an untyped module -- the file won't be included but imports will be allowed.
                     var shouldAddFile = resolvedFileName
-                        && !getResolutionDiagnostic(options, resolution)
-                        && !options.noResolve
+                        && !getResolutionDiagnostic(optionsForFile, resolution)
+                        && !optionsForFile.noResolve
                         && index < file.imports.length
                         && !elideImport
-                        && !(isJsFile && !ts.getAllowJSCompilerOption(options))
+                        && !(isJsFile && !ts.getAllowJSCompilerOption(optionsForFile))
                         && (ts.isInJSFile(file.imports[index]) || !(file.imports[index].flags & 4194304 /* JSDoc */));
                     if (elideImport) {
                         modulesWithElidedImports.set(file.path, true);
                     }
                     else if (shouldAddFile) {
-                        var path = toPath(resolvedFileName);
-                        findSourceFile(resolvedFileName, path, 
+                        findSourceFile(resolvedFileName, 
                         /*isDefaultLib*/ false, 
                         /*ignoreNoDefaultLib*/ false, { kind: ts.FileIncludeKind.Import, file: file.path, index: index, }, resolution.packageId);
                     }
@@ -108259,9 +115523,27 @@ var ts;
             return resolvedRef;
         }
         function verifyCompilerOptions() {
+            var isNightly = ts.stringContains(ts.version, "-dev");
+            if (!isNightly) {
+                if (ts.getEmitModuleKind(options) === ts.ModuleKind.Node12) {
+                    createOptionValueDiagnostic("module", ts.Diagnostics.Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next, "module", "node12");
+                }
+                else if (ts.getEmitModuleKind(options) === ts.ModuleKind.NodeNext) {
+                    createOptionValueDiagnostic("module", ts.Diagnostics.Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next, "module", "nodenext");
+                }
+                else if (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node12) {
+                    createOptionValueDiagnostic("moduleResolution", ts.Diagnostics.Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next, "moduleResolution", "node12");
+                }
+                else if (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext) {
+                    createOptionValueDiagnostic("moduleResolution", ts.Diagnostics.Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next, "moduleResolution", "nodenext");
+                }
+            }
             if (options.strictPropertyInitialization && !ts.getStrictOptionValue(options, "strictNullChecks")) {
                 createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "strictPropertyInitialization", "strictNullChecks");
             }
+            if (options.exactOptionalPropertyTypes && !ts.getStrictOptionValue(options, "strictNullChecks")) {
+                createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "exactOptionalPropertyTypes", "strictNullChecks");
+            }
             if (options.isolatedModules) {
                 if (options.out) {
                     createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "out", "isolatedModules");
@@ -108299,8 +115581,8 @@ var ts;
             // List of collected files is complete; validate exhautiveness if this is a project with a file list
             if (options.composite) {
                 var rootPaths = new ts.Set(rootNames.map(toPath));
-                for (var _i = 0, files_3 = files; _i < files_3.length; _i++) {
-                    var file = files_3[_i];
+                for (var _i = 0, files_4 = files; _i < files_4.length; _i++) {
+                    var file = files_4[_i];
                     // Ignore file that is not emitted
                     if (ts.sourceFileMayBeEmitted(file, program) && !rootPaths.has(file.path)) {
                         addProgramDiagnosticExplainingFile(file, ts.Diagnostics.File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern, [file.fileName, options.configFilePath || ""]);
@@ -108373,7 +115655,7 @@ var ts;
             if (options.noImplicitUseStrict && ts.getStrictOptionValue(options, "alwaysStrict")) {
                 createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "noImplicitUseStrict", "alwaysStrict");
             }
-            var languageVersion = options.target || 0 /* ES3 */;
+            var languageVersion = ts.getEmitScriptTarget(options);
             var firstNonAmbientExternalModuleSourceFile = ts.find(files, function (f) { return ts.isExternalModule(f) && !f.isDeclarationFile; });
             if (options.isolatedModules) {
                 if (options.module === ts.ModuleKind.None && languageVersion < 2 /* ES2015 */) {
@@ -108404,7 +115686,9 @@ var ts;
                 }
             }
             if (options.resolveJsonModule) {
-                if (ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeJs) {
+                if (ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeJs &&
+                    ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.Node12 &&
+                    ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeNext) {
                     createDiagnosticForOptionName(ts.Diagnostics.Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy, "resolveJsonModule");
                 }
                 // Any emit other than common js, amd, es2015 or esnext is error
@@ -108412,9 +115696,10 @@ var ts;
                     createDiagnosticForOptionName(ts.Diagnostics.Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_esNext, "resolveJsonModule", "module");
                 }
             }
-            // there has to be common source directory if user specified --outdir || --sourceRoot
+            // there has to be common source directory if user specified --outdir || --rootDir || --sourceRoot
             // if user specified --mapRoot, there needs to be common source directory if there would be multiple files being emitted
             if (options.outDir || // there is --outDir specified
+                options.rootDir || // there is --rootDir specified
                 options.sourceRoot || // there is --sourceRoot specified
                 options.mapRoot) { // there is --mapRoot specified
                 // Precalculate and cache the common source directory
@@ -108477,6 +115762,9 @@ var ts;
                     createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1, "jsxImportSource", ts.inverseJsxOptionMap.get("" + options.jsx));
                 }
             }
+            if (options.preserveValueImports && ts.getEmitModuleKind(options) < ts.ModuleKind.ES2015) {
+                createOptionValueDiagnostic("importsNotUsedAsValues", ts.Diagnostics.Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later);
+            }
             // If the emit is enabled make sure that every output file is unique and not overwriting any of the input files
             if (!options.noEmit && !options.suppressOutputPathCheck) {
                 var emitHost = getEmitHost();
@@ -108529,7 +115817,7 @@ var ts;
             var location = locationReason && getReferencedFileLocation(getSourceFileByPath, locationReason);
             var fileIncludeReasonDetails = fileIncludeReasons && ts.chainDiagnosticMessages(fileIncludeReasons, ts.Diagnostics.The_file_is_in_the_program_because_Colon);
             var redirectInfo = file && ts.explainIfFileIsRedirect(file);
-            var chain = ts.chainDiagnosticMessages.apply(void 0, __spreadArray([redirectInfo ? fileIncludeReasonDetails ? __spreadArray([fileIncludeReasonDetails], redirectInfo) : redirectInfo : fileIncludeReasonDetails, diagnostic], args || ts.emptyArray));
+            var chain = ts.chainDiagnosticMessages.apply(void 0, __spreadArray([redirectInfo ? fileIncludeReasonDetails ? __spreadArray([fileIncludeReasonDetails], redirectInfo, true) : redirectInfo : fileIncludeReasonDetails, diagnostic], args || ts.emptyArray, false));
             return location && isReferenceFileLocation(location) ?
                 ts.createFileDiagnosticFromMessageChain(location.file, location.pos, location.end - location.pos, chain, relatedInfo) :
                 ts.createCompilerDiagnosticFromMessageChain(chain, relatedInfo);
@@ -108630,7 +115918,7 @@ var ts;
                         message = ts.Diagnostics.File_is_library_specified_here;
                         break;
                     }
-                    var target = ts.forEachEntry(ts.targetOptionDeclaration.type, function (value, key) { return value === options.target ? key : undefined; });
+                    var target = ts.forEachEntry(ts.targetOptionDeclaration.type, function (value, key) { return value === ts.getEmitScriptTarget(options) ? key : undefined; });
                     configFileNode = target ? getOptionsSyntaxByValue("target", target) : undefined;
                     message = ts.Diagnostics.File_is_default_library_for_target_specified_here;
                     break;
@@ -108728,8 +116016,8 @@ var ts;
         function createDiagnosticForOptionName(message, option1, option2, option3) {
             createDiagnosticForOption(/*onKey*/ true, option1, option2, message, option1, option2, option3);
         }
-        function createOptionValueDiagnostic(option1, message, arg0) {
-            createDiagnosticForOption(/*onKey*/ false, option1, /*option2*/ undefined, message, arg0);
+        function createOptionValueDiagnostic(option1, message, arg0, arg1) {
+            createDiagnosticForOption(/*onKey*/ false, option1, /*option2*/ undefined, message, arg0, arg1);
         }
         function createDiagnosticForReference(sourceFile, index, message, arg0, arg1) {
             var referencesSyntax = ts.firstDefined(ts.getTsConfigPropArray(sourceFile || options.configFile, "references"), function (property) { return ts.isArrayLiteralExpression(property.initializer) ? property.initializer : undefined; });
@@ -108798,7 +116086,7 @@ var ts;
             if (options.outDir) {
                 return ts.containsPath(options.outDir, filePath, currentDirectory, !host.useCaseSensitiveFileNames());
             }
-            if (ts.fileExtensionIsOneOf(filePath, ts.supportedJSExtensions) || ts.fileExtensionIs(filePath, ".d.ts" /* Dts */)) {
+            if (ts.fileExtensionIsOneOf(filePath, ts.supportedJSExtensionsFlat) || ts.fileExtensionIs(filePath, ".d.ts" /* Dts */)) {
                 // Otherwise just check if sourceFile with the name exists
                 var filePathWithoutExtension = ts.removeFileExtension(filePath);
                 return !!getSourceFileByPath((filePathWithoutExtension + ".ts" /* Ts */)) ||
@@ -108813,7 +116101,13 @@ var ts;
             if (host.getSymlinkCache) {
                 return host.getSymlinkCache();
             }
-            return symlinks || (symlinks = ts.discoverProbableSymlinks(files, getCanonicalFileName, host.getCurrentDirectory()));
+            if (!symlinks) {
+                symlinks = ts.createSymlinkCache(currentDirectory, getCanonicalFileName);
+            }
+            if (files && resolvedTypeReferenceDirectives && !symlinks.hasProcessedResolutions()) {
+                symlinks.setSymlinksFromResolutions(files, resolvedTypeReferenceDirectives);
+            }
+            return symlinks;
         }
     }
     ts.createProgram = createProgram;
@@ -108895,19 +116189,19 @@ var ts;
             return fileOrDirectoryExistsUsingSource(file, /*isFile*/ true);
         }
         function fileExistsIfProjectReferenceDts(file) {
-            var source = host.getSourceOfProjectReferenceRedirect(file);
+            var source = host.getSourceOfProjectReferenceRedirect(host.toPath(file));
             return source !== undefined ?
                 ts.isString(source) ? originalFileExists.call(host.compilerHost, source) : true :
                 undefined;
         }
         function directoryExistsIfProjectReferenceDeclDir(dir) {
             var dirPath = host.toPath(dir);
-            var dirPathWithTrailingDirectorySeparator = "" + dirPath + ts.directorySeparator;
+            var dirPathWithTrailingDirectorySeparator = "".concat(dirPath).concat(ts.directorySeparator);
             return ts.forEachKey(setOfDeclarationDirectories, function (declDirPath) { return dirPath === declDirPath ||
                 // Any parent directory of declaration dir
                 ts.startsWith(declDirPath, dirPathWithTrailingDirectorySeparator) ||
                 // Any directory inside declaration dir
-                ts.startsWith(dirPath, declDirPath + "/"); });
+                ts.startsWith(dirPath, "".concat(declDirPath, "/")); });
         }
         function handleDirectoryCouldBeSymlink(directory) {
             var _a;
@@ -108960,7 +116254,7 @@ var ts;
                 if (isFile && result) {
                     // Store the real path for the file'
                     var absolutePath = ts.getNormalizedAbsolutePath(fileOrDirectory, host.compilerHost.getCurrentDirectory());
-                    symlinkCache.setSymlinkedFile(fileOrDirectoryPath, "" + symlinkedDirectory.real + absolutePath.replace(new RegExp(directoryPath, "i"), ""));
+                    symlinkCache.setSymlinkedFile(fileOrDirectoryPath, "".concat(symlinkedDirectory.real).concat(absolutePath.replace(new RegExp(directoryPath, "i"), "")));
                 }
                 return result;
             }) || false;
@@ -108983,7 +116277,7 @@ var ts;
         // get any preEmit diagnostics, not just the ones
         if (!options.noEmitOnError)
             return undefined;
-        var diagnostics = __spreadArray(__spreadArray(__spreadArray(__spreadArray([], program.getOptionsDiagnostics(cancellationToken)), program.getSyntacticDiagnostics(sourceFile, cancellationToken)), program.getGlobalDiagnostics(cancellationToken)), program.getSemanticDiagnostics(sourceFile, cancellationToken));
+        var diagnostics = __spreadArray(__spreadArray(__spreadArray(__spreadArray([], program.getOptionsDiagnostics(cancellationToken), true), program.getSyntacticDiagnostics(sourceFile, cancellationToken), true), program.getGlobalDiagnostics(cancellationToken), true), program.getSemanticDiagnostics(sourceFile, cancellationToken), true);
         if (diagnostics.length === 0 && ts.getEmitDeclarations(program.getCompilerOptions())) {
             diagnostics = program.getDeclarationDiagnostics(/*sourceFile*/ undefined, cancellationToken);
         }
@@ -108993,17 +116287,17 @@ var ts;
         if (!sourceFile && !ts.outFile(options)) {
             var emitResult = program.emitBuildInfo(writeFile, cancellationToken);
             if (emitResult.diagnostics)
-                diagnostics = __spreadArray(__spreadArray([], diagnostics), emitResult.diagnostics);
+                diagnostics = __spreadArray(__spreadArray([], diagnostics, true), emitResult.diagnostics, true);
             emittedFiles = emitResult.emittedFiles;
         }
         return { diagnostics: diagnostics, sourceMaps: undefined, emittedFiles: emittedFiles, emitSkipped: true };
     }
     ts.handleNoEmitOptions = handleNoEmitOptions;
     /*@internal*/
-    function filterSemanticDiagnotics(diagnostic, option) {
+    function filterSemanticDiagnostics(diagnostic, option) {
         return ts.filter(diagnostic, function (d) { return !d.skippedOn || !option[d.skippedOn]; });
     }
-    ts.filterSemanticDiagnotics = filterSemanticDiagnotics;
+    ts.filterSemanticDiagnostics = filterSemanticDiagnostics;
     /* @internal */
     function parseConfigHostFromCompilerHostLike(host, directoryStructureHost) {
         if (directoryStructureHost === void 0) { directoryStructureHost = host; }
@@ -109125,21 +116419,86 @@ var ts;
     ts.getFileEmitOutput = getFileEmitOutput;
     var BuilderState;
     (function (BuilderState) {
-        /**
-         * Get the referencedFile from the imported module symbol
-         */
-        function getReferencedFileFromImportedModuleSymbol(symbol) {
-            if (symbol.declarations && symbol.declarations[0]) {
-                var declarationSourceFile = ts.getSourceFileOfNode(symbol.declarations[0]);
-                return declarationSourceFile && declarationSourceFile.resolvedPath;
+        var manyToManyPathMapCount = 0;
+        function createManyToManyPathMap() {
+            function create(forward, reverse, deleted) {
+                var version = 0;
+                var map = {
+                    id: manyToManyPathMapCount++,
+                    version: function () { return version; },
+                    clone: function () { return create(new ts.Map(forward), new ts.Map(reverse), deleted && new ts.Set(deleted)); },
+                    forEach: function (fn) { return forward.forEach(fn); },
+                    getKeys: function (v) { return reverse.get(v); },
+                    getValues: function (k) { return forward.get(k); },
+                    hasKey: function (k) { return forward.has(k); },
+                    keys: function () { return forward.keys(); },
+                    deletedKeys: function () { return deleted; },
+                    deleteKey: function (k) {
+                        (deleted || (deleted = new ts.Set())).add(k);
+                        var set = forward.get(k);
+                        if (!set) {
+                            return false;
+                        }
+                        set.forEach(function (v) { return deleteFromMultimap(reverse, v, k); });
+                        forward.delete(k);
+                        version++;
+                        return true;
+                    },
+                    set: function (k, vSet) {
+                        var changed = !!(deleted === null || deleted === void 0 ? void 0 : deleted.delete(k));
+                        var existingVSet = forward.get(k);
+                        forward.set(k, vSet);
+                        existingVSet === null || existingVSet === void 0 ? void 0 : existingVSet.forEach(function (v) {
+                            if (!vSet.has(v)) {
+                                changed = true;
+                                deleteFromMultimap(reverse, v, k);
+                            }
+                        });
+                        vSet.forEach(function (v) {
+                            if (!(existingVSet === null || existingVSet === void 0 ? void 0 : existingVSet.has(v))) {
+                                changed = true;
+                                addToMultimap(reverse, v, k);
+                            }
+                        });
+                        if (changed) {
+                            version++;
+                        }
+                        return map;
+                    },
+                };
+                return map;
             }
+            return create(new ts.Map(), new ts.Map(), /*deleted*/ undefined);
+        }
+        BuilderState.createManyToManyPathMap = createManyToManyPathMap;
+        function addToMultimap(map, k, v) {
+            var set = map.get(k);
+            if (!set) {
+                set = new ts.Set();
+                map.set(k, set);
+            }
+            set.add(v);
+        }
+        function deleteFromMultimap(map, k, v, removeEmpty) {
+            if (removeEmpty === void 0) { removeEmpty = true; }
+            var set = map.get(k);
+            if (set === null || set === void 0 ? void 0 : set.delete(v)) {
+                if (removeEmpty && !set.size) {
+                    map.delete(k);
+                }
+                return true;
+            }
+            return false;
+        }
+        function getReferencedFilesFromImportedModuleSymbol(symbol) {
+            return ts.mapDefined(symbol.declarations, function (declaration) { var _a; return (_a = ts.getSourceFileOfNode(declaration)) === null || _a === void 0 ? void 0 : _a.resolvedPath; });
         }
         /**
-         * Get the referencedFile from the import name node from file
+         * Get the module source file and all augmenting files from the import name node from file
          */
-        function getReferencedFileFromImportLiteral(checker, importName) {
+        function getReferencedFilesFromImportLiteral(checker, importName) {
             var symbol = checker.getSymbolAtLocation(importName);
-            return symbol && getReferencedFileFromImportedModuleSymbol(symbol);
+            return symbol && getReferencedFilesFromImportedModuleSymbol(symbol);
         }
         /**
          * Gets the path to reference file from file name, it could be resolvedPath if present otherwise path
@@ -109159,10 +116518,8 @@ var ts;
                 var checker = program.getTypeChecker();
                 for (var _i = 0, _a = sourceFile.imports; _i < _a.length; _i++) {
                     var importName = _a[_i];
-                    var declarationSourceFilePath = getReferencedFileFromImportLiteral(checker, importName);
-                    if (declarationSourceFilePath) {
-                        addReferencedFile(declarationSourceFilePath);
-                    }
+                    var declarationSourceFilePaths = getReferencedFilesFromImportLiteral(checker, importName);
+                    declarationSourceFilePaths === null || declarationSourceFilePaths === void 0 ? void 0 : declarationSourceFilePaths.forEach(addReferencedFile);
                 }
             }
             var sourceFileDirectory = ts.getDirectoryPath(sourceFile.resolvedPath);
@@ -109190,13 +116547,11 @@ var ts;
                 var checker = program.getTypeChecker();
                 for (var _d = 0, _e = sourceFile.moduleAugmentations; _d < _e.length; _d++) {
                     var moduleName = _e[_d];
-                    if (!ts.isStringLiteral(moduleName)) {
+                    if (!ts.isStringLiteral(moduleName))
                         continue;
-                    }
                     var symbol = checker.getSymbolAtLocation(moduleName);
-                    if (!symbol) {
+                    if (!symbol)
                         continue;
-                    }
                     // Add any file other than our own as reference
                     addReferenceFromAmbientModule(symbol);
                 }
@@ -109204,12 +116559,15 @@ var ts;
             // From ambient modules
             for (var _f = 0, _g = program.getTypeChecker().getAmbientModules(); _f < _g.length; _f++) {
                 var ambientModule = _g[_f];
-                if (ambientModule.declarations.length > 1) {
+                if (ambientModule.declarations && ambientModule.declarations.length > 1) {
                     addReferenceFromAmbientModule(ambientModule);
                 }
             }
             return referencedFiles;
             function addReferenceFromAmbientModule(symbol) {
+                if (!symbol.declarations) {
+                    return;
+                }
                 // Add any file other than our own as reference
                 for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
                     var declaration = _a[_i];
@@ -109234,10 +116592,10 @@ var ts;
         /**
          * Creates the state of file references and signature for the new program from oldState if it is safe
          */
-        function create(newProgram, getCanonicalFileName, oldState) {
+        function create(newProgram, getCanonicalFileName, oldState, disableUseFileVersionAsSignature) {
             var fileInfos = new ts.Map();
-            var referencedMap = newProgram.getCompilerOptions().module !== ts.ModuleKind.None ? new ts.Map() : undefined;
-            var exportedModulesMap = referencedMap ? new ts.Map() : undefined;
+            var referencedMap = newProgram.getCompilerOptions().module !== ts.ModuleKind.None ? createManyToManyPathMap() : undefined;
+            var exportedModulesMap = referencedMap ? createManyToManyPathMap() : undefined;
             var hasCalledUpdateShapeSignature = new ts.Set();
             var useOldState = canReuseOldState(referencedMap, oldState);
             // Ensure source files have parent pointers set
@@ -109254,19 +116612,20 @@ var ts;
                     }
                     // Copy old visible to outside files map
                     if (useOldState) {
-                        var exportedModules = oldState.exportedModulesMap.get(sourceFile.resolvedPath);
+                        var exportedModules = oldState.exportedModulesMap.getValues(sourceFile.resolvedPath);
                         if (exportedModules) {
                             exportedModulesMap.set(sourceFile.resolvedPath, exportedModules);
                         }
                     }
                 }
-                fileInfos.set(sourceFile.resolvedPath, { version: version_2, signature: oldInfo && oldInfo.signature, affectsGlobalScope: isFileAffectingGlobalScope(sourceFile) });
+                fileInfos.set(sourceFile.resolvedPath, { version: version_2, signature: oldInfo && oldInfo.signature, affectsGlobalScope: isFileAffectingGlobalScope(sourceFile) || undefined, impliedFormat: sourceFile.impliedNodeFormat });
             }
             return {
                 fileInfos: fileInfos,
                 referencedMap: referencedMap,
                 exportedModulesMap: exportedModulesMap,
-                hasCalledUpdateShapeSignature: hasCalledUpdateShapeSignature
+                hasCalledUpdateShapeSignature: hasCalledUpdateShapeSignature,
+                useFileVersionAsSignature: !disableUseFileVersionAsSignature && !useOldState
             };
         }
         BuilderState.create = create;
@@ -109282,12 +116641,14 @@ var ts;
          * Creates a clone of the state
          */
         function clone(state) {
+            var _a, _b;
             // Dont need to backup allFiles info since its cache anyway
             return {
                 fileInfos: new ts.Map(state.fileInfos),
-                referencedMap: state.referencedMap && new ts.Map(state.referencedMap),
-                exportedModulesMap: state.exportedModulesMap && new ts.Map(state.exportedModulesMap),
+                referencedMap: (_a = state.referencedMap) === null || _a === void 0 ? void 0 : _a.clone(),
+                exportedModulesMap: (_b = state.exportedModulesMap) === null || _b === void 0 ? void 0 : _b.clone(),
                 hasCalledUpdateShapeSignature: new ts.Set(state.hasCalledUpdateShapeSignature),
+                useFileVersionAsSignature: state.useFileVersionAsSignature,
             };
         }
         BuilderState.clone = clone;
@@ -109331,7 +116692,8 @@ var ts;
         /**
          * Returns if the shape of the signature has changed since last emit
          */
-        function updateShapeSignature(state, programOfThisState, sourceFile, cacheToUpdateSignature, cancellationToken, computeHash, exportedModulesMapCache) {
+        function updateShapeSignature(state, programOfThisState, sourceFile, cacheToUpdateSignature, cancellationToken, computeHash, exportedModulesMapCache, useFileVersionAsSignature) {
+            if (useFileVersionAsSignature === void 0) { useFileVersionAsSignature = state.useFileVersionAsSignature; }
             ts.Debug.assert(!!sourceFile);
             ts.Debug.assert(!exportedModulesMapCache || !!state.exportedModulesMap, "Compute visible to outside map only if visibleToOutsideReferencedMap present in the state");
             // If we have cached the result for this file, that means hence forth we should assume file shape is uptodate
@@ -109343,36 +116705,36 @@ var ts;
                 return ts.Debug.fail();
             var prevSignature = info.signature;
             var latestSignature;
-            if (sourceFile.isDeclarationFile) {
-                latestSignature = sourceFile.version;
-                if (exportedModulesMapCache && latestSignature !== prevSignature) {
-                    // All the references in this file are exported
-                    var references = state.referencedMap ? state.referencedMap.get(sourceFile.resolvedPath) : undefined;
-                    exportedModulesMapCache.set(sourceFile.resolvedPath, references || false);
-                }
-            }
-            else {
+            if (!sourceFile.isDeclarationFile && !useFileVersionAsSignature) {
                 var emitOutput_1 = getFileEmitOutput(programOfThisState, sourceFile, 
                 /*emitOnlyDtsFiles*/ true, cancellationToken, 
                 /*customTransformers*/ undefined, 
                 /*forceDtsEmit*/ true);
-                var firstDts_1 = emitOutput_1.outputFiles &&
-                    programOfThisState.getCompilerOptions().declarationMap ?
-                    emitOutput_1.outputFiles.length > 1 ? emitOutput_1.outputFiles[1] : undefined :
-                    emitOutput_1.outputFiles.length > 0 ? emitOutput_1.outputFiles[0] : undefined;
+                var firstDts_1 = ts.firstOrUndefined(emitOutput_1.outputFiles);
                 if (firstDts_1) {
-                    ts.Debug.assert(ts.fileExtensionIs(firstDts_1.name, ".d.ts" /* Dts */), "File extension for signature expected to be dts", function () { return "Found: " + ts.getAnyExtensionFromPath(firstDts_1.name) + " for " + firstDts_1.name + ":: All output files: " + JSON.stringify(emitOutput_1.outputFiles.map(function (f) { return f.name; })); });
+                    ts.Debug.assert(ts.fileExtensionIsOneOf(firstDts_1.name, [".d.ts" /* Dts */, ".d.mts" /* Dmts */, ".d.cts" /* Dcts */]), "File extension for signature expected to be dts", function () { return "Found: ".concat(ts.getAnyExtensionFromPath(firstDts_1.name), " for ").concat(firstDts_1.name, ":: All output files: ").concat(JSON.stringify(emitOutput_1.outputFiles.map(function (f) { return f.name; }))); });
                     latestSignature = (computeHash || ts.generateDjb2Hash)(firstDts_1.text);
                     if (exportedModulesMapCache && latestSignature !== prevSignature) {
                         updateExportedModules(sourceFile, emitOutput_1.exportedModulesFromDeclarationEmit, exportedModulesMapCache);
                     }
                 }
-                else {
-                    latestSignature = prevSignature; // TODO: GH#18217
+            }
+            // Default is to use file version as signature
+            if (latestSignature === undefined) {
+                latestSignature = sourceFile.version;
+                if (exportedModulesMapCache && latestSignature !== prevSignature) {
+                    // All the references in this file are exported
+                    var references = state.referencedMap ? state.referencedMap.getValues(sourceFile.resolvedPath) : undefined;
+                    if (references) {
+                        exportedModulesMapCache.set(sourceFile.resolvedPath, references);
+                    }
+                    else {
+                        exportedModulesMapCache.deleteKey(sourceFile.resolvedPath);
+                    }
                 }
             }
             cacheToUpdateSignature.set(sourceFile.resolvedPath, latestSignature);
-            return !prevSignature || latestSignature !== prevSignature;
+            return latestSignature !== prevSignature;
         }
         BuilderState.updateShapeSignature = updateShapeSignature;
         /**
@@ -109380,18 +116742,23 @@ var ts;
          */
         function updateExportedModules(sourceFile, exportedModulesFromDeclarationEmit, exportedModulesMapCache) {
             if (!exportedModulesFromDeclarationEmit) {
-                exportedModulesMapCache.set(sourceFile.resolvedPath, false);
+                exportedModulesMapCache.deleteKey(sourceFile.resolvedPath);
                 return;
             }
             var exportedModules;
-            exportedModulesFromDeclarationEmit.forEach(function (symbol) { return addExportedModule(getReferencedFileFromImportedModuleSymbol(symbol)); });
-            exportedModulesMapCache.set(sourceFile.resolvedPath, exportedModules || false);
-            function addExportedModule(exportedModulePath) {
-                if (exportedModulePath) {
+            exportedModulesFromDeclarationEmit.forEach(function (symbol) { return addExportedModule(getReferencedFilesFromImportedModuleSymbol(symbol)); });
+            if (exportedModules) {
+                exportedModulesMapCache.set(sourceFile.resolvedPath, exportedModules);
+            }
+            else {
+                exportedModulesMapCache.deleteKey(sourceFile.resolvedPath);
+            }
+            function addExportedModule(exportedModulePaths) {
+                if (exportedModulePaths === null || exportedModulePaths === void 0 ? void 0 : exportedModulePaths.length) {
                     if (!exportedModules) {
                         exportedModules = new ts.Set();
                     }
-                    exportedModules.add(exportedModulePath);
+                    exportedModulePaths.forEach(function (path) { return exportedModules.add(path); });
                 }
             }
         }
@@ -109400,16 +116767,25 @@ var ts;
          * This should be called whenever it is safe to commit the state of the builder
          */
         function updateExportedFilesMapFromCache(state, exportedModulesMapCache) {
+            var _a;
             if (exportedModulesMapCache) {
                 ts.Debug.assert(!!state.exportedModulesMap);
-                exportedModulesMapCache.forEach(function (exportedModules, path) {
-                    if (exportedModules) {
-                        state.exportedModulesMap.set(path, exportedModules);
-                    }
-                    else {
-                        state.exportedModulesMap.delete(path);
+                var cacheId = exportedModulesMapCache.id;
+                var cacheVersion = exportedModulesMapCache.version();
+                if (state.previousCache) {
+                    if (state.previousCache.id === cacheId && state.previousCache.version === cacheVersion) {
+                        // If this is the same cache at the same version as last time this BuilderState
+                        // was updated, there's no need to update again
+                        return;
                     }
-                });
+                    state.previousCache.id = cacheId;
+                    state.previousCache.version = cacheVersion;
+                }
+                else {
+                    state.previousCache = { id: cacheId, version: cacheVersion };
+                }
+                (_a = exportedModulesMapCache.deletedKeys()) === null || _a === void 0 ? void 0 : _a.forEach(function (path) { return state.exportedModulesMap.deleteKey(path); });
+                exportedModulesMapCache.forEach(function (exportedModules, path) { return state.exportedModulesMap.set(path, exportedModules); });
             }
         }
         BuilderState.updateExportedFilesMapFromCache = updateExportedFilesMapFromCache;
@@ -109433,7 +116809,7 @@ var ts;
                 var path = queue.pop();
                 if (!seenMap.has(path)) {
                     seenMap.add(path);
-                    var references = state.referencedMap.get(path);
+                    var references = state.referencedMap.getValues(path);
                     if (references) {
                         var iterator = references.keys();
                         for (var iterResult = iterator.next(); !iterResult.done; iterResult = iterator.next()) {
@@ -109459,10 +116835,8 @@ var ts;
          * Gets the files referenced by the the file path
          */
         function getReferencedByPaths(state, referencedFilePath) {
-            return ts.arrayFrom(ts.mapDefinedIterator(state.referencedMap.entries(), function (_a) {
-                var filePath = _a[0], referencesInFile = _a[1];
-                return referencesInFile.has(referencedFilePath) ? filePath : undefined;
-            }));
+            var keys = state.referencedMap.getKeys(referencedFilePath);
+            return keys ? ts.arrayFrom(keys.keys()) : [];
         }
         BuilderState.getReferencedByPaths = getReferencedByPaths;
         /**
@@ -109492,7 +116866,7 @@ var ts;
          */
         function isFileAffectingGlobalScope(sourceFile) {
             return containsGlobalScopeAugmentation(sourceFile) ||
-                !ts.isExternalModule(sourceFile) && !containsOnlyAmbientModules(sourceFile);
+                !ts.isExternalOrCommonJsModule(sourceFile) && !ts.isJsonSourceFile(sourceFile) && !containsOnlyAmbientModules(sourceFile);
         }
         /**
          * Gets all files of the program excluding the default library file
@@ -109580,8 +116954,8 @@ var ts;
     /**
      * Create the state so that we can iterate on changedFiles/affected files
      */
-    function createBuilderProgramState(newProgram, getCanonicalFileName, oldState) {
-        var state = ts.BuilderState.create(newProgram, getCanonicalFileName, oldState);
+    function createBuilderProgramState(newProgram, getCanonicalFileName, oldState, disableUseFileVersionAsSignature) {
+        var state = ts.BuilderState.create(newProgram, getCanonicalFileName, oldState, disableUseFileVersionAsSignature);
         state.program = newProgram;
         var compilerOptions = newProgram.getCompilerOptions();
         state.compilerOptions = compilerOptions;
@@ -109628,7 +117002,7 @@ var ts;
                 // versions dont match
                 oldInfo.version !== info.version ||
                 // Referenced files changed
-                !hasSameKeys(newReferences = referencedMap && referencedMap.get(sourceFilePath), oldReferencedMap && oldReferencedMap.get(sourceFilePath)) ||
+                !hasSameKeys(newReferences = referencedMap && referencedMap.getValues(sourceFilePath), oldReferencedMap && oldReferencedMap.getValues(sourceFilePath)) ||
                 // Referenced file was deleted in the new program
                 newReferences && ts.forEachKey(newReferences, function (path) { return !state.fileInfos.has(path) && oldState.fileInfos.has(path); })) {
                 // Register file as changed file and do not copy semantic diagnostics, since all changed files need to be re-evaluated
@@ -109636,12 +117010,10 @@ var ts;
             }
             else if (canCopySemanticDiagnostics) {
                 var sourceFile = newProgram.getSourceFileByPath(sourceFilePath);
-                if (sourceFile.isDeclarationFile && !copyDeclarationFileDiagnostics) {
+                if (sourceFile.isDeclarationFile && !copyDeclarationFileDiagnostics)
                     return;
-                }
-                if (sourceFile.hasNoDefaultLib && !copyLibFileDiagnostics) {
+                if (sourceFile.hasNoDefaultLib && !copyLibFileDiagnostics)
                     return;
-                }
                 // Unchanged file copy diagnostics
                 var diagnostics = oldState.semanticDiagnosticsPerFile.get(sourceFilePath);
                 if (diagnostics) {
@@ -109664,6 +117036,14 @@ var ts;
             ts.Debug.assert(!state.seenAffectedFiles || !state.seenAffectedFiles.size);
             state.seenAffectedFiles = state.seenAffectedFiles || new ts.Set();
         }
+        if (useOldState) {
+            // Any time the interpretation of a source file changes, mark it as changed
+            ts.forEachEntry(oldState.fileInfos, function (info, sourceFilePath) {
+                if (state.fileInfos.has(sourceFilePath) && state.fileInfos.get(sourceFilePath).impliedFormat !== info.impliedFormat) {
+                    state.changedFilesSet.add(sourceFilePath);
+                }
+            });
+        }
         state.buildInfoEmitPending = !!state.changedFilesSet.size;
         return state;
     }
@@ -109704,6 +117084,7 @@ var ts;
      * Creates a clone of the state
      */
     function cloneBuilderProgramState(state) {
+        var _a;
         var newState = ts.BuilderState.clone(state);
         newState.semanticDiagnosticsPerFile = state.semanticDiagnosticsPerFile && new ts.Map(state.semanticDiagnosticsPerFile);
         newState.changedFilesSet = new ts.Set(state.changedFilesSet);
@@ -109711,7 +117092,7 @@ var ts;
         newState.affectedFilesIndex = state.affectedFilesIndex;
         newState.currentChangedFilePath = state.currentChangedFilePath;
         newState.currentAffectedFilesSignatures = state.currentAffectedFilesSignatures && new ts.Map(state.currentAffectedFilesSignatures);
-        newState.currentAffectedFilesExportedModulesMap = state.currentAffectedFilesExportedModulesMap && new ts.Map(state.currentAffectedFilesExportedModulesMap);
+        newState.currentAffectedFilesExportedModulesMap = (_a = state.currentAffectedFilesExportedModulesMap) === null || _a === void 0 ? void 0 : _a.clone();
         newState.seenAffectedFiles = state.seenAffectedFiles && new ts.Set(state.seenAffectedFiles);
         newState.cleanedDiagnosticsOfLibFiles = state.cleanedDiagnosticsOfLibFiles;
         newState.semanticDiagnosticsFromOldState = state.semanticDiagnosticsFromOldState && new ts.Set(state.semanticDiagnosticsFromOldState);
@@ -109779,8 +117160,7 @@ var ts;
             if (!state.currentAffectedFilesSignatures)
                 state.currentAffectedFilesSignatures = new ts.Map();
             if (state.exportedModulesMap) {
-                if (!state.currentAffectedFilesExportedModulesMap)
-                    state.currentAffectedFilesExportedModulesMap = new ts.Map();
+                state.currentAffectedFilesExportedModulesMap || (state.currentAffectedFilesExportedModulesMap = ts.BuilderState.createManyToManyPathMap());
             }
             state.affectedFiles = ts.BuilderState.getFilesAffectedBy(state, program, nextKey.value, cancellationToken, computeHash, state.currentAffectedFilesSignatures, state.currentAffectedFilesExportedModulesMap);
             state.currentChangedFilePath = nextKey.value;
@@ -109819,6 +117199,7 @@ var ts;
      *  This is because even though js emit doesnt change, dts emit / type used can change resulting in need for dts emit and js change
      */
     function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken, computeHash) {
+        var _a;
         removeSemanticDiagnosticsOf(state, affectedFile.resolvedPath);
         // If affected files is everything except default library, then nothing more to do
         if (state.allFilesExcludingDefaultLibraryFile === state.affectedFiles) {
@@ -109832,8 +117213,15 @@ var ts;
                         removeSemanticDiagnosticsOf(state, f.resolvedPath);
                 });
             }
+            // When a change affects the global scope, all files are considered to be affected without updating their signature
+            // That means when affected file is handled, its signature can be out of date
+            // To avoid this, ensure that we update the signature for any affected file in this scenario.
+            ts.BuilderState.updateShapeSignature(state, ts.Debug.checkDefined(state.program), affectedFile, ts.Debug.checkDefined(state.currentAffectedFilesSignatures), cancellationToken, computeHash, state.currentAffectedFilesExportedModulesMap);
             return;
         }
+        else {
+            ts.Debug.assert(state.hasCalledUpdateShapeSignature.has(affectedFile.resolvedPath) || ((_a = state.currentAffectedFilesSignatures) === null || _a === void 0 ? void 0 : _a.has(affectedFile.resolvedPath)), "Signature not updated for affected file: ".concat(affectedFile.fileName));
+        }
         if (!state.compilerOptions.assumeChangesOnlyAffectDirectDependencies) {
             forEachReferencingModulesOfExportOfAffectedFile(state, affectedFile, function (state, path) { return handleDtsMayChangeOf(state, path, cancellationToken, computeHash); });
         }
@@ -109852,14 +117240,15 @@ var ts;
                 // we need to update the signature to reflect correctness of the signature(which is output d.ts emit) of this file
                 // This ensures that we dont later during incremental builds considering wrong signature.
                 // Eg where this also is needed to ensure that .tsbuildinfo generated by incremental build should be same as if it was first fresh build
-                ts.BuilderState.updateShapeSignature(state, program, sourceFile, ts.Debug.checkDefined(state.currentAffectedFilesSignatures), cancellationToken, computeHash, state.currentAffectedFilesExportedModulesMap);
+                // But we avoid expensive full shape computation, as using file version as shape is enough for correctness.
+                ts.BuilderState.updateShapeSignature(state, program, sourceFile, ts.Debug.checkDefined(state.currentAffectedFilesSignatures), cancellationToken, computeHash, state.currentAffectedFilesExportedModulesMap, 
+                /* useFileVersionAsSignature */ true);
                 // If not dts emit, nothing more to do
                 if (ts.getEmitDeclarations(state.compilerOptions)) {
                     addToAffectedFilesPendingEmit(state, path, 0 /* DtsOnly */);
                 }
             }
         }
-        return false;
     }
     /**
      * Removes semantic diagnostics for path and
@@ -109882,6 +117271,7 @@ var ts;
      * Iterate on referencing modules that export entities from affected file
      */
     function forEachReferencingModulesOfExportOfAffectedFile(state, affectedFile, fn) {
+        var _a, _b;
         // If there was change in signature (dts output) for the changed file,
         // then only we need to handle pending file emit
         if (!state.exportedModulesMap || !state.changedFilesSet.has(affectedFile.resolvedPath)) {
@@ -109899,8 +117289,8 @@ var ts;
                 var currentPath = queue.pop();
                 if (!seenFileNamesMap.has(currentPath)) {
                     seenFileNamesMap.set(currentPath, true);
-                    var result = fn(state, currentPath);
-                    if (result && isChangedSignature(state, currentPath)) {
+                    fn(state, currentPath);
+                    if (isChangedSignature(state, currentPath)) {
                         var currentSourceFile = ts.Debug.checkDefined(state.program).getSourceFileByPath(currentPath);
                         queue.push.apply(queue, ts.BuilderState.getReferencedByPaths(state, currentSourceFile.resolvedPath));
                     }
@@ -109911,17 +117301,15 @@ var ts;
         var seenFileAndExportsOfFile = new ts.Set();
         // Go through exported modules from cache first
         // If exported modules has path, all files referencing file exported from are affected
-        if (ts.forEachEntry(state.currentAffectedFilesExportedModulesMap, function (exportedModules, exportedFromPath) {
-            return exportedModules &&
-                exportedModules.has(affectedFile.resolvedPath) &&
-                forEachFilesReferencingPath(state, exportedFromPath, seenFileAndExportsOfFile, fn);
-        })) {
-            return;
-        }
+        (_a = state.currentAffectedFilesExportedModulesMap.getKeys(affectedFile.resolvedPath)) === null || _a === void 0 ? void 0 : _a.forEach(function (exportedFromPath) {
+            return forEachFilesReferencingPath(state, exportedFromPath, seenFileAndExportsOfFile, fn);
+        });
         // If exported from path is not from cache and exported modules has path, all files referencing file exported from are affected
-        ts.forEachEntry(state.exportedModulesMap, function (exportedModules, exportedFromPath) {
-            return !state.currentAffectedFilesExportedModulesMap.has(exportedFromPath) && // If we already iterated this through cache, ignore it
-                exportedModules.has(affectedFile.resolvedPath) &&
+        (_b = state.exportedModulesMap.getKeys(affectedFile.resolvedPath)) === null || _b === void 0 ? void 0 : _b.forEach(function (exportedFromPath) {
+            var _a;
+            // If the cache had an updated value, skip
+            return !state.currentAffectedFilesExportedModulesMap.hasKey(exportedFromPath) &&
+                !((_a = state.currentAffectedFilesExportedModulesMap.deletedKeys()) === null || _a === void 0 ? void 0 : _a.has(exportedFromPath)) &&
                 forEachFilesReferencingPath(state, exportedFromPath, seenFileAndExportsOfFile, fn);
         });
     }
@@ -109929,43 +117317,37 @@ var ts;
      * Iterate on files referencing referencedPath
      */
     function forEachFilesReferencingPath(state, referencedPath, seenFileAndExportsOfFile, fn) {
-        return ts.forEachEntry(state.referencedMap, function (referencesInFile, filePath) {
-            return referencesInFile.has(referencedPath) && forEachFileAndExportsOfFile(state, filePath, seenFileAndExportsOfFile, fn);
+        var _a;
+        (_a = state.referencedMap.getKeys(referencedPath)) === null || _a === void 0 ? void 0 : _a.forEach(function (filePath) {
+            return forEachFileAndExportsOfFile(state, filePath, seenFileAndExportsOfFile, fn);
         });
     }
     /**
      * fn on file and iterate on anything that exports this file
      */
     function forEachFileAndExportsOfFile(state, filePath, seenFileAndExportsOfFile, fn) {
+        var _a, _b, _c;
         if (!ts.tryAddToSet(seenFileAndExportsOfFile, filePath)) {
-            return false;
-        }
-        if (fn(state, filePath)) {
-            // If there are no more diagnostics from old cache, done
-            return true;
+            return;
         }
+        fn(state, filePath);
         ts.Debug.assert(!!state.currentAffectedFilesExportedModulesMap);
         // Go through exported modules from cache first
         // If exported modules has path, all files referencing file exported from are affected
-        if (ts.forEachEntry(state.currentAffectedFilesExportedModulesMap, function (exportedModules, exportedFromPath) {
-            return exportedModules &&
-                exportedModules.has(filePath) &&
-                forEachFileAndExportsOfFile(state, exportedFromPath, seenFileAndExportsOfFile, fn);
-        })) {
-            return true;
-        }
+        (_a = state.currentAffectedFilesExportedModulesMap.getKeys(filePath)) === null || _a === void 0 ? void 0 : _a.forEach(function (exportedFromPath) {
+            return forEachFileAndExportsOfFile(state, exportedFromPath, seenFileAndExportsOfFile, fn);
+        });
         // If exported from path is not from cache and exported modules has path, all files referencing file exported from are affected
-        if (ts.forEachEntry(state.exportedModulesMap, function (exportedModules, exportedFromPath) {
-            return !state.currentAffectedFilesExportedModulesMap.has(exportedFromPath) && // If we already iterated this through cache, ignore it
-                exportedModules.has(filePath) &&
+        (_b = state.exportedModulesMap.getKeys(filePath)) === null || _b === void 0 ? void 0 : _b.forEach(function (exportedFromPath) {
+            var _a;
+            // If the cache had an updated value, skip
+            return !state.currentAffectedFilesExportedModulesMap.hasKey(exportedFromPath) &&
+                !((_a = state.currentAffectedFilesExportedModulesMap.deletedKeys()) === null || _a === void 0 ? void 0 : _a.has(exportedFromPath)) &&
                 forEachFileAndExportsOfFile(state, exportedFromPath, seenFileAndExportsOfFile, fn);
-        })) {
-            return true;
-        }
+        });
         // Remove diagnostics of files that import this file (without going to exports of referencing files)
-        return !!ts.forEachEntry(state.referencedMap, function (referencesInFile, referencingFilePath) {
-            return referencesInFile.has(filePath) &&
-                !seenFileAndExportsOfFile.has(referencingFilePath) && // Not already removed diagnostic file
+        (_c = state.referencedMap.getKeys(filePath)) === null || _c === void 0 ? void 0 : _c.forEach(function (referencingFilePath) {
+            return !seenFileAndExportsOfFile.has(referencingFilePath) && // Not already removed diagnostic file
                 fn(state, referencingFilePath);
         } // Dont add to seen since this is not yet done with the export removal
         );
@@ -110027,7 +117409,7 @@ var ts;
             var cachedDiagnostics = state.semanticDiagnosticsPerFile.get(path);
             // Report the bind and check diagnostics from the cache if we already have those diagnostics present
             if (cachedDiagnostics) {
-                return ts.filterSemanticDiagnotics(cachedDiagnostics, state.compilerOptions);
+                return ts.filterSemanticDiagnostics(cachedDiagnostics, state.compilerOptions);
             }
         }
         // Diagnostics werent cached, get them from program, and cache the result
@@ -110035,7 +117417,7 @@ var ts;
         if (state.semanticDiagnosticsPerFile) {
             state.semanticDiagnosticsPerFile.set(path, diagnostics);
         }
-        return ts.filterSemanticDiagnotics(diagnostics, state.compilerOptions);
+        return ts.filterSemanticDiagnostics(diagnostics, state.compilerOptions);
     }
     /**
      * Gets the program information to be emitted in buildInfo so that we can use it to create new program
@@ -110045,83 +117427,127 @@ var ts;
             return undefined;
         var currentDirectory = ts.Debug.checkDefined(state.program).getCurrentDirectory();
         var buildInfoDirectory = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(ts.getTsBuildInfoEmitOutputFilePath(state.compilerOptions), currentDirectory));
-        var fileInfos = {};
-        state.fileInfos.forEach(function (value, key) {
+        var fileNames = [];
+        var fileNameToFileId = new ts.Map();
+        var fileIdsList;
+        var fileNamesToFileIdListId;
+        var fileInfos = ts.arrayFrom(state.fileInfos.entries(), function (_a) {
+            var key = _a[0], value = _a[1];
+            // Ensure fileId
+            var fileId = toFileId(key);
+            ts.Debug.assert(fileNames[fileId - 1] === relativeToBuildInfo(key));
             var signature = state.currentAffectedFilesSignatures && state.currentAffectedFilesSignatures.get(key);
-            fileInfos[relativeToBuildInfo(key)] = signature === undefined ? value : { version: value.version, signature: signature, affectsGlobalScope: value.affectsGlobalScope };
+            var actualSignature = signature !== null && signature !== void 0 ? signature : value.signature;
+            return value.version === actualSignature ?
+                value.affectsGlobalScope ?
+                    { version: value.version, signature: undefined, affectsGlobalScope: true, impliedFormat: value.impliedFormat } :
+                    value.version :
+                actualSignature !== undefined ?
+                    signature === undefined ?
+                        value :
+                        { version: value.version, signature: signature, affectsGlobalScope: value.affectsGlobalScope, impliedFormat: value.impliedFormat } :
+                    { version: value.version, signature: false, affectsGlobalScope: value.affectsGlobalScope, impliedFormat: value.impliedFormat };
         });
-        var result = {
-            fileInfos: fileInfos,
-            options: convertToReusableCompilerOptions(state.compilerOptions, relativeToBuildInfoEnsuringAbsolutePath)
-        };
+        var referencedMap;
         if (state.referencedMap) {
-            var referencedMap = {};
-            for (var _i = 0, _a = ts.arrayFrom(state.referencedMap.keys()).sort(ts.compareStringsCaseSensitive); _i < _a.length; _i++) {
-                var key = _a[_i];
-                referencedMap[relativeToBuildInfo(key)] = ts.arrayFrom(state.referencedMap.get(key).keys(), relativeToBuildInfo).sort(ts.compareStringsCaseSensitive);
-            }
-            result.referencedMap = referencedMap;
+            referencedMap = ts.arrayFrom(state.referencedMap.keys()).sort(ts.compareStringsCaseSensitive).map(function (key) { return [
+                toFileId(key),
+                toFileIdListId(state.referencedMap.getValues(key))
+            ]; });
         }
+        var exportedModulesMap;
         if (state.exportedModulesMap) {
-            var exportedModulesMap = {};
-            for (var _b = 0, _c = ts.arrayFrom(state.exportedModulesMap.keys()).sort(ts.compareStringsCaseSensitive); _b < _c.length; _b++) {
-                var key = _c[_b];
-                var newValue = state.currentAffectedFilesExportedModulesMap && state.currentAffectedFilesExportedModulesMap.get(key);
+            exportedModulesMap = ts.mapDefined(ts.arrayFrom(state.exportedModulesMap.keys()).sort(ts.compareStringsCaseSensitive), function (key) {
+                var _a;
+                if (state.currentAffectedFilesExportedModulesMap) {
+                    if ((_a = state.currentAffectedFilesExportedModulesMap.deletedKeys()) === null || _a === void 0 ? void 0 : _a.has(key)) {
+                        return undefined;
+                    }
+                    var newValue = state.currentAffectedFilesExportedModulesMap.getValues(key);
+                    if (newValue) {
+                        return [toFileId(key), toFileIdListId(newValue)];
+                    }
+                }
                 // Not in temporary cache, use existing value
-                if (newValue === undefined)
-                    exportedModulesMap[relativeToBuildInfo(key)] = ts.arrayFrom(state.exportedModulesMap.get(key).keys(), relativeToBuildInfo).sort(ts.compareStringsCaseSensitive);
-                // Value in cache and has updated value map, use that
-                else if (newValue)
-                    exportedModulesMap[relativeToBuildInfo(key)] = ts.arrayFrom(newValue.keys(), relativeToBuildInfo).sort(ts.compareStringsCaseSensitive);
-            }
-            result.exportedModulesMap = exportedModulesMap;
+                return [toFileId(key), toFileIdListId(state.exportedModulesMap.getValues(key))];
+            });
         }
+        var semanticDiagnosticsPerFile;
         if (state.semanticDiagnosticsPerFile) {
-            var semanticDiagnosticsPerFile = [];
-            for (var _d = 0, _e = ts.arrayFrom(state.semanticDiagnosticsPerFile.keys()).sort(ts.compareStringsCaseSensitive); _d < _e.length; _d++) {
-                var key = _e[_d];
+            for (var _i = 0, _a = ts.arrayFrom(state.semanticDiagnosticsPerFile.keys()).sort(ts.compareStringsCaseSensitive); _i < _a.length; _i++) {
+                var key = _a[_i];
                 var value = state.semanticDiagnosticsPerFile.get(key);
-                semanticDiagnosticsPerFile.push(value.length ?
+                (semanticDiagnosticsPerFile || (semanticDiagnosticsPerFile = [])).push(value.length ?
                     [
-                        relativeToBuildInfo(key),
+                        toFileId(key),
                         state.hasReusableDiagnostic ?
                             value :
                             convertToReusableDiagnostics(value, relativeToBuildInfo)
                     ] :
-                    relativeToBuildInfo(key));
+                    toFileId(key));
             }
-            result.semanticDiagnosticsPerFile = semanticDiagnosticsPerFile;
         }
+        var affectedFilesPendingEmit;
         if (state.affectedFilesPendingEmit) {
-            var affectedFilesPendingEmit = [];
             var seenFiles = new ts.Set();
-            for (var _f = 0, _g = state.affectedFilesPendingEmit.slice(state.affectedFilesPendingEmitIndex).sort(ts.compareStringsCaseSensitive); _f < _g.length; _f++) {
-                var path = _g[_f];
+            for (var _b = 0, _c = state.affectedFilesPendingEmit.slice(state.affectedFilesPendingEmitIndex).sort(ts.compareStringsCaseSensitive); _b < _c.length; _b++) {
+                var path = _c[_b];
                 if (ts.tryAddToSet(seenFiles, path)) {
-                    affectedFilesPendingEmit.push([relativeToBuildInfo(path), state.affectedFilesPendingEmitKind.get(path)]);
+                    (affectedFilesPendingEmit || (affectedFilesPendingEmit = [])).push([toFileId(path), state.affectedFilesPendingEmitKind.get(path)]);
                 }
             }
-            result.affectedFilesPendingEmit = affectedFilesPendingEmit;
         }
-        return result;
+        return {
+            fileNames: fileNames,
+            fileInfos: fileInfos,
+            options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions, relativeToBuildInfoEnsuringAbsolutePath),
+            fileIdsList: fileIdsList,
+            referencedMap: referencedMap,
+            exportedModulesMap: exportedModulesMap,
+            semanticDiagnosticsPerFile: semanticDiagnosticsPerFile,
+            affectedFilesPendingEmit: affectedFilesPendingEmit,
+        };
         function relativeToBuildInfoEnsuringAbsolutePath(path) {
             return relativeToBuildInfo(ts.getNormalizedAbsolutePath(path, currentDirectory));
         }
         function relativeToBuildInfo(path) {
             return ts.ensurePathIsNonModuleName(ts.getRelativePathFromDirectory(buildInfoDirectory, path, getCanonicalFileName));
         }
+        function toFileId(path) {
+            var fileId = fileNameToFileId.get(path);
+            if (fileId === undefined) {
+                fileNames.push(relativeToBuildInfo(path));
+                fileNameToFileId.set(path, fileId = fileNames.length);
+            }
+            return fileId;
+        }
+        function toFileIdListId(set) {
+            var fileIds = ts.arrayFrom(set.keys(), toFileId).sort(ts.compareValues);
+            var key = fileIds.join();
+            var fileIdListId = fileNamesToFileIdListId === null || fileNamesToFileIdListId === void 0 ? void 0 : fileNamesToFileIdListId.get(key);
+            if (fileIdListId === undefined) {
+                (fileIdsList || (fileIdsList = [])).push(fileIds);
+                (fileNamesToFileIdListId || (fileNamesToFileIdListId = new ts.Map())).set(key, fileIdListId = fileIdsList.length);
+            }
+            return fileIdListId;
+        }
     }
-    function convertToReusableCompilerOptions(options, relativeToBuildInfo) {
-        var result = {};
+    function convertToProgramBuildInfoCompilerOptions(options, relativeToBuildInfo) {
+        var result;
         var optionsNameMap = ts.getOptionsNameMap().optionsNameMap;
-        for (var name in options) {
-            if (ts.hasProperty(options, name)) {
-                result[name] = convertToReusableCompilerOptionValue(optionsNameMap.get(name.toLowerCase()), options[name], relativeToBuildInfo);
+        for (var _i = 0, _a = ts.getOwnKeys(options).sort(ts.compareStringsCaseSensitive); _i < _a.length; _i++) {
+            var name = _a[_i];
+            var optionKey = name.toLowerCase();
+            var optionInfo = optionsNameMap.get(optionKey);
+            if ((optionInfo === null || optionInfo === void 0 ? void 0 : optionInfo.affectsEmit) || (optionInfo === null || optionInfo === void 0 ? void 0 : optionInfo.affectsSemanticDiagnostics) ||
+                // We need to store `strict`, even though it won't be examined directly, so that the
+                // flags it controls (e.g. `strictNullChecks`) will be retrieved correctly from the buildinfo
+                optionKey === "strict" ||
+                // We need to store these to determine whether `lib` files need to be rechecked.
+                optionKey === "skiplibcheck" || optionKey === "skipdefaultlibcheck") {
+                (result || (result = {}))[name] = convertToReusableCompilerOptionValue(optionInfo, options[name], relativeToBuildInfo);
             }
         }
-        if (result.configFilePath) {
-            result.configFilePath = relativeToBuildInfo(result.configFilePath);
-        }
         return result;
     }
     function convertToReusableCompilerOptionValue(option, value, relativeToBuildInfo) {
@@ -110213,15 +117639,16 @@ var ts;
          * Computing hash to for signature verification
          */
         var computeHash = ts.maybeBind(host, host.createHash);
-        var state = createBuilderProgramState(newProgram, getCanonicalFileName, oldState);
+        var state = createBuilderProgramState(newProgram, getCanonicalFileName, oldState, host.disableUseFileVersionAsSignature);
         var backupState;
         newProgram.getProgramBuildInfo = function () { return getProgramBuildInfo(state, getCanonicalFileName); };
         // To ensure that we arent storing any references to old program or new program without state
         newProgram = undefined; // TODO: GH#18217
         oldProgram = undefined;
         oldState = undefined;
-        var builderProgram = createRedirectedBuilderProgram(state, configFileParsingDiagnostics);
-        builderProgram.getState = function () { return state; };
+        var getState = function () { return state; };
+        var builderProgram = createRedirectedBuilderProgram(getState, configFileParsingDiagnostics);
+        builderProgram.getState = getState;
         builderProgram.backupState = function () {
             ts.Debug.assert(backupState === undefined);
             backupState = cloneBuilderProgramState(state);
@@ -110437,37 +117864,31 @@ var ts;
             state.affectedFilesPendingEmitIndex = 0;
         }
     }
-    function getMapOfReferencedSet(mapLike, toPath) {
-        if (!mapLike)
-            return undefined;
-        var map = new ts.Map();
-        // Copies keys/values from template. Note that for..in will not throw if
-        // template is undefined, and instead will just exit the loop.
-        for (var key in mapLike) {
-            if (ts.hasProperty(mapLike, key)) {
-                map.set(toPath(key), new ts.Set(mapLike[key].map(toPath)));
-            }
-        }
-        return map;
+    function toBuilderStateFileInfo(fileInfo) {
+        return ts.isString(fileInfo) ?
+            { version: fileInfo, signature: fileInfo, affectsGlobalScope: undefined, impliedFormat: undefined } :
+            ts.isString(fileInfo.signature) ?
+                fileInfo :
+                { version: fileInfo.version, signature: fileInfo.signature === false ? undefined : fileInfo.version, affectsGlobalScope: fileInfo.affectsGlobalScope, impliedFormat: fileInfo.impliedFormat };
     }
+    ts.toBuilderStateFileInfo = toBuilderStateFileInfo;
     function createBuildProgramUsingProgramBuildInfo(program, buildInfoPath, host) {
+        var _a;
         var buildInfoDirectory = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));
         var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames());
+        var filePaths = program.fileNames.map(toPath);
+        var filePathsSetList = (_a = program.fileIdsList) === null || _a === void 0 ? void 0 : _a.map(function (fileIds) { return new ts.Set(fileIds.map(toFilePath)); });
         var fileInfos = new ts.Map();
-        for (var key in program.fileInfos) {
-            if (ts.hasProperty(program.fileInfos, key)) {
-                fileInfos.set(toPath(key), program.fileInfos[key]);
-            }
-        }
+        program.fileInfos.forEach(function (fileInfo, index) { return fileInfos.set(toFilePath(index + 1), toBuilderStateFileInfo(fileInfo)); });
         var state = {
             fileInfos: fileInfos,
-            compilerOptions: ts.convertToOptionsWithAbsolutePaths(program.options, toAbsolutePath),
-            referencedMap: getMapOfReferencedSet(program.referencedMap, toPath),
-            exportedModulesMap: getMapOfReferencedSet(program.exportedModulesMap, toPath),
-            semanticDiagnosticsPerFile: program.semanticDiagnosticsPerFile && ts.arrayToMap(program.semanticDiagnosticsPerFile, function (value) { return toPath(ts.isString(value) ? value : value[0]); }, function (value) { return ts.isString(value) ? ts.emptyArray : value[1]; }),
+            compilerOptions: program.options ? ts.convertToOptionsWithAbsolutePaths(program.options, toAbsolutePath) : {},
+            referencedMap: toManyToManyPathMap(program.referencedMap),
+            exportedModulesMap: toManyToManyPathMap(program.exportedModulesMap),
+            semanticDiagnosticsPerFile: program.semanticDiagnosticsPerFile && ts.arrayToMap(program.semanticDiagnosticsPerFile, function (value) { return toFilePath(ts.isNumber(value) ? value : value[0]); }, function (value) { return ts.isNumber(value) ? ts.emptyArray : value[1]; }),
             hasReusableDiagnostic: true,
-            affectedFilesPendingEmit: ts.map(program.affectedFilesPendingEmit, function (value) { return toPath(value[0]); }),
-            affectedFilesPendingEmitKind: program.affectedFilesPendingEmit && ts.arrayToMap(program.affectedFilesPendingEmit, function (value) { return toPath(value[0]); }, function (value) { return value[1]; }),
+            affectedFilesPendingEmit: ts.map(program.affectedFilesPendingEmit, function (value) { return toFilePath(value[0]); }),
+            affectedFilesPendingEmitKind: program.affectedFilesPendingEmit && ts.arrayToMap(program.affectedFilesPendingEmit, function (value) { return toFilePath(value[0]); }, function (value) { return value[1]; }),
             affectedFilesPendingEmitIndex: program.affectedFilesPendingEmit && 0,
         };
         return {
@@ -110500,17 +117921,34 @@ var ts;
         function toAbsolutePath(path) {
             return ts.getNormalizedAbsolutePath(path, buildInfoDirectory);
         }
+        function toFilePath(fileId) {
+            return filePaths[fileId - 1];
+        }
+        function toFilePathsSet(fileIdsListId) {
+            return filePathsSetList[fileIdsListId - 1];
+        }
+        function toManyToManyPathMap(referenceMap) {
+            if (!referenceMap) {
+                return undefined;
+            }
+            var map = ts.BuilderState.createManyToManyPathMap();
+            referenceMap.forEach(function (_a) {
+                var fileId = _a[0], fileIdListId = _a[1];
+                return map.set(toFilePath(fileId), toFilePathsSet(fileIdListId));
+            });
+            return map;
+        }
     }
     ts.createBuildProgramUsingProgramBuildInfo = createBuildProgramUsingProgramBuildInfo;
-    function createRedirectedBuilderProgram(state, configFileParsingDiagnostics) {
+    function createRedirectedBuilderProgram(getState, configFileParsingDiagnostics) {
         return {
             getState: ts.notImplemented,
             backupState: ts.noop,
             restoreState: ts.noop,
             getProgram: getProgram,
-            getProgramOrUndefined: function () { return state.program; },
-            releaseProgram: function () { return state.program = undefined; },
-            getCompilerOptions: function () { return state.compilerOptions; },
+            getProgramOrUndefined: function () { return getState().program; },
+            releaseProgram: function () { return getState().program = undefined; },
+            getCompilerOptions: function () { return getState().compilerOptions; },
             getSourceFile: function (fileName) { return getProgram().getSourceFile(fileName); },
             getSourceFiles: function () { return getProgram().getSourceFiles(); },
             getOptionsDiagnostics: function (cancellationToken) { return getProgram().getOptionsDiagnostics(cancellationToken); },
@@ -110526,7 +117964,7 @@ var ts;
             close: ts.noop,
         };
         function getProgram() {
-            return ts.Debug.checkDefined(state.program);
+            return ts.Debug.checkDefined(getState().program);
         }
     }
     ts.createRedirectedBuilderProgram = createRedirectedBuilderProgram;
@@ -110543,7 +117981,7 @@ var ts;
     ts.createEmitAndSemanticDiagnosticsBuilderProgram = createEmitAndSemanticDiagnosticsBuilderProgram;
     function createAbstractBuilder(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences) {
         var _a = ts.getBuilderCreationParameters(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences), newProgram = _a.newProgram, newConfigFileParsingDiagnostics = _a.configFileParsingDiagnostics;
-        return ts.createRedirectedBuilderProgram({ program: newProgram, compilerOptions: newProgram.getCompilerOptions() }, newConfigFileParsingDiagnostics);
+        return ts.createRedirectedBuilderProgram(function () { return ({ program: newProgram, compilerOptions: newProgram.getCompilerOptions() }); }, newConfigFileParsingDiagnostics);
     }
     ts.createAbstractBuilder = createAbstractBuilder;
 })(ts || (ts = {}));
@@ -110612,9 +118050,9 @@ var ts;
         var resolutionsWithFailedLookups = [];
         var resolvedFileToResolution = ts.createMultiMap();
         var hasChangedAutomaticTypeDirectiveNames = false;
-        var failedLookupChecks = [];
-        var startsWithPathChecks = [];
-        var isInDirectoryChecks = [];
+        var failedLookupChecks;
+        var startsWithPathChecks;
+        var isInDirectoryChecks;
         var getCurrentDirectory = ts.memoize(function () { return resolutionHost.getCurrentDirectory(); }); // TODO: GH#18217
         var cachedDirectoryStructureHost = resolutionHost.getCachedDirectoryStructureHost();
         // The resolvedModuleNames and resolvedTypeReferenceDirectives are the cache of resolutions per file.
@@ -110623,9 +118061,12 @@ var ts;
         var resolvedModuleNames = new ts.Map();
         var perDirectoryResolvedModuleNames = ts.createCacheWithRedirects();
         var nonRelativeModuleNameCache = ts.createCacheWithRedirects();
-        var moduleResolutionCache = ts.createModuleResolutionCacheWithMaps(perDirectoryResolvedModuleNames, nonRelativeModuleNameCache, getCurrentDirectory(), resolutionHost.getCanonicalFileName);
+        var moduleResolutionCache = ts.createModuleResolutionCache(getCurrentDirectory(), resolutionHost.getCanonicalFileName, 
+        /*options*/ undefined, perDirectoryResolvedModuleNames, nonRelativeModuleNameCache);
         var resolvedTypeReferenceDirectives = new ts.Map();
         var perDirectoryResolvedTypeReferenceDirectives = ts.createCacheWithRedirects();
+        var typeReferenceDirectiveResolutionCache = ts.createTypeReferenceDirectiveResolutionCache(getCurrentDirectory(), resolutionHost.getCanonicalFileName, 
+        /*options*/ undefined, moduleResolutionCache.getPackageJsonInfoCache(), perDirectoryResolvedTypeReferenceDirectives);
         /**
          * These are the extensions that failed lookup files will have by default,
          * any other extension of failed lookup will be store that path in custom failed lookup path
@@ -110641,6 +118082,7 @@ var ts;
         // TypeRoot watches for the types that get added as part of getAutomaticTypeDirectiveNames
         var typeRootsWatches = new ts.Map();
         return {
+            getModuleResolutionCache: function () { return moduleResolutionCache; },
             startRecordingFilesWithChangedResolutions: startRecordingFilesWithChangedResolutions,
             finishRecordingFilesWithChangedResolutions: finishRecordingFilesWithChangedResolutions,
             // perDirectoryResolvedModuleNames and perDirectoryResolvedTypeReferenceDirectives could be non empty if there was exception during program update
@@ -110683,9 +118125,9 @@ var ts;
             resolvedTypeReferenceDirectives.clear();
             resolvedFileToResolution.clear();
             resolutionsWithFailedLookups.length = 0;
-            failedLookupChecks.length = 0;
-            startsWithPathChecks.length = 0;
-            isInDirectoryChecks.length = 0;
+            failedLookupChecks = undefined;
+            startsWithPathChecks = undefined;
+            isInDirectoryChecks = undefined;
             // perDirectoryResolvedModuleNames and perDirectoryResolvedTypeReferenceDirectives could be non empty if there was exception during program update
             // (between startCachingPerDirectoryResolution and finishCachingPerDirectoryResolution)
             clearPerDirectoryResolutions();
@@ -110721,9 +118163,8 @@ var ts;
                 isFileWithInvalidatedNonRelativeUnresolvedImports(path); };
         }
         function clearPerDirectoryResolutions() {
-            perDirectoryResolvedModuleNames.clear();
-            nonRelativeModuleNameCache.clear();
-            perDirectoryResolvedTypeReferenceDirectives.clear();
+            moduleResolutionCache.clear();
+            typeReferenceDirectiveResolutionCache.clear();
             nonRelativeExternalModuleResolutions.forEach(watchFailedLookupLocationOfNonRelativeModuleResolutions);
             nonRelativeExternalModuleResolutions.clear();
         }
@@ -110750,7 +118191,7 @@ var ts;
             if (globalCache !== undefined && !ts.isExternalModuleNameRelative(moduleName) && !(primaryResult.resolvedModule && ts.extensionIsTS(primaryResult.resolvedModule.extension))) {
                 // create different collection of failed lookup locations for second pass
                 // if it will fail and we've already found something during the first pass - we don't want to pollute its results
-                var _b = ts.loadModuleFromGlobalCache(ts.Debug.checkDefined(resolutionHost.globalCacheResolutionModuleName)(moduleName), resolutionHost.projectName, compilerOptions, host, globalCache), resolvedModule = _b.resolvedModule, failedLookupLocations = _b.failedLookupLocations;
+                var _b = ts.loadModuleFromGlobalCache(ts.Debug.checkDefined(resolutionHost.globalCacheResolutionModuleName)(moduleName), resolutionHost.projectName, compilerOptions, host, globalCache, moduleResolutionCache), resolvedModule = _b.resolvedModule, failedLookupLocations = _b.failedLookupLocations;
                 if (resolvedModule) {
                     // Modify existing resolution so its saved in the directory cache as well
                     primaryResult.resolvedModule = resolvedModule;
@@ -110761,16 +118202,19 @@ var ts;
             // Default return the result from the first pass
             return primaryResult;
         }
+        function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host, redirectedReference) {
+            return ts.resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host, redirectedReference, typeReferenceDirectiveResolutionCache);
+        }
         function resolveNamesWithLocalCache(_a) {
-            var _b;
-            var names = _a.names, containingFile = _a.containingFile, redirectedReference = _a.redirectedReference, cache = _a.cache, perDirectoryCacheWithRedirects = _a.perDirectoryCacheWithRedirects, loader = _a.loader, getResolutionWithResolvedFileName = _a.getResolutionWithResolvedFileName, shouldRetryResolution = _a.shouldRetryResolution, reusedNames = _a.reusedNames, logChanges = _a.logChanges;
+            var _b, _c, _d;
+            var names = _a.names, containingFile = _a.containingFile, redirectedReference = _a.redirectedReference, cache = _a.cache, perDirectoryCacheWithRedirects = _a.perDirectoryCacheWithRedirects, loader = _a.loader, getResolutionWithResolvedFileName = _a.getResolutionWithResolvedFileName, shouldRetryResolution = _a.shouldRetryResolution, reusedNames = _a.reusedNames, logChanges = _a.logChanges, containingSourceFile = _a.containingSourceFile;
             var path = resolutionHost.toPath(containingFile);
-            var resolutionsInFile = cache.get(path) || cache.set(path, new ts.Map()).get(path);
+            var resolutionsInFile = cache.get(path) || cache.set(path, ts.createModeAwareCache()).get(path);
             var dirPath = ts.getDirectoryPath(path);
             var perDirectoryCache = perDirectoryCacheWithRedirects.getOrCreateMapOfCacheRedirects(redirectedReference);
             var perDirectoryResolution = perDirectoryCache.get(dirPath);
             if (!perDirectoryResolution) {
-                perDirectoryResolution = new ts.Map();
+                perDirectoryResolution = ts.createModeAwareCache();
                 perDirectoryCache.set(dirPath, perDirectoryResolution);
             }
             var resolvedModules = [];
@@ -110782,25 +118226,46 @@ var ts;
             var unmatchedRedirects = oldRedirect ?
                 !redirectedReference || redirectedReference.sourceFile.path !== oldRedirect.sourceFile.path :
                 !!redirectedReference;
-            var seenNamesInFile = new ts.Map();
-            for (var _i = 0, names_3 = names; _i < names_3.length; _i++) {
-                var name = names_3[_i];
-                var resolution = resolutionsInFile.get(name);
+            var seenNamesInFile = ts.createModeAwareCache();
+            var i = 0;
+            for (var _i = 0, names_4 = names; _i < names_4.length; _i++) {
+                var name = names_4[_i];
+                var mode = containingSourceFile ? ts.getModeForResolutionAtIndex(containingSourceFile, i) : undefined;
+                i++;
+                var resolution = resolutionsInFile.get(name, mode);
                 // Resolution is valid if it is present and not invalidated
-                if (!seenNamesInFile.has(name) &&
+                if (!seenNamesInFile.has(name, mode) &&
                     unmatchedRedirects || !resolution || resolution.isInvalidated ||
                     // If the name is unresolved import that was invalidated, recalculate
                     (hasInvalidatedNonRelativeUnresolvedImport && !ts.isExternalModuleNameRelative(name) && shouldRetryResolution(resolution))) {
                     var existingResolution = resolution;
-                    var resolutionInDirectory = perDirectoryResolution.get(name);
+                    var resolutionInDirectory = perDirectoryResolution.get(name, mode);
                     if (resolutionInDirectory) {
                         resolution = resolutionInDirectory;
+                        var host = ((_b = resolutionHost.getCompilerHost) === null || _b === void 0 ? void 0 : _b.call(resolutionHost)) || resolutionHost;
+                        if (ts.isTraceEnabled(compilerOptions, host)) {
+                            var resolved = getResolutionWithResolvedFileName(resolution);
+                            ts.trace(host, loader === resolveModuleName ?
+                                (resolved === null || resolved === void 0 ? void 0 : resolved.resolvedFileName) ?
+                                    resolved.packagetId ?
+                                        ts.Diagnostics.Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4 :
+                                        ts.Diagnostics.Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3 :
+                                    ts.Diagnostics.Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_not_resolved :
+                                (resolved === null || resolved === void 0 ? void 0 : resolved.resolvedFileName) ?
+                                    resolved.packagetId ?
+                                        ts.Diagnostics.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 :
+                                        ts.Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3 :
+                                    ts.Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_resolved, name, containingFile, ts.getDirectoryPath(containingFile), resolved === null || resolved === void 0 ? void 0 : resolved.resolvedFileName, (resolved === null || resolved === void 0 ? void 0 : resolved.packagetId) && ts.packageIdToString(resolved.packagetId));
+                        }
                     }
                     else {
-                        resolution = loader(name, containingFile, compilerOptions, ((_b = resolutionHost.getCompilerHost) === null || _b === void 0 ? void 0 : _b.call(resolutionHost)) || resolutionHost, redirectedReference);
-                        perDirectoryResolution.set(name, resolution);
+                        resolution = loader(name, containingFile, compilerOptions, ((_c = resolutionHost.getCompilerHost) === null || _c === void 0 ? void 0 : _c.call(resolutionHost)) || resolutionHost, redirectedReference, containingSourceFile);
+                        perDirectoryResolution.set(name, mode, resolution);
+                        if (resolutionHost.onDiscoveredSymlink && resolutionIsSymlink(resolution)) {
+                            resolutionHost.onDiscoveredSymlink();
+                        }
                     }
-                    resolutionsInFile.set(name, resolution);
+                    resolutionsInFile.set(name, mode, resolution);
                     watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, path, getResolutionWithResolvedFileName);
                     if (existingResolution) {
                         stopWatchFailedLookupLocationOfResolution(existingResolution, path, getResolutionWithResolvedFileName);
@@ -110811,15 +118276,32 @@ var ts;
                         logChanges = false;
                     }
                 }
+                else {
+                    var host = ((_d = resolutionHost.getCompilerHost) === null || _d === void 0 ? void 0 : _d.call(resolutionHost)) || resolutionHost;
+                    if (ts.isTraceEnabled(compilerOptions, host) && !seenNamesInFile.has(name, mode)) {
+                        var resolved = getResolutionWithResolvedFileName(resolution);
+                        ts.trace(host, loader === resolveModuleName ?
+                            (resolved === null || resolved === void 0 ? void 0 : resolved.resolvedFileName) ?
+                                resolved.packagetId ?
+                                    ts.Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3 :
+                                    ts.Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2 :
+                                ts.Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved :
+                            (resolved === null || resolved === void 0 ? void 0 : resolved.resolvedFileName) ?
+                                resolved.packagetId ?
+                                    ts.Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3 :
+                                    ts.Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2 :
+                                ts.Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved, name, containingFile, resolved === null || resolved === void 0 ? void 0 : resolved.resolvedFileName, (resolved === null || resolved === void 0 ? void 0 : resolved.packagetId) && ts.packageIdToString(resolved.packagetId));
+                    }
+                }
                 ts.Debug.assert(resolution !== undefined && !resolution.isInvalidated);
-                seenNamesInFile.set(name, true);
+                seenNamesInFile.set(name, mode, true);
                 resolvedModules.push(getResolutionWithResolvedFileName(resolution));
             }
             // Stop watching and remove the unused name
-            resolutionsInFile.forEach(function (resolution, name) {
-                if (!seenNamesInFile.has(name) && !ts.contains(reusedNames, name)) {
+            resolutionsInFile.forEach(function (resolution, name, mode) {
+                if (!seenNamesInFile.has(name, mode) && !ts.contains(reusedNames, name)) {
                     stopWatchFailedLookupLocationOfResolution(resolution, path, getResolutionWithResolvedFileName);
-                    resolutionsInFile.delete(name);
+                    resolutionsInFile.delete(name, mode);
                 }
             });
             return resolvedModules;
@@ -110848,12 +118330,12 @@ var ts;
                 redirectedReference: redirectedReference,
                 cache: resolvedTypeReferenceDirectives,
                 perDirectoryCacheWithRedirects: perDirectoryResolvedTypeReferenceDirectives,
-                loader: ts.resolveTypeReferenceDirective,
+                loader: resolveTypeReferenceDirective,
                 getResolutionWithResolvedFileName: getResolvedTypeReferenceDirective,
                 shouldRetryResolution: function (resolution) { return resolution.resolvedTypeReferenceDirective === undefined; },
             });
         }
-        function resolveModuleNames(moduleNames, containingFile, reusedNames, redirectedReference) {
+        function resolveModuleNames(moduleNames, containingFile, reusedNames, redirectedReference, containingSourceFile) {
             return resolveNamesWithLocalCache({
                 names: moduleNames,
                 containingFile: containingFile,
@@ -110865,11 +118347,14 @@ var ts;
                 shouldRetryResolution: function (resolution) { return !resolution.resolvedModule || !ts.resolutionExtensionIsTSOrJson(resolution.resolvedModule.extension); },
                 reusedNames: reusedNames,
                 logChanges: logChangesWhenResolvingModule,
+                containingSourceFile: containingSourceFile,
             });
         }
-        function getResolvedModuleWithFailedLookupLocationsFromCache(moduleName, containingFile) {
+        function getResolvedModuleWithFailedLookupLocationsFromCache(moduleName, containingFile, resolutionMode) {
             var cache = resolvedModuleNames.get(resolutionHost.toPath(containingFile));
-            return cache && cache.get(moduleName);
+            if (!cache)
+                return undefined;
+            return cache.get(moduleName, resolutionMode);
         }
         function isNodeModulesAtTypesDirectory(dirPath) {
             return ts.endsWith(dirPath, "/node_modules/@types");
@@ -110880,7 +118365,7 @@ var ts;
                 failedLookupLocation = ts.isRootedDiskPath(failedLookupLocation) ? ts.normalizePath(failedLookupLocation) : ts.getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory());
                 var failedLookupPathSplit = failedLookupLocationPath.split(ts.directorySeparator);
                 var failedLookupSplit = failedLookupLocation.split(ts.directorySeparator);
-                ts.Debug.assert(failedLookupSplit.length === failedLookupPathSplit.length, "FailedLookup: " + failedLookupLocation + " failedLookupLocationPath: " + failedLookupLocationPath);
+                ts.Debug.assert(failedLookupSplit.length === failedLookupPathSplit.length, "FailedLookup: ".concat(failedLookupLocation, " failedLookupLocationPath: ").concat(failedLookupLocationPath));
                 if (failedLookupPathSplit.length > rootSplitLength + 1) {
                     // Instead of watching root, watch directory in root to avoid watching excluded directories not needed for module resolution
                     return {
@@ -111068,18 +118553,15 @@ var ts;
             }
         }
         function removeResolutionsFromProjectReferenceRedirects(filePath) {
-            if (!ts.fileExtensionIs(filePath, ".json" /* Json */)) {
+            if (!ts.fileExtensionIs(filePath, ".json" /* Json */))
                 return;
-            }
             var program = resolutionHost.getCurrentProgram();
-            if (!program) {
+            if (!program)
                 return;
-            }
             // If this file is input file for the referenced project, get it
             var resolvedProjectReference = program.getResolvedProjectReferenceByPath(filePath);
-            if (!resolvedProjectReference) {
+            if (!resolvedProjectReference)
                 return;
-            }
             // filePath is for the projectReference and the containing file is from this project reference, invalidate the resolution
             resolvedProjectReference.commandLine.fileNames.forEach(function (f) { return removeResolutionsOfFile(resolutionHost.toPath(f)); });
         }
@@ -111123,7 +118605,7 @@ var ts;
             if (isCreatingWatchedDirectory) {
                 // Watching directory is created
                 // Invalidate any resolution has failed lookup in this directory
-                isInDirectoryChecks.push(fileOrDirectoryPath);
+                (isInDirectoryChecks || (isInDirectoryChecks = [])).push(fileOrDirectoryPath);
             }
             else {
                 // If something to do with folder/file starting with "." in node_modules folder, skip it
@@ -111141,8 +118623,8 @@ var ts;
                 if (isNodeModulesAtTypesDirectory(fileOrDirectoryPath) || ts.isNodeModulesDirectory(fileOrDirectoryPath) ||
                     isNodeModulesAtTypesDirectory(dirOfFileOrDirectory) || ts.isNodeModulesDirectory(dirOfFileOrDirectory)) {
                     // Invalidate any resolution from this directory
-                    failedLookupChecks.push(fileOrDirectoryPath);
-                    startsWithPathChecks.push(fileOrDirectoryPath);
+                    (failedLookupChecks || (failedLookupChecks = [])).push(fileOrDirectoryPath);
+                    (startsWithPathChecks || (startsWithPathChecks = new ts.Set())).add(fileOrDirectoryPath);
                 }
                 else {
                     if (!isPathWithDefaultFailedLookupExtension(fileOrDirectoryPath) && !customFailedLookupPaths.has(fileOrDirectoryPath)) {
@@ -111153,27 +118635,33 @@ var ts;
                         return false;
                     }
                     // Resolution need to be invalidated if failed lookup location is same as the file or directory getting created
-                    failedLookupChecks.push(fileOrDirectoryPath);
+                    (failedLookupChecks || (failedLookupChecks = [])).push(fileOrDirectoryPath);
+                    // If the invalidated file is from a node_modules package, invalidate everything else
+                    // in the package since we might not get notifications for other files in the package.
+                    // This hardens our logic against unreliable file watchers.
+                    var packagePath = ts.parseNodeModuleFromPath(fileOrDirectoryPath);
+                    if (packagePath)
+                        (startsWithPathChecks || (startsWithPathChecks = new ts.Set())).add(packagePath);
                 }
             }
             resolutionHost.scheduleInvalidateResolutionsOfFailedLookupLocations();
         }
         function invalidateResolutionsOfFailedLookupLocations() {
-            if (!failedLookupChecks.length && !startsWithPathChecks.length && !isInDirectoryChecks.length) {
+            if (!failedLookupChecks && !startsWithPathChecks && !isInDirectoryChecks) {
                 return false;
             }
             var invalidated = invalidateResolutions(resolutionsWithFailedLookups, canInvalidateFailedLookupResolution);
-            failedLookupChecks.length = 0;
-            startsWithPathChecks.length = 0;
-            isInDirectoryChecks.length = 0;
+            failedLookupChecks = undefined;
+            startsWithPathChecks = undefined;
+            isInDirectoryChecks = undefined;
             return invalidated;
         }
         function canInvalidateFailedLookupResolution(resolution) {
             return resolution.failedLookupLocations.some(function (location) {
                 var locationPath = resolutionHost.toPath(location);
                 return ts.contains(failedLookupChecks, locationPath) ||
-                    startsWithPathChecks.some(function (fileOrDirectoryPath) { return ts.startsWith(locationPath, fileOrDirectoryPath); }) ||
-                    isInDirectoryChecks.some(function (fileOrDirectoryPath) { return isInDirectoryPath(fileOrDirectoryPath, locationPath); });
+                    ts.firstDefinedIterator((startsWithPathChecks === null || startsWithPathChecks === void 0 ? void 0 : startsWithPathChecks.keys()) || ts.emptyIterator, function (fileOrDirectoryPath) { return ts.startsWith(locationPath, fileOrDirectoryPath) ? true : undefined; }) ||
+                    (isInDirectoryChecks === null || isInDirectoryChecks === void 0 ? void 0 : isInDirectoryChecks.some(function (fileOrDirectoryPath) { return isInDirectoryPath(fileOrDirectoryPath, locationPath); }));
             });
         }
         function closeTypeRootsWatch() {
@@ -111244,13 +118732,18 @@ var ts;
         }
     }
     ts.createResolutionCache = createResolutionCache;
+    function resolutionIsSymlink(resolution) {
+        var _a, _b;
+        return !!(((_a = resolution.resolvedModule) === null || _a === void 0 ? void 0 : _a.originalPath) ||
+            ((_b = resolution.resolvedTypeReferenceDirective) === null || _b === void 0 ? void 0 : _b.originalPath));
+    }
 })(ts || (ts = {}));
 // Used by importFixes, getEditsForFileRename, and declaration emit to synthesize import module specifiers.
 /* @internal */
 var ts;
 (function (ts) {
     var moduleSpecifiers;
-    (function (moduleSpecifiers) {
+    (function (moduleSpecifiers_1) {
         var RelativePreference;
         (function (RelativePreference) {
             RelativePreference[RelativePreference["Relative"] = 0] = "Relative";
@@ -111265,7 +118758,7 @@ var ts;
             Ending[Ending["Index"] = 1] = "Index";
             Ending[Ending["JsExtension"] = 2] = "JsExtension";
         })(Ending || (Ending = {}));
-        function getPreferences(_a, compilerOptions, importingSourceFile) {
+        function getPreferences(host, _a, compilerOptions, importingSourceFile) {
             var importModuleSpecifierPreference = _a.importModuleSpecifierPreference, importModuleSpecifierEnding = _a.importModuleSpecifierEnding;
             return {
                 relativePreference: importModuleSpecifierPreference === "relative" ? 0 /* Relative */ :
@@ -111279,53 +118772,101 @@ var ts;
                     case "minimal": return 0 /* Minimal */;
                     case "index": return 1 /* Index */;
                     case "js": return 2 /* JsExtension */;
-                    default: return usesJsExtensionOnImports(importingSourceFile) ? 2 /* JsExtension */
+                    default: return usesJsExtensionOnImports(importingSourceFile) || isFormatRequiringExtensions(compilerOptions, importingSourceFile.path, host) ? 2 /* JsExtension */
                         : ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.NodeJs ? 1 /* Index */ : 0 /* Minimal */;
                 }
             }
         }
-        function getPreferencesForUpdate(compilerOptions, oldImportSpecifier) {
+        function getPreferencesForUpdate(compilerOptions, oldImportSpecifier, importingSourceFileName, host) {
             return {
                 relativePreference: ts.isExternalModuleNameRelative(oldImportSpecifier) ? 0 /* Relative */ : 1 /* NonRelative */,
-                ending: ts.hasJSFileExtension(oldImportSpecifier) ?
+                ending: ts.hasJSFileExtension(oldImportSpecifier) || isFormatRequiringExtensions(compilerOptions, importingSourceFileName, host) ?
                     2 /* JsExtension */ :
                     ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.NodeJs || ts.endsWith(oldImportSpecifier, "index") ? 1 /* Index */ : 0 /* Minimal */,
             };
         }
+        function isFormatRequiringExtensions(compilerOptions, importingSourceFileName, host) {
+            if (ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.Node12
+                && ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.NodeNext) {
+                return false;
+            }
+            return ts.getImpliedNodeFormatForFile(importingSourceFileName, /*packageJsonInfoCache*/ undefined, getModuleResolutionHost(host), compilerOptions) !== ts.ModuleKind.CommonJS;
+        }
+        function getModuleResolutionHost(host) {
+            var _a;
+            return {
+                fileExists: host.fileExists,
+                readFile: ts.Debug.checkDefined(host.readFile),
+                directoryExists: host.directoryExists,
+                getCurrentDirectory: host.getCurrentDirectory,
+                realpath: host.realpath,
+                useCaseSensitiveFileNames: (_a = host.useCaseSensitiveFileNames) === null || _a === void 0 ? void 0 : _a.call(host),
+            };
+        }
         function updateModuleSpecifier(compilerOptions, importingSourceFileName, toFileName, host, oldImportSpecifier) {
-            var res = getModuleSpecifierWorker(compilerOptions, importingSourceFileName, toFileName, host, getPreferencesForUpdate(compilerOptions, oldImportSpecifier));
+            var res = getModuleSpecifierWorker(compilerOptions, importingSourceFileName, toFileName, host, getPreferencesForUpdate(compilerOptions, oldImportSpecifier, importingSourceFileName, host), {});
             if (res === oldImportSpecifier)
                 return undefined;
             return res;
         }
-        moduleSpecifiers.updateModuleSpecifier = updateModuleSpecifier;
+        moduleSpecifiers_1.updateModuleSpecifier = updateModuleSpecifier;
         // Note: importingSourceFile is just for usesJsExtensionOnImports
-        function getModuleSpecifier(compilerOptions, importingSourceFile, importingSourceFileName, toFileName, host, preferences) {
-            if (preferences === void 0) { preferences = {}; }
-            return getModuleSpecifierWorker(compilerOptions, importingSourceFileName, toFileName, host, getPreferences(preferences, compilerOptions, importingSourceFile));
+        function getModuleSpecifier(compilerOptions, importingSourceFile, importingSourceFileName, toFileName, host) {
+            return getModuleSpecifierWorker(compilerOptions, importingSourceFileName, toFileName, host, getPreferences(host, {}, compilerOptions, importingSourceFile), {});
         }
-        moduleSpecifiers.getModuleSpecifier = getModuleSpecifier;
-        function getNodeModulesPackageName(compilerOptions, importingSourceFileName, nodeModulesFileName, host) {
+        moduleSpecifiers_1.getModuleSpecifier = getModuleSpecifier;
+        function getNodeModulesPackageName(compilerOptions, importingSourceFileName, nodeModulesFileName, host, preferences) {
             var info = getInfo(importingSourceFileName, host);
-            var modulePaths = getAllModulePaths(importingSourceFileName, nodeModulesFileName, host);
+            var modulePaths = getAllModulePaths(importingSourceFileName, nodeModulesFileName, host, preferences);
             return ts.firstDefined(modulePaths, function (modulePath) { return tryGetModuleNameAsNodeModule(modulePath, info, host, compilerOptions, /*packageNameOnly*/ true); });
         }
-        moduleSpecifiers.getNodeModulesPackageName = getNodeModulesPackageName;
-        function getModuleSpecifierWorker(compilerOptions, importingSourceFileName, toFileName, host, preferences) {
+        moduleSpecifiers_1.getNodeModulesPackageName = getNodeModulesPackageName;
+        function getModuleSpecifierWorker(compilerOptions, importingSourceFileName, toFileName, host, preferences, userPreferences) {
             var info = getInfo(importingSourceFileName, host);
-            var modulePaths = getAllModulePaths(importingSourceFileName, toFileName, host);
+            var modulePaths = getAllModulePaths(importingSourceFileName, toFileName, host, userPreferences);
             return ts.firstDefined(modulePaths, function (modulePath) { return tryGetModuleNameAsNodeModule(modulePath, info, host, compilerOptions); }) ||
                 getLocalModuleSpecifier(toFileName, info, compilerOptions, host, preferences);
         }
+        function tryGetModuleSpecifiersFromCache(moduleSymbol, importingSourceFile, host, userPreferences) {
+            return tryGetModuleSpecifiersFromCacheWorker(moduleSymbol, importingSourceFile, host, userPreferences)[0];
+        }
+        moduleSpecifiers_1.tryGetModuleSpecifiersFromCache = tryGetModuleSpecifiersFromCache;
+        function tryGetModuleSpecifiersFromCacheWorker(moduleSymbol, importingSourceFile, host, userPreferences) {
+            var _a;
+            var moduleSourceFile = ts.getSourceFileOfModule(moduleSymbol);
+            if (!moduleSourceFile) {
+                return ts.emptyArray;
+            }
+            var cache = (_a = host.getModuleSpecifierCache) === null || _a === void 0 ? void 0 : _a.call(host);
+            var cached = cache === null || cache === void 0 ? void 0 : cache.get(importingSourceFile.path, moduleSourceFile.path, userPreferences);
+            return [cached === null || cached === void 0 ? void 0 : cached.moduleSpecifiers, moduleSourceFile, cached === null || cached === void 0 ? void 0 : cached.modulePaths, cache];
+        }
         /** Returns an import for each symlink and for the realpath. */
         function getModuleSpecifiers(moduleSymbol, checker, compilerOptions, importingSourceFile, host, userPreferences) {
+            return getModuleSpecifiersWithCacheInfo(moduleSymbol, checker, compilerOptions, importingSourceFile, host, userPreferences).moduleSpecifiers;
+        }
+        moduleSpecifiers_1.getModuleSpecifiers = getModuleSpecifiers;
+        function getModuleSpecifiersWithCacheInfo(moduleSymbol, checker, compilerOptions, importingSourceFile, host, userPreferences) {
+            var computedWithoutCache = false;
             var ambient = tryGetModuleNameFromAmbientModule(moduleSymbol, checker);
             if (ambient)
-                return [ambient];
+                return { moduleSpecifiers: [ambient], computedWithoutCache: computedWithoutCache };
+            // eslint-disable-next-line prefer-const
+            var _a = tryGetModuleSpecifiersFromCacheWorker(moduleSymbol, importingSourceFile, host, userPreferences), specifiers = _a[0], moduleSourceFile = _a[1], modulePaths = _a[2], cache = _a[3];
+            if (specifiers)
+                return { moduleSpecifiers: specifiers, computedWithoutCache: computedWithoutCache };
+            if (!moduleSourceFile)
+                return { moduleSpecifiers: ts.emptyArray, computedWithoutCache: computedWithoutCache };
+            computedWithoutCache = true;
+            modulePaths || (modulePaths = getAllModulePathsWorker(importingSourceFile.path, moduleSourceFile.originalFileName, host));
+            var result = computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFile, host, userPreferences);
+            cache === null || cache === void 0 ? void 0 : cache.set(importingSourceFile.path, moduleSourceFile.path, userPreferences, modulePaths, result);
+            return { moduleSpecifiers: result, computedWithoutCache: computedWithoutCache };
+        }
+        moduleSpecifiers_1.getModuleSpecifiersWithCacheInfo = getModuleSpecifiersWithCacheInfo;
+        function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFile, host, userPreferences) {
             var info = getInfo(importingSourceFile.path, host);
-            var moduleSourceFile = ts.getSourceFileOfNode(moduleSymbol.valueDeclaration || ts.getNonAugmentationDeclaration(moduleSymbol));
-            var modulePaths = getAllModulePaths(importingSourceFile.path, moduleSourceFile.originalFileName, host);
-            var preferences = getPreferences(userPreferences, compilerOptions, importingSourceFile);
+            var preferences = getPreferences(host, userPreferences, compilerOptions, importingSourceFile);
             var existingSpecifier = ts.forEach(modulePaths, function (modulePath) { return ts.forEach(host.getFileIncludeReasons().get(ts.toPath(modulePath.path, host.getCurrentDirectory(), info.getCanonicalFileName)), function (reason) {
                 if (reason.kind !== ts.FileIncludeKind.Import || reason.file !== importingSourceFile.path)
                     return undefined;
@@ -111335,8 +118876,10 @@ var ts;
                     specifier :
                     undefined;
             }); });
-            if (existingSpecifier)
-                return [existingSpecifier];
+            if (existingSpecifier) {
+                var moduleSpecifiers_2 = [existingSpecifier];
+                return moduleSpecifiers_2;
+            }
             var importedFileIsInNodeModules = ts.some(modulePaths, function (p) { return p.isInNodeModules; });
             // Module specifier priority:
             //   1. "Bare package specifiers" (e.g. "@foo/bar") resulting from a path through node_modules to a package.json's "types" entry
@@ -111378,7 +118921,6 @@ var ts;
                 (nodeModulesSpecifiers === null || nodeModulesSpecifiers === void 0 ? void 0 : nodeModulesSpecifiers.length) ? nodeModulesSpecifiers :
                     ts.Debug.checkDefined(relativeSpecifiers);
         }
-        moduleSpecifiers.getModuleSpecifiers = getModuleSpecifiers;
         // importingSourceFileName is separate because getEditsForFileRename may need to specify an updated path
         function getInfo(importingSourceFileName, host) {
             var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames ? host.useCaseSensitiveFileNames() : true);
@@ -111394,7 +118936,7 @@ var ts;
             if (!baseUrl && !paths || relativePreference === 0 /* Relative */) {
                 return relativePath;
             }
-            var baseDirectory = ts.getPathsBasePath(compilerOptions, host) || baseUrl;
+            var baseDirectory = ts.getNormalizedAbsolutePath(ts.getPathsBasePath(compilerOptions, host) || baseUrl, host.getCurrentDirectory());
             var relativeToBaseUrl = getRelativePathIfInDirectory(moduleFileName, baseDirectory, getCanonicalFileName);
             if (!relativeToBaseUrl) {
                 return relativePath;
@@ -111409,7 +118951,9 @@ var ts;
                 return nonRelative;
             }
             if (relativePreference === 3 /* ExternalNonRelative */) {
-                var projectDirectory = host.getCurrentDirectory();
+                var projectDirectory = compilerOptions.configFilePath ?
+                    ts.toPath(ts.getDirectoryPath(compilerOptions.configFilePath), host.getCurrentDirectory(), info.getCanonicalFileName) :
+                    info.getCanonicalFileName(host.getCurrentDirectory());
                 var modulePath = ts.toPath(moduleFileName, projectDirectory, getCanonicalFileName);
                 var sourceIsInternal = ts.startsWith(sourceDirectory, projectDirectory);
                 var targetIsInternal = ts.startsWith(modulePath, projectDirectory);
@@ -111453,7 +118997,7 @@ var ts;
             }
             return count;
         }
-        moduleSpecifiers.countPathComponents = countPathComponents;
+        moduleSpecifiers_1.countPathComponents = countPathComponents;
         function usesJsExtensionOnImports(_a) {
             var imports = _a.imports;
             return ts.firstDefined(imports, function (_a) {
@@ -111473,25 +119017,23 @@ var ts;
             });
         }
         function forEachFileNameOfModule(importingFileName, importedFileName, host, preferSymlinks, cb) {
+            var _a;
             var getCanonicalFileName = ts.hostGetCanonicalFileName(host);
             var cwd = host.getCurrentDirectory();
             var referenceRedirect = host.isSourceOfProjectReferenceRedirect(importedFileName) ? host.getProjectReferenceRedirect(importedFileName) : undefined;
             var importedPath = ts.toPath(importedFileName, cwd, getCanonicalFileName);
             var redirects = host.redirectTargetsMap.get(importedPath) || ts.emptyArray;
-            var importedFileNames = __spreadArray(__spreadArray(__spreadArray([], (referenceRedirect ? [referenceRedirect] : ts.emptyArray)), [importedFileName]), redirects);
+            var importedFileNames = __spreadArray(__spreadArray(__spreadArray([], (referenceRedirect ? [referenceRedirect] : ts.emptyArray), true), [importedFileName], false), redirects, true);
             var targets = importedFileNames.map(function (f) { return ts.getNormalizedAbsolutePath(f, cwd); });
             var shouldFilterIgnoredPaths = !ts.every(targets, ts.containsIgnoredPath);
             if (!preferSymlinks) {
                 // Symlinks inside ignored paths are already filtered out of the symlink cache,
                 // so we only need to remove them from the realpath filenames.
-                var result_15 = ts.forEach(targets, function (p) { return !(shouldFilterIgnoredPaths && ts.containsIgnoredPath(p)) && cb(p, referenceRedirect === p); });
-                if (result_15)
-                    return result_15;
-            }
-            var links = host.getSymlinkCache
-                ? host.getSymlinkCache()
-                : ts.discoverProbableSymlinks(host.getSourceFiles(), getCanonicalFileName, cwd);
-            var symlinkedDirectories = links.getSymlinkedDirectoriesByRealpath();
+                var result_14 = ts.forEach(targets, function (p) { return !(shouldFilterIgnoredPaths && ts.containsIgnoredPath(p)) && cb(p, referenceRedirect === p); });
+                if (result_14)
+                    return result_14;
+            }
+            var symlinkedDirectories = (_a = host.getSymlinkCache) === null || _a === void 0 ? void 0 : _a.call(host).getSymlinkedDirectoriesByRealpath();
             var fullImportedFileName = ts.getNormalizedAbsolutePath(importedFileName, cwd);
             var result = symlinkedDirectories && ts.forEachAncestorDirectory(ts.getDirectoryPath(fullImportedFileName), function (realPathDirectory) {
                 var symlinkDirectories = symlinkedDirectories.get(ts.ensureTrailingDirectorySeparator(ts.toPath(realPathDirectory, cwd, getCanonicalFileName)));
@@ -111509,10 +119051,10 @@ var ts;
                     for (var _i = 0, symlinkDirectories_1 = symlinkDirectories; _i < symlinkDirectories_1.length; _i++) {
                         var symlinkDirectory = symlinkDirectories_1[_i];
                         var option = ts.resolvePath(symlinkDirectory, relative);
-                        var result_16 = cb(option, target === referenceRedirect);
+                        var result_15 = cb(option, target === referenceRedirect);
                         shouldFilterIgnoredPaths = true; // We found a non-ignored path in symlinks, so we can reject ignored-path realpaths
-                        if (result_16)
-                            return result_16;
+                        if (result_15)
+                            return result_15;
                     }
                 });
             });
@@ -111520,13 +119062,27 @@ var ts;
                 ? ts.forEach(targets, function (p) { return shouldFilterIgnoredPaths && ts.containsIgnoredPath(p) ? undefined : cb(p, p === referenceRedirect); })
                 : undefined);
         }
-        moduleSpecifiers.forEachFileNameOfModule = forEachFileNameOfModule;
+        moduleSpecifiers_1.forEachFileNameOfModule = forEachFileNameOfModule;
         /**
          * Looks for existing imports that use symlinks to this module.
          * Symlinks will be returned first so they are preferred over the real path.
          */
-        function getAllModulePaths(importingFileName, importedFileName, host) {
-            var cwd = host.getCurrentDirectory();
+        function getAllModulePaths(importingFilePath, importedFileName, host, preferences, importedFilePath) {
+            var _a;
+            if (importedFilePath === void 0) { importedFilePath = ts.toPath(importedFileName, host.getCurrentDirectory(), ts.hostGetCanonicalFileName(host)); }
+            var cache = (_a = host.getModuleSpecifierCache) === null || _a === void 0 ? void 0 : _a.call(host);
+            if (cache) {
+                var cached = cache.get(importingFilePath, importedFilePath, preferences);
+                if (cached === null || cached === void 0 ? void 0 : cached.modulePaths)
+                    return cached.modulePaths;
+            }
+            var modulePaths = getAllModulePathsWorker(importingFilePath, importedFileName, host);
+            if (cache) {
+                cache.setModulePaths(importingFilePath, importedFilePath, preferences, modulePaths);
+            }
+            return modulePaths;
+        }
+        function getAllModulePathsWorker(importingFileName, importedFileName, host) {
             var getCanonicalFileName = ts.hostGetCanonicalFileName(host);
             var allFileNames = new ts.Map();
             var importedFileFromNodeModules = false;
@@ -111539,7 +119095,7 @@ var ts;
             });
             // Sort by paths closest to importing file Name directory
             var sortedPaths = [];
-            var _loop_24 = function (directory) {
+            var _loop_31 = function (directory) {
                 var directoryStart = ts.ensureTrailingDirectorySeparator(directory);
                 var pathsInDirectory;
                 allFileNames.forEach(function (_a, fileName) {
@@ -111562,10 +119118,10 @@ var ts;
                 out_directory_1 = directory;
             };
             var out_directory_1;
-            for (var directory = ts.getDirectoryPath(ts.toPath(importingFileName, cwd, getCanonicalFileName)); allFileNames.size !== 0;) {
-                var state_8 = _loop_24(directory);
+            for (var directory = ts.getDirectoryPath(importingFileName); allFileNames.size !== 0;) {
+                var state_9 = _loop_31(directory);
                 directory = out_directory_1;
-                if (state_8 === "break")
+                if (state_9 === "break")
                     break;
             }
             if (allFileNames.size) {
@@ -111577,7 +119133,8 @@ var ts;
             return sortedPaths;
         }
         function tryGetModuleNameFromAmbientModule(moduleSymbol, checker) {
-            var decl = ts.find(moduleSymbol.declarations, function (d) { return ts.isNonGlobalAmbientModule(d) && (!ts.isExternalModuleAugmentation(d) || !ts.isExternalModuleNameRelative(ts.getTextOfIdentifierOrLiteral(d.name))); });
+            var _a;
+            var decl = (_a = moduleSymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(function (d) { return ts.isNonGlobalAmbientModule(d) && (!ts.isExternalModuleAugmentation(d) || !ts.isExternalModuleNameRelative(ts.getTextOfIdentifierOrLiteral(d.name))); });
             if (decl) {
                 return decl.name.text;
             }
@@ -111633,7 +119190,7 @@ var ts;
                             ts.startsWith(relativeToBaseUrl, prefix) &&
                             ts.endsWith(relativeToBaseUrl, suffix) ||
                             !suffix && relativeToBaseUrl === ts.removeTrailingDirectorySeparator(prefix)) {
-                            var matchedStar = relativeToBaseUrl.substr(prefix.length, relativeToBaseUrl.length - suffix.length);
+                            var matchedStar = relativeToBaseUrl.substr(prefix.length, relativeToBaseUrl.length - suffix.length - prefix.length);
                             return key.replace("*", matchedStar);
                         }
                     }
@@ -111643,6 +119200,78 @@ var ts;
                 }
             }
         }
+        var MatchingMode;
+        (function (MatchingMode) {
+            MatchingMode[MatchingMode["Exact"] = 0] = "Exact";
+            MatchingMode[MatchingMode["Directory"] = 1] = "Directory";
+            MatchingMode[MatchingMode["Pattern"] = 2] = "Pattern";
+        })(MatchingMode || (MatchingMode = {}));
+        function tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, exports, conditions, mode) {
+            if (mode === void 0) { mode = 0 /* Exact */; }
+            if (typeof exports === "string") {
+                var pathOrPattern = ts.getNormalizedAbsolutePath(ts.combinePaths(packageDirectory, exports), /*currentDirectory*/ undefined);
+                var extensionSwappedTarget = ts.hasTSFileExtension(targetFilePath) ? ts.removeFileExtension(targetFilePath) + tryGetJSExtensionForFile(targetFilePath, options) : undefined;
+                switch (mode) {
+                    case 0 /* Exact */:
+                        if (ts.comparePaths(targetFilePath, pathOrPattern) === 0 /* EqualTo */ || (extensionSwappedTarget && ts.comparePaths(extensionSwappedTarget, pathOrPattern) === 0 /* EqualTo */)) {
+                            return { moduleFileToTry: packageName };
+                        }
+                        break;
+                    case 1 /* Directory */:
+                        if (ts.containsPath(pathOrPattern, targetFilePath)) {
+                            var fragment = ts.getRelativePathFromDirectory(pathOrPattern, targetFilePath, /*ignoreCase*/ false);
+                            return { moduleFileToTry: ts.getNormalizedAbsolutePath(ts.combinePaths(ts.combinePaths(packageName, exports), fragment), /*currentDirectory*/ undefined) };
+                        }
+                        break;
+                    case 2 /* Pattern */:
+                        var starPos = pathOrPattern.indexOf("*");
+                        var leadingSlice = pathOrPattern.slice(0, starPos);
+                        var trailingSlice = pathOrPattern.slice(starPos + 1);
+                        if (ts.startsWith(targetFilePath, leadingSlice) && ts.endsWith(targetFilePath, trailingSlice)) {
+                            var starReplacement = targetFilePath.slice(leadingSlice.length, targetFilePath.length - trailingSlice.length);
+                            return { moduleFileToTry: packageName.replace("*", starReplacement) };
+                        }
+                        if (extensionSwappedTarget && ts.startsWith(extensionSwappedTarget, leadingSlice) && ts.endsWith(extensionSwappedTarget, trailingSlice)) {
+                            var starReplacement = extensionSwappedTarget.slice(leadingSlice.length, extensionSwappedTarget.length - trailingSlice.length);
+                            return { moduleFileToTry: packageName.replace("*", starReplacement) };
+                        }
+                        break;
+                }
+            }
+            else if (Array.isArray(exports)) {
+                return ts.forEach(exports, function (e) { return tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, e, conditions); });
+            }
+            else if (typeof exports === "object" && exports !== null) { // eslint-disable-line no-null/no-null
+                if (ts.allKeysStartWithDot(exports)) {
+                    // sub-mappings
+                    // 3 cases:
+                    // * directory mappings (legacyish, key ends with / (technically allows index/extension resolution under cjs mode))
+                    // * pattern mappings (contains a *)
+                    // * exact mappings (no *, does not end with /)
+                    return ts.forEach(ts.getOwnKeys(exports), function (k) {
+                        var subPackageName = ts.getNormalizedAbsolutePath(ts.combinePaths(packageName, k), /*currentDirectory*/ undefined);
+                        var mode = ts.endsWith(k, "/") ? 1 /* Directory */
+                            : ts.stringContains(k, "*") ? 2 /* Pattern */
+                                : 0 /* Exact */;
+                        return tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, subPackageName, exports[k], conditions, mode);
+                    });
+                }
+                else {
+                    // conditional mapping
+                    for (var _i = 0, _a = ts.getOwnKeys(exports); _i < _a.length; _i++) {
+                        var key = _a[_i];
+                        if (key === "default" || conditions.indexOf(key) >= 0 || ts.isApplicableVersionedTypesKey(conditions, key)) {
+                            var subTarget = exports[key];
+                            var result = tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, subTarget, conditions);
+                            if (result) {
+                                return result;
+                            }
+                        }
+                    }
+                }
+            }
+            return undefined;
+        }
         function tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName, ending, compilerOptions) {
             var normalizedTargetPath = getPathRelativeToRootDirs(moduleFileName, rootDirs, getCanonicalFileName);
             if (normalizedTargetPath === undefined) {
@@ -111672,7 +119301,15 @@ var ts;
                 var moduleFileNameForExtensionless = void 0;
                 while (true) {
                     // If the module could be imported by a directory name, use that directory's name
-                    var _c = tryDirectoryWithPackageJson(packageRootIndex), moduleFileToTry = _c.moduleFileToTry, packageRootPath = _c.packageRootPath;
+                    var _c = tryDirectoryWithPackageJson(packageRootIndex), moduleFileToTry = _c.moduleFileToTry, packageRootPath = _c.packageRootPath, blockedByExports = _c.blockedByExports, verbatimFromExports = _c.verbatimFromExports;
+                    if (ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.Classic) {
+                        if (blockedByExports) {
+                            return undefined; // File is under this package.json, but is not publicly exported - there's no way to name it via `node_modules` resolution
+                        }
+                        if (verbatimFromExports) {
+                            return moduleFileToTry;
+                        }
+                    }
                     if (packageRootPath) {
                         moduleSpecifier = packageRootPath;
                         isPackageRootPath = true;
@@ -111702,13 +119339,24 @@ var ts;
             var nodeModulesDirectoryName = moduleSpecifier.substring(parts.topLevelPackageNameIndex + 1);
             var packageName = ts.getPackageNameFromTypesPackageName(nodeModulesDirectoryName);
             // For classic resolution, only allow importing from node_modules/@types, not other node_modules
-            return ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeJs && packageName === nodeModulesDirectoryName ? undefined : packageName;
+            return ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Classic && packageName === nodeModulesDirectoryName ? undefined : packageName;
             function tryDirectoryWithPackageJson(packageRootIndex) {
                 var packageRootPath = path.substring(0, packageRootIndex);
                 var packageJsonPath = ts.combinePaths(packageRootPath, "package.json");
                 var moduleFileToTry = path;
                 if (host.fileExists(packageJsonPath)) {
                     var packageJsonContent = JSON.parse(host.readFile(packageJsonPath));
+                    // TODO: Inject `require` or `import` condition based on the intended import mode
+                    if (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node12 || ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext) {
+                        var fromExports = packageJsonContent.exports && typeof packageJsonContent.name === "string" ? tryGetModuleNameFromExports(options, path, packageRootPath, packageJsonContent.name, packageJsonContent.exports, ["node", "types"]) : undefined;
+                        if (fromExports) {
+                            var withJsExtension = !ts.hasTSFileExtension(fromExports.moduleFileToTry) ? fromExports : { moduleFileToTry: ts.removeFileExtension(fromExports.moduleFileToTry) + tryGetJSExtensionForFile(fromExports.moduleFileToTry, options) };
+                            return __assign(__assign({}, withJsExtension), { verbatimFromExports: true });
+                        }
+                        if (packageJsonContent.exports) {
+                            return { moduleFileToTry: path, blockedByExports: true };
+                        }
+                    }
                     var versionPaths = packageJsonContent.typesVersions
                         ? ts.getPackageJsonTypesVersionsPaths(packageJsonContent.typesVersions)
                         : undefined;
@@ -111745,7 +119393,7 @@ var ts;
             if (!host.fileExists)
                 return;
             // We check all js, `node` and `json` extensions in addition to TS, since node module resolution would also choose those over the directory
-            var extensions = ts.getSupportedExtensions({ allowJs: true }, [{ extension: "node", isMixedContent: false }, { extension: "json", isMixedContent: false, scriptKind: 6 /* JSON */ }]);
+            var extensions = ts.flatten(ts.getSupportedExtensions({ allowJs: true }, [{ extension: "node", isMixedContent: false }, { extension: "json", isMixedContent: false, scriptKind: 6 /* JSON */ }]));
             for (var _i = 0, extensions_3 = extensions; _i < extensions_3.length; _i++) {
                 var e = extensions_3[_i];
                 var fullPath = path + e;
@@ -111813,9 +119461,11 @@ var ts;
             });
         }
         function removeExtensionAndIndexPostFix(fileName, ending, options) {
-            if (ts.fileExtensionIs(fileName, ".json" /* Json */))
+            if (ts.fileExtensionIsOneOf(fileName, [".json" /* Json */, ".mjs" /* Mjs */, ".cjs" /* Cjs */]))
                 return fileName;
             var noExtension = ts.removeFileExtension(fileName);
+            if (ts.fileExtensionIsOneOf(fileName, [".d.mts" /* Dmts */, ".mts" /* Mts */, ".d.cts" /* Dcts */, ".cts" /* Cts */]))
+                return noExtension + getJSExtensionForFile(fileName, options);
             switch (ending) {
                 case 0 /* Minimal */:
                     return ts.removeSuffix(noExtension, "/index");
@@ -111828,7 +119478,11 @@ var ts;
             }
         }
         function getJSExtensionForFile(fileName, options) {
-            var ext = ts.extensionFromPath(fileName);
+            var _a;
+            return (_a = tryGetJSExtensionForFile(fileName, options)) !== null && _a !== void 0 ? _a : ts.Debug.fail("Extension ".concat(ts.extensionFromPath(fileName), " is unsupported:: FileName:: ").concat(fileName));
+        }
+        function tryGetJSExtensionForFile(fileName, options) {
+            var ext = ts.tryGetExtensionFromPath(fileName);
             switch (ext) {
                 case ".ts" /* Ts */:
                 case ".d.ts" /* Dts */:
@@ -111839,12 +119493,19 @@ var ts;
                 case ".jsx" /* Jsx */:
                 case ".json" /* Json */:
                     return ext;
-                case ".tsbuildinfo" /* TsBuildInfo */:
-                    return ts.Debug.fail("Extension " + ".tsbuildinfo" /* TsBuildInfo */ + " is unsupported:: FileName:: " + fileName);
+                case ".d.mts" /* Dmts */:
+                case ".mts" /* Mts */:
+                case ".mjs" /* Mjs */:
+                    return ".mjs" /* Mjs */;
+                case ".d.cts" /* Dcts */:
+                case ".cts" /* Cts */:
+                case ".cjs" /* Cjs */:
+                    return ".cjs" /* Cjs */;
                 default:
-                    return ts.Debug.assertNever(ext);
+                    return undefined;
             }
         }
+        moduleSpecifiers_1.tryGetJSExtensionForFile = tryGetJSExtensionForFile;
         function getRelativePathIfInDirectory(path, directoryPath, getCanonicalFileName) {
             var relativePath = ts.getRelativePathToDirectoryOrUrl(directoryPath, path, directoryPath, getCanonicalFileName, /*isAbsolutePathAnUrl*/ false);
             return ts.isRootedDiskPath(relativePath) ? undefined : relativePath;
@@ -111861,12 +119522,12 @@ var ts;
         getCurrentDirectory: function () { return ts.sys.getCurrentDirectory(); },
         getNewLine: function () { return ts.sys.newLine; },
         getCanonicalFileName: ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)
-    } : undefined; // TODO: GH#18217
+    } : undefined;
     /**
      * Create a function that reports error by writing to the system and handles the formating of the diagnostic
      */
     function createDiagnosticReporter(system, pretty) {
-        var host = system === ts.sys ? sysFormatDiagnosticsHost : {
+        var host = system === ts.sys && sysFormatDiagnosticsHost ? sysFormatDiagnosticsHost : {
             getCurrentDirectory: function () { return system.getCurrentDirectory(); },
             getNewLine: function () { return system.newLine; },
             getCanonicalFileName: ts.createGetCanonicalFileName(system.useCaseSensitiveFileNames),
@@ -111921,8 +119582,8 @@ var ts;
         return pretty ?
             function (diagnostic, newLine, options) {
                 clearScreenIfNotWatchingForFileChanges(system, diagnostic, options);
-                var output = "[" + ts.formatColorAndReset(getLocaleTimeString(system), ts.ForegroundColorEscapeSequences.Grey) + "] ";
-                output += "" + ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine) + (newLine + newLine);
+                var output = "[".concat(ts.formatColorAndReset(getLocaleTimeString(system), ts.ForegroundColorEscapeSequences.Grey), "] ");
+                output += "".concat(ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)).concat(newLine + newLine);
                 system.write(output);
             } :
             function (diagnostic, newLine, options) {
@@ -111930,17 +119591,17 @@ var ts;
                 if (!clearScreenIfNotWatchingForFileChanges(system, diagnostic, options)) {
                     output += newLine;
                 }
-                output += getLocaleTimeString(system) + " - ";
-                output += "" + ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine) + getPlainDiagnosticFollowingNewLines(diagnostic, newLine);
+                output += "".concat(getLocaleTimeString(system), " - ");
+                output += "".concat(ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)).concat(getPlainDiagnosticFollowingNewLines(diagnostic, newLine));
                 system.write(output);
             };
     }
     ts.createWatchStatusReporter = createWatchStatusReporter;
     /** Parses config file using System interface */
-    function parseConfigFileWithSystem(configFileName, optionsToExtend, watchOptionsToExtend, system, reportDiagnostic) {
+    function parseConfigFileWithSystem(configFileName, optionsToExtend, extendedConfigCache, watchOptionsToExtend, system, reportDiagnostic) {
         var host = system;
         host.onUnRecoverableConfigFileDiagnostic = function (diagnostic) { return reportUnrecoverableDiagnostic(system, reportDiagnostic, diagnostic); };
-        var result = ts.getParsedCommandLineOfConfigFile(configFileName, optionsToExtend, host, /*extendedConfigCache*/ undefined, watchOptionsToExtend);
+        var result = ts.getParsedCommandLineOfConfigFile(configFileName, optionsToExtend, host, extendedConfigCache, watchOptionsToExtend);
         host.onUnRecoverableConfigFileDiagnostic = undefined; // TODO: GH#18217
         return result;
     }
@@ -111959,7 +119620,7 @@ var ts;
         if (errorCount === 0)
             return "";
         var d = ts.createCompilerDiagnostic(errorCount === 1 ? ts.Diagnostics.Found_1_error : ts.Diagnostics.Found_0_errors, errorCount);
-        return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine;
+        return "".concat(newLine).concat(ts.flattenDiagnosticMessageText(d.messageText, newLine)).concat(newLine).concat(newLine);
     }
     ts.getErrorSummaryText = getErrorSummaryText;
     function isBuilderProgram(program) {
@@ -111985,9 +119646,9 @@ var ts;
         var relativeFileName = function (fileName) { return ts.convertToRelativePath(fileName, program.getCurrentDirectory(), getCanonicalFileName); };
         for (var _i = 0, _c = program.getSourceFiles(); _i < _c.length; _i++) {
             var file = _c[_i];
-            write("" + toFileName(file, relativeFileName));
-            (_a = reasons.get(file.path)) === null || _a === void 0 ? void 0 : _a.forEach(function (reason) { return write("  " + fileIncludeReasonToDiagnostics(program, reason, relativeFileName).messageText); });
-            (_b = explainIfFileIsRedirect(file, relativeFileName)) === null || _b === void 0 ? void 0 : _b.forEach(function (d) { return write("  " + d.messageText); });
+            write("".concat(toFileName(file, relativeFileName)));
+            (_a = reasons.get(file.path)) === null || _a === void 0 ? void 0 : _a.forEach(function (reason) { return write("  ".concat(fileIncludeReasonToDiagnostics(program, reason, relativeFileName).messageText)); });
+            (_b = explainIfFileIsRedirect(file, relativeFileName)) === null || _b === void 0 ? void 0 : _b.forEach(function (d) { return write("  ".concat(d.messageText)); });
         }
     }
     ts.explainFiles = explainFiles;
@@ -112027,7 +119688,7 @@ var ts;
             if (isJsonFile && !ts.endsWith(includeSpec, ".json" /* Json */))
                 return false;
             var pattern = ts.getPatternFromSpec(includeSpec, basePath, "files");
-            return !!pattern && ts.getRegexFromPattern("(" + pattern + ")$", useCaseSensitiveFileNames).test(fileName);
+            return !!pattern && ts.getRegexFromPattern("(".concat(pattern, ")$"), useCaseSensitiveFileNames).test(fileName);
         });
     }
     ts.getMatchedIncludeSpec = getMatchedIncludeSpec;
@@ -112036,7 +119697,7 @@ var ts;
         var options = program.getCompilerOptions();
         if (ts.isReferencedFile(reason)) {
             var referenceLocation = ts.getReferencedFileLocation(function (path) { return program.getSourceFileByPath(path); }, reason);
-            var referenceText = ts.isReferenceFileLocation(referenceLocation) ? referenceLocation.file.text.substring(referenceLocation.pos, referenceLocation.end) : "\"" + referenceLocation.text + "\"";
+            var referenceText = ts.isReferenceFileLocation(referenceLocation) ? referenceLocation.file.text.substring(referenceLocation.pos, referenceLocation.end) : "\"".concat(referenceLocation.text, "\"");
             var message = void 0;
             ts.Debug.assert(ts.isReferenceFileLocation(referenceLocation) || reason.kind === ts.FileIncludeKind.Import, "Only synthetic references are imports");
             switch (reason.kind) {
@@ -112114,7 +119775,7 @@ var ts;
             case ts.FileIncludeKind.LibFile:
                 if (reason.index !== undefined)
                     return ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Library_0_specified_in_compilerOptions, options.lib[reason.index]);
-                var target = ts.forEachEntry(ts.targetOptionDeclaration.type, function (value, key) { return value === options.target ? key : undefined; });
+                var target = ts.forEachEntry(ts.targetOptionDeclaration.type, function (value, key) { return value === ts.getEmitScriptTarget(options) ? key : undefined; });
                 return ts.chainDiagnosticMessages(
                 /*details*/ undefined, target ?
                     ts.Diagnostics.Default_library_for_target_0 :
@@ -112160,7 +119821,7 @@ var ts;
             var currentDir_1 = program.getCurrentDirectory();
             ts.forEach(emittedFiles, function (file) {
                 var filepath = ts.getNormalizedAbsolutePath(file, currentDir_1);
-                write("TSFILE: " + filepath);
+                write("TSFILE: ".concat(filepath));
             });
             listFiles(program, write);
         }
@@ -112208,7 +119869,11 @@ var ts;
         MissingFile: "Missing file",
         WildcardDirectory: "Wild card directory",
         FailedLookupLocations: "Failed Lookup Locations",
-        TypeRoots: "Type roots"
+        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",
     };
     function createWatchFactory(host, options) {
         var watchLogLevel = host.trace ? options.extendedDiagnostics ? ts.WatchLogLevel.Verbose : options.diagnostics ? ts.WatchLogLevel.TriggerOnly : ts.WatchLogLevel.None : ts.WatchLogLevel.None;
@@ -112255,6 +119920,7 @@ var ts;
             getEnvironmentVariable: ts.maybeBind(host, host.getEnvironmentVariable) || (function () { return ""; }),
             createHash: ts.maybeBind(host, host.createHash),
             readDirectory: ts.maybeBind(host, host.readDirectory),
+            disableUseFileVersionAsSignature: host.disableUseFileVersionAsSignature,
         };
         function writeFile(fileName, text, writeByteOrderMark, onError) {
             try {
@@ -112282,7 +119948,7 @@ var ts;
             for (var _i = 0; _i < arguments.length; _i++) {
                 args[_i] = arguments[_i];
             }
-            var result = originalGetSourceFile.call.apply(originalGetSourceFile, __spreadArray([compilerHost], args));
+            var result = originalGetSourceFile.call.apply(originalGetSourceFile, __spreadArray([compilerHost], args, false));
             if (result) {
                 result.version = computeHash(result.text);
             }
@@ -112312,7 +119978,8 @@ var ts;
             createDirectory: function (path) { return system.createDirectory(path); },
             writeFile: function (path, data, writeByteOrderMark) { return system.writeFile(path, data, writeByteOrderMark); },
             createHash: ts.maybeBind(system, system.createHash),
-            createProgram: createProgram || ts.createEmitAndSemanticDiagnosticsBuilderProgram
+            createProgram: createProgram || ts.createEmitAndSemanticDiagnosticsBuilderProgram,
+            disableUseFileVersionAsSignature: system.disableUseFileVersionAsSignature,
         };
     }
     ts.createProgramHost = createProgramHost;
@@ -112400,6 +120067,7 @@ var ts;
         if (system === void 0) { system = ts.sys; }
         var host = ts.createCompilerHostWorker(options, /*setParentNodes*/ undefined, system);
         host.createHash = ts.maybeBind(system, system.createHash);
+        host.disableUseFileVersionAsSignature = system.disableUseFileVersionAsSignature;
         ts.setGetSourceFileAsHashVersioned(host, system);
         ts.changeCompilerHostLikeToUseCache(host, function (fileName) { return ts.toPath(fileName, host.getCurrentDirectory(), host.getCanonicalFileName); });
         return host;
@@ -112443,11 +120111,15 @@ var ts;
     function createWatchProgram(host) {
         var builderProgram;
         var reloadLevel; // level to indicate if the program needs to be reloaded from config file/just filenames etc
-        var extendedConfigFilesMap; // Map of file watchers for the extended config files
         var missingFilesMap; // Map of file watchers for the missing files
+        var packageJsonMap; // map of watchers for package json files used in module resolution
         var watchedWildcardDirectories; // map of watchers for the wild card directories in the config file
         var timerToUpdateProgram; // timer callback to recompile the program
         var timerToInvalidateFailedLookupResolutions; // timer callback to invalidate resolutions for changes in failed lookup locations
+        var parsedConfigs; // Parsed commandline and watching cached for referenced projects
+        var sharedExtendedConfigFileWatchers; // Map of file watchers for extended files, shared between different referenced projects
+        var extendedConfigCache = host.extendedConfigCache; // Cache for extended config evaluation
+        var changesAffectResolution = false; // Flag for indicating non-config changes affect module resolution
         var sourceFilesCache = new ts.Map(); // Cache that stores the source file and version info
         var missingFilePathsRequestedForRelease; // These paths are held temporarily so that we can remove the entry from source file cache if the file is not tracked by missing files
         var hasChangedCompilerOptions = false; // True if the compiler options have changed between compilations
@@ -112477,7 +120149,7 @@ var ts;
         }
         var _b = ts.createWatchFactory(host, compilerOptions), watchFile = _b.watchFile, watchDirectory = _b.watchDirectory, writeLog = _b.writeLog;
         var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);
-        writeLog("Current directory: " + currentDirectory + " CaseSensitiveFileNames: " + useCaseSensitiveFileNames);
+        writeLog("Current directory: ".concat(currentDirectory, " CaseSensitiveFileNames: ").concat(useCaseSensitiveFileNames));
         var configFileWatcher;
         if (configFileName) {
             configFileWatcher = watchFile(configFileName, scheduleProgramReload, ts.PollingInterval.High, watchOptions, ts.WatchType.ConfigFile);
@@ -112491,12 +120163,13 @@ var ts;
             for (var _i = 1; _i < arguments.length; _i++) {
                 args[_i - 1] = arguments[_i];
             }
-            return getVersionedSourceFileByPath.apply(void 0, __spreadArray([fileName, toPath(fileName)], args));
+            return getVersionedSourceFileByPath.apply(void 0, __spreadArray([fileName, toPath(fileName)], args, false));
         };
         compilerHost.getSourceFileByPath = getVersionedSourceFileByPath;
         compilerHost.getNewLine = function () { return newLine; };
         compilerHost.fileExists = fileExists;
         compilerHost.onReleaseOldSourceFile = onReleaseOldSourceFile;
+        compilerHost.onReleaseParsedCommandLine = onReleaseParsedCommandLine;
         // Members for ResolutionCacheHost
         compilerHost.toPath = toPath;
         compilerHost.getCompilationSettings = function () { return compilerOptions; };
@@ -112510,6 +120183,7 @@ var ts;
         compilerHost.fileIsOpen = ts.returnFalse;
         compilerHost.getCurrentProgram = getCurrentProgram;
         compilerHost.writeLog = writeLog;
+        compilerHost.getParsedCommandLine = getParsedCommandLine;
         // Cache for the module resolution
         var resolutionCache = ts.createResolutionCache(compilerHost, configFileName ?
             ts.getDirectoryPath(ts.getNormalizedAbsolutePath(configFileName, currentDirectory)) :
@@ -112524,7 +120198,7 @@ var ts;
                 }
                 return host.resolveModuleNames.apply(host, args);
             }) :
-            (function (moduleNames, containingFile, reusedNames, redirectedReference) { return resolutionCache.resolveModuleNames(moduleNames, containingFile, reusedNames, redirectedReference); });
+            (function (moduleNames, containingFile, reusedNames, redirectedReference, _options, sourceFile) { return resolutionCache.resolveModuleNames(moduleNames, containingFile, reusedNames, redirectedReference, sourceFile); });
         compilerHost.resolveTypeReferenceDirectives = host.resolveTypeReferenceDirectives ?
             (function () {
                 var args = [];
@@ -112540,7 +120214,8 @@ var ts;
         // Update the wild card directory watch
         watchConfigFileWildCardDirectories();
         // Update extended config file watch
-        watchExtendedConfigFiles();
+        if (configFileName)
+            updateExtendedConfigFilesWatches(toPath(configFileName), compilerOptions, watchOptions, ts.WatchType.ExtendedConfigFile);
         return configFileName ?
             { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, close: close } :
             { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, updateRootFileNames: updateRootFileNames, close: close };
@@ -112557,9 +120232,11 @@ var ts;
                 configFileWatcher.close();
                 configFileWatcher = undefined;
             }
-            if (extendedConfigFilesMap) {
-                ts.clearMap(extendedConfigFilesMap, ts.closeFileWatcher);
-                extendedConfigFilesMap = undefined;
+            extendedConfigCache === null || extendedConfigCache === void 0 ? void 0 : extendedConfigCache.clear();
+            extendedConfigCache = undefined;
+            if (sharedExtendedConfigFileWatchers) {
+                ts.clearMap(sharedExtendedConfigFileWatchers, ts.closeFileWatcherOf);
+                sharedExtendedConfigFileWatchers = undefined;
             }
             if (watchedWildcardDirectories) {
                 ts.clearMap(watchedWildcardDirectories, ts.closeFileWatcherOf);
@@ -112569,6 +120246,21 @@ var ts;
                 ts.clearMap(missingFilesMap, ts.closeFileWatcher);
                 missingFilesMap = undefined;
             }
+            if (parsedConfigs) {
+                ts.clearMap(parsedConfigs, function (config) {
+                    var _a;
+                    (_a = config.watcher) === null || _a === void 0 ? void 0 : _a.close();
+                    config.watcher = undefined;
+                    if (config.watchedDirectories)
+                        ts.clearMap(config.watchedDirectories, ts.closeFileWatcherOf);
+                    config.watchedDirectories = undefined;
+                });
+                parsedConfigs = undefined;
+            }
+            if (packageJsonMap) {
+                ts.clearMap(packageJsonMap, ts.closeFileWatcher);
+                packageJsonMap = undefined;
+            }
         }
         function getCurrentBuilderProgram() {
             return builderProgram;
@@ -112582,13 +120274,13 @@ var ts;
             var program = getCurrentBuilderProgram();
             if (hasChangedCompilerOptions) {
                 newLine = updateNewLine();
-                if (program && ts.changesAffectModuleResolution(program.getCompilerOptions(), compilerOptions)) {
+                if (program && (changesAffectResolution || ts.changesAffectModuleResolution(program.getCompilerOptions(), compilerOptions))) {
                     resolutionCache.clear();
                 }
             }
             // All resolutions are invalid if user provided resolutions
-            var hasInvalidatedResolution = resolutionCache.createHasInvalidatedResolution(userProvidedResolution);
-            if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, fileExists, hasInvalidatedResolution, hasChangedAutomaticTypeDirectiveNames, projectReferences)) {
+            var hasInvalidatedResolution = resolutionCache.createHasInvalidatedResolution(userProvidedResolution || changesAffectResolution);
+            if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, fileExists, hasInvalidatedResolution, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
                 if (hasChangedConfigFileParsingErrors) {
                     builderProgram = createProgram(/*rootNames*/ undefined, /*options*/ undefined, compilerHost, builderProgram, configFileParsingDiagnostics, projectReferences);
                     hasChangedConfigFileParsingErrors = false;
@@ -112597,6 +120289,7 @@ var ts;
             else {
                 createNewProgram(hasInvalidatedResolution);
             }
+            changesAffectResolution = false; // reset for next sync
             if (host.afterProgramCreate && program !== builderProgram) {
                 host.afterProgramCreate(builderProgram);
             }
@@ -112605,8 +120298,10 @@ var ts;
         function createNewProgram(hasInvalidatedResolution) {
             // Compile the program
             writeLog("CreatingProgramWith::");
-            writeLog("  roots: " + JSON.stringify(rootFileNames));
-            writeLog("  options: " + JSON.stringify(compilerOptions));
+            writeLog("  roots: ".concat(JSON.stringify(rootFileNames)));
+            writeLog("  options: ".concat(JSON.stringify(compilerOptions)));
+            if (projectReferences)
+                writeLog("  projectReferences: ".concat(JSON.stringify(projectReferences)));
             var needsUpdateInTypeRootWatch = hasChangedCompilerOptions || !getCurrentProgram();
             hasChangedCompilerOptions = false;
             hasChangedConfigFileParsingErrors = false;
@@ -112614,9 +120309,15 @@ var ts;
             compilerHost.hasInvalidatedResolution = hasInvalidatedResolution;
             compilerHost.hasChangedAutomaticTypeDirectiveNames = hasChangedAutomaticTypeDirectiveNames;
             builderProgram = createProgram(rootFileNames, compilerOptions, compilerHost, builderProgram, configFileParsingDiagnostics, projectReferences);
+            // map package json cache entries to their realpaths so we don't try to watch across symlinks
+            var packageCacheEntries = ts.map(resolutionCache.getModuleResolutionCache().getPackageJsonInfoCache().entries(), function (_a) {
+                var path = _a[0], data = _a[1];
+                return [compilerHost.realpath ? toPath(compilerHost.realpath(path)) : path, data];
+            });
             resolutionCache.finishCachingPerDirectoryResolution();
             // Update watches
             ts.updateMissingFilePathsWatch(builderProgram.getProgram(), missingFilesMap || (missingFilesMap = new ts.Map()), watchMissingFilePath);
+            ts.updatePackageJsonWatch(packageCacheEntries, packageJsonMap || (packageJsonMap = new ts.Map()), watchPackageJsonLookupPath);
             if (needsUpdateInTypeRootWatch) {
                 resolutionCache.updateTypeRootsWatch();
             }
@@ -112696,6 +120397,9 @@ var ts;
                         sourceFilesCache.set(path, false);
                     }
                 }
+                if (sourceFile) {
+                    sourceFile.impliedNodeFormat = ts.getImpliedNodeFormatForFile(path, resolutionCache.getModuleResolutionCache().getPackageJsonInfoCache(), compilerHost, compilerHost.getCompilationSettings());
+                }
                 return sourceFile;
             }
             return hostSourceFile.sourceFile;
@@ -112758,7 +120462,7 @@ var ts;
                 return resolutionCache.invalidateResolutionsOfFailedLookupLocations();
             }
             var pending = clearInvalidateResolutionsOfFailedLookupLocations();
-            writeLog("Scheduling invalidateFailedLookup" + (pending ? ", Cancelled earlier one" : ""));
+            writeLog("Scheduling invalidateFailedLookup".concat(pending ? ", Cancelled earlier one" : ""));
             timerToInvalidateFailedLookupResolutions = host.setTimeout(invalidateResolutionsOfFailedLookup, 250);
         }
         function invalidateResolutionsOfFailedLookup() {
@@ -112818,7 +120522,7 @@ var ts;
             synchronizeProgram();
         }
         function reloadConfigFile() {
-            writeLog("Reloading config file: " + configFileName);
+            writeLog("Reloading config file: ".concat(configFileName));
             reloadLevel = ts.ConfigFileProgramReloadLevel.None;
             if (cachedDirectoryStructureHost) {
                 cachedDirectoryStructureHost.clearCache();
@@ -112829,10 +120533,10 @@ var ts;
             // Update the wild card directory watch
             watchConfigFileWildCardDirectories();
             // Update extended config file watch
-            watchExtendedConfigFiles();
+            updateExtendedConfigFilesWatches(toPath(configFileName), compilerOptions, watchOptions, ts.WatchType.ExtendedConfigFile);
         }
         function parseConfigFile() {
-            setConfigFileParsingResult(ts.getParsedCommandLineOfConfigFile(configFileName, optionsToExtendForConfigFile, parseConfigFileHost, /*extendedConfigCache*/ undefined, watchOptionsToExtend, extraFileExtensions)); // TODO: GH#18217
+            setConfigFileParsingResult(ts.getParsedCommandLineOfConfigFile(configFileName, optionsToExtendForConfigFile, parseConfigFileHost, extendedConfigCache || (extendedConfigCache = new ts.Map()), watchOptionsToExtend, extraFileExtensions)); // TODO: GH#18217
         }
         function setConfigFileParsingResult(configFileParseResult) {
             rootFileNames = configFileParseResult.fileNames;
@@ -112844,6 +120548,56 @@ var ts;
             canConfigFileJsonReportNoInputFiles = ts.canJsonReportNoInputFiles(configFileParseResult.raw);
             hasChangedConfigFileParsingErrors = true;
         }
+        function getParsedCommandLine(configFileName) {
+            var configPath = toPath(configFileName);
+            var config = parsedConfigs === null || parsedConfigs === void 0 ? void 0 : parsedConfigs.get(configPath);
+            if (config) {
+                if (!config.reloadLevel)
+                    return config.parsedCommandLine;
+                // With host implementing getParsedCommandLine we cant just update file names
+                if (config.parsedCommandLine && config.reloadLevel === ts.ConfigFileProgramReloadLevel.Partial && !host.getParsedCommandLine) {
+                    writeLog("Reloading new file names and options");
+                    var fileNames = ts.getFileNamesFromConfigSpecs(config.parsedCommandLine.options.configFile.configFileSpecs, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost);
+                    config.parsedCommandLine = __assign(__assign({}, config.parsedCommandLine), { fileNames: fileNames });
+                    config.reloadLevel = undefined;
+                    return config.parsedCommandLine;
+                }
+            }
+            writeLog("Loading config file: ".concat(configFileName));
+            var parsedCommandLine = host.getParsedCommandLine ?
+                host.getParsedCommandLine(configFileName) :
+                getParsedCommandLineFromConfigFileHost(configFileName);
+            if (config) {
+                config.parsedCommandLine = parsedCommandLine;
+                config.reloadLevel = undefined;
+            }
+            else {
+                (parsedConfigs || (parsedConfigs = new ts.Map())).set(configPath, config = { parsedCommandLine: parsedCommandLine });
+            }
+            watchReferencedProject(configFileName, configPath, config);
+            return parsedCommandLine;
+        }
+        function getParsedCommandLineFromConfigFileHost(configFileName) {
+            // Ignore the file absent errors
+            var onUnRecoverableConfigFileDiagnostic = parseConfigFileHost.onUnRecoverableConfigFileDiagnostic;
+            parseConfigFileHost.onUnRecoverableConfigFileDiagnostic = ts.noop;
+            var parsedCommandLine = ts.getParsedCommandLineOfConfigFile(configFileName, 
+            /*optionsToExtend*/ undefined, parseConfigFileHost, extendedConfigCache || (extendedConfigCache = new ts.Map()), watchOptionsToExtend);
+            parseConfigFileHost.onUnRecoverableConfigFileDiagnostic = onUnRecoverableConfigFileDiagnostic;
+            return parsedCommandLine;
+        }
+        function onReleaseParsedCommandLine(fileName) {
+            var _a;
+            var path = toPath(fileName);
+            var config = parsedConfigs === null || parsedConfigs === void 0 ? void 0 : parsedConfigs.get(path);
+            if (!config)
+                return;
+            parsedConfigs.delete(path);
+            if (config.watchedDirectories)
+                ts.clearMap(config.watchedDirectories, ts.closeFileWatcherOf);
+            (_a = config.watcher) === null || _a === void 0 ? void 0 : _a.close();
+            ts.clearSharedExtendedConfigFileWatcher(path, sharedExtendedConfigFileWatchers);
+        }
         function watchFilePath(path, file, callback, pollingInterval, options, watchType) {
             return watchFile(file, function (fileName, eventKind) { return callback(fileName, eventKind, path); }, pollingInterval, options, watchType);
         }
@@ -112853,7 +120607,6 @@ var ts;
             if (eventKind === ts.FileWatcherEventKind.Deleted && sourceFilesCache.has(path)) {
                 resolutionCache.invalidateResolutionOfFile(path);
             }
-            resolutionCache.removeResolutionsFromProjectReferenceRedirects(path);
             nextSourceFileVersion(path);
             // Update the program
             scheduleProgramUpdate();
@@ -112864,7 +120617,25 @@ var ts;
             }
         }
         function watchMissingFilePath(missingFilePath) {
-            return watchFilePath(missingFilePath, missingFilePath, onMissingFileChange, ts.PollingInterval.Medium, watchOptions, ts.WatchType.MissingFile);
+            // If watching missing referenced config file, we are already watching it so no need for separate watcher
+            return (parsedConfigs === null || parsedConfigs === void 0 ? void 0 : parsedConfigs.has(missingFilePath)) ?
+                ts.noopFileWatcher :
+                watchFilePath(missingFilePath, missingFilePath, onMissingFileChange, ts.PollingInterval.Medium, watchOptions, ts.WatchType.MissingFile);
+        }
+        function watchPackageJsonLookupPath(packageJsonPath) {
+            // If the package.json is pulled into the compilation itself (eg, via json imports), don't add a second watcher here
+            return sourceFilesCache.has(packageJsonPath) ?
+                ts.noopFileWatcher :
+                watchFilePath(packageJsonPath, packageJsonPath, onPackageJsonChange, ts.PollingInterval.High, watchOptions, ts.WatchType.PackageJson);
+        }
+        function onPackageJsonChange(fileName, eventKind, path) {
+            updateCachedSystemWithFile(fileName, path, eventKind);
+            // package.json changes invalidate module resolution and can change the set of loaded files
+            // so if we witness a change to one, we have to do a full reload
+            reloadLevel = ts.ConfigFileProgramReloadLevel.Full;
+            changesAffectResolution = true;
+            // Update the program
+            scheduleProgramUpdate();
         }
         function onMissingFileChange(fileName, eventKind, missingFilePath) {
             updateCachedSystemWithFile(fileName, missingFilePath, eventKind);
@@ -112901,10 +120672,11 @@ var ts;
                     configFileName: configFileName,
                     extraFileExtensions: extraFileExtensions,
                     options: compilerOptions,
-                    program: getCurrentBuilderProgram(),
+                    program: getCurrentBuilderProgram() || rootFileNames,
                     currentDirectory: currentDirectory,
                     useCaseSensitiveFileNames: useCaseSensitiveFileNames,
-                    writeLog: writeLog
+                    writeLog: writeLog,
+                    toPath: toPath,
                 }))
                     return;
                 // Reload is pending, do the reload
@@ -112915,18 +120687,87 @@ var ts;
                 }
             }, flags, watchOptions, ts.WatchType.WildcardDirectory);
         }
-        function watchExtendedConfigFiles() {
-            var _a;
-            // Update the extended config files watcher
-            ts.mutateMap(extendedConfigFilesMap || (extendedConfigFilesMap = new ts.Map()), ts.arrayToMap(((_a = compilerOptions.configFile) === null || _a === void 0 ? void 0 : _a.extendedSourceFiles) || ts.emptyArray, toPath), {
-                // Watch the extended config files
-                createNewValue: watchExtendedConfigFile,
-                // Config files that are no longer extended should no longer be watched.
-                onDeleteValue: ts.closeFileWatcher
-            });
-        }
-        function watchExtendedConfigFile(extendedConfigFile) {
-            return watchFile(extendedConfigFile, scheduleProgramReload, ts.PollingInterval.High, watchOptions, ts.WatchType.ExtendedConfigFile);
+        function updateExtendedConfigFilesWatches(forProjectPath, options, watchOptions, watchType) {
+            ts.updateSharedExtendedConfigFileWatcher(forProjectPath, options, sharedExtendedConfigFileWatchers || (sharedExtendedConfigFileWatchers = new ts.Map()), function (extendedConfigFileName, extendedConfigFilePath) { return watchFile(extendedConfigFileName, function (_fileName, eventKind) {
+                var _a;
+                updateCachedSystemWithFile(extendedConfigFileName, extendedConfigFilePath, eventKind);
+                // Update extended config cache
+                if (extendedConfigCache)
+                    ts.cleanExtendedConfigCache(extendedConfigCache, extendedConfigFilePath, toPath);
+                // Update projects
+                var projects = (_a = sharedExtendedConfigFileWatchers.get(extendedConfigFilePath)) === null || _a === void 0 ? void 0 : _a.projects;
+                // If there are no referenced projects this extended config file watcher depend on ignore
+                if (!(projects === null || projects === void 0 ? void 0 : projects.size))
+                    return;
+                projects.forEach(function (projectPath) {
+                    if (toPath(configFileName) === projectPath) {
+                        // If this is the config file of the project, reload completely
+                        reloadLevel = ts.ConfigFileProgramReloadLevel.Full;
+                    }
+                    else {
+                        // Reload config for the referenced projects and remove the resolutions from referenced projects since the config file changed
+                        var config = parsedConfigs === null || parsedConfigs === void 0 ? void 0 : parsedConfigs.get(projectPath);
+                        if (config)
+                            config.reloadLevel = ts.ConfigFileProgramReloadLevel.Full;
+                        resolutionCache.removeResolutionsFromProjectReferenceRedirects(projectPath);
+                    }
+                    scheduleProgramUpdate();
+                });
+            }, ts.PollingInterval.High, watchOptions, watchType); }, toPath);
+        }
+        function watchReferencedProject(configFileName, configPath, commandLine) {
+            var _a, _b, _c, _d, _e;
+            // Watch file
+            commandLine.watcher || (commandLine.watcher = watchFile(configFileName, function (_fileName, eventKind) {
+                updateCachedSystemWithFile(configFileName, configPath, eventKind);
+                var config = parsedConfigs === null || parsedConfigs === void 0 ? void 0 : parsedConfigs.get(configPath);
+                if (config)
+                    config.reloadLevel = ts.ConfigFileProgramReloadLevel.Full;
+                resolutionCache.removeResolutionsFromProjectReferenceRedirects(configPath);
+                scheduleProgramUpdate();
+            }, ts.PollingInterval.High, ((_a = commandLine.parsedCommandLine) === null || _a === void 0 ? void 0 : _a.watchOptions) || watchOptions, ts.WatchType.ConfigFileOfReferencedProject));
+            // Watch Wild card
+            if ((_b = commandLine.parsedCommandLine) === null || _b === void 0 ? void 0 : _b.wildcardDirectories) {
+                ts.updateWatchingWildcardDirectories(commandLine.watchedDirectories || (commandLine.watchedDirectories = new ts.Map()), new ts.Map(ts.getEntries((_c = commandLine.parsedCommandLine) === null || _c === void 0 ? void 0 : _c.wildcardDirectories)), function (directory, flags) {
+                    var _a;
+                    return watchDirectory(directory, function (fileOrDirectory) {
+                        var fileOrDirectoryPath = toPath(fileOrDirectory);
+                        // Since the file existence changed, update the sourceFiles cache
+                        if (cachedDirectoryStructureHost) {
+                            cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath);
+                        }
+                        nextSourceFileVersion(fileOrDirectoryPath);
+                        var config = parsedConfigs === null || parsedConfigs === void 0 ? void 0 : parsedConfigs.get(configPath);
+                        if (!(config === null || config === void 0 ? void 0 : config.parsedCommandLine))
+                            return;
+                        if (ts.isIgnoredFileFromWildCardWatching({
+                            watchedDirPath: toPath(directory),
+                            fileOrDirectory: fileOrDirectory,
+                            fileOrDirectoryPath: fileOrDirectoryPath,
+                            configFileName: configFileName,
+                            options: config.parsedCommandLine.options,
+                            program: config.parsedCommandLine.fileNames,
+                            currentDirectory: currentDirectory,
+                            useCaseSensitiveFileNames: useCaseSensitiveFileNames,
+                            writeLog: writeLog,
+                            toPath: toPath,
+                        }))
+                            return;
+                        // Reload is pending, do the reload
+                        if (config.reloadLevel !== ts.ConfigFileProgramReloadLevel.Full) {
+                            config.reloadLevel = ts.ConfigFileProgramReloadLevel.Partial;
+                            // Schedule Update the program
+                            scheduleProgramUpdate();
+                        }
+                    }, flags, ((_a = commandLine.parsedCommandLine) === null || _a === void 0 ? void 0 : _a.watchOptions) || watchOptions, ts.WatchType.WildcardDirectoryOfReferencedProject);
+                });
+            }
+            else if (commandLine.watchedDirectories) {
+                ts.clearMap(commandLine.watchedDirectories, ts.closeFileWatcherOf);
+                commandLine.watchedDirectories = undefined;
+            }
+            // Watch extended config files
+            updateExtendedConfigFilesWatches(configPath, (_d = commandLine.parsedCommandLine) === null || _d === void 0 ? void 0 : _d.options, ((_e = commandLine.parsedCommandLine) === null || _e === void 0 ? void 0 : _e.watchOptions) || watchOptions, ts.WatchType.ExtendedConfigOfReferencedProject);
         }
     }
     ts.createWatchProgram = createWatchProgram;
@@ -113026,8 +120867,8 @@ var ts;
      */
     function createBuilderStatusReporter(system, pretty) {
         return function (diagnostic) {
-            var output = pretty ? "[" + ts.formatColorAndReset(ts.getLocaleTimeString(system), ts.ForegroundColorEscapeSequences.Grey) + "] " : ts.getLocaleTimeString(system) + " - ";
-            output += "" + ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine) + (system.newLine + system.newLine);
+            var output = pretty ? "[".concat(ts.formatColorAndReset(ts.getLocaleTimeString(system), ts.ForegroundColorEscapeSequences.Grey), "] ") : "".concat(ts.getLocaleTimeString(system), " - ");
+            output += "".concat(ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)).concat(system.newLine + system.newLine);
             system.write(output);
         };
     }
@@ -113086,10 +120927,18 @@ var ts;
         compilerHost.resolveModuleNames = ts.maybeBind(host, host.resolveModuleNames);
         compilerHost.resolveTypeReferenceDirectives = ts.maybeBind(host, host.resolveTypeReferenceDirectives);
         var moduleResolutionCache = !compilerHost.resolveModuleNames ? ts.createModuleResolutionCache(currentDirectory, getCanonicalFileName) : undefined;
+        var typeReferenceDirectiveResolutionCache = !compilerHost.resolveTypeReferenceDirectives ? ts.createTypeReferenceDirectiveResolutionCache(currentDirectory, getCanonicalFileName, /*options*/ undefined, moduleResolutionCache === null || moduleResolutionCache === void 0 ? void 0 : moduleResolutionCache.getPackageJsonInfoCache()) : undefined;
         if (!compilerHost.resolveModuleNames) {
-            var loader_3 = function (moduleName, containingFile, redirectedReference) { return ts.resolveModuleName(moduleName, containingFile, state.projectCompilerOptions, compilerHost, moduleResolutionCache, redirectedReference).resolvedModule; };
-            compilerHost.resolveModuleNames = function (moduleNames, containingFile, _reusedNames, redirectedReference) {
-                return ts.loadWithLocalCache(ts.Debug.checkEachDefined(moduleNames), containingFile, redirectedReference, loader_3);
+            var loader_3 = function (moduleName, resolverMode, containingFile, redirectedReference) { return ts.resolveModuleName(moduleName, containingFile, state.projectCompilerOptions, compilerHost, moduleResolutionCache, redirectedReference, resolverMode).resolvedModule; };
+            compilerHost.resolveModuleNames = function (moduleNames, containingFile, _reusedNames, redirectedReference, _options, containingSourceFile) {
+                return ts.loadWithModeAwareCache(ts.Debug.checkEachDefined(moduleNames), ts.Debug.checkDefined(containingSourceFile), containingFile, redirectedReference, loader_3);
+            };
+            compilerHost.getModuleResolutionCache = function () { return moduleResolutionCache; };
+        }
+        if (!compilerHost.resolveTypeReferenceDirectives) {
+            var loader_4 = function (moduleName, containingFile, redirectedReference) { return ts.resolveTypeReferenceDirective(moduleName, containingFile, state.projectCompilerOptions, compilerHost, redirectedReference, state.typeReferenceDirectiveResolutionCache).resolvedTypeReferenceDirective; };
+            compilerHost.resolveTypeReferenceDirectives = function (typeReferenceDirectiveNames, containingFile, redirectedReference) {
+                return ts.loadWithLocalCache(ts.Debug.checkEachDefined(typeReferenceDirectiveNames), containingFile, redirectedReference, loader_4);
             };
         }
         var _a = ts.createWatchFactory(hostWithWatch, options), watchFile = _a.watchFile, watchDirectory = _a.watchDirectory, writeLog = _a.writeLog;
@@ -113116,6 +120965,7 @@ var ts;
             projectErrorsReported: new ts.Map(),
             compilerHost: compilerHost,
             moduleResolutionCache: moduleResolutionCache,
+            typeReferenceDirectiveResolutionCache: typeReferenceDirectiveResolutionCache,
             // Mutable state
             buildOrder: undefined,
             readFileWithCache: function (f) { return host.readFile(f); },
@@ -113131,6 +120981,8 @@ var ts;
             allWatchedInputFiles: new ts.Map(),
             allWatchedConfigFiles: new ts.Map(),
             allWatchedExtendedConfigFiles: new ts.Map(),
+            allWatchedPackageJsonFiles: new ts.Map(),
+            lastCachedPackageJsonLookups: new ts.Map(),
             timerToBuildInvalidatedProject: undefined,
             reportFileChangeDetected: false,
             watchFile: watchFile,
@@ -113154,6 +121006,10 @@ var ts;
     function isParsedCommandLine(entry) {
         return !!entry.options;
     }
+    function getCachedParsedConfigFile(state, configFilePath) {
+        var value = state.configFileCache.get(configFilePath);
+        return value && isParsedCommandLine(value) ? value : undefined;
+    }
     function parseConfigFile(state, configFileName, configFilePath) {
         var configFileCache = state.configFileCache;
         var value = configFileCache.get(configFilePath);
@@ -113250,6 +121106,7 @@ var ts;
             });
             ts.mutateMapSkippingNewValues(state.allWatchedWildcardDirectories, currentProjects, { onDeleteValue: function (existingMap) { return existingMap.forEach(ts.closeFileWatcherOf); } });
             ts.mutateMapSkippingNewValues(state.allWatchedInputFiles, currentProjects, { onDeleteValue: function (existingMap) { return existingMap.forEach(ts.closeFileWatcher); } });
+            ts.mutateMapSkippingNewValues(state.allWatchedPackageJsonFiles, currentProjects, { onDeleteValue: function (existingMap) { return existingMap.forEach(ts.closeFileWatcher); } });
         }
         return state.buildOrder = buildOrder;
     }
@@ -113282,7 +121139,7 @@ var ts;
             for (var _i = 0; _i < arguments.length; _i++) {
                 args[_i] = arguments[_i];
             }
-            return originalGetSourceFile.call.apply(originalGetSourceFile, __spreadArray([compilerHost], args));
+            return originalGetSourceFile.call.apply(originalGetSourceFile, __spreadArray([compilerHost], args, false));
         }), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile, getSourceFileWithCache = _a.getSourceFileWithCache, readFileWithCache = _a.readFileWithCache;
         state.readFileWithCache = readFileWithCache;
         compilerHost.getSourceFile = getSourceFileWithCache;
@@ -113299,7 +121156,7 @@ var ts;
     function disableCache(state) {
         if (!state.cache)
             return;
-        var cache = state.cache, host = state.host, compilerHost = state.compilerHost, extendedConfigCache = state.extendedConfigCache, moduleResolutionCache = state.moduleResolutionCache;
+        var cache = state.cache, host = state.host, compilerHost = state.compilerHost, extendedConfigCache = state.extendedConfigCache, moduleResolutionCache = state.moduleResolutionCache, typeReferenceDirectiveResolutionCache = state.typeReferenceDirectiveResolutionCache;
         host.readFile = cache.originalReadFile;
         host.fileExists = cache.originalFileExists;
         host.directoryExists = cache.originalDirectoryExists;
@@ -113308,10 +121165,8 @@ var ts;
         compilerHost.getSourceFile = cache.originalGetSourceFile;
         state.readFileWithCache = cache.originalReadFileWithCache;
         extendedConfigCache.clear();
-        if (moduleResolutionCache) {
-            moduleResolutionCache.directoryToModuleNameMap.clear();
-            moduleResolutionCache.moduleNameToDirectoryMap.clear();
-        }
+        moduleResolutionCache === null || moduleResolutionCache === void 0 ? void 0 : moduleResolutionCache.clear();
+        typeReferenceDirectiveResolutionCache === null || typeReferenceDirectiveResolutionCache === void 0 ? void 0 : typeReferenceDirectiveResolutionCache.clear();
         state.cache = undefined;
     }
     function clearProjectStatus(state, resolved) {
@@ -113333,9 +121188,8 @@ var ts;
         if (!state.allProjectBuildPending)
             return;
         state.allProjectBuildPending = false;
-        if (state.options.watch) {
+        if (state.options.watch)
             reportWatchStatus(state, ts.Diagnostics.Starting_compilation_in_watch_mode);
-        }
         enableCache(state);
         var buildOrder = getBuildOrderFromAnyBuildOrder(getBuildOrder(state));
         buildOrder.forEach(function (configFileName) {
@@ -113440,7 +121294,7 @@ var ts;
                 },
                 emit: function (targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) {
                     if (targetSourceFile || emitOnlyDtsFiles) {
-                        return withProgramOrUndefined(function (program) { return program.emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers); });
+                        return withProgramOrUndefined(function (program) { var _a, _b; return program.emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers || ((_b = (_a = state.host).getCustomTransformers) === null || _b === void 0 ? void 0 : _b.call(_a, project))); });
                     }
                     executeSteps(BuildStep.SemanticDiagnostics, cancellationToken);
                     if (step === BuildStep.EmitBuildInfo) {
@@ -113478,6 +121332,7 @@ var ts;
             return withProgramOrUndefined(action) || ts.emptyArray;
         }
         function createProgram() {
+            var _a, _b;
             ts.Debug.assert(program === undefined);
             if (state.options.dry) {
                 reportStatus(state, ts.Diagnostics.A_non_dry_build_would_build_project_0, project);
@@ -113497,10 +121352,15 @@ var ts;
             var host = state.host, compilerHost = state.compilerHost;
             state.projectCompilerOptions = config.options;
             // Update module resolution cache if needed
-            updateModuleResolutionCache(state, project, config);
+            (_a = state.moduleResolutionCache) === null || _a === void 0 ? void 0 : _a.update(config.options);
+            (_b = state.typeReferenceDirectiveResolutionCache) === null || _b === void 0 ? void 0 : _b.update(config.options);
             // Create program
             program = host.createProgram(config.fileNames, config.options, compilerHost, getOldProgram(state, projectPath, config), ts.getConfigFileParsingDiagnostics(config), config.projectReferences);
             if (state.watch) {
+                state.lastCachedPackageJsonLookups.set(projectPath, state.moduleResolutionCache && ts.map(state.moduleResolutionCache.getPackageJsonInfoCache().entries(), function (_a) {
+                    var path = _a[0], data = _a[1];
+                    return [state.host.realpath && data ? toPath(state, state.host.realpath(path)) : path, data];
+                }));
                 state.builderPrograms.set(projectPath, program);
             }
             step++;
@@ -113516,13 +121376,14 @@ var ts;
         }
         function getSyntaxDiagnostics(cancellationToken) {
             ts.Debug.assertIsDefined(program);
-            handleDiagnostics(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], program.getConfigFileParsingDiagnostics()), program.getOptionsDiagnostics(cancellationToken)), program.getGlobalDiagnostics(cancellationToken)), program.getSyntacticDiagnostics(/*sourceFile*/ undefined, cancellationToken)), BuildResultFlags.SyntaxErrors, "Syntactic");
+            handleDiagnostics(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], program.getConfigFileParsingDiagnostics(), true), program.getOptionsDiagnostics(cancellationToken), true), program.getGlobalDiagnostics(cancellationToken), true), program.getSyntacticDiagnostics(/*sourceFile*/ undefined, cancellationToken), true), BuildResultFlags.SyntaxErrors, "Syntactic");
         }
         function getSemanticDiagnostics(cancellationToken) {
             handleDiagnostics(ts.Debug.checkDefined(program).getSemanticDiagnostics(/*sourceFile*/ undefined, cancellationToken), BuildResultFlags.TypeErrors, "Semantic");
         }
         function emit(writeFileCallback, cancellationToken, customTransformers) {
             var _a;
+            var _b, _c;
             ts.Debug.assertIsDefined(program);
             ts.Debug.assert(step === BuildStep.Emit);
             // Before emitting lets backup state, so we can revert it back if there are declaration errors to handle emit and declaration errors correctly
@@ -113533,7 +121394,7 @@ var ts;
             var emitResult = ts.emitFilesAndReportErrors(program, reportDeclarationDiagnostics, 
             /*write*/ undefined, 
             /*reportSummary*/ undefined, function (name, text, writeByteOrderMark) { return outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark }); }, cancellationToken, 
-            /*emitOnlyDts*/ false, customTransformers).emitResult;
+            /*emitOnlyDts*/ false, customTransformers || ((_c = (_b = state.host).getCustomTransformers) === null || _c === void 0 ? void 0 : _c.call(_b, project))).emitResult;
             // Don't emit .d.ts if there are decl file errors
             if (declDiagnostics) {
                 program.restoreState();
@@ -113579,7 +121440,7 @@ var ts;
             var emitResult = program.emitBuildInfo(writeFileCallback, cancellationToken);
             if (emitResult.diagnostics.length) {
                 reportErrors(state, emitResult.diagnostics);
-                state.diagnostics.set(projectPath, __spreadArray(__spreadArray([], state.diagnostics.get(projectPath)), emitResult.diagnostics));
+                state.diagnostics.set(projectPath, __spreadArray(__spreadArray([], state.diagnostics.get(projectPath), true), emitResult.diagnostics, true));
                 buildResult = BuildResultFlags.EmitErrors & buildResult;
             }
             if (emitResult.emittedFiles && state.write) {
@@ -113615,6 +121476,7 @@ var ts;
             return emitDiagnostics;
         }
         function emitBundle(writeFileCallback, customTransformers) {
+            var _a, _b;
             ts.Debug.assert(kind === InvalidatedProjectKind.UpdateBundle);
             if (state.options.dry) {
                 reportStatus(state, ts.Diagnostics.A_non_dry_build_would_update_output_of_project_0, project);
@@ -113630,7 +121492,7 @@ var ts;
             var outputFiles = ts.emitUsingBuildInfo(config, compilerHost, function (ref) {
                 var refName = resolveProjectName(state, ref.path);
                 return parseConfigFile(state, refName, toResolvedConfigFilePath(state, refName));
-            }, customTransformers);
+            }, customTransformers || ((_b = (_a = state.host).getCustomTransformers) === null || _b === void 0 ? void 0 : _b.call(_a, project)));
             if (ts.isString(outputFiles)) {
                 reportStatus(state, ts.Diagnostics.Cannot_update_output_of_project_0_because_there_was_error_reading_file_1, project, relName(state, outputFiles));
                 step = BuildStep.BuildInvalidatedProjectOfBundle;
@@ -113672,7 +121534,7 @@ var ts;
                         emitBundle(writeFile, customTransformers);
                         break;
                     case BuildStep.BuildInvalidatedProjectOfBundle:
-                        ts.Debug.checkDefined(invalidatedProjectOfBundle).done(cancellationToken);
+                        ts.Debug.checkDefined(invalidatedProjectOfBundle).done(cancellationToken, writeFile, customTransformers);
                         step = BuildStep.Done;
                         break;
                     case BuildStep.QueueReferencingProjects:
@@ -113729,12 +121591,14 @@ var ts;
                 watchExtendedConfigFiles(state, projectPath, config);
                 watchWildCardDirectories(state, project, projectPath, config);
                 watchInputFiles(state, project, projectPath, config);
+                watchPackageJsonFiles(state, project, projectPath, config);
             }
             else if (reloadLevel === ts.ConfigFileProgramReloadLevel.Partial) {
                 // Update file names
                 config.fileNames = ts.getFileNamesFromConfigSpecs(config.options.configFile.configFileSpecs, ts.getDirectoryPath(project), config.options, state.parseConfigFileHost);
                 ts.updateErrorForNoInputFiles(config.fileNames, project, config.options.configFile.configFileSpecs, config.errors, ts.canJsonReportNoInputFiles(config.raw));
                 watchInputFiles(state, project, projectPath, config);
+                watchPackageJsonFiles(state, project, projectPath, config);
             }
             var status = getUpToDateStatus(state, config, projectPath);
             verboseReportProjectStatus(state, project, status);
@@ -113779,7 +121643,7 @@ var ts;
     function listEmittedFile(_a, proj, file) {
         var write = _a.write;
         if (write && proj.options.listEmittedFiles) {
-            write("TSFILE: " + file);
+            write("TSFILE: ".concat(file));
         }
     }
     function getOldProgram(_a, proj, parsed) {
@@ -113808,40 +121672,15 @@ var ts;
     function buildErrors(state, resolvedPath, program, config, diagnostics, buildResult, errorType) {
         var canEmitBuildInfo = !(buildResult & BuildResultFlags.SyntaxErrors) && program && !ts.outFile(program.getCompilerOptions());
         reportAndStoreErrors(state, resolvedPath, diagnostics);
-        state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.Unbuildable, reason: errorType + " errors" });
+        state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.Unbuildable, reason: "".concat(errorType, " errors") });
         if (canEmitBuildInfo)
             return { buildResult: buildResult, step: BuildStep.EmitBuildInfo };
         afterProgramDone(state, program, config);
         return { buildResult: buildResult, step: BuildStep.QueueReferencingProjects };
     }
-    function updateModuleResolutionCache(state, proj, config) {
-        if (!state.moduleResolutionCache)
-            return;
-        // Update module resolution cache if needed
-        var moduleResolutionCache = state.moduleResolutionCache;
-        var projPath = toPath(state, proj);
-        if (moduleResolutionCache.directoryToModuleNameMap.redirectsMap.size === 0) {
-            // The own map will be for projectCompilerOptions
-            ts.Debug.assert(moduleResolutionCache.moduleNameToDirectoryMap.redirectsMap.size === 0);
-            moduleResolutionCache.directoryToModuleNameMap.redirectsMap.set(projPath, moduleResolutionCache.directoryToModuleNameMap.ownMap);
-            moduleResolutionCache.moduleNameToDirectoryMap.redirectsMap.set(projPath, moduleResolutionCache.moduleNameToDirectoryMap.ownMap);
-        }
-        else {
-            // Set correct own map
-            ts.Debug.assert(moduleResolutionCache.moduleNameToDirectoryMap.redirectsMap.size > 0);
-            var ref = {
-                sourceFile: config.options.configFile,
-                commandLine: config
-            };
-            moduleResolutionCache.directoryToModuleNameMap.setOwnMap(moduleResolutionCache.directoryToModuleNameMap.getOrCreateMapOfCacheRedirects(ref));
-            moduleResolutionCache.moduleNameToDirectoryMap.setOwnMap(moduleResolutionCache.moduleNameToDirectoryMap.getOrCreateMapOfCacheRedirects(ref));
-        }
-        moduleResolutionCache.directoryToModuleNameMap.setOwnOptions(config.options);
-        moduleResolutionCache.moduleNameToDirectoryMap.setOwnOptions(config.options);
-    }
     function checkConfigFileUpToDateStatus(state, configFile, oldestOutputFileTime, oldestOutputFileName) {
         // Check tsconfig time
-        var tsconfigTime = state.host.getModifiedTime(configFile) || ts.missingFileModifiedTime;
+        var tsconfigTime = ts.getModifiedTime(state.host, configFile);
         if (oldestOutputFileTime < tsconfigTime) {
             return {
                 type: ts.UpToDateStatusType.OutOfDateWithSelf,
@@ -113851,6 +121690,7 @@ var ts;
         }
     }
     function getUpToDateStatusWorker(state, project, resolvedPath) {
+        var force = !!state.options.force;
         var newestInputFileName = undefined;
         var newestInputFileTime = minimumDate;
         var host = state.host;
@@ -113860,13 +121700,15 @@ var ts;
             if (!host.fileExists(inputFile)) {
                 return {
                     type: ts.UpToDateStatusType.Unbuildable,
-                    reason: inputFile + " does not exist"
+                    reason: "".concat(inputFile, " does not exist")
                 };
             }
-            var inputTime = host.getModifiedTime(inputFile) || ts.missingFileModifiedTime;
-            if (inputTime > newestInputFileTime) {
-                newestInputFileName = inputFile;
-                newestInputFileTime = inputTime;
+            if (!force) {
+                var inputTime = ts.getModifiedTime(host, inputFile);
+                if (inputTime > newestInputFileTime) {
+                    newestInputFileName = inputFile;
+                    newestInputFileTime = inputTime;
+                }
             }
         }
         // Container if no files are specified in the project
@@ -113885,36 +121727,38 @@ var ts;
         var missingOutputFileName;
         var newestDeclarationFileContentChangedTime = minimumDate;
         var isOutOfDateWithInputs = false;
-        for (var _b = 0, outputs_1 = outputs; _b < outputs_1.length; _b++) {
-            var output = outputs_1[_b];
-            // Output is missing; can stop checking
-            // Don't immediately return because we can still be upstream-blocked, which is a higher-priority status
-            if (!host.fileExists(output)) {
-                missingOutputFileName = output;
-                break;
-            }
-            var outputTime = host.getModifiedTime(output) || ts.missingFileModifiedTime;
-            if (outputTime < oldestOutputFileTime) {
-                oldestOutputFileTime = outputTime;
-                oldestOutputFileName = output;
-            }
-            // If an output is older than the newest input, we can stop checking
-            // Don't immediately return because we can still be upstream-blocked, which is a higher-priority status
-            if (outputTime < newestInputFileTime) {
-                isOutOfDateWithInputs = true;
-                break;
-            }
-            if (outputTime > newestOutputFileTime) {
-                newestOutputFileTime = outputTime;
-                newestOutputFileName = output;
-            }
-            // Keep track of when the most recent time a .d.ts file was changed.
-            // In addition to file timestamps, we also keep track of when a .d.ts file
-            // had its file touched but not had its contents changed - this allows us
-            // to skip a downstream typecheck
-            if (isDeclarationFile(output)) {
-                var outputModifiedTime = host.getModifiedTime(output) || ts.missingFileModifiedTime;
-                newestDeclarationFileContentChangedTime = newer(newestDeclarationFileContentChangedTime, outputModifiedTime);
+        if (!force) {
+            for (var _b = 0, outputs_1 = outputs; _b < outputs_1.length; _b++) {
+                var output = outputs_1[_b];
+                // Output is missing; can stop checking
+                // Don't immediately return because we can still be upstream-blocked, which is a higher-priority status
+                if (!host.fileExists(output)) {
+                    missingOutputFileName = output;
+                    break;
+                }
+                var outputTime = ts.getModifiedTime(host, output);
+                if (outputTime < oldestOutputFileTime) {
+                    oldestOutputFileTime = outputTime;
+                    oldestOutputFileName = output;
+                }
+                // If an output is older than the newest input, we can stop checking
+                // Don't immediately return because we can still be upstream-blocked, which is a higher-priority status
+                if (outputTime < newestInputFileTime) {
+                    isOutOfDateWithInputs = true;
+                    break;
+                }
+                if (outputTime > newestOutputFileTime) {
+                    newestOutputFileTime = outputTime;
+                    newestOutputFileName = output;
+                }
+                // Keep track of when the most recent time a .d.ts file was changed.
+                // In addition to file timestamps, we also keep track of when a .d.ts file
+                // had its file touched but not had its contents changed - this allows us
+                // to skip a downstream typecheck
+                if (isDeclarationFile(output)) {
+                    var outputModifiedTime = ts.getModifiedTime(host, output);
+                    newestDeclarationFileContentChangedTime = newer(newestDeclarationFileContentChangedTime, outputModifiedTime);
+                }
             }
         }
         var pseudoUpToDate = false;
@@ -113950,7 +121794,8 @@ var ts;
                     };
                 }
                 // Check oldest output file name only if there is no missing output file name
-                if (!missingOutputFileName) {
+                // (a check we will have skipped if this is a forced build)
+                if (!force && !missingOutputFileName) {
                     // If the upstream project's newest file is older than our oldest output, we
                     // can't be out of date because of it
                     if (refStatus.newestInputFileTime && refStatus.newestInputFileTime <= oldestOutputFileTime) {
@@ -113995,8 +121840,15 @@ var ts;
             var extendedConfigStatus = ts.forEach(project.options.configFile.extendedSourceFiles || ts.emptyArray, function (configFile) { return checkConfigFileUpToDateStatus(state, configFile, oldestOutputFileTime, oldestOutputFileName); });
             if (extendedConfigStatus)
                 return extendedConfigStatus;
+            // Check package file time
+            var dependentPackageFileStatus = ts.forEach(state.lastCachedPackageJsonLookups.get(resolvedPath) || ts.emptyArray, function (_a) {
+                var path = _a[0];
+                return checkConfigFileUpToDateStatus(state, path, oldestOutputFileTime, oldestOutputFileName);
+            });
+            if (dependentPackageFileStatus)
+                return dependentPackageFileStatus;
         }
-        if (!state.buildInfoChecked.has(resolvedPath)) {
+        if (!force && !state.buildInfoChecked.has(resolvedPath)) {
             state.buildInfoChecked.set(resolvedPath, true);
             var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(project.options);
             if (buildInfoPath) {
@@ -114041,6 +121893,8 @@ var ts;
         return actual;
     }
     function updateOutputTimestampsWorker(state, proj, priorNewestUpdateTime, verboseMessage, skipOutputs) {
+        if (proj.options.noEmit)
+            return priorNewestUpdateTime;
         var host = state.host;
         var outputs = ts.getAllProjectOutputs(proj, !host.useCaseSensitiveFileNames());
         if (!skipOutputs || outputs.length !== skipOutputs.size) {
@@ -114056,7 +121910,7 @@ var ts;
                     reportStatus(state, verboseMessage, proj.options.configFilePath);
                 }
                 if (isDeclarationFile(file)) {
-                    priorNewestUpdateTime = newer(priorNewestUpdateTime, host.getModifiedTime(file) || ts.missingFileModifiedTime);
+                    priorNewestUpdateTime = newer(priorNewestUpdateTime, ts.getModifiedTime(host, file));
                 }
                 host.setModifiedTime(file, now);
             }
@@ -114138,7 +121992,7 @@ var ts;
             }
         }
     }
-    function build(state, project, cancellationToken, onlyReferences) {
+    function build(state, project, cancellationToken, writeFile, getCustomTransformers, onlyReferences) {
         var buildOrder = getBuildOrderFor(state, project, onlyReferences);
         if (!buildOrder)
             return ts.ExitStatus.InvalidProject_OutputsSkipped;
@@ -114150,7 +122004,7 @@ var ts;
             if (!invalidatedProject)
                 break;
             reportQueue = false;
-            invalidatedProject.done(cancellationToken);
+            invalidatedProject.done(cancellationToken, writeFile, getCustomTransformers === null || getCustomTransformers === void 0 ? void 0 : getCustomTransformers(invalidatedProject.project));
             if (!state.diagnostics.has(invalidatedProject.projectPath))
                 successfulProjects++;
         }
@@ -114185,8 +122039,14 @@ var ts;
                 continue;
             }
             var outputs = ts.getAllProjectOutputs(parsed, !host.useCaseSensitiveFileNames());
+            if (!outputs.length)
+                continue;
+            var inputFileNames = new ts.Set(parsed.fileNames.map(function (f) { return toPath(state, f); }));
             for (var _a = 0, outputs_3 = outputs; _a < outputs_3.length; _a++) {
                 var output = outputs_3[_a];
+                // If output name is same as input file name, do not delete and ignore the error
+                if (inputFileNames.has(toPath(state, output)))
+                    continue;
                 if (host.fileExists(output)) {
                     if (filesToDelete) {
                         filesToDelete.push(output);
@@ -114199,7 +122059,7 @@ var ts;
             }
         }
         if (filesToDelete) {
-            reportStatus(state, ts.Diagnostics.A_non_dry_build_would_delete_the_following_files_Colon_0, filesToDelete.map(function (f) { return "\r\n * " + f; }).join(""));
+            reportStatus(state, ts.Diagnostics.A_non_dry_build_would_delete_the_following_files_Colon_0, filesToDelete.map(function (f) { return "\r\n * ".concat(f); }).join(""));
         }
         return ts.ExitStatus.Success;
     }
@@ -114262,7 +122122,7 @@ var ts;
         }, ts.PollingInterval.High, parsed === null || parsed === void 0 ? void 0 : parsed.watchOptions, ts.WatchType.ConfigFile, resolved));
     }
     function watchExtendedConfigFiles(state, resolvedPath, parsed) {
-        ts.updateSharedExtendedConfigFileWatcher(resolvedPath, parsed, state.allWatchedExtendedConfigFiles, function (extendedConfigFileName, extendedConfigFilePath) { return state.watchFile(extendedConfigFileName, function () {
+        ts.updateSharedExtendedConfigFileWatcher(resolvedPath, parsed === null || parsed === void 0 ? void 0 : parsed.options, state.allWatchedExtendedConfigFiles, function (extendedConfigFileName, extendedConfigFilePath) { return state.watchFile(extendedConfigFileName, function () {
             var _a;
             return (_a = state.allWatchedExtendedConfigFiles.get(extendedConfigFilePath)) === null || _a === void 0 ? void 0 : _a.projects.forEach(function (projectConfigFilePath) {
                 return invalidateProjectAndScheduleBuilds(state, projectConfigFilePath, ts.ConfigFileProgramReloadLevel.Full);
@@ -114273,6 +122133,7 @@ var ts;
         if (!state.watch)
             return;
         ts.updateWatchingWildcardDirectories(getOrCreateValueMapFromConfigFileMap(state.allWatchedWildcardDirectories, resolvedPath), new ts.Map(ts.getEntries(parsed.wildcardDirectories)), function (dir, flags) { return state.watchDirectory(dir, function (fileOrDirectory) {
+            var _a;
             if (ts.isIgnoredFileFromWildCardWatching({
                 watchedDirPath: toPath(state, dir),
                 fileOrDirectory: fileOrDirectory,
@@ -114280,9 +122141,10 @@ var ts;
                 configFileName: resolved,
                 currentDirectory: state.currentDirectory,
                 options: parsed.options,
-                program: state.builderPrograms.get(resolvedPath),
+                program: state.builderPrograms.get(resolvedPath) || ((_a = getCachedParsedConfigFile(state, resolvedPath)) === null || _a === void 0 ? void 0 : _a.fileNames),
                 useCaseSensitiveFileNames: state.parseConfigFileHost.useCaseSensitiveFileNames,
-                writeLog: function (s) { return state.writeLog(s); }
+                writeLog: function (s) { return state.writeLog(s); },
+                toPath: function (fileName) { return toPath(state, fileName); }
             }))
                 return;
             invalidateProjectAndScheduleBuilds(state, resolvedPath, ts.ConfigFileProgramReloadLevel.Partial);
@@ -114296,6 +122158,14 @@ var ts;
             onDeleteValue: ts.closeFileWatcher,
         });
     }
+    function watchPackageJsonFiles(state, resolved, resolvedPath, parsed) {
+        if (!state.watch || !state.lastCachedPackageJsonLookups)
+            return;
+        ts.mutateMap(getOrCreateValueMapFromConfigFileMap(state.allWatchedPackageJsonFiles, resolvedPath), new ts.Map(state.lastCachedPackageJsonLookups.get(resolvedPath)), {
+            createNewValue: function (path, _input) { return state.watchFile(path, function () { return invalidateProjectAndScheduleBuilds(state, resolvedPath, ts.ConfigFileProgramReloadLevel.Full); }, ts.PollingInterval.High, parsed === null || parsed === void 0 ? void 0 : parsed.watchOptions, ts.WatchType.PackageJson, resolved); },
+            onDeleteValue: ts.closeFileWatcher,
+        });
+    }
     function startWatching(state, buildOrder) {
         if (!state.watchAllProjectsPending)
             return;
@@ -114312,24 +122182,24 @@ var ts;
                 watchWildCardDirectories(state, resolved, resolvedPath, cfg);
                 // Watch input files
                 watchInputFiles(state, resolved, resolvedPath, cfg);
+                // Watch package json files
+                watchPackageJsonFiles(state, resolved, resolvedPath, cfg);
             }
         }
     }
     function stopWatching(state) {
         ts.clearMap(state.allWatchedConfigFiles, ts.closeFileWatcher);
-        ts.clearMap(state.allWatchedExtendedConfigFiles, function (watcher) {
-            watcher.projects.clear();
-            watcher.close();
-        });
+        ts.clearMap(state.allWatchedExtendedConfigFiles, ts.closeFileWatcherOf);
         ts.clearMap(state.allWatchedWildcardDirectories, function (watchedWildcardDirectories) { return ts.clearMap(watchedWildcardDirectories, ts.closeFileWatcherOf); });
         ts.clearMap(state.allWatchedInputFiles, function (watchedWildcardDirectories) { return ts.clearMap(watchedWildcardDirectories, ts.closeFileWatcher); });
+        ts.clearMap(state.allWatchedPackageJsonFiles, function (watchedPacageJsonFiles) { return ts.clearMap(watchedPacageJsonFiles, ts.closeFileWatcher); });
     }
     function createSolutionBuilderWorker(watch, hostOrHostWithWatch, rootNames, options, baseWatchOptions) {
         var state = createSolutionBuilderState(watch, hostOrHostWithWatch, rootNames, options, baseWatchOptions);
         return {
-            build: function (project, cancellationToken) { return build(state, project, cancellationToken); },
+            build: function (project, cancellationToken, writeFile, getCustomTransformers) { return build(state, project, cancellationToken, writeFile, getCustomTransformers); },
             clean: function (project) { return clean(state, project); },
-            buildReferences: function (project, cancellationToken) { return build(state, project, cancellationToken, /*onlyReferences*/ true); },
+            buildReferences: function (project, cancellationToken, writeFile, getCustomTransformers) { return build(state, project, cancellationToken, writeFile, getCustomTransformers, /*onlyReferences*/ true); },
             cleanReferences: function (project) { return clean(state, project, /*onlyReferences*/ true); },
             getNextInvalidatedProject: function (cancellationToken) {
                 setupInitialBuild(state, cancellationToken);
@@ -114355,7 +122225,7 @@ var ts;
         for (var _i = 2; _i < arguments.length; _i++) {
             args[_i - 2] = arguments[_i];
         }
-        state.host.reportSolutionBuilderStatus(ts.createCompilerDiagnostic.apply(void 0, __spreadArray([message], args)));
+        state.host.reportSolutionBuilderStatus(ts.createCompilerDiagnostic.apply(void 0, __spreadArray([message], args, false)));
     }
     function reportWatchStatus(state, message) {
         var _a, _b;
@@ -114363,7 +122233,7 @@ var ts;
         for (var _i = 2; _i < arguments.length; _i++) {
             args[_i - 2] = arguments[_i];
         }
-        (_b = (_a = state.hostWithWatch).onWatchStatusChange) === null || _b === void 0 ? void 0 : _b.call(_a, ts.createCompilerDiagnostic.apply(void 0, __spreadArray([message], args)), state.host.getNewLine(), state.baseCompilerOptions);
+        (_b = (_a = state.hostWithWatch).onWatchStatusChange) === null || _b === void 0 ? void 0 : _b.call(_a, ts.createCompilerDiagnostic.apply(void 0, __spreadArray([message], args, false)), state.host.getNewLine(), state.baseCompilerOptions);
     }
     function reportErrors(_a, errors) {
         var host = _a.host;
@@ -114419,6 +122289,9 @@ var ts;
         }
     }
     function reportUpToDateStatus(state, configFileName, status) {
+        if (state.options.force && (status.type === ts.UpToDateStatusType.UpToDate || status.type === ts.UpToDateStatusType.UpToDateWithUpstreamTypes)) {
+            return reportStatus(state, ts.Diagnostics.Project_0_is_being_forcibly_rebuilt, relName(state, configFileName));
+        }
         switch (status.type) {
             case ts.UpToDateStatusType.OutOfDateWithSelf:
                 return reportStatus(state, ts.Diagnostics.Project_0_is_out_of_date_because_oldest_output_1_is_older_than_newest_input_2, relName(state, configFileName), relName(state, status.outOfDateOutputFileName), relName(state, status.newerInputFileName));
@@ -114519,7 +122392,7 @@ var ts;
         function nowString() {
             // E.g. "12:34:56.789"
             var d = new Date();
-            return ts.padLeft(d.getHours().toString(), 2, "0") + ":" + ts.padLeft(d.getMinutes().toString(), 2, "0") + ":" + ts.padLeft(d.getSeconds().toString(), 2, "0") + "." + ts.padLeft(d.getMilliseconds().toString(), 3, "0");
+            return "".concat(ts.padLeft(d.getHours().toString(), 2, "0"), ":").concat(ts.padLeft(d.getMinutes().toString(), 2, "0"), ":").concat(ts.padLeft(d.getSeconds().toString(), 2, "0"), ".").concat(ts.padLeft(d.getMilliseconds().toString(), 3, "0"));
         }
         server.nowString = nowString;
     })(server = ts.server || (ts.server = {}));
@@ -114530,12 +122403,13 @@ var ts;
     var JsTyping;
     (function (JsTyping) {
         function isTypingUpToDate(cachedTyping, availableTypingVersions) {
-            var availableVersion = new ts.Version(ts.getProperty(availableTypingVersions, "ts" + ts.versionMajorMinor) || ts.getProperty(availableTypingVersions, "latest"));
+            var availableVersion = new ts.Version(ts.getProperty(availableTypingVersions, "ts".concat(ts.versionMajorMinor)) || ts.getProperty(availableTypingVersions, "latest"));
             return availableVersion.compareTo(cachedTyping.version) <= 0;
         }
         JsTyping.isTypingUpToDate = isTypingUpToDate;
-        JsTyping.nodeCoreModuleList = [
+        var unprefixedNodeCoreModuleList = [
             "assert",
+            "assert/strict",
             "async_hooks",
             "buffer",
             "child_process",
@@ -114544,14 +122418,18 @@ var ts;
             "constants",
             "crypto",
             "dgram",
+            "diagnostics_channel",
             "dns",
+            "dns/promises",
             "domain",
             "events",
             "fs",
+            "fs/promises",
             "http",
             "https",
             "http2",
             "inspector",
+            "module",
             "net",
             "os",
             "path",
@@ -114562,16 +122440,24 @@ var ts;
             "readline",
             "repl",
             "stream",
+            "stream/promises",
             "string_decoder",
             "timers",
+            "timers/promises",
             "tls",
+            "trace_events",
             "tty",
             "url",
             "util",
+            "util/types",
             "v8",
             "vm",
+            "wasi",
+            "worker_threads",
             "zlib"
         ];
+        JsTyping.prefixedNodeCoreModuleList = unprefixedNodeCoreModuleList.map(function (name) { return "node:".concat(name); });
+        JsTyping.nodeCoreModuleList = __spreadArray(__spreadArray([], unprefixedNodeCoreModuleList, true), JsTyping.prefixedNodeCoreModuleList, true);
         JsTyping.nodeCoreModules = new ts.Set(JsTyping.nodeCoreModuleList);
         function nonRelativeModuleNameForTypingCache(moduleName) {
             return JsTyping.nodeCoreModules.has(moduleName) ? "node" : moduleName;
@@ -114649,7 +122535,7 @@ var ts;
                 var excludeTypingName = exclude_1[_i];
                 var didDelete = inferredTypings.delete(excludeTypingName);
                 if (didDelete && log)
-                    log("Typing for " + excludeTypingName + " is in exclude list, will be ignored.");
+                    log("Typing for ".concat(excludeTypingName, " is in exclude list, will be ignored."));
             }
             var newTypingNames = [];
             var cachedTypingPaths = [];
@@ -114663,7 +122549,7 @@ var ts;
             });
             var result = { cachedTypingPaths: cachedTypingPaths, newTypingNames: newTypingNames, filesToWatch: filesToWatch };
             if (log)
-                log("Result: " + JSON.stringify(result));
+                log("Result: ".concat(JSON.stringify(result)));
             return result;
             function addInferredTyping(typingName) {
                 if (!inferredTypings.has(typingName)) {
@@ -114672,7 +122558,7 @@ var ts;
             }
             function addInferredTypings(typingNames, message) {
                 if (log)
-                    log(message + ": " + JSON.stringify(typingNames));
+                    log("".concat(message, ": ").concat(JSON.stringify(typingNames)));
                 ts.forEach(typingNames, addInferredTyping);
             }
             /**
@@ -114685,7 +122571,7 @@ var ts;
                 filesToWatch.push(jsonPath);
                 var jsonConfig = ts.readConfigFile(jsonPath, function (path) { return host.readFile(path); }).config;
                 var jsonTypingNames = ts.flatMap([jsonConfig.dependencies, jsonConfig.devDependencies, jsonConfig.optionalDependencies, jsonConfig.peerDependencies], ts.getOwnKeys);
-                addInferredTypings(jsonTypingNames, "Typing names in '" + jsonPath + "' dependencies");
+                addInferredTypings(jsonTypingNames, "Typing names in '".concat(jsonPath, "' dependencies"));
             }
             /**
              * Infer typing names from given file names. For example, the file name "jquery-min.2.3.4.js"
@@ -114724,7 +122610,7 @@ var ts;
                 // depth of 2, so we access `node_modules/foo` but not `node_modules/foo/bar`
                 var fileNames = host.readDirectory(packagesFolderPath, [".json" /* Json */], /*excludes*/ undefined, /*includes*/ undefined, /*depth*/ 2);
                 if (log)
-                    log("Searching for typing names in " + packagesFolderPath + "; all files: " + JSON.stringify(fileNames));
+                    log("Searching for typing names in ".concat(packagesFolderPath, "; all files: ").concat(JSON.stringify(fileNames)));
                 var packageNames = [];
                 for (var _i = 0, fileNames_1 = fileNames; _i < fileNames_1.length; _i++) {
                     var fileName = fileNames_1[_i];
@@ -114751,7 +122637,7 @@ var ts;
                     if (ownTypes) {
                         var absolutePath = ts.getNormalizedAbsolutePath(ownTypes, ts.getDirectoryPath(normalizedFileName));
                         if (log)
-                            log("    Package '" + packageJson.name + "' provides its own types.");
+                            log("    Package '".concat(packageJson.name, "' provides its own types."));
                         inferredTypings.set(packageJson.name, absolutePath);
                     }
                     else {
@@ -114823,15 +122709,15 @@ var ts;
             var kind = isScopeName ? "Scope" : "Package";
             switch (result) {
                 case 1 /* EmptyName */:
-                    return "'" + typing + "':: " + kind + " name '" + name + "' cannot be empty";
+                    return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' cannot be empty");
                 case 2 /* NameTooLong */:
-                    return "'" + typing + "':: " + kind + " name '" + name + "' should be less than " + maxPackageNameLength + " characters";
+                    return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' should be less than ").concat(maxPackageNameLength, " characters");
                 case 3 /* NameStartsWithDot */:
-                    return "'" + typing + "':: " + kind + " name '" + name + "' cannot start with '.'";
+                    return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' cannot start with '.'");
                 case 4 /* NameStartsWithUnderscore */:
-                    return "'" + typing + "':: " + kind + " name '" + name + "' cannot start with '_'";
+                    return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' cannot start with '_'");
                 case 5 /* NameContainsNonURISafeCharacters */:
-                    return "'" + typing + "':: " + kind + " name '" + name + "' contains non URI safe characters";
+                    return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' contains non URI safe characters");
                 case 0 /* Ok */:
                     return ts.Debug.fail(); // Shouldn't have called this.
                 default:
@@ -114857,7 +122743,7 @@ var ts;
                 }
                 catch (e) {
                     if (log.isEnabled()) {
-                        log.writeLine("Failed to resolve " + packageName + " in folder '" + cachePath + "': " + e.message);
+                        log.writeLine("Failed to resolve ".concat(packageName, " in folder '").concat(cachePath, "': ").concat(e.message));
                     }
                     return undefined;
                 }
@@ -114878,7 +122764,7 @@ var ts;
                 var sliceStart = packageNames.length - remaining;
                 var command, toSlice = remaining;
                 while (true) {
-                    command = npmPath + " install --ignore-scripts " + (toSlice === packageNames.length ? packageNames : packageNames.slice(sliceStart, sliceStart + toSlice)).join(" ") + " --save-dev --user-agent=\"typesInstaller/" + tsVersion + "\"";
+                    command = "".concat(npmPath, " install --ignore-scripts ").concat((toSlice === packageNames.length ? packageNames : packageNames.slice(sliceStart, sliceStart + toSlice)).join(" "), " --save-dev --user-agent=\"typesInstaller/").concat(tsVersion, "\"");
                     if (command.length < 8000) {
                         break;
                     }
@@ -114905,7 +122791,7 @@ var ts;
                 ProjectWatcherType["DirectoryWatcher"] = "DirectoryWatcher";
             })(ProjectWatcherType || (ProjectWatcherType = {}));
             function getDetailWatchInfo(projectName, watchers) {
-                return "Project: " + projectName + " watcher already invoked: " + watchers.isInvoked;
+                return "Project: ".concat(projectName, " watcher already invoked: ").concat(watchers.isInvoked);
             }
             var TypingsInstaller = /** @class */ (function () {
                 function TypingsInstaller(installTypingHost, globalCachePath, safeListPath, typesMapLocation, throttleLimit, log) {
@@ -114929,7 +122815,7 @@ var ts;
                     this.globalCachePackageJsonPath = ts.combinePaths(globalCachePath, "package.json");
                     var isLoggingEnabled = this.log.isEnabled();
                     if (isLoggingEnabled) {
-                        this.log.writeLine("Global cache location '" + globalCachePath + "', safe file path '" + safeListPath + "', types map path " + typesMapLocation);
+                        this.log.writeLine("Global cache location '".concat(globalCachePath, "', safe file path '").concat(safeListPath, "', types map path ").concat(typesMapLocation));
                     }
                     this.watchFactory = ts.getWatchFactory(this.installTypingHost, isLoggingEnabled ? ts.WatchLogLevel.Verbose : ts.WatchLogLevel.None, function (s) { return _this.log.writeLine(s); }, getDetailWatchInfo);
                     this.processCacheLocation(this.globalCachePath);
@@ -114939,30 +122825,30 @@ var ts;
                 };
                 TypingsInstaller.prototype.closeWatchers = function (projectName) {
                     if (this.log.isEnabled()) {
-                        this.log.writeLine("Closing file watchers for project '" + projectName + "'");
+                        this.log.writeLine("Closing file watchers for project '".concat(projectName, "'"));
                     }
                     var watchers = this.projectWatchers.get(projectName);
                     if (!watchers) {
                         if (this.log.isEnabled()) {
-                            this.log.writeLine("No watchers are registered for project '" + projectName + "'");
+                            this.log.writeLine("No watchers are registered for project '".concat(projectName, "'"));
                         }
                         return;
                     }
                     ts.clearMap(watchers, ts.closeFileWatcher);
                     this.projectWatchers.delete(projectName);
                     if (this.log.isEnabled()) {
-                        this.log.writeLine("Closing file watchers for project '" + projectName + "' - done.");
+                        this.log.writeLine("Closing file watchers for project '".concat(projectName, "' - done."));
                     }
                 };
                 TypingsInstaller.prototype.install = function (req) {
                     var _this = this;
                     if (this.log.isEnabled()) {
-                        this.log.writeLine("Got install request " + JSON.stringify(req));
+                        this.log.writeLine("Got install request ".concat(JSON.stringify(req)));
                     }
                     // load existing typing information from the cache
                     if (req.cachePath) {
                         if (this.log.isEnabled()) {
-                            this.log.writeLine("Request specifies cache path '" + req.cachePath + "', loading cached information...");
+                            this.log.writeLine("Request specifies cache path '".concat(req.cachePath, "', loading cached information..."));
                         }
                         this.processCacheLocation(req.cachePath);
                     }
@@ -114971,7 +122857,7 @@ var ts;
                     }
                     var discoverTypingsResult = ts.JsTyping.discoverTypings(this.installTypingHost, this.log.isEnabled() ? (function (s) { return _this.log.writeLine(s); }) : undefined, req.fileNames, req.projectRootPath, this.safeList, this.packageNameToTypingLocation, req.typeAcquisition, req.unresolvedImports, this.typesRegistry);
                     if (this.log.isEnabled()) {
-                        this.log.writeLine("Finished typings discovery: " + JSON.stringify(discoverTypingsResult));
+                        this.log.writeLine("Finished typings discovery: ".concat(JSON.stringify(discoverTypingsResult)));
                     }
                     // start watching files
                     this.watchFiles(req.projectName, discoverTypingsResult.filesToWatch, req.projectRootPath, req.watchOptions);
@@ -114991,17 +122877,17 @@ var ts;
                     if (this.typesMapLocation) {
                         var safeListFromMap = ts.JsTyping.loadTypesMap(this.installTypingHost, this.typesMapLocation);
                         if (safeListFromMap) {
-                            this.log.writeLine("Loaded safelist from types map file '" + this.typesMapLocation + "'");
+                            this.log.writeLine("Loaded safelist from types map file '".concat(this.typesMapLocation, "'"));
                             this.safeList = safeListFromMap;
                             return;
                         }
-                        this.log.writeLine("Failed to load safelist from types map file '" + this.typesMapLocation + "'");
+                        this.log.writeLine("Failed to load safelist from types map file '".concat(this.typesMapLocation, "'"));
                     }
                     this.safeList = ts.JsTyping.loadSafeList(this.installTypingHost, this.safeListPath);
                 };
                 TypingsInstaller.prototype.processCacheLocation = function (cacheLocation) {
                     if (this.log.isEnabled()) {
-                        this.log.writeLine("Processing cache location '" + cacheLocation + "'");
+                        this.log.writeLine("Processing cache location '".concat(cacheLocation, "'"));
                     }
                     if (this.knownCachesSet.has(cacheLocation)) {
                         if (this.log.isEnabled()) {
@@ -115012,14 +122898,14 @@ var ts;
                     var packageJson = ts.combinePaths(cacheLocation, "package.json");
                     var packageLockJson = ts.combinePaths(cacheLocation, "package-lock.json");
                     if (this.log.isEnabled()) {
-                        this.log.writeLine("Trying to find '" + packageJson + "'...");
+                        this.log.writeLine("Trying to find '".concat(packageJson, "'..."));
                     }
                     if (this.installTypingHost.fileExists(packageJson) && this.installTypingHost.fileExists(packageLockJson)) {
                         var npmConfig = JSON.parse(this.installTypingHost.readFile(packageJson)); // TODO: GH#18217
                         var npmLock = JSON.parse(this.installTypingHost.readFile(packageLockJson)); // TODO: GH#18217
                         if (this.log.isEnabled()) {
-                            this.log.writeLine("Loaded content of '" + packageJson + "': " + JSON.stringify(npmConfig));
-                            this.log.writeLine("Loaded content of '" + packageLockJson + "'");
+                            this.log.writeLine("Loaded content of '".concat(packageJson, "': ").concat(JSON.stringify(npmConfig)));
+                            this.log.writeLine("Loaded content of '".concat(packageLockJson, "'"));
                         }
                         if (npmConfig.devDependencies && npmLock.dependencies) {
                             for (var key in npmConfig.devDependencies) {
@@ -115043,11 +122929,11 @@ var ts;
                                         continue;
                                     }
                                     if (this.log.isEnabled()) {
-                                        this.log.writeLine("New typing for package " + packageName + " from '" + typingFile + "' conflicts with existing typing file '" + existingTypingFile + "'");
+                                        this.log.writeLine("New typing for package ".concat(packageName, " from '").concat(typingFile, "' conflicts with existing typing file '").concat(existingTypingFile, "'"));
                                     }
                                 }
                                 if (this.log.isEnabled()) {
-                                    this.log.writeLine("Adding entry into typings cache: '" + packageName + "' => '" + typingFile + "'");
+                                    this.log.writeLine("Adding entry into typings cache: '".concat(packageName, "' => '").concat(typingFile, "'"));
                                 }
                                 var info = ts.getProperty(npmLock.dependencies, key);
                                 var version_1 = info && info.version;
@@ -115060,7 +122946,7 @@ var ts;
                         }
                     }
                     if (this.log.isEnabled()) {
-                        this.log.writeLine("Finished processing cache location '" + cacheLocation + "'");
+                        this.log.writeLine("Finished processing cache location '".concat(cacheLocation, "'"));
                     }
                     this.knownCachesSet.add(cacheLocation);
                 };
@@ -115070,7 +122956,7 @@ var ts;
                         var typingKey = ts.mangleScopedPackageName(typing);
                         if (_this.missingTypingsSet.has(typingKey)) {
                             if (_this.log.isEnabled())
-                                _this.log.writeLine("'" + typing + "':: '" + typingKey + "' is in missingTypingsSet - skipping...");
+                                _this.log.writeLine("'".concat(typing, "':: '").concat(typingKey, "' is in missingTypingsSet - skipping..."));
                             return undefined;
                         }
                         var validationResult = ts.JsTyping.validatePackageName(typing);
@@ -115083,12 +122969,12 @@ var ts;
                         }
                         if (!_this.typesRegistry.has(typingKey)) {
                             if (_this.log.isEnabled())
-                                _this.log.writeLine("'" + typing + "':: Entry for package '" + typingKey + "' does not exist in local types registry - skipping...");
+                                _this.log.writeLine("'".concat(typing, "':: Entry for package '").concat(typingKey, "' does not exist in local types registry - skipping..."));
                             return undefined;
                         }
                         if (_this.packageNameToTypingLocation.get(typingKey) && ts.JsTyping.isTypingUpToDate(_this.packageNameToTypingLocation.get(typingKey), _this.typesRegistry.get(typingKey))) {
                             if (_this.log.isEnabled())
-                                _this.log.writeLine("'" + typing + "':: '" + typingKey + "' already has an up-to-date typing - skipping...");
+                                _this.log.writeLine("'".concat(typing, "':: '").concat(typingKey, "' already has an up-to-date typing - skipping..."));
                             return undefined;
                         }
                         return typingKey;
@@ -115097,11 +122983,11 @@ var ts;
                 TypingsInstaller.prototype.ensurePackageDirectoryExists = function (directory) {
                     var npmConfigPath = ts.combinePaths(directory, "package.json");
                     if (this.log.isEnabled()) {
-                        this.log.writeLine("Npm config file: " + npmConfigPath);
+                        this.log.writeLine("Npm config file: ".concat(npmConfigPath));
                     }
                     if (!this.installTypingHost.fileExists(npmConfigPath)) {
                         if (this.log.isEnabled()) {
-                            this.log.writeLine("Npm config file: '" + npmConfigPath + "' is missing, creating new one...");
+                            this.log.writeLine("Npm config file: '".concat(npmConfigPath, "' is missing, creating new one..."));
                         }
                         this.ensureDirectoryExists(directory, this.installTypingHost);
                         this.installTypingHost.writeFile(npmConfigPath, '{ "private": true }');
@@ -115110,7 +122996,7 @@ var ts;
                 TypingsInstaller.prototype.installTypings = function (req, cachePath, currentlyCachedTypings, typingsToInstall) {
                     var _this = this;
                     if (this.log.isEnabled()) {
-                        this.log.writeLine("Installing typings " + JSON.stringify(typingsToInstall));
+                        this.log.writeLine("Installing typings ".concat(JSON.stringify(typingsToInstall)));
                     }
                     var filteredTypings = this.filterTypings(typingsToInstall);
                     if (filteredTypings.length === 0) {
@@ -115137,7 +123023,7 @@ var ts;
                         try {
                             if (!ok) {
                                 if (_this.log.isEnabled()) {
-                                    _this.log.writeLine("install request failed, marking packages as missing to prevent repeated requests: " + JSON.stringify(filteredTypings));
+                                    _this.log.writeLine("install request failed, marking packages as missing to prevent repeated requests: ".concat(JSON.stringify(filteredTypings)));
                                 }
                                 for (var _i = 0, filteredTypings_1 = filteredTypings; _i < filteredTypings_1.length; _i++) {
                                     var typing = filteredTypings_1[_i];
@@ -115147,7 +123033,7 @@ var ts;
                             }
                             // TODO: watch project directory
                             if (_this.log.isEnabled()) {
-                                _this.log.writeLine("Installed typings " + JSON.stringify(scopedTypings));
+                                _this.log.writeLine("Installed typings ".concat(JSON.stringify(scopedTypings)));
                             }
                             var installedTypingFiles = [];
                             for (var _a = 0, filteredTypings_2 = filteredTypings; _a < filteredTypings_2.length; _a++) {
@@ -115159,13 +123045,13 @@ var ts;
                                 }
                                 // packageName is guaranteed to exist in typesRegistry by filterTypings
                                 var distTags = _this.typesRegistry.get(packageName);
-                                var newVersion = new ts.Version(distTags["ts" + ts.versionMajorMinor] || distTags[_this.latestDistTag]);
+                                var newVersion = new ts.Version(distTags["ts".concat(ts.versionMajorMinor)] || distTags[_this.latestDistTag]);
                                 var newTyping = { typingLocation: typingFile, version: newVersion };
                                 _this.packageNameToTypingLocation.set(packageName, newTyping);
                                 installedTypingFiles.push(typingFile);
                             }
                             if (_this.log.isEnabled()) {
-                                _this.log.writeLine("Installed typing files " + JSON.stringify(installedTypingFiles));
+                                _this.log.writeLine("Installed typing files ".concat(JSON.stringify(installedTypingFiles)));
                             }
                             _this.sendResponse(_this.createSetTypings(req, currentlyCachedTypings.concat(installedTypingFiles)));
                         }
@@ -115219,7 +123105,7 @@ var ts;
                             return;
                         }
                         if (isLoggingEnabled) {
-                            _this.log.writeLine(projectWatcherType + ":: Added:: WatchInfo: " + path);
+                            _this.log.writeLine("".concat(projectWatcherType, ":: Added:: WatchInfo: ").concat(path));
                         }
                         var watcher = projectWatcherType === "FileWatcher" /* FileWatcher */ ?
                             _this.watchFactory.watchFile(path, function () {
@@ -115240,7 +123126,7 @@ var ts;
                             }, 1 /* Recursive */, options, projectName, watchers);
                         watchers.set(canonicalPath, isLoggingEnabled ? {
                             close: function () {
-                                _this.log.writeLine(projectWatcherType + ":: Closed:: WatchInfo: " + path);
+                                _this.log.writeLine("".concat(projectWatcherType, ":: Closed:: WatchInfo: ").concat(path));
                                 watcher.close();
                             }
                         } : watcher);
@@ -115315,7 +123201,7 @@ var ts;
             typingsInstaller.TypingsInstaller = TypingsInstaller;
             /* @internal */
             function typingsName(packageName) {
-                return "@types/" + packageName + "@ts" + ts.versionMajorMinor;
+                return "@types/".concat(packageName, "@ts").concat(ts.versionMajorMinor);
             }
             typingsInstaller.typingsName = typingsName;
         })(typingsInstaller = server.typingsInstaller || (server.typingsInstaller = {}));
@@ -115340,7 +123226,7 @@ var ts;
                         if (typeof _this.logFile !== "string")
                             return;
                         try {
-                            fs.appendFileSync(_this.logFile, "[" + server.nowString() + "] " + text + ts.sys.newLine);
+                            fs.appendFileSync(_this.logFile, "[".concat(server.nowString(), "] ").concat(text).concat(ts.sys.newLine));
                         }
                         catch (e) {
                             _this.logFile = undefined;
@@ -115356,7 +123242,7 @@ var ts;
                         return npmPath;
                     }
                     if (host.fileExists(npmPath)) {
-                        return "\"" + npmPath + "\"";
+                        return "\"".concat(npmPath, "\"");
                     }
                 }
                 return "npm";
@@ -115364,7 +123250,7 @@ var ts;
             function loadTypesRegistryFile(typesRegistryFilePath, host, log) {
                 if (!host.fileExists(typesRegistryFilePath)) {
                     if (log.isEnabled()) {
-                        log.writeLine("Types registry file '" + typesRegistryFilePath + "' does not exist");
+                        log.writeLine("Types registry file '".concat(typesRegistryFilePath, "' does not exist"));
                     }
                     return new ts.Map();
                 }
@@ -115374,14 +123260,14 @@ var ts;
                 }
                 catch (e) {
                     if (log.isEnabled()) {
-                        log.writeLine("Error when loading types registry file '" + typesRegistryFilePath + "': " + e.message + ", " + e.stack);
+                        log.writeLine("Error when loading types registry file '".concat(typesRegistryFilePath, "': ").concat(e.message, ", ").concat(e.stack));
                     }
                     return new ts.Map();
                 }
             }
             var typesRegistryPackageName = "types-registry";
             function getTypesRegistryFileLocation(globalTypingsCacheLocation) {
-                return ts.combinePaths(ts.normalizeSlashes(globalTypingsCacheLocation), "node_modules/" + typesRegistryPackageName + "/index.json");
+                return ts.combinePaths(ts.normalizeSlashes(globalTypingsCacheLocation), "node_modules/".concat(typesRegistryPackageName, "/index.json"));
             }
             var NodeTypingsInstaller = (function (_super) {
                 __extends(NodeTypingsInstaller, _super);
@@ -115389,27 +123275,27 @@ var ts;
                     var _this = _super.call(this, ts.sys, globalTypingsCacheLocation, typingSafeListLocation ? ts.toPath(typingSafeListLocation, "", ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)) : ts.toPath("typingSafeList.json", __dirname, ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)), typesMapLocation ? ts.toPath(typesMapLocation, "", ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)) : ts.toPath("typesMap.json", __dirname, ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)), throttleLimit, log) || this;
                     _this.npmPath = npmLocation !== undefined ? npmLocation : getDefaultNPMLocation(process.argv[0], validateDefaultNpmLocation, _this.installTypingHost);
                     if (ts.stringContains(_this.npmPath, " ") && _this.npmPath[0] !== "\"") {
-                        _this.npmPath = "\"" + _this.npmPath + "\"";
+                        _this.npmPath = "\"".concat(_this.npmPath, "\"");
                     }
                     if (_this.log.isEnabled()) {
-                        _this.log.writeLine("Process id: " + process.pid);
-                        _this.log.writeLine("NPM location: " + _this.npmPath + " (explicit '" + server.Arguments.NpmLocation + "' " + (npmLocation === undefined ? "not " : "") + " provided)");
-                        _this.log.writeLine("validateDefaultNpmLocation: " + validateDefaultNpmLocation);
+                        _this.log.writeLine("Process id: ".concat(process.pid));
+                        _this.log.writeLine("NPM location: ".concat(_this.npmPath, " (explicit '").concat(server.Arguments.NpmLocation, "' ").concat(npmLocation === undefined ? "not " : "", " provided)"));
+                        _this.log.writeLine("validateDefaultNpmLocation: ".concat(validateDefaultNpmLocation));
                     }
                     (_this.nodeExecSync = require("child_process").execSync);
                     _this.ensurePackageDirectoryExists(globalTypingsCacheLocation);
                     try {
                         if (_this.log.isEnabled()) {
-                            _this.log.writeLine("Updating " + typesRegistryPackageName + " npm package...");
+                            _this.log.writeLine("Updating ".concat(typesRegistryPackageName, " npm package..."));
                         }
-                        _this.execSyncAndLog(_this.npmPath + " install --ignore-scripts " + typesRegistryPackageName + "@" + _this.latestDistTag, { cwd: globalTypingsCacheLocation });
+                        _this.execSyncAndLog("".concat(_this.npmPath, " install --ignore-scripts ").concat(typesRegistryPackageName, "@").concat(_this.latestDistTag), { cwd: globalTypingsCacheLocation });
                         if (_this.log.isEnabled()) {
-                            _this.log.writeLine("Updated " + typesRegistryPackageName + " npm package");
+                            _this.log.writeLine("Updated ".concat(typesRegistryPackageName, " npm package"));
                         }
                     }
                     catch (e) {
                         if (_this.log.isEnabled()) {
-                            _this.log.writeLine("Error updating " + typesRegistryPackageName + " package: " + e.message);
+                            _this.log.writeLine("Error updating ".concat(typesRegistryPackageName, " package: ").concat(e.message));
                         }
                         _this.delayedInitializationError = {
                             kind: "event::initializationFailed",
@@ -115448,7 +123334,7 @@ var ts;
                                 var cwd = getDirectoryOfPackageJson(fileName, _this.installTypingHost) || projectRootPath;
                                 if (cwd) {
                                     _this.installWorker(-1, [packageName_1], cwd, function (success) {
-                                        var message = success ? "Package " + packageName_1 + " installed." : "There was an error installing " + packageName_1 + ".";
+                                        var message = success ? "Package ".concat(packageName_1, " installed.") : "There was an error installing ".concat(packageName_1, ".");
                                         var response = { kind: server.ActionPackageInstalled, projectName: projectName_1, success: success, message: message };
                                         _this.sendResponse(response);
                                     });
@@ -115466,7 +123352,7 @@ var ts;
                 };
                 NodeTypingsInstaller.prototype.sendResponse = function (response) {
                     if (this.log.isEnabled()) {
-                        this.log.writeLine("Sending response:\n    " + JSON.stringify(response));
+                        this.log.writeLine("Sending response:\n    ".concat(JSON.stringify(response)));
                     }
                     process.send(response);
                     if (this.log.isEnabled()) {
@@ -115476,29 +123362,29 @@ var ts;
                 NodeTypingsInstaller.prototype.installWorker = function (requestId, packageNames, cwd, onRequestCompleted) {
                     var _this = this;
                     if (this.log.isEnabled()) {
-                        this.log.writeLine("#" + requestId + " with arguments'" + JSON.stringify(packageNames) + "'.");
+                        this.log.writeLine("#".concat(requestId, " with arguments'").concat(JSON.stringify(packageNames), "'."));
                     }
                     var start = Date.now();
                     var hasError = typingsInstaller.installNpmPackages(this.npmPath, ts.version, packageNames, function (command) { return _this.execSyncAndLog(command, { cwd: cwd }); });
                     if (this.log.isEnabled()) {
-                        this.log.writeLine("npm install #" + requestId + " took: " + (Date.now() - start) + " ms");
+                        this.log.writeLine("npm install #".concat(requestId, " took: ").concat(Date.now() - start, " ms"));
                     }
                     onRequestCompleted(!hasError);
                 };
                 NodeTypingsInstaller.prototype.execSyncAndLog = function (command, options) {
                     if (this.log.isEnabled()) {
-                        this.log.writeLine("Exec: " + command);
+                        this.log.writeLine("Exec: ".concat(command));
                     }
                     try {
                         var stdout = this.nodeExecSync(command, __assign(__assign({}, options), { encoding: "utf-8" }));
                         if (this.log.isEnabled()) {
-                            this.log.writeLine("    Succeeded. stdout:" + indent(ts.sys.newLine, stdout));
+                            this.log.writeLine("    Succeeded. stdout:".concat(indent(ts.sys.newLine, stdout)));
                         }
                         return false;
                     }
                     catch (error) {
                         var stdout = error.stdout, stderr = error.stderr;
-                        this.log.writeLine("    Failed. stdout:" + indent(ts.sys.newLine, stdout) + ts.sys.newLine + "    stderr:" + indent(ts.sys.newLine, stderr));
+                        this.log.writeLine("    Failed. stdout:".concat(indent(ts.sys.newLine, stdout)).concat(ts.sys.newLine, "    stderr:").concat(indent(ts.sys.newLine, stderr)));
                         return true;
                     }
                 };
@@ -115521,7 +123407,7 @@ var ts;
             var log = new FileLog(logFilePath);
             if (log.isEnabled()) {
                 process.on("uncaughtException", function (e) {
-                    log.writeLine("Unhandled exception: " + e + " at " + e.stack);
+                    log.writeLine("Unhandled exception: ".concat(e, " at ").concat(e.stack));
                 });
             }
             process.on("disconnect", function () {
@@ -115534,7 +123420,7 @@ var ts;
             installer.listen();
             function indent(newline, str) {
                 return str && str.length
-                    ? newline + "    " + str.replace(/\r?\n/, newline + "    ")
+                    ? "".concat(newline, "    ") + str.replace(/\r?\n/, "".concat(newline, "    "))
                     : "";
             }
         })(typingsInstaller = server.typingsInstaller || (server.typingsInstaller = {}));