xml-model 1.2.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/README.md +0 -1
  2. package/dist/_virtual/Reflect.js +8 -0
  3. package/dist/_virtual/Reflect2.js +5 -0
  4. package/{vite/dist → dist}/_virtual/_commonjsHelpers.js +10 -4
  5. package/dist/defaults.d.ts +1 -0
  6. package/dist/errors.d.ts +1 -0
  7. package/dist/index.d.ts +1 -0
  8. package/dist/middleware.d.ts +1 -0
  9. package/dist/model/built-ins.d.ts +1 -0
  10. package/dist/model/index.d.ts +1 -0
  11. package/dist/model/index.js +1 -0
  12. package/dist/model/property.d.ts +1 -0
  13. package/dist/model/registry.d.ts +1 -0
  14. package/dist/model/types.d.ts +1 -0
  15. package/dist/node_modules/reflect-metadata/Reflect.js +867 -0
  16. package/dist/types.d.ts +1 -0
  17. package/dist/util/is-regexp.d.ts +1 -0
  18. package/dist/util/kebab-case.d.ts +1 -0
  19. package/dist/util/merge-maps.d.ts +1 -0
  20. package/dist/xml/index.d.ts +1 -0
  21. package/dist/xml/xml-js.d.ts +1 -0
  22. package/package.json +4 -4
  23. package/vite/dist/index.js +2 -3
  24. package/vite/dist/node_modules/typescript-rtti/dist.esm/common/format.js +105 -0
  25. package/vite/dist/node_modules/typescript-rtti/dist.esm/common/index.js +55 -0
  26. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/api-call-transformer.js +152 -0
  27. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/common/class-analyzer.js +83 -0
  28. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/common/compile-error.js +8 -0
  29. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/common/import-analyzer.js +89 -0
  30. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/common/interface-analyzer.js +58 -0
  31. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/common/visitor-base.js +93 -0
  32. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/declarations-emitter.js +31 -0
  33. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/encode-parameter.js +64 -0
  34. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/find-relative-path.js +41 -0
  35. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/flags.js +43 -0
  36. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/forward-ref.js +20 -0
  37. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/get-exports-for-symbol.js +64 -0
  38. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/index.js +130 -0
  39. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/legacy-decorator.js +10 -0
  40. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/legacy-type-encoder.js +82 -0
  41. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/literal-node.js +9 -0
  42. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/metadata-collector.js +56 -0
  43. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/metadata-decorator.js +80 -0
  44. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/metadata-emitter.js +425 -0
  45. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/metadata-encoder.js +212 -0
  46. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/rt-helper.js +96 -0
  47. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/rtti-visitor-base.js +28 -0
  48. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/serialize.js +31 -0
  49. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/type-encoder.js +76 -0
  50. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/type-literal.js +499 -0
  51. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/utils.js +906 -0
  52. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/workarounds.js +7 -0
  53. package/vite/dist/src/class-names.test.d.ts +9 -0
  54. package/vite/dist/src/defaults.d.ts +15 -0
  55. package/vite/dist/src/errors.d.ts +24 -0
  56. package/vite/dist/src/index.d.ts +8 -0
  57. package/vite/dist/src/middleware.d.ts +10 -0
  58. package/vite/dist/src/model/built-ins.d.ts +3 -0
  59. package/vite/dist/src/model/index.d.ts +21 -0
  60. package/vite/dist/src/model/property.d.ts +6 -0
  61. package/vite/dist/src/model/registry.d.ts +9 -0
  62. package/vite/dist/src/model/types.d.ts +74 -0
  63. package/vite/dist/src/model.test.d.ts +2 -0
  64. package/vite/dist/src/types.d.ts +17 -0
  65. package/vite/dist/src/util/is-regexp.d.ts +12 -0
  66. package/vite/dist/src/util/kebab-case.d.ts +16 -0
  67. package/vite/dist/src/util/merge-maps.d.ts +2 -0
  68. package/vite/dist/src/xml/index.d.ts +33 -0
  69. package/vite/dist/src/xml/xml-js.d.ts +7 -0
  70. package/vite/dist/_virtual/_commonjs-dynamic-modules.js +0 -7
  71. package/vite/dist/_virtual/_typescript.js +0 -5
  72. package/vite/dist/_virtual/api-call-transformer.js +0 -5
  73. package/vite/dist/_virtual/class-analyzer.js +0 -5
  74. package/vite/dist/_virtual/compile-error.js +0 -5
  75. package/vite/dist/_virtual/declarations-emitter.js +0 -5
  76. package/vite/dist/_virtual/encode-parameter.js +0 -5
  77. package/vite/dist/_virtual/find-relative-path.js +0 -5
  78. package/vite/dist/_virtual/flags.js +0 -5
  79. package/vite/dist/_virtual/format.js +0 -5
  80. package/vite/dist/_virtual/forward-ref.js +0 -5
  81. package/vite/dist/_virtual/get-exports-for-symbol.js +0 -5
  82. package/vite/dist/_virtual/import-analyzer.js +0 -5
  83. package/vite/dist/_virtual/index.js +0 -8
  84. package/vite/dist/_virtual/index2.js +0 -5
  85. package/vite/dist/_virtual/index3.js +0 -5
  86. package/vite/dist/_virtual/interface-analyzer.js +0 -5
  87. package/vite/dist/_virtual/legacy-decorator.js +0 -5
  88. package/vite/dist/_virtual/legacy-type-encoder.js +0 -5
  89. package/vite/dist/_virtual/literal-node.js +0 -5
  90. package/vite/dist/_virtual/metadata-collector.js +0 -5
  91. package/vite/dist/_virtual/metadata-decorator.js +0 -5
  92. package/vite/dist/_virtual/metadata-emitter.js +0 -5
  93. package/vite/dist/_virtual/metadata-encoder.js +0 -5
  94. package/vite/dist/_virtual/rt-helper.js +0 -5
  95. package/vite/dist/_virtual/rtti-visitor-base.js +0 -5
  96. package/vite/dist/_virtual/serialize.js +0 -5
  97. package/vite/dist/_virtual/type-encoder.js +0 -5
  98. package/vite/dist/_virtual/type-literal.js +0 -5
  99. package/vite/dist/_virtual/utils.js +0 -5
  100. package/vite/dist/_virtual/visitor-base.js +0 -5
  101. package/vite/dist/_virtual/workarounds.js +0 -5
  102. package/vite/dist/index.d.ts +0 -28
  103. package/vite/dist/node_modules/typescript-rtti/dist/common/format.js +0 -69
  104. package/vite/dist/node_modules/typescript-rtti/dist/common/index.js +0 -34
  105. package/vite/dist/node_modules/typescript-rtti/dist/transformer/api-call-transformer.js +0 -197
  106. package/vite/dist/node_modules/typescript-rtti/dist/transformer/common/class-analyzer.js +0 -124
  107. package/vite/dist/node_modules/typescript-rtti/dist/transformer/common/compile-error.js +0 -18
  108. package/vite/dist/node_modules/typescript-rtti/dist/transformer/common/import-analyzer.js +0 -130
  109. package/vite/dist/node_modules/typescript-rtti/dist/transformer/common/interface-analyzer.js +0 -98
  110. package/vite/dist/node_modules/typescript-rtti/dist/transformer/common/visitor-base.js +0 -132
  111. package/vite/dist/node_modules/typescript-rtti/dist/transformer/declarations-emitter.js +0 -72
  112. package/vite/dist/node_modules/typescript-rtti/dist/transformer/encode-parameter.js +0 -110
  113. package/vite/dist/node_modules/typescript-rtti/dist/transformer/find-relative-path.js +0 -51
  114. package/vite/dist/node_modules/typescript-rtti/dist/transformer/flags.js +0 -59
  115. package/vite/dist/node_modules/typescript-rtti/dist/transformer/forward-ref.js +0 -35
  116. package/vite/dist/node_modules/typescript-rtti/dist/transformer/get-exports-for-symbol.js +0 -75
  117. package/vite/dist/node_modules/typescript-rtti/dist/transformer/index.js +0 -174
  118. package/vite/dist/node_modules/typescript-rtti/dist/transformer/legacy-decorator.js +0 -20
  119. package/vite/dist/node_modules/typescript-rtti/dist/transformer/legacy-type-encoder.js +0 -123
  120. package/vite/dist/node_modules/typescript-rtti/dist/transformer/literal-node.js +0 -19
  121. package/vite/dist/node_modules/typescript-rtti/dist/transformer/metadata-collector.js +0 -96
  122. package/vite/dist/node_modules/typescript-rtti/dist/transformer/metadata-decorator.js +0 -99
  123. package/vite/dist/node_modules/typescript-rtti/dist/transformer/metadata-emitter.js +0 -475
  124. package/vite/dist/node_modules/typescript-rtti/dist/transformer/metadata-encoder.js +0 -261
  125. package/vite/dist/node_modules/typescript-rtti/dist/transformer/rt-helper.js +0 -113
  126. package/vite/dist/node_modules/typescript-rtti/dist/transformer/rtti-visitor-base.js +0 -39
  127. package/vite/dist/node_modules/typescript-rtti/dist/transformer/serialize.js +0 -46
  128. package/vite/dist/node_modules/typescript-rtti/dist/transformer/type-encoder.js +0 -96
  129. package/vite/dist/node_modules/typescript-rtti/dist/transformer/type-literal.js +0 -546
  130. package/vite/dist/node_modules/typescript-rtti/dist/transformer/utils.js +0 -922
  131. package/vite/dist/node_modules/typescript-rtti/dist/transformer/workarounds.js +0 -16
@@ -0,0 +1,906 @@
1
+ import ts from "typescript";
2
+ import { createRequire } from "node:module";
3
+ const require$1 = createRequire(import.meta.url);
4
+ function assert(check) {
5
+ if (!check())
6
+ throw new Error(`Assertion failed: ${check.toString().replace(/.*?=> */, "")}`);
7
+ }
8
+ function isInterfaceType(type) {
9
+ return type.isClassOrInterface() && !type.isClass();
10
+ }
11
+ function getRootNameOfQualifiedName(qualifiedName) {
12
+ if (ts.isQualifiedName(qualifiedName.left))
13
+ return getRootNameOfQualifiedName(qualifiedName.left);
14
+ else if (ts.isIdentifier(qualifiedName.left))
15
+ return qualifiedName.left.text;
16
+ }
17
+ function getRootNameOfEntityName(entityName) {
18
+ if (ts.isQualifiedName(entityName)) {
19
+ return getRootNameOfQualifiedName(entityName);
20
+ } else if (ts.isIdentifier(entityName)) {
21
+ return entityName.text;
22
+ }
23
+ }
24
+ function hasFlag(flags, flag) {
25
+ return (flags & flag) !== 0;
26
+ }
27
+ function hasAnyFlag(flags, possibleFlags) {
28
+ return possibleFlags.some((x) => hasFlag(flags, x));
29
+ }
30
+ function isFlagType(type, flag) {
31
+ return hasFlag(type.flags, flag);
32
+ }
33
+ function cloneQualifiedName(qualifiedName, rootName) {
34
+ let left;
35
+ if (ts.isIdentifier(qualifiedName.left)) {
36
+ left = ts.factory.createIdentifier(rootName);
37
+ } else {
38
+ left = cloneEntityNameAsExpr(qualifiedName.left, rootName);
39
+ }
40
+ return ts.factory.createPropertyAccessExpression(left, cloneEntityNameAsExpr(qualifiedName.right));
41
+ }
42
+ function cloneEntityNameAsExpr(entityName, rootName) {
43
+ if (ts.isQualifiedName(entityName))
44
+ return cloneQualifiedName(entityName, rootName);
45
+ else if (ts.isIdentifier(entityName))
46
+ return ts.factory.createIdentifier(entityName.text);
47
+ }
48
+ function qualifiedNameToString(qualifiedName) {
49
+ return ts.isIdentifier(qualifiedName.left) ? qualifiedName.left.text + "." + qualifiedName.right.text : entityNameToString(qualifiedName.left) + "." + qualifiedName.right.text;
50
+ }
51
+ function entityNameToString(entityName) {
52
+ if (ts.isQualifiedName(entityName))
53
+ return qualifiedNameToString(entityName);
54
+ else if (ts.isIdentifier(entityName))
55
+ return entityName.text;
56
+ }
57
+ function createCheckedValue(left, right) {
58
+ return ts.factory.createLogicalAnd(ts.factory.createStrictInequality(ts.factory.createTypeOfExpression(left), ts.factory.createStringLiteral("undefined")), right);
59
+ }
60
+ function setParent(child, parent) {
61
+ if (child && parent) {
62
+ child.parent = parent;
63
+ }
64
+ return child;
65
+ }
66
+ function serializeEntityNameAsExpressionFallback(node, context, currentLexicalScope) {
67
+ if (node.kind === ts.SyntaxKind.Identifier) {
68
+ const copied = serializeEntityNameAsExpression(node, currentLexicalScope);
69
+ return createCheckedValue(copied, copied);
70
+ }
71
+ if (node.left.kind === ts.SyntaxKind.Identifier) {
72
+ return createCheckedValue(serializeEntityNameAsExpression(node.left, currentLexicalScope), serializeEntityNameAsExpression(node, currentLexicalScope));
73
+ }
74
+ const left = serializeEntityNameAsExpressionFallback(node.left, context, currentLexicalScope);
75
+ const temp = ts.factory.createTempVariable(context.hoistVariableDeclaration);
76
+ return ts.factory.createLogicalAnd(ts.factory.createLogicalAnd(left.left, ts.factory.createStrictInequality(ts.factory.createAssignment(temp, left.right), ts.factory.createVoidZero())), ts.factory.createPropertyAccessExpression(temp, node.right));
77
+ }
78
+ function serializeEntityNameAsExpression(node, currentLexicalScope) {
79
+ switch (node.kind) {
80
+ case ts.SyntaxKind.Identifier:
81
+ const name = setParent(ts.setTextRange(ts.factory["cloneNode"](node), node), node.parent);
82
+ name["original"] = void 0;
83
+ setParent(name, ts.getParseTreeNode(currentLexicalScope));
84
+ return name;
85
+ case ts.SyntaxKind.QualifiedName:
86
+ return serializeQualifiedNameAsExpression(node, currentLexicalScope);
87
+ }
88
+ }
89
+ function serializeQualifiedNameAsExpression(node, currentLexicalScope) {
90
+ return ts.factory.createPropertyAccessExpression(serializeEntityNameAsExpression(node.left, currentLexicalScope), node.right);
91
+ }
92
+ function dottedNameToExpr(dottedName) {
93
+ return dottedName.split(".").map((ident) => ts.factory.createIdentifier(ident)).reduce((pv, cv) => pv ? ts.factory.createPropertyAccessExpression(pv, cv) : cv);
94
+ }
95
+ function replacePropertyRoot(propertyExpr, newRootExpr) {
96
+ if (ts.isPropertyAccessExpression(propertyExpr.expression)) {
97
+ return ts.factory.createPropertyAccessExpression(replacePropertyRoot(propertyExpr.expression, newRootExpr), propertyExpr.name);
98
+ } else {
99
+ return ts.factory.createPropertyAccessExpression(newRootExpr, propertyExpr.name);
100
+ }
101
+ }
102
+ function getPropertyRoot(propertyExpr) {
103
+ if (ts.isPropertyAccessExpression(propertyExpr.expression))
104
+ return getPropertyRoot(propertyExpr.expression);
105
+ return propertyExpr.expression;
106
+ }
107
+ function optionalExportRef(object, expr) {
108
+ let propertyName;
109
+ let propertyAccess;
110
+ if (ts.isIdentifier(expr)) {
111
+ propertyName = expr.text;
112
+ } else if (ts.isPropertyAccessExpression(expr)) {
113
+ let propertyRoot = getPropertyRoot(expr);
114
+ propertyAccess = expr;
115
+ if (ts.isIdentifier(propertyRoot)) {
116
+ propertyName = propertyRoot.text;
117
+ } else {
118
+ throw new Error(`Property root should have been an identifier!`);
119
+ }
120
+ }
121
+ let callExpr = ts.factory.createCallExpression(ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier("__RΦ"), "oe"), [], [
122
+ object,
123
+ ts.factory.createStringLiteral(propertyName)
124
+ ]);
125
+ if (propertyAccess)
126
+ return replacePropertyRoot(propertyAccess, callExpr);
127
+ return callExpr;
128
+ }
129
+ function propertyPrepend(expr, propAccess) {
130
+ if (ts.isIdentifier(propAccess)) {
131
+ return ts.factory.createPropertyAccessExpression(expr, propAccess);
132
+ } else if (ts.isPropertyAccessExpression(propAccess.expression)) {
133
+ return ts.factory.createPropertyAccessExpression(propertyPrepend(expr, propAccess.expression), propAccess.name);
134
+ } else if (ts.isIdentifier(propAccess.expression)) {
135
+ return ts.factory.createPropertyAccessExpression(ts.factory.createPropertyAccessExpression(expr, propAccess.expression), propAccess.name);
136
+ } else {
137
+ console.dir(propAccess);
138
+ throw new Error(`Unsupported expression type '${ts.SyntaxKind[propAccess.kind]}'`);
139
+ }
140
+ }
141
+ function expressionForPropertyName(propName) {
142
+ if (ts.isComputedPropertyName(propName)) {
143
+ return propName.expression;
144
+ } else if (ts.isIdentifier(propName)) {
145
+ return ts.factory.createStringLiteral(propName.text);
146
+ } else if (ts.isStringLiteral(propName)) {
147
+ return ts.factory.createStringLiteral(propName.text);
148
+ } else if (ts.isPrivateIdentifier(propName)) {
149
+ return ts.factory.createStringLiteral(propName.text);
150
+ } else {
151
+ throw new Error(`Unexpected property name node of type '${ts.SyntaxKind[propName.kind]}'! Please file a bug!`);
152
+ }
153
+ }
154
+ function propertyNameToString(propName) {
155
+ if (!propName)
156
+ return `<undefined>`;
157
+ if (propName.getSourceFile()) {
158
+ return propName.getText();
159
+ }
160
+ if (ts.isComputedPropertyName(propName)) {
161
+ return `(computed property name)`;
162
+ } else if (ts.isIdentifier(propName)) {
163
+ return propName.text;
164
+ } else if (ts.isStringLiteral(propName)) {
165
+ return `"${propName.text}"`;
166
+ } else if (ts.isPrivateIdentifier(propName)) {
167
+ return propName.text;
168
+ } else {
169
+ throw new Error(`Unexpected property name node of type '${ts.SyntaxKind[propName.kind]}'! Please file a bug!`);
170
+ }
171
+ }
172
+ function hasModifier(modifiers, modifier) {
173
+ var _a;
174
+ return (_a = modifiers === null || modifiers === void 0 ? void 0 : modifiers.some((x) => x.kind === modifier)) !== null && _a !== void 0 ? _a : false;
175
+ }
176
+ function hasModifiers(modifiersArray, modifiers) {
177
+ return modifiers.every((modifier) => hasModifier(modifiersArray, modifier));
178
+ }
179
+ function getModifiers(node) {
180
+ var _a;
181
+ return ts.canHaveModifiers(node) ? (_a = ts.getModifiers(node)) !== null && _a !== void 0 ? _a : [] : [];
182
+ }
183
+ function getDecorators(node) {
184
+ var _a;
185
+ return ts.canHaveDecorators(node) ? (_a = ts.getDecorators(node)) !== null && _a !== void 0 ? _a : [] : [];
186
+ }
187
+ function referenceImportedSymbol(ctx, modulePath, identifier, hasValue, importDecl) {
188
+ let impo = ctx.importMap.get(`*:${modulePath}`);
189
+ if (!impo) {
190
+ ctx.importMap.set(`*:${modulePath}`, impo = {
191
+ importDeclaration: importDecl !== null && importDecl !== void 0 ? importDecl : ctx.currentTopStatement,
192
+ isDefault: false,
193
+ isNamespace: true,
194
+ localName: `LΦ_${ctx.freeImportReference++}`,
195
+ modulePath,
196
+ name: `*:${modulePath}`,
197
+ refName: "",
198
+ referenced: true
199
+ });
200
+ }
201
+ impo.referenced = true;
202
+ if (hasValue === true) {
203
+ return ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier(impo.localName), identifier);
204
+ } else if (hasValue === false) {
205
+ return ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier(impo.localName), `IΦ${identifier}`);
206
+ }
207
+ return ts.factory.createBinaryExpression(ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier(impo.localName), identifier), ts.factory.createToken(ts.SyntaxKind.QuestionQuestionToken), ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier(impo.localName), `IΦ${identifier}`));
208
+ }
209
+ function isExternalOrCommonJsModule(file) {
210
+ return (file["externalModuleIndicator"] || file["commonJsModuleIndicator"]) !== void 0;
211
+ }
212
+ function* externalModules(program) {
213
+ let checker = program.getTypeChecker();
214
+ for (const ambient of checker.getAmbientModules()) {
215
+ yield [
216
+ ambient,
217
+ /*sourceFile*/
218
+ void 0
219
+ ];
220
+ }
221
+ for (const sourceFile of program.getSourceFiles()) {
222
+ if (isExternalOrCommonJsModule(sourceFile)) {
223
+ yield [checker["getMergedSymbol"](sourceFile["symbol"]), sourceFile];
224
+ }
225
+ }
226
+ }
227
+ function removeTrailingSlash(path) {
228
+ return path.replace(/[/\\]+$/, "");
229
+ }
230
+ function getDirectoryPath(path) {
231
+ return removeTrailingSlash(removeTrailingSlash(path).replace(/[/\\][^/\\]+$/, ""));
232
+ }
233
+ function hasTrailingDirectorySeparator(path) {
234
+ return path.length > 0 && isAnyDirectorySeparator(path.charCodeAt(path.length - 1));
235
+ }
236
+ function isAnyDirectorySeparator(charCode) {
237
+ return charCode === 47 || charCode === 92;
238
+ }
239
+ function removeTrailingDirectorySeparator(path) {
240
+ if (hasTrailingDirectorySeparator(path)) {
241
+ return path.substr(0, path.length - 1);
242
+ }
243
+ return path;
244
+ }
245
+ function getBaseFileName(path, extensions, ignoreCase) {
246
+ path = normalizeSlashes(path);
247
+ const rootLength = getRootLength(path);
248
+ if (rootLength === path.length)
249
+ return "";
250
+ path = removeTrailingDirectorySeparator(path);
251
+ const name = path.slice(Math.max(getRootLength(path), path.lastIndexOf(directorySeparator) + 1));
252
+ const extension = extensions !== void 0 && ignoreCase !== void 0 ? getAnyExtensionFromPath(name, extensions, ignoreCase) : void 0;
253
+ return extension ? name.slice(0, name.length - extension.length) : name;
254
+ }
255
+ const backslashRegExp = /\\/g;
256
+ const directorySeparator = "/";
257
+ const altDirectorySeparator = "\\";
258
+ const urlSchemeSeparator = "://";
259
+ function equateStringsCaseInsensitive(a, b) {
260
+ return a === b || a !== void 0 && b !== void 0 && a.toUpperCase() === b.toUpperCase();
261
+ }
262
+ function equateStringsCaseSensitive(a, b) {
263
+ return a === b;
264
+ }
265
+ function getAnyExtensionFromPath(path, extensions, ignoreCase) {
266
+ if (extensions) {
267
+ return getAnyExtensionFromPathWorker(removeTrailingDirectorySeparator(path), extensions, ignoreCase ? equateStringsCaseInsensitive : equateStringsCaseSensitive);
268
+ }
269
+ const baseFileName = getBaseFileName(path);
270
+ const extensionIndex = baseFileName.lastIndexOf(".");
271
+ if (extensionIndex >= 0) {
272
+ return baseFileName.substring(extensionIndex);
273
+ }
274
+ return "";
275
+ }
276
+ function getAnyExtensionFromPathWorker(path, extensions, stringEqualityComparer) {
277
+ if (typeof extensions === "string") {
278
+ return tryGetExtensionFromPath(path, extensions, stringEqualityComparer) || "";
279
+ }
280
+ for (const extension of extensions) {
281
+ const result = tryGetExtensionFromPath(path, extension, stringEqualityComparer);
282
+ if (result)
283
+ return result;
284
+ }
285
+ return "";
286
+ }
287
+ function tryGetExtensionFromPath(path, extension, stringEqualityComparer) {
288
+ if (!extension.startsWith("."))
289
+ extension = "." + extension;
290
+ if (path.length >= extension.length && path.charCodeAt(path.length - extension.length) === 46) {
291
+ const pathExtension = path.slice(path.length - extension.length);
292
+ if (stringEqualityComparer(pathExtension, extension)) {
293
+ return pathExtension;
294
+ }
295
+ }
296
+ }
297
+ function getRootLength(path) {
298
+ const rootLength = getEncodedRootLength(path);
299
+ return rootLength < 0 ? ~rootLength : rootLength;
300
+ }
301
+ function isVolumeCharacter(charCode) {
302
+ return charCode >= 97 && charCode <= 122 || charCode >= 65 && charCode <= 90;
303
+ }
304
+ function getFileUrlVolumeSeparatorEnd(url, start) {
305
+ const ch0 = url.charCodeAt(start);
306
+ if (ch0 === 58)
307
+ return start + 1;
308
+ if (ch0 === 37 && url.charCodeAt(start + 1) === 51) {
309
+ const ch2 = url.charCodeAt(start + 2);
310
+ if (ch2 === 97 || ch2 === 65)
311
+ return start + 3;
312
+ }
313
+ return -1;
314
+ }
315
+ function getEncodedRootLength(path) {
316
+ if (!path)
317
+ return 0;
318
+ const ch0 = path.charCodeAt(0);
319
+ if (ch0 === 47 || ch0 === 92) {
320
+ if (path.charCodeAt(1) !== ch0)
321
+ return 1;
322
+ const p1 = path.indexOf(ch0 === 47 ? directorySeparator : altDirectorySeparator, 2);
323
+ if (p1 < 0)
324
+ return path.length;
325
+ return p1 + 1;
326
+ }
327
+ if (isVolumeCharacter(ch0) && path.charCodeAt(1) === 58) {
328
+ const ch2 = path.charCodeAt(2);
329
+ if (ch2 === 47 || ch2 === 92)
330
+ return 3;
331
+ if (path.length === 2)
332
+ return 2;
333
+ }
334
+ const schemeEnd = path.indexOf(urlSchemeSeparator);
335
+ if (schemeEnd !== -1) {
336
+ const authorityStart = schemeEnd + urlSchemeSeparator.length;
337
+ const authorityEnd = path.indexOf(directorySeparator, authorityStart);
338
+ if (authorityEnd !== -1) {
339
+ const scheme = path.slice(0, schemeEnd);
340
+ const authority = path.slice(authorityStart, authorityEnd);
341
+ if (scheme === "file" && (authority === "" || authority === "localhost") && isVolumeCharacter(path.charCodeAt(authorityEnd + 1))) {
342
+ const volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(path, authorityEnd + 2);
343
+ if (volumeSeparatorEnd !== -1) {
344
+ if (path.charCodeAt(volumeSeparatorEnd) === 47) {
345
+ return ~(volumeSeparatorEnd + 1);
346
+ }
347
+ if (volumeSeparatorEnd === path.length) {
348
+ return ~volumeSeparatorEnd;
349
+ }
350
+ }
351
+ }
352
+ return ~(authorityEnd + 1);
353
+ }
354
+ return ~path.length;
355
+ }
356
+ return 0;
357
+ }
358
+ function normalizeSlashes(path) {
359
+ return path.replace(backslashRegExp, directorySeparator);
360
+ }
361
+ function getParentOfSymbol(symbol) {
362
+ return symbol["parent"];
363
+ }
364
+ function getDefaultLikeExportInfo(importingFile, moduleSymbol, checker, compilerOptions) {
365
+ const exported = getDefaultLikeExportWorker(importingFile, moduleSymbol, checker, compilerOptions);
366
+ if (!exported)
367
+ return void 0;
368
+ const { symbol, kind } = exported;
369
+ const info = getDefaultExportInfoWorker(symbol, checker, compilerOptions);
370
+ return info && Object.assign({ symbol, kind }, info);
371
+ }
372
+ function getDefaultExportInfoWorker(defaultExport, checker, compilerOptions) {
373
+ const localSymbol = getLocalSymbolForExportDefault(defaultExport);
374
+ if (localSymbol)
375
+ return { symbolForMeaning: localSymbol, name: localSymbol.name };
376
+ const name = getNameForExportDefault(defaultExport);
377
+ if (name !== void 0)
378
+ return { symbolForMeaning: defaultExport, name };
379
+ if (defaultExport.flags & ts.SymbolFlags.Alias) {
380
+ const aliased = checker.getImmediateAliasedSymbol(defaultExport);
381
+ if (aliased && getParentOfSymbol(aliased)) {
382
+ return getDefaultExportInfoWorker(aliased, checker, compilerOptions);
383
+ }
384
+ }
385
+ if (defaultExport.escapedName !== ts.InternalSymbolName.Default && defaultExport.escapedName !== ts.InternalSymbolName.ExportEquals) {
386
+ return { symbolForMeaning: defaultExport, name: defaultExport.getName() };
387
+ }
388
+ return { symbolForMeaning: defaultExport, name: getNameForExportedSymbol(defaultExport, compilerOptions.target) };
389
+ }
390
+ function getSymbolParentOrFail(symbol) {
391
+ var _a;
392
+ let parent = getParentOfSymbol(symbol);
393
+ if (!parent) {
394
+ throw new Error(`RTTI: Symbol parent was undefined. Flags: ${symbol.flags}. Declarations: ${(_a = symbol.declarations) === null || _a === void 0 ? void 0 : _a.map((d) => {
395
+ const inJS = isInJSFile(d);
396
+ const { expression } = d;
397
+ return (inJS ? "[JS]" : "") + d.kind + (expression ? ` (expression: ${expression.kind})` : "");
398
+ }).join(", ")}.`);
399
+ }
400
+ return parent;
401
+ }
402
+ function getNameForExportedSymbol(symbol, scriptTarget) {
403
+ if (!(symbol.flags & ts.SymbolFlags.Transient) && (symbol.escapedName === ts.InternalSymbolName.ExportEquals || symbol.escapedName === ts.InternalSymbolName.Default)) {
404
+ if (!symbol.declarations)
405
+ return void 0;
406
+ for (let d of symbol.declarations) {
407
+ if (isExportAssignment(d)) {
408
+ let expr = skipOuterExpressions(d.expression);
409
+ if (ts.isIdentifier(expr))
410
+ return expr.text;
411
+ let x = moduleSymbolToValidIdentifier(getSymbolParentOrFail(symbol), scriptTarget);
412
+ if (x)
413
+ return x;
414
+ }
415
+ }
416
+ return void 0;
417
+ }
418
+ return symbol.name;
419
+ }
420
+ function getNameForExportDefault(symbol) {
421
+ if (!symbol.declarations)
422
+ return void 0;
423
+ let firstDefined = symbol.declarations.find((x) => x !== void 0);
424
+ for (let declaration of symbol.declarations) {
425
+ if (ts.isExportAssignment(declaration)) {
426
+ let expr = skipOuterExpressions(declaration.expression);
427
+ if (ts.isIdentifier(expr))
428
+ return expr.text;
429
+ } else if (ts.isExportSpecifier(declaration)) {
430
+ if (declaration.name.text !== ts.InternalSymbolName.Default)
431
+ throw new Error("Expected the specifier to be a default export");
432
+ return declaration.propertyName && declaration.propertyName.text;
433
+ }
434
+ }
435
+ }
436
+ function getDefaultLikeExportWorker(importingFile, moduleSymbol, checker, compilerOptions) {
437
+ const defaultExport = checker.tryGetMemberInModuleExports(ts.InternalSymbolName.Default, moduleSymbol);
438
+ if (defaultExport)
439
+ return {
440
+ symbol: defaultExport,
441
+ kind: 1
442
+ /* ImportKind.Default */
443
+ };
444
+ const exportEquals = checker.resolveExternalModuleSymbol(moduleSymbol);
445
+ return exportEquals === moduleSymbol ? void 0 : { symbol: exportEquals, kind: getExportEqualsImportKind(importingFile, compilerOptions) };
446
+ }
447
+ function getExportEqualsImportKind(importingFile, compilerOptions) {
448
+ const allowSyntheticDefaults = getAllowSyntheticDefaultImports(compilerOptions);
449
+ if (getEmitModuleKind(compilerOptions) >= ts.ModuleKind.ES2015) {
450
+ return allowSyntheticDefaults ? 1 : 2;
451
+ }
452
+ if (isInJSFile(importingFile)) {
453
+ return isExternalModule(importingFile) ? 1 : 3;
454
+ }
455
+ for (const statement of importingFile.statements) {
456
+ if (statement.kind === ts.SyntaxKind.ImportEqualsDeclaration) {
457
+ return 3;
458
+ }
459
+ }
460
+ return allowSyntheticDefaults ? 1 : 3;
461
+ }
462
+ function getEmitModuleKind(compilerOptions) {
463
+ return typeof compilerOptions.module === "number" ? compilerOptions.module : getEmitScriptTarget(compilerOptions) >= ts.ScriptTarget.ES2015 ? ts.ModuleKind.ES2015 : ts.ModuleKind.CommonJS;
464
+ }
465
+ function getEmitScriptTarget(compilerOptions) {
466
+ return compilerOptions.target || ts.ScriptTarget.ES3;
467
+ }
468
+ function getAllowSyntheticDefaultImports(compilerOptions) {
469
+ const moduleKind = getEmitModuleKind(compilerOptions);
470
+ return compilerOptions.allowSyntheticDefaultImports !== void 0 ? compilerOptions.allowSyntheticDefaultImports : compilerOptions.esModuleInterop || moduleKind === ts.ModuleKind.System;
471
+ }
472
+ function isInJSFile(node) {
473
+ return !!node && !!(node.flags & ts.NodeFlags.JavaScriptFile);
474
+ }
475
+ function isExternalModule(file) {
476
+ return file.externalModuleIndicator !== void 0;
477
+ }
478
+ function getLocalSymbolForExportDefault(symbol) {
479
+ if (!isExportDefaultSymbol(symbol))
480
+ return void 0;
481
+ if (!symbol.declarations)
482
+ return void 0;
483
+ for (const decl of symbol.declarations) {
484
+ if (decl.localSymbol)
485
+ return decl.localSymbol;
486
+ }
487
+ return void 0;
488
+ }
489
+ function isExportDefaultSymbol(symbol) {
490
+ var _a, _b;
491
+ if (!symbol.declarations)
492
+ return false;
493
+ return symbol && ((_b = (_a = symbol.declarations) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 0 && hasModifier(ts.canHaveModifiers(symbol.declarations[0]) ? ts.getModifiers(symbol.declarations[0]) : [], ts.SyntaxKind.DefaultKeyword);
494
+ }
495
+ function skipOuterExpressions(node, kinds = ts.OuterExpressionKinds.All) {
496
+ while (isOuterExpression(node, kinds)) {
497
+ node = node.expression;
498
+ }
499
+ return node;
500
+ }
501
+ function isOuterExpression(node, kinds = ts.OuterExpressionKinds.All) {
502
+ switch (node.kind) {
503
+ case ts.SyntaxKind.ParenthesizedExpression:
504
+ return (kinds & ts.OuterExpressionKinds.Parentheses) !== 0;
505
+ case ts.SyntaxKind.TypeAssertionExpression:
506
+ case ts.SyntaxKind.AsExpression:
507
+ return (kinds & ts.OuterExpressionKinds.TypeAssertions) !== 0;
508
+ case ts.SyntaxKind.NonNullExpression:
509
+ return (kinds & ts.OuterExpressionKinds.NonNullAssertions) !== 0;
510
+ case ts.SyntaxKind.PartiallyEmittedExpression:
511
+ return (kinds & ts.OuterExpressionKinds.PartiallyEmittedExpressions) !== 0;
512
+ }
513
+ return false;
514
+ }
515
+ function isExportAssignment(node) {
516
+ return node.kind === ts.SyntaxKind.ExportAssignment;
517
+ }
518
+ function moduleSymbolToValidIdentifier(moduleSymbol, target) {
519
+ return moduleSpecifierToValidIdentifier(removeFileExtension(stripQuotes(moduleSymbol.name)), target);
520
+ }
521
+ function removeSuffix(str, suffix) {
522
+ return str.endsWith(suffix) ? str.slice(0, str.length - suffix.length) : str;
523
+ }
524
+ function getRttiDocTagFromNode(element, tagName) {
525
+ let tags = ts.getJSDocTags(element);
526
+ if (!tags)
527
+ return void 0;
528
+ let match = tags.find((x) => x.tagName.text === "rtti" && typeof x.comment === "string" && (x.comment.startsWith(`:${tagName} `) || x.comment === `:${tagName}`));
529
+ if (!match)
530
+ return void 0;
531
+ return match.comment.slice(`:${tagName} `.length);
532
+ }
533
+ function getRttiDocTagFromSignature(signature, tagName) {
534
+ let jsDocTags = signature.getJsDocTags();
535
+ if (!jsDocTags)
536
+ return void 0;
537
+ let tag = jsDocTags.find((x) => {
538
+ var _a;
539
+ return x.name === "rtti" && ((_a = x.text[0]) === null || _a === void 0 ? void 0 : _a.text.startsWith(`:${tagName} `));
540
+ });
541
+ if (!tag)
542
+ return void 0;
543
+ let comment = tag.text[0].text;
544
+ let value = comment.slice(`:${tagName} `.length);
545
+ return value;
546
+ }
547
+ const 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];
548
+ const 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];
549
+ const 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];
550
+ const unicodeES5IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6e3, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43e3, 43047, 43072, 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500];
551
+ const unicodeESNextIdentifierStart = [65, 90, 97, 122, 170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 895, 895, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1327, 1329, 1366, 1369, 1369, 1376, 1416, 1488, 1514, 1519, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2144, 2154, 2208, 2228, 2230, 2237, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2432, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2556, 2556, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2809, 2809, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3129, 3133, 3133, 3160, 3162, 3168, 3169, 3200, 3200, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3412, 3414, 3423, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3718, 3722, 3724, 3747, 3749, 3749, 3751, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5109, 5112, 5117, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5880, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6e3, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6264, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6430, 6480, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7296, 7304, 7312, 7354, 7357, 7359, 7401, 7404, 7406, 7411, 7413, 7414, 7418, 7418, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8472, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12443, 12447, 12449, 12538, 12540, 12543, 12549, 12591, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40943, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42653, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42943, 42946, 42950, 42999, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43261, 43262, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43488, 43492, 43494, 43503, 43514, 43518, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43646, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43824, 43866, 43868, 43879, 43888, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594, 65596, 65597, 65599, 65613, 65616, 65629, 65664, 65786, 65856, 65908, 66176, 66204, 66208, 66256, 66304, 66335, 66349, 66378, 66384, 66421, 66432, 66461, 66464, 66499, 66504, 66511, 66513, 66517, 66560, 66717, 66736, 66771, 66776, 66811, 66816, 66855, 66864, 66915, 67072, 67382, 67392, 67413, 67424, 67431, 67584, 67589, 67592, 67592, 67594, 67637, 67639, 67640, 67644, 67644, 67647, 67669, 67680, 67702, 67712, 67742, 67808, 67826, 67828, 67829, 67840, 67861, 67872, 67897, 67968, 68023, 68030, 68031, 68096, 68096, 68112, 68115, 68117, 68119, 68121, 68149, 68192, 68220, 68224, 68252, 68288, 68295, 68297, 68324, 68352, 68405, 68416, 68437, 68448, 68466, 68480, 68497, 68608, 68680, 68736, 68786, 68800, 68850, 68864, 68899, 69376, 69404, 69415, 69415, 69424, 69445, 69600, 69622, 69635, 69687, 69763, 69807, 69840, 69864, 69891, 69926, 69956, 69956, 69968, 70002, 70006, 70006, 70019, 70066, 70081, 70084, 70106, 70106, 70108, 70108, 70144, 70161, 70163, 70187, 70272, 70278, 70280, 70280, 70282, 70285, 70287, 70301, 70303, 70312, 70320, 70366, 70405, 70412, 70415, 70416, 70419, 70440, 70442, 70448, 70450, 70451, 70453, 70457, 70461, 70461, 70480, 70480, 70493, 70497, 70656, 70708, 70727, 70730, 70751, 70751, 70784, 70831, 70852, 70853, 70855, 70855, 71040, 71086, 71128, 71131, 71168, 71215, 71236, 71236, 71296, 71338, 71352, 71352, 71424, 71450, 71680, 71723, 71840, 71903, 71935, 71935, 72096, 72103, 72106, 72144, 72161, 72161, 72163, 72163, 72192, 72192, 72203, 72242, 72250, 72250, 72272, 72272, 72284, 72329, 72349, 72349, 72384, 72440, 72704, 72712, 72714, 72750, 72768, 72768, 72818, 72847, 72960, 72966, 72968, 72969, 72971, 73008, 73030, 73030, 73056, 73061, 73063, 73064, 73066, 73097, 73112, 73112, 73440, 73458, 73728, 74649, 74752, 74862, 74880, 75075, 77824, 78894, 82944, 83526, 92160, 92728, 92736, 92766, 92880, 92909, 92928, 92975, 92992, 92995, 93027, 93047, 93053, 93071, 93760, 93823, 93952, 94026, 94032, 94032, 94099, 94111, 94176, 94177, 94179, 94179, 94208, 100343, 100352, 101106, 110592, 110878, 110928, 110930, 110948, 110951, 110960, 111355, 113664, 113770, 113776, 113788, 113792, 113800, 113808, 113817, 119808, 119892, 119894, 119964, 119966, 119967, 119970, 119970, 119973, 119974, 119977, 119980, 119982, 119993, 119995, 119995, 119997, 120003, 120005, 120069, 120071, 120074, 120077, 120084, 120086, 120092, 120094, 120121, 120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144, 120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570, 120572, 120596, 120598, 120628, 120630, 120654, 120656, 120686, 120688, 120712, 120714, 120744, 120746, 120770, 120772, 120779, 123136, 123180, 123191, 123197, 123214, 123214, 123584, 123627, 124928, 125124, 125184, 125251, 125259, 125259, 126464, 126467, 126469, 126495, 126497, 126498, 126500, 126500, 126503, 126503, 126505, 126514, 126516, 126519, 126521, 126521, 126523, 126523, 126530, 126530, 126535, 126535, 126537, 126537, 126539, 126539, 126541, 126543, 126545, 126546, 126548, 126548, 126551, 126551, 126553, 126553, 126555, 126555, 126557, 126557, 126559, 126559, 126561, 126562, 126564, 126564, 126567, 126570, 126572, 126578, 126580, 126583, 126585, 126588, 126590, 126590, 126592, 126601, 126603, 126619, 126625, 126627, 126629, 126633, 126635, 126651, 131072, 173782, 173824, 177972, 177984, 178205, 178208, 183969, 183984, 191456, 194560, 195101];
552
+ const 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];
553
+ function isUnicodeIdentifierStart(code, languageVersion) {
554
+ return languageVersion >= ts.ScriptTarget.ES2015 ? lookupInUnicodeMap(code, unicodeESNextIdentifierStart) : languageVersion === ts.ScriptTarget.ES5 ? lookupInUnicodeMap(code, unicodeES5IdentifierStart) : lookupInUnicodeMap(code, unicodeES3IdentifierStart);
555
+ }
556
+ function lookupInUnicodeMap(code, map) {
557
+ if (code < map[0]) {
558
+ return false;
559
+ }
560
+ let lo = 0;
561
+ let hi = map.length;
562
+ let mid;
563
+ while (lo + 1 < hi) {
564
+ mid = lo + (hi - lo) / 2;
565
+ mid -= mid % 2;
566
+ if (map[mid] <= code && code <= map[mid + 1]) {
567
+ return true;
568
+ }
569
+ if (code < map[mid]) {
570
+ hi = mid;
571
+ } else {
572
+ lo = mid + 2;
573
+ }
574
+ }
575
+ return false;
576
+ }
577
+ function moduleSpecifierToValidIdentifier(moduleSpecifier, target) {
578
+ const baseName = getBaseFileName(removeSuffix(moduleSpecifier, "/index"));
579
+ let res = "";
580
+ let lastCharWasValid = true;
581
+ const firstCharCode = baseName.charCodeAt(0);
582
+ if (isIdentifierStart(firstCharCode, target)) {
583
+ res += String.fromCharCode(firstCharCode);
584
+ } else {
585
+ lastCharWasValid = false;
586
+ }
587
+ for (let i = 1; i < baseName.length; i++) {
588
+ const ch = baseName.charCodeAt(i);
589
+ const isValid = isIdentifierPart(ch, target);
590
+ if (isValid) {
591
+ let char = String.fromCharCode(ch);
592
+ if (!lastCharWasValid) {
593
+ char = char.toUpperCase();
594
+ }
595
+ res += char;
596
+ }
597
+ lastCharWasValid = isValid;
598
+ }
599
+ return !isStringANonContextualKeyword(res) ? res || "_" : `_${res}`;
600
+ }
601
+ function isIdentifierStart(ch, languageVersion) {
602
+ return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || ch === 36 || ch === 95 || ch > 127 && isUnicodeIdentifierStart(ch, languageVersion);
603
+ }
604
+ function isIdentifierPart(ch, languageVersion, identifierVariant) {
605
+ return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || ch >= 48 && ch <= 57 || ch === 36 || ch === 95 || // "-" and ":" are valid in JSX Identifiers
606
+ (identifierVariant === ts.LanguageVariant.JSX ? ch === 45 || ch === 58 : false) || ch > 127 && isUnicodeIdentifierPart(ch, languageVersion);
607
+ }
608
+ function isUnicodeIdentifierPart(code, languageVersion) {
609
+ return languageVersion >= ts.ScriptTarget.ES2015 ? lookupInUnicodeMap(code, unicodeESNextIdentifierPart) : languageVersion === ts.ScriptTarget.ES5 ? lookupInUnicodeMap(code, unicodeES5IdentifierPart) : lookupInUnicodeMap(code, unicodeES3IdentifierPart);
610
+ }
611
+ const textToKeywordObj = {
612
+ abstract: ts.SyntaxKind.AbstractKeyword,
613
+ any: ts.SyntaxKind.AnyKeyword,
614
+ as: ts.SyntaxKind.AsKeyword,
615
+ asserts: ts.SyntaxKind.AssertsKeyword,
616
+ bigint: ts.SyntaxKind.BigIntKeyword,
617
+ boolean: ts.SyntaxKind.BooleanKeyword,
618
+ break: ts.SyntaxKind.BreakKeyword,
619
+ case: ts.SyntaxKind.CaseKeyword,
620
+ catch: ts.SyntaxKind.CatchKeyword,
621
+ class: ts.SyntaxKind.ClassKeyword,
622
+ continue: ts.SyntaxKind.ContinueKeyword,
623
+ const: ts.SyntaxKind.ConstKeyword,
624
+ ["constructor"]: ts.SyntaxKind.ConstructorKeyword,
625
+ debugger: ts.SyntaxKind.DebuggerKeyword,
626
+ declare: ts.SyntaxKind.DeclareKeyword,
627
+ default: ts.SyntaxKind.DefaultKeyword,
628
+ delete: ts.SyntaxKind.DeleteKeyword,
629
+ do: ts.SyntaxKind.DoKeyword,
630
+ else: ts.SyntaxKind.ElseKeyword,
631
+ enum: ts.SyntaxKind.EnumKeyword,
632
+ export: ts.SyntaxKind.ExportKeyword,
633
+ extends: ts.SyntaxKind.ExtendsKeyword,
634
+ false: ts.SyntaxKind.FalseKeyword,
635
+ finally: ts.SyntaxKind.FinallyKeyword,
636
+ for: ts.SyntaxKind.ForKeyword,
637
+ from: ts.SyntaxKind.FromKeyword,
638
+ function: ts.SyntaxKind.FunctionKeyword,
639
+ get: ts.SyntaxKind.GetKeyword,
640
+ if: ts.SyntaxKind.IfKeyword,
641
+ implements: ts.SyntaxKind.ImplementsKeyword,
642
+ import: ts.SyntaxKind.ImportKeyword,
643
+ in: ts.SyntaxKind.InKeyword,
644
+ infer: ts.SyntaxKind.InferKeyword,
645
+ instanceof: ts.SyntaxKind.InstanceOfKeyword,
646
+ interface: ts.SyntaxKind.InterfaceKeyword,
647
+ intrinsic: ts.SyntaxKind.IntrinsicKeyword,
648
+ is: ts.SyntaxKind.IsKeyword,
649
+ keyof: ts.SyntaxKind.KeyOfKeyword,
650
+ let: ts.SyntaxKind.LetKeyword,
651
+ module: ts.SyntaxKind.ModuleKeyword,
652
+ namespace: ts.SyntaxKind.NamespaceKeyword,
653
+ never: ts.SyntaxKind.NeverKeyword,
654
+ new: ts.SyntaxKind.NewKeyword,
655
+ null: ts.SyntaxKind.NullKeyword,
656
+ number: ts.SyntaxKind.NumberKeyword,
657
+ object: ts.SyntaxKind.ObjectKeyword,
658
+ package: ts.SyntaxKind.PackageKeyword,
659
+ private: ts.SyntaxKind.PrivateKeyword,
660
+ protected: ts.SyntaxKind.ProtectedKeyword,
661
+ public: ts.SyntaxKind.PublicKeyword,
662
+ readonly: ts.SyntaxKind.ReadonlyKeyword,
663
+ require: ts.SyntaxKind.RequireKeyword,
664
+ global: ts.SyntaxKind.GlobalKeyword,
665
+ return: ts.SyntaxKind.ReturnKeyword,
666
+ set: ts.SyntaxKind.SetKeyword,
667
+ static: ts.SyntaxKind.StaticKeyword,
668
+ string: ts.SyntaxKind.StringKeyword,
669
+ super: ts.SyntaxKind.SuperKeyword,
670
+ switch: ts.SyntaxKind.SwitchKeyword,
671
+ symbol: ts.SyntaxKind.SymbolKeyword,
672
+ this: ts.SyntaxKind.ThisKeyword,
673
+ throw: ts.SyntaxKind.ThrowKeyword,
674
+ true: ts.SyntaxKind.TrueKeyword,
675
+ try: ts.SyntaxKind.TryKeyword,
676
+ type: ts.SyntaxKind.TypeKeyword,
677
+ typeof: ts.SyntaxKind.TypeOfKeyword,
678
+ undefined: ts.SyntaxKind.UndefinedKeyword,
679
+ unique: ts.SyntaxKind.UniqueKeyword,
680
+ unknown: ts.SyntaxKind.UnknownKeyword,
681
+ var: ts.SyntaxKind.VarKeyword,
682
+ void: ts.SyntaxKind.VoidKeyword,
683
+ while: ts.SyntaxKind.WhileKeyword,
684
+ with: ts.SyntaxKind.WithKeyword,
685
+ yield: ts.SyntaxKind.YieldKeyword,
686
+ async: ts.SyntaxKind.AsyncKeyword,
687
+ await: ts.SyntaxKind.AwaitKeyword,
688
+ of: ts.SyntaxKind.OfKeyword
689
+ };
690
+ function isStringANonContextualKeyword(name) {
691
+ const token = stringToToken(name);
692
+ return token !== void 0 && isNonContextualKeyword(token);
693
+ }
694
+ function isNonContextualKeyword(token) {
695
+ return isKeyword(token) && !isContextualKeyword(token);
696
+ }
697
+ function isKeyword(token) {
698
+ return ts.SyntaxKind.FirstKeyword <= token && token <= ts.SyntaxKind.LastKeyword;
699
+ }
700
+ function isContextualKeyword(token) {
701
+ return ts.SyntaxKind.FirstContextualKeyword <= token && token <= ts.SyntaxKind.LastContextualKeyword;
702
+ }
703
+ function getEntries(obj) {
704
+ return obj ? _entries(obj) : [];
705
+ }
706
+ const hasOwnProperty = Object.prototype.hasOwnProperty;
707
+ function getOwnKeys(map) {
708
+ const keys = [];
709
+ for (const key in map) {
710
+ if (hasOwnProperty.call(map, key)) {
711
+ keys.push(key);
712
+ }
713
+ }
714
+ return keys;
715
+ }
716
+ const _entries = Object.entries || ((obj) => {
717
+ const keys = getOwnKeys(obj);
718
+ const result = Array(keys.length);
719
+ for (let i = 0; i < keys.length; i++) {
720
+ result[i] = [keys[i], obj[keys[i]]];
721
+ }
722
+ return result;
723
+ });
724
+ const textToToken = new Map(getEntries(Object.assign(Object.assign({}, textToKeywordObj), { "{": ts.SyntaxKind.OpenBraceToken, "}": ts.SyntaxKind.CloseBraceToken, "(": ts.SyntaxKind.OpenParenToken, ")": ts.SyntaxKind.CloseParenToken, "[": ts.SyntaxKind.OpenBracketToken, "]": ts.SyntaxKind.CloseBracketToken, ".": ts.SyntaxKind.DotToken, "...": ts.SyntaxKind.DotDotDotToken, ";": ts.SyntaxKind.SemicolonToken, ",": ts.SyntaxKind.CommaToken, "<": ts.SyntaxKind.LessThanToken, ">": ts.SyntaxKind.GreaterThanToken, "<=": ts.SyntaxKind.LessThanEqualsToken, ">=": ts.SyntaxKind.GreaterThanEqualsToken, "==": ts.SyntaxKind.EqualsEqualsToken, "!=": ts.SyntaxKind.ExclamationEqualsToken, "===": ts.SyntaxKind.EqualsEqualsEqualsToken, "!==": ts.SyntaxKind.ExclamationEqualsEqualsToken, "=>": ts.SyntaxKind.EqualsGreaterThanToken, "+": ts.SyntaxKind.PlusToken, "-": ts.SyntaxKind.MinusToken, "**": ts.SyntaxKind.AsteriskAsteriskToken, "*": ts.SyntaxKind.AsteriskToken, "/": ts.SyntaxKind.SlashToken, "%": ts.SyntaxKind.PercentToken, "++": ts.SyntaxKind.PlusPlusToken, "--": ts.SyntaxKind.MinusMinusToken, "<<": ts.SyntaxKind.LessThanLessThanToken, "</": ts.SyntaxKind.LessThanSlashToken, ">>": ts.SyntaxKind.GreaterThanGreaterThanToken, ">>>": ts.SyntaxKind.GreaterThanGreaterThanGreaterThanToken, "&": ts.SyntaxKind.AmpersandToken, "|": ts.SyntaxKind.BarToken, "^": ts.SyntaxKind.CaretToken, "!": ts.SyntaxKind.ExclamationToken, "~": ts.SyntaxKind.TildeToken, "&&": ts.SyntaxKind.AmpersandAmpersandToken, "||": ts.SyntaxKind.BarBarToken, "?": ts.SyntaxKind.QuestionToken, "??": ts.SyntaxKind.QuestionQuestionToken, "?.": ts.SyntaxKind.QuestionDotToken, ":": ts.SyntaxKind.ColonToken, "=": ts.SyntaxKind.EqualsToken, "+=": ts.SyntaxKind.PlusEqualsToken, "-=": ts.SyntaxKind.MinusEqualsToken, "*=": ts.SyntaxKind.AsteriskEqualsToken, "**=": ts.SyntaxKind.AsteriskAsteriskEqualsToken, "/=": ts.SyntaxKind.SlashEqualsToken, "%=": ts.SyntaxKind.PercentEqualsToken, "<<=": ts.SyntaxKind.LessThanLessThanEqualsToken, ">>=": ts.SyntaxKind.GreaterThanGreaterThanEqualsToken, ">>>=": ts.SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken, "&=": ts.SyntaxKind.AmpersandEqualsToken, "|=": ts.SyntaxKind.BarEqualsToken, "^=": ts.SyntaxKind.CaretEqualsToken, "||=": ts.SyntaxKind.BarBarEqualsToken, "&&=": ts.SyntaxKind.AmpersandAmpersandEqualsToken, "??=": ts.SyntaxKind.QuestionQuestionEqualsToken, "@": ts.SyntaxKind.AtToken, "`": ts.SyntaxKind.BacktickToken })));
725
+ function stringToToken(s) {
726
+ return textToToken.get(s);
727
+ }
728
+ function stripQuotes(name) {
729
+ const length = name.length;
730
+ if (length >= 2 && name.charCodeAt(0) === name.charCodeAt(length - 1) && isQuoteOrBacktick(name.charCodeAt(0))) {
731
+ return name.substring(1, length - 1);
732
+ }
733
+ return name;
734
+ }
735
+ function isQuoteOrBacktick(charCode) {
736
+ return charCode === 39 || charCode === 34 || charCode === 96;
737
+ }
738
+ const extensionsToRemove = [ts.Extension.Dts, ts.Extension.Ts, ts.Extension.Js, ts.Extension.Tsx, ts.Extension.Jsx, ts.Extension.Json];
739
+ function removeFileExtension(path) {
740
+ for (const ext of extensionsToRemove) {
741
+ const extensionless = tryRemoveExtension(path, ext);
742
+ if (extensionless !== void 0) {
743
+ return extensionless;
744
+ }
745
+ }
746
+ return path;
747
+ }
748
+ function tryRemoveExtension(path, extension) {
749
+ return path.endsWith(extension) ? removeExtension(path, extension) : void 0;
750
+ }
751
+ function removeExtension(path, extension) {
752
+ return path.substring(0, path.length - extension.length);
753
+ }
754
+ function isTypeOnlySymbol(s, checker) {
755
+ return !(skipAlias(s, checker).flags & ts.SymbolFlags.Value);
756
+ }
757
+ function skipAlias(symbol, checker) {
758
+ return symbol.flags & ts.SymbolFlags.Alias ? checker.getAliasedSymbol(symbol) : symbol;
759
+ }
760
+ function typeHasValue(type) {
761
+ var _a, _b;
762
+ return type.isClass() || ((_a = type.symbol) === null || _a === void 0 ? void 0 : _a.name) === "Promise" || !!((_b = type.symbol) === null || _b === void 0 ? void 0 : _b.valueDeclaration);
763
+ }
764
+ function isNodeJS() {
765
+ return Object.prototype.toString.call(typeof process !== "undefined" ? process : 0) === "[object process]";
766
+ }
767
+ function hasGlobalFlag(name) {
768
+ return !!globalThis[name];
769
+ }
770
+ function setGlobalFlag(name, value) {
771
+ globalThis[name] = value;
772
+ }
773
+ function resolveName(checker, location, name, meaning, excludeGlobals) {
774
+ return checker.resolveName(name, location, meaning, excludeGlobals);
775
+ }
776
+ function isStatement(node) {
777
+ return ts["isStatement"](node);
778
+ }
779
+ function getTypeLocality(ctx, type, typeNode) {
780
+ var _a, _b;
781
+ if (!type.symbol)
782
+ return "global";
783
+ let typeSourceFile = (_b = (_a = type.symbol.declarations) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.getSourceFile();
784
+ if (!typeSourceFile || ctx.program.isSourceFileDefaultLibrary(typeSourceFile))
785
+ return "global";
786
+ let isLocal = typeSourceFile === ctx.sourceFile;
787
+ let resolvedGlobalSymbol = resolveName(ctx.checker, typeNode, type.symbol.name, ts.SymbolFlags.Value, false);
788
+ let resolvedNonGlobalSymbol = resolveName(ctx.checker, typeNode, type.symbol.name, ts.SymbolFlags.Value, true);
789
+ if (resolvedGlobalSymbol && !resolvedNonGlobalSymbol && resolvedGlobalSymbol === type.symbol)
790
+ return "global";
791
+ return isLocal ? "local" : "imported";
792
+ }
793
+ function hasFilesystemAccess() {
794
+ if (isNodeJS()) {
795
+ let fsx;
796
+ try {
797
+ fsx = require$1("fs");
798
+ } catch (e) {
799
+ }
800
+ return !!fsx;
801
+ }
802
+ return false;
803
+ }
804
+ function fileExists(filename) {
805
+ if (isNodeJS()) {
806
+ let fsx;
807
+ try {
808
+ fsx = require$1("fs");
809
+ } catch (e) {
810
+ }
811
+ if (fsx)
812
+ return fsx.existsSync(filename);
813
+ }
814
+ throw new Error(`No filesystem access available in this environment! Should guard using hasFilesystem()! This is a bug.`);
815
+ }
816
+ export {
817
+ altDirectorySeparator,
818
+ assert,
819
+ cloneEntityNameAsExpr,
820
+ cloneQualifiedName,
821
+ directorySeparator,
822
+ dottedNameToExpr,
823
+ entityNameToString,
824
+ equateStringsCaseInsensitive,
825
+ equateStringsCaseSensitive,
826
+ expressionForPropertyName,
827
+ externalModules,
828
+ fileExists,
829
+ getAllowSyntheticDefaultImports,
830
+ getAnyExtensionFromPath,
831
+ getBaseFileName,
832
+ getDecorators,
833
+ getDefaultLikeExportInfo,
834
+ getDefaultLikeExportWorker,
835
+ getDirectoryPath,
836
+ getEmitModuleKind,
837
+ getEmitScriptTarget,
838
+ getEntries,
839
+ getExportEqualsImportKind,
840
+ getLocalSymbolForExportDefault,
841
+ getModifiers,
842
+ getNameForExportDefault,
843
+ getNameForExportedSymbol,
844
+ getOwnKeys,
845
+ getParentOfSymbol,
846
+ getPropertyRoot,
847
+ getRootLength,
848
+ getRootNameOfEntityName,
849
+ getRootNameOfQualifiedName,
850
+ getRttiDocTagFromNode,
851
+ getRttiDocTagFromSignature,
852
+ getTypeLocality,
853
+ hasAnyFlag,
854
+ hasFilesystemAccess,
855
+ hasFlag,
856
+ hasGlobalFlag,
857
+ hasModifier,
858
+ hasModifiers,
859
+ hasTrailingDirectorySeparator,
860
+ isAnyDirectorySeparator,
861
+ isContextualKeyword,
862
+ isExportAssignment,
863
+ isExportDefaultSymbol,
864
+ isExternalModule,
865
+ isExternalOrCommonJsModule,
866
+ isFlagType,
867
+ isIdentifierPart,
868
+ isIdentifierStart,
869
+ isInJSFile,
870
+ isInterfaceType,
871
+ isKeyword,
872
+ isNodeJS,
873
+ isNonContextualKeyword,
874
+ isOuterExpression,
875
+ isQuoteOrBacktick,
876
+ isStatement,
877
+ isStringANonContextualKeyword,
878
+ isTypeOnlySymbol,
879
+ isUnicodeIdentifierStart,
880
+ moduleSpecifierToValidIdentifier,
881
+ moduleSymbolToValidIdentifier,
882
+ normalizeSlashes,
883
+ optionalExportRef,
884
+ propertyNameToString,
885
+ propertyPrepend,
886
+ qualifiedNameToString,
887
+ referenceImportedSymbol,
888
+ removeExtension,
889
+ removeFileExtension,
890
+ removeSuffix,
891
+ removeTrailingDirectorySeparator,
892
+ removeTrailingSlash,
893
+ replacePropertyRoot,
894
+ resolveName,
895
+ serializeEntityNameAsExpression,
896
+ serializeEntityNameAsExpressionFallback,
897
+ setGlobalFlag,
898
+ setParent,
899
+ skipAlias,
900
+ skipOuterExpressions,
901
+ stringToToken,
902
+ stripQuotes,
903
+ tryRemoveExtension,
904
+ typeHasValue
905
+ };
906
+ //# sourceMappingURL=utils.js.map