@typescript-deploys/pr-build 5.3.0-pr-54242-4 → 5.3.0-pr-55600-27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/tsc.js CHANGED
@@ -3312,12 +3312,9 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind4) => {
3312
3312
  SyntaxKind4[SyntaxKind4["DefaultClause"] = 297] = "DefaultClause";
3313
3313
  SyntaxKind4[SyntaxKind4["HeritageClause"] = 298] = "HeritageClause";
3314
3314
  SyntaxKind4[SyntaxKind4["CatchClause"] = 299] = "CatchClause";
3315
- SyntaxKind4[SyntaxKind4["ImportAttributes"] = 300] = "ImportAttributes";
3316
- SyntaxKind4[SyntaxKind4["ImportAttribute"] = 301] = "ImportAttribute";
3317
- SyntaxKind4[SyntaxKind4["ImportTypeAttributes"] = 302] = "ImportTypeAttributes";
3318
- SyntaxKind4[SyntaxKind4["AssertClause"] = 300 /* ImportAttributes */] = "AssertClause";
3319
- SyntaxKind4[SyntaxKind4["AssertEntry"] = 301 /* ImportAttribute */] = "AssertEntry";
3320
- SyntaxKind4[SyntaxKind4["ImportTypeAssertionContainer"] = 302 /* ImportTypeAttributes */] = "ImportTypeAssertionContainer";
3315
+ SyntaxKind4[SyntaxKind4["AssertClause"] = 300] = "AssertClause";
3316
+ SyntaxKind4[SyntaxKind4["AssertEntry"] = 301] = "AssertEntry";
3317
+ SyntaxKind4[SyntaxKind4["ImportTypeAssertionContainer"] = 302] = "ImportTypeAssertionContainer";
3321
3318
  SyntaxKind4[SyntaxKind4["PropertyAssignment"] = 303] = "PropertyAssignment";
3322
3319
  SyntaxKind4[SyntaxKind4["ShorthandPropertyAssignment"] = 304] = "ShorthandPropertyAssignment";
3323
3320
  SyntaxKind4[SyntaxKind4["SpreadAssignment"] = 305] = "SpreadAssignment";
@@ -3785,6 +3782,24 @@ var ScriptKind = /* @__PURE__ */ ((ScriptKind3) => {
3785
3782
  ScriptKind3[ScriptKind3["Deferred"] = 7] = "Deferred";
3786
3783
  return ScriptKind3;
3787
3784
  })(ScriptKind || {});
3785
+ var ScriptTarget = /* @__PURE__ */ ((ScriptTarget3) => {
3786
+ ScriptTarget3[ScriptTarget3["ES3"] = 0] = "ES3";
3787
+ ScriptTarget3[ScriptTarget3["ES5"] = 1] = "ES5";
3788
+ ScriptTarget3[ScriptTarget3["ES2015"] = 2] = "ES2015";
3789
+ ScriptTarget3[ScriptTarget3["ES2016"] = 3] = "ES2016";
3790
+ ScriptTarget3[ScriptTarget3["ES2017"] = 4] = "ES2017";
3791
+ ScriptTarget3[ScriptTarget3["ES2018"] = 5] = "ES2018";
3792
+ ScriptTarget3[ScriptTarget3["ES2019"] = 6] = "ES2019";
3793
+ ScriptTarget3[ScriptTarget3["ES2020"] = 7] = "ES2020";
3794
+ ScriptTarget3[ScriptTarget3["ES2021"] = 8] = "ES2021";
3795
+ ScriptTarget3[ScriptTarget3["ES2022"] = 9] = "ES2022";
3796
+ ScriptTarget3[ScriptTarget3["ES2023"] = 10] = "ES2023";
3797
+ ScriptTarget3[ScriptTarget3["ES2024"] = 11] = "ES2024";
3798
+ ScriptTarget3[ScriptTarget3["ESNext"] = 99] = "ESNext";
3799
+ ScriptTarget3[ScriptTarget3["JSON"] = 100] = "JSON";
3800
+ ScriptTarget3[ScriptTarget3["Latest"] = 99 /* ESNext */] = "Latest";
3801
+ return ScriptTarget3;
3802
+ })(ScriptTarget || {});
3788
3803
  var TransformFlags = /* @__PURE__ */ ((TransformFlags3) => {
3789
3804
  TransformFlags3[TransformFlags3["None"] = 0] = "None";
3790
3805
  TransformFlags3[TransformFlags3["ContainsTypeScript"] = 1] = "ContainsTypeScript";
@@ -5694,7 +5709,6 @@ var Diagnostics = {
5694
5709
  _0_expected: diag(1005, 1 /* Error */, "_0_expected_1005", "'{0}' expected."),
5695
5710
  A_file_cannot_have_a_reference_to_itself: diag(1006, 1 /* Error */, "A_file_cannot_have_a_reference_to_itself_1006", "A file cannot have a reference to itself."),
5696
5711
  The_parser_expected_to_find_a_1_to_match_the_0_token_here: diag(1007, 1 /* Error */, "The_parser_expected_to_find_a_1_to_match_the_0_token_here_1007", "The parser expected to find a '{1}' to match the '{0}' token here."),
5697
- The_assert_keyword_in_import_attributes_is_deprecated_and_has_been_replaced_by_the_with_keyword: diag(1008, 1 /* Error */, "The_assert_keyword_in_import_attributes_is_deprecated_and_has_been_replaced_by_the_with_keyword_1008", "The 'assert' keyword in import attributes is deprecated and has been replaced by the 'with' keyword."),
5698
5712
  Trailing_comma_not_allowed: diag(1009, 1 /* Error */, "Trailing_comma_not_allowed_1009", "Trailing comma not allowed."),
5699
5713
  Asterisk_Slash_expected: diag(1010, 1 /* Error */, "Asterisk_Slash_expected_1010", "'*/' expected."),
5700
5714
  An_element_access_expression_should_take_an_argument: diag(1011, 1 /* Error */, "An_element_access_expression_should_take_an_argument_1011", "An element access expression should take an argument."),
@@ -6058,7 +6072,7 @@ var Diagnostics = {
6058
6072
  _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, 1 /* 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."),
6059
6073
  _0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_enabled: diag(1448, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_1448", "'{0}' resolves to a type-only declaration and must be re-exported using a type-only re-export when '{1}' is enabled."),
6060
6074
  Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed: diag(1449, 3 /* 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."),
6061
- Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments: diag(1450, 3 /* Message */, "Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments_1450", "Dynamic imports can only accept a module specifier and an optional set of attributes as arguments"),
6075
+ Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments: diag(1450, 3 /* 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"),
6062
6076
  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, 1 /* 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"),
6063
6077
  resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext: diag(1452, 1 /* Error */, "resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext_1452", "'resolution-mode' assertions are only supported when `moduleResolution` is `node16` or `nodenext`."),
6064
6078
  resolution_mode_should_be_either_require_or_import: diag(1453, 1 /* Error */, "resolution_mode_should_be_either_require_or_import_1453", "`resolution-mode` should be either `require` or `import`."),
@@ -6070,9 +6084,6 @@ var Diagnostics = {
6070
6084
  File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module: diag(1459, 3 /* Message */, "File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module_1459", `File is CommonJS module because '{0}' has field "type" whose value is not "module"`),
6071
6085
  File_is_CommonJS_module_because_0_does_not_have_field_type: diag(1460, 3 /* Message */, "File_is_CommonJS_module_because_0_does_not_have_field_type_1460", `File is CommonJS module because '{0}' does not have field "type"`),
6072
6086
  File_is_CommonJS_module_because_package_json_was_not_found: diag(1461, 3 /* Message */, "File_is_CommonJS_module_because_package_json_was_not_found_1461", "File is CommonJS module because 'package.json' was not found"),
6073
- resolution_mode_attribute_are_only_supported_when_moduleResolution_is_node16_or_nodenext: diag(1462, 1 /* Error */, "resolution_mode_attribute_are_only_supported_when_moduleResolution_is_node16_or_nodenext_1462", "'resolution-mode' attribute are only supported when `moduleResolution` is `node16` or `nodenext`."),
6074
- resolution_mode_is_the_only_valid_key_for_type_import_attributes: diag(1463, 1 /* Error */, "resolution_mode_is_the_only_valid_key_for_type_import_attributes_1463", "`resolution-mode` is the only valid key for type import attributes."),
6075
- Type_import_attributes_should_have_exactly_one_key_resolution_mode_with_value_import_or_require: diag(1464, 1 /* Error */, "Type_import_attributes_should_have_exactly_one_key_resolution_mode_with_value_import_or_require_1464", "Type import attributes should have exactly one key - `resolution-mode` - with value `import` or `require`."),
6076
6087
  The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output: diag(1470, 1 /* 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."),
6077
6088
  Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_with_require_Use_an_ECMAScript_import_instead: diag(1471, 1 /* 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 with 'require'. Use an ECMAScript import instead."),
6078
6089
  catch_or_finally_expected: diag(1472, 1 /* Error */, "catch_or_finally_expected_1472", "'catch' or 'finally' expected."),
@@ -6099,7 +6110,43 @@ var Diagnostics = {
6099
6110
  The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration: diag(1493, 1 /* Error */, "The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration_1493", "The left-hand side of a 'for...in' statement cannot be a 'using' declaration."),
6100
6111
  The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration: diag(1494, 1 /* Error */, "The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration_1494", "The left-hand side of a 'for...in' statement cannot be an 'await using' declaration."),
6101
6112
  _0_modifier_cannot_appear_on_an_await_using_declaration: diag(1495, 1 /* Error */, "_0_modifier_cannot_appear_on_an_await_using_declaration_1495", "'{0}' modifier cannot appear on an 'await using' declaration."),
6102
- Identifier_string_literal_or_number_literal_expected: diag(1496, 1 /* Error */, "Identifier_string_literal_or_number_literal_expected_1496", "Identifier, string literal or number literal expected."),
6113
+ _0_is_not_a_valid_character_escape: diag(1496, 1 /* Error */, "_0_is_not_a_valid_character_escape_1496", "'\\{0}' is not a valid character escape."),
6114
+ Unknown_regular_expression_flag: diag(1497, 1 /* Error */, "Unknown_regular_expression_flag_1497", "Unknown regular expression flag."),
6115
+ Duplicate_regular_expression_flag: diag(1498, 1 /* Error */, "Duplicate_regular_expression_flag_1498", "Duplicate regular expression flag."),
6116
+ This_regular_expression_flag_is_only_available_when_targeting_0_or_later: diag(1499, 1 /* Error */, "This_regular_expression_flag_is_only_available_when_targeting_0_or_later_1499", "This regular expression flag is only available when targeting '{0}' or later."),
6117
+ The_Unicode_u_flag_and_the_Unicode_Sets_v_flag_cannot_be_set_simultaneously: diag(1500, 1 /* Error */, "The_Unicode_u_flag_and_the_Unicode_Sets_v_flag_cannot_be_set_simultaneously_1500", "The Unicode (u) flag and the Unicode Sets (v) flag cannot be set simultaneously."),
6118
+ Named_capturing_groups_are_only_available_when_targeting_ES2018_or_later: diag(1501, 1 /* Error */, "Named_capturing_groups_are_only_available_when_targeting_ES2018_or_later_1501", "Named capturing groups are only available when targeting 'ES2018' or later."),
6119
+ Subpattern_flags_must_be_present_when_there_is_a_minus_sign: diag(1502, 1 /* Error */, "Subpattern_flags_must_be_present_when_there_is_a_minus_sign_1502", "Subpattern flags must be present when there is a minus sign."),
6120
+ Incomplete_quantifier_Digit_expected: diag(1503, 1 /* Error */, "Incomplete_quantifier_Digit_expected_1503", "Incomplete quantifier. Digit expected."),
6121
+ Numbers_out_of_order_in_quantifier: diag(1504, 1 /* Error */, "Numbers_out_of_order_in_quantifier_1504", "Numbers out of order in quantifier."),
6122
+ There_is_nothing_available_for_repetition: diag(1505, 1 /* Error */, "There_is_nothing_available_for_repetition_1505", "There is nothing available for repetition."),
6123
+ Unexpected_0_Did_you_mean_to_escape_it_with_backslash: diag(1506, 1 /* Error */, "Unexpected_0_Did_you_mean_to_escape_it_with_backslash_1506", "Unexpected '{0}'. Did you mean to escape it with backslash?"),
6124
+ This_regular_expression_flag_cannot_be_toggled_within_a_subpattern: diag(1507, 1 /* Error */, "This_regular_expression_flag_cannot_be_toggled_within_a_subpattern_1507", "This regular expression flag cannot be toggled within a subpattern."),
6125
+ k_must_be_followed_by_a_capturing_group_name_enclosed_in_angle_brackets: diag(1508, 1 /* Error */, "k_must_be_followed_by_a_capturing_group_name_enclosed_in_angle_brackets_1508", "'\\k' must be followed by a capturing group name enclosed in angle brackets."),
6126
+ q_is_only_available_inside_character_class: diag(1509, 1 /* Error */, "q_is_only_available_inside_character_class_1509", "'\\q' is only available inside character class."),
6127
+ c_must_be_followed_by_an_ASCII_letter: diag(1510, 1 /* Error */, "c_must_be_followed_by_an_ASCII_letter_1510", "'\\c' must be followed by an ASCII letter."),
6128
+ Undetermined_character_escape: diag(1511, 1 /* Error */, "Undetermined_character_escape_1511", "Undetermined character escape."),
6129
+ Expected_a_capturing_group_name: diag(1512, 1 /* Error */, "Expected_a_capturing_group_name_1512", "Expected a capturing group name."),
6130
+ Named_capturing_groups_with_the_same_name_must_be_mutually_exclusive_to_each_other: diag(1513, 1 /* Error */, "Named_capturing_groups_with_the_same_name_must_be_mutually_exclusive_to_each_other_1513", "Named capturing groups with the same name must be mutually exclusive to each other."),
6131
+ A_character_class_range_must_not_be_bounded_by_another_character_class: diag(1514, 1 /* Error */, "A_character_class_range_must_not_be_bounded_by_another_character_class_1514", "A character class range must not be bounded by another character class."),
6132
+ Range_out_of_order_in_character_class: diag(1515, 1 /* Error */, "Range_out_of_order_in_character_class_1515", "Range out of order in character class."),
6133
+ Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class: diag(1516, 1 /* Error */, "Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_characte_1516", "Anything that would possibly match more than a single character is invalid inside a negated character class."),
6134
+ Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead: diag(1517, 1 /* Error */, "Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead_1517", "Operators must not be mixed within a character class. Wrap it in a nested class instead."),
6135
+ Expected_a_class_set_oprand: diag(1518, 1 /* Error */, "Expected_a_class_set_oprand_1518", "Expected a class set oprand."),
6136
+ q_must_be_followed_by_string_alternatives_enclosed_in_braces: diag(1519, 1 /* Error */, "q_must_be_followed_by_string_alternatives_enclosed_in_braces_1519", "'\\q' must be followed by string alternatives enclosed in braces."),
6137
+ A_character_class_must_not_contain_a_reserved_double_punctuator_Did_you_mean_to_escape_it_with_backslash: diag(1520, 1 /* Error */, "A_character_class_must_not_contain_a_reserved_double_punctuator_Did_you_mean_to_escape_it_with_backs_1520", "A character class must not contain a reserved double punctuator. Did you mean to escape it with backslash?"),
6138
+ Expected_a_Unicode_property_name: diag(1521, 1 /* Error */, "Expected_a_Unicode_property_name_1521", "Expected a Unicode property name."),
6139
+ Unknown_Unicode_property_name: diag(1522, 1 /* Error */, "Unknown_Unicode_property_name_1522", "Unknown Unicode property name."),
6140
+ Expected_a_Unicode_property_value: diag(1523, 1 /* Error */, "Expected_a_Unicode_property_value_1523", "Expected a Unicode property value."),
6141
+ Unknown_Unicode_property_value: diag(1524, 1 /* Error */, "Unknown_Unicode_property_value_1524", "Unknown Unicode property value."),
6142
+ Expected_a_Unicode_property_name_or_value: diag(1525, 1 /* Error */, "Expected_a_Unicode_property_name_or_value_1525", "Expected a Unicode property name or value."),
6143
+ Any_Unicode_property_that_would_possibly_match_more_than_a_single_character_is_only_available_when_the_Unicode_Sets_v_flag_is_set: diag(1526, 1 /* Error */, "Any_Unicode_property_that_would_possibly_match_more_than_a_single_character_is_only_available_when_t_1526", "Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set."),
6144
+ Unknown_Unicode_property_name_or_value: diag(1527, 1 /* Error */, "Unknown_Unicode_property_name_or_value_1527", "Unknown Unicode property name or value."),
6145
+ Unicode_property_value_expressions_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_set: diag(1528, 1 /* Error */, "Unicode_property_value_expressions_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v__1528", "Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set."),
6146
+ _0_must_be_followed_by_a_Unicode_property_value_expression_enclosed_in_braces: diag(1529, 1 /* Error */, "_0_must_be_followed_by_a_Unicode_property_value_expression_enclosed_in_braces_1529", "'\\{0}' must be followed by a Unicode property value expression enclosed in braces."),
6147
+ There_is_no_capturing_group_named_0_in_this_regular_expression: diag(1530, 1 /* Error */, "There_is_no_capturing_group_named_0_in_this_regular_expression_1530", "There is no capturing group named '{0}' in this regular expression."),
6148
+ A_decimal_escape_must_refer_to_an_existent_capturing_group_There_are_only_0_capturing_groups_in_this_regular_expression: diag(1531, 1 /* Error */, "A_decimal_escape_must_refer_to_an_existent_capturing_group_There_are_only_0_capturing_groups_in_this_1531", "A decimal escape must refer to an existent capturing group. There are only {0} capturing groups in this regular expression."),
6149
+ Decimal_escapes_are_invalid_when_there_are_no_capturing_groups_in_a_regular_expression: diag(1532, 1 /* Error */, "Decimal_escapes_are_invalid_when_there_are_no_capturing_groups_in_a_regular_expression_1532", "Decimal escapes are invalid when there are no capturing groups in a regular expression."),
6103
6150
  The_types_of_0_are_incompatible_between_these_types: diag(2200, 1 /* Error */, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."),
6104
6151
  The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, 1 /* Error */, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."),
6105
6152
  Call_signature_return_types_0_and_1_are_incompatible: diag(
@@ -6629,7 +6676,6 @@ var Diagnostics = {
6629
6676
  Type_0_is_not_assignable_to_type_1_Did_you_mean_2: diag(2820, 1 /* 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}'?"),
6630
6677
  Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext: diag(2821, 1 /* Error */, "Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext_2821", "Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'."),
6631
6678
  Import_assertions_cannot_be_used_with_type_only_imports_or_exports: diag(2822, 1 /* Error */, "Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822", "Import assertions cannot be used with type-only imports or exports."),
6632
- Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext: diag(2823, 1 /* Error */, "Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext_2823", "Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'."),
6633
6679
  Cannot_find_namespace_0_Did_you_mean_1: diag(2833, 1 /* Error */, "Cannot_find_namespace_0_Did_you_mean_1_2833", "Cannot find namespace '{0}'. Did you mean '{1}'?"),
6634
6680
  Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path: diag(2834, 1 /* 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 'node16' or 'nodenext'. Consider adding an extension to the import path."),
6635
6681
  Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0: diag(2835, 1 /* 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 'node16' or 'nodenext'. Did you mean '{0}'?"),
@@ -6638,6 +6684,7 @@ var Diagnostics = {
6638
6684
  All_declarations_of_0_must_have_identical_constraints: diag(2838, 1 /* Error */, "All_declarations_of_0_must_have_identical_constraints_2838", "All declarations of '{0}' must have identical constraints."),
6639
6685
  This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value: diag(2839, 1 /* Error */, "This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value_2839", "This condition will always return '{0}' since JavaScript compares objects by reference, not value."),
6640
6686
  An_interface_cannot_extend_a_primitive_type_like_0_an_interface_can_only_extend_named_types_and_classes: diag(2840, 1 /* Error */, "An_interface_cannot_extend_a_primitive_type_like_0_an_interface_can_only_extend_named_types_and_clas_2840", "An interface cannot extend a primitive type like '{0}'; an interface can only extend named types and classes"),
6687
+ The_type_of_this_expression_cannot_be_named_without_a_resolution_mode_assertion_which_is_an_unstable_feature_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(2841, 1 /* Error */, "The_type_of_this_expression_cannot_be_named_without_a_resolution_mode_assertion_which_is_an_unstable_2841", "The type of this expression cannot be named without a 'resolution-mode' assertion, which is an unstable feature. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),
6641
6688
  _0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation: diag(2842, 1 /* Error */, "_0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation_2842", "'{0}' is an unused renaming of '{1}'. Did you intend to use it as a type annotation?"),
6642
6689
  We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here: diag(2843, 1 /* Error */, "We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here_2843", "We can only write a type for '{0}' by adding a type for the entire parameter here."),
6643
6690
  Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2844, 1 /* Error */, "Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2844", "Type of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."),
@@ -6650,9 +6697,6 @@ var Diagnostics = {
6650
6697
  await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(2852, 1 /* Error */, "await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_2852", "'await using' statements are only allowed within async functions and at the top levels of modules."),
6651
6698
  await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(2853, 1 /* Error */, "await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_th_2853", "'await using' statements are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),
6652
6699
  Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher: diag(2854, 1 /* Error */, "Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_sys_2854", "Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),
6653
- Import_attributes_are_not_allowed_on_statements_that_transpile_to_CommonJS_require_calls: diag(2855, 1 /* Error */, "Import_attributes_are_not_allowed_on_statements_that_transpile_to_CommonJS_require_calls_2855", "Import attributes are not allowed on statements that transpile to CommonJS 'require' calls."),
6654
- Import_attributes_cannot_be_used_with_type_only_imports_or_exports: diag(2856, 1 /* Error */, "Import_attributes_cannot_be_used_with_type_only_imports_or_exports_2856", "Import attributes cannot be used with type-only imports or exports."),
6655
- Import_attribute_values_must_be_string_literal_expressions: diag(2857, 1 /* Error */, "Import_attribute_values_must_be_string_literal_expressions_2857", "Import attribute values must be string literal expressions."),
6656
6700
  Import_declaration_0_is_using_private_name_1: diag(4e3, 1 /* Error */, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
6657
6701
  Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1 /* 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}'."),
6658
6702
  Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1 /* 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}'."),
@@ -6761,6 +6805,7 @@ var Diagnostics = {
6761
6805
  This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0: diag(4122, 1 /* 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}'."),
6762
6806
  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, 1 /* 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}'?"),
6763
6807
  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, 1 /* 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'."),
6808
+ resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(4125, 1 /* Error */, "resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_wi_4125", "'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),
6764
6809
  The_current_host_does_not_support_the_0_option: diag(5001, 1 /* Error */, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."),
6765
6810
  Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, 1 /* Error */, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."),
6766
6811
  File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, 1 /* 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}'."),
@@ -7699,7 +7744,7 @@ var Diagnostics = {
7699
7744
  Could_not_convert_to_arrow_function: diag(95151, 3 /* Message */, "Could_not_convert_to_arrow_function_95151", "Could not convert to arrow function"),
7700
7745
  Could_not_convert_to_named_function: diag(95152, 3 /* Message */, "Could_not_convert_to_named_function_95152", "Could not convert to named function"),
7701
7746
  Could_not_convert_to_anonymous_function: diag(95153, 3 /* Message */, "Could_not_convert_to_anonymous_function_95153", "Could not convert to anonymous function"),
7702
- Can_only_convert_string_concatenations_and_string_literals: diag(95154, 3 /* Message */, "Can_only_convert_string_concatenations_and_string_literals_95154", "Can only convert string concatenations and string literals"),
7747
+ Can_only_convert_string_concatenation: diag(95154, 3 /* Message */, "Can_only_convert_string_concatenation_95154", "Can only convert string concatenation"),
7703
7748
  Selection_is_not_a_valid_statement_or_statements: diag(95155, 3 /* Message */, "Selection_is_not_a_valid_statement_or_statements_95155", "Selection is not a valid statement or statements"),
7704
7749
  Add_missing_function_declaration_0: diag(95156, 3 /* Message */, "Add_missing_function_declaration_0_95156", "Add missing function declaration '{0}'"),
7705
7750
  Add_all_missing_function_declarations: diag(95157, 3 /* Message */, "Add_all_missing_function_declarations_95157", "Add all missing function declarations"),
@@ -7935,6 +7980,26 @@ var textToToken = new Map(Object.entries({
7935
7980
  "#": 63 /* HashToken */,
7936
7981
  "`": 62 /* BacktickToken */
7937
7982
  }));
7983
+ var charToRegExpFlag = new Map(Object.entries({
7984
+ d: 1 /* HasIndices */,
7985
+ g: 2 /* Global */,
7986
+ i: 4 /* IgnoreCase */,
7987
+ m: 8 /* Multiline */,
7988
+ s: 16 /* DotAll */,
7989
+ u: 32 /* Unicode */,
7990
+ v: 64 /* UnicodeSets */,
7991
+ y: 128 /* Sticky */
7992
+ }));
7993
+ var regExpFlagToFirstAvailableLanguageVersion = /* @__PURE__ */ new Map([
7994
+ [1 /* HasIndices */, 9 /* ES2022 */],
7995
+ [2 /* Global */, 0 /* ES3 */],
7996
+ [4 /* IgnoreCase */, 0 /* ES3 */],
7997
+ [8 /* Multiline */, 0 /* ES3 */],
7998
+ [16 /* DotAll */, 5 /* ES2018 */],
7999
+ [32 /* Unicode */, 2 /* ES2015 */],
8000
+ [64 /* UnicodeSets */, 11 /* ES2024 */],
8001
+ [128 /* Sticky */, 2 /* ES2015 */]
8002
+ ]);
7938
8003
  var unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 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, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 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, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500];
7939
8004
  var unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 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, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 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, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500];
7940
8005
  var unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6e3, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43e3, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500];
@@ -7943,7 +8008,7 @@ var unicodeESNextIdentifierStart = [65, 90, 97, 122, 170, 170, 181, 181, 186, 18
7943
8008
  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, 6e3, 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];
7944
8009
  var commentDirectiveRegExSingleLine = /^\/\/\/?\s*@(ts-expect-error|ts-ignore)/;
7945
8010
  var commentDirectiveRegExMultiLine = /^(?:\/|\*)*\s*@(ts-expect-error|ts-ignore)/;
7946
- var jsDocSeeOrLink = /@(?:see|link)/i;
8011
+ var semanticJSDocTagRegEx = /@(?:see|link)/i;
7947
8012
  function lookupInUnicodeMap(code, map2) {
7948
8013
  if (code < map2[0]) {
7949
8014
  return false;
@@ -7985,6 +8050,13 @@ function tokenToString(t) {
7985
8050
  function stringToToken(s) {
7986
8051
  return textToToken.get(s);
7987
8052
  }
8053
+ var regExpFlagChars = makeReverseMap(charToRegExpFlag);
8054
+ function characterToRegularExpressionFlag(c) {
8055
+ return charToRegExpFlag.get(c);
8056
+ }
8057
+ function regularExpressionFlagToFirstAvailableLanguageVersion(f) {
8058
+ return regExpFlagToFirstAvailableLanguageVersion.get(f);
8059
+ }
7988
8060
  function computeLineStarts(text) {
7989
8061
  const result = [];
7990
8062
  let pos = 0;
@@ -8081,8 +8153,11 @@ function isDigit(ch) {
8081
8153
  function isHexDigit(ch) {
8082
8154
  return isDigit(ch) || ch >= 65 /* A */ && ch <= 70 /* F */ || ch >= 97 /* a */ && ch <= 102 /* f */;
8083
8155
  }
8084
- function isCodePoint(code) {
8085
- return code <= 1114111;
8156
+ function isASCIILetter(ch) {
8157
+ return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */;
8158
+ }
8159
+ function isWordCharacter(ch) {
8160
+ return isASCIILetter(ch) || isDigit(ch) || ch === 95 /* _ */;
8086
8161
  }
8087
8162
  function isOctalDigit(ch) {
8088
8163
  return ch >= 48 /* _0 */ && ch <= 55 /* _7 */;
@@ -8400,10 +8475,10 @@ function getShebang(text) {
8400
8475
  }
8401
8476
  }
8402
8477
  function isIdentifierStart(ch, languageVersion) {
8403
- return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierStart(ch, languageVersion);
8478
+ return isASCIILetter(ch) || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierStart(ch, languageVersion);
8404
8479
  }
8405
8480
  function isIdentifierPart(ch, languageVersion, identifierVariant) {
8406
- return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch >= 48 /* _0 */ && ch <= 57 /* _9 */ || ch === 36 /* $ */ || ch === 95 /* _ */ || // "-" and ":" are valid in JSX Identifiers
8481
+ return isWordCharacter(ch) || ch === 36 /* $ */ || // "-" and ":" are valid in JSX Identifiers
8407
8482
  (identifierVariant === 1 /* JSX */ ? ch === 45 /* minus */ || ch === 58 /* colon */ : false) || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion);
8408
8483
  }
8409
8484
  function isIdentifierText(name, languageVersion, identifierVariant) {
@@ -8429,8 +8504,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
8429
8504
  var tokenFlags;
8430
8505
  var commentDirectives;
8431
8506
  var inJSDocType = 0;
8432
- var scriptKind = 0 /* Unknown */;
8433
- var jsDocParsingMode = 0 /* ParseAll */;
8507
+ var skipNonSemanticJSDoc = false;
8434
8508
  setText(text, start, length2);
8435
8509
  var scanner = {
8436
8510
  getTokenFullStart: () => fullStartPos,
@@ -8474,15 +8548,14 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
8474
8548
  setText,
8475
8549
  setScriptTarget,
8476
8550
  setLanguageVariant,
8477
- setScriptKind,
8478
- setJSDocParsingMode,
8479
8551
  setOnError,
8480
8552
  resetTokenState,
8481
8553
  setTextPos: resetTokenState,
8482
8554
  setInJSDocType,
8483
8555
  tryScan,
8484
8556
  lookAhead,
8485
- scanRange
8557
+ scanRange,
8558
+ setSkipNonSemanticJSDoc
8486
8559
  };
8487
8560
  if (Debug.isDebugging) {
8488
8561
  Object.defineProperty(scanner, "__debugShowCurrentPositionInText", {
@@ -8724,7 +8797,9 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
8724
8797
  result += text.substring(start2, pos);
8725
8798
  result += scanEscapeSequence(
8726
8799
  /*shouldEmitInvalidEscapeError*/
8727
- true
8800
+ true,
8801
+ /*isRegularExpression*/
8802
+ false
8728
8803
  );
8729
8804
  start2 = pos;
8730
8805
  continue;
@@ -8768,7 +8843,11 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
8768
8843
  }
8769
8844
  if (currChar === 92 /* backslash */) {
8770
8845
  contents += text.substring(start2, pos);
8771
- contents += scanEscapeSequence(shouldEmitInvalidEscapeError);
8846
+ contents += scanEscapeSequence(
8847
+ shouldEmitInvalidEscapeError,
8848
+ /*isRegularExpression*/
8849
+ false
8850
+ );
8772
8851
  start2 = pos;
8773
8852
  continue;
8774
8853
  }
@@ -8788,7 +8867,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
8788
8867
  tokenValue = contents;
8789
8868
  return resultingToken;
8790
8869
  }
8791
- function scanEscapeSequence(shouldEmitInvalidEscapeError) {
8870
+ function scanEscapeSequence(shouldEmitInvalidEscapeError, isRegularExpression) {
8792
8871
  const start2 = pos;
8793
8872
  pos++;
8794
8873
  if (pos >= end) {
@@ -8816,7 +8895,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
8816
8895
  pos++;
8817
8896
  }
8818
8897
  tokenFlags |= 2048 /* ContainsInvalidEscape */;
8819
- if (shouldEmitInvalidEscapeError) {
8898
+ if (isRegularExpression || shouldEmitInvalidEscapeError) {
8820
8899
  const code = parseInt(text.substring(start2 + 1, pos), 8);
8821
8900
  error(Diagnostics.Octal_escape_sequences_are_not_allowed_Use_the_syntax_0, start2, pos - start2, "\\x" + code.toString(16).padStart(2, "0"));
8822
8901
  return String.fromCharCode(code);
@@ -8825,7 +8904,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
8825
8904
  case 56 /* _8 */:
8826
8905
  case 57 /* _9 */:
8827
8906
  tokenFlags |= 2048 /* ContainsInvalidEscape */;
8828
- if (shouldEmitInvalidEscapeError) {
8907
+ if (isRegularExpression || shouldEmitInvalidEscapeError) {
8829
8908
  error(Diagnostics.Escape_sequence_0_is_not_allowed, start2, pos - start2, text.substring(start2, pos));
8830
8909
  return String.fromCharCode(ch);
8831
8910
  }
@@ -8847,62 +8926,42 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
8847
8926
  case 34 /* doubleQuote */:
8848
8927
  return '"';
8849
8928
  case 117 /* u */:
8850
- if (pos < end && text.charCodeAt(pos) === 123 /* openBrace */) {
8851
- pos++;
8852
- const escapedValueString = scanMinimumNumberOfHexDigits(
8853
- 1,
8854
- /*canHaveSeparators*/
8855
- false
8856
- );
8857
- const escapedValue = escapedValueString ? parseInt(escapedValueString, 16) : -1;
8858
- if (escapedValue < 0) {
8859
- tokenFlags |= 2048 /* ContainsInvalidEscape */;
8860
- if (shouldEmitInvalidEscapeError) {
8861
- error(Diagnostics.Hexadecimal_digit_expected);
8862
- }
8863
- return text.substring(start2, pos);
8864
- }
8865
- if (!isCodePoint(escapedValue)) {
8866
- tokenFlags |= 2048 /* ContainsInvalidEscape */;
8867
- if (shouldEmitInvalidEscapeError) {
8868
- error(Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive);
8869
- }
8870
- return text.substring(start2, pos);
8871
- }
8872
- if (pos >= end) {
8873
- tokenFlags |= 2048 /* ContainsInvalidEscape */;
8874
- if (shouldEmitInvalidEscapeError) {
8875
- error(Diagnostics.Unexpected_end_of_text);
8876
- }
8877
- return text.substring(start2, pos);
8878
- }
8879
- if (text.charCodeAt(pos) !== 125 /* closeBrace */) {
8880
- tokenFlags |= 2048 /* ContainsInvalidEscape */;
8881
- if (shouldEmitInvalidEscapeError) {
8882
- error(Diagnostics.Unterminated_Unicode_escape_sequence);
8883
- }
8884
- return text.substring(start2, pos);
8885
- }
8886
- pos++;
8887
- tokenFlags |= 8 /* ExtendedUnicodeEscape */;
8888
- return utf16EncodeAsString(escapedValue);
8929
+ if ((!isRegularExpression || shouldEmitInvalidEscapeError) && pos < end && text.charCodeAt(pos) === 123 /* openBrace */) {
8930
+ pos -= 2;
8931
+ return scanExtendedUnicodeEscape(isRegularExpression || shouldEmitInvalidEscapeError);
8889
8932
  }
8890
8933
  for (; pos < start2 + 6; pos++) {
8891
8934
  if (!(pos < end && isHexDigit(text.charCodeAt(pos)))) {
8892
8935
  tokenFlags |= 2048 /* ContainsInvalidEscape */;
8893
- if (shouldEmitInvalidEscapeError) {
8936
+ if (isRegularExpression || shouldEmitInvalidEscapeError) {
8894
8937
  error(Diagnostics.Hexadecimal_digit_expected);
8895
8938
  }
8896
8939
  return text.substring(start2, pos);
8897
8940
  }
8898
8941
  }
8899
8942
  tokenFlags |= 1024 /* UnicodeEscape */;
8900
- return String.fromCharCode(parseInt(text.substring(start2 + 2, pos), 16));
8943
+ const escapedValue = parseInt(text.substring(start2 + 2, pos), 16);
8944
+ const escapedValueString = String.fromCharCode(escapedValue);
8945
+ if (isRegularExpression && shouldEmitInvalidEscapeError && escapedValue >= 55296 && escapedValue <= 56319 && pos + 6 < end && text.substring(pos, pos + 2) === "\\u" && text.charCodeAt(pos + 2) !== 123 /* openBrace */) {
8946
+ const nextStart = pos;
8947
+ let nextPos = pos + 2;
8948
+ for (; nextPos < nextStart + 6; nextPos++) {
8949
+ if (!isHexDigit(text.charCodeAt(pos))) {
8950
+ return escapedValueString;
8951
+ }
8952
+ }
8953
+ const nextEscapedValue = parseInt(text.substring(nextStart + 2, nextPos), 16);
8954
+ if (nextEscapedValue >= 56320 && nextEscapedValue <= 57343) {
8955
+ pos = nextPos;
8956
+ return escapedValueString + String.fromCharCode(nextEscapedValue);
8957
+ }
8958
+ }
8959
+ return escapedValueString;
8901
8960
  case 120 /* x */:
8902
8961
  for (; pos < start2 + 4; pos++) {
8903
8962
  if (!(pos < end && isHexDigit(text.charCodeAt(pos)))) {
8904
8963
  tokenFlags |= 2048 /* ContainsInvalidEscape */;
8905
- if (shouldEmitInvalidEscapeError) {
8964
+ if (isRegularExpression || shouldEmitInvalidEscapeError) {
8906
8965
  error(Diagnostics.Hexadecimal_digit_expected);
8907
8966
  }
8908
8967
  return text.substring(start2, pos);
@@ -8919,10 +8978,16 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
8919
8978
  case 8233 /* paragraphSeparator */:
8920
8979
  return "";
8921
8980
  default:
8981
+ if (isRegularExpression && (shouldEmitInvalidEscapeError || isIdentifierPart(ch, languageVersion))) {
8982
+ error(Diagnostics._0_is_not_a_valid_character_escape, pos - 2, 2, String.fromCharCode(ch));
8983
+ }
8922
8984
  return String.fromCharCode(ch);
8923
8985
  }
8924
8986
  }
8925
- function scanExtendedUnicodeEscape() {
8987
+ function scanExtendedUnicodeEscape(shouldEmitInvalidEscapeError = true) {
8988
+ const start2 = pos;
8989
+ pos += 3;
8990
+ const escapedStart = pos;
8926
8991
  const escapedValueString = scanMinimumNumberOfHexDigits(
8927
8992
  1,
8928
8993
  /*canHaveSeparators*/
@@ -8931,24 +8996,34 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
8931
8996
  const escapedValue = escapedValueString ? parseInt(escapedValueString, 16) : -1;
8932
8997
  let isInvalidExtendedEscape = false;
8933
8998
  if (escapedValue < 0) {
8934
- error(Diagnostics.Hexadecimal_digit_expected);
8999
+ if (shouldEmitInvalidEscapeError) {
9000
+ error(Diagnostics.Hexadecimal_digit_expected);
9001
+ }
8935
9002
  isInvalidExtendedEscape = true;
8936
9003
  } else if (escapedValue > 1114111) {
8937
- error(Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive);
9004
+ if (shouldEmitInvalidEscapeError) {
9005
+ error(Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive, escapedStart, pos - escapedStart);
9006
+ }
8938
9007
  isInvalidExtendedEscape = true;
8939
9008
  }
8940
9009
  if (pos >= end) {
8941
- error(Diagnostics.Unexpected_end_of_text);
9010
+ if (shouldEmitInvalidEscapeError) {
9011
+ error(Diagnostics.Unexpected_end_of_text);
9012
+ }
8942
9013
  isInvalidExtendedEscape = true;
8943
9014
  } else if (text.charCodeAt(pos) === 125 /* closeBrace */) {
8944
9015
  pos++;
8945
9016
  } else {
8946
- error(Diagnostics.Unterminated_Unicode_escape_sequence);
9017
+ if (shouldEmitInvalidEscapeError) {
9018
+ error(Diagnostics.Unterminated_Unicode_escape_sequence);
9019
+ }
8947
9020
  isInvalidExtendedEscape = true;
8948
9021
  }
8949
9022
  if (isInvalidExtendedEscape) {
8950
- return "";
9023
+ tokenFlags |= 2048 /* ContainsInvalidEscape */;
9024
+ return text.substring(start2, pos);
8951
9025
  }
9026
+ tokenFlags |= 8 /* ExtendedUnicodeEscape */;
8952
9027
  return utf16EncodeAsString(escapedValue);
8953
9028
  }
8954
9029
  function peekUnicodeEscape() {
@@ -8990,8 +9065,6 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
8990
9065
  } else if (ch === 92 /* backslash */) {
8991
9066
  ch = peekExtendedUnicodeEscape();
8992
9067
  if (ch >= 0 && isIdentifierPart(ch, languageVersion)) {
8993
- pos += 3;
8994
- tokenFlags |= 8 /* ExtendedUnicodeEscape */;
8995
9068
  result += scanExtendedUnicodeEscape();
8996
9069
  start2 = pos;
8997
9070
  continue;
@@ -9270,7 +9343,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
9270
9343
  tokenFlags |= 1 /* PrecedingLineBreak */;
9271
9344
  }
9272
9345
  }
9273
- if (isJSDoc2 && shouldParseJSDoc()) {
9346
+ if (isJSDoc2 && (!skipNonSemanticJSDoc || semanticJSDocTagRegEx.test(text.slice(fullStartPos, pos)))) {
9274
9347
  tokenFlags |= 2 /* PrecedingJSDocComment */;
9275
9348
  }
9276
9349
  commentDirectives = appendIfCommentDirective(commentDirectives, text.slice(lastLineStart, pos), commentDirectiveRegExMultiLine, lastLineStart);
@@ -9462,8 +9535,6 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
9462
9535
  case 92 /* backslash */:
9463
9536
  const extendedCookedChar = peekExtendedUnicodeEscape();
9464
9537
  if (extendedCookedChar >= 0 && isIdentifierStart(extendedCookedChar, languageVersion)) {
9465
- pos += 3;
9466
- tokenFlags |= 8 /* ExtendedUnicodeEscape */;
9467
9538
  tokenValue = scanExtendedUnicodeEscape() + scanIdentifierParts();
9468
9539
  return token = getIdentifierToken();
9469
9540
  }
@@ -9479,7 +9550,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
9479
9550
  return token = 0 /* Unknown */;
9480
9551
  case 35 /* hash */:
9481
9552
  if (pos !== 0 && text[pos + 1] === "!") {
9482
- error(Diagnostics.can_only_be_used_at_the_start_of_a_file);
9553
+ error(Diagnostics.can_only_be_used_at_the_start_of_a_file, pos, 2);
9483
9554
  pos++;
9484
9555
  return token = 0 /* Unknown */;
9485
9556
  }
@@ -9488,8 +9559,6 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
9488
9559
  pos++;
9489
9560
  const extendedCookedChar2 = peekExtendedUnicodeEscape();
9490
9561
  if (extendedCookedChar2 >= 0 && isIdentifierStart(extendedCookedChar2, languageVersion)) {
9491
- pos += 3;
9492
- tokenFlags |= 8 /* ExtendedUnicodeEscape */;
9493
9562
  tokenValue = "#" + scanExtendedUnicodeEscape() + scanIdentifierParts();
9494
9563
  return token = 81 /* PrivateIdentifier */;
9495
9564
  }
@@ -9529,21 +9598,6 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
9529
9598
  }
9530
9599
  }
9531
9600
  }
9532
- function shouldParseJSDoc() {
9533
- switch (jsDocParsingMode) {
9534
- case 0 /* ParseAll */:
9535
- return true;
9536
- case 1 /* ParseNone */:
9537
- return false;
9538
- }
9539
- if (scriptKind !== 3 /* TS */ && scriptKind !== 4 /* TSX */) {
9540
- return true;
9541
- }
9542
- if (jsDocParsingMode === 3 /* ParseForTypeInfo */) {
9543
- return false;
9544
- }
9545
- return jsDocSeeOrLink.test(text.slice(fullStartPos, pos));
9546
- }
9547
9601
  function reScanInvalidIdentifier() {
9548
9602
  Debug.assert(token === 0 /* Unknown */, "'reScanInvalidIdentifier' should only be called when the current token is 'SyntaxKind.Unknown'.");
9549
9603
  pos = tokenStart = fullStartPos;
@@ -9627,14 +9681,841 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
9627
9681
  }
9628
9682
  p++;
9629
9683
  }
9630
- while (p < end && isIdentifierPart(text.charCodeAt(p), languageVersion)) {
9684
+ const isUnterminated = !!(tokenFlags & 4 /* Unterminated */);
9685
+ const endOfBody = p - (isUnterminated ? 0 : 1);
9686
+ let regExpFlags = 0 /* None */;
9687
+ while (p < end) {
9688
+ const ch = text.charCodeAt(p);
9689
+ if (!isIdentifierPart(ch, languageVersion)) {
9690
+ break;
9691
+ }
9692
+ const flag = characterToRegularExpressionFlag(String.fromCharCode(ch));
9693
+ if (flag === void 0) {
9694
+ error(Diagnostics.Unknown_regular_expression_flag, p, 1);
9695
+ } else if (regExpFlags & flag) {
9696
+ error(Diagnostics.Duplicate_regular_expression_flag, p, 1);
9697
+ } else if (((regExpFlags | flag) & 96 /* UnicodeMode */) === 96 /* UnicodeMode */) {
9698
+ error(Diagnostics.The_Unicode_u_flag_and_the_Unicode_Sets_v_flag_cannot_be_set_simultaneously, p, 1);
9699
+ } else {
9700
+ regExpFlags |= flag;
9701
+ const availableFrom = regularExpressionFlagToFirstAvailableLanguageVersion(flag);
9702
+ if (languageVersion < availableFrom) {
9703
+ error(Diagnostics.This_regular_expression_flag_is_only_available_when_targeting_0_or_later, p, 1, ScriptTarget[availableFrom]);
9704
+ }
9705
+ }
9631
9706
  p++;
9632
9707
  }
9633
- pos = p;
9708
+ pos = tokenStart + 1;
9709
+ const saveTokenPos = tokenStart;
9710
+ const saveTokenFlags = tokenFlags;
9711
+ scanRegularExpressionWorker(text.slice(0, endOfBody), endOfBody, regExpFlags, isUnterminated);
9712
+ if (!isUnterminated) {
9713
+ pos = p;
9714
+ }
9715
+ tokenStart = saveTokenPos;
9716
+ tokenFlags = saveTokenFlags;
9634
9717
  tokenValue = text.substring(tokenStart, pos);
9635
9718
  token = 14 /* RegularExpressionLiteral */;
9636
9719
  }
9637
9720
  return token;
9721
+ function scanRegularExpressionWorker(text2, end2, regExpFlags, isUnterminated) {
9722
+ const unicodeMode = !!(regExpFlags & 96 /* UnicodeMode */);
9723
+ const unicodeSetsMode = !!(regExpFlags & 64 /* UnicodeSets */);
9724
+ let mayContainStrings = false;
9725
+ let numberOfCapturingGroups = 0;
9726
+ const groupSpecifiers = /* @__PURE__ */ new Set();
9727
+ const groupNameReferences = [];
9728
+ const decimalEscapes = [];
9729
+ const namedCapturingGroups = [];
9730
+ function scanDisjunction(isInGroup) {
9731
+ while (true) {
9732
+ namedCapturingGroups.push(/* @__PURE__ */ new Set());
9733
+ scanAlternative(isInGroup);
9734
+ namedCapturingGroups.pop();
9735
+ if (text2.charCodeAt(pos) !== 124 /* bar */) {
9736
+ return;
9737
+ }
9738
+ pos++;
9739
+ }
9740
+ }
9741
+ function scanAlternative(isInGroup) {
9742
+ let isPreviousTermQuantifiable = false;
9743
+ while (pos < end2) {
9744
+ const start2 = pos;
9745
+ const ch = text2.charCodeAt(pos);
9746
+ switch (ch) {
9747
+ case 94 /* caret */:
9748
+ case 36 /* $ */:
9749
+ pos++;
9750
+ isPreviousTermQuantifiable = false;
9751
+ break;
9752
+ case 92 /* backslash */:
9753
+ pos++;
9754
+ switch (text2.charCodeAt(pos)) {
9755
+ case 98 /* b */:
9756
+ case 66 /* B */:
9757
+ pos++;
9758
+ isPreviousTermQuantifiable = false;
9759
+ break;
9760
+ default:
9761
+ scanAtomEscape();
9762
+ isPreviousTermQuantifiable = true;
9763
+ break;
9764
+ }
9765
+ break;
9766
+ case 40 /* openParen */:
9767
+ pos++;
9768
+ if (text2.charCodeAt(pos) === 63 /* question */) {
9769
+ pos++;
9770
+ switch (text2.charCodeAt(pos)) {
9771
+ case 61 /* equals */:
9772
+ case 33 /* exclamation */:
9773
+ pos++;
9774
+ isPreviousTermQuantifiable = false;
9775
+ break;
9776
+ case 60 /* lessThan */:
9777
+ const groupNameStart = pos;
9778
+ pos++;
9779
+ switch (text2.charCodeAt(pos)) {
9780
+ case 61 /* equals */:
9781
+ case 33 /* exclamation */:
9782
+ pos++;
9783
+ isPreviousTermQuantifiable = false;
9784
+ break;
9785
+ default:
9786
+ scanGroupName(
9787
+ /*isReference*/
9788
+ false
9789
+ );
9790
+ scanExpectedChar(62 /* greaterThan */);
9791
+ if (languageVersion < 5 /* ES2018 */) {
9792
+ error(Diagnostics.Named_capturing_groups_are_only_available_when_targeting_ES2018_or_later, groupNameStart, pos - groupNameStart);
9793
+ }
9794
+ numberOfCapturingGroups++;
9795
+ isPreviousTermQuantifiable = true;
9796
+ break;
9797
+ }
9798
+ break;
9799
+ default:
9800
+ const start3 = pos;
9801
+ const setFlags = scanPatternModifiers();
9802
+ if (text2.charCodeAt(pos) === 45 /* minus */) {
9803
+ pos++;
9804
+ scanPatternModifiers(setFlags);
9805
+ if (pos === start3 + 1) {
9806
+ error(Diagnostics.Subpattern_flags_must_be_present_when_there_is_a_minus_sign, start3, pos - start3);
9807
+ }
9808
+ }
9809
+ scanExpectedChar(58 /* colon */);
9810
+ isPreviousTermQuantifiable = true;
9811
+ break;
9812
+ }
9813
+ } else {
9814
+ numberOfCapturingGroups++;
9815
+ isPreviousTermQuantifiable = true;
9816
+ }
9817
+ scanDisjunction(
9818
+ /*isInGroup*/
9819
+ true
9820
+ );
9821
+ scanExpectedChar(41 /* closeParen */);
9822
+ break;
9823
+ case 123 /* openBrace */:
9824
+ pos++;
9825
+ const digitsStart = pos;
9826
+ scanDigits();
9827
+ const min2 = tokenValue;
9828
+ if (text2.charCodeAt(pos) === 44 /* comma */) {
9829
+ pos++;
9830
+ scanDigits();
9831
+ const max = tokenValue;
9832
+ if (!min2) {
9833
+ if (max || text2.charCodeAt(pos) === 125 /* closeBrace */) {
9834
+ error(Diagnostics.Incomplete_quantifier_Digit_expected, digitsStart, 0);
9835
+ } else {
9836
+ if (unicodeMode) {
9837
+ error(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, start2, 1, String.fromCharCode(ch));
9838
+ }
9839
+ isPreviousTermQuantifiable = true;
9840
+ break;
9841
+ }
9842
+ }
9843
+ if (max && Number.parseInt(min2) > Number.parseInt(max)) {
9844
+ error(Diagnostics.Numbers_out_of_order_in_quantifier, digitsStart, pos - digitsStart);
9845
+ }
9846
+ } else if (!min2) {
9847
+ if (unicodeMode) {
9848
+ error(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, start2, 1, String.fromCharCode(ch));
9849
+ }
9850
+ isPreviousTermQuantifiable = true;
9851
+ break;
9852
+ }
9853
+ scanExpectedChar(125 /* closeBrace */);
9854
+ pos--;
9855
+ case 42 /* asterisk */:
9856
+ case 43 /* plus */:
9857
+ case 63 /* question */:
9858
+ pos++;
9859
+ if (text2.charCodeAt(pos) === 63 /* question */) {
9860
+ pos++;
9861
+ }
9862
+ if (!isPreviousTermQuantifiable) {
9863
+ error(Diagnostics.There_is_nothing_available_for_repetition, start2, pos - start2);
9864
+ }
9865
+ isPreviousTermQuantifiable = false;
9866
+ break;
9867
+ case 46 /* dot */:
9868
+ pos++;
9869
+ isPreviousTermQuantifiable = true;
9870
+ break;
9871
+ case 91 /* openBracket */:
9872
+ pos++;
9873
+ if (unicodeSetsMode) {
9874
+ scanClassSetExpression();
9875
+ } else {
9876
+ scanClassRanges();
9877
+ }
9878
+ scanExpectedChar(93 /* closeBracket */);
9879
+ isPreviousTermQuantifiable = true;
9880
+ break;
9881
+ case 41 /* closeParen */:
9882
+ if (isInGroup) {
9883
+ return;
9884
+ }
9885
+ case 93 /* closeBracket */:
9886
+ case 125 /* closeBrace */:
9887
+ if (isUnterminated && !isInGroup) {
9888
+ return;
9889
+ }
9890
+ if (unicodeMode) {
9891
+ error(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch));
9892
+ }
9893
+ pos++;
9894
+ isPreviousTermQuantifiable = true;
9895
+ break;
9896
+ case 47 /* slash */:
9897
+ case 124 /* bar */:
9898
+ return;
9899
+ default:
9900
+ scanSourceCharacter();
9901
+ isPreviousTermQuantifiable = true;
9902
+ break;
9903
+ }
9904
+ }
9905
+ }
9906
+ function scanPatternModifiers(currFlags = 0 /* None */) {
9907
+ while (pos < end2) {
9908
+ const ch = text2.charCodeAt(pos);
9909
+ if (!isIdentifierPart(ch, languageVersion)) {
9910
+ break;
9911
+ }
9912
+ const flag = characterToRegularExpressionFlag(String.fromCharCode(ch));
9913
+ if (flag === void 0) {
9914
+ error(Diagnostics.Unknown_regular_expression_flag, pos, 1);
9915
+ } else if (currFlags & flag) {
9916
+ error(Diagnostics.Duplicate_regular_expression_flag, pos, 1);
9917
+ } else if (!(flag & 28 /* Modifiers */)) {
9918
+ error(Diagnostics.This_regular_expression_flag_cannot_be_toggled_within_a_subpattern, pos, 1);
9919
+ } else {
9920
+ currFlags |= flag;
9921
+ const availableFrom = regularExpressionFlagToFirstAvailableLanguageVersion(flag);
9922
+ if (languageVersion < availableFrom) {
9923
+ error(Diagnostics.This_regular_expression_flag_is_only_available_when_targeting_0_or_later, pos, 1, ScriptTarget[availableFrom]);
9924
+ }
9925
+ }
9926
+ pos++;
9927
+ }
9928
+ return currFlags;
9929
+ }
9930
+ function scanAtomEscape() {
9931
+ Debug.assertEqual(text2.charCodeAt(pos - 1), 92 /* backslash */);
9932
+ switch (text2.charCodeAt(pos)) {
9933
+ case 107 /* k */:
9934
+ pos++;
9935
+ if (text2.charCodeAt(pos) === 60 /* lessThan */) {
9936
+ pos++;
9937
+ scanGroupName(
9938
+ /*isReference*/
9939
+ true
9940
+ );
9941
+ scanExpectedChar(62 /* greaterThan */);
9942
+ } else if (unicodeMode) {
9943
+ error(Diagnostics.k_must_be_followed_by_a_capturing_group_name_enclosed_in_angle_brackets, pos - 2, 2);
9944
+ }
9945
+ break;
9946
+ case 113 /* q */:
9947
+ if (unicodeSetsMode) {
9948
+ pos++;
9949
+ error(Diagnostics.q_is_only_available_inside_character_class, pos - 2, 2);
9950
+ break;
9951
+ }
9952
+ default:
9953
+ scanCharacterClassEscape() || scanDecimalEscape() || scanCharacterEscape();
9954
+ break;
9955
+ }
9956
+ }
9957
+ function scanDecimalEscape() {
9958
+ Debug.assertEqual(text2.charCodeAt(pos - 1), 92 /* backslash */);
9959
+ const ch = text2.charCodeAt(pos);
9960
+ if (ch >= 49 /* _1 */ && ch <= 57 /* _9 */) {
9961
+ const start2 = pos;
9962
+ scanDigits();
9963
+ decimalEscapes.push({ pos: start2, end: pos, value: +tokenValue });
9964
+ return true;
9965
+ }
9966
+ return false;
9967
+ }
9968
+ function scanCharacterEscape() {
9969
+ Debug.assertEqual(text2.charCodeAt(pos - 1), 92 /* backslash */);
9970
+ let ch = text2.charCodeAt(pos);
9971
+ switch (ch) {
9972
+ case 99 /* c */:
9973
+ pos++;
9974
+ ch = text2.charCodeAt(pos);
9975
+ if (isASCIILetter(ch)) {
9976
+ pos++;
9977
+ return String.fromCharCode(ch & 31);
9978
+ }
9979
+ if (unicodeMode) {
9980
+ error(Diagnostics.c_must_be_followed_by_an_ASCII_letter, pos - 2, 2);
9981
+ }
9982
+ return String.fromCharCode(ch);
9983
+ case 94 /* caret */:
9984
+ case 36 /* $ */:
9985
+ case 47 /* slash */:
9986
+ case 92 /* backslash */:
9987
+ case 46 /* dot */:
9988
+ case 42 /* asterisk */:
9989
+ case 43 /* plus */:
9990
+ case 63 /* question */:
9991
+ case 40 /* openParen */:
9992
+ case 41 /* closeParen */:
9993
+ case 91 /* openBracket */:
9994
+ case 93 /* closeBracket */:
9995
+ case 123 /* openBrace */:
9996
+ case 125 /* closeBrace */:
9997
+ case 124 /* bar */:
9998
+ pos++;
9999
+ return String.fromCharCode(ch);
10000
+ default:
10001
+ if (pos >= end2) {
10002
+ error(Diagnostics.Undetermined_character_escape, pos - 1, 1, ch);
10003
+ return "\\";
10004
+ }
10005
+ pos--;
10006
+ return scanEscapeSequence(
10007
+ /*shouldEmitInvalidEscapeError*/
10008
+ unicodeMode,
10009
+ /*isRegularExpression*/
10010
+ true
10011
+ );
10012
+ }
10013
+ }
10014
+ function scanGroupName(isReference) {
10015
+ Debug.assertEqual(text2.charCodeAt(pos - 1), 60 /* lessThan */);
10016
+ tokenStart = pos;
10017
+ scanIdentifier(codePointAt(text2, pos), languageVersion);
10018
+ if (pos === tokenStart) {
10019
+ error(Diagnostics.Expected_a_capturing_group_name);
10020
+ } else if (isReference) {
10021
+ groupNameReferences.push({ pos: tokenStart, end: pos, name: tokenValue });
10022
+ } else if (namedCapturingGroups.some((group2) => group2.has(tokenValue))) {
10023
+ error(Diagnostics.Named_capturing_groups_with_the_same_name_must_be_mutually_exclusive_to_each_other, tokenStart, pos - tokenStart);
10024
+ } else {
10025
+ last(namedCapturingGroups).add(tokenValue);
10026
+ groupSpecifiers.add(tokenValue);
10027
+ }
10028
+ }
10029
+ function isClassContentExit(ch) {
10030
+ return ch === 93 /* closeBracket */ || pos >= end2;
10031
+ }
10032
+ function scanClassRanges() {
10033
+ Debug.assertEqual(text2.charCodeAt(pos - 1), 91 /* openBracket */);
10034
+ if (text2.charCodeAt(pos) === 94 /* caret */) {
10035
+ pos++;
10036
+ }
10037
+ while (pos < end2) {
10038
+ const ch = text2.charCodeAt(pos);
10039
+ if (isClassContentExit(ch)) {
10040
+ return;
10041
+ }
10042
+ const minStart = pos;
10043
+ const minCharacter = scanClassAtom();
10044
+ if (text2.charCodeAt(pos) === 45 /* minus */) {
10045
+ pos++;
10046
+ const ch2 = text2.charCodeAt(pos);
10047
+ if (isClassContentExit(ch2)) {
10048
+ return;
10049
+ }
10050
+ if (!minCharacter) {
10051
+ error(Diagnostics.A_character_class_range_must_not_be_bounded_by_another_character_class, minStart, pos - 1 - minStart);
10052
+ }
10053
+ const maxStart = pos;
10054
+ const maxCharacter = scanClassAtom();
10055
+ if (!maxCharacter) {
10056
+ error(Diagnostics.A_character_class_range_must_not_be_bounded_by_another_character_class, maxStart, pos - maxStart);
10057
+ continue;
10058
+ }
10059
+ if (!minCharacter) {
10060
+ continue;
10061
+ }
10062
+ const minCharacterValue = codePointAt(minCharacter, 0);
10063
+ const maxCharacterValue = codePointAt(maxCharacter, 0);
10064
+ if (minCharacter.length === charSize(minCharacterValue) && maxCharacter.length === charSize(maxCharacterValue) && minCharacterValue > maxCharacterValue) {
10065
+ error(Diagnostics.Range_out_of_order_in_character_class, minStart, pos - minStart);
10066
+ }
10067
+ }
10068
+ }
10069
+ }
10070
+ function scanClassSetExpression() {
10071
+ Debug.assertEqual(text2.charCodeAt(pos - 1), 91 /* openBracket */);
10072
+ let isCharacterComplement = false;
10073
+ if (text2.charCodeAt(pos) === 94 /* caret */) {
10074
+ pos++;
10075
+ isCharacterComplement = true;
10076
+ }
10077
+ let expressionMayContainStrings = false;
10078
+ let ch = text2.charCodeAt(pos);
10079
+ if (isClassContentExit(ch)) {
10080
+ return;
10081
+ }
10082
+ let start2 = pos;
10083
+ let oprand;
10084
+ switch (text2.slice(pos, pos + 2)) {
10085
+ case "--":
10086
+ case "&&":
10087
+ error(Diagnostics.Expected_a_class_set_oprand);
10088
+ mayContainStrings = false;
10089
+ break;
10090
+ default:
10091
+ oprand = scanClassSetOprand();
10092
+ break;
10093
+ }
10094
+ switch (text2.charCodeAt(pos)) {
10095
+ case 45 /* minus */:
10096
+ if (text2.charCodeAt(pos + 1) === 45 /* minus */) {
10097
+ if (isCharacterComplement && mayContainStrings) {
10098
+ error(Diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, start2, pos - start2);
10099
+ }
10100
+ expressionMayContainStrings = mayContainStrings;
10101
+ scanClassSetSubExpression(3 /* ClassSubtraction */);
10102
+ mayContainStrings = !isCharacterComplement && expressionMayContainStrings;
10103
+ return;
10104
+ }
10105
+ break;
10106
+ case 38 /* ampersand */:
10107
+ if (text2.charCodeAt(pos + 1) === 38 /* ampersand */) {
10108
+ scanClassSetSubExpression(2 /* ClassIntersection */);
10109
+ if (isCharacterComplement && mayContainStrings) {
10110
+ error(Diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, start2, pos - start2);
10111
+ }
10112
+ expressionMayContainStrings = mayContainStrings;
10113
+ mayContainStrings = !isCharacterComplement && expressionMayContainStrings;
10114
+ return;
10115
+ } else {
10116
+ error(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch));
10117
+ }
10118
+ break;
10119
+ default:
10120
+ if (isCharacterComplement && mayContainStrings) {
10121
+ error(Diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, start2, pos - start2);
10122
+ }
10123
+ expressionMayContainStrings = mayContainStrings;
10124
+ break;
10125
+ }
10126
+ while (pos < end2) {
10127
+ ch = text2.charCodeAt(pos);
10128
+ switch (ch) {
10129
+ case 45 /* minus */:
10130
+ pos++;
10131
+ ch = text2.charCodeAt(pos);
10132
+ if (isClassContentExit(ch)) {
10133
+ mayContainStrings = !isCharacterComplement && expressionMayContainStrings;
10134
+ return;
10135
+ }
10136
+ if (ch === 45 /* minus */) {
10137
+ pos++;
10138
+ error(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 2, 2);
10139
+ start2 = pos - 2;
10140
+ oprand = text2.slice(start2, pos);
10141
+ continue;
10142
+ } else {
10143
+ if (!oprand) {
10144
+ error(Diagnostics.A_character_class_range_must_not_be_bounded_by_another_character_class, start2, pos - 1 - start2);
10145
+ }
10146
+ const secondStart = pos;
10147
+ const secondOprand = scanClassSetOprand();
10148
+ if (isCharacterComplement && mayContainStrings) {
10149
+ error(Diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, secondStart, pos - secondStart);
10150
+ }
10151
+ expressionMayContainStrings || (expressionMayContainStrings = mayContainStrings);
10152
+ if (!secondOprand) {
10153
+ error(Diagnostics.A_character_class_range_must_not_be_bounded_by_another_character_class, secondStart, pos - secondStart);
10154
+ break;
10155
+ }
10156
+ if (!oprand) {
10157
+ break;
10158
+ }
10159
+ const minCharacterValue = codePointAt(oprand, 0);
10160
+ const maxCharacterValue = codePointAt(secondOprand, 0);
10161
+ if (oprand.length === charSize(minCharacterValue) && secondOprand.length === charSize(maxCharacterValue) && minCharacterValue > maxCharacterValue) {
10162
+ error(Diagnostics.Range_out_of_order_in_character_class, start2, pos - start2);
10163
+ }
10164
+ }
10165
+ break;
10166
+ case 38 /* ampersand */:
10167
+ start2 = pos;
10168
+ pos++;
10169
+ if (text2.charCodeAt(pos) === 38 /* ampersand */) {
10170
+ pos++;
10171
+ error(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 2, 2);
10172
+ if (text2.charCodeAt(pos) === 38 /* ampersand */) {
10173
+ error(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch));
10174
+ pos++;
10175
+ }
10176
+ } else {
10177
+ error(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos - 1, 1, String.fromCharCode(ch));
10178
+ }
10179
+ oprand = text2.slice(start2, pos);
10180
+ continue;
10181
+ }
10182
+ if (isClassContentExit(text2.charCodeAt(pos))) {
10183
+ break;
10184
+ }
10185
+ start2 = pos;
10186
+ switch (text2.slice(pos, pos + 2)) {
10187
+ case "--":
10188
+ case "&&":
10189
+ error(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos, 2);
10190
+ pos += 2;
10191
+ oprand = text2.slice(start2, pos);
10192
+ break;
10193
+ default:
10194
+ oprand = scanClassSetOprand();
10195
+ break;
10196
+ }
10197
+ }
10198
+ mayContainStrings = !isCharacterComplement && expressionMayContainStrings;
10199
+ }
10200
+ function scanClassSetSubExpression(expressionType) {
10201
+ let expressionMayContainStrings = mayContainStrings;
10202
+ while (pos < end2) {
10203
+ let ch = text2.charCodeAt(pos);
10204
+ if (isClassContentExit(ch)) {
10205
+ break;
10206
+ }
10207
+ switch (ch) {
10208
+ case 45 /* minus */:
10209
+ pos++;
10210
+ if (text2.charCodeAt(pos) === 45 /* minus */) {
10211
+ pos++;
10212
+ if (expressionType !== 3 /* ClassSubtraction */) {
10213
+ error(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 2, 2);
10214
+ }
10215
+ } else {
10216
+ error(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 1, 1);
10217
+ }
10218
+ break;
10219
+ case 38 /* ampersand */:
10220
+ pos++;
10221
+ if (text2.charCodeAt(pos) === 38 /* ampersand */) {
10222
+ pos++;
10223
+ if (expressionType !== 2 /* ClassIntersection */) {
10224
+ error(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 2, 2);
10225
+ }
10226
+ if (text2.charCodeAt(pos) === 38 /* ampersand */) {
10227
+ error(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch));
10228
+ pos++;
10229
+ }
10230
+ } else {
10231
+ error(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos - 1, 1, String.fromCharCode(ch));
10232
+ }
10233
+ break;
10234
+ default:
10235
+ switch (expressionType) {
10236
+ case 3 /* ClassSubtraction */:
10237
+ error(Diagnostics._0_expected, pos, 0, "--");
10238
+ break;
10239
+ case 2 /* ClassIntersection */:
10240
+ error(Diagnostics._0_expected, pos, 0, "&&");
10241
+ break;
10242
+ default:
10243
+ break;
10244
+ }
10245
+ break;
10246
+ }
10247
+ ch = text2.charCodeAt(pos);
10248
+ if (isClassContentExit(ch)) {
10249
+ error(Diagnostics.Expected_a_class_set_oprand);
10250
+ break;
10251
+ }
10252
+ scanClassSetOprand();
10253
+ expressionMayContainStrings && (expressionMayContainStrings = mayContainStrings);
10254
+ }
10255
+ mayContainStrings = expressionMayContainStrings;
10256
+ }
10257
+ function scanClassSetOprand() {
10258
+ mayContainStrings = false;
10259
+ switch (text2.charCodeAt(pos)) {
10260
+ case 91 /* openBracket */:
10261
+ pos++;
10262
+ scanClassSetExpression();
10263
+ scanExpectedChar(93 /* closeBracket */);
10264
+ return "";
10265
+ case 92 /* backslash */:
10266
+ pos++;
10267
+ if (scanCharacterClassEscape()) {
10268
+ return "";
10269
+ } else if (text2.charCodeAt(pos) === 113 /* q */) {
10270
+ pos++;
10271
+ if (text2.charCodeAt(pos) === 123 /* openBrace */) {
10272
+ pos++;
10273
+ scanClassStringDisjunctionContents();
10274
+ scanExpectedChar(125 /* closeBrace */);
10275
+ return "";
10276
+ } else {
10277
+ error(Diagnostics.q_must_be_followed_by_string_alternatives_enclosed_in_braces, pos - 2, 2);
10278
+ return "q";
10279
+ }
10280
+ }
10281
+ pos--;
10282
+ default:
10283
+ return scanClassSetCharacter();
10284
+ }
10285
+ }
10286
+ function scanClassStringDisjunctionContents() {
10287
+ Debug.assertEqual(text2.charCodeAt(pos - 1), 123 /* openBrace */);
10288
+ let characterCount = 0;
10289
+ while (pos < end2) {
10290
+ const ch = text2.charCodeAt(pos);
10291
+ switch (ch) {
10292
+ case 125 /* closeBrace */:
10293
+ if (characterCount !== 1) {
10294
+ mayContainStrings = true;
10295
+ }
10296
+ return;
10297
+ case 124 /* bar */:
10298
+ if (characterCount !== 1) {
10299
+ mayContainStrings = true;
10300
+ }
10301
+ pos++;
10302
+ start = pos;
10303
+ characterCount = 0;
10304
+ break;
10305
+ default:
10306
+ scanClassSetCharacter();
10307
+ characterCount++;
10308
+ break;
10309
+ }
10310
+ }
10311
+ }
10312
+ function scanClassSetCharacter() {
10313
+ const ch = text2.charCodeAt(pos);
10314
+ if (ch === 92 /* backslash */) {
10315
+ pos++;
10316
+ const ch2 = text2.charCodeAt(pos);
10317
+ switch (ch2) {
10318
+ case 98 /* b */:
10319
+ pos++;
10320
+ return "\b";
10321
+ case 38 /* ampersand */:
10322
+ case 45 /* minus */:
10323
+ case 33 /* exclamation */:
10324
+ case 35 /* hash */:
10325
+ case 37 /* percent */:
10326
+ case 44 /* comma */:
10327
+ case 58 /* colon */:
10328
+ case 59 /* semicolon */:
10329
+ case 60 /* lessThan */:
10330
+ case 61 /* equals */:
10331
+ case 62 /* greaterThan */:
10332
+ case 64 /* at */:
10333
+ case 96 /* backtick */:
10334
+ case 126 /* tilde */:
10335
+ pos++;
10336
+ return String.fromCharCode(ch2);
10337
+ default:
10338
+ return scanCharacterEscape();
10339
+ }
10340
+ } else if (ch === text2.charCodeAt(pos + 1)) {
10341
+ switch (ch) {
10342
+ case 38 /* ampersand */:
10343
+ case 33 /* exclamation */:
10344
+ case 35 /* hash */:
10345
+ case 37 /* percent */:
10346
+ case 42 /* asterisk */:
10347
+ case 43 /* plus */:
10348
+ case 44 /* comma */:
10349
+ case 46 /* dot */:
10350
+ case 58 /* colon */:
10351
+ case 59 /* semicolon */:
10352
+ case 60 /* lessThan */:
10353
+ case 61 /* equals */:
10354
+ case 62 /* greaterThan */:
10355
+ case 63 /* question */:
10356
+ case 64 /* at */:
10357
+ case 96 /* backtick */:
10358
+ case 126 /* tilde */:
10359
+ error(Diagnostics.A_character_class_must_not_contain_a_reserved_double_punctuator_Did_you_mean_to_escape_it_with_backslash, pos, 2);
10360
+ pos += 2;
10361
+ return text2.substring(pos - 2, pos);
10362
+ }
10363
+ }
10364
+ switch (ch) {
10365
+ case 47 /* slash */:
10366
+ case 40 /* openParen */:
10367
+ case 41 /* closeParen */:
10368
+ case 91 /* openBracket */:
10369
+ case 93 /* closeBracket */:
10370
+ case 123 /* openBrace */:
10371
+ case 125 /* closeBrace */:
10372
+ case 45 /* minus */:
10373
+ case 124 /* bar */:
10374
+ error(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch));
10375
+ pos++;
10376
+ return String.fromCharCode(ch);
10377
+ }
10378
+ return scanSourceCharacter();
10379
+ }
10380
+ function scanClassAtom() {
10381
+ if (text2.charCodeAt(pos) === 92 /* backslash */) {
10382
+ pos++;
10383
+ const ch = text2.charCodeAt(pos);
10384
+ switch (ch) {
10385
+ case 98 /* b */:
10386
+ pos++;
10387
+ return "\b";
10388
+ case 45 /* minus */:
10389
+ pos++;
10390
+ return String.fromCharCode(ch);
10391
+ default:
10392
+ if (scanCharacterClassEscape()) {
10393
+ return "";
10394
+ }
10395
+ return scanCharacterEscape();
10396
+ }
10397
+ } else {
10398
+ return scanSourceCharacter();
10399
+ }
10400
+ }
10401
+ function scanCharacterClassEscape() {
10402
+ Debug.assertEqual(text2.charCodeAt(pos - 1), 92 /* backslash */);
10403
+ let isCharacterComplement = false;
10404
+ const start2 = pos - 1;
10405
+ const ch = text2.charCodeAt(pos);
10406
+ switch (ch) {
10407
+ case 100 /* d */:
10408
+ case 68 /* D */:
10409
+ case 115 /* s */:
10410
+ case 83 /* S */:
10411
+ case 119 /* w */:
10412
+ case 87 /* W */:
10413
+ pos++;
10414
+ return true;
10415
+ case 80 /* P */:
10416
+ isCharacterComplement = true;
10417
+ case 112 /* p */:
10418
+ pos++;
10419
+ if (text2.charCodeAt(pos) === 123 /* openBrace */) {
10420
+ pos++;
10421
+ const propertyNameOrValueStart = pos;
10422
+ const propertyNameOrValue = scanWordCharacters();
10423
+ if (text2.charCodeAt(pos) === 61 /* equals */) {
10424
+ const propertyName = nonBinaryUnicodeProperties.get(propertyNameOrValue);
10425
+ if (pos === propertyNameOrValueStart) {
10426
+ error(Diagnostics.Expected_a_Unicode_property_name);
10427
+ } else if (propertyName === void 0) {
10428
+ error(Diagnostics.Unknown_Unicode_property_name, propertyNameOrValueStart, pos - propertyNameOrValueStart);
10429
+ const suggestion = getSpellingSuggestion(propertyNameOrValue, nonBinaryUnicodeProperties.keys(), identity);
10430
+ if (suggestion) {
10431
+ error(Diagnostics.Did_you_mean_0, propertyNameOrValueStart, pos - propertyNameOrValueStart, suggestion);
10432
+ }
10433
+ }
10434
+ pos++;
10435
+ const propertyValueStart = pos;
10436
+ const propertyValue = scanWordCharacters();
10437
+ if (pos === propertyValueStart) {
10438
+ error(Diagnostics.Expected_a_Unicode_property_value);
10439
+ } else if (propertyName !== void 0 && !valuesOfNonBinaryUnicodeProperties[propertyName].has(propertyValue)) {
10440
+ error(Diagnostics.Unknown_Unicode_property_value, propertyValueStart, pos - propertyValueStart);
10441
+ const suggestion = getSpellingSuggestion(propertyValue, valuesOfNonBinaryUnicodeProperties[propertyName], identity);
10442
+ if (suggestion) {
10443
+ error(Diagnostics.Did_you_mean_0, propertyValueStart, pos - propertyValueStart, suggestion);
10444
+ }
10445
+ }
10446
+ } else {
10447
+ if (pos === propertyNameOrValueStart) {
10448
+ error(Diagnostics.Expected_a_Unicode_property_name_or_value);
10449
+ } else if (binaryUnicodePropertiesOfStrings.has(propertyNameOrValue)) {
10450
+ if (!unicodeSetsMode) {
10451
+ error(Diagnostics.Any_Unicode_property_that_would_possibly_match_more_than_a_single_character_is_only_available_when_the_Unicode_Sets_v_flag_is_set, propertyNameOrValueStart, pos - propertyNameOrValueStart);
10452
+ } else if (isCharacterComplement) {
10453
+ error(Diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, propertyNameOrValueStart, pos - propertyNameOrValueStart);
10454
+ } else {
10455
+ mayContainStrings = true;
10456
+ }
10457
+ } else if (!valuesOfNonBinaryUnicodeProperties.General_Category.has(propertyNameOrValue) && !binaryUnicodeProperties.has(propertyNameOrValue)) {
10458
+ error(Diagnostics.Unknown_Unicode_property_name_or_value, propertyNameOrValueStart, pos - propertyNameOrValueStart);
10459
+ const suggestion = getSpellingSuggestion(propertyNameOrValue, [...valuesOfNonBinaryUnicodeProperties.General_Category, ...binaryUnicodeProperties, ...binaryUnicodePropertiesOfStrings], identity);
10460
+ if (suggestion) {
10461
+ error(Diagnostics.Did_you_mean_0, propertyNameOrValueStart, pos - propertyNameOrValueStart, suggestion);
10462
+ }
10463
+ }
10464
+ }
10465
+ scanExpectedChar(125 /* closeBrace */);
10466
+ if (!unicodeMode) {
10467
+ error(Diagnostics.Unicode_property_value_expressions_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_set, start2, pos - start2);
10468
+ }
10469
+ } else if (unicodeMode) {
10470
+ error(Diagnostics._0_must_be_followed_by_a_Unicode_property_value_expression_enclosed_in_braces, pos - 2, 2, String.fromCharCode(ch));
10471
+ }
10472
+ return true;
10473
+ }
10474
+ return false;
10475
+ }
10476
+ function scanWordCharacters() {
10477
+ let value = "";
10478
+ while (pos < end2) {
10479
+ const ch = text2.charCodeAt(pos);
10480
+ if (!isWordCharacter(ch)) {
10481
+ break;
10482
+ }
10483
+ value += String.fromCharCode(ch);
10484
+ pos++;
10485
+ }
10486
+ return value;
10487
+ }
10488
+ function scanSourceCharacter() {
10489
+ const size = unicodeMode ? charSize(codePointAt(text2, pos)) : 1;
10490
+ pos += size;
10491
+ return text2.substring(pos - size, pos);
10492
+ }
10493
+ function scanExpectedChar(ch) {
10494
+ if (text2.charCodeAt(pos) === ch) {
10495
+ pos++;
10496
+ } else {
10497
+ error(Diagnostics._0_expected, pos, 0, String.fromCharCode(ch));
10498
+ }
10499
+ }
10500
+ scanDisjunction(
10501
+ /*isInGroup*/
10502
+ false
10503
+ );
10504
+ forEach(groupNameReferences, (reference) => {
10505
+ if (!groupSpecifiers.has(reference.name)) {
10506
+ error(Diagnostics.There_is_no_capturing_group_named_0_in_this_regular_expression, reference.pos, reference.end - reference.pos, reference.name);
10507
+ }
10508
+ });
10509
+ forEach(decimalEscapes, (escape) => {
10510
+ if (escape.value > numberOfCapturingGroups) {
10511
+ if (numberOfCapturingGroups) {
10512
+ error(Diagnostics.A_decimal_escape_must_refer_to_an_existent_capturing_group_There_are_only_0_capturing_groups_in_this_regular_expression, escape.pos, escape.end - escape.pos, numberOfCapturingGroups);
10513
+ } else {
10514
+ error(Diagnostics.Decimal_escapes_are_invalid_when_there_are_no_capturing_groups_in_a_regular_expression, escape.pos, escape.end - escape.pos);
10515
+ }
10516
+ }
10517
+ });
10518
+ }
9638
10519
  }
9639
10520
  function appendIfCommentDirective(commentDirectives2, text2, commentDirectiveRegEx, lineStart) {
9640
10521
  const type = getDirectiveFromComment(text2.trimStart(), commentDirectiveRegEx);
@@ -9857,8 +10738,6 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
9857
10738
  pos--;
9858
10739
  const extendedCookedChar = peekExtendedUnicodeEscape();
9859
10740
  if (extendedCookedChar >= 0 && isIdentifierStart(extendedCookedChar, languageVersion)) {
9860
- pos += 3;
9861
- tokenFlags |= 8 /* ExtendedUnicodeEscape */;
9862
10741
  tokenValue = scanExtendedUnicodeEscape() + scanIdentifierParts();
9863
10742
  return token = getIdentifierToken();
9864
10743
  }
@@ -9958,11 +10837,8 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
9958
10837
  function setLanguageVariant(variant) {
9959
10838
  languageVariant = variant;
9960
10839
  }
9961
- function setScriptKind(kind) {
9962
- scriptKind = kind;
9963
- }
9964
- function setJSDocParsingMode(kind) {
9965
- jsDocParsingMode = kind;
10840
+ function setSkipNonSemanticJSDoc(skip) {
10841
+ skipNonSemanticJSDoc = skip;
9966
10842
  }
9967
10843
  function resetTokenState(position) {
9968
10844
  Debug.assert(position >= 0);
@@ -9999,6 +10875,22 @@ var utf16EncodeAsStringWorker = String.fromCodePoint ? (codePoint) => String.fro
9999
10875
  function utf16EncodeAsString(codePoint) {
10000
10876
  return utf16EncodeAsStringWorker(codePoint);
10001
10877
  }
10878
+ var nonBinaryUnicodeProperties = new Map(Object.entries({
10879
+ General_Category: "General_Category",
10880
+ gc: "General_Category",
10881
+ Script: "Script",
10882
+ sc: "Script",
10883
+ Script_Extensions: "Script_Extensions",
10884
+ scx: "Script_Extensions"
10885
+ }));
10886
+ var binaryUnicodeProperties = /* @__PURE__ */ new Set(["ASCII", "ASCII_Hex_Digit", "AHex", "Alphabetic", "Alpha", "Any", "Assigned", "Bidi_Control", "Bidi_C", "Bidi_Mirrored", "Bidi_M", "Case_Ignorable", "CI", "Cased", "Changes_When_Casefolded", "CWCF", "Changes_When_Casemapped", "CWCM", "Changes_When_Lowercased", "CWL", "Changes_When_NFKC_Casefolded", "CWKCF", "Changes_When_Titlecased", "CWT", "Changes_When_Uppercased", "CWU", "Dash", "Default_Ignorable_Code_Point", "DI", "Deprecated", "Dep", "Diacritic", "Dia", "Emoji", "Emoji_Component", "EComp", "Emoji_Modifier", "EMod", "Emoji_Modifier_Base", "EBase", "Emoji_Presentation", "EPres", "Extended_Pictographic", "ExtPict", "Extender", "Ext", "Grapheme_Base", "Gr_Base", "Grapheme_Extend", "Gr_Ext", "Hex_Digit", "Hex", "IDS_Binary_Operator", "IDSB", "IDS_Trinary_Operator", "IDST", "ID_Continue", "IDC", "ID_Start", "IDS", "Ideographic", "Ideo", "Join_Control", "Join_C", "Logical_Order_Exception", "LOE", "Lowercase", "Lower", "Math", "Noncharacter_Code_Point", "NChar", "Pattern_Syntax", "Pat_Syn", "Pattern_White_Space", "Pat_WS", "Quotation_Mark", "QMark", "Radical", "Regional_Indicator", "RI", "Sentence_Terminal", "STerm", "Soft_Dotted", "SD", "Terminal_Punctuation", "Term", "Unified_Ideograph", "UIdeo", "Uppercase", "Upper", "Variation_Selector", "VS", "White_Space", "space", "XID_Continue", "XIDC", "XID_Start", "XIDS"]);
10887
+ var binaryUnicodePropertiesOfStrings = /* @__PURE__ */ new Set(["Basic_Emoji", "Emoji_Keycap_Sequence", "RGI_Emoji_Modifier_Sequence", "RGI_Emoji_Flag_Sequence", "RGI_Emoji_Tag_Sequence", "RGI_Emoji_ZWJ_Sequence", "RGI_Emoji"]);
10888
+ var valuesOfNonBinaryUnicodeProperties = {
10889
+ General_Category: /* @__PURE__ */ new Set(["C", "Other", "Cc", "Control", "cntrl", "Cf", "Format", "Cn", "Unassigned", "Co", "Private_Use", "Cs", "Surrogate", "L", "Letter", "LC", "Cased_Letter", "Ll", "Lowercase_Letter", "Lm", "Modifier_Letter", "Lo", "Other_Letter", "Lt", "Titlecase_Letter", "Lu", "Uppercase_Letter", "M", "Mark", "Combining_Mark", "Mc", "Spacing_Mark", "Me", "Enclosing_Mark", "Mn", "Nonspacing_Mark", "N", "Number", "Nd", "Decimal_Number", "digit", "Nl", "Letter_Number", "No", "Other_Number", "P", "Punctuation", "punct", "Pc", "Connector_Punctuation", "Pd", "Dash_Punctuation", "Pe", "Close_Punctuation", "Pf", "Final_Punctuation", "Pi", "Initial_Punctuation", "Po", "Other_Punctuation", "Ps", "Open_Punctuation", "S", "Symbol", "Sc", "Currency_Symbol", "Sk", "Modifier_Symbol", "Sm", "Math_Symbol", "So", "Other_Symbol", "Z", "Separator", "Zl", "Line_Separator", "Zp", "Paragraph_Separator", "Zs", "Space_Separator"]),
10890
+ Script: /* @__PURE__ */ new Set(["Adlm", "Adlam", "Aghb", "Caucasian_Albanian", "Ahom", "Ahom", "Arab", "Arabic", "Armi", "Imperial_Aramaic", "Armn", "Armenian", "Avst", "Avestan", "Bali", "Balinese", "Bamu", "Bamum", "Bass", "Bassa_Vah", "Batk", "Batak", "Beng", "Bengali", "Bhks", "Bhaiksuki", "Bopo", "Bopomofo", "Brah", "Brahmi", "Brai", "Braille", "Bugi", "Buginese", "Buhd", "Buhid", "Cakm", "Chakma", "Cans", "Canadian_Aboriginal", "Cari", "Carian", "Cham", "Cham", "Cher", "Cherokee", "Chrs", "Chorasmian", "Copt", "Coptic", "Qaac", "Cpmn", "Cypro_Minoan", "Cprt", "Cypriot", "Cyrl", "Cyrillic", "Deva", "Devanagari", "Diak", "Dives_Akuru", "Dogr", "Dogra", "Dsrt", "Deseret", "Dupl", "Duployan", "Egyp", "Egyptian_Hieroglyphs", "Elba", "Elbasan", "Elym", "Elymaic", "Ethi", "Ethiopic", "Geor", "Georgian", "Glag", "Glagolitic", "Gong", "Gunjala_Gondi", "Gonm", "Masaram_Gondi", "Goth", "Gothic", "Gran", "Grantha", "Grek", "Greek", "Gujr", "Gujarati", "Guru", "Gurmukhi", "Hang", "Hangul", "Hani", "Han", "Hano", "Hanunoo", "Hatr", "Hatran", "Hebr", "Hebrew", "Hira", "Hiragana", "Hluw", "Anatolian_Hieroglyphs", "Hmng", "Pahawh_Hmong", "Hmnp", "Nyiakeng_Puachue_Hmong", "Hrkt", "Katakana_Or_Hiragana", "Hung", "Old_Hungarian", "Ital", "Old_Italic", "Java", "Javanese", "Kali", "Kayah_Li", "Kana", "Katakana", "Kawi", "Kawi", "Khar", "Kharoshthi", "Khmr", "Khmer", "Khoj", "Khojki", "Kits", "Khitan_Small_Script", "Knda", "Kannada", "Kthi", "Kaithi", "Lana", "Tai_Tham", "Laoo", "Lao", "Latn", "Latin", "Lepc", "Lepcha", "Limb", "Limbu", "Lina", "Linear_A", "Linb", "Linear_B", "Lisu", "Lisu", "Lyci", "Lycian", "Lydi", "Lydian", "Mahj", "Mahajani", "Maka", "Makasar", "Mand", "Mandaic", "Mani", "Manichaean", "Marc", "Marchen", "Medf", "Medefaidrin", "Mend", "Mende_Kikakui", "Merc", "Meroitic_Cursive", "Mero", "Meroitic_Hieroglyphs", "Mlym", "Malayalam", "Modi", "Modi", "Mong", "Mongolian", "Mroo", "Mro", "Mtei", "Meetei_Mayek", "Mult", "Multani", "Mymr", "Myanmar", "Nagm", "Nag_Mundari", "Nand", "Nandinagari", "Narb", "Old_North_Arabian", "Nbat", "Nabataean", "Newa", "Newa", "Nkoo", "Nko", "Nshu", "Nushu", "Ogam", "Ogham", "Olck", "Ol_Chiki", "Orkh", "Old_Turkic", "Orya", "Oriya", "Osge", "Osage", "Osma", "Osmanya", "Ougr", "Old_Uyghur", "Palm", "Palmyrene", "Pauc", "Pau_Cin_Hau", "Perm", "Old_Permic", "Phag", "Phags_Pa", "Phli", "Inscriptional_Pahlavi", "Phlp", "Psalter_Pahlavi", "Phnx", "Phoenician", "Plrd", "Miao", "Prti", "Inscriptional_Parthian", "Rjng", "Rejang", "Rohg", "Hanifi_Rohingya", "Runr", "Runic", "Samr", "Samaritan", "Sarb", "Old_South_Arabian", "Saur", "Saurashtra", "Sgnw", "SignWriting", "Shaw", "Shavian", "Shrd", "Sharada", "Sidd", "Siddham", "Sind", "Khudawadi", "Sinh", "Sinhala", "Sogd", "Sogdian", "Sogo", "Old_Sogdian", "Sora", "Sora_Sompeng", "Soyo", "Soyombo", "Sund", "Sundanese", "Sylo", "Syloti_Nagri", "Syrc", "Syriac", "Tagb", "Tagbanwa", "Takr", "Takri", "Tale", "Tai_Le", "Talu", "New_Tai_Lue", "Taml", "Tamil", "Tang", "Tangut", "Tavt", "Tai_Viet", "Telu", "Telugu", "Tfng", "Tifinagh", "Tglg", "Tagalog", "Thaa", "Thaana", "Thai", "Thai", "Tibt", "Tibetan", "Tirh", "Tirhuta", "Tnsa", "Tangsa", "Toto", "Toto", "Ugar", "Ugaritic", "Vaii", "Vai", "Vith", "Vithkuqi", "Wara", "Warang_Citi", "Wcho", "Wancho", "Xpeo", "Old_Persian", "Xsux", "Cuneiform", "Yezi", "Yezidi", "Yiii", "Yi", "Zanb", "Zanabazar_Square", "Zinh", "Inherited", "Qaai", "Zyyy", "Common", "Zzzz", "Unknown"]),
10891
+ Script_Extensions: /* @__PURE__ */ new Set()
10892
+ // Currently empty
10893
+ };
10002
10894
 
10003
10895
  // src/compiler/utilitiesPublic.ts
10004
10896
  function isExternalModuleNameRelative(moduleName) {
@@ -10695,7 +11587,7 @@ function isTypeOnlyExportDeclaration(node) {
10695
11587
  function isTypeOnlyImportOrExportDeclaration(node) {
10696
11588
  return isTypeOnlyImportDeclaration(node) || isTypeOnlyExportDeclaration(node);
10697
11589
  }
10698
- function isImportAttributeName(node) {
11590
+ function isAssertionKey(node) {
10699
11591
  return isStringLiteral(node) || isIdentifier(node);
10700
11592
  }
10701
11593
  function isGeneratedIdentifier(node) {
@@ -11468,8 +12360,8 @@ function moduleResolutionIsEqualTo(oldResolution, newResolution) {
11468
12360
  return oldResolution === newResolution || oldResolution.resolvedModule === newResolution.resolvedModule || !!oldResolution.resolvedModule && !!newResolution.resolvedModule && oldResolution.resolvedModule.isExternalLibraryImport === newResolution.resolvedModule.isExternalLibraryImport && oldResolution.resolvedModule.extension === newResolution.resolvedModule.extension && oldResolution.resolvedModule.resolvedFileName === newResolution.resolvedModule.resolvedFileName && oldResolution.resolvedModule.originalPath === newResolution.resolvedModule.originalPath && packageIdIsEqual(oldResolution.resolvedModule.packageId, newResolution.resolvedModule.packageId) && oldResolution.node10Result === newResolution.node10Result;
11469
12361
  }
11470
12362
  function createModuleNotFoundChain(sourceFile, host, moduleReference, mode, packageName) {
11471
- var _a;
11472
- const node10Result = (_a = host.getResolvedModule(sourceFile, moduleReference, mode)) == null ? void 0 : _a.node10Result;
12363
+ var _a, _b, _c;
12364
+ const node10Result = (_c = (_b = (_a = host.resolvedModules) == null ? void 0 : _a.get(sourceFile.path)) == null ? void 0 : _b.get(moduleReference, mode)) == null ? void 0 : _c.node10Result;
11473
12365
  const result = node10Result ? chainDiagnosticMessages(
11474
12366
  /*details*/
11475
12367
  void 0,
@@ -11511,14 +12403,14 @@ function packageIdToString(packageId) {
11511
12403
  function typeDirectiveIsEqualTo(oldResolution, newResolution) {
11512
12404
  return oldResolution === newResolution || oldResolution.resolvedTypeReferenceDirective === newResolution.resolvedTypeReferenceDirective || !!oldResolution.resolvedTypeReferenceDirective && !!newResolution.resolvedTypeReferenceDirective && oldResolution.resolvedTypeReferenceDirective.resolvedFileName === newResolution.resolvedTypeReferenceDirective.resolvedFileName && !!oldResolution.resolvedTypeReferenceDirective.primary === !!newResolution.resolvedTypeReferenceDirective.primary && oldResolution.resolvedTypeReferenceDirective.originalPath === newResolution.resolvedTypeReferenceDirective.originalPath;
11513
12405
  }
11514
- function hasChangesInResolutions(names, newSourceFile, newResolutions, getOldResolution, comparer, nameAndModeGetter) {
12406
+ function hasChangesInResolutions(names, newSourceFile, newResolutions, oldResolutions, comparer, nameAndModeGetter) {
11515
12407
  Debug.assert(names.length === newResolutions.length);
11516
12408
  for (let i = 0; i < names.length; i++) {
11517
12409
  const newResolution = newResolutions[i];
11518
12410
  const entry = names[i];
11519
12411
  const name = nameAndModeGetter.getName(entry);
11520
12412
  const mode = nameAndModeGetter.getMode(entry, newSourceFile);
11521
- const oldResolution = getOldResolution(name, mode);
12413
+ const oldResolution = oldResolutions && oldResolutions.get(name, mode);
11522
12414
  const changed = oldResolution ? !newResolution || !comparer(oldResolution, newResolution) : newResolution;
11523
12415
  if (changed) {
11524
12416
  return true;
@@ -14745,6 +15637,9 @@ function getIndentString(level) {
14745
15637
  function getIndentSize() {
14746
15638
  return indentStrings[1].length;
14747
15639
  }
15640
+ function isNightly() {
15641
+ return version.includes("-dev") || version.includes("-insiders");
15642
+ }
14748
15643
  function createTextWriter(newLine) {
14749
15644
  var output;
14750
15645
  var indent2;
@@ -16481,11 +17376,11 @@ function createSymlinkCache(cwd, getCanonicalFileName) {
16481
17376
  (symlinkedDirectories || (symlinkedDirectories = /* @__PURE__ */ new Map())).set(symlinkPath, real);
16482
17377
  }
16483
17378
  },
16484
- setSymlinksFromResolutions(forEachResolvedModule, forEachResolvedTypeReferenceDirective, typeReferenceDirectives) {
17379
+ setSymlinksFromResolutions(resolvedModules, resolvedTypeReferenceDirectiveNames, typeReferenceDirectives) {
16485
17380
  Debug.assert(!hasProcessedResolutions);
16486
17381
  hasProcessedResolutions = true;
16487
- forEachResolvedModule((resolution) => processResolution(this, resolution.resolvedModule));
16488
- forEachResolvedTypeReferenceDirective((resolution) => processResolution(this, resolution.resolvedTypeReferenceDirective));
17382
+ resolvedModules == null ? void 0 : resolvedModules.forEach((cache) => cache.forEach((resolution) => processResolution(this, resolution.resolvedModule)));
17383
+ resolvedTypeReferenceDirectiveNames == null ? void 0 : resolvedTypeReferenceDirectiveNames.forEach((cache) => cache.forEach((resolution) => processResolution(this, resolution.resolvedTypeReferenceDirective)));
16489
17384
  typeReferenceDirectives.forEach((resolution) => processResolution(this, resolution.resolvedTypeReferenceDirective));
16490
17385
  },
16491
17386
  hasProcessedResolutions: () => hasProcessedResolutions
@@ -17461,13 +18356,6 @@ function getPropertyNameFromType(type) {
17461
18356
  function isExpandoPropertyDeclaration(declaration) {
17462
18357
  return !!declaration && (isPropertyAccessExpression(declaration) || isElementAccessExpression(declaration) || isBinaryExpression(declaration));
17463
18358
  }
17464
- function hasResolutionModeOverride(node) {
17465
- var _a;
17466
- if (node === void 0) {
17467
- return false;
17468
- }
17469
- return !!getResolutionModeOverride(isImportTypeNode(node) ? (_a = node.attributes) == null ? void 0 : _a.attributes : node.attributes);
17470
- }
17471
18359
 
17472
18360
  // src/compiler/factory/baseNodeFactory.ts
17473
18361
  function createBaseNodeFactory() {
@@ -18339,12 +19227,6 @@ function createNodeFactory(flags, baseFactory2) {
18339
19227
  updateAssertEntry,
18340
19228
  createImportTypeAssertionContainer,
18341
19229
  updateImportTypeAssertionContainer,
18342
- createImportTypeAttributes,
18343
- updateImportTypeAttributes,
18344
- createImportAttributes,
18345
- updateImportAttributes,
18346
- createImportAttribute,
18347
- updateImportAttribute,
18348
19230
  createNamespaceImport,
18349
19231
  updateNamespaceImport,
18350
19232
  createNamespaceExport,
@@ -19613,18 +20495,18 @@ function createNodeFactory(flags, baseFactory2) {
19613
20495
  function updateTemplateLiteralType(node, head, templateSpans) {
19614
20496
  return node.head !== head || node.templateSpans !== templateSpans ? update(createTemplateLiteralType(head, templateSpans), node) : node;
19615
20497
  }
19616
- function createImportTypeNode(argument, attributes, qualifier, typeArguments, isTypeOf = false) {
20498
+ function createImportTypeNode(argument, assertions, qualifier, typeArguments, isTypeOf = false) {
19617
20499
  const node = createBaseNode(205 /* ImportType */);
19618
20500
  node.argument = argument;
19619
- node.attributes = node.assertions = attributes;
20501
+ node.assertions = assertions;
19620
20502
  node.qualifier = qualifier;
19621
20503
  node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments);
19622
20504
  node.isTypeOf = isTypeOf;
19623
20505
  node.transformFlags = 1 /* ContainsTypeScript */;
19624
20506
  return node;
19625
20507
  }
19626
- function updateImportTypeNode(node, argument, attributes, qualifier, typeArguments, isTypeOf = node.isTypeOf) {
19627
- return node.argument !== argument || node.attributes !== attributes || node.qualifier !== qualifier || node.typeArguments !== typeArguments || node.isTypeOf !== isTypeOf ? update(createImportTypeNode(argument, attributes, qualifier, typeArguments, isTypeOf), node) : node;
20508
+ function updateImportTypeNode(node, argument, assertions, qualifier, typeArguments, isTypeOf = node.isTypeOf) {
20509
+ return node.argument !== argument || node.assertions !== assertions || node.qualifier !== qualifier || node.typeArguments !== typeArguments || node.isTypeOf !== isTypeOf ? update(createImportTypeNode(argument, assertions, qualifier, typeArguments, isTypeOf), node) : node;
19628
20510
  }
19629
20511
  function createParenthesizedType(type) {
19630
20512
  const node = createBaseNode(196 /* ParenthesizedType */);
@@ -20754,19 +21636,19 @@ function createNodeFactory(flags, baseFactory2) {
20754
21636
  function updateImportEqualsDeclaration(node, modifiers, isTypeOnly, name, moduleReference) {
20755
21637
  return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.name !== name || node.moduleReference !== moduleReference ? update(createImportEqualsDeclaration(modifiers, isTypeOnly, name, moduleReference), node) : node;
20756
21638
  }
20757
- function createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes) {
21639
+ function createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause) {
20758
21640
  const node = createBaseNode(272 /* ImportDeclaration */);
20759
21641
  node.modifiers = asNodeArray(modifiers);
20760
21642
  node.importClause = importClause;
20761
21643
  node.moduleSpecifier = moduleSpecifier;
20762
- node.attributes = node.assertClause = attributes;
21644
+ node.assertClause = assertClause;
20763
21645
  node.transformFlags |= propagateChildFlags(node.importClause) | propagateChildFlags(node.moduleSpecifier);
20764
21646
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
20765
21647
  node.jsDoc = void 0;
20766
21648
  return node;
20767
21649
  }
20768
- function updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, attributes) {
20769
- return node.modifiers !== modifiers || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier || node.attributes !== attributes ? update(createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes), node) : node;
21650
+ function updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause) {
21651
+ return node.modifiers !== modifiers || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier || node.assertClause !== assertClause ? update(createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause), node) : node;
20770
21652
  }
20771
21653
  function createImportClause(isTypeOnly, name, namedBindings) {
20772
21654
  const node = createBaseDeclaration(273 /* ImportClause */);
@@ -20787,7 +21669,6 @@ function createNodeFactory(flags, baseFactory2) {
20787
21669
  const node = createBaseNode(300 /* AssertClause */);
20788
21670
  node.elements = createNodeArray(elements);
20789
21671
  node.multiLine = multiLine;
20790
- node.token = 132 /* AssertKeyword */;
20791
21672
  node.transformFlags |= 4 /* ContainsESNext */;
20792
21673
  return node;
20793
21674
  }
@@ -20813,36 +21694,6 @@ function createNodeFactory(flags, baseFactory2) {
20813
21694
  function updateImportTypeAssertionContainer(node, clause, multiLine) {
20814
21695
  return node.assertClause !== clause || node.multiLine !== multiLine ? update(createImportTypeAssertionContainer(clause, multiLine), node) : node;
20815
21696
  }
20816
- function createImportTypeAttributes(attributes, multiLine) {
20817
- const node = createBaseNode(302 /* ImportTypeAttributes */);
20818
- node.attributes = node.assertClause = attributes;
20819
- node.multiLine = multiLine;
20820
- return node;
20821
- }
20822
- function updateImportTypeAttributes(node, attributes, multiLine) {
20823
- return node.attributes !== attributes || node.multiLine !== multiLine ? update(createImportTypeAttributes(attributes, multiLine), node) : node;
20824
- }
20825
- function createImportAttributes(elements, multiLine, token) {
20826
- const node = createBaseNode(300 /* ImportAttributes */);
20827
- node.token = token ?? 118 /* WithKeyword */;
20828
- node.elements = createNodeArray(elements);
20829
- node.multiLine = multiLine;
20830
- node.transformFlags |= 4 /* ContainsESNext */;
20831
- return node;
20832
- }
20833
- function updateImportAttributes(node, elements, multiLine) {
20834
- return node.elements !== elements || node.multiLine !== multiLine ? update(createImportAttributes(elements, multiLine, node.token), node) : node;
20835
- }
20836
- function createImportAttribute(name, value) {
20837
- const node = createBaseNode(301 /* ImportAttribute */);
20838
- node.name = name;
20839
- node.value = value;
20840
- node.transformFlags |= 4 /* ContainsESNext */;
20841
- return node;
20842
- }
20843
- function updateImportAttribute(node, name, value) {
20844
- return node.name !== name || node.value !== value ? update(createImportAttribute(name, value), node) : node;
20845
- }
20846
21697
  function createNamespaceImport(name) {
20847
21698
  const node = createBaseDeclaration(274 /* NamespaceImport */);
20848
21699
  node.name = name;
@@ -20903,20 +21754,20 @@ function createNodeFactory(flags, baseFactory2) {
20903
21754
  function updateExportAssignment(node, modifiers, expression) {
20904
21755
  return node.modifiers !== modifiers || node.expression !== expression ? update(createExportAssignment(modifiers, node.isExportEquals, expression), node) : node;
20905
21756
  }
20906
- function createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes) {
21757
+ function createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) {
20907
21758
  const node = createBaseDeclaration(278 /* ExportDeclaration */);
20908
21759
  node.modifiers = asNodeArray(modifiers);
20909
21760
  node.isTypeOnly = isTypeOnly;
20910
21761
  node.exportClause = exportClause;
20911
21762
  node.moduleSpecifier = moduleSpecifier;
20912
- node.attributes = node.assertClause = attributes;
21763
+ node.assertClause = assertClause;
20913
21764
  node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.exportClause) | propagateChildFlags(node.moduleSpecifier);
20914
21765
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
20915
21766
  node.jsDoc = void 0;
20916
21767
  return node;
20917
21768
  }
20918
- function updateExportDeclaration(node, modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes) {
20919
- return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.exportClause !== exportClause || node.moduleSpecifier !== moduleSpecifier || node.attributes !== attributes ? finishUpdateExportDeclaration(createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes), node) : node;
21769
+ function updateExportDeclaration(node, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) {
21770
+ return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.exportClause !== exportClause || node.moduleSpecifier !== moduleSpecifier || node.assertClause !== assertClause ? finishUpdateExportDeclaration(createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause), node) : node;
20920
21771
  }
20921
21772
  function finishUpdateExportDeclaration(updated, original) {
20922
21773
  if (updated !== original) {
@@ -22243,7 +23094,7 @@ function createNodeFactory(flags, baseFactory2) {
22243
23094
  } else {
22244
23095
  modifierArray = modifiers;
22245
23096
  }
22246
- return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration(node, modifierArray, node.importClause, node.moduleSpecifier, node.attributes) : isExportAssignment(node) ? updateExportAssignment(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.attributes) : Debug.assertNever(node);
23097
+ return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node);
22247
23098
  }
22248
23099
  function updateModifierLike(node, modifierArray) {
22249
23100
  return isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isPropertyDeclaration(node) ? updatePropertyDeclaration(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : Debug.assertNever(node);
@@ -24467,14 +25318,14 @@ function isImportDeclaration(node) {
24467
25318
  function isImportClause(node) {
24468
25319
  return node.kind === 273 /* ImportClause */;
24469
25320
  }
24470
- function isImportTypeAttributes(node) {
24471
- return node.kind === 302 /* ImportTypeAttributes */;
25321
+ function isImportTypeAssertionContainer(node) {
25322
+ return node.kind === 302 /* ImportTypeAssertionContainer */;
24472
25323
  }
24473
- function isImportAttributes(node) {
24474
- return node.kind === 300 /* ImportAttributes */;
25324
+ function isAssertClause(node) {
25325
+ return node.kind === 300 /* AssertClause */;
24475
25326
  }
24476
- function isImportAttribute(node) {
24477
- return node.kind === 301 /* ImportAttribute */;
25327
+ function isAssertEntry(node) {
25328
+ return node.kind === 301 /* AssertEntry */;
24478
25329
  }
24479
25330
  function isNamespaceImport(node) {
24480
25331
  return node.kind === 274 /* NamespaceImport */;
@@ -25150,7 +26001,7 @@ function createExternalHelpersImportDeclarationIfNeeded(nodeFactory, helperFacto
25150
26001
  namedBindings
25151
26002
  ),
25152
26003
  nodeFactory.createStringLiteral(externalHelpersModuleNameText),
25153
- /*attributes*/
26004
+ /*assertClause*/
25154
26005
  void 0
25155
26006
  );
25156
26007
  addInternalEmitFlags(externalHelpersImportDeclaration, 2 /* NeverApplyImportHelper */);
@@ -25904,10 +26755,10 @@ var forEachChildTable = {
25904
26755
  return visitNode2(cbNode, node.typeParameter);
25905
26756
  },
25906
26757
  [205 /* ImportType */]: function forEachChildInImportType(node, cbNode, cbNodes) {
25907
- return visitNode2(cbNode, node.argument) || visitNode2(cbNode, node.attributes) || visitNode2(cbNode, node.qualifier) || visitNodes(cbNode, cbNodes, node.typeArguments);
26758
+ return visitNode2(cbNode, node.argument) || visitNode2(cbNode, node.assertions) || visitNode2(cbNode, node.qualifier) || visitNodes(cbNode, cbNodes, node.typeArguments);
25908
26759
  },
25909
- [302 /* ImportTypeAttributes */]: function forEachChildInImportTypeAttributes(node, cbNode, _cbNodes) {
25910
- return visitNode2(cbNode, node.attributes);
26760
+ [302 /* ImportTypeAssertionContainer */]: function forEachChildInImportTypeAssertionContainer(node, cbNode, _cbNodes) {
26761
+ return visitNode2(cbNode, node.assertClause);
25911
26762
  },
25912
26763
  [196 /* ParenthesizedType */]: forEachChildInParenthesizedTypeOrTypeOperator,
25913
26764
  [198 /* TypeOperator */]: forEachChildInParenthesizedTypeOrTypeOperator,
@@ -26078,15 +26929,15 @@ var forEachChildTable = {
26078
26929
  return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.moduleReference);
26079
26930
  },
26080
26931
  [272 /* ImportDeclaration */]: function forEachChildInImportDeclaration(node, cbNode, cbNodes) {
26081
- return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.attributes);
26932
+ return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.assertClause);
26082
26933
  },
26083
26934
  [273 /* ImportClause */]: function forEachChildInImportClause(node, cbNode, _cbNodes) {
26084
26935
  return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.namedBindings);
26085
26936
  },
26086
- [300 /* ImportAttributes */]: function forEachChildInImportAttributes(node, cbNode, cbNodes) {
26937
+ [300 /* AssertClause */]: function forEachChildInAssertClause(node, cbNode, cbNodes) {
26087
26938
  return visitNodes(cbNode, cbNodes, node.elements);
26088
26939
  },
26089
- [301 /* ImportAttribute */]: function forEachChildInImportAttribute(node, cbNode, _cbNodes) {
26940
+ [301 /* AssertEntry */]: function forEachChildInAssertEntry(node, cbNode, _cbNodes) {
26090
26941
  return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.value);
26091
26942
  },
26092
26943
  [270 /* NamespaceExportDeclaration */]: function forEachChildInNamespaceExportDeclaration(node, cbNode, cbNodes) {
@@ -26101,7 +26952,7 @@ var forEachChildTable = {
26101
26952
  [275 /* NamedImports */]: forEachChildInNamedImportsOrExports,
26102
26953
  [279 /* NamedExports */]: forEachChildInNamedImportsOrExports,
26103
26954
  [278 /* ExportDeclaration */]: function forEachChildInExportDeclaration(node, cbNode, cbNodes) {
26104
- return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.exportClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.attributes);
26955
+ return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.exportClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.assertClause);
26105
26956
  },
26106
26957
  [276 /* ImportSpecifier */]: forEachChildInImportOrExportSpecifier,
26107
26958
  [281 /* ExportSpecifier */]: forEachChildInImportOrExportSpecifier,
@@ -26340,7 +27191,7 @@ function gatherPossibleChildren(node) {
26340
27191
  function setExternalModuleIndicator(sourceFile) {
26341
27192
  sourceFile.externalModuleIndicator = isFileProbablyExternalModule(sourceFile);
26342
27193
  }
26343
- function createSourceFile(fileName, sourceText, languageVersionOrOptions, setParentNodes = false, scriptKind) {
27194
+ function createSourceFile(fileName, sourceText, languageVersionOrOptions, setParentNodes = false, scriptKind, skipNonSemanticJSDoc) {
26344
27195
  var _a, _b, _c, _d;
26345
27196
  (_a = tracing) == null ? void 0 : _a.push(
26346
27197
  tracing.Phase.Parse,
@@ -26355,8 +27206,7 @@ function createSourceFile(fileName, sourceText, languageVersionOrOptions, setPar
26355
27206
  const {
26356
27207
  languageVersion,
26357
27208
  setExternalModuleIndicator: overrideSetExternalModuleIndicator,
26358
- impliedNodeFormat: format,
26359
- jsDocParsingMode
27209
+ impliedNodeFormat: format
26360
27210
  } = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions : { languageVersion: languageVersionOrOptions };
26361
27211
  if (languageVersion === 100 /* JSON */) {
26362
27212
  result = Parser.parseSourceFile(
@@ -26368,7 +27218,7 @@ function createSourceFile(fileName, sourceText, languageVersionOrOptions, setPar
26368
27218
  setParentNodes,
26369
27219
  6 /* JSON */,
26370
27220
  noop,
26371
- jsDocParsingMode
27221
+ skipNonSemanticJSDoc
26372
27222
  );
26373
27223
  } else {
26374
27224
  const setIndicator = format === void 0 ? overrideSetExternalModuleIndicator : (file) => {
@@ -26384,7 +27234,7 @@ function createSourceFile(fileName, sourceText, languageVersionOrOptions, setPar
26384
27234
  setParentNodes,
26385
27235
  scriptKind,
26386
27236
  setIndicator,
26387
- jsDocParsingMode
27237
+ skipNonSemanticJSDoc
26388
27238
  );
26389
27239
  }
26390
27240
  (_c = perfLogger) == null ? void 0 : _c.logStopParseSourceFile();
@@ -26503,7 +27353,7 @@ var Parser;
26503
27353
  var contextFlags;
26504
27354
  var topLevel = true;
26505
27355
  var parseErrorBeforeNextFinishedNode = false;
26506
- function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride, jsDocParsingMode = 0 /* ParseAll */) {
27356
+ function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride, skipNonSemanticJSDoc) {
26507
27357
  var _a;
26508
27358
  scriptKind2 = ensureScriptKind(fileName2, scriptKind2);
26509
27359
  if (scriptKind2 === 6 /* JSON */) {
@@ -26525,8 +27375,9 @@ var Parser;
26525
27375
  result2.pragmas = emptyMap;
26526
27376
  return result2;
26527
27377
  }
26528
- initializeState(fileName2, sourceText2, languageVersion2, syntaxCursor2, scriptKind2, jsDocParsingMode);
26529
- const result = parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicatorOverride || setExternalModuleIndicator, jsDocParsingMode);
27378
+ skipNonSemanticJSDoc = !!skipNonSemanticJSDoc && scriptKind2 !== 1 /* JS */ && scriptKind2 !== 2 /* JSX */;
27379
+ initializeState(fileName2, sourceText2, languageVersion2, syntaxCursor2, scriptKind2, skipNonSemanticJSDoc);
27380
+ const result = parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicatorOverride || setExternalModuleIndicator, skipNonSemanticJSDoc);
26530
27381
  clearState();
26531
27382
  return result;
26532
27383
  }
@@ -26539,7 +27390,8 @@ var Parser;
26539
27390
  /*syntaxCursor*/
26540
27391
  void 0,
26541
27392
  1 /* JS */,
26542
- 0 /* ParseAll */
27393
+ /*skipNonSemanticJSDoc*/
27394
+ false
26543
27395
  );
26544
27396
  nextToken();
26545
27397
  const entityName = parseEntityName(
@@ -26552,7 +27404,15 @@ var Parser;
26552
27404
  }
26553
27405
  Parser2.parseIsolatedEntityName = parseIsolatedEntityName2;
26554
27406
  function parseJsonText2(fileName2, sourceText2, languageVersion2 = 2 /* ES2015 */, syntaxCursor2, setParentNodes = false) {
26555
- initializeState(fileName2, sourceText2, languageVersion2, syntaxCursor2, 6 /* JSON */, 0 /* ParseAll */);
27407
+ initializeState(
27408
+ fileName2,
27409
+ sourceText2,
27410
+ languageVersion2,
27411
+ syntaxCursor2,
27412
+ 6 /* JSON */,
27413
+ /*skipNonSemanticJSDoc*/
27414
+ false
27415
+ );
26556
27416
  sourceFlags = contextFlags;
26557
27417
  nextToken();
26558
27418
  const pos = getNodePos();
@@ -26633,7 +27493,7 @@ var Parser;
26633
27493
  return result;
26634
27494
  }
26635
27495
  Parser2.parseJsonText = parseJsonText2;
26636
- function initializeState(_fileName, _sourceText, _languageVersion, _syntaxCursor, _scriptKind, _jsDocParsingMode) {
27496
+ function initializeState(_fileName, _sourceText, _languageVersion, _syntaxCursor, _scriptKind, _skipNonSemanticJSDoc) {
26637
27497
  NodeConstructor2 = objectAllocator.getNodeConstructor();
26638
27498
  TokenConstructor2 = objectAllocator.getTokenConstructor();
26639
27499
  IdentifierConstructor2 = objectAllocator.getIdentifierConstructor();
@@ -26669,15 +27529,13 @@ var Parser;
26669
27529
  scanner.setOnError(scanError);
26670
27530
  scanner.setScriptTarget(languageVersion);
26671
27531
  scanner.setLanguageVariant(languageVariant);
26672
- scanner.setScriptKind(scriptKind);
26673
- scanner.setJSDocParsingMode(_jsDocParsingMode);
27532
+ scanner.setSkipNonSemanticJSDoc(_skipNonSemanticJSDoc);
26674
27533
  }
26675
27534
  function clearState() {
26676
27535
  scanner.clearCommentDirectives();
26677
27536
  scanner.setText("");
26678
27537
  scanner.setOnError(void 0);
26679
- scanner.setScriptKind(0 /* Unknown */);
26680
- scanner.setJSDocParsingMode(0 /* ParseAll */);
27538
+ scanner.setSkipNonSemanticJSDoc(false);
26681
27539
  sourceText = void 0;
26682
27540
  languageVersion = void 0;
26683
27541
  syntaxCursor = void 0;
@@ -26691,7 +27549,7 @@ var Parser;
26691
27549
  notParenthesizedArrow = void 0;
26692
27550
  topLevel = true;
26693
27551
  }
26694
- function parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicator2, jsDocParsingMode) {
27552
+ function parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicator2, skipNonSemanticJSDoc) {
26695
27553
  const isDeclarationFile = isDeclarationFileName(fileName);
26696
27554
  if (isDeclarationFile) {
26697
27555
  contextFlags |= 33554432 /* Ambient */;
@@ -26710,7 +27568,7 @@ var Parser;
26710
27568
  sourceFile.identifierCount = identifierCount;
26711
27569
  sourceFile.identifiers = identifiers;
26712
27570
  sourceFile.parseDiagnostics = attachFileToDiagnostics(parseDiagnostics, sourceFile);
26713
- sourceFile.jsDocParsingMode = jsDocParsingMode;
27571
+ sourceFile.skipNonSemanticJSDoc = skipNonSemanticJSDoc;
26714
27572
  if (jsDocDiagnostics) {
26715
27573
  sourceFile.jsDocDiagnostics = attachFileToDiagnostics(jsDocDiagnostics, sourceFile);
26716
27574
  }
@@ -26958,7 +27816,10 @@ var Parser;
26958
27816
  function parseErrorAtPosition(start, length2, message, ...args) {
26959
27817
  const lastError = lastOrUndefined(parseDiagnostics);
26960
27818
  let result;
26961
- if (!lastError || start !== lastError.start) {
27819
+ if (message.category === 3 /* Message */ && lastError && start === lastError.start && length2 === lastError.length) {
27820
+ result = createDetachedDiagnostic(fileName, sourceText, start, length2, message, ...args);
27821
+ addRelatedInfo(lastError, result);
27822
+ } else if (!lastError || start !== lastError.start) {
26962
27823
  result = createDetachedDiagnostic(fileName, sourceText, start, length2, message, ...args);
26963
27824
  parseDiagnostics.push(result);
26964
27825
  }
@@ -27114,7 +27975,7 @@ var Parser;
27114
27975
  parseErrorForInvalidName(Diagnostics.Type_alias_name_cannot_be_0, Diagnostics.Type_alias_must_be_given_a_name, 64 /* EqualsToken */);
27115
27976
  return;
27116
27977
  }
27117
- const suggestion = getSpellingSuggestion(expressionText, viableKeywordSuggestions, (n) => n) ?? getSpaceSuggestion(expressionText);
27978
+ const suggestion = getSpellingSuggestion(expressionText, viableKeywordSuggestions, identity) ?? getSpaceSuggestion(expressionText);
27118
27979
  if (suggestion) {
27119
27980
  parseErrorAt(pos, node.end, Diagnostics.Unknown_keyword_or_identifier_Did_you_mean_0, suggestion);
27120
27981
  return;
@@ -27366,7 +28227,7 @@ var Parser;
27366
28227
  function isLiteralPropertyName() {
27367
28228
  return tokenIsIdentifierOrKeyword(token()) || token() === 11 /* StringLiteral */ || token() === 9 /* NumericLiteral */;
27368
28229
  }
27369
- function isImportAttributeName2() {
28230
+ function isAssertionKey2() {
27370
28231
  return tokenIsIdentifierOrKeyword(token()) || token() === 11 /* StringLiteral */;
27371
28232
  }
27372
28233
  function parsePropertyNameWorker(allowComputedPropertyNames) {
@@ -27485,8 +28346,8 @@ var Parser;
27485
28346
  return isLiteralPropertyName();
27486
28347
  case 9 /* ObjectBindingElements */:
27487
28348
  return token() === 23 /* OpenBracketToken */ || token() === 26 /* DotDotDotToken */ || isLiteralPropertyName();
27488
- case 24 /* ImportAttributes */:
27489
- return isImportAttributeName2();
28349
+ case 24 /* AssertEntries */:
28350
+ return isAssertionKey2();
27490
28351
  case 7 /* HeritageClauseElement */:
27491
28352
  if (token() === 19 /* OpenBraceToken */) {
27492
28353
  return lookAhead(isValidHeritageClauseObjectLiteral);
@@ -27589,7 +28450,7 @@ var Parser;
27589
28450
  case 12 /* ObjectLiteralMembers */:
27590
28451
  case 9 /* ObjectBindingElements */:
27591
28452
  case 23 /* ImportOrExportSpecifiers */:
27592
- case 24 /* ImportAttributes */:
28453
+ case 24 /* AssertEntries */:
27593
28454
  return token() === 20 /* CloseBraceToken */;
27594
28455
  case 3 /* SwitchClauseStatements */:
27595
28456
  return token() === 20 /* CloseBraceToken */ || token() === 84 /* CaseKeyword */ || token() === 90 /* DefaultKeyword */;
@@ -27895,7 +28756,7 @@ var Parser;
27895
28756
  return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
27896
28757
  case 14 /* JsxChildren */:
27897
28758
  return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
27898
- case 24 /* ImportAttributes */:
28759
+ case 24 /* AssertEntries */:
27899
28760
  return parseErrorAtCurrentToken(Diagnostics.Identifier_or_string_literal_expected);
27900
28761
  case 25 /* JSDocComment */:
27901
28762
  return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
@@ -28770,22 +29631,16 @@ var Parser;
28770
29631
  nextToken();
28771
29632
  return token() === 102 /* ImportKeyword */;
28772
29633
  }
28773
- function parseImportTypeAttributes() {
29634
+ function parseImportTypeAssertions() {
28774
29635
  const pos = getNodePos();
28775
29636
  const openBracePosition = scanner.getTokenStart();
28776
29637
  parseExpected(19 /* OpenBraceToken */);
28777
29638
  const multiLine = scanner.hasPrecedingLineBreak();
28778
- const currentToken2 = token();
28779
- if (currentToken2 !== 118 /* WithKeyword */ && currentToken2 !== 132 /* AssertKeyword */) {
28780
- parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString(118 /* WithKeyword */));
28781
- } else {
28782
- nextToken();
28783
- }
29639
+ parseExpected(132 /* AssertKeyword */);
28784
29640
  parseExpected(59 /* ColonToken */);
28785
- const attributes = parseImportAttributes(
28786
- currentToken2,
28787
- /*shouldAdvance*/
28788
- false
29641
+ const clause = parseAssertClause(
29642
+ /*skipAssertKeyword*/
29643
+ true
28789
29644
  );
28790
29645
  if (!parseExpected(20 /* CloseBraceToken */)) {
28791
29646
  const lastError = lastOrUndefined(parseDiagnostics);
@@ -28796,7 +29651,7 @@ var Parser;
28796
29651
  );
28797
29652
  }
28798
29653
  }
28799
- return finishNode(factory2.createImportTypeAttributes(attributes, multiLine), pos);
29654
+ return finishNode(factory2.createImportTypeAssertionContainer(clause, multiLine), pos);
28800
29655
  }
28801
29656
  function parseImportType() {
28802
29657
  sourceFlags |= 4194304 /* PossiblyContainsDynamicImport */;
@@ -28805,14 +29660,14 @@ var Parser;
28805
29660
  parseExpected(102 /* ImportKeyword */);
28806
29661
  parseExpected(21 /* OpenParenToken */);
28807
29662
  const type = parseType();
28808
- let attributes;
29663
+ let assertions;
28809
29664
  if (parseOptional(28 /* CommaToken */)) {
28810
- attributes = parseImportTypeAttributes();
29665
+ assertions = parseImportTypeAssertions();
28811
29666
  }
28812
29667
  parseExpected(22 /* CloseParenToken */);
28813
29668
  const qualifier = parseOptional(25 /* DotToken */) ? parseEntityNameOfTypeReference() : void 0;
28814
29669
  const typeArguments = parseTypeArgumentsOfTypeReference();
28815
- return finishNode(factory2.createImportTypeNode(type, attributes, qualifier, typeArguments, isTypeOf), pos);
29670
+ return finishNode(factory2.createImportTypeNode(type, assertions, qualifier, typeArguments, isTypeOf), pos);
28816
29671
  }
28817
29672
  function nextTokenIsNumericOrBigIntLiteral() {
28818
29673
  nextToken();
@@ -31874,16 +32729,15 @@ var Parser;
31874
32729
  parseExpected(161 /* FromKeyword */);
31875
32730
  }
31876
32731
  const moduleSpecifier = parseModuleSpecifier();
31877
- const currentToken2 = token();
31878
- let attributes;
31879
- if ((currentToken2 === 118 /* WithKeyword */ || currentToken2 === 132 /* AssertKeyword */) && !scanner.hasPrecedingLineBreak()) {
31880
- attributes = parseImportAttributes(currentToken2);
32732
+ let assertClause;
32733
+ if (token() === 132 /* AssertKeyword */ && !scanner.hasPrecedingLineBreak()) {
32734
+ assertClause = parseAssertClause();
31881
32735
  }
31882
32736
  parseSemicolon();
31883
- const node = factory2.createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes);
32737
+ const node = factory2.createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause);
31884
32738
  return withJSDoc(finishNode(node, pos), hasJSDoc);
31885
32739
  }
31886
- function parseImportAttribute() {
32740
+ function parseAssertEntry() {
31887
32741
  const pos = getNodePos();
31888
32742
  const name = tokenIsIdentifierOrKeyword(token()) ? parseIdentifierName() : parseLiteralLikeNode(11 /* StringLiteral */);
31889
32743
  parseExpected(59 /* ColonToken */);
@@ -31891,19 +32745,19 @@ var Parser;
31891
32745
  /*allowReturnTypeInArrowFunction*/
31892
32746
  true
31893
32747
  );
31894
- return finishNode(factory2.createImportAttribute(name, value), pos);
32748
+ return finishNode(factory2.createAssertEntry(name, value), pos);
31895
32749
  }
31896
- function parseImportAttributes(token2, shouldAdvance = true) {
32750
+ function parseAssertClause(skipAssertKeyword) {
31897
32751
  const pos = getNodePos();
31898
- if (shouldAdvance) {
31899
- nextToken();
32752
+ if (!skipAssertKeyword) {
32753
+ parseExpected(132 /* AssertKeyword */);
31900
32754
  }
31901
32755
  const openBracePosition = scanner.getTokenStart();
31902
32756
  if (parseExpected(19 /* OpenBraceToken */)) {
31903
32757
  const multiLine = scanner.hasPrecedingLineBreak();
31904
32758
  const elements = parseDelimitedList(
31905
- 24 /* ImportAttributes */,
31906
- parseImportAttribute,
32759
+ 24 /* AssertEntries */,
32760
+ parseAssertEntry,
31907
32761
  /*considerSemicolonAsDelimiter*/
31908
32762
  true
31909
32763
  );
@@ -31916,7 +32770,7 @@ var Parser;
31916
32770
  );
31917
32771
  }
31918
32772
  }
31919
- return finishNode(factory2.createImportAttributes(elements, multiLine, token2), pos);
32773
+ return finishNode(factory2.createAssertClause(elements, multiLine), pos);
31920
32774
  } else {
31921
32775
  const elements = createNodeArray(
31922
32776
  [],
@@ -31926,11 +32780,10 @@ var Parser;
31926
32780
  /*hasTrailingComma*/
31927
32781
  false
31928
32782
  );
31929
- return finishNode(factory2.createImportAttributes(
32783
+ return finishNode(factory2.createAssertClause(
31930
32784
  elements,
31931
32785
  /*multiLine*/
31932
- false,
31933
- token2
32786
+ false
31934
32787
  ), pos);
31935
32788
  }
31936
32789
  }
@@ -32062,7 +32915,7 @@ var Parser;
32062
32915
  );
32063
32916
  let exportClause;
32064
32917
  let moduleSpecifier;
32065
- let attributes;
32918
+ let assertClause;
32066
32919
  const isTypeOnly = parseOptional(156 /* TypeKeyword */);
32067
32920
  const namespaceExportPos = getNodePos();
32068
32921
  if (parseOptional(42 /* AsteriskToken */)) {
@@ -32078,13 +32931,12 @@ var Parser;
32078
32931
  moduleSpecifier = parseModuleSpecifier();
32079
32932
  }
32080
32933
  }
32081
- const currentToken2 = token();
32082
- if (moduleSpecifier && (currentToken2 === 118 /* WithKeyword */ || currentToken2 === 132 /* AssertKeyword */) && !scanner.hasPrecedingLineBreak()) {
32083
- attributes = parseImportAttributes(currentToken2);
32934
+ if (moduleSpecifier && token() === 132 /* AssertKeyword */ && !scanner.hasPrecedingLineBreak()) {
32935
+ assertClause = parseAssertClause();
32084
32936
  }
32085
32937
  parseSemicolon();
32086
32938
  setAwaitContext(savedAwaitContext);
32087
- const node = factory2.createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes);
32939
+ const node = factory2.createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause);
32088
32940
  return withJSDoc(finishNode(node, pos), hasJSDoc);
32089
32941
  }
32090
32942
  function parseExportAssignment(pos, hasJSDoc, modifiers) {
@@ -32134,7 +32986,7 @@ var Parser;
32134
32986
  ParsingContext2[ParsingContext2["TupleElementTypes"] = 21] = "TupleElementTypes";
32135
32987
  ParsingContext2[ParsingContext2["HeritageClauses"] = 22] = "HeritageClauses";
32136
32988
  ParsingContext2[ParsingContext2["ImportOrExportSpecifiers"] = 23] = "ImportOrExportSpecifiers";
32137
- ParsingContext2[ParsingContext2["ImportAttributes"] = 24] = "ImportAttributes";
32989
+ ParsingContext2[ParsingContext2["AssertEntries"] = 24] = "AssertEntries";
32138
32990
  ParsingContext2[ParsingContext2["JSDocComment"] = 25] = "JSDocComment";
32139
32991
  ParsingContext2[ParsingContext2["Count"] = 26] = "Count";
32140
32992
  })(ParsingContext || (ParsingContext = {}));
@@ -32154,7 +33006,8 @@ var Parser;
32154
33006
  /*syntaxCursor*/
32155
33007
  void 0,
32156
33008
  1 /* JS */,
32157
- 0 /* ParseAll */
33009
+ /*skipNonSemanticJSDoc*/
33010
+ false
32158
33011
  );
32159
33012
  scanner.setText(content, start, length2);
32160
33013
  currentToken = scanner.scan();
@@ -32219,7 +33072,8 @@ var Parser;
32219
33072
  /*syntaxCursor*/
32220
33073
  void 0,
32221
33074
  1 /* JS */,
32222
- 0 /* ParseAll */
33075
+ /*skipNonSemanticJSDoc*/
33076
+ false
32223
33077
  );
32224
33078
  const jsDoc = doInsideOfContext(16777216 /* JSDoc */, () => parseJSDocCommentWorker(start, length2));
32225
33079
  const sourceFile = { languageVariant: 0 /* Standard */, text: content };
@@ -33176,7 +34030,7 @@ var IncrementalParser;
33176
34030
  true,
33177
34031
  sourceFile.scriptKind,
33178
34032
  sourceFile.setExternalModuleIndicator,
33179
- sourceFile.jsDocParsingMode
34033
+ sourceFile.skipNonSemanticJSDoc
33180
34034
  );
33181
34035
  }
33182
34036
  const incrementalSourceFile = sourceFile;
@@ -33201,7 +34055,7 @@ var IncrementalParser;
33201
34055
  true,
33202
34056
  sourceFile.scriptKind,
33203
34057
  sourceFile.setExternalModuleIndicator,
33204
- sourceFile.jsDocParsingMode
34058
+ sourceFile.skipNonSemanticJSDoc
33205
34059
  );
33206
34060
  result.commentDirectives = getNewCommentDirectives(
33207
34061
  sourceFile.commentDirectives,
@@ -46358,7 +47212,7 @@ function createTypeChecker(host) {
46358
47212
  return isStringLiteralLike(moduleReferenceExpression) ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError, moduleReferenceExpression, isForAugmentation) : void 0;
46359
47213
  }
46360
47214
  function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation = false) {
46361
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
47215
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
46362
47216
  if (startsWith(moduleReference, "@types/")) {
46363
47217
  const diag2 = Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1;
46364
47218
  const withoutAtTypePrefix = removePrefix(moduleReference, "@types/");
@@ -46376,7 +47230,7 @@ function createTypeChecker(host) {
46376
47230
  const contextSpecifier = isStringLiteralLike(location) ? location : ((_a = findAncestor(location, isImportCall)) == null ? void 0 : _a.arguments[0]) || ((_b = findAncestor(location, isImportDeclaration)) == null ? void 0 : _b.moduleSpecifier) || ((_c = findAncestor(location, isExternalModuleImportEqualsDeclaration)) == null ? void 0 : _c.moduleReference.expression) || ((_d = findAncestor(location, isExportDeclaration)) == null ? void 0 : _d.moduleSpecifier) || ((_e = isModuleDeclaration(location) ? location : location.parent && isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : void 0) == null ? void 0 : _e.name) || ((_f = isLiteralImportTypeNode(location) ? location : void 0) == null ? void 0 : _f.argument.literal);
46377
47231
  const mode = contextSpecifier && isStringLiteralLike(contextSpecifier) ? getModeForUsageLocation(currentSourceFile, contextSpecifier) : currentSourceFile.impliedNodeFormat;
46378
47232
  const moduleResolutionKind = getEmitModuleResolutionKind(compilerOptions);
46379
- const resolvedModule = (_g = host.getResolvedModule(currentSourceFile, moduleReference, mode)) == null ? void 0 : _g.resolvedModule;
47233
+ const resolvedModule = (_i = (_h = (_g = host.resolvedModules) == null ? void 0 : _g.get(currentSourceFile.path)) == null ? void 0 : _h.get(moduleReference, mode)) == null ? void 0 : _i.resolvedModule;
46380
47234
  const resolutionDiagnostic = resolvedModule && getResolutionDiagnostic(compilerOptions, resolvedModule, currentSourceFile);
46381
47235
  const sourceFile = resolvedModule && (!resolutionDiagnostic || resolutionDiagnostic === Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set) && host.getSourceFile(resolvedModule.resolvedFileName);
46382
47236
  if (sourceFile) {
@@ -46384,7 +47238,7 @@ function createTypeChecker(host) {
46384
47238
  error(errorNode, resolutionDiagnostic, moduleReference, resolvedModule.resolvedFileName);
46385
47239
  }
46386
47240
  if (resolvedModule.resolvedUsingTsExtension && isDeclarationFileName(moduleReference)) {
46387
- const importOrExport = ((_h = findAncestor(location, isImportDeclaration)) == null ? void 0 : _h.importClause) || findAncestor(location, or(isImportEqualsDeclaration, isExportDeclaration));
47241
+ const importOrExport = ((_j = findAncestor(location, isImportDeclaration)) == null ? void 0 : _j.importClause) || findAncestor(location, or(isImportEqualsDeclaration, isExportDeclaration));
46388
47242
  if (importOrExport && !importOrExport.isTypeOnly || findAncestor(location, isImportCall)) {
46389
47243
  error(
46390
47244
  errorNode,
@@ -46393,7 +47247,7 @@ function createTypeChecker(host) {
46393
47247
  );
46394
47248
  }
46395
47249
  } else if (resolvedModule.resolvedUsingTsExtension && !shouldAllowImportingTsExtension(compilerOptions, currentSourceFile.fileName)) {
46396
- const importOrExport = ((_i = findAncestor(location, isImportDeclaration)) == null ? void 0 : _i.importClause) || findAncestor(location, or(isImportEqualsDeclaration, isExportDeclaration));
47250
+ const importOrExport = ((_k = findAncestor(location, isImportDeclaration)) == null ? void 0 : _k.importClause) || findAncestor(location, or(isImportEqualsDeclaration, isExportDeclaration));
46397
47251
  if (!((importOrExport == null ? void 0 : importOrExport.isTypeOnly) || findAncestor(location, isImportTypeNode))) {
46398
47252
  const tsExtension = Debug.checkDefined(tryExtractTSExtension(moduleReference));
46399
47253
  error(errorNode, Diagnostics.An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled, tsExtension);
@@ -46413,8 +47267,9 @@ function createTypeChecker(host) {
46413
47267
  }
46414
47268
  if (moduleResolutionKind === 3 /* Node16 */ || moduleResolutionKind === 99 /* NodeNext */) {
46415
47269
  const isSyncImport = currentSourceFile.impliedNodeFormat === 1 /* CommonJS */ && !findAncestor(location, isImportCall) || !!findAncestor(location, isImportEqualsDeclaration);
46416
- const overrideHost = findAncestor(location, (l) => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l));
46417
- if (isSyncImport && sourceFile.impliedNodeFormat === 99 /* ESNext */ && !hasResolutionModeOverride(overrideHost)) {
47270
+ const overrideClauseHost = findAncestor(location, (l) => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l));
47271
+ const overrideClause = overrideClauseHost && isImportTypeNode(overrideClauseHost) ? (_l = overrideClauseHost.assertions) == null ? void 0 : _l.assertClause : overrideClauseHost == null ? void 0 : overrideClauseHost.assertClause;
47272
+ if (isSyncImport && sourceFile.impliedNodeFormat === 99 /* ESNext */ && !getResolutionModeOverrideForClause(overrideClause)) {
46418
47273
  if (findAncestor(location, isImportEqualsDeclaration)) {
46419
47274
  error(errorNode, Diagnostics.Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_with_require_Use_an_ECMAScript_import_instead, moduleReference);
46420
47275
  } else {
@@ -46520,7 +47375,7 @@ function createTypeChecker(host) {
46520
47375
  error(errorNode, Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference);
46521
47376
  } else if (mode === 99 /* ESNext */ && resolutionIsNode16OrNext && isExtensionlessRelativePathImport) {
46522
47377
  const absoluteRef = getNormalizedAbsolutePath(moduleReference, getDirectoryPath(currentSourceFile.path));
46523
- const suggestedExt = (_j = suggestedExtensions.find(([actualExt, _importExt]) => host.fileExists(absoluteRef + actualExt))) == null ? void 0 : _j[1];
47378
+ const suggestedExt = (_m = suggestedExtensions.find(([actualExt, _importExt]) => host.fileExists(absoluteRef + actualExt))) == null ? void 0 : _m[1];
46524
47379
  if (suggestedExt) {
46525
47380
  error(errorNode, Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0, moduleReference + suggestedExt);
46526
47381
  } else {
@@ -48285,7 +49140,7 @@ function createTypeChecker(host) {
48285
49140
  return factory.updateImportTypeNode(
48286
49141
  root,
48287
49142
  root.argument,
48288
- root.attributes,
49143
+ root.assertions,
48289
49144
  qualifier,
48290
49145
  typeArguments,
48291
49146
  root.isTypeOf
@@ -49018,6 +49873,7 @@ function createTypeChecker(host) {
49018
49873
  return symbol.parent ? factory.createQualifiedName(symbolToEntityNameNode(symbol.parent), identifier) : identifier;
49019
49874
  }
49020
49875
  function symbolToTypeNode(symbol, context, meaning, overrideTypeArguments) {
49876
+ var _a, _b, _c, _d;
49021
49877
  const chain = lookupSymbolChain(symbol, context, meaning, !(context.flags & 16384 /* UseAliasDefinedOutsideCurrentScope */));
49022
49878
  const isTypeOf = meaning === 111551 /* Value */;
49023
49879
  if (some(chain[0].declarations, hasNonGlobalAugmentationExternalModuleSymbol)) {
@@ -49026,18 +49882,17 @@ function createTypeChecker(host) {
49026
49882
  const contextFile = getSourceFileOfNode(getOriginalNode(context.enclosingDeclaration));
49027
49883
  const targetFile = getSourceFileOfModule(chain[0]);
49028
49884
  let specifier;
49029
- let attributes;
49885
+ let assertion;
49030
49886
  if (getEmitModuleResolutionKind(compilerOptions) === 3 /* Node16 */ || getEmitModuleResolutionKind(compilerOptions) === 99 /* NodeNext */) {
49031
49887
  if ((targetFile == null ? void 0 : targetFile.impliedNodeFormat) === 99 /* ESNext */ && targetFile.impliedNodeFormat !== (contextFile == null ? void 0 : contextFile.impliedNodeFormat)) {
49032
49888
  specifier = getSpecifierForModuleSymbol(chain[0], context, 99 /* ESNext */);
49033
- attributes = factory.createImportTypeAttributes(factory.createImportAttributes(
49034
- factory.createNodeArray([
49035
- factory.createImportAttribute(
49036
- factory.createStringLiteral("resolution-mode"),
49037
- factory.createStringLiteral("import")
49038
- )
49039
- ])
49040
- ));
49889
+ assertion = factory.createImportTypeAssertionContainer(factory.createAssertClause(factory.createNodeArray([
49890
+ factory.createAssertEntry(
49891
+ factory.createStringLiteral("resolution-mode"),
49892
+ factory.createStringLiteral("import")
49893
+ )
49894
+ ])));
49895
+ (_b = (_a = context.tracker).reportImportTypeNodeResolutionModeOverride) == null ? void 0 : _b.call(_a);
49041
49896
  }
49042
49897
  }
49043
49898
  if (!specifier) {
@@ -49051,17 +49906,16 @@ function createTypeChecker(host) {
49051
49906
  if (specifier.includes("/node_modules/")) {
49052
49907
  specifier = oldSpecifier;
49053
49908
  } else {
49054
- attributes = factory.createImportTypeAttributes(factory.createImportAttributes(
49055
- factory.createNodeArray([
49056
- factory.createImportAttribute(
49057
- factory.createStringLiteral("resolution-mode"),
49058
- factory.createStringLiteral(swappedMode === 99 /* ESNext */ ? "import" : "require")
49059
- )
49060
- ])
49061
- ));
49909
+ assertion = factory.createImportTypeAssertionContainer(factory.createAssertClause(factory.createNodeArray([
49910
+ factory.createAssertEntry(
49911
+ factory.createStringLiteral("resolution-mode"),
49912
+ factory.createStringLiteral(swappedMode === 99 /* ESNext */ ? "import" : "require")
49913
+ )
49914
+ ])));
49915
+ (_d = (_c = context.tracker).reportImportTypeNodeResolutionModeOverride) == null ? void 0 : _d.call(_c);
49062
49916
  }
49063
49917
  }
49064
- if (!attributes) {
49918
+ if (!assertion) {
49065
49919
  context.encounteredError = true;
49066
49920
  if (context.tracker.reportLikelyUnsafeImportRequiredError) {
49067
49921
  context.tracker.reportLikelyUnsafeImportRequiredError(oldSpecifier);
@@ -49081,11 +49935,11 @@ function createTypeChecker(host) {
49081
49935
  void 0
49082
49936
  );
49083
49937
  }
49084
- return factory.createImportTypeNode(lit, attributes, nonRootParts, typeParameterNodes, isTypeOf);
49938
+ return factory.createImportTypeNode(lit, assertion, nonRootParts, typeParameterNodes, isTypeOf);
49085
49939
  } else {
49086
49940
  const splitNode = getTopmostIndexedAccessType(nonRootParts);
49087
49941
  const qualifier = splitNode.objectType.typeName;
49088
- return factory.createIndexedAccessTypeNode(factory.createImportTypeNode(lit, attributes, qualifier, typeParameterNodes, isTypeOf), splitNode.indexType);
49942
+ return factory.createIndexedAccessTypeNode(factory.createImportTypeNode(lit, assertion, qualifier, typeParameterNodes, isTypeOf), splitNode.indexType);
49089
49943
  }
49090
49944
  }
49091
49945
  const entityName = createAccessFromSymbolChain(chain, chain.length - 1, 0);
@@ -49561,7 +50415,7 @@ function createTypeChecker(host) {
49561
50415
  return factory.updateImportTypeNode(
49562
50416
  node,
49563
50417
  factory.updateLiteralTypeNode(node.argument, rewriteModuleSpecifier(node, node.argument.literal)),
49564
- node.attributes,
50418
+ node.assertions,
49565
50419
  node.qualifier,
49566
50420
  visitNodes2(node.typeArguments, visitExistingNodeTreeSymbols, isTypeNode),
49567
50421
  node.isTypeOf
@@ -49781,7 +50635,7 @@ function createTypeChecker(host) {
49781
50635
  return statements;
49782
50636
  }
49783
50637
  function inlineExportModifiers(statements) {
49784
- const index = findIndex(statements, (d) => isExportDeclaration(d) && !d.moduleSpecifier && !d.attributes && !!d.exportClause && isNamedExports(d.exportClause));
50638
+ const index = findIndex(statements, (d) => isExportDeclaration(d) && !d.moduleSpecifier && !d.assertClause && !!d.exportClause && isNamedExports(d.exportClause));
49785
50639
  if (index >= 0) {
49786
50640
  const exportDecl = statements[index];
49787
50641
  const replacements = mapDefined(exportDecl.exportClause.elements, (e) => {
@@ -49809,7 +50663,7 @@ function createTypeChecker(host) {
49809
50663
  replacements
49810
50664
  ),
49811
50665
  exportDecl.moduleSpecifier,
49812
- exportDecl.attributes
50666
+ exportDecl.assertClause
49813
50667
  );
49814
50668
  }
49815
50669
  }
@@ -50460,7 +51314,7 @@ function createTypeChecker(host) {
50460
51314
  )])
50461
51315
  ),
50462
51316
  factory.createStringLiteral(specifier2),
50463
- /*attributes*/
51317
+ /*assertClause*/
50464
51318
  void 0
50465
51319
  ),
50466
51320
  0 /* None */
@@ -50548,7 +51402,7 @@ function createTypeChecker(host) {
50548
51402
  void 0
50549
51403
  ),
50550
51404
  specifier2,
50551
- node.parent.attributes
51405
+ node.parent.assertClause
50552
51406
  ),
50553
51407
  0 /* None */
50554
51408
  );
@@ -50569,7 +51423,7 @@ function createTypeChecker(host) {
50569
51423
  factory.createNamespaceImport(factory.createIdentifier(localName))
50570
51424
  ),
50571
51425
  specifier2,
50572
- node.parent.attributes
51426
+ node.parent.parent.assertClause
50573
51427
  ),
50574
51428
  0 /* None */
50575
51429
  );
@@ -50610,7 +51464,7 @@ function createTypeChecker(host) {
50610
51464
  ])
50611
51465
  ),
50612
51466
  specifier2,
50613
- node.parent.parent.parent.attributes
51467
+ node.parent.parent.parent.assertClause
50614
51468
  ),
50615
51469
  0 /* None */
50616
51470
  );
@@ -53279,28 +54133,7 @@ function createTypeChecker(host) {
53279
54133
  }
53280
54134
  }
53281
54135
  }
53282
- let resolved = combineSymbolTables(earlySymbols, lateSymbols);
53283
- if (symbol.flags & 33554432 /* Transient */ && links.cjsExportMerged && symbol.declarations) {
53284
- for (const decl of symbol.declarations) {
53285
- const original = getSymbolLinks(decl.symbol)[resolutionKind];
53286
- if (!resolved) {
53287
- resolved = original;
53288
- continue;
53289
- }
53290
- if (!original)
53291
- continue;
53292
- original.forEach((s, name) => {
53293
- const existing = resolved.get(name);
53294
- if (!existing)
53295
- resolved.set(name, s);
53296
- else if (existing === s)
53297
- return;
53298
- else
53299
- resolved.set(name, mergeSymbol(existing, s));
53300
- });
53301
- }
53302
- }
53303
- links[resolutionKind] = resolved || emptySymbols;
54136
+ links[resolutionKind] = combineSymbolTables(earlySymbols, lateSymbols) || emptySymbols;
53304
54137
  }
53305
54138
  return links[resolutionKind];
53306
54139
  }
@@ -75848,16 +76681,16 @@ function createTypeChecker(host) {
75848
76681
  getTypeFromTypeNode(node);
75849
76682
  }
75850
76683
  function checkImportType(node) {
75851
- var _a, _b;
75852
76684
  checkSourceElement(node.argument);
75853
- if (node.attributes) {
75854
- const override = getResolutionModeOverride((_a = node.attributes) == null ? void 0 : _a.attributes, grammarErrorOnNode);
75855
- const errorNode = (_b = node.attributes) == null ? void 0 : _b.attributes;
75856
- if (override && errorNode && getEmitModuleResolutionKind(compilerOptions) !== 3 /* Node16 */ && getEmitModuleResolutionKind(compilerOptions) !== 99 /* NodeNext */) {
75857
- grammarErrorOnNode(
75858
- errorNode,
75859
- node.attributes.attributes.token === 118 /* WithKeyword */ ? Diagnostics.resolution_mode_attribute_are_only_supported_when_moduleResolution_is_node16_or_nodenext : Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext
75860
- );
76685
+ if (node.assertions) {
76686
+ const override = getResolutionModeOverrideForClause(node.assertions.assertClause, grammarErrorOnNode);
76687
+ if (override) {
76688
+ if (!isNightly()) {
76689
+ grammarErrorOnNode(node.assertions.assertClause, Diagnostics.resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next);
76690
+ }
76691
+ if (getEmitModuleResolutionKind(compilerOptions) !== 3 /* Node16 */ && getEmitModuleResolutionKind(compilerOptions) !== 99 /* NodeNext */) {
76692
+ grammarErrorOnNode(node.assertions.assertClause, Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext);
76693
+ }
75861
76694
  }
75862
76695
  }
75863
76696
  checkTypeReferenceOrImport(node);
@@ -79822,13 +80655,12 @@ function createTypeChecker(host) {
79822
80655
  return false;
79823
80656
  }
79824
80657
  }
79825
- if (!isImportEqualsDeclaration(node) && node.attributes) {
79826
- const diagnostic = node.attributes.token === 118 /* WithKeyword */ ? Diagnostics.Import_attribute_values_must_be_string_literal_expressions : Diagnostics.Import_assertion_values_must_be_string_literal_expressions;
80658
+ if (!isImportEqualsDeclaration(node) && node.assertClause) {
79827
80659
  let hasError = false;
79828
- for (const attr of node.attributes.elements) {
79829
- if (!isStringLiteral(attr.value)) {
80660
+ for (const clause of node.assertClause.elements) {
80661
+ if (!isStringLiteral(clause.value)) {
79830
80662
  hasError = true;
79831
- error(attr.value, diagnostic);
80663
+ error(clause.value, Diagnostics.Import_assertion_values_must_be_string_literal_expressions);
79832
80664
  }
79833
80665
  }
79834
80666
  return !hasError;
@@ -79960,35 +80792,32 @@ function createTypeChecker(host) {
79960
80792
  checkExternalEmitHelpers(node, 131072 /* ImportDefault */);
79961
80793
  }
79962
80794
  }
79963
- function checkImportAttributes(declaration) {
80795
+ function checkAssertClause(declaration) {
79964
80796
  var _a;
79965
- if (declaration.attributes && declaration.attributes.token === 132 /* AssertKeyword */) {
79966
- grammarErrorOnFirstToken(declaration.attributes, Diagnostics.The_assert_keyword_in_import_attributes_is_deprecated_and_has_been_replaced_by_the_with_keyword);
79967
- }
79968
- const node = declaration.attributes;
79969
- if (node) {
79970
- const validForTypeAttributes = isExclusivelyTypeOnlyImportOrExport(declaration);
79971
- const override = getResolutionModeOverride(node, validForTypeAttributes ? grammarErrorOnNode : void 0);
79972
- const isImportAttributes2 = declaration.attributes.token === 118 /* WithKeyword */;
79973
- if (validForTypeAttributes && override) {
80797
+ if (declaration.assertClause) {
80798
+ const validForTypeAssertions = isExclusivelyTypeOnlyImportOrExport(declaration);
80799
+ const override = getResolutionModeOverrideForClause(declaration.assertClause, validForTypeAssertions ? grammarErrorOnNode : void 0);
80800
+ if (validForTypeAssertions && override) {
80801
+ if (!isNightly()) {
80802
+ grammarErrorOnNode(declaration.assertClause, Diagnostics.resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next);
80803
+ }
79974
80804
  if (getEmitModuleResolutionKind(compilerOptions) !== 3 /* Node16 */ && getEmitModuleResolutionKind(compilerOptions) !== 99 /* NodeNext */) {
79975
- return grammarErrorOnNode(
79976
- node,
79977
- isImportAttributes2 ? Diagnostics.resolution_mode_attribute_are_only_supported_when_moduleResolution_is_node16_or_nodenext : Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext
79978
- );
80805
+ return grammarErrorOnNode(declaration.assertClause, Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext);
79979
80806
  }
79980
80807
  return;
79981
80808
  }
79982
80809
  const mode = moduleKind === 199 /* NodeNext */ && declaration.moduleSpecifier && getUsageModeForExpression(declaration.moduleSpecifier);
79983
80810
  if (mode !== 99 /* ESNext */ && moduleKind !== 99 /* ESNext */) {
79984
- const message = isImportAttributes2 ? moduleKind === 199 /* NodeNext */ ? Diagnostics.Import_attributes_are_not_allowed_on_statements_that_transpile_to_CommonJS_require_calls : Diagnostics.Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext : moduleKind === 199 /* NodeNext */ ? Diagnostics.Import_assertions_are_not_allowed_on_statements_that_transpile_to_CommonJS_require_calls : Diagnostics.Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext;
79985
- return grammarErrorOnNode(node, message);
80811
+ return grammarErrorOnNode(
80812
+ declaration.assertClause,
80813
+ moduleKind === 199 /* NodeNext */ ? Diagnostics.Import_assertions_are_not_allowed_on_statements_that_transpile_to_CommonJS_require_calls : Diagnostics.Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext
80814
+ );
79986
80815
  }
79987
80816
  if (isImportDeclaration(declaration) ? (_a = declaration.importClause) == null ? void 0 : _a.isTypeOnly : declaration.isTypeOnly) {
79988
- return grammarErrorOnNode(node, isImportAttributes2 ? Diagnostics.Import_attributes_cannot_be_used_with_type_only_imports_or_exports : Diagnostics.Import_assertions_cannot_be_used_with_type_only_imports_or_exports);
80817
+ return grammarErrorOnNode(declaration.assertClause, Diagnostics.Import_assertions_cannot_be_used_with_type_only_imports_or_exports);
79989
80818
  }
79990
80819
  if (override) {
79991
- return grammarErrorOnNode(node, Diagnostics.resolution_mode_can_only_be_set_for_type_only_imports);
80820
+ return grammarErrorOnNode(declaration.assertClause, Diagnostics.resolution_mode_can_only_be_set_for_type_only_imports);
79992
80821
  }
79993
80822
  }
79994
80823
  }
@@ -80020,7 +80849,7 @@ function createTypeChecker(host) {
80020
80849
  }
80021
80850
  }
80022
80851
  }
80023
- checkImportAttributes(node);
80852
+ checkAssertClause(node);
80024
80853
  }
80025
80854
  function checkImportEqualsDeclaration(node) {
80026
80855
  if (checkGrammarModuleElementContext(node, isInJSFile(node) ? Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module : Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)) {
@@ -80093,7 +80922,7 @@ function createTypeChecker(host) {
80093
80922
  }
80094
80923
  }
80095
80924
  }
80096
- checkImportAttributes(node);
80925
+ checkAssertClause(node);
80097
80926
  }
80098
80927
  function checkGrammarExportDeclaration(node) {
80099
80928
  var _a;
@@ -83883,12 +84712,12 @@ function createTypeChecker(host) {
83883
84712
  if (moduleKind !== 99 /* ESNext */ && moduleKind !== 199 /* NodeNext */ && moduleKind !== 100 /* Node16 */) {
83884
84713
  checkGrammarForDisallowedTrailingComma(nodeArguments);
83885
84714
  if (nodeArguments.length > 1) {
83886
- const importAttributesArgument = nodeArguments[1];
83887
- return grammarErrorOnNode(importAttributesArgument, Diagnostics.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nodenext);
84715
+ const assertionArgument = nodeArguments[1];
84716
+ return grammarErrorOnNode(assertionArgument, Diagnostics.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nodenext);
83888
84717
  }
83889
84718
  }
83890
84719
  if (nodeArguments.length === 0 || nodeArguments.length > 2) {
83891
- return grammarErrorOnNode(node, Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments);
84720
+ return grammarErrorOnNode(node, Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments);
83892
84721
  }
83893
84722
  const spreadElement = find(nodeArguments, isSpreadElement);
83894
84723
  if (spreadElement) {
@@ -84155,6 +84984,13 @@ var SymbolTrackerImpl = class _SymbolTrackerImpl {
84155
84984
  this.inner.reportNonSerializableProperty(propertyName);
84156
84985
  }
84157
84986
  }
84987
+ reportImportTypeNodeResolutionModeOverride() {
84988
+ var _a;
84989
+ if ((_a = this.inner) == null ? void 0 : _a.reportImportTypeNodeResolutionModeOverride) {
84990
+ this.onDiagnosticReported();
84991
+ this.inner.reportImportTypeNodeResolutionModeOverride();
84992
+ }
84993
+ }
84158
84994
  onDiagnosticReported() {
84159
84995
  this.context.reportedDiagnostic = true;
84160
84996
  }
@@ -84663,16 +85499,16 @@ var visitEachChildTable = {
84663
85499
  return context.factory.updateImportTypeNode(
84664
85500
  node,
84665
85501
  Debug.checkDefined(nodeVisitor(node.argument, visitor, isTypeNode)),
84666
- nodeVisitor(node.attributes, visitor, isImportTypeAttributes),
85502
+ nodeVisitor(node.assertions, visitor, isImportTypeAssertionContainer),
84667
85503
  nodeVisitor(node.qualifier, visitor, isEntityName),
84668
85504
  nodesVisitor(node.typeArguments, visitor, isTypeNode),
84669
85505
  node.isTypeOf
84670
85506
  );
84671
85507
  },
84672
- [302 /* ImportTypeAttributes */]: function visitEachChildOfImportTypeAttributes(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
84673
- return context.factory.updateImportTypeAttributes(
85508
+ [302 /* ImportTypeAssertionContainer */]: function visitEachChildOfImportTypeAssertionContainer(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
85509
+ return context.factory.updateImportTypeAssertionContainer(
84674
85510
  node,
84675
- Debug.checkDefined(nodeVisitor(node.attributes, visitor, isImportAttributes)),
85511
+ Debug.checkDefined(nodeVisitor(node.assertClause, visitor, isAssertClause)),
84676
85512
  node.multiLine
84677
85513
  );
84678
85514
  },
@@ -85214,20 +86050,20 @@ var visitEachChildTable = {
85214
86050
  nodesVisitor(node.modifiers, visitor, isModifierLike),
85215
86051
  nodeVisitor(node.importClause, visitor, isImportClause),
85216
86052
  Debug.checkDefined(nodeVisitor(node.moduleSpecifier, visitor, isExpression)),
85217
- nodeVisitor(node.attributes, visitor, isImportAttributes)
86053
+ nodeVisitor(node.assertClause, visitor, isAssertClause)
85218
86054
  );
85219
86055
  },
85220
- [300 /* ImportAttributes */]: function visitEachChildOfImportAttributes(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
85221
- return context.factory.updateImportAttributes(
86056
+ [300 /* AssertClause */]: function visitEachChildOfAssertClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
86057
+ return context.factory.updateAssertClause(
85222
86058
  node,
85223
- nodesVisitor(node.elements, visitor, isImportAttribute),
86059
+ nodesVisitor(node.elements, visitor, isAssertEntry),
85224
86060
  node.multiLine
85225
86061
  );
85226
86062
  },
85227
- [301 /* ImportAttribute */]: function visitEachChildOfImportAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
85228
- return context.factory.updateImportAttribute(
86063
+ [301 /* AssertEntry */]: function visitEachChildOfAssertEntry(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
86064
+ return context.factory.updateAssertEntry(
85229
86065
  node,
85230
- Debug.checkDefined(nodeVisitor(node.name, visitor, isImportAttributeName)),
86066
+ Debug.checkDefined(nodeVisitor(node.name, visitor, isAssertionKey)),
85231
86067
  Debug.checkDefined(nodeVisitor(node.value, visitor, isExpression))
85232
86068
  );
85233
86069
  },
@@ -85279,7 +86115,7 @@ var visitEachChildTable = {
85279
86115
  node.isTypeOnly,
85280
86116
  nodeVisitor(node.exportClause, visitor, isNamedExportBindings),
85281
86117
  nodeVisitor(node.moduleSpecifier, visitor, isExpression),
85282
- nodeVisitor(node.attributes, visitor, isImportAttributes)
86118
+ nodeVisitor(node.assertClause, visitor, isAssertClause)
85283
86119
  );
85284
86120
  },
85285
86121
  [279 /* NamedExports */]: function visitEachChildOfNamedExports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
@@ -88598,7 +89434,7 @@ function transformTypeScript(context) {
88598
89434
  void 0,
88599
89435
  importClause,
88600
89436
  node.moduleSpecifier,
88601
- node.attributes
89437
+ node.assertClause
88602
89438
  ) : void 0;
88603
89439
  }
88604
89440
  function visitImportClause(node) {
@@ -88648,7 +89484,7 @@ function transformTypeScript(context) {
88648
89484
  node.isTypeOnly,
88649
89485
  exportClause,
88650
89486
  node.moduleSpecifier,
88651
- node.attributes
89487
+ node.assertClause
88652
89488
  ) : void 0;
88653
89489
  }
88654
89490
  function visitNamedExports(node, allowEmpty) {
@@ -88682,7 +89518,7 @@ function transformTypeScript(context) {
88682
89518
  /*importClause*/
88683
89519
  void 0,
88684
89520
  node.moduleReference.expression,
88685
- /*attributes*/
89521
+ /*assertClause*/
88686
89522
  void 0
88687
89523
  ),
88688
89524
  node
@@ -96852,7 +97688,7 @@ function transformJsx(context) {
96852
97688
  factory2.createNamedImports(arrayFrom(importSpecifiersMap.values()))
96853
97689
  ),
96854
97690
  factory2.createStringLiteral(importSource),
96855
- /*attributes*/
97691
+ /*assertClause*/
96856
97692
  void 0
96857
97693
  );
96858
97694
  setParentRecursive(
@@ -106259,9 +107095,7 @@ function transformECMAScriptModule(context) {
106259
107095
  )
106260
107096
  ])
106261
107097
  ),
106262
- factory2.createStringLiteral("module"),
106263
- /*attributes*/
106264
- void 0
107098
+ factory2.createStringLiteral("module")
106265
107099
  );
106266
107100
  const requireHelperName = factory2.createUniqueName("__require", 16 /* Optimistic */ | 32 /* FileLevel */);
106267
107101
  const requireStatement = factory2.createVariableStatement(
@@ -106378,7 +107212,7 @@ function transformECMAScriptModule(context) {
106378
107212
  )
106379
107213
  ),
106380
107214
  node.moduleSpecifier,
106381
- node.attributes
107215
+ node.assertClause
106382
107216
  );
106383
107217
  setOriginalNode(importDecl, node.exportClause);
106384
107218
  const exportDecl = isExportNamespaceAsDefaultDeclaration(node) ? factory2.createExportDefault(synthName) : factory2.createExportDeclaration(
@@ -106831,7 +107665,8 @@ function transformDeclarations(context) {
106831
107665
  trackReferencedAmbientModule,
106832
107666
  trackExternalModuleSymbolOfImportTypeNode,
106833
107667
  reportNonlocalAugmentation,
106834
- reportNonSerializableProperty
107668
+ reportNonSerializableProperty,
107669
+ reportImportTypeNodeResolutionModeOverride
106835
107670
  };
106836
107671
  let errorNameNode;
106837
107672
  let errorFallbackNode;
@@ -106955,6 +107790,11 @@ function transformDeclarations(context) {
106955
107790
  context.addDiagnostic(createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized, propertyName));
106956
107791
  }
106957
107792
  }
107793
+ function reportImportTypeNodeResolutionModeOverride() {
107794
+ if (!isNightly() && (errorNameNode || errorFallbackNode)) {
107795
+ context.addDiagnostic(createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.The_type_of_this_expression_cannot_be_named_without_a_resolution_mode_assertion_which_is_an_unstable_feature_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next));
107796
+ }
107797
+ }
106958
107798
  function transformDeclarationsForJS(sourceFile, bundled) {
106959
107799
  const oldDiag = getSymbolAccessibilityDiagnostic;
106960
107800
  getSymbolAccessibilityDiagnostic = (s) => s.errorNode && canProduceDiagnostics(s.errorNode) ? createGetSymbolAccessibilityDiagnosticForNode(s.errorNode)(s) : {
@@ -107459,7 +108299,7 @@ function transformDeclarations(context) {
107459
108299
  decl.modifiers,
107460
108300
  decl.importClause,
107461
108301
  rewriteModuleSpecifier(decl, decl.moduleSpecifier),
107462
- tryGetResolutionModeOverride(decl.attributes)
108302
+ getResolutionModeOverrideForClauseInNightly(decl.assertClause)
107463
108303
  );
107464
108304
  }
107465
108305
  const visibleDefaultBinding = decl.importClause && decl.importClause.name && resolver.isDeclarationVisible(decl.importClause) ? decl.importClause.name : void 0;
@@ -107475,7 +108315,7 @@ function transformDeclarations(context) {
107475
108315
  void 0
107476
108316
  ),
107477
108317
  rewriteModuleSpecifier(decl, decl.moduleSpecifier),
107478
- tryGetResolutionModeOverride(decl.attributes)
108318
+ getResolutionModeOverrideForClauseInNightly(decl.assertClause)
107479
108319
  );
107480
108320
  }
107481
108321
  if (decl.importClause.namedBindings.kind === 274 /* NamespaceImport */) {
@@ -107493,7 +108333,7 @@ function transformDeclarations(context) {
107493
108333
  namedBindings
107494
108334
  ),
107495
108335
  rewriteModuleSpecifier(decl, decl.moduleSpecifier),
107496
- tryGetResolutionModeOverride(decl.attributes)
108336
+ getResolutionModeOverrideForClauseInNightly(decl.assertClause)
107497
108337
  ) : void 0;
107498
108338
  }
107499
108339
  const bindingList = mapDefined(decl.importClause.namedBindings.elements, (b) => resolver.isDeclarationVisible(b) ? b : void 0);
@@ -107508,7 +108348,7 @@ function transformDeclarations(context) {
107508
108348
  bindingList && bindingList.length ? factory2.updateNamedImports(decl.importClause.namedBindings, bindingList) : void 0
107509
108349
  ),
107510
108350
  rewriteModuleSpecifier(decl, decl.moduleSpecifier),
107511
- tryGetResolutionModeOverride(decl.attributes)
108351
+ getResolutionModeOverrideForClauseInNightly(decl.assertClause)
107512
108352
  );
107513
108353
  }
107514
108354
  if (resolver.isImportRequiredByAugmentation(decl)) {
@@ -107518,13 +108358,19 @@ function transformDeclarations(context) {
107518
108358
  /*importClause*/
107519
108359
  void 0,
107520
108360
  rewriteModuleSpecifier(decl, decl.moduleSpecifier),
107521
- tryGetResolutionModeOverride(decl.attributes)
108361
+ getResolutionModeOverrideForClauseInNightly(decl.assertClause)
107522
108362
  );
107523
108363
  }
107524
108364
  }
107525
- function tryGetResolutionModeOverride(node) {
107526
- const mode = getResolutionModeOverride(node);
107527
- return node && mode !== void 0 ? node : void 0;
108365
+ function getResolutionModeOverrideForClauseInNightly(assertClause) {
108366
+ const mode = getResolutionModeOverrideForClause(assertClause);
108367
+ if (mode !== void 0) {
108368
+ if (!isNightly()) {
108369
+ context.addDiagnostic(createDiagnosticForNode(assertClause, Diagnostics.resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next));
108370
+ }
108371
+ return assertClause;
108372
+ }
108373
+ return void 0;
107528
108374
  }
107529
108375
  function transformAndReplaceLatePaintedStatements(statements) {
107530
108376
  while (length(lateMarkedStatements)) {
@@ -107810,7 +108656,7 @@ function transformDeclarations(context) {
107810
108656
  return cleanup(factory2.updateImportTypeNode(
107811
108657
  input,
107812
108658
  factory2.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)),
107813
- input.attributes,
108659
+ input.assertions,
107814
108660
  input.qualifier,
107815
108661
  visitNodes2(input.typeArguments, visitDeclarationSubtree, isTypeNode),
107816
108662
  input.isTypeOf
@@ -107864,7 +108710,7 @@ function transformDeclarations(context) {
107864
108710
  input.isTypeOnly,
107865
108711
  input.exportClause,
107866
108712
  rewriteModuleSpecifier(input, input.moduleSpecifier),
107867
- tryGetResolutionModeOverride(input.attributes)
108713
+ getResolutionModeOverrideForClause(input.assertClause) ? input.assertClause : void 0
107868
108714
  );
107869
108715
  }
107870
108716
  case 277 /* ExportAssignment */: {
@@ -110357,10 +111203,10 @@ function createPrinter(printerOptions = {}, handlers = {}) {
110357
111203
  return emitNamedExports(node);
110358
111204
  case 281 /* ExportSpecifier */:
110359
111205
  return emitExportSpecifier(node);
110360
- case 300 /* ImportAttributes */:
110361
- return emitImportAttributes(node);
110362
- case 301 /* ImportAttribute */:
110363
- return emitImportAttribute(node);
111206
+ case 300 /* AssertClause */:
111207
+ return emitAssertClause(node);
111208
+ case 301 /* AssertEntry */:
111209
+ return emitAssertEntry(node);
110364
111210
  case 282 /* MissingDeclaration */:
110365
111211
  return;
110366
111212
  case 283 /* ExternalModuleReference */:
@@ -111135,16 +111981,16 @@ function createPrinter(printerOptions = {}, handlers = {}) {
111135
111981
  writeKeyword("import");
111136
111982
  writePunctuation("(");
111137
111983
  emit(node.argument);
111138
- if (node.attributes) {
111984
+ if (node.assertions) {
111139
111985
  writePunctuation(",");
111140
111986
  writeSpace();
111141
111987
  writePunctuation("{");
111142
111988
  writeSpace();
111143
- writeKeyword(node.attributes.attributes.token === 132 /* AssertKeyword */ ? "assert" : "with");
111989
+ writeKeyword("assert");
111144
111990
  writePunctuation(":");
111145
111991
  writeSpace();
111146
- const elements = node.attributes.attributes.elements;
111147
- emitList(node.attributes.attributes, elements, 526226 /* ImportAttributes */);
111992
+ const elements = node.assertions.assertClause.elements;
111993
+ emitList(node.assertions.assertClause, elements, 526226 /* ImportClauseEntries */);
111148
111994
  writeSpace();
111149
111995
  writePunctuation("}");
111150
111996
  }
@@ -112129,8 +112975,8 @@ function createPrinter(printerOptions = {}, handlers = {}) {
112129
112975
  writeSpace();
112130
112976
  }
112131
112977
  emitExpression(node.moduleSpecifier);
112132
- if (node.attributes) {
112133
- emitWithLeadingSpace(node.attributes);
112978
+ if (node.assertClause) {
112979
+ emitWithLeadingSpace(node.assertClause);
112134
112980
  }
112135
112981
  writeTrailingSemicolon();
112136
112982
  }
@@ -112199,18 +113045,18 @@ function createPrinter(printerOptions = {}, handlers = {}) {
112199
113045
  writeSpace();
112200
113046
  emitExpression(node.moduleSpecifier);
112201
113047
  }
112202
- if (node.attributes) {
112203
- emitWithLeadingSpace(node.attributes);
113048
+ if (node.assertClause) {
113049
+ emitWithLeadingSpace(node.assertClause);
112204
113050
  }
112205
113051
  writeTrailingSemicolon();
112206
113052
  }
112207
- function emitImportAttributes(node) {
112208
- emitTokenWithComment(node.token, node.pos, writeKeyword, node);
113053
+ function emitAssertClause(node) {
113054
+ emitTokenWithComment(132 /* AssertKeyword */, node.pos, writeKeyword, node);
112209
113055
  writeSpace();
112210
113056
  const elements = node.elements;
112211
- emitList(node, elements, 526226 /* ImportAttributes */);
113057
+ emitList(node, elements, 526226 /* ImportClauseEntries */);
112212
113058
  }
112213
- function emitImportAttribute(node) {
113059
+ function emitAssertEntry(node) {
112214
113060
  emit(node.name);
112215
113061
  writePunctuation(":");
112216
113062
  writeSpace();
@@ -114927,7 +115773,7 @@ function computeCommonSourceDirectoryOfFilenames(fileNames, currentDirectory, ge
114927
115773
  function createCompilerHost(options, setParentNodes) {
114928
115774
  return createCompilerHostWorker(options, setParentNodes);
114929
115775
  }
114930
- function createGetSourceFile(readFile, getCompilerOptions, setParentNodes) {
115776
+ function createGetSourceFile(readFile, getCompilerOptions, setParentNodes, skipNonSemanticJSDocParsing2) {
114931
115777
  return (fileName, languageVersionOrOptions, onError) => {
114932
115778
  let text;
114933
115779
  try {
@@ -114941,7 +115787,15 @@ function createGetSourceFile(readFile, getCompilerOptions, setParentNodes) {
114941
115787
  }
114942
115788
  text = "";
114943
115789
  }
114944
- return text !== void 0 ? createSourceFile(fileName, text, languageVersionOrOptions, setParentNodes) : void 0;
115790
+ return text !== void 0 ? createSourceFile(
115791
+ fileName,
115792
+ text,
115793
+ languageVersionOrOptions,
115794
+ setParentNodes,
115795
+ /*scriptKind*/
115796
+ void 0,
115797
+ skipNonSemanticJSDocParsing2
115798
+ ) : void 0;
114945
115799
  };
114946
115800
  }
114947
115801
  function createWriteFileMeasuringIO(actualWriteFile, createDirectory, directoryExists) {
@@ -114965,7 +115819,7 @@ function createWriteFileMeasuringIO(actualWriteFile, createDirectory, directoryE
114965
115819
  }
114966
115820
  };
114967
115821
  }
114968
- function createCompilerHostWorker(options, setParentNodes, system = sys) {
115822
+ function createCompilerHostWorker(options, setParentNodes, skipNonSemanticJSDocParsing2, system = sys) {
114969
115823
  const existingDirectories = /* @__PURE__ */ new Map();
114970
115824
  const getCanonicalFileName = createGetCanonicalFileName(system.useCaseSensitiveFileNames);
114971
115825
  function directoryExists(directoryPath) {
@@ -114984,7 +115838,7 @@ function createCompilerHostWorker(options, setParentNodes, system = sys) {
114984
115838
  const newLine = getNewLineCharacter(options);
114985
115839
  const realpath = system.realpath && ((path) => system.realpath(path));
114986
115840
  const compilerHost = {
114987
- getSourceFile: createGetSourceFile((fileName) => compilerHost.readFile(fileName), () => options, setParentNodes),
115841
+ getSourceFile: createGetSourceFile((fileName) => compilerHost.readFile(fileName), () => options, setParentNodes, skipNonSemanticJSDocParsing2),
114988
115842
  getDefaultLibLocation,
114989
115843
  getDefaultLibFileName: (options2) => combinePaths(getDefaultLibLocation(), getDefaultLibFileName(options2)),
114990
115844
  writeFile: createWriteFileMeasuringIO(
@@ -115268,14 +116122,14 @@ function getModeForUsageLocation(file, usage) {
115268
116122
  if (isImportDeclaration(usage.parent) || isExportDeclaration(usage.parent)) {
115269
116123
  const isTypeOnly = isExclusivelyTypeOnlyImportOrExport(usage.parent);
115270
116124
  if (isTypeOnly) {
115271
- const override = getResolutionModeOverride(usage.parent.attributes);
116125
+ const override = getResolutionModeOverrideForClause(usage.parent.assertClause);
115272
116126
  if (override) {
115273
116127
  return override;
115274
116128
  }
115275
116129
  }
115276
116130
  }
115277
116131
  if (usage.parent.parent && isImportTypeNode(usage.parent.parent)) {
115278
- const override = getResolutionModeOverride((_a = usage.parent.parent.attributes) == null ? void 0 : _a.attributes);
116132
+ const override = getResolutionModeOverrideForClause((_a = usage.parent.parent.assertions) == null ? void 0 : _a.assertClause);
115279
116133
  if (override) {
115280
116134
  return override;
115281
116135
  }
@@ -115286,24 +116140,18 @@ function getModeForUsageLocation(file, usage) {
115286
116140
  const exprParentParent = (_b = walkUpParenthesizedExpressions(usage.parent)) == null ? void 0 : _b.parent;
115287
116141
  return exprParentParent && isImportEqualsDeclaration(exprParentParent) ? 1 /* CommonJS */ : 99 /* ESNext */;
115288
116142
  }
115289
- function getResolutionModeOverride(node, grammarErrorOnNode) {
115290
- if (!node)
116143
+ function getResolutionModeOverrideForClause(clause, grammarErrorOnNode) {
116144
+ if (!clause)
115291
116145
  return void 0;
115292
- if (length(node.elements) !== 1) {
115293
- grammarErrorOnNode == null ? void 0 : grammarErrorOnNode(
115294
- node,
115295
- node.token === 118 /* WithKeyword */ ? Diagnostics.Type_import_attributes_should_have_exactly_one_key_resolution_mode_with_value_import_or_require : Diagnostics.Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require
115296
- );
116146
+ if (length(clause.elements) !== 1) {
116147
+ grammarErrorOnNode == null ? void 0 : grammarErrorOnNode(clause, Diagnostics.Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require);
115297
116148
  return void 0;
115298
116149
  }
115299
- const elem = node.elements[0];
116150
+ const elem = clause.elements[0];
115300
116151
  if (!isStringLiteralLike(elem.name))
115301
116152
  return void 0;
115302
116153
  if (elem.name.text !== "resolution-mode") {
115303
- grammarErrorOnNode == null ? void 0 : grammarErrorOnNode(
115304
- elem.name,
115305
- node.token === 118 /* WithKeyword */ ? Diagnostics.resolution_mode_is_the_only_valid_key_for_type_import_attributes : Diagnostics.resolution_mode_is_the_only_valid_key_for_type_import_assertions
115306
- );
116154
+ grammarErrorOnNode == null ? void 0 : grammarErrorOnNode(elem.name, Diagnostics.resolution_mode_is_the_only_valid_key_for_type_import_assertions);
115307
116155
  return void 0;
115308
116156
  }
115309
116157
  if (!isStringLiteralLike(elem.value))
@@ -115447,14 +116295,14 @@ function isReferenceFileLocation(location) {
115447
116295
  return location.pos !== void 0;
115448
116296
  }
115449
116297
  function getReferencedFileLocation(program, ref) {
115450
- var _a, _b, _c, _d;
116298
+ var _a, _b, _c, _d, _e, _f, _g, _h;
115451
116299
  const file = Debug.checkDefined(program.getSourceFileByPath(ref.file));
115452
116300
  const { kind, index } = ref;
115453
116301
  let pos, end, packageId, resolutionMode;
115454
116302
  switch (kind) {
115455
116303
  case 3 /* Import */:
115456
116304
  const importLiteral = getModuleNameStringLiteralAt(file, index);
115457
- packageId = (_b = (_a = program.getResolvedModule(file, importLiteral.text, getModeForResolutionAtIndex(file, index))) == null ? void 0 : _a.resolvedModule) == null ? void 0 : _b.packageId;
116305
+ packageId = (_d = (_c = (_b = (_a = program.resolvedModules) == null ? void 0 : _a.get(file.path)) == null ? void 0 : _b.get(importLiteral.text, getModeForResolutionAtIndex(file, index))) == null ? void 0 : _c.resolvedModule) == null ? void 0 : _d.packageId;
115458
116306
  if (importLiteral.pos === -1)
115459
116307
  return { file, packageId, text: importLiteral.text };
115460
116308
  pos = skipTrivia(file.text, importLiteral.pos);
@@ -115465,7 +116313,7 @@ function getReferencedFileLocation(program, ref) {
115465
116313
  break;
115466
116314
  case 5 /* TypeReferenceDirective */:
115467
116315
  ({ pos, end, resolutionMode } = file.typeReferenceDirectives[index]);
115468
- packageId = (_d = (_c = program.getResolvedTypeReferenceDirective(file, toFileNameLowerCase(file.typeReferenceDirectives[index].fileName), resolutionMode || file.impliedNodeFormat)) == null ? void 0 : _c.resolvedTypeReferenceDirective) == null ? void 0 : _d.packageId;
116316
+ packageId = (_h = (_g = (_f = (_e = program.resolvedTypeReferenceDirectiveNames) == null ? void 0 : _e.get(file.path)) == null ? void 0 : _f.get(toFileNameLowerCase(file.typeReferenceDirectives[index].fileName), resolutionMode || file.impliedNodeFormat)) == null ? void 0 : _g.resolvedTypeReferenceDirective) == null ? void 0 : _h.packageId;
115469
116317
  break;
115470
116318
  case 7 /* LibReferenceDirective */:
115471
116319
  ({ pos, end } = file.libReferenceDirectives[index]);
@@ -115598,7 +116446,7 @@ var plainJSErrors = /* @__PURE__ */ new Set([
115598
116446
  Diagnostics.Classes_may_not_have_a_field_named_constructor.code,
115599
116447
  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.code,
115600
116448
  Diagnostics.Duplicate_label_0.code,
115601
- Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments.code,
116449
+ Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments.code,
115602
116450
  Diagnostics.for_await_loops_cannot_be_used_inside_a_class_static_block.code,
115603
116451
  Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression.code,
115604
116452
  Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name.code,
@@ -115993,10 +116841,6 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
115993
116841
  resolvedModules,
115994
116842
  resolvedTypeReferenceDirectiveNames,
115995
116843
  resolvedLibReferences,
115996
- getResolvedModule,
115997
- getResolvedTypeReferenceDirective,
115998
- forEachResolvedModule,
115999
- forEachResolvedTypeReferenceDirective,
116000
116844
  getCurrentPackagesMap: () => packageMap,
116001
116845
  typesPackageExists,
116002
116846
  packageBundlesTypes,
@@ -116040,35 +116884,19 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
116040
116884
  measure("Program", "beforeProgram", "afterProgram");
116041
116885
  (_p = tracing) == null ? void 0 : _p.pop();
116042
116886
  return program;
116043
- function getResolvedModule(file, moduleName, mode) {
116044
- var _a2;
116045
- return (_a2 = resolvedModules == null ? void 0 : resolvedModules.get(file.path)) == null ? void 0 : _a2.get(moduleName, mode);
116046
- }
116047
- function getResolvedTypeReferenceDirective(file, typeDirectiveName, mode) {
116048
- var _a2;
116049
- return (_a2 = resolvedTypeReferenceDirectiveNames == null ? void 0 : resolvedTypeReferenceDirectiveNames.get(file.path)) == null ? void 0 : _a2.get(typeDirectiveName, mode);
116050
- }
116051
- function forEachResolvedModule(callback, file) {
116052
- forEachResolution(resolvedModules, callback, file);
116053
- }
116054
- function forEachResolvedTypeReferenceDirective(callback, file) {
116055
- forEachResolution(resolvedTypeReferenceDirectiveNames, callback, file);
116056
- }
116057
- function forEachResolution(resolutionCache, callback, file) {
116058
- var _a2;
116059
- if (file)
116060
- (_a2 = resolutionCache == null ? void 0 : resolutionCache.get(file.path)) == null ? void 0 : _a2.forEach((resolution, name, mode) => callback(resolution, name, mode, file.path));
116061
- else
116062
- resolutionCache == null ? void 0 : resolutionCache.forEach((resolutions, filePath) => resolutions.forEach((resolution, name, mode) => callback(resolution, name, mode, filePath)));
116063
- }
116064
116887
  function getPackagesMap() {
116065
116888
  if (packageMap)
116066
116889
  return packageMap;
116067
116890
  packageMap = /* @__PURE__ */ new Map();
116068
- forEachResolvedModule(({ resolvedModule }) => {
116069
- if (resolvedModule == null ? void 0 : resolvedModule.packageId)
116070
- packageMap.set(resolvedModule.packageId.name, resolvedModule.extension === ".d.ts" /* Dts */ || !!packageMap.get(resolvedModule.packageId.name));
116071
- });
116891
+ files.forEach(
116892
+ (sf) => {
116893
+ var _a2;
116894
+ return (_a2 = resolvedModules == null ? void 0 : resolvedModules.get(sf.path)) == null ? void 0 : _a2.forEach(({ resolvedModule }) => {
116895
+ if (resolvedModule == null ? void 0 : resolvedModule.packageId)
116896
+ packageMap.set(resolvedModule.packageId.name, resolvedModule.extension === ".d.ts" /* Dts */ || !!packageMap.get(resolvedModule.packageId.name));
116897
+ });
116898
+ }
116899
+ );
116072
116900
  return packageMap;
116073
116901
  }
116074
116902
  function typesPackageExists(packageName) {
@@ -116200,6 +117028,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
116200
117028
  return classifiableNames;
116201
117029
  }
116202
117030
  function resolveModuleNamesReusingOldState(moduleNames, file) {
117031
+ var _a2, _b2;
116203
117032
  if (structureIsReused === 0 /* Not */ && !file.ambientModuleNames.length) {
116204
117033
  return resolveModuleNamesWorker(
116205
117034
  moduleNames,
@@ -116217,7 +117046,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
116217
117046
  const moduleName = moduleNames[i];
116218
117047
  if (file === oldSourceFile && !hasInvalidatedResolutions(file.path)) {
116219
117048
  const mode = getModeForUsageLocation(file, moduleName);
116220
- const oldResolution = oldProgram == null ? void 0 : oldProgram.getResolvedModule(file, moduleName.text, mode);
117049
+ const oldResolution = (_b2 = (_a2 = oldProgram == null ? void 0 : oldProgram.resolvedModules) == null ? void 0 : _a2.get(file.path)) == null ? void 0 : _b2.get(moduleName.text, mode);
116221
117050
  if (oldResolution == null ? void 0 : oldResolution.resolvedModule) {
116222
117051
  if (isTraceEnabled(options, host)) {
116223
117052
  trace(
@@ -116264,8 +117093,8 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
116264
117093
  Debug.assert(j === resolutions.length);
116265
117094
  return result;
116266
117095
  function moduleNameResolvesToAmbientModuleInNonModifiedFile(moduleName) {
116267
- var _a2;
116268
- const resolutionToFile = (_a2 = oldProgram == null ? void 0 : oldProgram.getResolvedModule(file, moduleName.text, getModeForUsageLocation(file, moduleName))) == null ? void 0 : _a2.resolvedModule;
117096
+ var _a3, _b3, _c2;
117097
+ const resolutionToFile = (_c2 = (_b3 = (_a3 = oldProgram == null ? void 0 : oldProgram.resolvedModules) == null ? void 0 : _a3.get(file.path)) == null ? void 0 : _b3.get(moduleName.text, getModeForUsageLocation(file, moduleName))) == null ? void 0 : _c2.resolvedModule;
116269
117098
  const resolvedFile = resolutionToFile && oldProgram.getSourceFile(resolutionToFile.resolvedFileName);
116270
117099
  if (resolutionToFile && resolvedFile) {
116271
117100
  return false;
@@ -116281,7 +117110,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
116281
117110
  }
116282
117111
  }
116283
117112
  function resolveTypeReferenceDirectiveNamesReusingOldState(typeDirectiveNames, containingFile) {
116284
- var _a2;
117113
+ var _a2, _b2;
116285
117114
  if (structureIsReused === 0 /* Not */) {
116286
117115
  return resolveTypeReferenceDirectiveNamesWorker(
116287
117116
  typeDirectiveNames,
@@ -116301,7 +117130,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
116301
117130
  if (canReuseResolutions) {
116302
117131
  const typeDirectiveName = getTypeReferenceResolutionName(entry);
116303
117132
  const mode = getModeForFileReference(entry, containingSourceFile == null ? void 0 : containingSourceFile.impliedNodeFormat);
116304
- const oldResolution = !isString(containingFile) ? oldProgram == null ? void 0 : oldProgram.getResolvedTypeReferenceDirective(containingFile, typeDirectiveName, mode) : (_a2 = oldProgram == null ? void 0 : oldProgram.getAutomaticTypeDirectiveResolutions()) == null ? void 0 : _a2.get(typeDirectiveName, mode);
117133
+ const oldResolution = (_b2 = !isString(containingFile) ? (_a2 = oldProgram == null ? void 0 : oldProgram.resolvedTypeReferenceDirectiveNames) == null ? void 0 : _a2.get(containingFile.path) : oldProgram == null ? void 0 : oldProgram.getAutomaticTypeDirectiveResolutions()) == null ? void 0 : _b2.get(typeDirectiveName, mode);
116305
117134
  if (oldResolution == null ? void 0 : oldResolution.resolvedTypeReferenceDirective) {
116306
117135
  if (isTraceEnabled(options, host)) {
116307
117136
  trace(
@@ -116361,7 +117190,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
116361
117190
  );
116362
117191
  }
116363
117192
  function tryReuseStructureFromOldProgram() {
116364
- var _a2;
117193
+ var _a2, _b2, _c2;
116365
117194
  if (!oldProgram) {
116366
117195
  return 0 /* Not */;
116367
117196
  }
@@ -116481,29 +117310,20 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
116481
117310
  const moduleNames = getModuleNames(newSourceFile);
116482
117311
  const resolutions = resolveModuleNamesReusingOldState(moduleNames, newSourceFile);
116483
117312
  (resolvedModulesProcessing ?? (resolvedModulesProcessing = /* @__PURE__ */ new Map())).set(newSourceFile.path, resolutions);
116484
- const resolutionsChanged = hasChangesInResolutions(
116485
- moduleNames,
116486
- newSourceFile,
116487
- resolutions,
116488
- (name, mode) => oldProgram.getResolvedModule(newSourceFile, name, mode),
116489
- moduleResolutionIsEqualTo,
116490
- moduleResolutionNameAndModeGetter
116491
- );
117313
+ const oldResolutions = (_b2 = oldProgram.resolvedModules) == null ? void 0 : _b2.get(newSourceFile.path);
117314
+ const resolutionsChanged = hasChangesInResolutions(moduleNames, newSourceFile, resolutions, oldResolutions, moduleResolutionIsEqualTo, moduleResolutionNameAndModeGetter);
116492
117315
  if (resolutionsChanged)
116493
117316
  structureIsReused = 1 /* SafeModules */;
116494
117317
  const typesReferenceDirectives = newSourceFile.typeReferenceDirectives;
116495
117318
  const typeReferenceResolutions = resolveTypeReferenceDirectiveNamesReusingOldState(typesReferenceDirectives, newSourceFile);
116496
117319
  (resolvedTypeReferenceDirectiveNamesProcessing ?? (resolvedTypeReferenceDirectiveNamesProcessing = /* @__PURE__ */ new Map())).set(newSourceFile.path, typeReferenceResolutions);
116497
- const typeReferenceResolutionsChanged = hasChangesInResolutions(
116498
- typesReferenceDirectives,
116499
- newSourceFile,
116500
- typeReferenceResolutions,
116501
- (name, mode) => oldProgram == null ? void 0 : oldProgram.getResolvedTypeReferenceDirective(newSourceFile, name, mode),
116502
- typeDirectiveIsEqualTo,
116503
- typeReferenceResolutionNameAndModeGetter
116504
- );
116505
- if (typeReferenceResolutionsChanged)
117320
+ const oldTypeResolutions = (_c2 = oldProgram.resolvedTypeReferenceDirectiveNames) == null ? void 0 : _c2.get(newSourceFile.path);
117321
+ const typeReferenceResolutionsChanged = hasChangesInResolutions(typesReferenceDirectives, newSourceFile, typeReferenceResolutions, oldTypeResolutions, typeDirectiveIsEqualTo, typeReferenceResolutionNameAndModeGetter);
117322
+ if (typeReferenceResolutionsChanged) {
116506
117323
  structureIsReused = 1 /* SafeModules */;
117324
+ } else if (oldTypeResolutions) {
117325
+ (resolvedTypeReferenceDirectiveNamesProcessing ?? (resolvedTypeReferenceDirectiveNamesProcessing = /* @__PURE__ */ new Map())).set(newSourceFile.path, oldTypeResolutions);
117326
+ }
116507
117327
  }
116508
117328
  if (structureIsReused !== 2 /* Completely */) {
116509
117329
  return structureIsReused;
@@ -117132,7 +117952,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
117132
117952
  /*importClause*/
117133
117953
  void 0,
117134
117954
  externalHelpersModuleReference,
117135
- /*attributes*/
117955
+ /*assertClause*/
117136
117956
  void 0
117137
117957
  );
117138
117958
  addInternalEmitFlags(importDecl, 2 /* NeverApplyImportHelper */);
@@ -117373,7 +118193,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
117373
118193
  const result = getImpliedNodeFormatForFileWorker(getNormalizedAbsolutePath(fileName, currentDirectory), moduleResolutionCache2 == null ? void 0 : moduleResolutionCache2.getPackageJsonInfoCache(), host2, options2);
117374
118194
  const languageVersion = getEmitScriptTarget(options2);
117375
118195
  const setExternalModuleIndicator2 = getSetExternalModuleIndicator(options2);
117376
- return typeof result === "object" ? { ...result, languageVersion, setExternalModuleIndicator: setExternalModuleIndicator2, jsDocParsingMode: host2.jsDocParsingMode } : { languageVersion, impliedNodeFormat: result, setExternalModuleIndicator: setExternalModuleIndicator2, jsDocParsingMode: host2.jsDocParsingMode };
118196
+ return typeof result === "object" ? { ...result, languageVersion, setExternalModuleIndicator: setExternalModuleIndicator2 } : { languageVersion, impliedNodeFormat: result, setExternalModuleIndicator: setExternalModuleIndicator2 };
117377
118197
  }
117378
118198
  function findSourceFileWorker(fileName, isDefaultLib, ignoreNoDefaultLib, reason, packageId) {
117379
118199
  var _a2;
@@ -118650,7 +119470,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
118650
119470
  symlinks = createSymlinkCache(currentDirectory, getCanonicalFileName);
118651
119471
  }
118652
119472
  if (files && !symlinks.hasProcessedResolutions()) {
118653
- symlinks.setSymlinksFromResolutions(forEachResolvedModule, forEachResolvedTypeReferenceDirective, automaticTypeDirectiveResolutions);
119473
+ symlinks.setSymlinksFromResolutions(resolvedModules, resolvedTypeReferenceDirectiveNames, automaticTypeDirectiveResolutions);
118654
119474
  }
118655
119475
  return symlinks;
118656
119476
  }
@@ -119004,6 +119824,7 @@ var BuilderState;
119004
119824
  return toPath(program.getProjectReferenceRedirect(fileName) || fileName, sourceFileDirectory, getCanonicalFileName);
119005
119825
  }
119006
119826
  function getReferencedFiles(program, sourceFile, getCanonicalFileName) {
119827
+ var _a;
119007
119828
  let referencedFiles;
119008
119829
  if (sourceFile.imports && sourceFile.imports.length > 0) {
119009
119830
  const checker = program.getTypeChecker();
@@ -119019,14 +119840,17 @@ var BuilderState;
119019
119840
  addReferencedFile(referencedPath);
119020
119841
  }
119021
119842
  }
119022
- program.forEachResolvedTypeReferenceDirective(({ resolvedTypeReferenceDirective }) => {
119023
- if (!resolvedTypeReferenceDirective) {
119024
- return;
119025
- }
119026
- const fileName = resolvedTypeReferenceDirective.resolvedFileName;
119027
- const typeFilePath = getReferencedFileFromFileName(program, fileName, sourceFileDirectory, getCanonicalFileName);
119028
- addReferencedFile(typeFilePath);
119029
- }, sourceFile);
119843
+ const resolvedTypeReferenceDirectiveNames = (_a = program.resolvedTypeReferenceDirectiveNames) == null ? void 0 : _a.get(sourceFile.path);
119844
+ if (resolvedTypeReferenceDirectiveNames) {
119845
+ resolvedTypeReferenceDirectiveNames.forEach(({ resolvedTypeReferenceDirective }) => {
119846
+ if (!resolvedTypeReferenceDirective) {
119847
+ return;
119848
+ }
119849
+ const fileName = resolvedTypeReferenceDirective.resolvedFileName;
119850
+ const typeFilePath = getReferencedFileFromFileName(program, fileName, sourceFileDirectory, getCanonicalFileName);
119851
+ addReferencedFile(typeFilePath);
119852
+ });
119853
+ }
119030
119854
  if (sourceFile.moduleAugmentations.length) {
119031
119855
  const checker = program.getTypeChecker();
119032
119856
  for (const moduleName of sourceFile.moduleAugmentations) {
@@ -120744,47 +121568,6 @@ function getRootDirectoryOfResolutionCache(rootDirForResolution, getCurrentDirec
120744
121568
  const normalized = getNormalizedAbsolutePath(rootDirForResolution, getCurrentDirectory());
120745
121569
  return !isDiskPathRoot(normalized) ? removeTrailingDirectorySeparator(normalized) : normalized;
120746
121570
  }
120747
- function createModuleResolutionLoaderUsingGlobalCache(containingFile, redirectedReference, options, resolutionHost, moduleResolutionCache) {
120748
- return {
120749
- nameAndMode: moduleResolutionNameAndModeGetter,
120750
- resolve: (moduleName, resoluionMode) => resolveModuleNameUsingGlobalCache(
120751
- resolutionHost,
120752
- moduleResolutionCache,
120753
- moduleName,
120754
- containingFile,
120755
- options,
120756
- redirectedReference,
120757
- resoluionMode
120758
- )
120759
- };
120760
- }
120761
- function resolveModuleNameUsingGlobalCache(resolutionHost, moduleResolutionCache, moduleName, containingFile, compilerOptions, redirectedReference, mode) {
120762
- var _a;
120763
- const host = ((_a = resolutionHost.getCompilerHost) == null ? void 0 : _a.call(resolutionHost)) || resolutionHost;
120764
- const primaryResult = resolveModuleName(moduleName, containingFile, compilerOptions, host, moduleResolutionCache, redirectedReference, mode);
120765
- if (!resolutionHost.getGlobalCache) {
120766
- return primaryResult;
120767
- }
120768
- const globalCache = resolutionHost.getGlobalCache();
120769
- if (globalCache !== void 0 && !isExternalModuleNameRelative(moduleName) && !(primaryResult.resolvedModule && extensionIsTS(primaryResult.resolvedModule.extension))) {
120770
- const { resolvedModule, failedLookupLocations, affectingLocations, resolutionDiagnostics } = loadModuleFromGlobalCache(
120771
- Debug.checkDefined(resolutionHost.globalCacheResolutionModuleName)(moduleName),
120772
- resolutionHost.projectName,
120773
- compilerOptions,
120774
- host,
120775
- globalCache,
120776
- moduleResolutionCache
120777
- );
120778
- if (resolvedModule) {
120779
- primaryResult.resolvedModule = resolvedModule;
120780
- primaryResult.failedLookupLocations = updateResolutionField(primaryResult.failedLookupLocations, failedLookupLocations);
120781
- primaryResult.affectingLocations = updateResolutionField(primaryResult.affectingLocations, affectingLocations);
120782
- primaryResult.resolutionDiagnostics = updateResolutionField(primaryResult.resolutionDiagnostics, resolutionDiagnostics);
120783
- return primaryResult;
120784
- }
120785
- }
120786
- return primaryResult;
120787
- }
120788
121571
  function createResolutionCache(resolutionHost, rootDirForResolution, logChangesWhenResolvingModule) {
120789
121572
  let filesWithChangedSetOfUnresolvedImports;
120790
121573
  let filesWithInvalidatedResolutions;
@@ -120831,16 +121614,6 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
120831
121614
  const rootPathComponents = getPathComponents(rootPath);
120832
121615
  const typeRootsWatches = /* @__PURE__ */ new Map();
120833
121616
  return {
120834
- rootDirForResolution,
120835
- resolvedModuleNames,
120836
- resolvedTypeReferenceDirectives,
120837
- resolvedLibraries,
120838
- resolvedFileToResolution,
120839
- resolutionsWithFailedLookups,
120840
- resolutionsWithOnlyAffectingLocations,
120841
- directoryWatchesOfFailedLookups,
120842
- fileWatchesOfAffectingLocations,
120843
- watchFailedLookupLocationsOfExternalModuleResolutions,
120844
121617
  getModuleResolutionCache: () => moduleResolutionCache,
120845
121618
  startRecordingFilesWithChangedResolutions,
120846
121619
  finishRecordingFilesWithChangedResolutions,
@@ -120943,7 +121716,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
120943
121716
  if (!((_a = newProgram == null ? void 0 : newProgram.resolvedLibReferences) == null ? void 0 : _a.has(libFileName))) {
120944
121717
  stopWatchFailedLookupLocationOfResolution(
120945
121718
  resolution,
120946
- resolutionHost.toPath(getInferredLibraryNameResolveFrom(resolutionHost.getCompilationSettings(), getCurrentDirectory(), libFileName)),
121719
+ resolutionHost.toPath(getInferredLibraryNameResolveFrom(newProgram.getCompilerOptions(), getCurrentDirectory(), libFileName)),
120947
121720
  getResolvedModule
120948
121721
  );
120949
121722
  resolvedLibraries.delete(libFileName);
@@ -120985,22 +121758,58 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
120985
121758
  }
120986
121759
  });
120987
121760
  }
120988
- directoryWatchesOfFailedLookups.forEach(closeDirectoryWatchesOfFailedLookup);
120989
- fileWatchesOfAffectingLocations.forEach(closeFileWatcherOfAffectingLocation);
121761
+ directoryWatchesOfFailedLookups.forEach((watcher, path) => {
121762
+ if (watcher.refCount === 0) {
121763
+ directoryWatchesOfFailedLookups.delete(path);
121764
+ watcher.watcher.close();
121765
+ }
121766
+ });
121767
+ fileWatchesOfAffectingLocations.forEach((watcher, path) => {
121768
+ if (watcher.files === 0 && watcher.resolutions === 0) {
121769
+ fileWatchesOfAffectingLocations.delete(path);
121770
+ watcher.watcher.close();
121771
+ }
121772
+ });
120990
121773
  hasChangedAutomaticTypeDirectiveNames = false;
120991
121774
  }
120992
- function closeDirectoryWatchesOfFailedLookup(watcher, path) {
120993
- if (watcher.refCount === 0) {
120994
- directoryWatchesOfFailedLookups.delete(path);
120995
- watcher.watcher.close();
120996
- }
120997
- }
120998
- function closeFileWatcherOfAffectingLocation(watcher, path) {
121775
+ function resolveModuleName2(moduleName, containingFile, compilerOptions, redirectedReference, mode) {
120999
121776
  var _a;
121000
- if (watcher.files === 0 && watcher.resolutions === 0 && !((_a = watcher.symlinks) == null ? void 0 : _a.size)) {
121001
- fileWatchesOfAffectingLocations.delete(path);
121002
- watcher.watcher.close();
121777
+ const host = ((_a = resolutionHost.getCompilerHost) == null ? void 0 : _a.call(resolutionHost)) || resolutionHost;
121778
+ const primaryResult = resolveModuleName(moduleName, containingFile, compilerOptions, host, moduleResolutionCache, redirectedReference, mode);
121779
+ if (!resolutionHost.getGlobalCache) {
121780
+ return primaryResult;
121781
+ }
121782
+ const globalCache = resolutionHost.getGlobalCache();
121783
+ if (globalCache !== void 0 && !isExternalModuleNameRelative(moduleName) && !(primaryResult.resolvedModule && extensionIsTS(primaryResult.resolvedModule.extension))) {
121784
+ const { resolvedModule, failedLookupLocations, affectingLocations, resolutionDiagnostics } = loadModuleFromGlobalCache(
121785
+ Debug.checkDefined(resolutionHost.globalCacheResolutionModuleName)(moduleName),
121786
+ resolutionHost.projectName,
121787
+ compilerOptions,
121788
+ host,
121789
+ globalCache,
121790
+ moduleResolutionCache
121791
+ );
121792
+ if (resolvedModule) {
121793
+ primaryResult.resolvedModule = resolvedModule;
121794
+ primaryResult.failedLookupLocations = updateResolutionField(primaryResult.failedLookupLocations, failedLookupLocations);
121795
+ primaryResult.affectingLocations = updateResolutionField(primaryResult.affectingLocations, affectingLocations);
121796
+ primaryResult.resolutionDiagnostics = updateResolutionField(primaryResult.resolutionDiagnostics, resolutionDiagnostics);
121797
+ return primaryResult;
121798
+ }
121003
121799
  }
121800
+ return primaryResult;
121801
+ }
121802
+ function createModuleResolutionLoader2(containingFile, redirectedReference, options) {
121803
+ return {
121804
+ nameAndMode: moduleResolutionNameAndModeGetter,
121805
+ resolve: (moduleName, resoluionMode) => resolveModuleName2(
121806
+ moduleName,
121807
+ containingFile,
121808
+ options,
121809
+ redirectedReference,
121810
+ resoluionMode
121811
+ )
121812
+ };
121004
121813
  }
121005
121814
  function resolveNamesWithLocalCache({
121006
121815
  entries,
@@ -121037,11 +121846,9 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
121037
121846
  resolutionHost.onDiscoveredSymlink();
121038
121847
  }
121039
121848
  resolutionsInFile.set(name, mode, resolution);
121040
- if (resolution !== existingResolution) {
121041
- watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, path, getResolutionWithResolvedFileName, deferWatchingNonRelativeResolution);
121042
- if (existingResolution) {
121043
- stopWatchFailedLookupLocationOfResolution(existingResolution, path, getResolutionWithResolvedFileName);
121044
- }
121849
+ watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, path, getResolutionWithResolvedFileName, deferWatchingNonRelativeResolution);
121850
+ if (existingResolution) {
121851
+ stopWatchFailedLookupLocationOfResolution(existingResolution, path, getResolutionWithResolvedFileName);
121045
121852
  }
121046
121853
  if (logChanges && filesWithChangedSetOfUnresolvedImports && !resolutionIsEqualTo(existingResolution, resolution)) {
121047
121854
  filesWithChangedSetOfUnresolvedImports.push(path);
@@ -121130,12 +121937,10 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
121130
121937
  options,
121131
121938
  reusedNames,
121132
121939
  perFileCache: resolvedModuleNames,
121133
- loader: createModuleResolutionLoaderUsingGlobalCache(
121940
+ loader: createModuleResolutionLoader2(
121134
121941
  containingFile,
121135
121942
  redirectedReference,
121136
- options,
121137
- resolutionHost,
121138
- moduleResolutionCache
121943
+ options
121139
121944
  ),
121140
121945
  getResolutionWithResolvedFileName: getResolvedModule,
121141
121946
  shouldRetryResolution: (resolution) => !resolution.resolvedModule || !resolutionExtensionIsTSOrJson(resolution.resolvedModule.extension),
@@ -121189,7 +121994,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
121189
121994
  );
121190
121995
  if (resolution && !resolution.isInvalidated)
121191
121996
  return resolution;
121192
- return resolveModuleNameUsingGlobalCache(resolutionHost, moduleResolutionCache, moduleName, containingFile, resolutionHost.getCompilationSettings());
121997
+ return resolveModuleName2(moduleName, containingFile, resolutionHost.getCompilationSettings());
121193
121998
  }
121194
121999
  function isNodeModulesAtTypesDirectory(dirPath) {
121195
122000
  return endsWith(dirPath, "/node_modules/@types");
@@ -121289,63 +122094,52 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
121289
122094
  return;
121290
122095
  }
121291
122096
  let locationToWatch = affectingLocation;
121292
- let isSymlink = false;
121293
- let symlinkWatcher;
121294
122097
  if (resolutionHost.realpath) {
121295
122098
  locationToWatch = resolutionHost.realpath(affectingLocation);
121296
122099
  if (affectingLocation !== locationToWatch) {
121297
- isSymlink = true;
121298
- symlinkWatcher = fileWatchesOfAffectingLocations.get(locationToWatch);
121299
- }
121300
- }
121301
- const resolutions = forResolution ? 1 : 0;
121302
- const files = forResolution ? 0 : 1;
121303
- if (!isSymlink || !symlinkWatcher) {
121304
- const watcher = {
121305
- watcher: canWatchAffectingLocation(resolutionHost.toPath(locationToWatch)) ? resolutionHost.watchAffectingFileLocation(locationToWatch, (fileName, eventKind) => {
121306
- cachedDirectoryStructureHost == null ? void 0 : cachedDirectoryStructureHost.addOrDeleteFile(fileName, resolutionHost.toPath(locationToWatch), eventKind);
121307
- invalidateAffectingFileWatcher(locationToWatch, moduleResolutionCache.getPackageJsonInfoCache().getInternalMap());
121308
- resolutionHost.scheduleInvalidateResolutionsOfFailedLookupLocations();
121309
- }) : noopFileWatcher,
121310
- resolutions: isSymlink ? 0 : resolutions,
121311
- files: isSymlink ? 0 : files,
121312
- symlinks: void 0
121313
- };
121314
- fileWatchesOfAffectingLocations.set(locationToWatch, watcher);
121315
- if (isSymlink)
121316
- symlinkWatcher = watcher;
121317
- }
121318
- if (isSymlink) {
121319
- Debug.assert(!!symlinkWatcher);
121320
- const watcher = {
121321
- watcher: {
121322
- close: () => {
121323
- var _a;
121324
- const symlinkWatcher2 = fileWatchesOfAffectingLocations.get(locationToWatch);
121325
- if (((_a = symlinkWatcher2 == null ? void 0 : symlinkWatcher2.symlinks) == null ? void 0 : _a.delete(affectingLocation)) && !symlinkWatcher2.symlinks.size && !symlinkWatcher2.resolutions && !symlinkWatcher2.files) {
121326
- fileWatchesOfAffectingLocations.delete(locationToWatch);
121327
- symlinkWatcher2.watcher.close();
121328
- }
121329
- }
121330
- },
121331
- resolutions,
121332
- files,
121333
- symlinks: void 0
121334
- };
122100
+ const fileWatcher2 = fileWatchesOfAffectingLocations.get(locationToWatch);
122101
+ if (fileWatcher2) {
122102
+ if (forResolution)
122103
+ fileWatcher2.resolutions++;
122104
+ else
122105
+ fileWatcher2.files++;
122106
+ fileWatcher2.paths.add(affectingLocation);
122107
+ fileWatchesOfAffectingLocations.set(affectingLocation, fileWatcher2);
122108
+ return;
122109
+ }
122110
+ }
122111
+ }
122112
+ const paths = /* @__PURE__ */ new Set();
122113
+ paths.add(locationToWatch);
122114
+ let actualWatcher = canWatchAffectingLocation(resolutionHost.toPath(locationToWatch)) ? resolutionHost.watchAffectingFileLocation(locationToWatch, (fileName, eventKind) => {
122115
+ cachedDirectoryStructureHost == null ? void 0 : cachedDirectoryStructureHost.addOrDeleteFile(fileName, resolutionHost.toPath(locationToWatch), eventKind);
122116
+ const packageJsonMap = moduleResolutionCache.getPackageJsonInfoCache().getInternalMap();
122117
+ paths.forEach((path) => {
122118
+ if (watcher.resolutions)
122119
+ (affectingPathChecks ?? (affectingPathChecks = /* @__PURE__ */ new Set())).add(path);
122120
+ if (watcher.files)
122121
+ (affectingPathChecksForFile ?? (affectingPathChecksForFile = /* @__PURE__ */ new Set())).add(path);
122122
+ packageJsonMap == null ? void 0 : packageJsonMap.delete(resolutionHost.toPath(path));
122123
+ });
122124
+ resolutionHost.scheduleInvalidateResolutionsOfFailedLookupLocations();
122125
+ }) : noopFileWatcher;
122126
+ const watcher = {
122127
+ watcher: actualWatcher !== noopFileWatcher ? {
122128
+ close: () => {
122129
+ actualWatcher.close();
122130
+ actualWatcher = noopFileWatcher;
122131
+ }
122132
+ } : actualWatcher,
122133
+ resolutions: forResolution ? 1 : 0,
122134
+ files: forResolution ? 0 : 1,
122135
+ paths
122136
+ };
122137
+ fileWatchesOfAffectingLocations.set(locationToWatch, watcher);
122138
+ if (affectingLocation !== locationToWatch) {
121335
122139
  fileWatchesOfAffectingLocations.set(affectingLocation, watcher);
121336
- (symlinkWatcher.symlinks ?? (symlinkWatcher.symlinks = /* @__PURE__ */ new Set())).add(affectingLocation);
122140
+ paths.add(affectingLocation);
121337
122141
  }
121338
122142
  }
121339
- function invalidateAffectingFileWatcher(path, packageJsonMap) {
121340
- var _a;
121341
- const watcher = fileWatchesOfAffectingLocations.get(path);
121342
- if (watcher == null ? void 0 : watcher.resolutions)
121343
- (affectingPathChecks ?? (affectingPathChecks = /* @__PURE__ */ new Set())).add(path);
121344
- if (watcher == null ? void 0 : watcher.files)
121345
- (affectingPathChecksForFile ?? (affectingPathChecksForFile = /* @__PURE__ */ new Set())).add(path);
121346
- (_a = watcher == null ? void 0 : watcher.symlinks) == null ? void 0 : _a.forEach((path2) => invalidateAffectingFileWatcher(path2, packageJsonMap));
121347
- packageJsonMap == null ? void 0 : packageJsonMap.delete(resolutionHost.toPath(path));
121348
- }
121349
122143
  function watchFailedLookupLocationOfNonRelativeModuleResolutions(resolutions, name) {
121350
122144
  const program = resolutionHost.getCurrentProgram();
121351
122145
  if (!program || !program.getTypeChecker().tryFindAmbientModuleWithoutAugmentations(name)) {
@@ -121367,7 +122161,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
121367
122161
  directoryWatchesOfFailedLookups.set(dirPath, { watcher: createDirectoryWatcher(dir, dirPath, nonRecursive), refCount: 1, nonRecursive });
121368
122162
  }
121369
122163
  }
121370
- function stopWatchFailedLookupLocation(failedLookupLocation, removeAtRoot, syncDirWatcherRemove) {
122164
+ function stopWatchFailedLookupLocation(failedLookupLocation, removeAtRoot) {
121371
122165
  const failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation);
121372
122166
  const toWatch = getDirectoryToWatchFailedLookupLocation(
121373
122167
  failedLookupLocation,
@@ -121382,12 +122176,12 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
121382
122176
  if (dirPath === rootPath) {
121383
122177
  removeAtRoot = true;
121384
122178
  } else {
121385
- removeDirectoryWatcher(dirPath, syncDirWatcherRemove);
122179
+ removeDirectoryWatcher(dirPath);
121386
122180
  }
121387
122181
  }
121388
122182
  return removeAtRoot;
121389
122183
  }
121390
- function stopWatchFailedLookupLocationOfResolution(resolution, filePath, getResolutionWithResolvedFileName, syncDirWatcherRemove) {
122184
+ function stopWatchFailedLookupLocationOfResolution(resolution, filePath, getResolutionWithResolvedFileName) {
121391
122185
  Debug.checkDefined(resolution.files).delete(filePath);
121392
122186
  resolution.refCount--;
121393
122187
  if (resolution.refCount) {
@@ -121405,13 +122199,13 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
121405
122199
  let removeAtRoot = false;
121406
122200
  if (failedLookupLocations) {
121407
122201
  for (const failedLookupLocation of failedLookupLocations) {
121408
- removeAtRoot = stopWatchFailedLookupLocation(failedLookupLocation, removeAtRoot, syncDirWatcherRemove);
122202
+ removeAtRoot = stopWatchFailedLookupLocation(failedLookupLocation, removeAtRoot);
121409
122203
  }
121410
122204
  }
121411
122205
  if (node10Result)
121412
- removeAtRoot = stopWatchFailedLookupLocation(node10Result, removeAtRoot, syncDirWatcherRemove);
122206
+ removeAtRoot = stopWatchFailedLookupLocation(node10Result, removeAtRoot);
121413
122207
  if (removeAtRoot)
121414
- removeDirectoryWatcher(rootPath, syncDirWatcherRemove);
122208
+ removeDirectoryWatcher(rootPath);
121415
122209
  } else if (affectingLocations == null ? void 0 : affectingLocations.length) {
121416
122210
  resolutionsWithOnlyAffectingLocations.delete(resolution);
121417
122211
  }
@@ -121419,16 +122213,12 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
121419
122213
  for (const affectingLocation of affectingLocations) {
121420
122214
  const watcher = fileWatchesOfAffectingLocations.get(affectingLocation);
121421
122215
  watcher.resolutions--;
121422
- if (syncDirWatcherRemove)
121423
- closeFileWatcherOfAffectingLocation(watcher, affectingLocation);
121424
122216
  }
121425
122217
  }
121426
122218
  }
121427
- function removeDirectoryWatcher(dirPath, syncDirWatcherRemove) {
122219
+ function removeDirectoryWatcher(dirPath) {
121428
122220
  const dirWatcher = directoryWatchesOfFailedLookups.get(dirPath);
121429
122221
  dirWatcher.refCount--;
121430
- if (syncDirWatcherRemove)
121431
- closeDirectoryWatchesOfFailedLookup(dirWatcher, dirPath);
121432
122222
  }
121433
122223
  function createDirectoryWatcher(directory, dirPath, nonRecursive) {
121434
122224
  return resolutionHost.watchDirectoryOfFailedLookupLocation(directory, (fileOrDirectory) => {
@@ -121439,17 +122229,10 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
121439
122229
  scheduleInvalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, dirPath === fileOrDirectoryPath);
121440
122230
  }, nonRecursive ? 0 /* None */ : 1 /* Recursive */);
121441
122231
  }
121442
- function removeResolutionsOfFileFromCache(cache, filePath, getResolutionWithResolvedFileName, syncDirWatcherRemove) {
122232
+ function removeResolutionsOfFileFromCache(cache, filePath, getResolutionWithResolvedFileName) {
121443
122233
  const resolutions = cache.get(filePath);
121444
122234
  if (resolutions) {
121445
- resolutions.forEach(
121446
- (resolution) => stopWatchFailedLookupLocationOfResolution(
121447
- resolution,
121448
- filePath,
121449
- getResolutionWithResolvedFileName,
121450
- syncDirWatcherRemove
121451
- )
121452
- );
122235
+ resolutions.forEach((resolution) => stopWatchFailedLookupLocationOfResolution(resolution, filePath, getResolutionWithResolvedFileName));
121453
122236
  cache.delete(filePath);
121454
122237
  }
121455
122238
  }
@@ -121464,9 +122247,9 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
121464
122247
  return;
121465
122248
  resolvedProjectReference.commandLine.fileNames.forEach((f) => removeResolutionsOfFile(resolutionHost.toPath(f)));
121466
122249
  }
121467
- function removeResolutionsOfFile(filePath, syncDirWatcherRemove) {
121468
- removeResolutionsOfFileFromCache(resolvedModuleNames, filePath, getResolvedModule, syncDirWatcherRemove);
121469
- removeResolutionsOfFileFromCache(resolvedTypeReferenceDirectives, filePath, getResolvedTypeReferenceDirective, syncDirWatcherRemove);
122250
+ function removeResolutionsOfFile(filePath) {
122251
+ removeResolutionsOfFileFromCache(resolvedModuleNames, filePath, getResolvedModule);
122252
+ removeResolutionsOfFileFromCache(resolvedTypeReferenceDirectives, filePath, getResolvedTypeReferenceDirective);
121470
122253
  }
121471
122254
  function invalidateResolutions(resolutions, canInvalidate) {
121472
122255
  if (!resolutions)
@@ -122120,7 +122903,8 @@ function createCompilerHostFromProgramHost(host, getCompilerOptions, directorySt
122120
122903
  (fileName, encoding) => !encoding ? compilerHost.readFile(fileName) : host.readFile(fileName, encoding),
122121
122904
  getCompilerOptions,
122122
122905
  /*setParentNodes*/
122123
- void 0
122906
+ void 0,
122907
+ host.skipNonSemanticJSDocParsing
122124
122908
  ),
122125
122909
  getDefaultLibLocation: maybeBind(host, host.getDefaultLibLocation),
122126
122910
  getDefaultLibFileName: (options) => host.getDefaultLibFileName(options),
@@ -122142,8 +122926,7 @@ function createCompilerHostFromProgramHost(host, getCompilerOptions, directorySt
122142
122926
  getEnvironmentVariable: maybeBind(host, host.getEnvironmentVariable) || (() => ""),
122143
122927
  createHash: maybeBind(host, host.createHash),
122144
122928
  readDirectory: maybeBind(host, host.readDirectory),
122145
- storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit,
122146
- jsDocParsingMode: host.jsDocParsingMode
122929
+ storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit
122147
122930
  };
122148
122931
  return compilerHost;
122149
122932
  }
@@ -122307,11 +123090,12 @@ function readBuilderProgram(compilerOptions, host) {
122307
123090
  return void 0;
122308
123091
  return createBuilderProgramUsingProgramBuildInfo(buildInfo, buildInfoPath, host);
122309
123092
  }
122310
- function createIncrementalCompilerHost(options, system = sys) {
123093
+ function createIncrementalCompilerHost(options, system = sys, skipNonSemanticJSDocParsing2) {
122311
123094
  const host = createCompilerHostWorker(
122312
123095
  options,
122313
123096
  /*setParentNodes*/
122314
123097
  void 0,
123098
+ skipNonSemanticJSDocParsing2,
122315
123099
  system
122316
123100
  );
122317
123101
  host.createHash = maybeBind(system, system.createHash);
@@ -122428,7 +123212,7 @@ function createWatchProgram(host) {
122428
123212
  watchConfigFileWildCardDirectories();
122429
123213
  if (configFileName)
122430
123214
  updateExtendedConfigFilesWatches(toPath3(configFileName), compilerOptions, watchOptions, WatchType.ExtendedConfigFile);
122431
- return configFileName ? { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, close, getResolutionCache } : { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, updateRootFileNames, close, getResolutionCache };
123215
+ return configFileName ? { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, close } : { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, updateRootFileNames, close };
122432
123216
  function close() {
122433
123217
  clearInvalidateResolutionsOfFailedLookupLocations();
122434
123218
  resolutionCache.clear();
@@ -122468,9 +123252,6 @@ function createWatchProgram(host) {
122468
123252
  parsedConfigs = void 0;
122469
123253
  }
122470
123254
  }
122471
- function getResolutionCache() {
122472
- return resolutionCache;
122473
- }
122474
123255
  function getCurrentBuilderProgram() {
122475
123256
  return builderProgram;
122476
123257
  }
@@ -125644,7 +126425,7 @@ function reportWatchModeWithoutSysSupport(sys2, reportDiagnostic) {
125644
126425
  }
125645
126426
  return false;
125646
126427
  }
125647
- var defaultJSDocParsingMode = 2 /* ParseForTypeErrors */;
126428
+ var skipNonSemanticJSDocParsing = true;
125648
126429
  function performBuild(sys2, cb, buildOptions, watchOptions, projects, errors) {
125649
126430
  const reportDiagnostic = updateReportDiagnostic(
125650
126431
  sys2,
@@ -125683,7 +126464,7 @@ function performBuild(sys2, cb, buildOptions, watchOptions, projects, errors) {
125683
126464
  createBuilderStatusReporter(sys2, shouldBePretty(sys2, buildOptions)),
125684
126465
  createWatchStatusReporter2(sys2, buildOptions)
125685
126466
  );
125686
- buildHost2.jsDocParsingMode = defaultJSDocParsingMode;
126467
+ buildHost2.skipNonSemanticJSDocParsing = skipNonSemanticJSDocParsing;
125687
126468
  const solutionPerformance2 = enableSolutionPerformance(sys2, buildOptions);
125688
126469
  updateSolutionBuilderHost(sys2, cb, buildHost2, solutionPerformance2);
125689
126470
  const onWatchStatusChange = buildHost2.onWatchStatusChange;
@@ -125708,7 +126489,7 @@ function performBuild(sys2, cb, buildOptions, watchOptions, projects, errors) {
125708
126489
  createBuilderStatusReporter(sys2, shouldBePretty(sys2, buildOptions)),
125709
126490
  createReportErrorSummary(sys2, buildOptions)
125710
126491
  );
125711
- buildHost.jsDocParsingMode = defaultJSDocParsingMode;
126492
+ buildHost.skipNonSemanticJSDocParsing = skipNonSemanticJSDocParsing;
125712
126493
  const solutionPerformance = enableSolutionPerformance(sys2, buildOptions);
125713
126494
  updateSolutionBuilderHost(sys2, cb, buildHost, solutionPerformance);
125714
126495
  const builder = createSolutionBuilder(buildHost, projects, buildOptions);
@@ -125726,9 +126507,9 @@ function performCompilation(sys2, cb, reportDiagnostic, config) {
125726
126507
  options,
125727
126508
  /*setParentNodes*/
125728
126509
  void 0,
126510
+ skipNonSemanticJSDocParsing,
125729
126511
  sys2
125730
126512
  );
125731
- host.jsDocParsingMode = defaultJSDocParsingMode;
125732
126513
  const currentDirectory = host.getCurrentDirectory();
125733
126514
  const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames());
125734
126515
  changeCompilerHostLikeToUseCache(host, (fileName) => toPath(fileName, currentDirectory, getCanonicalFileName));
@@ -125769,8 +126550,7 @@ function performIncrementalCompilation2(sys2, cb, reportDiagnostic, config) {
125769
126550
  /*isBuildMode*/
125770
126551
  false
125771
126552
  );
125772
- const host = createIncrementalCompilerHost(options, sys2);
125773
- host.jsDocParsingMode = defaultJSDocParsingMode;
126553
+ const host = createIncrementalCompilerHost(options, sys2, skipNonSemanticJSDocParsing);
125774
126554
  const exitStatus = performIncrementalCompilation({
125775
126555
  host,
125776
126556
  system: sys2,
@@ -125825,7 +126605,7 @@ function updateCreateProgram(sys2, host, isBuildMode) {
125825
126605
  };
125826
126606
  }
125827
126607
  function updateWatchCompilationHost(sys2, cb, watchCompilerHost) {
125828
- watchCompilerHost.jsDocParsingMode = defaultJSDocParsingMode;
126608
+ watchCompilerHost.skipNonSemanticJSDocParsing = skipNonSemanticJSDocParsing;
125829
126609
  updateCreateProgram(
125830
126610
  sys2,
125831
126611
  watchCompilerHost,