@angular/compiler-cli 13.0.3 → 13.1.0-next.3

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 (88) hide show
  1. package/bundles/chunk-4EDYFHXN.js +681 -0
  2. package/bundles/chunk-4EDYFHXN.js.map +6 -0
  3. package/bundles/chunk-7HBAJSZA.js +5106 -0
  4. package/bundles/chunk-7HBAJSZA.js.map +6 -0
  5. package/bundles/chunk-7HVF6UHR.js +380 -0
  6. package/bundles/chunk-7HVF6UHR.js.map +6 -0
  7. package/bundles/chunk-COAETSNP.js +7531 -0
  8. package/bundles/chunk-COAETSNP.js.map +6 -0
  9. package/bundles/chunk-EP5JHXG2.js +448 -0
  10. package/bundles/chunk-EP5JHXG2.js.map +6 -0
  11. package/bundles/chunk-GLCRIILX.js +206 -0
  12. package/bundles/chunk-GLCRIILX.js.map +6 -0
  13. package/bundles/chunk-HDZS2JG2.js +1265 -0
  14. package/bundles/chunk-HDZS2JG2.js.map +6 -0
  15. package/bundles/chunk-IESRH26X.js +5684 -0
  16. package/bundles/chunk-IESRH26X.js.map +6 -0
  17. package/bundles/chunk-JJMLEEKA.js +382 -0
  18. package/bundles/chunk-JJMLEEKA.js.map +6 -0
  19. package/bundles/chunk-MFCLQBFK.js +968 -0
  20. package/bundles/chunk-MFCLQBFK.js.map +6 -0
  21. package/bundles/chunk-QDWL7SZJ.js +29 -0
  22. package/bundles/chunk-QDWL7SZJ.js.map +6 -0
  23. package/bundles/chunk-QL6ZC3U3.js +424 -0
  24. package/bundles/chunk-QL6ZC3U3.js.map +6 -0
  25. package/bundles/chunk-SKBLJA43.js +56 -0
  26. package/bundles/chunk-SKBLJA43.js.map +6 -0
  27. package/bundles/chunk-UIKTHF6Z.js +2177 -0
  28. package/bundles/chunk-UIKTHF6Z.js.map +6 -0
  29. package/bundles/chunk-UMUIU7TE.js +116 -0
  30. package/bundles/chunk-UMUIU7TE.js.map +6 -0
  31. package/bundles/chunk-XA5IZLLC.js +68 -0
  32. package/bundles/chunk-XA5IZLLC.js.map +6 -0
  33. package/bundles/index.js +67 -20229
  34. package/bundles/index.js.map +2 -2
  35. package/bundles/linker/babel/index.js +17 -1980
  36. package/bundles/linker/babel/index.js.map +2 -2
  37. package/bundles/linker/index.js +12 -1833
  38. package/bundles/linker/index.js.map +2 -2
  39. package/bundles/ngcc/index.js +24 -16040
  40. package/bundles/ngcc/index.js.map +2 -2
  41. package/bundles/ngcc/main-ngcc.js +16 -16124
  42. package/bundles/ngcc/main-ngcc.js.map +2 -2
  43. package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js +27 -13782
  44. package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js.map +2 -2
  45. package/bundles/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.js +10 -309
  46. package/bundles/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.js.map +2 -2
  47. package/bundles/private/bazel.js +4 -81
  48. package/bundles/private/bazel.js.map +2 -2
  49. package/bundles/private/localize.js +27 -870
  50. package/bundles/private/localize.js.map +2 -2
  51. package/bundles/private/migrations.js +13 -2178
  52. package/bundles/private/migrations.js.map +2 -2
  53. package/bundles/private/tooling.js +7 -931
  54. package/bundles/private/tooling.js.map +2 -2
  55. package/bundles/src/bin/ng_xi18n.js +20 -20378
  56. package/bundles/src/bin/ng_xi18n.js.map +2 -2
  57. package/bundles/src/bin/ngc.js +15 -20392
  58. package/bundles/src/bin/ngc.js.map +2 -2
  59. package/bundles_metadata.json +1 -1
  60. package/index.d.ts +0 -1
  61. package/ngcc/src/packages/build_marker.d.ts +1 -1
  62. package/package.json +3 -3
  63. package/src/ngtsc/core/src/host.d.ts +2 -1
  64. package/src/ngtsc/program_driver/src/ts_create_program_driver.d.ts +2 -1
  65. package/src/ngtsc/reflection/src/host.d.ts +1 -1
  66. package/src/ngtsc/util/src/typescript.d.ts +10 -0
  67. package/src/transformers/compiler_host.d.ts +1 -97
  68. package/src/transformers/program.d.ts +0 -19
  69. package/src/transformers/util.d.ts +1 -18
  70. package/src/{diagnostics/typescript_version.d.ts → version_helpers.d.ts} +1 -1
  71. package/src/diagnostics/translate_diagnostics.d.ts +0 -18
  72. package/src/language_services.d.ts +0 -11
  73. package/src/metadata/bundle_index_host.d.ts +0 -16
  74. package/src/metadata/bundler.d.ts +0 -66
  75. package/src/metadata/collector.d.ts +0 -44
  76. package/src/metadata/evaluator.d.ts +0 -58
  77. package/src/metadata/index.d.ts +0 -11
  78. package/src/metadata/index_writer.d.ts +0 -10
  79. package/src/metadata/schema.d.ts +0 -182
  80. package/src/metadata/symbols.d.ts +0 -22
  81. package/src/transformers/inline_resources.d.ts +0 -26
  82. package/src/transformers/lower_expressions.d.ts +0 -30
  83. package/src/transformers/metadata_cache.d.ts +0 -27
  84. package/src/transformers/metadata_reader.d.ts +0 -19
  85. package/src/transformers/node_emitter.d.ts +0 -105
  86. package/src/transformers/node_emitter_transform.d.ts +0 -19
  87. package/src/transformers/r3_metadata_transform.d.ts +0 -16
  88. package/src/transformers/r3_transform.d.ts +0 -16
@@ -3,1990 +3,27 @@
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
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
26
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
27
- }) : x)(function(x) {
28
- if (typeof require !== "undefined")
29
- return require.apply(this, arguments);
30
- throw new Error('Dynamic require of "' + x + '" is not supported');
31
- });
32
- var __objRest = (source, exclude) => {
33
- var target = {};
34
- for (var prop in source)
35
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
36
- target[prop] = source[prop];
37
- if (source != null && __getOwnPropSymbols)
38
- for (var prop of __getOwnPropSymbols(source)) {
39
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
40
- target[prop] = source[prop];
41
- }
42
- return target;
43
- };
44
-
45
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/file_system/src/compiler_host.mjs
46
6
  import {
47
- EOL
48
- } from "os";
49
- import ts from "typescript";
50
-
51
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/file_system/src/invalid_file_system.mjs
52
- var InvalidFileSystem = class {
53
- exists(path) {
54
- throw makeError();
55
- }
56
- readFile(path) {
57
- throw makeError();
58
- }
59
- readFileBuffer(path) {
60
- throw makeError();
61
- }
62
- writeFile(path, data, exclusive) {
63
- throw makeError();
64
- }
65
- removeFile(path) {
66
- throw makeError();
67
- }
68
- symlink(target, path) {
69
- throw makeError();
70
- }
71
- readdir(path) {
72
- throw makeError();
73
- }
74
- lstat(path) {
75
- throw makeError();
76
- }
77
- stat(path) {
78
- throw makeError();
79
- }
80
- pwd() {
81
- throw makeError();
82
- }
83
- chdir(path) {
84
- throw makeError();
85
- }
86
- extname(path) {
87
- throw makeError();
88
- }
89
- copyFile(from, to) {
90
- throw makeError();
91
- }
92
- moveFile(from, to) {
93
- throw makeError();
94
- }
95
- ensureDir(path) {
96
- throw makeError();
97
- }
98
- removeDeep(path) {
99
- throw makeError();
100
- }
101
- isCaseSensitive() {
102
- throw makeError();
103
- }
104
- resolve(...paths) {
105
- throw makeError();
106
- }
107
- dirname(file) {
108
- throw makeError();
109
- }
110
- join(basePath, ...paths) {
111
- throw makeError();
112
- }
113
- isRoot(path) {
114
- throw makeError();
115
- }
116
- isRooted(path) {
117
- throw makeError();
118
- }
119
- relative(from, to) {
120
- throw makeError();
121
- }
122
- basename(filePath, extension) {
123
- throw makeError();
124
- }
125
- realpath(filePath) {
126
- throw makeError();
127
- }
128
- getDefaultLibLocation() {
129
- throw makeError();
130
- }
131
- normalize(path) {
132
- throw makeError();
133
- }
134
- };
135
- function makeError() {
136
- return new Error("FileSystem has not been configured. Please call `setFileSystem()` before calling this method.");
137
- }
138
-
139
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/file_system/src/helpers.mjs
140
- var fs = new InvalidFileSystem();
141
- var ABSOLUTE_PATH = Symbol("AbsolutePath");
142
-
143
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/file_system/src/node_js_file_system.mjs
7
+ ConsoleLogger,
8
+ LogLevel
9
+ } from "../../chunk-SKBLJA43.js";
144
10
  import {
145
- copyFileSync,
146
- existsSync,
147
- lstatSync,
148
- mkdirSync,
149
- readFileSync,
150
- readdirSync,
151
- realpathSync,
152
- renameSync,
153
- rmdirSync,
154
- statSync,
155
- symlinkSync,
156
- unlinkSync,
157
- writeFileSync
158
- } from "fs";
159
- import module from "module";
11
+ FatalLinkerError,
12
+ FileLinker,
13
+ LinkerEnvironment,
14
+ assert,
15
+ isFatalLinkerError
16
+ } from "../../chunk-MFCLQBFK.js";
17
+ import "../../chunk-QL6ZC3U3.js";
18
+ import "../../chunk-HDZS2JG2.js";
160
19
  import {
161
- basename,
162
- dirname as dirname2,
163
- extname,
164
- isAbsolute,
165
- join,
166
- relative as relative2,
167
- resolve as resolve2
168
- } from "path";
169
- import { fileURLToPath } from "url";
170
- var NodeJSPathManipulation = class {
171
- pwd() {
172
- return this.normalize(process.cwd());
173
- }
174
- chdir(dir) {
175
- process.chdir(dir);
176
- }
177
- resolve(...paths) {
178
- return this.normalize(resolve2(...paths));
179
- }
180
- dirname(file) {
181
- return this.normalize(dirname2(file));
182
- }
183
- join(basePath, ...paths) {
184
- return this.normalize(join(basePath, ...paths));
185
- }
186
- isRoot(path) {
187
- return this.dirname(path) === this.normalize(path);
188
- }
189
- isRooted(path) {
190
- return isAbsolute(path);
191
- }
192
- relative(from, to) {
193
- return this.normalize(relative2(from, to));
194
- }
195
- basename(filePath, extension) {
196
- return basename(filePath, extension);
197
- }
198
- extname(path) {
199
- return extname(path);
200
- }
201
- normalize(path) {
202
- return path.replace(/\\/g, "/");
203
- }
204
- };
205
- var isCommonJS = typeof __filename !== "undefined";
206
- var currentFileUrl = isCommonJS ? null : __ESM_IMPORT_META_URL__;
207
- var currentFileName = isCommonJS ? __filename : fileURLToPath(currentFileUrl);
208
- var NodeJSReadonlyFileSystem = class extends NodeJSPathManipulation {
209
- constructor() {
210
- super(...arguments);
211
- this._caseSensitive = void 0;
212
- }
213
- isCaseSensitive() {
214
- if (this._caseSensitive === void 0) {
215
- this._caseSensitive = !existsSync(this.normalize(toggleCase(currentFileName)));
216
- }
217
- return this._caseSensitive;
218
- }
219
- exists(path) {
220
- return existsSync(path);
221
- }
222
- readFile(path) {
223
- return readFileSync(path, "utf8");
224
- }
225
- readFileBuffer(path) {
226
- return readFileSync(path);
227
- }
228
- readdir(path) {
229
- return readdirSync(path);
230
- }
231
- lstat(path) {
232
- return lstatSync(path);
233
- }
234
- stat(path) {
235
- return statSync(path);
236
- }
237
- realpath(path) {
238
- return this.resolve(realpathSync(path));
239
- }
240
- getDefaultLibLocation() {
241
- const requireFn = isCommonJS ? __require : module.createRequire(currentFileUrl);
242
- return this.resolve(requireFn.resolve("typescript"), "..");
243
- }
244
- };
245
- var NodeJSFileSystem = class extends NodeJSReadonlyFileSystem {
246
- writeFile(path, data, exclusive = false) {
247
- writeFileSync(path, data, exclusive ? { flag: "wx" } : void 0);
248
- }
249
- removeFile(path) {
250
- unlinkSync(path);
251
- }
252
- symlink(target, path) {
253
- symlinkSync(target, path);
254
- }
255
- copyFile(from, to) {
256
- copyFileSync(from, to);
257
- }
258
- moveFile(from, to) {
259
- renameSync(from, to);
260
- }
261
- ensureDir(path) {
262
- const parents = [];
263
- while (!this.isRoot(path) && !this.exists(path)) {
264
- parents.push(path);
265
- path = this.dirname(path);
266
- }
267
- while (parents.length) {
268
- this.safeMkdir(parents.pop());
269
- }
270
- }
271
- removeDeep(path) {
272
- rmdirSync(path, { recursive: true });
273
- }
274
- safeMkdir(path) {
275
- try {
276
- mkdirSync(path);
277
- } catch (err) {
278
- if (!this.exists(path) || !this.stat(path).isDirectory()) {
279
- throw err;
280
- }
281
- }
282
- }
283
- };
284
- function toggleCase(str) {
285
- return str.replace(/\w/g, (ch) => ch.toUpperCase() === ch ? ch.toLowerCase() : ch.toUpperCase());
286
- }
287
-
288
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/logging/src/logger.mjs
289
- var LogLevel;
290
- (function(LogLevel2) {
291
- LogLevel2[LogLevel2["debug"] = 0] = "debug";
292
- LogLevel2[LogLevel2["info"] = 1] = "info";
293
- LogLevel2[LogLevel2["warn"] = 2] = "warn";
294
- LogLevel2[LogLevel2["error"] = 3] = "error";
295
- })(LogLevel || (LogLevel = {}));
296
-
297
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/logging/src/console_logger.mjs
298
- var RESET = "";
299
- var RED = "";
300
- var YELLOW = "";
301
- var BLUE = "";
302
- var DEBUG = `${BLUE}Debug:${RESET}`;
303
- var WARN = `${YELLOW}Warning:${RESET}`;
304
- var ERROR = `${RED}Error:${RESET}`;
305
- var ConsoleLogger = class {
306
- constructor(level) {
307
- this.level = level;
308
- }
309
- debug(...args) {
310
- if (this.level <= LogLevel.debug)
311
- console.debug(DEBUG, ...args);
312
- }
313
- info(...args) {
314
- if (this.level <= LogLevel.info)
315
- console.info(...args);
316
- }
317
- warn(...args) {
318
- if (this.level <= LogLevel.warn)
319
- console.warn(WARN, ...args);
320
- }
321
- error(...args) {
322
- if (this.level <= LogLevel.error)
323
- console.error(ERROR, ...args);
324
- }
325
- };
326
-
327
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/fatal_linker_error.mjs
328
- var FatalLinkerError = class extends Error {
329
- constructor(node, message) {
330
- super(message);
331
- this.node = node;
332
- this.type = "FatalLinkerError";
333
- }
334
- };
335
- function isFatalLinkerError(e) {
336
- return e && e.type === "FatalLinkerError";
337
- }
338
-
339
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/ast/utils.mjs
340
- function assert(node, predicate, expected) {
341
- if (!predicate(node)) {
342
- throw new FatalLinkerError(node, `Unsupported syntax, expected ${expected}.`);
343
- }
344
- }
345
-
346
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/ast/ast_value.mjs
20
+ NodeJSFileSystem
21
+ } from "../../chunk-EP5JHXG2.js";
347
22
  import {
348
- WrappedNodeExpr
349
- } from "@angular/compiler";
350
- var AstObject = class {
351
- constructor(expression, obj, host) {
352
- this.expression = expression;
353
- this.obj = obj;
354
- this.host = host;
355
- }
356
- static parse(expression, host) {
357
- const obj = host.parseObjectLiteral(expression);
358
- return new AstObject(expression, obj, host);
359
- }
360
- has(propertyName) {
361
- return this.obj.has(propertyName);
362
- }
363
- getNumber(propertyName) {
364
- return this.host.parseNumericLiteral(this.getRequiredProperty(propertyName));
365
- }
366
- getString(propertyName) {
367
- return this.host.parseStringLiteral(this.getRequiredProperty(propertyName));
368
- }
369
- getBoolean(propertyName) {
370
- return this.host.parseBooleanLiteral(this.getRequiredProperty(propertyName));
371
- }
372
- getObject(propertyName) {
373
- const expr = this.getRequiredProperty(propertyName);
374
- const obj = this.host.parseObjectLiteral(expr);
375
- return new AstObject(expr, obj, this.host);
376
- }
377
- getArray(propertyName) {
378
- const arr = this.host.parseArrayLiteral(this.getRequiredProperty(propertyName));
379
- return arr.map((entry) => new AstValue(entry, this.host));
380
- }
381
- getOpaque(propertyName) {
382
- return new WrappedNodeExpr(this.getRequiredProperty(propertyName));
383
- }
384
- getNode(propertyName) {
385
- return this.getRequiredProperty(propertyName);
386
- }
387
- getValue(propertyName) {
388
- return new AstValue(this.getRequiredProperty(propertyName), this.host);
389
- }
390
- toLiteral(mapper) {
391
- const result = {};
392
- for (const [key, expression] of this.obj) {
393
- result[key] = mapper(new AstValue(expression, this.host));
394
- }
395
- return result;
396
- }
397
- toMap(mapper) {
398
- const result = new Map();
399
- for (const [key, expression] of this.obj) {
400
- result.set(key, mapper(new AstValue(expression, this.host)));
401
- }
402
- return result;
403
- }
404
- getRequiredProperty(propertyName) {
405
- if (!this.obj.has(propertyName)) {
406
- throw new FatalLinkerError(this.expression, `Expected property '${propertyName}' to be present.`);
407
- }
408
- return this.obj.get(propertyName);
409
- }
410
- };
411
- var AstValue = class {
412
- constructor(expression, host) {
413
- this.expression = expression;
414
- this.host = host;
415
- }
416
- getSymbolName() {
417
- return this.host.getSymbolName(this.expression);
418
- }
419
- isNumber() {
420
- return this.host.isNumericLiteral(this.expression);
421
- }
422
- getNumber() {
423
- return this.host.parseNumericLiteral(this.expression);
424
- }
425
- isString() {
426
- return this.host.isStringLiteral(this.expression);
427
- }
428
- getString() {
429
- return this.host.parseStringLiteral(this.expression);
430
- }
431
- isBoolean() {
432
- return this.host.isBooleanLiteral(this.expression);
433
- }
434
- getBoolean() {
435
- return this.host.parseBooleanLiteral(this.expression);
436
- }
437
- isObject() {
438
- return this.host.isObjectLiteral(this.expression);
439
- }
440
- getObject() {
441
- return AstObject.parse(this.expression, this.host);
442
- }
443
- isArray() {
444
- return this.host.isArrayLiteral(this.expression);
445
- }
446
- getArray() {
447
- const arr = this.host.parseArrayLiteral(this.expression);
448
- return arr.map((entry) => new AstValue(entry, this.host));
449
- }
450
- isFunction() {
451
- return this.host.isFunctionExpression(this.expression);
452
- }
453
- getFunctionReturnValue() {
454
- return new AstValue(this.host.parseReturnValue(this.expression), this.host);
455
- }
456
- isCallExpression() {
457
- return this.host.isCallExpression(this.expression);
458
- }
459
- getCallee() {
460
- return new AstValue(this.host.parseCallee(this.expression), this.host);
461
- }
462
- getArguments() {
463
- const args = this.host.parseArguments(this.expression);
464
- return args.map((arg) => new AstValue(arg, this.host));
465
- }
466
- getOpaque() {
467
- return new WrappedNodeExpr(this.expression);
468
- }
469
- getRange() {
470
- return this.host.getRange(this.expression);
471
- }
472
- };
473
-
474
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/emit_scopes/emit_scope.mjs
475
- import { ConstantPool } from "@angular/compiler";
476
-
477
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/linker_import_generator.mjs
478
- var LinkerImportGenerator = class {
479
- constructor(ngImport) {
480
- this.ngImport = ngImport;
481
- }
482
- generateNamespaceImport(moduleName) {
483
- this.assertModuleName(moduleName);
484
- return this.ngImport;
485
- }
486
- generateNamedImport(moduleName, originalSymbol) {
487
- this.assertModuleName(moduleName);
488
- return { moduleImport: this.ngImport, symbol: originalSymbol };
489
- }
490
- assertModuleName(moduleName) {
491
- if (moduleName !== "@angular/core") {
492
- throw new FatalLinkerError(this.ngImport, `Unable to import from anything other than '@angular/core'`);
493
- }
494
- }
495
- };
496
-
497
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/emit_scopes/emit_scope.mjs
498
- var EmitScope = class {
499
- constructor(ngImport, translator) {
500
- this.ngImport = ngImport;
501
- this.translator = translator;
502
- this.constantPool = new ConstantPool();
503
- }
504
- translateDefinition(definition) {
505
- return this.translator.translateExpression(definition, new LinkerImportGenerator(this.ngImport));
506
- }
507
- getConstantStatements() {
508
- const importGenerator = new LinkerImportGenerator(this.ngImport);
509
- return this.constantPool.statements.map((statement) => this.translator.translateStatement(statement, importGenerator));
510
- }
511
- };
512
-
513
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/emit_scopes/iife_emit_scope.mjs
514
- var IifeEmitScope = class extends EmitScope {
515
- constructor(ngImport, translator, factory) {
516
- super(ngImport, translator);
517
- this.factory = factory;
518
- }
519
- translateDefinition(definition) {
520
- const constantStatements = super.getConstantStatements();
521
- const returnStatement = this.factory.createReturnStatement(super.translateDefinition(definition));
522
- const body = this.factory.createBlock([...constantStatements, returnStatement]);
523
- const fn = this.factory.createFunctionExpression(null, [], body);
524
- return this.factory.createCallExpression(fn, [], false);
525
- }
526
- getConstantStatements() {
527
- throw new Error("BUG - IifeEmitScope should not expose any constant statements");
528
- }
529
- };
530
-
531
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_linker_selector.mjs
532
- import semver from "semver";
533
-
534
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/get_source_file.mjs
535
- function createGetSourceFile(sourceUrl, code, loader) {
536
- if (loader === null) {
537
- return () => null;
538
- } else {
539
- let sourceFile = void 0;
540
- return () => {
541
- if (sourceFile === void 0) {
542
- sourceFile = loader.loadSourceFile(sourceUrl, code);
543
- }
544
- return sourceFile;
545
- };
546
- }
547
- }
548
-
549
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_class_metadata_linker_1.mjs
550
- import { compileClassMetadata } from "@angular/compiler";
551
- var PartialClassMetadataLinkerVersion1 = class {
552
- linkPartialDeclaration(constantPool, metaObj) {
553
- const meta = toR3ClassMetadata(metaObj);
554
- return compileClassMetadata(meta);
555
- }
556
- };
557
- function toR3ClassMetadata(metaObj) {
558
- return {
559
- type: metaObj.getOpaque("type"),
560
- decorators: metaObj.getOpaque("decorators"),
561
- ctorParameters: metaObj.has("ctorParameters") ? metaObj.getOpaque("ctorParameters") : null,
562
- propDecorators: metaObj.has("propDecorators") ? metaObj.getOpaque("propDecorators") : null
563
- };
564
- }
565
-
566
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_component_linker_1.mjs
567
- import { ChangeDetectionStrategy, compileComponentFromMetadata, DEFAULT_INTERPOLATION_CONFIG, InterpolationConfig, makeBindingParser as makeBindingParser2, parseTemplate, ViewEncapsulation } from "@angular/compiler";
568
-
569
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_directive_linker_1.mjs
570
- import { compileDirectiveFromMetadata, makeBindingParser, ParseLocation, ParseSourceFile, ParseSourceSpan } from "@angular/compiler";
571
-
572
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/util.mjs
573
- import { createMayBeForwardRefExpression, outputAst as o2 } from "@angular/compiler";
574
- function wrapReference(wrapped) {
575
- return { value: wrapped, type: wrapped };
576
- }
577
- function parseEnum(value, Enum) {
578
- const symbolName = value.getSymbolName();
579
- if (symbolName === null) {
580
- throw new FatalLinkerError(value.expression, "Expected value to have a symbol name");
581
- }
582
- const enumValue = Enum[symbolName];
583
- if (enumValue === void 0) {
584
- throw new FatalLinkerError(value.expression, `Unsupported enum value for ${Enum}`);
585
- }
586
- return enumValue;
587
- }
588
- function getDependency(depObj) {
589
- const isAttribute = depObj.has("attribute") && depObj.getBoolean("attribute");
590
- const token = depObj.getOpaque("token");
591
- const attributeNameType = isAttribute ? o2.literal("unknown") : null;
592
- return {
593
- token,
594
- attributeNameType,
595
- host: depObj.has("host") && depObj.getBoolean("host"),
596
- optional: depObj.has("optional") && depObj.getBoolean("optional"),
597
- self: depObj.has("self") && depObj.getBoolean("self"),
598
- skipSelf: depObj.has("skipSelf") && depObj.getBoolean("skipSelf")
599
- };
600
- }
601
- function extractForwardRef(expr) {
602
- if (!expr.isCallExpression()) {
603
- return createMayBeForwardRefExpression(expr.getOpaque(), 0);
604
- }
605
- const callee = expr.getCallee();
606
- if (callee.getSymbolName() !== "forwardRef") {
607
- throw new FatalLinkerError(callee.expression, "Unsupported expression, expected a `forwardRef()` call or a type reference");
608
- }
609
- const args = expr.getArguments();
610
- if (args.length !== 1) {
611
- throw new FatalLinkerError(expr, "Unsupported `forwardRef(fn)` call, expected a single argument");
612
- }
613
- const wrapperFn = args[0];
614
- if (!wrapperFn.isFunction()) {
615
- throw new FatalLinkerError(wrapperFn, "Unsupported `forwardRef(fn)` call, expected its argument to be a function");
616
- }
617
- return createMayBeForwardRefExpression(wrapperFn.getFunctionReturnValue().getOpaque(), 2);
618
- }
619
-
620
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_directive_linker_1.mjs
621
- var PartialDirectiveLinkerVersion1 = class {
622
- constructor(sourceUrl, code) {
623
- this.sourceUrl = sourceUrl;
624
- this.code = code;
625
- }
626
- linkPartialDeclaration(constantPool, metaObj) {
627
- const meta = toR3DirectiveMeta(metaObj, this.code, this.sourceUrl);
628
- const def = compileDirectiveFromMetadata(meta, constantPool, makeBindingParser());
629
- return def.expression;
630
- }
631
- };
632
- function toR3DirectiveMeta(metaObj, code, sourceUrl) {
633
- const typeExpr = metaObj.getValue("type");
634
- const typeName = typeExpr.getSymbolName();
635
- if (typeName === null) {
636
- throw new FatalLinkerError(typeExpr.expression, "Unsupported type, its name could not be determined");
637
- }
638
- return {
639
- typeSourceSpan: createSourceSpan(typeExpr.getRange(), code, sourceUrl),
640
- type: wrapReference(typeExpr.getOpaque()),
641
- typeArgumentCount: 0,
642
- internalType: metaObj.getOpaque("type"),
643
- deps: null,
644
- host: toHostMetadata(metaObj),
645
- inputs: metaObj.has("inputs") ? metaObj.getObject("inputs").toLiteral(toInputMapping) : {},
646
- outputs: metaObj.has("outputs") ? metaObj.getObject("outputs").toLiteral((value) => value.getString()) : {},
647
- queries: metaObj.has("queries") ? metaObj.getArray("queries").map((entry) => toQueryMetadata(entry.getObject())) : [],
648
- viewQueries: metaObj.has("viewQueries") ? metaObj.getArray("viewQueries").map((entry) => toQueryMetadata(entry.getObject())) : [],
649
- providers: metaObj.has("providers") ? metaObj.getOpaque("providers") : null,
650
- fullInheritance: false,
651
- selector: metaObj.has("selector") ? metaObj.getString("selector") : null,
652
- exportAs: metaObj.has("exportAs") ? metaObj.getArray("exportAs").map((entry) => entry.getString()) : null,
653
- lifecycle: {
654
- usesOnChanges: metaObj.has("usesOnChanges") ? metaObj.getBoolean("usesOnChanges") : false
655
- },
656
- name: typeName,
657
- usesInheritance: metaObj.has("usesInheritance") ? metaObj.getBoolean("usesInheritance") : false
658
- };
659
- }
660
- function toInputMapping(value) {
661
- if (value.isString()) {
662
- return value.getString();
663
- }
664
- const values = value.getArray().map((innerValue) => innerValue.getString());
665
- if (values.length !== 2) {
666
- throw new FatalLinkerError(value.expression, "Unsupported input, expected a string or an array containing exactly two strings");
667
- }
668
- return values;
669
- }
670
- function toHostMetadata(metaObj) {
671
- if (!metaObj.has("host")) {
672
- return {
673
- attributes: {},
674
- listeners: {},
675
- properties: {},
676
- specialAttributes: {}
677
- };
678
- }
679
- const host = metaObj.getObject("host");
680
- const specialAttributes = {};
681
- if (host.has("styleAttribute")) {
682
- specialAttributes.styleAttr = host.getString("styleAttribute");
683
- }
684
- if (host.has("classAttribute")) {
685
- specialAttributes.classAttr = host.getString("classAttribute");
686
- }
687
- return {
688
- attributes: host.has("attributes") ? host.getObject("attributes").toLiteral((value) => value.getOpaque()) : {},
689
- listeners: host.has("listeners") ? host.getObject("listeners").toLiteral((value) => value.getString()) : {},
690
- properties: host.has("properties") ? host.getObject("properties").toLiteral((value) => value.getString()) : {},
691
- specialAttributes
692
- };
693
- }
694
- function toQueryMetadata(obj) {
695
- let predicate;
696
- const predicateExpr = obj.getValue("predicate");
697
- if (predicateExpr.isArray()) {
698
- predicate = predicateExpr.getArray().map((entry) => entry.getString());
699
- } else {
700
- predicate = extractForwardRef(predicateExpr);
701
- }
702
- return {
703
- propertyName: obj.getString("propertyName"),
704
- first: obj.has("first") ? obj.getBoolean("first") : false,
705
- predicate,
706
- descendants: obj.has("descendants") ? obj.getBoolean("descendants") : false,
707
- emitDistinctChangesOnly: obj.has("emitDistinctChangesOnly") ? obj.getBoolean("emitDistinctChangesOnly") : true,
708
- read: obj.has("read") ? obj.getOpaque("read") : null,
709
- static: obj.has("static") ? obj.getBoolean("static") : false
710
- };
711
- }
712
- function createSourceSpan(range, code, sourceUrl) {
713
- const sourceFile = new ParseSourceFile(code, sourceUrl);
714
- const startLocation = new ParseLocation(sourceFile, range.startPos, range.startLine, range.startCol);
715
- return new ParseSourceSpan(startLocation, startLocation.moveBy(range.endPos - range.startPos));
716
- }
717
-
718
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_component_linker_1.mjs
719
- var PartialComponentLinkerVersion1 = class {
720
- constructor(getSourceFile2, sourceUrl, code) {
721
- this.getSourceFile = getSourceFile2;
722
- this.sourceUrl = sourceUrl;
723
- this.code = code;
724
- }
725
- linkPartialDeclaration(constantPool, metaObj) {
726
- const meta = this.toR3ComponentMeta(metaObj);
727
- const def = compileComponentFromMetadata(meta, constantPool, makeBindingParser2());
728
- return def.expression;
729
- }
730
- toR3ComponentMeta(metaObj) {
731
- const interpolation = parseInterpolationConfig(metaObj);
732
- const templateSource = metaObj.getValue("template");
733
- const isInline = metaObj.has("isInline") ? metaObj.getBoolean("isInline") : false;
734
- const templateInfo = this.getTemplateInfo(templateSource, isInline);
735
- const template = parseTemplate(templateInfo.code, templateInfo.sourceUrl, {
736
- escapedString: templateInfo.isEscaped,
737
- interpolationConfig: interpolation,
738
- range: templateInfo.range,
739
- enableI18nLegacyMessageIdFormat: false,
740
- preserveWhitespaces: metaObj.has("preserveWhitespaces") ? metaObj.getBoolean("preserveWhitespaces") : false,
741
- i18nNormalizeLineEndingsInICUs: isInline
742
- });
743
- if (template.errors !== null) {
744
- const errors = template.errors.map((err) => err.toString()).join("\n");
745
- throw new FatalLinkerError(templateSource.expression, `Errors found in the template:
746
- ${errors}`);
747
- }
748
- let declarationListEmitMode = 0;
749
- const collectUsedDirectives = (directives2) => {
750
- return directives2.map((directive) => {
751
- const directiveExpr = directive.getObject();
752
- const type = directiveExpr.getValue("type");
753
- const selector = directiveExpr.getString("selector");
754
- const { expression: typeExpr, forwardRef } = extractForwardRef(type);
755
- if (forwardRef === 2) {
756
- declarationListEmitMode = 1;
757
- }
758
- return {
759
- type: typeExpr,
760
- selector,
761
- inputs: directiveExpr.has("inputs") ? directiveExpr.getArray("inputs").map((input) => input.getString()) : [],
762
- outputs: directiveExpr.has("outputs") ? directiveExpr.getArray("outputs").map((input) => input.getString()) : [],
763
- exportAs: directiveExpr.has("exportAs") ? directiveExpr.getArray("exportAs").map((exportAs) => exportAs.getString()) : null
764
- };
765
- });
766
- };
767
- let directives = [];
768
- if (metaObj.has("components")) {
769
- directives.push(...collectUsedDirectives(metaObj.getArray("components")));
770
- }
771
- if (metaObj.has("directives")) {
772
- directives.push(...collectUsedDirectives(metaObj.getArray("directives")));
773
- }
774
- let pipes = new Map();
775
- if (metaObj.has("pipes")) {
776
- pipes = metaObj.getObject("pipes").toMap((pipe) => {
777
- const { expression: pipeType, forwardRef } = extractForwardRef(pipe);
778
- if (forwardRef === 2) {
779
- declarationListEmitMode = 1;
780
- }
781
- return pipeType;
782
- });
783
- }
784
- return __spreadProps(__spreadValues({}, toR3DirectiveMeta(metaObj, this.code, this.sourceUrl)), {
785
- viewProviders: metaObj.has("viewProviders") ? metaObj.getOpaque("viewProviders") : null,
786
- template: {
787
- nodes: template.nodes,
788
- ngContentSelectors: template.ngContentSelectors
789
- },
790
- declarationListEmitMode,
791
- styles: metaObj.has("styles") ? metaObj.getArray("styles").map((entry) => entry.getString()) : [],
792
- encapsulation: metaObj.has("encapsulation") ? parseEncapsulation(metaObj.getValue("encapsulation")) : ViewEncapsulation.Emulated,
793
- interpolation,
794
- changeDetection: metaObj.has("changeDetection") ? parseChangeDetectionStrategy(metaObj.getValue("changeDetection")) : ChangeDetectionStrategy.Default,
795
- animations: metaObj.has("animations") ? metaObj.getOpaque("animations") : null,
796
- relativeContextFilePath: this.sourceUrl,
797
- i18nUseExternalIds: false,
798
- pipes,
799
- directives
800
- });
801
- }
802
- getTemplateInfo(templateNode, isInline) {
803
- const range = templateNode.getRange();
804
- if (!isInline) {
805
- const externalTemplate = this.tryExternalTemplate(range);
806
- if (externalTemplate !== null) {
807
- return externalTemplate;
808
- }
809
- }
810
- return this.templateFromPartialCode(templateNode, range);
811
- }
812
- tryExternalTemplate(range) {
813
- const sourceFile = this.getSourceFile();
814
- if (sourceFile === null) {
815
- return null;
816
- }
817
- const pos = sourceFile.getOriginalLocation(range.startLine, range.startCol);
818
- if (pos === null || pos.file === this.sourceUrl || /\.[jt]s$/.test(pos.file) || pos.line !== 0 || pos.column !== 0) {
819
- return null;
820
- }
821
- const templateContents = sourceFile.sources.find((src) => (src == null ? void 0 : src.sourcePath) === pos.file).contents;
822
- return {
823
- code: templateContents,
824
- sourceUrl: pos.file,
825
- range: { startPos: 0, startLine: 0, startCol: 0, endPos: templateContents.length },
826
- isEscaped: false
827
- };
828
- }
829
- templateFromPartialCode(templateNode, { startPos, endPos, startLine, startCol }) {
830
- if (!/["'`]/.test(this.code[startPos]) || this.code[startPos] !== this.code[endPos - 1]) {
831
- throw new FatalLinkerError(templateNode.expression, `Expected the template string to be wrapped in quotes but got: ${this.code.substring(startPos, endPos)}`);
832
- }
833
- return {
834
- code: this.code,
835
- sourceUrl: this.sourceUrl,
836
- range: { startPos: startPos + 1, endPos: endPos - 1, startLine, startCol: startCol + 1 },
837
- isEscaped: true
838
- };
839
- }
840
- };
841
- function parseInterpolationConfig(metaObj) {
842
- if (!metaObj.has("interpolation")) {
843
- return DEFAULT_INTERPOLATION_CONFIG;
844
- }
845
- const interpolationExpr = metaObj.getValue("interpolation");
846
- const values = interpolationExpr.getArray().map((entry) => entry.getString());
847
- if (values.length !== 2) {
848
- throw new FatalLinkerError(interpolationExpr.expression, "Unsupported interpolation config, expected an array containing exactly two strings");
849
- }
850
- return InterpolationConfig.fromArray(values);
851
- }
852
- function parseEncapsulation(encapsulation) {
853
- const symbolName = encapsulation.getSymbolName();
854
- if (symbolName === null) {
855
- throw new FatalLinkerError(encapsulation.expression, "Expected encapsulation to have a symbol name");
856
- }
857
- const enumValue = ViewEncapsulation[symbolName];
858
- if (enumValue === void 0) {
859
- throw new FatalLinkerError(encapsulation.expression, "Unsupported encapsulation");
860
- }
861
- return enumValue;
862
- }
863
- function parseChangeDetectionStrategy(changeDetectionStrategy) {
864
- const symbolName = changeDetectionStrategy.getSymbolName();
865
- if (symbolName === null) {
866
- throw new FatalLinkerError(changeDetectionStrategy.expression, "Expected change detection strategy to have a symbol name");
867
- }
868
- const enumValue = ChangeDetectionStrategy[symbolName];
869
- if (enumValue === void 0) {
870
- throw new FatalLinkerError(changeDetectionStrategy.expression, "Unsupported change detection strategy");
871
- }
872
- return enumValue;
873
- }
874
-
875
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_factory_linker_1.mjs
876
- import { compileFactoryFunction, FactoryTarget } from "@angular/compiler";
877
- var PartialFactoryLinkerVersion1 = class {
878
- linkPartialDeclaration(constantPool, metaObj) {
879
- const meta = toR3FactoryMeta(metaObj);
880
- const def = compileFactoryFunction(meta);
881
- return def.expression;
882
- }
883
- };
884
- function toR3FactoryMeta(metaObj) {
885
- const typeExpr = metaObj.getValue("type");
886
- const typeName = typeExpr.getSymbolName();
887
- if (typeName === null) {
888
- throw new FatalLinkerError(typeExpr.expression, "Unsupported type, its name could not be determined");
889
- }
890
- return {
891
- name: typeName,
892
- type: wrapReference(typeExpr.getOpaque()),
893
- internalType: metaObj.getOpaque("type"),
894
- typeArgumentCount: 0,
895
- target: parseEnum(metaObj.getValue("target"), FactoryTarget),
896
- deps: getDependencies(metaObj, "deps")
897
- };
898
- }
899
- function getDependencies(metaObj, propName) {
900
- if (!metaObj.has(propName)) {
901
- return null;
902
- }
903
- const deps = metaObj.getValue(propName);
904
- if (deps.isArray()) {
905
- return deps.getArray().map((dep) => getDependency(dep.getObject()));
906
- }
907
- if (deps.isString()) {
908
- return "invalid";
909
- }
910
- return null;
911
- }
912
-
913
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_injectable_linker_1.mjs
914
- import { compileInjectable, createMayBeForwardRefExpression as createMayBeForwardRefExpression2, outputAst as o3 } from "@angular/compiler";
915
- var PartialInjectableLinkerVersion1 = class {
916
- linkPartialDeclaration(constantPool, metaObj) {
917
- const meta = toR3InjectableMeta(metaObj);
918
- const def = compileInjectable(meta, false);
919
- return def.expression;
920
- }
921
- };
922
- function toR3InjectableMeta(metaObj) {
923
- const typeExpr = metaObj.getValue("type");
924
- const typeName = typeExpr.getSymbolName();
925
- if (typeName === null) {
926
- throw new FatalLinkerError(typeExpr.expression, "Unsupported type, its name could not be determined");
927
- }
928
- const meta = {
929
- name: typeName,
930
- type: wrapReference(typeExpr.getOpaque()),
931
- internalType: typeExpr.getOpaque(),
932
- typeArgumentCount: 0,
933
- providedIn: metaObj.has("providedIn") ? extractForwardRef(metaObj.getValue("providedIn")) : createMayBeForwardRefExpression2(o3.literal(null), 0)
934
- };
935
- if (metaObj.has("useClass")) {
936
- meta.useClass = extractForwardRef(metaObj.getValue("useClass"));
937
- }
938
- if (metaObj.has("useFactory")) {
939
- meta.useFactory = metaObj.getOpaque("useFactory");
940
- }
941
- if (metaObj.has("useExisting")) {
942
- meta.useExisting = extractForwardRef(metaObj.getValue("useExisting"));
943
- }
944
- if (metaObj.has("useValue")) {
945
- meta.useValue = extractForwardRef(metaObj.getValue("useValue"));
946
- }
947
- if (metaObj.has("deps")) {
948
- meta.deps = metaObj.getArray("deps").map((dep) => getDependency(dep.getObject()));
949
- }
950
- return meta;
951
- }
952
-
953
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_injector_linker_1.mjs
954
- import { compileInjector } from "@angular/compiler";
955
- var PartialInjectorLinkerVersion1 = class {
956
- linkPartialDeclaration(constantPool, metaObj) {
957
- const meta = toR3InjectorMeta(metaObj);
958
- const def = compileInjector(meta);
959
- return def.expression;
960
- }
961
- };
962
- function toR3InjectorMeta(metaObj) {
963
- const typeExpr = metaObj.getValue("type");
964
- const typeName = typeExpr.getSymbolName();
965
- if (typeName === null) {
966
- throw new FatalLinkerError(typeExpr.expression, "Unsupported type, its name could not be determined");
967
- }
968
- return {
969
- name: typeName,
970
- type: wrapReference(typeExpr.getOpaque()),
971
- internalType: metaObj.getOpaque("type"),
972
- providers: metaObj.has("providers") ? metaObj.getOpaque("providers") : null,
973
- imports: metaObj.has("imports") ? metaObj.getArray("imports").map((i) => i.getOpaque()) : []
974
- };
975
- }
976
-
977
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_ng_module_linker_1.mjs
978
- import { compileNgModule } from "@angular/compiler";
979
- var PartialNgModuleLinkerVersion1 = class {
980
- constructor(emitInline) {
981
- this.emitInline = emitInline;
982
- }
983
- linkPartialDeclaration(constantPool, metaObj) {
984
- const meta = toR3NgModuleMeta(metaObj, this.emitInline);
985
- const def = compileNgModule(meta);
986
- return def.expression;
987
- }
988
- };
989
- function toR3NgModuleMeta(metaObj, emitInline) {
990
- const wrappedType = metaObj.getOpaque("type");
991
- const meta = {
992
- type: wrapReference(wrappedType),
993
- internalType: wrappedType,
994
- adjacentType: wrappedType,
995
- bootstrap: [],
996
- declarations: [],
997
- imports: [],
998
- exports: [],
999
- emitInline,
1000
- containsForwardDecls: false,
1001
- schemas: [],
1002
- id: metaObj.has("id") ? metaObj.getOpaque("id") : null
1003
- };
1004
- if (metaObj.has("bootstrap")) {
1005
- const bootstrap = metaObj.getValue("bootstrap");
1006
- if (bootstrap.isFunction()) {
1007
- meta.containsForwardDecls = true;
1008
- meta.bootstrap = wrapReferences(unwrapForwardRefs(bootstrap));
1009
- } else
1010
- meta.bootstrap = wrapReferences(bootstrap);
1011
- }
1012
- if (metaObj.has("declarations")) {
1013
- const declarations = metaObj.getValue("declarations");
1014
- if (declarations.isFunction()) {
1015
- meta.containsForwardDecls = true;
1016
- meta.declarations = wrapReferences(unwrapForwardRefs(declarations));
1017
- } else
1018
- meta.declarations = wrapReferences(declarations);
1019
- }
1020
- if (metaObj.has("imports")) {
1021
- const imports = metaObj.getValue("imports");
1022
- if (imports.isFunction()) {
1023
- meta.containsForwardDecls = true;
1024
- meta.imports = wrapReferences(unwrapForwardRefs(imports));
1025
- } else
1026
- meta.imports = wrapReferences(imports);
1027
- }
1028
- if (metaObj.has("exports")) {
1029
- const exports = metaObj.getValue("exports");
1030
- if (exports.isFunction()) {
1031
- meta.containsForwardDecls = true;
1032
- meta.exports = wrapReferences(unwrapForwardRefs(exports));
1033
- } else
1034
- meta.exports = wrapReferences(exports);
1035
- }
1036
- if (metaObj.has("schemas")) {
1037
- const schemas = metaObj.getValue("schemas");
1038
- meta.schemas = wrapReferences(schemas);
1039
- }
1040
- return meta;
1041
- }
1042
- function unwrapForwardRefs(field) {
1043
- return field.getFunctionReturnValue();
1044
- }
1045
- function wrapReferences(values) {
1046
- return values.getArray().map((i) => wrapReference(i.getOpaque()));
1047
- }
1048
-
1049
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_pipe_linker_1.mjs
1050
- import { compilePipeFromMetadata } from "@angular/compiler";
1051
- var PartialPipeLinkerVersion1 = class {
1052
- constructor() {
1053
- }
1054
- linkPartialDeclaration(constantPool, metaObj) {
1055
- const meta = toR3PipeMeta(metaObj);
1056
- const def = compilePipeFromMetadata(meta);
1057
- return def.expression;
1058
- }
1059
- };
1060
- function toR3PipeMeta(metaObj) {
1061
- const typeExpr = metaObj.getValue("type");
1062
- const typeName = typeExpr.getSymbolName();
1063
- if (typeName === null) {
1064
- throw new FatalLinkerError(typeExpr.expression, "Unsupported type, its name could not be determined");
1065
- }
1066
- const pure = metaObj.has("pure") ? metaObj.getBoolean("pure") : true;
1067
- return {
1068
- name: typeName,
1069
- type: wrapReference(typeExpr.getOpaque()),
1070
- internalType: metaObj.getOpaque("type"),
1071
- typeArgumentCount: 0,
1072
- deps: null,
1073
- pipeName: metaObj.getString("name"),
1074
- pure
1075
- };
1076
- }
1077
-
1078
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_linker_selector.mjs
1079
- var \u0275\u0275ngDeclareDirective = "\u0275\u0275ngDeclareDirective";
1080
- var \u0275\u0275ngDeclareClassMetadata = "\u0275\u0275ngDeclareClassMetadata";
1081
- var \u0275\u0275ngDeclareComponent = "\u0275\u0275ngDeclareComponent";
1082
- var \u0275\u0275ngDeclareFactory = "\u0275\u0275ngDeclareFactory";
1083
- var \u0275\u0275ngDeclareInjectable = "\u0275\u0275ngDeclareInjectable";
1084
- var \u0275\u0275ngDeclareInjector = "\u0275\u0275ngDeclareInjector";
1085
- var \u0275\u0275ngDeclareNgModule = "\u0275\u0275ngDeclareNgModule";
1086
- var \u0275\u0275ngDeclarePipe = "\u0275\u0275ngDeclarePipe";
1087
- function createLinkerMap(environment, sourceUrl, code) {
1088
- const linkers = new Map();
1089
- const LATEST_VERSION_RANGE = getRange("<=", "13.0.3");
1090
- linkers.set(\u0275\u0275ngDeclareDirective, [
1091
- { range: LATEST_VERSION_RANGE, linker: new PartialDirectiveLinkerVersion1(sourceUrl, code) }
1092
- ]);
1093
- linkers.set(\u0275\u0275ngDeclareClassMetadata, [
1094
- { range: LATEST_VERSION_RANGE, linker: new PartialClassMetadataLinkerVersion1() }
1095
- ]);
1096
- linkers.set(\u0275\u0275ngDeclareComponent, [
1097
- {
1098
- range: LATEST_VERSION_RANGE,
1099
- linker: new PartialComponentLinkerVersion1(createGetSourceFile(sourceUrl, code, environment.sourceFileLoader), sourceUrl, code)
1100
- }
1101
- ]);
1102
- linkers.set(\u0275\u0275ngDeclareFactory, [
1103
- { range: LATEST_VERSION_RANGE, linker: new PartialFactoryLinkerVersion1() }
1104
- ]);
1105
- linkers.set(\u0275\u0275ngDeclareInjectable, [
1106
- { range: LATEST_VERSION_RANGE, linker: new PartialInjectableLinkerVersion1() }
1107
- ]);
1108
- linkers.set(\u0275\u0275ngDeclareInjector, [
1109
- { range: LATEST_VERSION_RANGE, linker: new PartialInjectorLinkerVersion1() }
1110
- ]);
1111
- linkers.set(\u0275\u0275ngDeclareNgModule, [
1112
- {
1113
- range: LATEST_VERSION_RANGE,
1114
- linker: new PartialNgModuleLinkerVersion1(environment.options.linkerJitMode)
1115
- }
1116
- ]);
1117
- linkers.set(\u0275\u0275ngDeclarePipe, [
1118
- { range: LATEST_VERSION_RANGE, linker: new PartialPipeLinkerVersion1() }
1119
- ]);
1120
- return linkers;
1121
- }
1122
- var PartialLinkerSelector = class {
1123
- constructor(linkers, logger, unknownDeclarationVersionHandling) {
1124
- this.linkers = linkers;
1125
- this.logger = logger;
1126
- this.unknownDeclarationVersionHandling = unknownDeclarationVersionHandling;
1127
- }
1128
- supportsDeclaration(functionName) {
1129
- return this.linkers.has(functionName);
1130
- }
1131
- getLinker(functionName, minVersion, version) {
1132
- if (!this.linkers.has(functionName)) {
1133
- throw new Error(`Unknown partial declaration function ${functionName}.`);
1134
- }
1135
- const linkerRanges = this.linkers.get(functionName);
1136
- if (version === "13.0.3") {
1137
- return linkerRanges[linkerRanges.length - 1].linker;
1138
- }
1139
- const declarationRange = getRange(">=", minVersion);
1140
- for (const { range: linkerRange, linker } of linkerRanges) {
1141
- if (semver.intersects(declarationRange, linkerRange)) {
1142
- return linker;
1143
- }
1144
- }
1145
- const message = `This application depends upon a library published using Angular version ${version}, which requires Angular version ${minVersion} or newer to work correctly.
1146
- Consider upgrading your application to use a more recent version of Angular.`;
1147
- if (this.unknownDeclarationVersionHandling === "error") {
1148
- throw new Error(message);
1149
- } else if (this.unknownDeclarationVersionHandling === "warn") {
1150
- this.logger.warn(`${message}
1151
- Attempting to continue using this version of Angular.`);
1152
- }
1153
- return linkerRanges[linkerRanges.length - 1].linker;
1154
- }
1155
- };
1156
- function getRange(comparator, versionStr) {
1157
- const version = new semver.SemVer(versionStr);
1158
- version.prerelease = [];
1159
- return new semver.Range(`${comparator}${version.format()}`);
1160
- }
1161
-
1162
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/file_linker.mjs
1163
- var FileLinker = class {
1164
- constructor(linkerEnvironment, sourceUrl, code) {
1165
- this.linkerEnvironment = linkerEnvironment;
1166
- this.emitScopes = new Map();
1167
- this.linkerSelector = new PartialLinkerSelector(createLinkerMap(this.linkerEnvironment, sourceUrl, code), this.linkerEnvironment.logger, this.linkerEnvironment.options.unknownDeclarationVersionHandling);
1168
- }
1169
- isPartialDeclaration(calleeName) {
1170
- return this.linkerSelector.supportsDeclaration(calleeName);
1171
- }
1172
- linkPartialDeclaration(declarationFn, args, declarationScope) {
1173
- if (args.length !== 1) {
1174
- throw new Error(`Invalid function call: It should have only a single object literal argument, but contained ${args.length}.`);
1175
- }
1176
- const metaObj = AstObject.parse(args[0], this.linkerEnvironment.host);
1177
- const ngImport = metaObj.getNode("ngImport");
1178
- const emitScope = this.getEmitScope(ngImport, declarationScope);
1179
- const minVersion = metaObj.getString("minVersion");
1180
- const version = metaObj.getString("version");
1181
- const linker = this.linkerSelector.getLinker(declarationFn, minVersion, version);
1182
- const definition = linker.linkPartialDeclaration(emitScope.constantPool, metaObj);
1183
- return emitScope.translateDefinition(definition);
1184
- }
1185
- getConstantStatements() {
1186
- const results = [];
1187
- for (const [constantScope, emitScope] of this.emitScopes.entries()) {
1188
- const statements = emitScope.getConstantStatements();
1189
- results.push({ constantScope, statements });
1190
- }
1191
- return results;
1192
- }
1193
- getEmitScope(ngImport, declarationScope) {
1194
- const constantScope = declarationScope.getConstantScopeRef(ngImport);
1195
- if (constantScope === null) {
1196
- return new IifeEmitScope(ngImport, this.linkerEnvironment.translator, this.linkerEnvironment.factory);
1197
- }
1198
- if (!this.emitScopes.has(constantScope)) {
1199
- this.emitScopes.set(constantScope, new EmitScope(ngImport, this.linkerEnvironment.translator));
1200
- }
1201
- return this.emitScopes.get(constantScope);
1202
- }
1203
- };
1204
-
1205
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/sourcemaps/src/content_origin.mjs
1206
- var ContentOrigin;
1207
- (function(ContentOrigin2) {
1208
- ContentOrigin2[ContentOrigin2["Provided"] = 0] = "Provided";
1209
- ContentOrigin2[ContentOrigin2["Inline"] = 1] = "Inline";
1210
- ContentOrigin2[ContentOrigin2["FileSystem"] = 2] = "FileSystem";
1211
- })(ContentOrigin || (ContentOrigin = {}));
1212
-
1213
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/sourcemaps/src/source_file.mjs
1214
- import mapHelpers from "convert-source-map";
1215
- import { decode, encode } from "sourcemap-codec";
1216
-
1217
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/sourcemaps/src/segment_marker.mjs
1218
- function compareSegments(a, b) {
1219
- return a.position - b.position;
1220
- }
1221
- function offsetSegment(startOfLinePositions, marker, offset) {
1222
- if (offset === 0) {
1223
- return marker;
1224
- }
1225
- let line = marker.line;
1226
- const position = marker.position + offset;
1227
- while (line < startOfLinePositions.length - 1 && startOfLinePositions[line + 1] <= position) {
1228
- line++;
1229
- }
1230
- while (line > 0 && startOfLinePositions[line] > position) {
1231
- line--;
1232
- }
1233
- const column = position - startOfLinePositions[line];
1234
- return { line, column, position, next: void 0 };
1235
- }
1236
-
1237
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/sourcemaps/src/source_file.mjs
1238
- function removeSourceMapComments(contents) {
1239
- return mapHelpers.removeMapFileComments(mapHelpers.removeComments(contents)).replace(/\n\n$/, "\n");
1240
- }
1241
- var SourceFile = class {
1242
- constructor(sourcePath, contents, rawMap, sources, fs3) {
1243
- this.sourcePath = sourcePath;
1244
- this.contents = contents;
1245
- this.rawMap = rawMap;
1246
- this.sources = sources;
1247
- this.fs = fs3;
1248
- this.contents = removeSourceMapComments(contents);
1249
- this.startOfLinePositions = computeStartOfLinePositions(this.contents);
1250
- this.flattenedMappings = this.flattenMappings();
1251
- }
1252
- renderFlattenedSourceMap() {
1253
- const sources = new IndexedMap();
1254
- const names = new IndexedSet();
1255
- const mappings = [];
1256
- const sourcePathDir = this.fs.dirname(this.sourcePath);
1257
- const relativeSourcePathCache = new Cache((input) => this.fs.relative(sourcePathDir, input));
1258
- for (const mapping of this.flattenedMappings) {
1259
- const sourceIndex = sources.set(relativeSourcePathCache.get(mapping.originalSource.sourcePath), mapping.originalSource.contents);
1260
- const mappingArray = [
1261
- mapping.generatedSegment.column,
1262
- sourceIndex,
1263
- mapping.originalSegment.line,
1264
- mapping.originalSegment.column
1265
- ];
1266
- if (mapping.name !== void 0) {
1267
- const nameIndex = names.add(mapping.name);
1268
- mappingArray.push(nameIndex);
1269
- }
1270
- const line = mapping.generatedSegment.line;
1271
- while (line >= mappings.length) {
1272
- mappings.push([]);
1273
- }
1274
- mappings[line].push(mappingArray);
1275
- }
1276
- const sourceMap = {
1277
- version: 3,
1278
- file: this.fs.relative(sourcePathDir, this.sourcePath),
1279
- sources: sources.keys,
1280
- names: names.values,
1281
- mappings: encode(mappings),
1282
- sourcesContent: sources.values
1283
- };
1284
- return sourceMap;
1285
- }
1286
- getOriginalLocation(line, column) {
1287
- if (this.flattenedMappings.length === 0) {
1288
- return null;
1289
- }
1290
- let position;
1291
- if (line < this.startOfLinePositions.length) {
1292
- position = this.startOfLinePositions[line] + column;
1293
- } else {
1294
- position = this.contents.length;
1295
- }
1296
- const locationSegment = { line, column, position, next: void 0 };
1297
- let mappingIndex = findLastMappingIndexBefore(this.flattenedMappings, locationSegment, false, 0);
1298
- if (mappingIndex < 0) {
1299
- mappingIndex = 0;
1300
- }
1301
- const { originalSegment, originalSource, generatedSegment } = this.flattenedMappings[mappingIndex];
1302
- const offset = locationSegment.position - generatedSegment.position;
1303
- const offsetOriginalSegment = offsetSegment(originalSource.startOfLinePositions, originalSegment, offset);
1304
- return {
1305
- file: originalSource.sourcePath,
1306
- line: offsetOriginalSegment.line,
1307
- column: offsetOriginalSegment.column
1308
- };
1309
- }
1310
- flattenMappings() {
1311
- const mappings = parseMappings(this.rawMap && this.rawMap.map, this.sources, this.startOfLinePositions);
1312
- ensureOriginalSegmentLinks(mappings);
1313
- const flattenedMappings = [];
1314
- for (let mappingIndex = 0; mappingIndex < mappings.length; mappingIndex++) {
1315
- const aToBmapping = mappings[mappingIndex];
1316
- const bSource = aToBmapping.originalSource;
1317
- if (bSource.flattenedMappings.length === 0) {
1318
- flattenedMappings.push(aToBmapping);
1319
- continue;
1320
- }
1321
- const incomingStart = aToBmapping.originalSegment;
1322
- const incomingEnd = incomingStart.next;
1323
- let outgoingStartIndex = findLastMappingIndexBefore(bSource.flattenedMappings, incomingStart, false, 0);
1324
- if (outgoingStartIndex < 0) {
1325
- outgoingStartIndex = 0;
1326
- }
1327
- const outgoingEndIndex = incomingEnd !== void 0 ? findLastMappingIndexBefore(bSource.flattenedMappings, incomingEnd, true, outgoingStartIndex) : bSource.flattenedMappings.length - 1;
1328
- for (let bToCmappingIndex = outgoingStartIndex; bToCmappingIndex <= outgoingEndIndex; bToCmappingIndex++) {
1329
- const bToCmapping = bSource.flattenedMappings[bToCmappingIndex];
1330
- flattenedMappings.push(mergeMappings(this, aToBmapping, bToCmapping));
1331
- }
1332
- }
1333
- return flattenedMappings;
1334
- }
1335
- };
1336
- function findLastMappingIndexBefore(mappings, marker, exclusive, lowerIndex) {
1337
- let upperIndex = mappings.length - 1;
1338
- const test = exclusive ? -1 : 0;
1339
- if (compareSegments(mappings[lowerIndex].generatedSegment, marker) > test) {
1340
- return -1;
1341
- }
1342
- let matchingIndex = -1;
1343
- while (lowerIndex <= upperIndex) {
1344
- const index = upperIndex + lowerIndex >> 1;
1345
- if (compareSegments(mappings[index].generatedSegment, marker) <= test) {
1346
- matchingIndex = index;
1347
- lowerIndex = index + 1;
1348
- } else {
1349
- upperIndex = index - 1;
1350
- }
1351
- }
1352
- return matchingIndex;
1353
- }
1354
- function mergeMappings(generatedSource, ab, bc) {
1355
- const name = bc.name || ab.name;
1356
- const diff = compareSegments(bc.generatedSegment, ab.originalSegment);
1357
- if (diff > 0) {
1358
- return {
1359
- name,
1360
- generatedSegment: offsetSegment(generatedSource.startOfLinePositions, ab.generatedSegment, diff),
1361
- originalSource: bc.originalSource,
1362
- originalSegment: bc.originalSegment
1363
- };
1364
- } else {
1365
- return {
1366
- name,
1367
- generatedSegment: ab.generatedSegment,
1368
- originalSource: bc.originalSource,
1369
- originalSegment: offsetSegment(bc.originalSource.startOfLinePositions, bc.originalSegment, -diff)
1370
- };
1371
- }
1372
- }
1373
- function parseMappings(rawMap, sources, generatedSourceStartOfLinePositions) {
1374
- if (rawMap === null) {
1375
- return [];
1376
- }
1377
- const rawMappings = decode(rawMap.mappings);
1378
- if (rawMappings === null) {
1379
- return [];
1380
- }
1381
- const mappings = [];
1382
- for (let generatedLine = 0; generatedLine < rawMappings.length; generatedLine++) {
1383
- const generatedLineMappings = rawMappings[generatedLine];
1384
- for (const rawMapping of generatedLineMappings) {
1385
- if (rawMapping.length >= 4) {
1386
- const originalSource = sources[rawMapping[1]];
1387
- if (originalSource === null || originalSource === void 0) {
1388
- continue;
1389
- }
1390
- const generatedColumn = rawMapping[0];
1391
- const name = rawMapping.length === 5 ? rawMap.names[rawMapping[4]] : void 0;
1392
- const line = rawMapping[2];
1393
- const column = rawMapping[3];
1394
- const generatedSegment = {
1395
- line: generatedLine,
1396
- column: generatedColumn,
1397
- position: generatedSourceStartOfLinePositions[generatedLine] + generatedColumn,
1398
- next: void 0
1399
- };
1400
- const originalSegment = {
1401
- line,
1402
- column,
1403
- position: originalSource.startOfLinePositions[line] + column,
1404
- next: void 0
1405
- };
1406
- mappings.push({ name, generatedSegment, originalSegment, originalSource });
1407
- }
1408
- }
1409
- }
1410
- return mappings;
1411
- }
1412
- function extractOriginalSegments(mappings) {
1413
- const originalSegments = new Map();
1414
- for (const mapping of mappings) {
1415
- const originalSource = mapping.originalSource;
1416
- if (!originalSegments.has(originalSource)) {
1417
- originalSegments.set(originalSource, []);
1418
- }
1419
- const segments = originalSegments.get(originalSource);
1420
- segments.push(mapping.originalSegment);
1421
- }
1422
- originalSegments.forEach((segmentMarkers) => segmentMarkers.sort(compareSegments));
1423
- return originalSegments;
1424
- }
1425
- function ensureOriginalSegmentLinks(mappings) {
1426
- const segmentsBySource = extractOriginalSegments(mappings);
1427
- segmentsBySource.forEach((markers) => {
1428
- for (let i = 0; i < markers.length - 1; i++) {
1429
- markers[i].next = markers[i + 1];
1430
- }
1431
- });
1432
- }
1433
- function computeStartOfLinePositions(str) {
1434
- const NEWLINE_MARKER_OFFSET = 1;
1435
- const lineLengths = computeLineLengths(str);
1436
- const startPositions = [0];
1437
- for (let i = 0; i < lineLengths.length - 1; i++) {
1438
- startPositions.push(startPositions[i] + lineLengths[i] + NEWLINE_MARKER_OFFSET);
1439
- }
1440
- return startPositions;
1441
- }
1442
- function computeLineLengths(str) {
1443
- return str.split(/\n/).map((s) => s.length);
1444
- }
1445
- var IndexedMap = class {
1446
- constructor() {
1447
- this.map = new Map();
1448
- this.keys = [];
1449
- this.values = [];
1450
- }
1451
- set(key, value) {
1452
- if (this.map.has(key)) {
1453
- return this.map.get(key);
1454
- }
1455
- const index = this.values.push(value) - 1;
1456
- this.keys.push(key);
1457
- this.map.set(key, index);
1458
- return index;
1459
- }
1460
- };
1461
- var IndexedSet = class {
1462
- constructor() {
1463
- this.map = new Map();
1464
- this.values = [];
1465
- }
1466
- add(value) {
1467
- if (this.map.has(value)) {
1468
- return this.map.get(value);
1469
- }
1470
- const index = this.values.push(value) - 1;
1471
- this.map.set(value, index);
1472
- return index;
1473
- }
1474
- };
1475
- var Cache = class {
1476
- constructor(computeFn) {
1477
- this.computeFn = computeFn;
1478
- this.map = new Map();
1479
- }
1480
- get(input) {
1481
- if (!this.map.has(input)) {
1482
- this.map.set(input, this.computeFn(input));
1483
- }
1484
- return this.map.get(input);
1485
- }
1486
- };
1487
-
1488
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/sourcemaps/src/source_file_loader.mjs
1489
- import mapHelpers2 from "convert-source-map";
1490
- var SCHEME_MATCHER = /^([a-z][a-z0-9.-]*):\/\//i;
1491
- var SourceFileLoader = class {
1492
- constructor(fs3, logger, schemeMap) {
1493
- this.fs = fs3;
1494
- this.logger = logger;
1495
- this.schemeMap = schemeMap;
1496
- this.currentPaths = [];
1497
- }
1498
- loadSourceFile(sourcePath, contents = null, mapAndPath = null) {
1499
- const contentsOrigin = contents !== null ? ContentOrigin.Provided : ContentOrigin.FileSystem;
1500
- const sourceMapInfo = mapAndPath && __spreadValues({ origin: ContentOrigin.Provided }, mapAndPath);
1501
- return this.loadSourceFileInternal(sourcePath, contents, contentsOrigin, sourceMapInfo);
1502
- }
1503
- loadSourceFileInternal(sourcePath, contents, sourceOrigin, sourceMapInfo) {
1504
- const previousPaths = this.currentPaths.slice();
1505
- try {
1506
- if (contents === null) {
1507
- if (!this.fs.exists(sourcePath)) {
1508
- return null;
1509
- }
1510
- contents = this.readSourceFile(sourcePath);
1511
- }
1512
- if (sourceMapInfo === null) {
1513
- sourceMapInfo = this.loadSourceMap(sourcePath, contents, sourceOrigin);
1514
- }
1515
- let sources = [];
1516
- if (sourceMapInfo !== null) {
1517
- const basePath = sourceMapInfo.mapPath || sourcePath;
1518
- sources = this.processSources(basePath, sourceMapInfo);
1519
- }
1520
- return new SourceFile(sourcePath, contents, sourceMapInfo, sources, this.fs);
1521
- } catch (e) {
1522
- this.logger.warn(`Unable to fully load ${sourcePath} for source-map flattening: ${e.message}`);
1523
- return null;
1524
- } finally {
1525
- this.currentPaths = previousPaths;
1526
- }
1527
- }
1528
- loadSourceMap(sourcePath, sourceContents, sourceOrigin) {
1529
- const lastLine = this.getLastNonEmptyLine(sourceContents);
1530
- const inline = mapHelpers2.commentRegex.exec(lastLine);
1531
- if (inline !== null) {
1532
- return {
1533
- map: mapHelpers2.fromComment(inline.pop()).sourcemap,
1534
- mapPath: null,
1535
- origin: ContentOrigin.Inline
1536
- };
1537
- }
1538
- if (sourceOrigin === ContentOrigin.Inline) {
1539
- return null;
1540
- }
1541
- const external = mapHelpers2.mapFileCommentRegex.exec(lastLine);
1542
- if (external) {
1543
- try {
1544
- const fileName = external[1] || external[2];
1545
- const externalMapPath = this.fs.resolve(this.fs.dirname(sourcePath), fileName);
1546
- return {
1547
- map: this.readRawSourceMap(externalMapPath),
1548
- mapPath: externalMapPath,
1549
- origin: ContentOrigin.FileSystem
1550
- };
1551
- } catch (e) {
1552
- this.logger.warn(`Unable to fully load ${sourcePath} for source-map flattening: ${e.message}`);
1553
- return null;
1554
- }
1555
- }
1556
- const impliedMapPath = this.fs.resolve(sourcePath + ".map");
1557
- if (this.fs.exists(impliedMapPath)) {
1558
- return {
1559
- map: this.readRawSourceMap(impliedMapPath),
1560
- mapPath: impliedMapPath,
1561
- origin: ContentOrigin.FileSystem
1562
- };
1563
- }
1564
- return null;
1565
- }
1566
- processSources(basePath, { map, origin: sourceMapOrigin }) {
1567
- const sourceRoot = this.fs.resolve(this.fs.dirname(basePath), this.replaceSchemeWithPath(map.sourceRoot || ""));
1568
- return map.sources.map((source, index) => {
1569
- const path = this.fs.resolve(sourceRoot, this.replaceSchemeWithPath(source));
1570
- const content = map.sourcesContent && map.sourcesContent[index] || null;
1571
- const sourceOrigin = content !== null && sourceMapOrigin !== ContentOrigin.Provided ? ContentOrigin.Inline : ContentOrigin.FileSystem;
1572
- return this.loadSourceFileInternal(path, content, sourceOrigin, null);
1573
- });
1574
- }
1575
- readSourceFile(sourcePath) {
1576
- this.trackPath(sourcePath);
1577
- return this.fs.readFile(sourcePath);
1578
- }
1579
- readRawSourceMap(mapPath) {
1580
- this.trackPath(mapPath);
1581
- return JSON.parse(this.fs.readFile(mapPath));
1582
- }
1583
- trackPath(path) {
1584
- if (this.currentPaths.includes(path)) {
1585
- throw new Error(`Circular source file mapping dependency: ${this.currentPaths.join(" -> ")} -> ${path}`);
1586
- }
1587
- this.currentPaths.push(path);
1588
- }
1589
- getLastNonEmptyLine(contents) {
1590
- let trailingWhitespaceIndex = contents.length - 1;
1591
- while (trailingWhitespaceIndex > 0 && (contents[trailingWhitespaceIndex] === "\n" || contents[trailingWhitespaceIndex] === "\r")) {
1592
- trailingWhitespaceIndex--;
1593
- }
1594
- let lastRealLineIndex = contents.lastIndexOf("\n", trailingWhitespaceIndex - 1);
1595
- if (lastRealLineIndex === -1) {
1596
- lastRealLineIndex = 0;
1597
- }
1598
- return contents.substr(lastRealLineIndex + 1);
1599
- }
1600
- replaceSchemeWithPath(path) {
1601
- return path.replace(SCHEME_MATCHER, (_, scheme) => this.schemeMap[scheme.toLowerCase()] || "");
1602
- }
1603
- };
1604
-
1605
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/linker_options.mjs
1606
- var DEFAULT_LINKER_OPTIONS = {
1607
- sourceMapping: true,
1608
- linkerJitMode: false,
1609
- unknownDeclarationVersionHandling: "error"
1610
- };
1611
-
1612
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/context.mjs
1613
- var Context = class {
1614
- constructor(isStatement) {
1615
- this.isStatement = isStatement;
1616
- }
1617
- get withExpressionMode() {
1618
- return this.isStatement ? new Context(false) : this;
1619
- }
1620
- get withStatementMode() {
1621
- return !this.isStatement ? new Context(true) : this;
1622
- }
1623
- };
1624
-
1625
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/import_manager.mjs
1626
- import ts6 from "typescript";
1627
-
1628
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/alias.mjs
1629
- import { ExternalExpr as ExternalExpr2 } from "@angular/compiler";
1630
-
1631
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/emitter.mjs
1632
- import { ExternalExpr, ExternalReference, WrappedNodeExpr as WrappedNodeExpr2 } from "@angular/compiler";
1633
- import ts4 from "typescript";
1634
-
1635
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/util/src/typescript.mjs
1636
- import ts2 from "typescript";
1637
-
1638
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/find_export.mjs
1639
- import ts3 from "typescript";
1640
-
1641
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/emitter.mjs
1642
- var ImportFlags;
1643
- (function(ImportFlags2) {
1644
- ImportFlags2[ImportFlags2["None"] = 0] = "None";
1645
- ImportFlags2[ImportFlags2["ForceNewImport"] = 1] = "ForceNewImport";
1646
- ImportFlags2[ImportFlags2["NoAliasing"] = 2] = "NoAliasing";
1647
- ImportFlags2[ImportFlags2["AllowTypeImports"] = 4] = "AllowTypeImports";
1648
- })(ImportFlags || (ImportFlags = {}));
1649
-
1650
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/core.mjs
1651
- var CORE_SUPPORTED_SYMBOLS = new Map([
1652
- ["\u0275\u0275defineInjectable", "\u0275\u0275defineInjectable"],
1653
- ["\u0275\u0275defineInjector", "\u0275\u0275defineInjector"],
1654
- ["\u0275\u0275defineNgModule", "\u0275\u0275defineNgModule"],
1655
- ["\u0275\u0275setNgModuleScope", "\u0275\u0275setNgModuleScope"],
1656
- ["\u0275\u0275inject", "\u0275\u0275inject"],
1657
- ["\u0275\u0275FactoryDeclaration", "\u0275\u0275FactoryDeclaration"],
1658
- ["\u0275setClassMetadata", "setClassMetadata"],
1659
- ["\u0275\u0275InjectableDeclaration", "\u0275\u0275InjectableDeclaration"],
1660
- ["\u0275\u0275InjectorDeclaration", "\u0275\u0275InjectorDeclaration"],
1661
- ["\u0275\u0275NgModuleDeclaration", "\u0275\u0275NgModuleDeclaration"],
1662
- ["\u0275NgModuleFactory", "NgModuleFactory"],
1663
- ["\u0275noSideEffects", "\u0275noSideEffects"]
1664
- ]);
1665
-
1666
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/default.mjs
1667
- import ts5 from "typescript";
1668
- var DefaultImportDeclaration = Symbol("DefaultImportDeclaration");
1669
-
1670
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/translator.mjs
1671
- import {
1672
- BinaryOperator,
1673
- ConditionalExpr,
1674
- StmtModifier,
1675
- UnaryOperator
1676
- } from "@angular/compiler";
1677
- var UNARY_OPERATORS = new Map([
1678
- [UnaryOperator.Minus, "-"],
1679
- [UnaryOperator.Plus, "+"]
1680
- ]);
1681
- var BINARY_OPERATORS = new Map([
1682
- [BinaryOperator.And, "&&"],
1683
- [BinaryOperator.Bigger, ">"],
1684
- [BinaryOperator.BiggerEquals, ">="],
1685
- [BinaryOperator.BitwiseAnd, "&"],
1686
- [BinaryOperator.Divide, "/"],
1687
- [BinaryOperator.Equals, "=="],
1688
- [BinaryOperator.Identical, "==="],
1689
- [BinaryOperator.Lower, "<"],
1690
- [BinaryOperator.LowerEquals, "<="],
1691
- [BinaryOperator.Minus, "-"],
1692
- [BinaryOperator.Modulo, "%"],
1693
- [BinaryOperator.Multiply, "*"],
1694
- [BinaryOperator.NotEquals, "!="],
1695
- [BinaryOperator.NotIdentical, "!=="],
1696
- [BinaryOperator.Or, "||"],
1697
- [BinaryOperator.Plus, "+"],
1698
- [BinaryOperator.NullishCoalesce, "??"]
1699
- ]);
1700
- var ExpressionTranslatorVisitor = class {
1701
- constructor(factory, imports, options) {
1702
- this.factory = factory;
1703
- this.imports = imports;
1704
- this.downlevelTaggedTemplates = options.downlevelTaggedTemplates === true;
1705
- this.downlevelVariableDeclarations = options.downlevelVariableDeclarations === true;
1706
- this.recordWrappedNode = options.recordWrappedNode || (() => {
1707
- });
1708
- }
1709
- visitDeclareVarStmt(stmt, context) {
1710
- var _a2;
1711
- const varType = this.downlevelVariableDeclarations ? "var" : stmt.hasModifier(StmtModifier.Final) ? "const" : "let";
1712
- return this.attachComments(this.factory.createVariableDeclaration(stmt.name, (_a2 = stmt.value) == null ? void 0 : _a2.visitExpression(this, context.withExpressionMode), varType), stmt.leadingComments);
1713
- }
1714
- visitDeclareFunctionStmt(stmt, context) {
1715
- return this.attachComments(this.factory.createFunctionDeclaration(stmt.name, stmt.params.map((param) => param.name), this.factory.createBlock(this.visitStatements(stmt.statements, context.withStatementMode))), stmt.leadingComments);
1716
- }
1717
- visitExpressionStmt(stmt, context) {
1718
- return this.attachComments(this.factory.createExpressionStatement(stmt.expr.visitExpression(this, context.withStatementMode)), stmt.leadingComments);
1719
- }
1720
- visitReturnStmt(stmt, context) {
1721
- return this.attachComments(this.factory.createReturnStatement(stmt.value.visitExpression(this, context.withExpressionMode)), stmt.leadingComments);
1722
- }
1723
- visitDeclareClassStmt(_stmt, _context) {
1724
- throw new Error("Method not implemented.");
1725
- }
1726
- visitIfStmt(stmt, context) {
1727
- return this.attachComments(this.factory.createIfStatement(stmt.condition.visitExpression(this, context), this.factory.createBlock(this.visitStatements(stmt.trueCase, context.withStatementMode)), stmt.falseCase.length > 0 ? this.factory.createBlock(this.visitStatements(stmt.falseCase, context.withStatementMode)) : null), stmt.leadingComments);
1728
- }
1729
- visitTryCatchStmt(_stmt, _context) {
1730
- throw new Error("Method not implemented.");
1731
- }
1732
- visitThrowStmt(stmt, context) {
1733
- return this.attachComments(this.factory.createThrowStatement(stmt.error.visitExpression(this, context.withExpressionMode)), stmt.leadingComments);
1734
- }
1735
- visitReadVarExpr(ast, _context) {
1736
- const identifier = this.factory.createIdentifier(ast.name);
1737
- this.setSourceMapRange(identifier, ast.sourceSpan);
1738
- return identifier;
1739
- }
1740
- visitWriteVarExpr(expr, context) {
1741
- const assignment = this.factory.createAssignment(this.setSourceMapRange(this.factory.createIdentifier(expr.name), expr.sourceSpan), expr.value.visitExpression(this, context));
1742
- return context.isStatement ? assignment : this.factory.createParenthesizedExpression(assignment);
1743
- }
1744
- visitWriteKeyExpr(expr, context) {
1745
- const exprContext = context.withExpressionMode;
1746
- const target = this.factory.createElementAccess(expr.receiver.visitExpression(this, exprContext), expr.index.visitExpression(this, exprContext));
1747
- const assignment = this.factory.createAssignment(target, expr.value.visitExpression(this, exprContext));
1748
- return context.isStatement ? assignment : this.factory.createParenthesizedExpression(assignment);
1749
- }
1750
- visitWritePropExpr(expr, context) {
1751
- const target = this.factory.createPropertyAccess(expr.receiver.visitExpression(this, context), expr.name);
1752
- return this.factory.createAssignment(target, expr.value.visitExpression(this, context));
1753
- }
1754
- visitInvokeFunctionExpr(ast, context) {
1755
- return this.setSourceMapRange(this.factory.createCallExpression(ast.fn.visitExpression(this, context), ast.args.map((arg) => arg.visitExpression(this, context)), ast.pure), ast.sourceSpan);
1756
- }
1757
- visitTaggedTemplateExpr(ast, context) {
1758
- return this.setSourceMapRange(this.createTaggedTemplateExpression(ast.tag.visitExpression(this, context), {
1759
- elements: ast.template.elements.map((e) => {
1760
- var _a2;
1761
- return createTemplateElement({
1762
- cooked: e.text,
1763
- raw: e.rawText,
1764
- range: (_a2 = e.sourceSpan) != null ? _a2 : ast.sourceSpan
1765
- });
1766
- }),
1767
- expressions: ast.template.expressions.map((e) => e.visitExpression(this, context))
1768
- }), ast.sourceSpan);
1769
- }
1770
- visitInstantiateExpr(ast, context) {
1771
- return this.factory.createNewExpression(ast.classExpr.visitExpression(this, context), ast.args.map((arg) => arg.visitExpression(this, context)));
1772
- }
1773
- visitLiteralExpr(ast, _context) {
1774
- return this.setSourceMapRange(this.factory.createLiteral(ast.value), ast.sourceSpan);
1775
- }
1776
- visitLocalizedString(ast, context) {
1777
- const elements = [createTemplateElement(ast.serializeI18nHead())];
1778
- const expressions = [];
1779
- for (let i = 0; i < ast.expressions.length; i++) {
1780
- const placeholder = this.setSourceMapRange(ast.expressions[i].visitExpression(this, context), ast.getPlaceholderSourceSpan(i));
1781
- expressions.push(placeholder);
1782
- elements.push(createTemplateElement(ast.serializeI18nTemplatePart(i + 1)));
1783
- }
1784
- const localizeTag = this.factory.createIdentifier("$localize");
1785
- return this.setSourceMapRange(this.createTaggedTemplateExpression(localizeTag, { elements, expressions }), ast.sourceSpan);
1786
- }
1787
- createTaggedTemplateExpression(tag, template) {
1788
- return this.downlevelTaggedTemplates ? this.createES5TaggedTemplateFunctionCall(tag, template) : this.factory.createTaggedTemplate(tag, template);
1789
- }
1790
- createES5TaggedTemplateFunctionCall(tagHandler, { elements, expressions }) {
1791
- const { moduleImport, symbol } = this.imports.generateNamedImport("tslib", "__makeTemplateObject");
1792
- const __makeTemplateObjectHelper = moduleImport === null ? this.factory.createIdentifier(symbol) : this.factory.createPropertyAccess(moduleImport, symbol);
1793
- const cooked = [];
1794
- const raw = [];
1795
- for (const element of elements) {
1796
- cooked.push(this.factory.setSourceMapRange(this.factory.createLiteral(element.cooked), element.range));
1797
- raw.push(this.factory.setSourceMapRange(this.factory.createLiteral(element.raw), element.range));
1798
- }
1799
- const templateHelperCall = this.factory.createCallExpression(__makeTemplateObjectHelper, [this.factory.createArrayLiteral(cooked), this.factory.createArrayLiteral(raw)], false);
1800
- return this.factory.createCallExpression(tagHandler, [templateHelperCall, ...expressions], false);
1801
- }
1802
- visitExternalExpr(ast, _context) {
1803
- if (ast.value.name === null) {
1804
- if (ast.value.moduleName === null) {
1805
- throw new Error("Invalid import without name nor moduleName");
1806
- }
1807
- return this.imports.generateNamespaceImport(ast.value.moduleName);
1808
- }
1809
- if (ast.value.moduleName !== null) {
1810
- const { moduleImport, symbol } = this.imports.generateNamedImport(ast.value.moduleName, ast.value.name);
1811
- if (moduleImport === null) {
1812
- return this.factory.createIdentifier(symbol);
1813
- } else {
1814
- return this.factory.createPropertyAccess(moduleImport, symbol);
1815
- }
1816
- } else {
1817
- return this.factory.createIdentifier(ast.value.name);
1818
- }
1819
- }
1820
- visitConditionalExpr(ast, context) {
1821
- let cond = ast.condition.visitExpression(this, context);
1822
- if (ast.condition instanceof ConditionalExpr) {
1823
- cond = this.factory.createParenthesizedExpression(cond);
1824
- }
1825
- return this.factory.createConditional(cond, ast.trueCase.visitExpression(this, context), ast.falseCase.visitExpression(this, context));
1826
- }
1827
- visitNotExpr(ast, context) {
1828
- return this.factory.createUnaryExpression("!", ast.condition.visitExpression(this, context));
1829
- }
1830
- visitAssertNotNullExpr(ast, context) {
1831
- return ast.condition.visitExpression(this, context);
1832
- }
1833
- visitCastExpr(ast, context) {
1834
- return ast.value.visitExpression(this, context);
1835
- }
1836
- visitFunctionExpr(ast, context) {
1837
- var _a2;
1838
- return this.factory.createFunctionExpression((_a2 = ast.name) != null ? _a2 : null, ast.params.map((param) => param.name), this.factory.createBlock(this.visitStatements(ast.statements, context)));
1839
- }
1840
- visitBinaryOperatorExpr(ast, context) {
1841
- if (!BINARY_OPERATORS.has(ast.operator)) {
1842
- throw new Error(`Unknown binary operator: ${BinaryOperator[ast.operator]}`);
1843
- }
1844
- return this.factory.createBinaryExpression(ast.lhs.visitExpression(this, context), BINARY_OPERATORS.get(ast.operator), ast.rhs.visitExpression(this, context));
1845
- }
1846
- visitReadPropExpr(ast, context) {
1847
- return this.factory.createPropertyAccess(ast.receiver.visitExpression(this, context), ast.name);
1848
- }
1849
- visitReadKeyExpr(ast, context) {
1850
- return this.factory.createElementAccess(ast.receiver.visitExpression(this, context), ast.index.visitExpression(this, context));
1851
- }
1852
- visitLiteralArrayExpr(ast, context) {
1853
- return this.factory.createArrayLiteral(ast.entries.map((expr) => this.setSourceMapRange(expr.visitExpression(this, context), ast.sourceSpan)));
1854
- }
1855
- visitLiteralMapExpr(ast, context) {
1856
- const properties = ast.entries.map((entry) => {
1857
- return {
1858
- propertyName: entry.key,
1859
- quoted: entry.quoted,
1860
- value: entry.value.visitExpression(this, context)
1861
- };
1862
- });
1863
- return this.setSourceMapRange(this.factory.createObjectLiteral(properties), ast.sourceSpan);
1864
- }
1865
- visitCommaExpr(ast, context) {
1866
- throw new Error("Method not implemented.");
1867
- }
1868
- visitWrappedNodeExpr(ast, _context) {
1869
- this.recordWrappedNode(ast);
1870
- return ast.node;
1871
- }
1872
- visitTypeofExpr(ast, context) {
1873
- return this.factory.createTypeOfExpression(ast.expr.visitExpression(this, context));
1874
- }
1875
- visitUnaryOperatorExpr(ast, context) {
1876
- if (!UNARY_OPERATORS.has(ast.operator)) {
1877
- throw new Error(`Unknown unary operator: ${UnaryOperator[ast.operator]}`);
1878
- }
1879
- return this.factory.createUnaryExpression(UNARY_OPERATORS.get(ast.operator), ast.expr.visitExpression(this, context));
1880
- }
1881
- visitStatements(statements, context) {
1882
- return statements.map((stmt) => stmt.visitStatement(this, context)).filter((stmt) => stmt !== void 0);
1883
- }
1884
- setSourceMapRange(ast, span) {
1885
- return this.factory.setSourceMapRange(ast, createRange(span));
1886
- }
1887
- attachComments(statement, leadingComments) {
1888
- if (leadingComments !== void 0) {
1889
- this.factory.attachComments(statement, leadingComments);
1890
- }
1891
- return statement;
1892
- }
1893
- };
1894
- function createTemplateElement({ cooked, raw, range }) {
1895
- return { cooked, raw, range: createRange(range) };
1896
- }
1897
- function createRange(span) {
1898
- if (span === null) {
1899
- return null;
1900
- }
1901
- const { start, end } = span;
1902
- const { url, content } = start.file;
1903
- if (!url) {
1904
- return null;
1905
- }
1906
- return {
1907
- url,
1908
- content,
1909
- start: { offset: start.offset, line: start.line, column: start.col },
1910
- end: { offset: end.offset, line: end.line, column: end.col }
1911
- };
1912
- }
1913
-
1914
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/type_translator.mjs
1915
- import {
1916
- BuiltinTypeName
1917
- } from "@angular/compiler";
1918
- import ts7 from "typescript";
1919
-
1920
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/typescript_ast_factory.mjs
1921
- import ts8 from "typescript";
1922
- var PureAnnotation;
1923
- (function(PureAnnotation2) {
1924
- PureAnnotation2["CLOSURE"] = "* @pureOrBreakMyCode ";
1925
- PureAnnotation2["TERSER"] = "@__PURE__";
1926
- })(PureAnnotation || (PureAnnotation = {}));
1927
- var UNARY_OPERATORS2 = {
1928
- "+": ts8.SyntaxKind.PlusToken,
1929
- "-": ts8.SyntaxKind.MinusToken,
1930
- "!": ts8.SyntaxKind.ExclamationToken
1931
- };
1932
- var BINARY_OPERATORS2 = {
1933
- "&&": ts8.SyntaxKind.AmpersandAmpersandToken,
1934
- ">": ts8.SyntaxKind.GreaterThanToken,
1935
- ">=": ts8.SyntaxKind.GreaterThanEqualsToken,
1936
- "&": ts8.SyntaxKind.AmpersandToken,
1937
- "/": ts8.SyntaxKind.SlashToken,
1938
- "==": ts8.SyntaxKind.EqualsEqualsToken,
1939
- "===": ts8.SyntaxKind.EqualsEqualsEqualsToken,
1940
- "<": ts8.SyntaxKind.LessThanToken,
1941
- "<=": ts8.SyntaxKind.LessThanEqualsToken,
1942
- "-": ts8.SyntaxKind.MinusToken,
1943
- "%": ts8.SyntaxKind.PercentToken,
1944
- "*": ts8.SyntaxKind.AsteriskToken,
1945
- "!=": ts8.SyntaxKind.ExclamationEqualsToken,
1946
- "!==": ts8.SyntaxKind.ExclamationEqualsEqualsToken,
1947
- "||": ts8.SyntaxKind.BarBarToken,
1948
- "+": ts8.SyntaxKind.PlusToken,
1949
- "??": ts8.SyntaxKind.QuestionQuestionToken
1950
- };
1951
- var VAR_TYPES = {
1952
- "const": ts8.NodeFlags.Const,
1953
- "let": ts8.NodeFlags.Let,
1954
- "var": ts8.NodeFlags.None
1955
- };
1956
-
1957
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/translator.mjs
1958
- var Translator = class {
1959
- constructor(factory) {
1960
- this.factory = factory;
1961
- }
1962
- translateExpression(expression, imports, options = {}) {
1963
- return expression.visitExpression(new ExpressionTranslatorVisitor(this.factory, imports, options), new Context(false));
1964
- }
1965
- translateStatement(statement, imports, options = {}) {
1966
- return statement.visitStatement(new ExpressionTranslatorVisitor(this.factory, imports, options), new Context(true));
1967
- }
1968
- };
1969
-
1970
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/linker_environment.mjs
1971
- var LinkerEnvironment = class {
1972
- constructor(fileSystem, logger, host, factory, options) {
1973
- this.fileSystem = fileSystem;
1974
- this.logger = logger;
1975
- this.host = host;
1976
- this.factory = factory;
1977
- this.options = options;
1978
- this.translator = new Translator(this.factory);
1979
- this.sourceFileLoader = this.options.sourceMapping ? new SourceFileLoader(this.fileSystem, this.logger, {}) : null;
1980
- }
1981
- static create(fileSystem, logger, host, factory, options) {
1982
- var _a2, _b, _c;
1983
- return new LinkerEnvironment(fileSystem, logger, host, factory, {
1984
- sourceMapping: (_a2 = options.sourceMapping) != null ? _a2 : DEFAULT_LINKER_OPTIONS.sourceMapping,
1985
- linkerJitMode: (_b = options.linkerJitMode) != null ? _b : DEFAULT_LINKER_OPTIONS.linkerJitMode,
1986
- unknownDeclarationVersionHandling: (_c = options.unknownDeclarationVersionHandling) != null ? _c : DEFAULT_LINKER_OPTIONS.unknownDeclarationVersionHandling
1987
- });
1988
- }
1989
- };
23
+ __objRest,
24
+ __spreadProps,
25
+ __spreadValues
26
+ } from "../../chunk-XA5IZLLC.js";
1990
27
 
1991
28
  // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/babel/src/babel_core.mjs
1992
29
  import * as _babelNamespace from "@babel/core";