@angular/compiler-cli 13.0.0-rc.3 → 13.1.0-next.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 (69) hide show
  1. package/bundles/chunk-2DL256T3.js +5105 -0
  2. package/bundles/chunk-2DL256T3.js.map +6 -0
  3. package/bundles/chunk-ACINBTQB.js +43 -0
  4. package/bundles/chunk-ACINBTQB.js.map +6 -0
  5. package/bundles/chunk-BUHTODFL.js +380 -0
  6. package/bundles/chunk-BUHTODFL.js.map +6 -0
  7. package/bundles/chunk-EP5JHXG2.js +448 -0
  8. package/bundles/chunk-EP5JHXG2.js.map +6 -0
  9. package/bundles/chunk-GLCRIILX.js +206 -0
  10. package/bundles/chunk-GLCRIILX.js.map +6 -0
  11. package/bundles/chunk-JNWO3JB2.js +968 -0
  12. package/bundles/chunk-JNWO3JB2.js.map +6 -0
  13. package/bundles/chunk-MIQ5UCHZ.js +5663 -0
  14. package/bundles/chunk-MIQ5UCHZ.js.map +6 -0
  15. package/bundles/chunk-PBA67OV4.js +358 -0
  16. package/bundles/chunk-PBA67OV4.js.map +6 -0
  17. package/bundles/chunk-QDWL7SZJ.js +29 -0
  18. package/bundles/chunk-QDWL7SZJ.js.map +6 -0
  19. package/bundles/chunk-QL6ZC3U3.js +424 -0
  20. package/bundles/chunk-QL6ZC3U3.js.map +6 -0
  21. package/bundles/chunk-S3QIIFH7.js +678 -0
  22. package/bundles/chunk-S3QIIFH7.js.map +6 -0
  23. package/bundles/chunk-SKBLJA43.js +56 -0
  24. package/bundles/chunk-SKBLJA43.js.map +6 -0
  25. package/bundles/chunk-UMUIU7TE.js +116 -0
  26. package/bundles/chunk-UMUIU7TE.js.map +6 -0
  27. package/bundles/chunk-VKIZ4TCJ.js +11997 -0
  28. package/bundles/chunk-VKIZ4TCJ.js.map +6 -0
  29. package/bundles/chunk-WOC6KEUY.js +2177 -0
  30. package/bundles/chunk-WOC6KEUY.js.map +6 -0
  31. package/bundles/chunk-WYO7JO2T.js +1261 -0
  32. package/bundles/chunk-WYO7JO2T.js.map +6 -0
  33. package/bundles/chunk-XA5IZLLC.js +68 -0
  34. package/bundles/chunk-XA5IZLLC.js.map +6 -0
  35. package/bundles/index.js +96 -20249
  36. package/bundles/index.js.map +2 -2
  37. package/bundles/linker/babel/index.js +24 -1987
  38. package/bundles/linker/babel/index.js.map +2 -2
  39. package/bundles/linker/index.js +12 -1833
  40. package/bundles/linker/index.js.map +2 -2
  41. package/bundles/ngcc/index.js +27 -16011
  42. package/bundles/ngcc/index.js.map +2 -2
  43. package/bundles/ngcc/main-ngcc.js +19 -16095
  44. package/bundles/ngcc/main-ngcc.js.map +2 -2
  45. package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js +32 -13768
  46. package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js.map +2 -2
  47. package/bundles/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.js +11 -310
  48. package/bundles/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.js.map +2 -2
  49. package/bundles/private/bazel.js +4 -81
  50. package/bundles/private/bazel.js.map +2 -2
  51. package/bundles/private/localize.js +27 -870
  52. package/bundles/private/localize.js.map +2 -2
  53. package/bundles/private/migrations.js +13 -2158
  54. package/bundles/private/migrations.js.map +2 -2
  55. package/bundles/private/tooling.js +8 -931
  56. package/bundles/private/tooling.js.map +2 -2
  57. package/bundles/src/bin/ng_xi18n.js +22 -20419
  58. package/bundles/src/bin/ng_xi18n.js.map +2 -2
  59. package/bundles/src/bin/ngc.js +16 -20432
  60. package/bundles/src/bin/ngc.js.map +2 -2
  61. package/bundles_metadata.json +1 -1
  62. package/linker/src/file_linker/partial_linkers/util.d.ts +2 -2
  63. package/linker/src/file_linker/translator.d.ts +1 -1
  64. package/ngcc/src/packages/build_marker.d.ts +1 -1
  65. package/ngcc/src/packages/entry_point.d.ts +5 -0
  66. package/ngcc/src/rendering/commonjs_rendering_formatter.d.ts +1 -1
  67. package/package.json +2 -2
  68. package/src/ngtsc/typecheck/api/checker.d.ts +1 -1
  69. package/src/ngtsc/typecheck/src/tcb_util.d.ts +1 -1
@@ -3,2167 +3,22 @@
3
3
  const require = __cjsCompatRequire(import.meta.url);
4
4
  const __ESM_IMPORT_META_URL__ = import.meta.url;
5
5
 
6
- var __defProp = Object.defineProperty;
7
- var __defProps = Object.defineProperties;
8
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
9
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
10
- var __hasOwnProp = Object.prototype.hasOwnProperty;
11
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13
- var __spreadValues = (a, b) => {
14
- for (var prop in b || (b = {}))
15
- if (__hasOwnProp.call(b, prop))
16
- __defNormalProp(a, prop, b[prop]);
17
- if (__getOwnPropSymbols)
18
- for (var prop of __getOwnPropSymbols(b)) {
19
- if (__propIsEnum.call(b, prop))
20
- __defNormalProp(a, prop, b[prop]);
21
- }
22
- return a;
23
- };
24
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
25
-
26
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/component.mjs
27
- import { compileClassMetadata as compileClassMetadata3, compileComponentFromMetadata, compileDeclareClassMetadata as compileDeclareClassMetadata3, compileDeclareComponentFromMetadata, CssSelector, DEFAULT_INTERPOLATION_CONFIG, DomElementSchemaRegistry, ExternalExpr as ExternalExpr7, FactoryTarget as FactoryTarget3, InterpolationConfig, makeBindingParser as makeBindingParser2, ParseSourceFile as ParseSourceFile2, parseTemplate, R3TargetBinder, SelectorMatcher, ViewEncapsulation, WrappedNodeExpr as WrappedNodeExpr6 } from "@angular/compiler";
28
- import ts31 from "typescript";
29
-
30
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/error_code.mjs
31
- var ErrorCode;
32
- (function(ErrorCode2) {
33
- ErrorCode2[ErrorCode2["DECORATOR_ARG_NOT_LITERAL"] = 1001] = "DECORATOR_ARG_NOT_LITERAL";
34
- ErrorCode2[ErrorCode2["DECORATOR_ARITY_WRONG"] = 1002] = "DECORATOR_ARITY_WRONG";
35
- ErrorCode2[ErrorCode2["DECORATOR_NOT_CALLED"] = 1003] = "DECORATOR_NOT_CALLED";
36
- ErrorCode2[ErrorCode2["DECORATOR_ON_ANONYMOUS_CLASS"] = 1004] = "DECORATOR_ON_ANONYMOUS_CLASS";
37
- ErrorCode2[ErrorCode2["DECORATOR_UNEXPECTED"] = 1005] = "DECORATOR_UNEXPECTED";
38
- ErrorCode2[ErrorCode2["DECORATOR_COLLISION"] = 1006] = "DECORATOR_COLLISION";
39
- ErrorCode2[ErrorCode2["VALUE_HAS_WRONG_TYPE"] = 1010] = "VALUE_HAS_WRONG_TYPE";
40
- ErrorCode2[ErrorCode2["VALUE_NOT_LITERAL"] = 1011] = "VALUE_NOT_LITERAL";
41
- ErrorCode2[ErrorCode2["COMPONENT_MISSING_TEMPLATE"] = 2001] = "COMPONENT_MISSING_TEMPLATE";
42
- ErrorCode2[ErrorCode2["PIPE_MISSING_NAME"] = 2002] = "PIPE_MISSING_NAME";
43
- ErrorCode2[ErrorCode2["PARAM_MISSING_TOKEN"] = 2003] = "PARAM_MISSING_TOKEN";
44
- ErrorCode2[ErrorCode2["DIRECTIVE_MISSING_SELECTOR"] = 2004] = "DIRECTIVE_MISSING_SELECTOR";
45
- ErrorCode2[ErrorCode2["UNDECORATED_PROVIDER"] = 2005] = "UNDECORATED_PROVIDER";
46
- ErrorCode2[ErrorCode2["DIRECTIVE_INHERITS_UNDECORATED_CTOR"] = 2006] = "DIRECTIVE_INHERITS_UNDECORATED_CTOR";
47
- ErrorCode2[ErrorCode2["UNDECORATED_CLASS_USING_ANGULAR_FEATURES"] = 2007] = "UNDECORATED_CLASS_USING_ANGULAR_FEATURES";
48
- ErrorCode2[ErrorCode2["COMPONENT_RESOURCE_NOT_FOUND"] = 2008] = "COMPONENT_RESOURCE_NOT_FOUND";
49
- ErrorCode2[ErrorCode2["COMPONENT_INVALID_SHADOW_DOM_SELECTOR"] = 2009] = "COMPONENT_INVALID_SHADOW_DOM_SELECTOR";
50
- ErrorCode2[ErrorCode2["SYMBOL_NOT_EXPORTED"] = 3001] = "SYMBOL_NOT_EXPORTED";
51
- ErrorCode2[ErrorCode2["SYMBOL_EXPORTED_UNDER_DIFFERENT_NAME"] = 3002] = "SYMBOL_EXPORTED_UNDER_DIFFERENT_NAME";
52
- ErrorCode2[ErrorCode2["IMPORT_CYCLE_DETECTED"] = 3003] = "IMPORT_CYCLE_DETECTED";
53
- ErrorCode2[ErrorCode2["CONFIG_FLAT_MODULE_NO_INDEX"] = 4001] = "CONFIG_FLAT_MODULE_NO_INDEX";
54
- ErrorCode2[ErrorCode2["CONFIG_STRICT_TEMPLATES_IMPLIES_FULL_TEMPLATE_TYPECHECK"] = 4002] = "CONFIG_STRICT_TEMPLATES_IMPLIES_FULL_TEMPLATE_TYPECHECK";
55
- ErrorCode2[ErrorCode2["HOST_BINDING_PARSE_ERROR"] = 5001] = "HOST_BINDING_PARSE_ERROR";
56
- ErrorCode2[ErrorCode2["TEMPLATE_PARSE_ERROR"] = 5002] = "TEMPLATE_PARSE_ERROR";
57
- ErrorCode2[ErrorCode2["NGMODULE_INVALID_DECLARATION"] = 6001] = "NGMODULE_INVALID_DECLARATION";
58
- ErrorCode2[ErrorCode2["NGMODULE_INVALID_IMPORT"] = 6002] = "NGMODULE_INVALID_IMPORT";
59
- ErrorCode2[ErrorCode2["NGMODULE_INVALID_EXPORT"] = 6003] = "NGMODULE_INVALID_EXPORT";
60
- ErrorCode2[ErrorCode2["NGMODULE_INVALID_REEXPORT"] = 6004] = "NGMODULE_INVALID_REEXPORT";
61
- ErrorCode2[ErrorCode2["NGMODULE_MODULE_WITH_PROVIDERS_MISSING_GENERIC"] = 6005] = "NGMODULE_MODULE_WITH_PROVIDERS_MISSING_GENERIC";
62
- ErrorCode2[ErrorCode2["NGMODULE_REEXPORT_NAME_COLLISION"] = 6006] = "NGMODULE_REEXPORT_NAME_COLLISION";
63
- ErrorCode2[ErrorCode2["NGMODULE_DECLARATION_NOT_UNIQUE"] = 6007] = "NGMODULE_DECLARATION_NOT_UNIQUE";
64
- ErrorCode2[ErrorCode2["NGMODULE_VE_DEPENDENCY_ON_IVY_LIB"] = 6999] = "NGMODULE_VE_DEPENDENCY_ON_IVY_LIB";
65
- ErrorCode2[ErrorCode2["SCHEMA_INVALID_ELEMENT"] = 8001] = "SCHEMA_INVALID_ELEMENT";
66
- ErrorCode2[ErrorCode2["SCHEMA_INVALID_ATTRIBUTE"] = 8002] = "SCHEMA_INVALID_ATTRIBUTE";
67
- ErrorCode2[ErrorCode2["MISSING_REFERENCE_TARGET"] = 8003] = "MISSING_REFERENCE_TARGET";
68
- ErrorCode2[ErrorCode2["MISSING_PIPE"] = 8004] = "MISSING_PIPE";
69
- ErrorCode2[ErrorCode2["WRITE_TO_READ_ONLY_VARIABLE"] = 8005] = "WRITE_TO_READ_ONLY_VARIABLE";
70
- ErrorCode2[ErrorCode2["DUPLICATE_VARIABLE_DECLARATION"] = 8006] = "DUPLICATE_VARIABLE_DECLARATION";
71
- ErrorCode2[ErrorCode2["SPLIT_TWO_WAY_BINDING"] = 8007] = "SPLIT_TWO_WAY_BINDING";
72
- ErrorCode2[ErrorCode2["INVALID_BANANA_IN_BOX"] = 8101] = "INVALID_BANANA_IN_BOX";
73
- ErrorCode2[ErrorCode2["NULLISH_COALESCING_NOT_NULLABLE"] = 8102] = "NULLISH_COALESCING_NOT_NULLABLE";
74
- ErrorCode2[ErrorCode2["INLINE_TCB_REQUIRED"] = 8900] = "INLINE_TCB_REQUIRED";
75
- ErrorCode2[ErrorCode2["INLINE_TYPE_CTOR_REQUIRED"] = 8901] = "INLINE_TYPE_CTOR_REQUIRED";
76
- ErrorCode2[ErrorCode2["INJECTABLE_DUPLICATE_PROV"] = 9001] = "INJECTABLE_DUPLICATE_PROV";
77
- ErrorCode2[ErrorCode2["SUGGEST_STRICT_TEMPLATES"] = 10001] = "SUGGEST_STRICT_TEMPLATES";
78
- ErrorCode2[ErrorCode2["SUGGEST_SUBOPTIMAL_TYPE_INFERENCE"] = 10002] = "SUGGEST_SUBOPTIMAL_TYPE_INFERENCE";
79
- })(ErrorCode || (ErrorCode = {}));
80
-
81
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/docs.mjs
82
- var COMPILER_ERRORS_WITH_GUIDES = new Set([
83
- ErrorCode.DECORATOR_ARG_NOT_LITERAL,
84
- ErrorCode.IMPORT_CYCLE_DETECTED,
85
- ErrorCode.PARAM_MISSING_TOKEN,
86
- ErrorCode.SCHEMA_INVALID_ELEMENT,
87
- ErrorCode.SCHEMA_INVALID_ATTRIBUTE,
88
- ErrorCode.MISSING_REFERENCE_TARGET,
89
- ErrorCode.COMPONENT_INVALID_SHADOW_DOM_SELECTOR
90
- ]);
91
-
92
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/error.mjs
93
- import ts from "typescript";
94
-
95
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/file_system/src/compiler_host.mjs
96
- import {
97
- EOL
98
- } from "os";
99
- import ts2 from "typescript";
100
-
101
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/file_system/src/invalid_file_system.mjs
102
- var InvalidFileSystem = class {
103
- exists(path) {
104
- throw makeError();
105
- }
106
- readFile(path) {
107
- throw makeError();
108
- }
109
- readFileBuffer(path) {
110
- throw makeError();
111
- }
112
- writeFile(path, data, exclusive) {
113
- throw makeError();
114
- }
115
- removeFile(path) {
116
- throw makeError();
117
- }
118
- symlink(target, path) {
119
- throw makeError();
120
- }
121
- readdir(path) {
122
- throw makeError();
123
- }
124
- lstat(path) {
125
- throw makeError();
126
- }
127
- stat(path) {
128
- throw makeError();
129
- }
130
- pwd() {
131
- throw makeError();
132
- }
133
- chdir(path) {
134
- throw makeError();
135
- }
136
- extname(path) {
137
- throw makeError();
138
- }
139
- copyFile(from, to) {
140
- throw makeError();
141
- }
142
- moveFile(from, to) {
143
- throw makeError();
144
- }
145
- ensureDir(path) {
146
- throw makeError();
147
- }
148
- removeDeep(path) {
149
- throw makeError();
150
- }
151
- isCaseSensitive() {
152
- throw makeError();
153
- }
154
- resolve(...paths) {
155
- throw makeError();
156
- }
157
- dirname(file) {
158
- throw makeError();
159
- }
160
- join(basePath, ...paths) {
161
- throw makeError();
162
- }
163
- isRoot(path) {
164
- throw makeError();
165
- }
166
- isRooted(path) {
167
- throw makeError();
168
- }
169
- relative(from, to) {
170
- throw makeError();
171
- }
172
- basename(filePath, extension) {
173
- throw makeError();
174
- }
175
- realpath(filePath) {
176
- throw makeError();
177
- }
178
- getDefaultLibLocation() {
179
- throw makeError();
180
- }
181
- normalize(path) {
182
- throw makeError();
183
- }
184
- };
185
- function makeError() {
186
- return new Error("FileSystem has not been configured. Please call `setFileSystem()` before calling this method.");
187
- }
188
-
189
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/file_system/src/helpers.mjs
190
- var fs = new InvalidFileSystem();
191
- var ABSOLUTE_PATH = Symbol("AbsolutePath");
192
-
193
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/file_system/src/node_js_file_system.mjs
194
- import {
195
- copyFileSync,
196
- existsSync,
197
- lstatSync,
198
- mkdirSync,
199
- readFileSync,
200
- readdirSync,
201
- realpathSync,
202
- renameSync,
203
- rmdirSync,
204
- statSync,
205
- symlinkSync,
206
- unlinkSync,
207
- writeFileSync
208
- } from "fs";
209
- import module from "module";
210
6
  import {
211
- basename,
212
- dirname as dirname2,
213
- extname,
214
- isAbsolute,
215
- join,
216
- relative as relative2,
217
- resolve as resolve2
218
- } from "path";
219
- import { fileURLToPath } from "url";
220
- var isCommonJS = typeof __filename !== "undefined";
221
- var currentFileUrl = isCommonJS ? null : __ESM_IMPORT_META_URL__;
222
- var currentFileName = isCommonJS ? __filename : fileURLToPath(currentFileUrl);
223
-
224
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/alias.mjs
225
- import { ExternalExpr as ExternalExpr2 } from "@angular/compiler";
226
-
227
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/emitter.mjs
228
- import { ExternalExpr, ExternalReference, WrappedNodeExpr } from "@angular/compiler";
229
- import ts5 from "typescript";
230
-
231
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/util/src/typescript.mjs
232
- import ts3 from "typescript";
233
- function identifierOfNode(decl) {
234
- if (decl.name !== void 0 && ts3.isIdentifier(decl.name)) {
235
- return decl.name;
236
- } else {
237
- return null;
238
- }
239
- }
240
- function isDeclaration(node) {
241
- return isValueDeclaration(node) || isTypeDeclaration(node);
242
- }
243
- function isValueDeclaration(node) {
244
- return ts3.isClassDeclaration(node) || ts3.isFunctionDeclaration(node) || ts3.isVariableDeclaration(node);
245
- }
246
- function isTypeDeclaration(node) {
247
- return ts3.isEnumDeclaration(node) || ts3.isTypeAliasDeclaration(node) || ts3.isInterfaceDeclaration(node);
248
- }
249
-
250
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/find_export.mjs
251
- import ts4 from "typescript";
252
-
253
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/emitter.mjs
254
- var ImportFlags;
255
- (function(ImportFlags2) {
256
- ImportFlags2[ImportFlags2["None"] = 0] = "None";
257
- ImportFlags2[ImportFlags2["ForceNewImport"] = 1] = "ForceNewImport";
258
- ImportFlags2[ImportFlags2["NoAliasing"] = 2] = "NoAliasing";
259
- ImportFlags2[ImportFlags2["AllowTypeImports"] = 4] = "AllowTypeImports";
260
- })(ImportFlags || (ImportFlags = {}));
261
-
262
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/core.mjs
263
- var CORE_SUPPORTED_SYMBOLS = new Map([
264
- ["\u0275\u0275defineInjectable", "\u0275\u0275defineInjectable"],
265
- ["\u0275\u0275defineInjector", "\u0275\u0275defineInjector"],
266
- ["\u0275\u0275defineNgModule", "\u0275\u0275defineNgModule"],
267
- ["\u0275\u0275setNgModuleScope", "\u0275\u0275setNgModuleScope"],
268
- ["\u0275\u0275inject", "\u0275\u0275inject"],
269
- ["\u0275\u0275FactoryDeclaration", "\u0275\u0275FactoryDeclaration"],
270
- ["\u0275setClassMetadata", "setClassMetadata"],
271
- ["\u0275\u0275InjectableDeclaration", "\u0275\u0275InjectableDeclaration"],
272
- ["\u0275\u0275InjectorDeclaration", "\u0275\u0275InjectorDeclaration"],
273
- ["\u0275\u0275NgModuleDeclaration", "\u0275\u0275NgModuleDeclaration"],
274
- ["\u0275NgModuleFactory", "NgModuleFactory"],
275
- ["\u0275noSideEffects", "\u0275noSideEffects"]
276
- ]);
277
-
278
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/default.mjs
279
- import ts6 from "typescript";
280
- var DefaultImportDeclaration = Symbol("DefaultImportDeclaration");
281
-
282
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/references.mjs
283
- var Reference = class {
284
- constructor(node, bestGuessOwningModule = null) {
285
- this.node = node;
286
- this.identifiers = [];
287
- this.synthetic = false;
288
- this._alias = null;
289
- this.bestGuessOwningModule = bestGuessOwningModule;
290
- const id = identifierOfNode(node);
291
- if (id !== null) {
292
- this.identifiers.push(id);
293
- }
294
- }
295
- get ownedByModuleGuess() {
296
- if (this.bestGuessOwningModule !== null) {
297
- return this.bestGuessOwningModule.specifier;
298
- } else {
299
- return null;
300
- }
301
- }
302
- get hasOwningModuleGuess() {
303
- return this.bestGuessOwningModule !== null;
304
- }
305
- get debugName() {
306
- const id = identifierOfNode(this.node);
307
- return id !== null ? id.text : null;
308
- }
309
- get alias() {
310
- return this._alias;
311
- }
312
- addIdentifier(identifier) {
313
- this.identifiers.push(identifier);
314
- }
315
- getIdentityIn(context) {
316
- return this.identifiers.find((id) => id.getSourceFile() === context) || null;
317
- }
318
- getIdentityInExpression(expr) {
319
- const sf = expr.getSourceFile();
320
- return this.identifiers.find((id) => {
321
- if (id.getSourceFile() !== sf) {
322
- return false;
323
- }
324
- return id.pos >= expr.pos && id.end <= expr.end;
325
- }) || null;
326
- }
327
- getOriginForDiagnostics(container, fallback = container) {
328
- const id = this.getIdentityInExpression(container);
329
- return id !== null ? id : fallback;
330
- }
331
- cloneWithAlias(alias) {
332
- const ref = new Reference(this.node, this.bestGuessOwningModule);
333
- ref.identifiers = [...this.identifiers];
334
- ref._alias = alias;
335
- return ref;
336
- }
337
- cloneWithNoIdentifiers() {
338
- const ref = new Reference(this.node, this.bestGuessOwningModule);
339
- ref._alias = this._alias;
340
- ref.identifiers = [];
341
- return ref;
342
- }
343
- };
344
-
345
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/api.mjs
346
- import ts7 from "typescript";
347
-
348
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/graph.mjs
349
- import { ExternalExpr as ExternalExpr3 } from "@angular/compiler";
350
-
351
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/type_parameters.mjs
352
- import ts8 from "typescript";
353
-
354
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/api.mjs
355
- var MetaType;
356
- (function(MetaType2) {
357
- MetaType2[MetaType2["Pipe"] = 0] = "Pipe";
358
- MetaType2[MetaType2["Directive"] = 1] = "Directive";
359
- })(MetaType || (MetaType = {}));
360
-
361
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/dts.mjs
362
- import ts14 from "typescript";
363
-
364
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/reflection/src/host.mjs
365
- import ts9 from "typescript";
366
- function isDecoratorIdentifier(exp) {
367
- return ts9.isIdentifier(exp) || ts9.isPropertyAccessExpression(exp) && ts9.isIdentifier(exp.expression) && ts9.isIdentifier(exp.name);
368
- }
369
- var ClassMemberKind;
370
- (function(ClassMemberKind2) {
371
- ClassMemberKind2[ClassMemberKind2["Constructor"] = 0] = "Constructor";
372
- ClassMemberKind2[ClassMemberKind2["Getter"] = 1] = "Getter";
373
- ClassMemberKind2[ClassMemberKind2["Setter"] = 2] = "Setter";
374
- ClassMemberKind2[ClassMemberKind2["Property"] = 3] = "Property";
375
- ClassMemberKind2[ClassMemberKind2["Method"] = 4] = "Method";
376
- })(ClassMemberKind || (ClassMemberKind = {}));
377
- var KnownDeclaration;
378
- (function(KnownDeclaration2) {
379
- KnownDeclaration2[KnownDeclaration2["JsGlobalObject"] = 0] = "JsGlobalObject";
380
- KnownDeclaration2[KnownDeclaration2["TsHelperAssign"] = 1] = "TsHelperAssign";
381
- KnownDeclaration2[KnownDeclaration2["TsHelperSpread"] = 2] = "TsHelperSpread";
382
- KnownDeclaration2[KnownDeclaration2["TsHelperSpreadArrays"] = 3] = "TsHelperSpreadArrays";
383
- KnownDeclaration2[KnownDeclaration2["TsHelperSpreadArray"] = 4] = "TsHelperSpreadArray";
384
- KnownDeclaration2[KnownDeclaration2["TsHelperRead"] = 5] = "TsHelperRead";
385
- })(KnownDeclaration || (KnownDeclaration = {}));
386
- function isConcreteDeclaration(decl) {
387
- return decl.kind === 0;
388
- }
389
-
390
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/reflection/src/type_to_value.mjs
391
- import ts10 from "typescript";
392
- function typeToValue(typeNode, checker) {
393
- if (typeNode === null) {
394
- return missingType();
395
- }
396
- if (!ts10.isTypeReferenceNode(typeNode)) {
397
- return unsupportedType(typeNode);
398
- }
399
- const symbols = resolveTypeSymbols(typeNode, checker);
400
- if (symbols === null) {
401
- return unknownReference(typeNode);
402
- }
403
- const { local, decl } = symbols;
404
- if (decl.valueDeclaration === void 0 || decl.flags & ts10.SymbolFlags.ConstEnum) {
405
- let typeOnlyDecl = null;
406
- if (decl.declarations !== void 0 && decl.declarations.length > 0) {
407
- typeOnlyDecl = decl.declarations[0];
408
- }
409
- return noValueDeclaration(typeNode, typeOnlyDecl);
410
- }
411
- const firstDecl = local.declarations && local.declarations[0];
412
- if (firstDecl !== void 0) {
413
- if (ts10.isImportClause(firstDecl) && firstDecl.name !== void 0) {
414
- if (firstDecl.isTypeOnly) {
415
- return typeOnlyImport(typeNode, firstDecl);
416
- }
417
- return {
418
- kind: 0,
419
- expression: firstDecl.name,
420
- defaultImportStatement: firstDecl.parent
421
- };
422
- } else if (ts10.isImportSpecifier(firstDecl)) {
423
- if (firstDecl.parent.parent.isTypeOnly) {
424
- return typeOnlyImport(typeNode, firstDecl.parent.parent);
425
- }
426
- const importedName = (firstDecl.propertyName || firstDecl.name).text;
427
- const [_localName, ...nestedPath] = symbols.symbolNames;
428
- const moduleName = extractModuleName(firstDecl.parent.parent.parent);
429
- return {
430
- kind: 1,
431
- valueDeclaration: decl.valueDeclaration,
432
- moduleName,
433
- importedName,
434
- nestedPath
435
- };
436
- } else if (ts10.isNamespaceImport(firstDecl)) {
437
- if (firstDecl.parent.isTypeOnly) {
438
- return typeOnlyImport(typeNode, firstDecl.parent);
439
- }
440
- if (symbols.symbolNames.length === 1) {
441
- return namespaceImport(typeNode, firstDecl.parent);
442
- }
443
- const [_ns, importedName, ...nestedPath] = symbols.symbolNames;
444
- const moduleName = extractModuleName(firstDecl.parent.parent);
445
- return {
446
- kind: 1,
447
- valueDeclaration: decl.valueDeclaration,
448
- moduleName,
449
- importedName,
450
- nestedPath
451
- };
452
- }
453
- }
454
- const expression = typeNodeToValueExpr(typeNode);
455
- if (expression !== null) {
456
- return {
457
- kind: 0,
458
- expression,
459
- defaultImportStatement: null
460
- };
461
- } else {
462
- return unsupportedType(typeNode);
463
- }
464
- }
465
- function unsupportedType(typeNode) {
466
- return {
467
- kind: 2,
468
- reason: { kind: 5, typeNode }
469
- };
470
- }
471
- function noValueDeclaration(typeNode, decl) {
472
- return {
473
- kind: 2,
474
- reason: { kind: 1, typeNode, decl }
475
- };
476
- }
477
- function typeOnlyImport(typeNode, importClause) {
478
- return {
479
- kind: 2,
480
- reason: { kind: 2, typeNode, importClause }
481
- };
482
- }
483
- function unknownReference(typeNode) {
484
- return {
485
- kind: 2,
486
- reason: { kind: 3, typeNode }
487
- };
488
- }
489
- function namespaceImport(typeNode, importClause) {
490
- return {
491
- kind: 2,
492
- reason: { kind: 4, typeNode, importClause }
493
- };
494
- }
495
- function missingType() {
496
- return {
497
- kind: 2,
498
- reason: { kind: 0 }
499
- };
500
- }
501
- function typeNodeToValueExpr(node) {
502
- if (ts10.isTypeReferenceNode(node)) {
503
- return entityNameToValue(node.typeName);
504
- } else {
505
- return null;
506
- }
507
- }
508
- function resolveTypeSymbols(typeRef, checker) {
509
- const typeName = typeRef.typeName;
510
- const typeRefSymbol = checker.getSymbolAtLocation(typeName);
511
- if (typeRefSymbol === void 0) {
512
- return null;
513
- }
514
- let local = typeRefSymbol;
515
- let leftMost = typeName;
516
- const symbolNames = [];
517
- while (ts10.isQualifiedName(leftMost)) {
518
- symbolNames.unshift(leftMost.right.text);
519
- leftMost = leftMost.left;
520
- }
521
- symbolNames.unshift(leftMost.text);
522
- if (leftMost !== typeName) {
523
- const localTmp = checker.getSymbolAtLocation(leftMost);
524
- if (localTmp !== void 0) {
525
- local = localTmp;
526
- }
527
- }
528
- let decl = typeRefSymbol;
529
- if (typeRefSymbol.flags & ts10.SymbolFlags.Alias) {
530
- decl = checker.getAliasedSymbol(typeRefSymbol);
531
- }
532
- return { local, decl, symbolNames };
533
- }
534
- function entityNameToValue(node) {
535
- if (ts10.isQualifiedName(node)) {
536
- const left = entityNameToValue(node.left);
537
- return left !== null ? ts10.createPropertyAccess(left, node.right) : null;
538
- } else if (ts10.isIdentifier(node)) {
539
- return ts10.getMutableClone(node);
540
- } else {
541
- return null;
542
- }
543
- }
544
- function extractModuleName(node) {
545
- if (!ts10.isStringLiteral(node.moduleSpecifier)) {
546
- throw new Error("not a module specifier");
547
- }
548
- return node.moduleSpecifier.text;
549
- }
550
-
551
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/reflection/src/typescript.mjs
552
- import ts12 from "typescript";
553
-
554
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/reflection/src/util.mjs
555
- import ts11 from "typescript";
556
- function isNamedClassDeclaration(node) {
557
- return ts11.isClassDeclaration(node) && isIdentifier(node.name);
558
- }
559
- function isIdentifier(node) {
560
- return node !== void 0 && ts11.isIdentifier(node);
561
- }
562
-
563
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/reflection/src/typescript.mjs
564
- var TypeScriptReflectionHost = class {
565
- constructor(checker) {
566
- this.checker = checker;
567
- }
568
- getDecoratorsOfDeclaration(declaration) {
569
- if (declaration.decorators === void 0 || declaration.decorators.length === 0) {
570
- return null;
571
- }
572
- return declaration.decorators.map((decorator) => this._reflectDecorator(decorator)).filter((dec) => dec !== null);
573
- }
574
- getMembersOfClass(clazz) {
575
- const tsClazz = castDeclarationToClassOrDie(clazz);
576
- return tsClazz.members.map((member) => this._reflectMember(member)).filter((member) => member !== null);
577
- }
578
- getConstructorParameters(clazz) {
579
- const tsClazz = castDeclarationToClassOrDie(clazz);
580
- const isDeclaration2 = tsClazz.getSourceFile().isDeclarationFile;
581
- const ctor = tsClazz.members.find((member) => ts12.isConstructorDeclaration(member) && (isDeclaration2 || member.body !== void 0));
582
- if (ctor === void 0) {
583
- return null;
584
- }
585
- return ctor.parameters.map((node) => {
586
- const name = parameterName(node.name);
587
- const decorators = this.getDecoratorsOfDeclaration(node);
588
- let originalTypeNode = node.type || null;
589
- let typeNode = originalTypeNode;
590
- if (typeNode && ts12.isUnionTypeNode(typeNode)) {
591
- let childTypeNodes = typeNode.types.filter((childTypeNode) => !(ts12.isLiteralTypeNode(childTypeNode) && childTypeNode.literal.kind === ts12.SyntaxKind.NullKeyword));
592
- if (childTypeNodes.length === 1) {
593
- typeNode = childTypeNodes[0];
594
- }
595
- }
596
- const typeValueReference = typeToValue(typeNode, this.checker);
597
- return {
598
- name,
599
- nameNode: node.name,
600
- typeValueReference,
601
- typeNode: originalTypeNode,
602
- decorators
603
- };
604
- });
605
- }
606
- getImportOfIdentifier(id) {
607
- const directImport = this.getDirectImportOfIdentifier(id);
608
- if (directImport !== null) {
609
- return directImport;
610
- } else if (ts12.isQualifiedName(id.parent) && id.parent.right === id) {
611
- return this.getImportOfNamespacedIdentifier(id, getQualifiedNameRoot(id.parent));
612
- } else if (ts12.isPropertyAccessExpression(id.parent) && id.parent.name === id) {
613
- return this.getImportOfNamespacedIdentifier(id, getFarLeftIdentifier(id.parent));
614
- } else {
615
- return null;
616
- }
617
- }
618
- getExportsOfModule(node) {
619
- if (!ts12.isSourceFile(node)) {
620
- throw new Error(`getExportsOfModule() called on non-SourceFile in TS code`);
621
- }
622
- const symbol = this.checker.getSymbolAtLocation(node);
623
- if (symbol === void 0) {
624
- return null;
625
- }
626
- const map = new Map();
627
- this.checker.getExportsOfModule(symbol).forEach((exportSymbol) => {
628
- const decl = this.getDeclarationOfSymbol(exportSymbol, null);
629
- if (decl !== null) {
630
- map.set(exportSymbol.name, decl);
631
- }
632
- });
633
- return map;
634
- }
635
- isClass(node) {
636
- return isNamedClassDeclaration(node);
637
- }
638
- hasBaseClass(clazz) {
639
- return this.getBaseClassExpression(clazz) !== null;
640
- }
641
- getBaseClassExpression(clazz) {
642
- if (!(ts12.isClassDeclaration(clazz) || ts12.isClassExpression(clazz)) || clazz.heritageClauses === void 0) {
643
- return null;
644
- }
645
- const extendsClause = clazz.heritageClauses.find((clause) => clause.token === ts12.SyntaxKind.ExtendsKeyword);
646
- if (extendsClause === void 0) {
647
- return null;
648
- }
649
- const extendsType = extendsClause.types[0];
650
- if (extendsType === void 0) {
651
- return null;
652
- }
653
- return extendsType.expression;
654
- }
655
- getDeclarationOfIdentifier(id) {
656
- let symbol = this.checker.getSymbolAtLocation(id);
657
- if (symbol === void 0) {
658
- return null;
659
- }
660
- return this.getDeclarationOfSymbol(symbol, id);
661
- }
662
- getDefinitionOfFunction(node) {
663
- if (!ts12.isFunctionDeclaration(node) && !ts12.isMethodDeclaration(node) && !ts12.isFunctionExpression(node)) {
664
- return null;
665
- }
666
- return {
667
- node,
668
- body: node.body !== void 0 ? Array.from(node.body.statements) : null,
669
- parameters: node.parameters.map((param) => {
670
- const name = parameterName(param.name);
671
- const initializer = param.initializer || null;
672
- return { name, node: param, initializer };
673
- })
674
- };
675
- }
676
- getGenericArityOfClass(clazz) {
677
- if (!ts12.isClassDeclaration(clazz)) {
678
- return null;
679
- }
680
- return clazz.typeParameters !== void 0 ? clazz.typeParameters.length : 0;
681
- }
682
- getVariableValue(declaration) {
683
- return declaration.initializer || null;
684
- }
685
- getDtsDeclaration(_) {
686
- return null;
687
- }
688
- getInternalNameOfClass(clazz) {
689
- return clazz.name;
690
- }
691
- getAdjacentNameOfClass(clazz) {
692
- return clazz.name;
693
- }
694
- isStaticallyExported(decl) {
695
- let topLevel = decl;
696
- if (ts12.isVariableDeclaration(decl) && ts12.isVariableDeclarationList(decl.parent)) {
697
- topLevel = decl.parent.parent;
698
- }
699
- if (topLevel.modifiers !== void 0 && topLevel.modifiers.some((modifier) => modifier.kind === ts12.SyntaxKind.ExportKeyword)) {
700
- return true;
701
- }
702
- if (topLevel.parent === void 0 || !ts12.isSourceFile(topLevel.parent)) {
703
- return false;
704
- }
705
- const localExports = this.getLocalExportedDeclarationsOfSourceFile(decl.getSourceFile());
706
- return localExports.has(decl);
707
- }
708
- getDirectImportOfIdentifier(id) {
709
- const symbol = this.checker.getSymbolAtLocation(id);
710
- if (symbol === void 0 || symbol.declarations === void 0 || symbol.declarations.length !== 1) {
711
- return null;
712
- }
713
- const decl = symbol.declarations[0];
714
- const importDecl = getContainingImportDeclaration(decl);
715
- if (importDecl === null) {
716
- return null;
717
- }
718
- if (!ts12.isStringLiteral(importDecl.moduleSpecifier)) {
719
- return null;
720
- }
721
- return { from: importDecl.moduleSpecifier.text, name: getExportedName(decl, id) };
722
- }
723
- getImportOfNamespacedIdentifier(id, namespaceIdentifier) {
724
- if (namespaceIdentifier === null) {
725
- return null;
726
- }
727
- const namespaceSymbol = this.checker.getSymbolAtLocation(namespaceIdentifier);
728
- if (!namespaceSymbol || namespaceSymbol.declarations === void 0) {
729
- return null;
730
- }
731
- const declaration = namespaceSymbol.declarations.length === 1 ? namespaceSymbol.declarations[0] : null;
732
- if (!declaration) {
733
- return null;
734
- }
735
- const namespaceDeclaration = ts12.isNamespaceImport(declaration) ? declaration : null;
736
- if (!namespaceDeclaration) {
737
- return null;
738
- }
739
- const importDeclaration = namespaceDeclaration.parent.parent;
740
- if (!ts12.isStringLiteral(importDeclaration.moduleSpecifier)) {
741
- return null;
742
- }
743
- return {
744
- from: importDeclaration.moduleSpecifier.text,
745
- name: id.text
746
- };
747
- }
748
- getDeclarationOfSymbol(symbol, originalId) {
749
- let valueDeclaration = void 0;
750
- if (symbol.valueDeclaration !== void 0) {
751
- valueDeclaration = symbol.valueDeclaration;
752
- } else if (symbol.declarations !== void 0 && symbol.declarations.length > 0) {
753
- valueDeclaration = symbol.declarations[0];
754
- }
755
- if (valueDeclaration !== void 0 && ts12.isShorthandPropertyAssignment(valueDeclaration)) {
756
- const shorthandSymbol = this.checker.getShorthandAssignmentValueSymbol(valueDeclaration);
757
- if (shorthandSymbol === void 0) {
758
- return null;
759
- }
760
- return this.getDeclarationOfSymbol(shorthandSymbol, originalId);
761
- } else if (valueDeclaration !== void 0 && ts12.isExportSpecifier(valueDeclaration)) {
762
- const targetSymbol = this.checker.getExportSpecifierLocalTargetSymbol(valueDeclaration);
763
- if (targetSymbol === void 0) {
764
- return null;
765
- }
766
- return this.getDeclarationOfSymbol(targetSymbol, originalId);
767
- }
768
- const importInfo = originalId && this.getImportOfIdentifier(originalId);
769
- const viaModule = importInfo !== null && importInfo.from !== null && !importInfo.from.startsWith(".") ? importInfo.from : null;
770
- while (symbol.flags & ts12.SymbolFlags.Alias) {
771
- symbol = this.checker.getAliasedSymbol(symbol);
772
- }
773
- if (symbol.valueDeclaration !== void 0) {
774
- return {
775
- node: symbol.valueDeclaration,
776
- known: null,
777
- viaModule,
778
- identity: null,
779
- kind: 0
780
- };
781
- } else if (symbol.declarations !== void 0 && symbol.declarations.length > 0) {
782
- return {
783
- node: symbol.declarations[0],
784
- known: null,
785
- viaModule,
786
- identity: null,
787
- kind: 0
788
- };
789
- } else {
790
- return null;
791
- }
792
- }
793
- _reflectDecorator(node) {
794
- let decoratorExpr = node.expression;
795
- let args = null;
796
- if (ts12.isCallExpression(decoratorExpr)) {
797
- args = Array.from(decoratorExpr.arguments);
798
- decoratorExpr = decoratorExpr.expression;
799
- }
800
- if (!isDecoratorIdentifier(decoratorExpr)) {
801
- return null;
802
- }
803
- const decoratorIdentifier = ts12.isIdentifier(decoratorExpr) ? decoratorExpr : decoratorExpr.name;
804
- const importDecl = this.getImportOfIdentifier(decoratorIdentifier);
805
- return {
806
- name: decoratorIdentifier.text,
807
- identifier: decoratorExpr,
808
- import: importDecl,
809
- node,
810
- args
811
- };
812
- }
813
- _reflectMember(node) {
814
- let kind = null;
815
- let value = null;
816
- let name = null;
817
- let nameNode = null;
818
- if (ts12.isPropertyDeclaration(node)) {
819
- kind = ClassMemberKind.Property;
820
- value = node.initializer || null;
821
- } else if (ts12.isGetAccessorDeclaration(node)) {
822
- kind = ClassMemberKind.Getter;
823
- } else if (ts12.isSetAccessorDeclaration(node)) {
824
- kind = ClassMemberKind.Setter;
825
- } else if (ts12.isMethodDeclaration(node)) {
826
- kind = ClassMemberKind.Method;
827
- } else if (ts12.isConstructorDeclaration(node)) {
828
- kind = ClassMemberKind.Constructor;
829
- } else {
830
- return null;
831
- }
832
- if (ts12.isConstructorDeclaration(node)) {
833
- name = "constructor";
834
- } else if (ts12.isIdentifier(node.name)) {
835
- name = node.name.text;
836
- nameNode = node.name;
837
- } else if (ts12.isStringLiteral(node.name)) {
838
- name = node.name.text;
839
- nameNode = node.name;
840
- } else {
841
- return null;
842
- }
843
- const decorators = this.getDecoratorsOfDeclaration(node);
844
- const isStatic = node.modifiers !== void 0 && node.modifiers.some((mod) => mod.kind === ts12.SyntaxKind.StaticKeyword);
845
- return {
846
- node,
847
- implementation: node,
848
- kind,
849
- type: node.type || null,
850
- name,
851
- nameNode,
852
- decorators,
853
- value,
854
- isStatic
855
- };
856
- }
857
- getLocalExportedDeclarationsOfSourceFile(file) {
858
- const cacheSf = file;
859
- if (cacheSf[LocalExportedDeclarations] !== void 0) {
860
- return cacheSf[LocalExportedDeclarations];
861
- }
862
- const exportSet = new Set();
863
- cacheSf[LocalExportedDeclarations] = exportSet;
864
- const sfSymbol = this.checker.getSymbolAtLocation(cacheSf);
865
- if (sfSymbol === void 0 || sfSymbol.exports === void 0) {
866
- return exportSet;
867
- }
868
- const iter = sfSymbol.exports.values();
869
- let item = iter.next();
870
- while (item.done !== true) {
871
- let exportedSymbol = item.value;
872
- if (exportedSymbol.flags & ts12.SymbolFlags.Alias) {
873
- exportedSymbol = this.checker.getAliasedSymbol(exportedSymbol);
874
- }
875
- if (exportedSymbol.valueDeclaration !== void 0 && exportedSymbol.valueDeclaration.getSourceFile() === file) {
876
- exportSet.add(exportedSymbol.valueDeclaration);
877
- }
878
- item = iter.next();
879
- }
880
- return exportSet;
881
- }
882
- };
883
- function reflectObjectLiteral(node) {
884
- const map = new Map();
885
- node.properties.forEach((prop) => {
886
- if (ts12.isPropertyAssignment(prop)) {
887
- const name = propertyNameToString(prop.name);
888
- if (name === null) {
889
- return;
890
- }
891
- map.set(name, prop.initializer);
892
- } else if (ts12.isShorthandPropertyAssignment(prop)) {
893
- map.set(prop.name.text, prop.name);
894
- } else {
895
- return;
896
- }
897
- });
898
- return map;
899
- }
900
- function castDeclarationToClassOrDie(declaration) {
901
- if (!ts12.isClassDeclaration(declaration)) {
902
- throw new Error(`Reflecting on a ${ts12.SyntaxKind[declaration.kind]} instead of a ClassDeclaration.`);
903
- }
904
- return declaration;
905
- }
906
- function parameterName(name) {
907
- if (ts12.isIdentifier(name)) {
908
- return name.text;
909
- } else {
910
- return null;
911
- }
912
- }
913
- function propertyNameToString(node) {
914
- if (ts12.isIdentifier(node) || ts12.isStringLiteral(node) || ts12.isNumericLiteral(node)) {
915
- return node.text;
916
- } else {
917
- return null;
918
- }
919
- }
920
- function getQualifiedNameRoot(qualifiedName) {
921
- while (ts12.isQualifiedName(qualifiedName.left)) {
922
- qualifiedName = qualifiedName.left;
923
- }
924
- return ts12.isIdentifier(qualifiedName.left) ? qualifiedName.left : null;
925
- }
926
- function getFarLeftIdentifier(propertyAccess) {
927
- while (ts12.isPropertyAccessExpression(propertyAccess.expression)) {
928
- propertyAccess = propertyAccess.expression;
929
- }
930
- return ts12.isIdentifier(propertyAccess.expression) ? propertyAccess.expression : null;
931
- }
932
- function getContainingImportDeclaration(node) {
933
- return ts12.isImportSpecifier(node) ? node.parent.parent.parent : ts12.isNamespaceImport(node) ? node.parent.parent : null;
934
- }
935
- function getExportedName(decl, originalId) {
936
- return ts12.isImportSpecifier(decl) ? (decl.propertyName !== void 0 ? decl.propertyName : decl.name).text : originalId.text;
937
- }
938
- var LocalExportedDeclarations = Symbol("LocalExportedDeclarations");
939
-
940
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/property_mapping.mjs
941
- var ClassPropertyMapping = class {
942
- constructor(forwardMap) {
943
- this.forwardMap = forwardMap;
944
- this.reverseMap = reverseMapFromForwardMap(forwardMap);
945
- }
946
- static empty() {
947
- return new ClassPropertyMapping(new Map());
948
- }
949
- static fromMappedObject(obj) {
950
- const forwardMap = new Map();
951
- for (const classPropertyName of Object.keys(obj)) {
952
- const value = obj[classPropertyName];
953
- const bindingPropertyName = Array.isArray(value) ? value[0] : value;
954
- const inputOrOutput = { classPropertyName, bindingPropertyName };
955
- forwardMap.set(classPropertyName, inputOrOutput);
956
- }
957
- return new ClassPropertyMapping(forwardMap);
958
- }
959
- static merge(a, b) {
960
- const forwardMap = new Map(a.forwardMap.entries());
961
- for (const [classPropertyName, inputOrOutput] of b.forwardMap) {
962
- forwardMap.set(classPropertyName, inputOrOutput);
963
- }
964
- return new ClassPropertyMapping(forwardMap);
965
- }
966
- get classPropertyNames() {
967
- return Array.from(this.forwardMap.keys());
968
- }
969
- get propertyNames() {
970
- return Array.from(this.reverseMap.keys());
971
- }
972
- hasBindingPropertyName(propertyName) {
973
- return this.reverseMap.has(propertyName);
974
- }
975
- getByBindingPropertyName(propertyName) {
976
- return this.reverseMap.has(propertyName) ? this.reverseMap.get(propertyName) : null;
977
- }
978
- getByClassPropertyName(classPropertyName) {
979
- return this.forwardMap.has(classPropertyName) ? this.forwardMap.get(classPropertyName) : null;
980
- }
981
- toDirectMappedObject() {
982
- const obj = {};
983
- for (const [classPropertyName, inputOrOutput] of this.forwardMap) {
984
- obj[classPropertyName] = inputOrOutput.bindingPropertyName;
985
- }
986
- return obj;
987
- }
988
- toJointMappedObject() {
989
- const obj = {};
990
- for (const [classPropertyName, inputOrOutput] of this.forwardMap) {
991
- if (inputOrOutput.bindingPropertyName === classPropertyName) {
992
- obj[classPropertyName] = inputOrOutput.bindingPropertyName;
993
- } else {
994
- obj[classPropertyName] = [inputOrOutput.bindingPropertyName, classPropertyName];
995
- }
996
- }
997
- return obj;
998
- }
999
- *[Symbol.iterator]() {
1000
- for (const [classPropertyName, inputOrOutput] of this.forwardMap.entries()) {
1001
- yield [classPropertyName, inputOrOutput.bindingPropertyName];
1002
- }
1003
- }
1004
- };
1005
- function reverseMapFromForwardMap(forwardMap) {
1006
- const reverseMap = new Map();
1007
- for (const [_, inputOrOutput] of forwardMap) {
1008
- if (!reverseMap.has(inputOrOutput.bindingPropertyName)) {
1009
- reverseMap.set(inputOrOutput.bindingPropertyName, []);
1010
- }
1011
- reverseMap.get(inputOrOutput.bindingPropertyName).push(inputOrOutput);
1012
- }
1013
- return reverseMap;
1014
- }
1015
-
1016
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/util.mjs
1017
- import ts13 from "typescript";
1018
-
1019
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/diagnostics.mjs
1020
- import ts15 from "typescript";
1021
-
1022
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/dynamic.mjs
1023
- var DynamicValue = class {
1024
- constructor(node, reason, code) {
1025
- this.node = node;
1026
- this.reason = reason;
1027
- this.code = code;
1028
- }
1029
- static fromDynamicInput(node, input) {
1030
- return new DynamicValue(node, input, 0);
1031
- }
1032
- static fromDynamicString(node) {
1033
- return new DynamicValue(node, void 0, 1);
1034
- }
1035
- static fromExternalReference(node, ref) {
1036
- return new DynamicValue(node, ref, 2);
1037
- }
1038
- static fromUnsupportedSyntax(node) {
1039
- return new DynamicValue(node, void 0, 3);
1040
- }
1041
- static fromUnknownIdentifier(node) {
1042
- return new DynamicValue(node, void 0, 4);
1043
- }
1044
- static fromInvalidExpressionType(node, value) {
1045
- return new DynamicValue(node, value, 5);
1046
- }
1047
- static fromComplexFunctionCall(node, fn) {
1048
- return new DynamicValue(node, fn, 6);
1049
- }
1050
- static fromDynamicType(node) {
1051
- return new DynamicValue(node, void 0, 7);
1052
- }
1053
- static fromUnknown(node) {
1054
- return new DynamicValue(node, void 0, 8);
1055
- }
1056
- isFromDynamicInput() {
1057
- return this.code === 0;
1058
- }
1059
- isFromDynamicString() {
1060
- return this.code === 1;
1061
- }
1062
- isFromExternalReference() {
1063
- return this.code === 2;
1064
- }
1065
- isFromUnsupportedSyntax() {
1066
- return this.code === 3;
1067
- }
1068
- isFromUnknownIdentifier() {
1069
- return this.code === 4;
1070
- }
1071
- isFromInvalidExpressionType() {
1072
- return this.code === 5;
1073
- }
1074
- isFromComplexFunctionCall() {
1075
- return this.code === 6;
1076
- }
1077
- isFromDynamicType() {
1078
- return this.code === 7;
1079
- }
1080
- isFromUnknown() {
1081
- return this.code === 8;
1082
- }
1083
- accept(visitor) {
1084
- switch (this.code) {
1085
- case 0:
1086
- return visitor.visitDynamicInput(this);
1087
- case 1:
1088
- return visitor.visitDynamicString(this);
1089
- case 2:
1090
- return visitor.visitExternalReference(this);
1091
- case 3:
1092
- return visitor.visitUnsupportedSyntax(this);
1093
- case 4:
1094
- return visitor.visitUnknownIdentifier(this);
1095
- case 5:
1096
- return visitor.visitInvalidExpressionType(this);
1097
- case 6:
1098
- return visitor.visitComplexFunctionCall(this);
1099
- case 7:
1100
- return visitor.visitDynamicType(this);
1101
- case 8:
1102
- return visitor.visitUnknown(this);
1103
- }
1104
- }
1105
- };
1106
-
1107
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/result.mjs
1108
- var ResolvedModule = class {
1109
- constructor(exports, evaluate) {
1110
- this.exports = exports;
1111
- this.evaluate = evaluate;
1112
- }
1113
- getExport(name) {
1114
- if (!this.exports.has(name)) {
1115
- return void 0;
1116
- }
1117
- return this.evaluate(this.exports.get(name));
1118
- }
1119
- getExports() {
1120
- const map = new Map();
1121
- this.exports.forEach((decl, name) => {
1122
- map.set(name, this.evaluate(decl));
1123
- });
1124
- return map;
1125
- }
1126
- };
1127
- var EnumValue = class {
1128
- constructor(enumRef, name, resolved) {
1129
- this.enumRef = enumRef;
1130
- this.name = name;
1131
- this.resolved = resolved;
1132
- }
1133
- };
1134
- var KnownFn = class {
1135
- };
1136
-
1137
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/interpreter.mjs
1138
- import ts16 from "typescript";
1139
-
1140
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/builtin.mjs
1141
- var ArraySliceBuiltinFn = class extends KnownFn {
1142
- constructor(lhs) {
1143
- super();
1144
- this.lhs = lhs;
1145
- }
1146
- evaluate(node, args) {
1147
- if (args.length === 0) {
1148
- return this.lhs;
1149
- } else {
1150
- return DynamicValue.fromUnknown(node);
1151
- }
1152
- }
1153
- };
1154
- var ArrayConcatBuiltinFn = class extends KnownFn {
1155
- constructor(lhs) {
1156
- super();
1157
- this.lhs = lhs;
1158
- }
1159
- evaluate(node, args) {
1160
- const result = [...this.lhs];
1161
- for (const arg of args) {
1162
- if (arg instanceof DynamicValue) {
1163
- result.push(DynamicValue.fromDynamicInput(node, arg));
1164
- } else if (Array.isArray(arg)) {
1165
- result.push(...arg);
1166
- } else {
1167
- result.push(arg);
1168
- }
1169
- }
1170
- return result;
1171
- }
1172
- };
1173
- var ObjectAssignBuiltinFn = class extends KnownFn {
1174
- evaluate(node, args) {
1175
- if (args.length === 0) {
1176
- return DynamicValue.fromUnsupportedSyntax(node);
1177
- }
1178
- for (const arg of args) {
1179
- if (arg instanceof DynamicValue) {
1180
- return DynamicValue.fromDynamicInput(node, arg);
1181
- } else if (!(arg instanceof Map)) {
1182
- return DynamicValue.fromUnsupportedSyntax(node);
1183
- }
1184
- }
1185
- const [target, ...sources] = args;
1186
- for (const source of sources) {
1187
- source.forEach((value, key) => target.set(key, value));
1188
- }
1189
- return target;
1190
- }
1191
- };
1192
-
1193
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/ts_helpers.mjs
1194
- var AssignHelperFn = class extends ObjectAssignBuiltinFn {
1195
- };
1196
- var SpreadHelperFn = class extends KnownFn {
1197
- evaluate(node, args) {
1198
- const result = [];
1199
- for (const arg of args) {
1200
- if (arg instanceof DynamicValue) {
1201
- result.push(DynamicValue.fromDynamicInput(node, arg));
1202
- } else if (Array.isArray(arg)) {
1203
- result.push(...arg);
1204
- } else {
1205
- result.push(arg);
1206
- }
1207
- }
1208
- return result;
1209
- }
1210
- };
1211
- var SpreadArrayHelperFn = class extends KnownFn {
1212
- evaluate(node, args) {
1213
- if (args.length !== 2 && args.length !== 3) {
1214
- return DynamicValue.fromUnknown(node);
1215
- }
1216
- const [to, from] = args;
1217
- if (to instanceof DynamicValue) {
1218
- return DynamicValue.fromDynamicInput(node, to);
1219
- } else if (from instanceof DynamicValue) {
1220
- return DynamicValue.fromDynamicInput(node, from);
1221
- }
1222
- if (!Array.isArray(to)) {
1223
- return DynamicValue.fromInvalidExpressionType(node, to);
1224
- } else if (!Array.isArray(from)) {
1225
- return DynamicValue.fromInvalidExpressionType(node, from);
1226
- }
1227
- return to.concat(from);
1228
- }
1229
- };
1230
- var ReadHelperFn = class extends KnownFn {
1231
- evaluate(node, args) {
1232
- if (args.length !== 1) {
1233
- return DynamicValue.fromUnknown(node);
1234
- }
1235
- const [value] = args;
1236
- if (value instanceof DynamicValue) {
1237
- return DynamicValue.fromDynamicInput(node, value);
1238
- }
1239
- if (!Array.isArray(value)) {
1240
- return DynamicValue.fromInvalidExpressionType(node, value);
1241
- }
1242
- return value;
1243
- }
1244
- };
1245
-
1246
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/known_declaration.mjs
1247
- var jsGlobalObjectValue = new Map([["assign", new ObjectAssignBuiltinFn()]]);
1248
- var assignTsHelperFn = new AssignHelperFn();
1249
- var spreadTsHelperFn = new SpreadHelperFn();
1250
- var spreadArrayTsHelperFn = new SpreadArrayHelperFn();
1251
- var readTsHelperFn = new ReadHelperFn();
1252
- function resolveKnownDeclaration(decl) {
1253
- switch (decl) {
1254
- case KnownDeclaration.JsGlobalObject:
1255
- return jsGlobalObjectValue;
1256
- case KnownDeclaration.TsHelperAssign:
1257
- return assignTsHelperFn;
1258
- case KnownDeclaration.TsHelperSpread:
1259
- case KnownDeclaration.TsHelperSpreadArrays:
1260
- return spreadTsHelperFn;
1261
- case KnownDeclaration.TsHelperSpreadArray:
1262
- return spreadArrayTsHelperFn;
1263
- case KnownDeclaration.TsHelperRead:
1264
- return readTsHelperFn;
1265
- default:
1266
- throw new Error(`Cannot resolve known declaration. Received: ${KnownDeclaration[decl]}.`);
1267
- }
1268
- }
1269
-
1270
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/interpreter.mjs
1271
- function literalBinaryOp(op) {
1272
- return { op, literal: true };
1273
- }
1274
- function referenceBinaryOp(op) {
1275
- return { op, literal: false };
1276
- }
1277
- var BINARY_OPERATORS = new Map([
1278
- [ts16.SyntaxKind.PlusToken, literalBinaryOp((a, b) => a + b)],
1279
- [ts16.SyntaxKind.MinusToken, literalBinaryOp((a, b) => a - b)],
1280
- [ts16.SyntaxKind.AsteriskToken, literalBinaryOp((a, b) => a * b)],
1281
- [ts16.SyntaxKind.SlashToken, literalBinaryOp((a, b) => a / b)],
1282
- [ts16.SyntaxKind.PercentToken, literalBinaryOp((a, b) => a % b)],
1283
- [ts16.SyntaxKind.AmpersandToken, literalBinaryOp((a, b) => a & b)],
1284
- [ts16.SyntaxKind.BarToken, literalBinaryOp((a, b) => a | b)],
1285
- [ts16.SyntaxKind.CaretToken, literalBinaryOp((a, b) => a ^ b)],
1286
- [ts16.SyntaxKind.LessThanToken, literalBinaryOp((a, b) => a < b)],
1287
- [ts16.SyntaxKind.LessThanEqualsToken, literalBinaryOp((a, b) => a <= b)],
1288
- [ts16.SyntaxKind.GreaterThanToken, literalBinaryOp((a, b) => a > b)],
1289
- [ts16.SyntaxKind.GreaterThanEqualsToken, literalBinaryOp((a, b) => a >= b)],
1290
- [ts16.SyntaxKind.EqualsEqualsToken, literalBinaryOp((a, b) => a == b)],
1291
- [ts16.SyntaxKind.EqualsEqualsEqualsToken, literalBinaryOp((a, b) => a === b)],
1292
- [ts16.SyntaxKind.ExclamationEqualsToken, literalBinaryOp((a, b) => a != b)],
1293
- [ts16.SyntaxKind.ExclamationEqualsEqualsToken, literalBinaryOp((a, b) => a !== b)],
1294
- [ts16.SyntaxKind.LessThanLessThanToken, literalBinaryOp((a, b) => a << b)],
1295
- [ts16.SyntaxKind.GreaterThanGreaterThanToken, literalBinaryOp((a, b) => a >> b)],
1296
- [ts16.SyntaxKind.GreaterThanGreaterThanGreaterThanToken, literalBinaryOp((a, b) => a >>> b)],
1297
- [ts16.SyntaxKind.AsteriskAsteriskToken, literalBinaryOp((a, b) => Math.pow(a, b))],
1298
- [ts16.SyntaxKind.AmpersandAmpersandToken, referenceBinaryOp((a, b) => a && b)],
1299
- [ts16.SyntaxKind.BarBarToken, referenceBinaryOp((a, b) => a || b)]
1300
- ]);
1301
- var UNARY_OPERATORS = new Map([
1302
- [ts16.SyntaxKind.TildeToken, (a) => ~a],
1303
- [ts16.SyntaxKind.MinusToken, (a) => -a],
1304
- [ts16.SyntaxKind.PlusToken, (a) => +a],
1305
- [ts16.SyntaxKind.ExclamationToken, (a) => !a]
1306
- ]);
1307
- var StaticInterpreter = class {
1308
- constructor(host, checker, dependencyTracker) {
1309
- this.host = host;
1310
- this.checker = checker;
1311
- this.dependencyTracker = dependencyTracker;
1312
- }
1313
- visit(node, context) {
1314
- return this.visitExpression(node, context);
1315
- }
1316
- visitExpression(node, context) {
1317
- let result;
1318
- if (node.kind === ts16.SyntaxKind.TrueKeyword) {
1319
- return true;
1320
- } else if (node.kind === ts16.SyntaxKind.FalseKeyword) {
1321
- return false;
1322
- } else if (node.kind === ts16.SyntaxKind.NullKeyword) {
1323
- return null;
1324
- } else if (ts16.isStringLiteral(node)) {
1325
- return node.text;
1326
- } else if (ts16.isNoSubstitutionTemplateLiteral(node)) {
1327
- return node.text;
1328
- } else if (ts16.isTemplateExpression(node)) {
1329
- result = this.visitTemplateExpression(node, context);
1330
- } else if (ts16.isNumericLiteral(node)) {
1331
- return parseFloat(node.text);
1332
- } else if (ts16.isObjectLiteralExpression(node)) {
1333
- result = this.visitObjectLiteralExpression(node, context);
1334
- } else if (ts16.isIdentifier(node)) {
1335
- result = this.visitIdentifier(node, context);
1336
- } else if (ts16.isPropertyAccessExpression(node)) {
1337
- result = this.visitPropertyAccessExpression(node, context);
1338
- } else if (ts16.isCallExpression(node)) {
1339
- result = this.visitCallExpression(node, context);
1340
- } else if (ts16.isConditionalExpression(node)) {
1341
- result = this.visitConditionalExpression(node, context);
1342
- } else if (ts16.isPrefixUnaryExpression(node)) {
1343
- result = this.visitPrefixUnaryExpression(node, context);
1344
- } else if (ts16.isBinaryExpression(node)) {
1345
- result = this.visitBinaryExpression(node, context);
1346
- } else if (ts16.isArrayLiteralExpression(node)) {
1347
- result = this.visitArrayLiteralExpression(node, context);
1348
- } else if (ts16.isParenthesizedExpression(node)) {
1349
- result = this.visitParenthesizedExpression(node, context);
1350
- } else if (ts16.isElementAccessExpression(node)) {
1351
- result = this.visitElementAccessExpression(node, context);
1352
- } else if (ts16.isAsExpression(node)) {
1353
- result = this.visitExpression(node.expression, context);
1354
- } else if (ts16.isNonNullExpression(node)) {
1355
- result = this.visitExpression(node.expression, context);
1356
- } else if (this.host.isClass(node)) {
1357
- result = this.visitDeclaration(node, context);
1358
- } else {
1359
- return DynamicValue.fromUnsupportedSyntax(node);
1360
- }
1361
- if (result instanceof DynamicValue && result.node !== node) {
1362
- return DynamicValue.fromDynamicInput(node, result);
1363
- }
1364
- return result;
1365
- }
1366
- visitArrayLiteralExpression(node, context) {
1367
- const array = [];
1368
- for (let i = 0; i < node.elements.length; i++) {
1369
- const element = node.elements[i];
1370
- if (ts16.isSpreadElement(element)) {
1371
- array.push(...this.visitSpreadElement(element, context));
1372
- } else {
1373
- array.push(this.visitExpression(element, context));
1374
- }
1375
- }
1376
- return array;
1377
- }
1378
- visitObjectLiteralExpression(node, context) {
1379
- const map = new Map();
1380
- for (let i = 0; i < node.properties.length; i++) {
1381
- const property = node.properties[i];
1382
- if (ts16.isPropertyAssignment(property)) {
1383
- const name = this.stringNameFromPropertyName(property.name, context);
1384
- if (name === void 0) {
1385
- return DynamicValue.fromDynamicInput(node, DynamicValue.fromDynamicString(property.name));
1386
- }
1387
- map.set(name, this.visitExpression(property.initializer, context));
1388
- } else if (ts16.isShorthandPropertyAssignment(property)) {
1389
- const symbol = this.checker.getShorthandAssignmentValueSymbol(property);
1390
- if (symbol === void 0 || symbol.valueDeclaration === void 0) {
1391
- map.set(property.name.text, DynamicValue.fromUnknown(property));
1392
- } else {
1393
- map.set(property.name.text, this.visitDeclaration(symbol.valueDeclaration, context));
1394
- }
1395
- } else if (ts16.isSpreadAssignment(property)) {
1396
- const spread = this.visitExpression(property.expression, context);
1397
- if (spread instanceof DynamicValue) {
1398
- return DynamicValue.fromDynamicInput(node, spread);
1399
- } else if (spread instanceof Map) {
1400
- spread.forEach((value, key) => map.set(key, value));
1401
- } else if (spread instanceof ResolvedModule) {
1402
- spread.getExports().forEach((value, key) => map.set(key, value));
1403
- } else {
1404
- return DynamicValue.fromDynamicInput(node, DynamicValue.fromInvalidExpressionType(property, spread));
1405
- }
1406
- } else {
1407
- return DynamicValue.fromUnknown(node);
1408
- }
1409
- }
1410
- return map;
1411
- }
1412
- visitTemplateExpression(node, context) {
1413
- const pieces = [node.head.text];
1414
- for (let i = 0; i < node.templateSpans.length; i++) {
1415
- const span = node.templateSpans[i];
1416
- const value = literal(this.visit(span.expression, context), () => DynamicValue.fromDynamicString(span.expression));
1417
- if (value instanceof DynamicValue) {
1418
- return DynamicValue.fromDynamicInput(node, value);
1419
- }
1420
- pieces.push(`${value}`, span.literal.text);
1421
- }
1422
- return pieces.join("");
1423
- }
1424
- visitIdentifier(node, context) {
1425
- const decl = this.host.getDeclarationOfIdentifier(node);
1426
- if (decl === null) {
1427
- if (node.originalKeywordKind === ts16.SyntaxKind.UndefinedKeyword) {
1428
- return void 0;
1429
- } else {
1430
- if (this.dependencyTracker !== null && this.host.getImportOfIdentifier(node) !== null) {
1431
- this.dependencyTracker.recordDependencyAnalysisFailure(context.originatingFile);
1432
- }
1433
- return DynamicValue.fromUnknownIdentifier(node);
1434
- }
1435
- }
1436
- if (decl.known !== null) {
1437
- return resolveKnownDeclaration(decl.known);
1438
- } else if (isConcreteDeclaration(decl) && decl.identity !== null && decl.identity.kind === 0) {
1439
- return this.getResolvedEnum(decl.node, decl.identity.enumMembers, context);
1440
- }
1441
- const declContext = __spreadValues(__spreadValues({}, context), joinModuleContext(context, node, decl));
1442
- const result = this.visitAmbiguousDeclaration(decl, declContext);
1443
- if (result instanceof Reference) {
1444
- if (!result.synthetic) {
1445
- result.addIdentifier(node);
1446
- }
1447
- } else if (result instanceof DynamicValue) {
1448
- return DynamicValue.fromDynamicInput(node, result);
1449
- }
1450
- return result;
1451
- }
1452
- visitDeclaration(node, context) {
1453
- if (this.dependencyTracker !== null) {
1454
- this.dependencyTracker.addDependency(context.originatingFile, node.getSourceFile());
1455
- }
1456
- if (this.host.isClass(node)) {
1457
- return this.getReference(node, context);
1458
- } else if (ts16.isVariableDeclaration(node)) {
1459
- return this.visitVariableDeclaration(node, context);
1460
- } else if (ts16.isParameter(node) && context.scope.has(node)) {
1461
- return context.scope.get(node);
1462
- } else if (ts16.isExportAssignment(node)) {
1463
- return this.visitExpression(node.expression, context);
1464
- } else if (ts16.isEnumDeclaration(node)) {
1465
- return this.visitEnumDeclaration(node, context);
1466
- } else if (ts16.isSourceFile(node)) {
1467
- return this.visitSourceFile(node, context);
1468
- } else if (ts16.isBindingElement(node)) {
1469
- return this.visitBindingElement(node, context);
1470
- } else {
1471
- return this.getReference(node, context);
1472
- }
1473
- }
1474
- visitVariableDeclaration(node, context) {
1475
- const value = this.host.getVariableValue(node);
1476
- if (value !== null) {
1477
- return this.visitExpression(value, context);
1478
- } else if (isVariableDeclarationDeclared(node)) {
1479
- if (node.type !== void 0) {
1480
- const evaluatedType = this.visitType(node.type, context);
1481
- if (!(evaluatedType instanceof DynamicValue)) {
1482
- return evaluatedType;
1483
- }
1484
- }
1485
- return this.getReference(node, context);
1486
- } else {
1487
- return void 0;
1488
- }
1489
- }
1490
- visitEnumDeclaration(node, context) {
1491
- const enumRef = this.getReference(node, context);
1492
- const map = new Map();
1493
- node.members.forEach((member) => {
1494
- const name = this.stringNameFromPropertyName(member.name, context);
1495
- if (name !== void 0) {
1496
- const resolved = member.initializer && this.visit(member.initializer, context);
1497
- map.set(name, new EnumValue(enumRef, name, resolved));
1498
- }
1499
- });
1500
- return map;
1501
- }
1502
- visitElementAccessExpression(node, context) {
1503
- const lhs = this.visitExpression(node.expression, context);
1504
- if (lhs instanceof DynamicValue) {
1505
- return DynamicValue.fromDynamicInput(node, lhs);
1506
- }
1507
- const rhs = this.visitExpression(node.argumentExpression, context);
1508
- if (rhs instanceof DynamicValue) {
1509
- return DynamicValue.fromDynamicInput(node, rhs);
1510
- }
1511
- if (typeof rhs !== "string" && typeof rhs !== "number") {
1512
- return DynamicValue.fromInvalidExpressionType(node, rhs);
1513
- }
1514
- return this.accessHelper(node, lhs, rhs, context);
1515
- }
1516
- visitPropertyAccessExpression(node, context) {
1517
- const lhs = this.visitExpression(node.expression, context);
1518
- const rhs = node.name.text;
1519
- if (lhs instanceof DynamicValue) {
1520
- return DynamicValue.fromDynamicInput(node, lhs);
1521
- }
1522
- return this.accessHelper(node, lhs, rhs, context);
1523
- }
1524
- visitSourceFile(node, context) {
1525
- const declarations = this.host.getExportsOfModule(node);
1526
- if (declarations === null) {
1527
- return DynamicValue.fromUnknown(node);
1528
- }
1529
- return new ResolvedModule(declarations, (decl) => {
1530
- if (decl.known !== null) {
1531
- return resolveKnownDeclaration(decl.known);
1532
- }
1533
- const declContext = __spreadValues(__spreadValues({}, context), joinModuleContext(context, node, decl));
1534
- return this.visitAmbiguousDeclaration(decl, declContext);
1535
- });
1536
- }
1537
- visitAmbiguousDeclaration(decl, declContext) {
1538
- return decl.kind === 1 && decl.implementation !== void 0 && !isDeclaration(decl.implementation) ? this.visitExpression(decl.implementation, declContext) : this.visitDeclaration(decl.node, declContext);
1539
- }
1540
- accessHelper(node, lhs, rhs, context) {
1541
- const strIndex = `${rhs}`;
1542
- if (lhs instanceof Map) {
1543
- if (lhs.has(strIndex)) {
1544
- return lhs.get(strIndex);
1545
- } else {
1546
- return void 0;
1547
- }
1548
- } else if (lhs instanceof ResolvedModule) {
1549
- return lhs.getExport(strIndex);
1550
- } else if (Array.isArray(lhs)) {
1551
- if (rhs === "length") {
1552
- return lhs.length;
1553
- } else if (rhs === "slice") {
1554
- return new ArraySliceBuiltinFn(lhs);
1555
- } else if (rhs === "concat") {
1556
- return new ArrayConcatBuiltinFn(lhs);
1557
- }
1558
- if (typeof rhs !== "number" || !Number.isInteger(rhs)) {
1559
- return DynamicValue.fromInvalidExpressionType(node, rhs);
1560
- }
1561
- return lhs[rhs];
1562
- } else if (lhs instanceof Reference) {
1563
- const ref = lhs.node;
1564
- if (this.host.isClass(ref)) {
1565
- const module2 = owningModule(context, lhs.bestGuessOwningModule);
1566
- let value = void 0;
1567
- const member = this.host.getMembersOfClass(ref).find((member2) => member2.isStatic && member2.name === strIndex);
1568
- if (member !== void 0) {
1569
- if (member.value !== null) {
1570
- value = this.visitExpression(member.value, context);
1571
- } else if (member.implementation !== null) {
1572
- value = new Reference(member.implementation, module2);
1573
- } else if (member.node) {
1574
- value = new Reference(member.node, module2);
1575
- }
1576
- }
1577
- return value;
1578
- } else if (isDeclaration(ref)) {
1579
- return DynamicValue.fromDynamicInput(node, DynamicValue.fromExternalReference(ref, lhs));
1580
- }
1581
- } else if (lhs instanceof DynamicValue) {
1582
- return DynamicValue.fromDynamicInput(node, lhs);
1583
- }
1584
- return DynamicValue.fromUnknown(node);
1585
- }
1586
- visitCallExpression(node, context) {
1587
- const lhs = this.visitExpression(node.expression, context);
1588
- if (lhs instanceof DynamicValue) {
1589
- return DynamicValue.fromDynamicInput(node, lhs);
1590
- }
1591
- if (lhs instanceof KnownFn) {
1592
- return lhs.evaluate(node, this.evaluateFunctionArguments(node, context));
1593
- }
1594
- if (!(lhs instanceof Reference)) {
1595
- return DynamicValue.fromInvalidExpressionType(node.expression, lhs);
1596
- }
1597
- const fn = this.host.getDefinitionOfFunction(lhs.node);
1598
- if (fn === null) {
1599
- return DynamicValue.fromInvalidExpressionType(node.expression, lhs);
1600
- }
1601
- if (!isFunctionOrMethodReference(lhs)) {
1602
- return DynamicValue.fromInvalidExpressionType(node.expression, lhs);
1603
- }
1604
- if (fn.body === null) {
1605
- let expr = null;
1606
- if (context.foreignFunctionResolver) {
1607
- expr = context.foreignFunctionResolver(lhs, node.arguments);
1608
- }
1609
- if (expr === null) {
1610
- return DynamicValue.fromDynamicInput(node, DynamicValue.fromExternalReference(node.expression, lhs));
1611
- }
1612
- if (expr.getSourceFile() !== node.expression.getSourceFile() && lhs.bestGuessOwningModule !== null) {
1613
- context = __spreadProps(__spreadValues({}, context), {
1614
- absoluteModuleName: lhs.bestGuessOwningModule.specifier,
1615
- resolutionContext: lhs.bestGuessOwningModule.resolutionContext
1616
- });
1617
- }
1618
- return this.visitFfrExpression(expr, context);
1619
- }
1620
- let res = this.visitFunctionBody(node, fn, context);
1621
- if (res instanceof DynamicValue && context.foreignFunctionResolver !== void 0) {
1622
- const ffrExpr = context.foreignFunctionResolver(lhs, node.arguments);
1623
- if (ffrExpr !== null) {
1624
- const ffrRes = this.visitFfrExpression(ffrExpr, context);
1625
- if (!(ffrRes instanceof DynamicValue)) {
1626
- res = ffrRes;
1627
- }
1628
- }
1629
- }
1630
- return res;
1631
- }
1632
- visitFfrExpression(expr, context) {
1633
- const res = this.visitExpression(expr, context);
1634
- if (res instanceof Reference) {
1635
- res.synthetic = true;
1636
- }
1637
- return res;
1638
- }
1639
- visitFunctionBody(node, fn, context) {
1640
- if (fn.body === null) {
1641
- return DynamicValue.fromUnknown(node);
1642
- } else if (fn.body.length !== 1 || !ts16.isReturnStatement(fn.body[0])) {
1643
- return DynamicValue.fromComplexFunctionCall(node, fn);
1644
- }
1645
- const ret = fn.body[0];
1646
- const args = this.evaluateFunctionArguments(node, context);
1647
- const newScope = new Map();
1648
- const calleeContext = __spreadProps(__spreadValues({}, context), { scope: newScope });
1649
- fn.parameters.forEach((param, index) => {
1650
- let arg = args[index];
1651
- if (param.node.dotDotDotToken !== void 0) {
1652
- arg = args.slice(index);
1653
- }
1654
- if (arg === void 0 && param.initializer !== null) {
1655
- arg = this.visitExpression(param.initializer, calleeContext);
1656
- }
1657
- newScope.set(param.node, arg);
1658
- });
1659
- return ret.expression !== void 0 ? this.visitExpression(ret.expression, calleeContext) : void 0;
1660
- }
1661
- visitConditionalExpression(node, context) {
1662
- const condition = this.visitExpression(node.condition, context);
1663
- if (condition instanceof DynamicValue) {
1664
- return DynamicValue.fromDynamicInput(node, condition);
1665
- }
1666
- if (condition) {
1667
- return this.visitExpression(node.whenTrue, context);
1668
- } else {
1669
- return this.visitExpression(node.whenFalse, context);
1670
- }
1671
- }
1672
- visitPrefixUnaryExpression(node, context) {
1673
- const operatorKind = node.operator;
1674
- if (!UNARY_OPERATORS.has(operatorKind)) {
1675
- return DynamicValue.fromUnsupportedSyntax(node);
1676
- }
1677
- const op = UNARY_OPERATORS.get(operatorKind);
1678
- const value = this.visitExpression(node.operand, context);
1679
- if (value instanceof DynamicValue) {
1680
- return DynamicValue.fromDynamicInput(node, value);
1681
- } else {
1682
- return op(value);
1683
- }
1684
- }
1685
- visitBinaryExpression(node, context) {
1686
- const tokenKind = node.operatorToken.kind;
1687
- if (!BINARY_OPERATORS.has(tokenKind)) {
1688
- return DynamicValue.fromUnsupportedSyntax(node);
1689
- }
1690
- const opRecord = BINARY_OPERATORS.get(tokenKind);
1691
- let lhs, rhs;
1692
- if (opRecord.literal) {
1693
- lhs = literal(this.visitExpression(node.left, context), (value) => DynamicValue.fromInvalidExpressionType(node.left, value));
1694
- rhs = literal(this.visitExpression(node.right, context), (value) => DynamicValue.fromInvalidExpressionType(node.right, value));
1695
- } else {
1696
- lhs = this.visitExpression(node.left, context);
1697
- rhs = this.visitExpression(node.right, context);
1698
- }
1699
- if (lhs instanceof DynamicValue) {
1700
- return DynamicValue.fromDynamicInput(node, lhs);
1701
- } else if (rhs instanceof DynamicValue) {
1702
- return DynamicValue.fromDynamicInput(node, rhs);
1703
- } else {
1704
- return opRecord.op(lhs, rhs);
1705
- }
1706
- }
1707
- visitParenthesizedExpression(node, context) {
1708
- return this.visitExpression(node.expression, context);
1709
- }
1710
- evaluateFunctionArguments(node, context) {
1711
- const args = [];
1712
- for (const arg of node.arguments) {
1713
- if (ts16.isSpreadElement(arg)) {
1714
- args.push(...this.visitSpreadElement(arg, context));
1715
- } else {
1716
- args.push(this.visitExpression(arg, context));
1717
- }
1718
- }
1719
- return args;
1720
- }
1721
- visitSpreadElement(node, context) {
1722
- const spread = this.visitExpression(node.expression, context);
1723
- if (spread instanceof DynamicValue) {
1724
- return [DynamicValue.fromDynamicInput(node, spread)];
1725
- } else if (!Array.isArray(spread)) {
1726
- return [DynamicValue.fromInvalidExpressionType(node, spread)];
1727
- } else {
1728
- return spread;
1729
- }
1730
- }
1731
- visitBindingElement(node, context) {
1732
- const path = [];
1733
- let closestDeclaration = node;
1734
- while (ts16.isBindingElement(closestDeclaration) || ts16.isArrayBindingPattern(closestDeclaration) || ts16.isObjectBindingPattern(closestDeclaration)) {
1735
- if (ts16.isBindingElement(closestDeclaration)) {
1736
- path.unshift(closestDeclaration);
1737
- }
1738
- closestDeclaration = closestDeclaration.parent;
1739
- }
1740
- if (!ts16.isVariableDeclaration(closestDeclaration) || closestDeclaration.initializer === void 0) {
1741
- return DynamicValue.fromUnknown(node);
1742
- }
1743
- let value = this.visit(closestDeclaration.initializer, context);
1744
- for (const element of path) {
1745
- let key;
1746
- if (ts16.isArrayBindingPattern(element.parent)) {
1747
- key = element.parent.elements.indexOf(element);
1748
- } else {
1749
- const name = element.propertyName || element.name;
1750
- if (ts16.isIdentifier(name)) {
1751
- key = name.text;
1752
- } else {
1753
- return DynamicValue.fromUnknown(element);
1754
- }
1755
- }
1756
- value = this.accessHelper(element, value, key, context);
1757
- if (value instanceof DynamicValue) {
1758
- return value;
1759
- }
1760
- }
1761
- return value;
1762
- }
1763
- stringNameFromPropertyName(node, context) {
1764
- if (ts16.isIdentifier(node) || ts16.isStringLiteral(node) || ts16.isNumericLiteral(node)) {
1765
- return node.text;
1766
- } else if (ts16.isComputedPropertyName(node)) {
1767
- const literal2 = this.visitExpression(node.expression, context);
1768
- return typeof literal2 === "string" ? literal2 : void 0;
1769
- } else {
1770
- return void 0;
1771
- }
1772
- }
1773
- getResolvedEnum(node, enumMembers, context) {
1774
- const enumRef = this.getReference(node, context);
1775
- const map = new Map();
1776
- enumMembers.forEach((member) => {
1777
- const name = this.stringNameFromPropertyName(member.name, context);
1778
- if (name !== void 0) {
1779
- const resolved = this.visit(member.initializer, context);
1780
- map.set(name, new EnumValue(enumRef, name, resolved));
1781
- }
1782
- });
1783
- return map;
1784
- }
1785
- getReference(node, context) {
1786
- return new Reference(node, owningModule(context));
1787
- }
1788
- visitType(node, context) {
1789
- if (ts16.isLiteralTypeNode(node)) {
1790
- return this.visitExpression(node.literal, context);
1791
- } else if (ts16.isTupleTypeNode(node)) {
1792
- return this.visitTupleType(node, context);
1793
- } else if (ts16.isNamedTupleMember(node)) {
1794
- return this.visitType(node.type, context);
1795
- }
1796
- return DynamicValue.fromDynamicType(node);
1797
- }
1798
- visitTupleType(node, context) {
1799
- const res = [];
1800
- for (const elem of node.elements) {
1801
- res.push(this.visitType(elem, context));
1802
- }
1803
- return res;
1804
- }
1805
- };
1806
- function isFunctionOrMethodReference(ref) {
1807
- return ts16.isFunctionDeclaration(ref.node) || ts16.isMethodDeclaration(ref.node) || ts16.isFunctionExpression(ref.node);
1808
- }
1809
- function literal(value, reject) {
1810
- if (value instanceof EnumValue) {
1811
- value = value.resolved;
1812
- }
1813
- if (value instanceof DynamicValue || value === null || value === void 0 || typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
1814
- return value;
1815
- }
1816
- return reject(value);
1817
- }
1818
- function isVariableDeclarationDeclared(node) {
1819
- if (node.parent === void 0 || !ts16.isVariableDeclarationList(node.parent)) {
1820
- return false;
1821
- }
1822
- const declList = node.parent;
1823
- if (declList.parent === void 0 || !ts16.isVariableStatement(declList.parent)) {
1824
- return false;
1825
- }
1826
- const varStmt = declList.parent;
1827
- return varStmt.modifiers !== void 0 && varStmt.modifiers.some((mod) => mod.kind === ts16.SyntaxKind.DeclareKeyword);
1828
- }
1829
- var EMPTY = {};
1830
- function joinModuleContext(existing, node, decl) {
1831
- if (decl.viaModule !== null && decl.viaModule !== existing.absoluteModuleName) {
1832
- return {
1833
- absoluteModuleName: decl.viaModule,
1834
- resolutionContext: node.getSourceFile().fileName
1835
- };
1836
- } else {
1837
- return EMPTY;
1838
- }
1839
- }
1840
- function owningModule(context, override = null) {
1841
- let specifier = context.absoluteModuleName;
1842
- if (override !== null) {
1843
- specifier = override.specifier;
1844
- }
1845
- if (specifier !== null) {
1846
- return {
1847
- specifier,
1848
- resolutionContext: context.resolutionContext
1849
- };
1850
- } else {
1851
- return null;
1852
- }
1853
- }
1854
-
1855
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/interface.mjs
1856
- var PartialEvaluator = class {
1857
- constructor(host, checker, dependencyTracker) {
1858
- this.host = host;
1859
- this.checker = checker;
1860
- this.dependencyTracker = dependencyTracker;
1861
- }
1862
- evaluate(expr, foreignFunctionResolver) {
1863
- const interpreter = new StaticInterpreter(this.host, this.checker, this.dependencyTracker);
1864
- const sourceFile = expr.getSourceFile();
1865
- return interpreter.visit(expr, {
1866
- originatingFile: sourceFile,
1867
- absoluteModuleName: null,
1868
- resolutionContext: sourceFile.fileName,
1869
- scope: new Map(),
1870
- foreignFunctionResolver
1871
- });
1872
- }
1873
- };
1874
-
1875
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/perf/src/api.mjs
1876
- var PerfPhase;
1877
- (function(PerfPhase2) {
1878
- PerfPhase2[PerfPhase2["Unaccounted"] = 0] = "Unaccounted";
1879
- PerfPhase2[PerfPhase2["Setup"] = 1] = "Setup";
1880
- PerfPhase2[PerfPhase2["TypeScriptProgramCreate"] = 2] = "TypeScriptProgramCreate";
1881
- PerfPhase2[PerfPhase2["Reconciliation"] = 3] = "Reconciliation";
1882
- PerfPhase2[PerfPhase2["ResourceUpdate"] = 4] = "ResourceUpdate";
1883
- PerfPhase2[PerfPhase2["TypeScriptDiagnostics"] = 5] = "TypeScriptDiagnostics";
1884
- PerfPhase2[PerfPhase2["Analysis"] = 6] = "Analysis";
1885
- PerfPhase2[PerfPhase2["Resolve"] = 7] = "Resolve";
1886
- PerfPhase2[PerfPhase2["CycleDetection"] = 8] = "CycleDetection";
1887
- PerfPhase2[PerfPhase2["TcbGeneration"] = 9] = "TcbGeneration";
1888
- PerfPhase2[PerfPhase2["TcbUpdateProgram"] = 10] = "TcbUpdateProgram";
1889
- PerfPhase2[PerfPhase2["TypeScriptEmit"] = 11] = "TypeScriptEmit";
1890
- PerfPhase2[PerfPhase2["Compile"] = 12] = "Compile";
1891
- PerfPhase2[PerfPhase2["TtcAutocompletion"] = 13] = "TtcAutocompletion";
1892
- PerfPhase2[PerfPhase2["TtcDiagnostics"] = 14] = "TtcDiagnostics";
1893
- PerfPhase2[PerfPhase2["TtcSymbol"] = 15] = "TtcSymbol";
1894
- PerfPhase2[PerfPhase2["LsReferencesAndRenames"] = 16] = "LsReferencesAndRenames";
1895
- PerfPhase2[PerfPhase2["LsQuickInfo"] = 17] = "LsQuickInfo";
1896
- PerfPhase2[PerfPhase2["LsDefinition"] = 18] = "LsDefinition";
1897
- PerfPhase2[PerfPhase2["LsCompletions"] = 19] = "LsCompletions";
1898
- PerfPhase2[PerfPhase2["LsTcb"] = 20] = "LsTcb";
1899
- PerfPhase2[PerfPhase2["LsDiagnostics"] = 21] = "LsDiagnostics";
1900
- PerfPhase2[PerfPhase2["LsComponentLocations"] = 22] = "LsComponentLocations";
1901
- PerfPhase2[PerfPhase2["LsSignatureHelp"] = 23] = "LsSignatureHelp";
1902
- PerfPhase2[PerfPhase2["LAST"] = 24] = "LAST";
1903
- })(PerfPhase || (PerfPhase = {}));
1904
- var PerfEvent;
1905
- (function(PerfEvent2) {
1906
- PerfEvent2[PerfEvent2["InputDtsFile"] = 0] = "InputDtsFile";
1907
- PerfEvent2[PerfEvent2["InputTsFile"] = 1] = "InputTsFile";
1908
- PerfEvent2[PerfEvent2["AnalyzeComponent"] = 2] = "AnalyzeComponent";
1909
- PerfEvent2[PerfEvent2["AnalyzeDirective"] = 3] = "AnalyzeDirective";
1910
- PerfEvent2[PerfEvent2["AnalyzeInjectable"] = 4] = "AnalyzeInjectable";
1911
- PerfEvent2[PerfEvent2["AnalyzeNgModule"] = 5] = "AnalyzeNgModule";
1912
- PerfEvent2[PerfEvent2["AnalyzePipe"] = 6] = "AnalyzePipe";
1913
- PerfEvent2[PerfEvent2["TraitAnalyze"] = 7] = "TraitAnalyze";
1914
- PerfEvent2[PerfEvent2["TraitReuseAnalysis"] = 8] = "TraitReuseAnalysis";
1915
- PerfEvent2[PerfEvent2["SourceFilePhysicalChange"] = 9] = "SourceFilePhysicalChange";
1916
- PerfEvent2[PerfEvent2["SourceFileLogicalChange"] = 10] = "SourceFileLogicalChange";
1917
- PerfEvent2[PerfEvent2["SourceFileReuseAnalysis"] = 11] = "SourceFileReuseAnalysis";
1918
- PerfEvent2[PerfEvent2["GenerateTcb"] = 12] = "GenerateTcb";
1919
- PerfEvent2[PerfEvent2["SkipGenerateTcbNoInline"] = 13] = "SkipGenerateTcbNoInline";
1920
- PerfEvent2[PerfEvent2["ReuseTypeCheckFile"] = 14] = "ReuseTypeCheckFile";
1921
- PerfEvent2[PerfEvent2["UpdateTypeCheckProgram"] = 15] = "UpdateTypeCheckProgram";
1922
- PerfEvent2[PerfEvent2["EmitSkipSourceFile"] = 16] = "EmitSkipSourceFile";
1923
- PerfEvent2[PerfEvent2["EmitSourceFile"] = 17] = "EmitSourceFile";
1924
- PerfEvent2[PerfEvent2["LAST"] = 18] = "LAST";
1925
- })(PerfEvent || (PerfEvent = {}));
1926
- var PerfCheckpoint;
1927
- (function(PerfCheckpoint2) {
1928
- PerfCheckpoint2[PerfCheckpoint2["Initial"] = 0] = "Initial";
1929
- PerfCheckpoint2[PerfCheckpoint2["TypeScriptProgramCreate"] = 1] = "TypeScriptProgramCreate";
1930
- PerfCheckpoint2[PerfCheckpoint2["PreAnalysis"] = 2] = "PreAnalysis";
1931
- PerfCheckpoint2[PerfCheckpoint2["Analysis"] = 3] = "Analysis";
1932
- PerfCheckpoint2[PerfCheckpoint2["Resolve"] = 4] = "Resolve";
1933
- PerfCheckpoint2[PerfCheckpoint2["TtcGeneration"] = 5] = "TtcGeneration";
1934
- PerfCheckpoint2[PerfCheckpoint2["TtcUpdateProgram"] = 6] = "TtcUpdateProgram";
1935
- PerfCheckpoint2[PerfCheckpoint2["PreEmit"] = 7] = "PreEmit";
1936
- PerfCheckpoint2[PerfCheckpoint2["Emit"] = 8] = "Emit";
1937
- PerfCheckpoint2[PerfCheckpoint2["LAST"] = 9] = "LAST";
1938
- })(PerfCheckpoint || (PerfCheckpoint = {}));
1939
-
1940
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/perf/src/noop.mjs
1941
- var NoopPerfRecorder = class {
1942
- eventCount() {
1943
- }
1944
- memory() {
1945
- }
1946
- phase() {
1947
- return PerfPhase.Unaccounted;
1948
- }
1949
- inPhase(phase, fn) {
1950
- return fn();
1951
- }
1952
- reset() {
1953
- }
1954
- };
1955
- var NOOP_PERF_RECORDER = new NoopPerfRecorder();
1956
-
1957
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/api.mjs
1958
- var CompilationMode;
1959
- (function(CompilationMode2) {
1960
- CompilationMode2[CompilationMode2["FULL"] = 0] = "FULL";
1961
- CompilationMode2[CompilationMode2["PARTIAL"] = 1] = "PARTIAL";
1962
- })(CompilationMode || (CompilationMode = {}));
1963
- var HandlerPrecedence;
1964
- (function(HandlerPrecedence2) {
1965
- HandlerPrecedence2[HandlerPrecedence2["PRIMARY"] = 0] = "PRIMARY";
1966
- HandlerPrecedence2[HandlerPrecedence2["SHARED"] = 1] = "SHARED";
1967
- HandlerPrecedence2[HandlerPrecedence2["WEAK"] = 2] = "WEAK";
1968
- })(HandlerPrecedence || (HandlerPrecedence = {}));
1969
- var HandlerFlags;
1970
- (function(HandlerFlags2) {
1971
- HandlerFlags2[HandlerFlags2["NONE"] = 0] = "NONE";
1972
- HandlerFlags2[HandlerFlags2["FULL_INHERITANCE"] = 1] = "FULL_INHERITANCE";
1973
- })(HandlerFlags || (HandlerFlags = {}));
1974
-
1975
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/alias.mjs
1976
- import ts17 from "typescript";
1977
-
1978
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/compilation.mjs
1979
- import ts18 from "typescript";
1980
-
1981
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/trait.mjs
1982
- var TraitState;
1983
- (function(TraitState2) {
1984
- TraitState2[TraitState2["Pending"] = 0] = "Pending";
1985
- TraitState2[TraitState2["Analyzed"] = 1] = "Analyzed";
1986
- TraitState2[TraitState2["Resolved"] = 2] = "Resolved";
1987
- TraitState2[TraitState2["Skipped"] = 3] = "Skipped";
1988
- })(TraitState || (TraitState = {}));
1989
-
1990
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/declaration.mjs
1991
- import ts23 from "typescript";
1992
-
1993
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/import_manager.mjs
1994
- import ts19 from "typescript";
1995
-
1996
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/translator.mjs
7
+ DynamicValue,
8
+ PartialEvaluator,
9
+ StaticInterpreter,
10
+ forwardRefResolver
11
+ } from "../chunk-MIQ5UCHZ.js";
1997
12
  import {
1998
- BinaryOperator,
1999
- ConditionalExpr,
2000
- StmtModifier,
2001
- UnaryOperator
2002
- } from "@angular/compiler";
2003
- var UNARY_OPERATORS2 = new Map([
2004
- [UnaryOperator.Minus, "-"],
2005
- [UnaryOperator.Plus, "+"]
2006
- ]);
2007
- var BINARY_OPERATORS2 = new Map([
2008
- [BinaryOperator.And, "&&"],
2009
- [BinaryOperator.Bigger, ">"],
2010
- [BinaryOperator.BiggerEquals, ">="],
2011
- [BinaryOperator.BitwiseAnd, "&"],
2012
- [BinaryOperator.Divide, "/"],
2013
- [BinaryOperator.Equals, "=="],
2014
- [BinaryOperator.Identical, "==="],
2015
- [BinaryOperator.Lower, "<"],
2016
- [BinaryOperator.LowerEquals, "<="],
2017
- [BinaryOperator.Minus, "-"],
2018
- [BinaryOperator.Modulo, "%"],
2019
- [BinaryOperator.Multiply, "*"],
2020
- [BinaryOperator.NotEquals, "!="],
2021
- [BinaryOperator.NotIdentical, "!=="],
2022
- [BinaryOperator.Or, "||"],
2023
- [BinaryOperator.Plus, "+"],
2024
- [BinaryOperator.NullishCoalesce, "??"]
2025
- ]);
2026
-
2027
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/type_translator.mjs
13
+ TypeScriptReflectionHost,
14
+ reflectObjectLiteral
15
+ } from "../chunk-S3QIIFH7.js";
2028
16
  import {
2029
- BuiltinTypeName
2030
- } from "@angular/compiler";
2031
- import ts20 from "typescript";
2032
-
2033
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/typescript_ast_factory.mjs
2034
- import ts21 from "typescript";
2035
- var PureAnnotation;
2036
- (function(PureAnnotation2) {
2037
- PureAnnotation2["CLOSURE"] = "* @pureOrBreakMyCode ";
2038
- PureAnnotation2["TERSER"] = "@__PURE__";
2039
- })(PureAnnotation || (PureAnnotation = {}));
2040
- var UNARY_OPERATORS3 = {
2041
- "+": ts21.SyntaxKind.PlusToken,
2042
- "-": ts21.SyntaxKind.MinusToken,
2043
- "!": ts21.SyntaxKind.ExclamationToken
2044
- };
2045
- var BINARY_OPERATORS3 = {
2046
- "&&": ts21.SyntaxKind.AmpersandAmpersandToken,
2047
- ">": ts21.SyntaxKind.GreaterThanToken,
2048
- ">=": ts21.SyntaxKind.GreaterThanEqualsToken,
2049
- "&": ts21.SyntaxKind.AmpersandToken,
2050
- "/": ts21.SyntaxKind.SlashToken,
2051
- "==": ts21.SyntaxKind.EqualsEqualsToken,
2052
- "===": ts21.SyntaxKind.EqualsEqualsEqualsToken,
2053
- "<": ts21.SyntaxKind.LessThanToken,
2054
- "<=": ts21.SyntaxKind.LessThanEqualsToken,
2055
- "-": ts21.SyntaxKind.MinusToken,
2056
- "%": ts21.SyntaxKind.PercentToken,
2057
- "*": ts21.SyntaxKind.AsteriskToken,
2058
- "!=": ts21.SyntaxKind.ExclamationEqualsToken,
2059
- "!==": ts21.SyntaxKind.ExclamationEqualsEqualsToken,
2060
- "||": ts21.SyntaxKind.BarBarToken,
2061
- "+": ts21.SyntaxKind.PlusToken,
2062
- "??": ts21.SyntaxKind.QuestionQuestionToken
2063
- };
2064
- var VAR_TYPES = {
2065
- "const": ts21.NodeFlags.Const,
2066
- "let": ts21.NodeFlags.Let,
2067
- "var": ts21.NodeFlags.None
2068
- };
2069
-
2070
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/utils.mjs
2071
- import ts22 from "typescript";
2072
-
2073
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/transform.mjs
2074
- import { ConstantPool } from "@angular/compiler";
2075
- import ts25 from "typescript";
2076
-
2077
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/util/src/visitor.mjs
2078
- import ts24 from "typescript";
2079
-
2080
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/transform.mjs
2081
- var NO_DECORATORS = new Set();
2082
-
2083
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/diagnostics.mjs
2084
- import ts27 from "typescript";
2085
-
2086
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/util.mjs
2087
- import { ExternalExpr as ExternalExpr4, LiteralExpr, ParseLocation, ParseSourceFile, ParseSourceSpan, ReadPropExpr, WrappedNodeExpr as WrappedNodeExpr2 } from "@angular/compiler";
2088
- import ts26 from "typescript";
2089
- function isAngularCoreReference(reference, symbolName) {
2090
- return reference.ownedByModuleGuess === "@angular/core" && reference.debugName === symbolName;
2091
- }
2092
- function unwrapExpression(node) {
2093
- while (ts26.isAsExpression(node) || ts26.isParenthesizedExpression(node)) {
2094
- node = node.expression;
2095
- }
2096
- return node;
2097
- }
2098
- function expandForwardRef(arg) {
2099
- arg = unwrapExpression(arg);
2100
- if (!ts26.isArrowFunction(arg) && !ts26.isFunctionExpression(arg)) {
2101
- return null;
2102
- }
2103
- const body = arg.body;
2104
- if (ts26.isBlock(body)) {
2105
- if (body.statements.length !== 1) {
2106
- return null;
2107
- }
2108
- const stmt = body.statements[0];
2109
- if (!ts26.isReturnStatement(stmt) || stmt.expression === void 0) {
2110
- return null;
2111
- }
2112
- return stmt.expression;
2113
- } else {
2114
- return body;
2115
- }
2116
- }
2117
- function forwardRefResolver(ref, args) {
2118
- if (!isAngularCoreReference(ref, "forwardRef") || args.length !== 1) {
2119
- return null;
2120
- }
2121
- return expandForwardRef(args[0]);
2122
- }
2123
-
2124
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/directive.mjs
2125
- import { compileClassMetadata, compileDeclareClassMetadata, compileDeclareDirectiveFromMetadata, compileDirectiveFromMetadata, emitDistinctChangesOnlyDefaultValue, ExternalExpr as ExternalExpr5, FactoryTarget, getSafePropertyAccessString, makeBindingParser, parseHostBindings, verifyHostBindings, WrappedNodeExpr as WrappedNodeExpr4 } from "@angular/compiler";
2126
- import ts29 from "typescript";
2127
-
2128
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/factory.mjs
2129
- import { compileDeclareFactoryFunction, compileFactoryFunction } from "@angular/compiler";
2130
-
2131
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/metadata.mjs
2132
- import { FunctionExpr, LiteralArrayExpr, LiteralExpr as LiteralExpr2, literalMap, ReturnStatement, WrappedNodeExpr as WrappedNodeExpr3 } from "@angular/compiler";
2133
- import ts28 from "typescript";
2134
-
2135
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/directive.mjs
2136
- var LIFECYCLE_HOOKS = new Set([
2137
- "ngOnChanges",
2138
- "ngOnInit",
2139
- "ngOnDestroy",
2140
- "ngDoCheck",
2141
- "ngAfterViewInit",
2142
- "ngAfterViewChecked",
2143
- "ngAfterContentInit",
2144
- "ngAfterContentChecked"
2145
- ]);
2146
- var QUERY_TYPES = new Set([
2147
- "ContentChild",
2148
- "ContentChildren",
2149
- "ViewChild",
2150
- "ViewChildren"
2151
- ]);
2152
-
2153
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/ng_module.mjs
2154
- import { compileClassMetadata as compileClassMetadata2, compileDeclareClassMetadata as compileDeclareClassMetadata2, compileDeclareInjectorFromMetadata, compileDeclareNgModuleFromMetadata, compileInjector, compileNgModule, CUSTOM_ELEMENTS_SCHEMA, ExternalExpr as ExternalExpr6, FactoryTarget as FactoryTarget2, InvokeFunctionExpr, LiteralArrayExpr as LiteralArrayExpr2, NO_ERRORS_SCHEMA, R3Identifiers, WrappedNodeExpr as WrappedNodeExpr5 } from "@angular/compiler";
2155
- import ts30 from "typescript";
2156
-
2157
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/component.mjs
2158
- var EMPTY_MAP = new Map();
2159
-
2160
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/injectable.mjs
2161
- import { compileClassMetadata as compileClassMetadata4, compileDeclareClassMetadata as compileDeclareClassMetadata4, compileDeclareInjectableFromMetadata, compileInjectable, createR3ProviderExpression, FactoryTarget as FactoryTarget4, LiteralExpr as LiteralExpr3, WrappedNodeExpr as WrappedNodeExpr7 } from "@angular/compiler";
2162
- import ts32 from "typescript";
2163
-
2164
- // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/pipe.mjs
2165
- import { compileClassMetadata as compileClassMetadata5, compileDeclareClassMetadata as compileDeclareClassMetadata5, compileDeclarePipeFromMetadata, compilePipeFromMetadata, FactoryTarget as FactoryTarget5, WrappedNodeExpr as WrappedNodeExpr8 } from "@angular/compiler";
2166
- import ts33 from "typescript";
17
+ Reference
18
+ } from "../chunk-WYO7JO2T.js";
19
+ import "../chunk-EP5JHXG2.js";
20
+ import "../chunk-GLCRIILX.js";
21
+ import "../chunk-XA5IZLLC.js";
2167
22
  export {
2168
23
  DynamicValue,
2169
24
  PartialEvaluator,