dorian 2.6.8 → 3.0.0

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 (66) hide show
  1. checksums.yaml +4 -4
  2. data/.node-version +1 -1
  3. data/.npm-version +1 -1
  4. data/.rubocop.yml +25 -21
  5. data/.ruby-version +1 -1
  6. data/.tool-versions +2 -3
  7. data/Gemfile +0 -4
  8. data/Gemfile.lock +63 -116
  9. data/VERSION +1 -1
  10. data/dorian.gemspec +19 -19
  11. data/lib/dorian/bin.rb +82 -75
  12. data/package-lock.json +8 -8
  13. data/package.json +5 -5
  14. data/vendor/prettier/LICENSE +0 -4372
  15. data/vendor/prettier/README.md +14 -19
  16. data/vendor/prettier/THIRD-PARTY-NOTICES.md +6059 -0
  17. data/vendor/prettier/bin/prettier.cjs +27 -18
  18. data/vendor/prettier/doc.d.ts +11 -0
  19. data/vendor/prettier/doc.js +742 -776
  20. data/vendor/prettier/doc.mjs +743 -766
  21. data/vendor/prettier/index.cjs +266 -371
  22. data/vendor/prettier/index.d.ts +43 -16
  23. data/vendor/prettier/index.mjs +9615 -16721
  24. data/vendor/prettier/internal/experimental-cli-worker.mjs +2841 -0
  25. data/vendor/prettier/internal/experimental-cli.mjs +12790 -0
  26. data/vendor/prettier/internal/legacy-cli.mjs +6229 -0
  27. data/vendor/prettier/package.json +113 -108
  28. data/vendor/prettier/plugins/acorn.js +16 -6618
  29. data/vendor/prettier/plugins/acorn.mjs +16 -6456
  30. data/vendor/prettier/plugins/angular.js +4 -2435
  31. data/vendor/prettier/plugins/angular.mjs +4 -2375
  32. data/vendor/prettier/plugins/babel.d.ts +7 -7
  33. data/vendor/prettier/plugins/babel.js +15 -14271
  34. data/vendor/prettier/plugins/babel.mjs +15 -13986
  35. data/vendor/prettier/plugins/estree.d.ts +6 -1
  36. data/vendor/prettier/plugins/estree.js +43 -9486
  37. data/vendor/prettier/plugins/estree.mjs +43 -9278
  38. data/vendor/prettier/plugins/flow.js +19 -51476
  39. data/vendor/prettier/plugins/flow.mjs +19 -51218
  40. data/vendor/prettier/plugins/glimmer.d.ts +5 -1
  41. data/vendor/prettier/plugins/glimmer.js +30 -8527
  42. data/vendor/prettier/plugins/glimmer.mjs +30 -8414
  43. data/vendor/prettier/plugins/graphql.d.ts +5 -1
  44. data/vendor/prettier/plugins/graphql.js +15 -2408
  45. data/vendor/prettier/plugins/graphql.mjs +15 -2334
  46. data/vendor/prettier/plugins/html.d.ts +6 -1
  47. data/vendor/prettier/plugins/html.js +25 -8182
  48. data/vendor/prettier/plugins/html.mjs +25 -8077
  49. data/vendor/prettier/plugins/markdown.d.ts +5 -1
  50. data/vendor/prettier/plugins/markdown.js +57 -9063
  51. data/vendor/prettier/plugins/markdown.mjs +57 -8972
  52. data/vendor/prettier/plugins/meriyah.js +5 -5953
  53. data/vendor/prettier/plugins/meriyah.mjs +5 -5800
  54. data/vendor/prettier/plugins/postcss.d.ts +5 -1
  55. data/vendor/prettier/plugins/postcss.js +61 -9244
  56. data/vendor/prettier/plugins/postcss.mjs +61 -9046
  57. data/vendor/prettier/plugins/typescript.js +15 -38052
  58. data/vendor/prettier/plugins/typescript.mjs +15 -37726
  59. data/vendor/prettier/plugins/yaml.d.ts +5 -1
  60. data/vendor/prettier/plugins/yaml.js +157 -7423
  61. data/vendor/prettier/plugins/yaml.mjs +157 -7327
  62. data/vendor/prettier/standalone.d.ts +1 -1
  63. data/vendor/prettier/standalone.js +29 -3984
  64. data/vendor/prettier/standalone.mjs +29 -3938
  65. metadata +145 -40
  66. data/vendor/prettier/internal/cli.mjs +0 -4366
@@ -1,2375 +1,4 @@
1
- var Je = Object.defineProperty;
2
- var ae = (r) => {
3
- throw TypeError(r);
4
- };
5
- var oe = (r, t) => {
6
- for (var e in t) Je(r, e, { get: t[e], enumerable: !0 });
7
- };
8
- var Ut = (r, t, e) => t.has(r) || ae("Cannot " + e);
9
- var O = (r, t, e) => (
10
- Ut(r, t, "read from private field"), e ? e.call(r) : t.get(r)
11
- ),
12
- P = (r, t, e) =>
13
- t.has(r)
14
- ? ae("Cannot add the same private member more than once")
15
- : t instanceof WeakSet
16
- ? t.add(r)
17
- : t.set(r, e),
18
- Y = (r, t, e, s) => (
19
- Ut(r, t, "write to private field"), s ? s.call(r, e) : t.set(r, e), e
20
- ),
21
- c = (r, t, e) => (Ut(r, t, "access private method"), e);
22
- var ne = {};
23
- oe(ne, { parsers: () => ie });
24
- var ie = {};
25
- oe(ie, {
26
- __ng_action: () => js,
27
- __ng_binding: () => Ys,
28
- __ng_directive: () => Js,
29
- __ng_interpolation: () => Zs,
30
- });
31
- var Z = class {
32
- constructor(t, e, s, i) {
33
- (this.input = e),
34
- (this.errLocation = s),
35
- (this.ctxLocation = i),
36
- (this.message = `Parser Error: ${t} ${s} [${e}] in ${i}`);
37
- }
38
- },
39
- b = class {
40
- constructor(t, e) {
41
- (this.start = t), (this.end = e);
42
- }
43
- toAbsolute(t) {
44
- return new L(t + this.start, t + this.end);
45
- }
46
- },
47
- m = class {
48
- constructor(t, e) {
49
- (this.span = t), (this.sourceSpan = e);
50
- }
51
- toString() {
52
- return "AST";
53
- }
54
- },
55
- J = class extends m {
56
- constructor(t, e, s) {
57
- super(t, e), (this.nameSpan = s);
58
- }
59
- },
60
- $ = class extends m {
61
- visit(t, e = null) {}
62
- },
63
- K = class extends m {
64
- visit(t, e = null) {
65
- return t.visitImplicitReceiver(this, e);
66
- }
67
- },
68
- Lt = class extends K {
69
- visit(t, e = null) {
70
- var s;
71
- return (s = t.visitThisReceiver) == null ? void 0 : s.call(t, this, e);
72
- }
73
- },
74
- X = class extends m {
75
- constructor(t, e, s) {
76
- super(t, e), (this.expressions = s);
77
- }
78
- visit(t, e = null) {
79
- return t.visitChain(this, e);
80
- }
81
- },
82
- tt = class extends m {
83
- constructor(t, e, s, i, n) {
84
- super(t, e),
85
- (this.condition = s),
86
- (this.trueExp = i),
87
- (this.falseExp = n);
88
- }
89
- visit(t, e = null) {
90
- return t.visitConditional(this, e);
91
- }
92
- },
93
- M = class extends J {
94
- constructor(t, e, s, i, n) {
95
- super(t, e, s), (this.receiver = i), (this.name = n);
96
- }
97
- visit(t, e = null) {
98
- return t.visitPropertyRead(this, e);
99
- }
100
- },
101
- et = class extends J {
102
- constructor(t, e, s, i, n, a) {
103
- super(t, e, s), (this.receiver = i), (this.name = n), (this.value = a);
104
- }
105
- visit(t, e = null) {
106
- return t.visitPropertyWrite(this, e);
107
- }
108
- },
109
- _ = class extends J {
110
- constructor(t, e, s, i, n) {
111
- super(t, e, s), (this.receiver = i), (this.name = n);
112
- }
113
- visit(t, e = null) {
114
- return t.visitSafePropertyRead(this, e);
115
- }
116
- },
117
- st = class extends m {
118
- constructor(t, e, s, i) {
119
- super(t, e), (this.receiver = s), (this.key = i);
120
- }
121
- visit(t, e = null) {
122
- return t.visitKeyedRead(this, e);
123
- }
124
- },
125
- U = class extends m {
126
- constructor(t, e, s, i) {
127
- super(t, e), (this.receiver = s), (this.key = i);
128
- }
129
- visit(t, e = null) {
130
- return t.visitSafeKeyedRead(this, e);
131
- }
132
- },
133
- rt = class extends m {
134
- constructor(t, e, s, i, n) {
135
- super(t, e), (this.receiver = s), (this.key = i), (this.value = n);
136
- }
137
- visit(t, e = null) {
138
- return t.visitKeyedWrite(this, e);
139
- }
140
- },
141
- it = class extends J {
142
- constructor(t, e, s, i, n, a) {
143
- super(t, e, a), (this.exp = s), (this.name = i), (this.args = n);
144
- }
145
- visit(t, e = null) {
146
- return t.visitPipe(this, e);
147
- }
148
- },
149
- E = class extends m {
150
- constructor(t, e, s) {
151
- super(t, e), (this.value = s);
152
- }
153
- visit(t, e = null) {
154
- return t.visitLiteralPrimitive(this, e);
155
- }
156
- },
157
- nt = class extends m {
158
- constructor(t, e, s) {
159
- super(t, e), (this.expressions = s);
160
- }
161
- visit(t, e = null) {
162
- return t.visitLiteralArray(this, e);
163
- }
164
- },
165
- at = class extends m {
166
- constructor(t, e, s, i) {
167
- super(t, e), (this.keys = s), (this.values = i);
168
- }
169
- visit(t, e = null) {
170
- return t.visitLiteralMap(this, e);
171
- }
172
- },
173
- ot = class extends m {
174
- constructor(t, e, s, i) {
175
- super(t, e), (this.strings = s), (this.expressions = i);
176
- }
177
- visit(t, e = null) {
178
- return t.visitInterpolation(this, e);
179
- }
180
- },
181
- A = class extends m {
182
- constructor(t, e, s, i, n) {
183
- super(t, e), (this.operation = s), (this.left = i), (this.right = n);
184
- }
185
- visit(t, e = null) {
186
- return t.visitBinary(this, e);
187
- }
188
- },
189
- F = class r extends A {
190
- static createMinus(t, e, s) {
191
- return new r(t, e, "-", s, "-", new E(t, e, 0), s);
192
- }
193
- static createPlus(t, e, s) {
194
- return new r(t, e, "+", s, "-", s, new E(t, e, 0));
195
- }
196
- constructor(t, e, s, i, n, a, o) {
197
- super(t, e, n, a, o),
198
- (this.operator = s),
199
- (this.expr = i),
200
- (this.left = null),
201
- (this.right = null),
202
- (this.operation = null);
203
- }
204
- visit(t, e = null) {
205
- return t.visitUnary !== void 0
206
- ? t.visitUnary(this, e)
207
- : t.visitBinary(this, e);
208
- }
209
- },
210
- ct = class extends m {
211
- constructor(t, e, s) {
212
- super(t, e), (this.expression = s);
213
- }
214
- visit(t, e = null) {
215
- return t.visitPrefixNot(this, e);
216
- }
217
- },
218
- ht = class extends m {
219
- constructor(t, e, s) {
220
- super(t, e), (this.expression = s);
221
- }
222
- visit(t, e = null) {
223
- return t.visitNonNullAssert(this, e);
224
- }
225
- },
226
- pt = class extends m {
227
- constructor(t, e, s, i, n) {
228
- super(t, e),
229
- (this.receiver = s),
230
- (this.args = i),
231
- (this.argumentSpan = n);
232
- }
233
- visit(t, e = null) {
234
- return t.visitCall(this, e);
235
- }
236
- },
237
- D = class extends m {
238
- constructor(t, e, s, i, n) {
239
- super(t, e),
240
- (this.receiver = s),
241
- (this.args = i),
242
- (this.argumentSpan = n);
243
- }
244
- visit(t, e = null) {
245
- return t.visitSafeCall(this, e);
246
- }
247
- },
248
- L = class {
249
- constructor(t, e) {
250
- (this.start = t), (this.end = e);
251
- }
252
- },
253
- R = class extends m {
254
- constructor(t, e, s, i, n) {
255
- super(
256
- new b(0, e === null ? 0 : e.length),
257
- new L(i, e === null ? i : i + e.length),
258
- ),
259
- (this.ast = t),
260
- (this.source = e),
261
- (this.location = s),
262
- (this.errors = n);
263
- }
264
- visit(t, e = null) {
265
- return t.visitASTWithSource
266
- ? t.visitASTWithSource(this, e)
267
- : this.ast.visit(t, e);
268
- }
269
- toString() {
270
- return `${this.source} in ${this.location}`;
271
- }
272
- },
273
- W = class {
274
- constructor(t, e, s) {
275
- (this.sourceSpan = t), (this.key = e), (this.value = s);
276
- }
277
- },
278
- ut = class {
279
- constructor(t, e, s) {
280
- (this.sourceSpan = t), (this.key = e), (this.value = s);
281
- }
282
- },
283
- Rt = class {
284
- visit(t, e) {
285
- t.visit(this, e);
286
- }
287
- visitUnary(t, e) {
288
- this.visit(t.expr, e);
289
- }
290
- visitBinary(t, e) {
291
- this.visit(t.left, e), this.visit(t.right, e);
292
- }
293
- visitChain(t, e) {
294
- this.visitAll(t.expressions, e);
295
- }
296
- visitConditional(t, e) {
297
- this.visit(t.condition, e),
298
- this.visit(t.trueExp, e),
299
- this.visit(t.falseExp, e);
300
- }
301
- visitPipe(t, e) {
302
- this.visit(t.exp, e), this.visitAll(t.args, e);
303
- }
304
- visitImplicitReceiver(t, e) {}
305
- visitThisReceiver(t, e) {}
306
- visitInterpolation(t, e) {
307
- this.visitAll(t.expressions, e);
308
- }
309
- visitKeyedRead(t, e) {
310
- this.visit(t.receiver, e), this.visit(t.key, e);
311
- }
312
- visitKeyedWrite(t, e) {
313
- this.visit(t.receiver, e), this.visit(t.key, e), this.visit(t.value, e);
314
- }
315
- visitLiteralArray(t, e) {
316
- this.visitAll(t.expressions, e);
317
- }
318
- visitLiteralMap(t, e) {
319
- this.visitAll(t.values, e);
320
- }
321
- visitLiteralPrimitive(t, e) {}
322
- visitPrefixNot(t, e) {
323
- this.visit(t.expression, e);
324
- }
325
- visitNonNullAssert(t, e) {
326
- this.visit(t.expression, e);
327
- }
328
- visitPropertyRead(t, e) {
329
- this.visit(t.receiver, e);
330
- }
331
- visitPropertyWrite(t, e) {
332
- this.visit(t.receiver, e), this.visit(t.value, e);
333
- }
334
- visitSafePropertyRead(t, e) {
335
- this.visit(t.receiver, e);
336
- }
337
- visitSafeKeyedRead(t, e) {
338
- this.visit(t.receiver, e), this.visit(t.key, e);
339
- }
340
- visitCall(t, e) {
341
- this.visit(t.receiver, e), this.visitAll(t.args, e);
342
- }
343
- visitSafeCall(t, e) {
344
- this.visit(t.receiver, e), this.visitAll(t.args, e);
345
- }
346
- visitAll(t, e) {
347
- for (let s of t) this.visit(s, e);
348
- }
349
- };
350
- var ce;
351
- (function (r) {
352
- (r[(r.DEFAULT = 0)] = "DEFAULT"),
353
- (r[(r.LITERAL_ATTR = 1)] = "LITERAL_ATTR"),
354
- (r[(r.ANIMATION = 2)] = "ANIMATION"),
355
- (r[(r.TWO_WAY = 3)] = "TWO_WAY");
356
- })(ce || (ce = {}));
357
- var he;
358
- (function (r) {
359
- (r[(r.Regular = 0)] = "Regular"),
360
- (r[(r.Animation = 1)] = "Animation"),
361
- (r[(r.TwoWay = 2)] = "TwoWay");
362
- })(he || (he = {}));
363
- var pe;
364
- (function (r) {
365
- (r[(r.Property = 0)] = "Property"),
366
- (r[(r.Attribute = 1)] = "Attribute"),
367
- (r[(r.Class = 2)] = "Class"),
368
- (r[(r.Style = 3)] = "Style"),
369
- (r[(r.Animation = 4)] = "Animation"),
370
- (r[(r.TwoWay = 5)] = "TwoWay");
371
- })(pe || (pe = {}));
372
- function ue(r) {
373
- return (r >= 9 && r <= 32) || r == 160;
374
- }
375
- function B(r) {
376
- return 48 <= r && r <= 57;
377
- }
378
- function le(r) {
379
- return (r >= 97 && r <= 122) || (r >= 65 && r <= 90);
380
- }
381
- function Ft(r) {
382
- return r === 39 || r === 34 || r === 96;
383
- }
384
- var l;
385
- (function (r) {
386
- (r[(r.Character = 0)] = "Character"),
387
- (r[(r.Identifier = 1)] = "Identifier"),
388
- (r[(r.PrivateIdentifier = 2)] = "PrivateIdentifier"),
389
- (r[(r.Keyword = 3)] = "Keyword"),
390
- (r[(r.String = 4)] = "String"),
391
- (r[(r.Operator = 5)] = "Operator"),
392
- (r[(r.Number = 6)] = "Number"),
393
- (r[(r.Error = 7)] = "Error");
394
- })(l || (l = {}));
395
- var ks = [
396
- "var",
397
- "let",
398
- "as",
399
- "null",
400
- "undefined",
401
- "true",
402
- "false",
403
- "if",
404
- "else",
405
- "this",
406
- ],
407
- yt = class {
408
- tokenize(t) {
409
- let e = new Gt(t),
410
- s = [],
411
- i = e.scanToken();
412
- for (; i != null; ) s.push(i), (i = e.scanToken());
413
- return s;
414
- }
415
- },
416
- I = class {
417
- constructor(t, e, s, i, n) {
418
- (this.index = t),
419
- (this.end = e),
420
- (this.type = s),
421
- (this.numValue = i),
422
- (this.strValue = n);
423
- }
424
- isCharacter(t) {
425
- return this.type == l.Character && this.numValue == t;
426
- }
427
- isNumber() {
428
- return this.type == l.Number;
429
- }
430
- isString() {
431
- return this.type == l.String;
432
- }
433
- isOperator(t) {
434
- return this.type == l.Operator && this.strValue == t;
435
- }
436
- isIdentifier() {
437
- return this.type == l.Identifier;
438
- }
439
- isPrivateIdentifier() {
440
- return this.type == l.PrivateIdentifier;
441
- }
442
- isKeyword() {
443
- return this.type == l.Keyword;
444
- }
445
- isKeywordLet() {
446
- return this.type == l.Keyword && this.strValue == "let";
447
- }
448
- isKeywordAs() {
449
- return this.type == l.Keyword && this.strValue == "as";
450
- }
451
- isKeywordNull() {
452
- return this.type == l.Keyword && this.strValue == "null";
453
- }
454
- isKeywordUndefined() {
455
- return this.type == l.Keyword && this.strValue == "undefined";
456
- }
457
- isKeywordTrue() {
458
- return this.type == l.Keyword && this.strValue == "true";
459
- }
460
- isKeywordFalse() {
461
- return this.type == l.Keyword && this.strValue == "false";
462
- }
463
- isKeywordThis() {
464
- return this.type == l.Keyword && this.strValue == "this";
465
- }
466
- isError() {
467
- return this.type == l.Error;
468
- }
469
- toNumber() {
470
- return this.type == l.Number ? this.numValue : -1;
471
- }
472
- toString() {
473
- switch (this.type) {
474
- case l.Character:
475
- case l.Identifier:
476
- case l.Keyword:
477
- case l.Operator:
478
- case l.PrivateIdentifier:
479
- case l.String:
480
- case l.Error:
481
- return this.strValue;
482
- case l.Number:
483
- return this.numValue.toString();
484
- default:
485
- return null;
486
- }
487
- }
488
- };
489
- function ge(r, t, e) {
490
- return new I(r, t, l.Character, e, String.fromCharCode(e));
491
- }
492
- function Ns(r, t, e) {
493
- return new I(r, t, l.Identifier, 0, e);
494
- }
495
- function Ls(r, t, e) {
496
- return new I(r, t, l.PrivateIdentifier, 0, e);
497
- }
498
- function Rs(r, t, e) {
499
- return new I(r, t, l.Keyword, 0, e);
500
- }
501
- function Wt(r, t, e) {
502
- return new I(r, t, l.Operator, 0, e);
503
- }
504
- function Ps(r, t, e) {
505
- return new I(r, t, l.String, 0, e);
506
- }
507
- function bs(r, t, e) {
508
- return new I(r, t, l.Number, e, "");
509
- }
510
- function Ks(r, t, e) {
511
- return new I(r, t, l.Error, 0, e);
512
- }
513
- var Bt = new I(-1, -1, l.Character, 0, ""),
514
- Gt = class {
515
- constructor(t) {
516
- (this.input = t),
517
- (this.peek = 0),
518
- (this.index = -1),
519
- (this.length = t.length),
520
- this.advance();
521
- }
522
- advance() {
523
- this.peek =
524
- ++this.index >= this.length ? 0 : this.input.charCodeAt(this.index);
525
- }
526
- scanToken() {
527
- let t = this.input,
528
- e = this.length,
529
- s = this.peek,
530
- i = this.index;
531
- for (; s <= 32; )
532
- if (++i >= e) {
533
- s = 0;
534
- break;
535
- } else s = t.charCodeAt(i);
536
- if (((this.peek = s), (this.index = i), i >= e)) return null;
537
- if (me(s)) return this.scanIdentifier();
538
- if (B(s)) return this.scanNumber(i);
539
- let n = i;
540
- switch (s) {
541
- case 46:
542
- return (
543
- this.advance(),
544
- B(this.peek) ? this.scanNumber(n) : ge(n, this.index, 46)
545
- );
546
- case 40:
547
- case 41:
548
- case 123:
549
- case 125:
550
- case 91:
551
- case 93:
552
- case 44:
553
- case 58:
554
- case 59:
555
- return this.scanCharacter(n, s);
556
- case 39:
557
- case 34:
558
- return this.scanString();
559
- case 35:
560
- return this.scanPrivateIdentifier();
561
- case 43:
562
- case 45:
563
- case 42:
564
- case 47:
565
- case 37:
566
- case 94:
567
- return this.scanOperator(n, String.fromCharCode(s));
568
- case 63:
569
- return this.scanQuestion(n);
570
- case 60:
571
- case 62:
572
- return this.scanComplexOperator(n, String.fromCharCode(s), 61, "=");
573
- case 33:
574
- case 61:
575
- return this.scanComplexOperator(
576
- n,
577
- String.fromCharCode(s),
578
- 61,
579
- "=",
580
- 61,
581
- "=",
582
- );
583
- case 38:
584
- return this.scanComplexOperator(n, "&", 38, "&");
585
- case 124:
586
- return this.scanComplexOperator(n, "|", 124, "|");
587
- case 160:
588
- for (; ue(this.peek); ) this.advance();
589
- return this.scanToken();
590
- }
591
- return (
592
- this.advance(),
593
- this.error(`Unexpected character [${String.fromCharCode(s)}]`, 0)
594
- );
595
- }
596
- scanCharacter(t, e) {
597
- return this.advance(), ge(t, this.index, e);
598
- }
599
- scanOperator(t, e) {
600
- return this.advance(), Wt(t, this.index, e);
601
- }
602
- scanComplexOperator(t, e, s, i, n, a) {
603
- this.advance();
604
- let o = e;
605
- return (
606
- this.peek == s && (this.advance(), (o += i)),
607
- n != null && this.peek == n && (this.advance(), (o += a)),
608
- Wt(t, this.index, o)
609
- );
610
- }
611
- scanIdentifier() {
612
- let t = this.index;
613
- for (this.advance(); Se(this.peek); ) this.advance();
614
- let e = this.input.substring(t, this.index);
615
- return ks.indexOf(e) > -1 ? Rs(t, this.index, e) : Ns(t, this.index, e);
616
- }
617
- scanPrivateIdentifier() {
618
- let t = this.index;
619
- if ((this.advance(), !me(this.peek)))
620
- return this.error("Invalid character [#]", -1);
621
- for (; Se(this.peek); ) this.advance();
622
- let e = this.input.substring(t, this.index);
623
- return Ls(t, this.index, e);
624
- }
625
- scanNumber(t) {
626
- let e = this.index === t,
627
- s = !1;
628
- for (this.advance(); ; ) {
629
- if (!B(this.peek))
630
- if (this.peek === 95) {
631
- if (
632
- !B(this.input.charCodeAt(this.index - 1)) ||
633
- !B(this.input.charCodeAt(this.index + 1))
634
- )
635
- return this.error("Invalid numeric separator", 0);
636
- s = !0;
637
- } else if (this.peek === 46) e = !1;
638
- else if (Bs(this.peek)) {
639
- if (
640
- (this.advance(), Ts(this.peek) && this.advance(), !B(this.peek))
641
- )
642
- return this.error("Invalid exponent", -1);
643
- e = !1;
644
- } else break;
645
- this.advance();
646
- }
647
- let i = this.input.substring(t, this.index);
648
- s && (i = i.replace(/_/g, ""));
649
- let n = e ? _s(i) : parseFloat(i);
650
- return bs(t, this.index, n);
651
- }
652
- scanString() {
653
- let t = this.index,
654
- e = this.peek;
655
- this.advance();
656
- let s = "",
657
- i = this.index,
658
- n = this.input;
659
- for (; this.peek != e; )
660
- if (this.peek == 92) {
661
- s += n.substring(i, this.index);
662
- let o;
663
- if ((this.advance(), this.peek == 117)) {
664
- let p = n.substring(this.index + 1, this.index + 5);
665
- if (/^[0-9a-f]+$/i.test(p)) o = parseInt(p, 16);
666
- else return this.error(`Invalid unicode escape [\\u${p}]`, 0);
667
- for (let u = 0; u < 5; u++) this.advance();
668
- } else (o = Ms(this.peek)), this.advance();
669
- (s += String.fromCharCode(o)), (i = this.index);
670
- } else {
671
- if (this.peek == 0) return this.error("Unterminated quote", 0);
672
- this.advance();
673
- }
674
- let a = n.substring(i, this.index);
675
- return this.advance(), Ps(t, this.index, s + a);
676
- }
677
- scanQuestion(t) {
678
- this.advance();
679
- let e = "?";
680
- return (
681
- (this.peek === 63 || this.peek === 46) &&
682
- ((e += this.peek === 46 ? "." : "?"), this.advance()),
683
- Wt(t, this.index, e)
684
- );
685
- }
686
- error(t, e) {
687
- let s = this.index + e;
688
- return Ks(
689
- s,
690
- this.index,
691
- `Lexer Error: ${t} at column ${s} in expression [${this.input}]`,
692
- );
693
- }
694
- };
695
- function me(r) {
696
- return (97 <= r && r <= 122) || (65 <= r && r <= 90) || r == 95 || r == 36;
697
- }
698
- function Se(r) {
699
- return le(r) || B(r) || r == 95 || r == 36;
700
- }
701
- function Bs(r) {
702
- return r == 101 || r == 69;
703
- }
704
- function Ts(r) {
705
- return r == 45 || r == 43;
706
- }
707
- function Ms(r) {
708
- switch (r) {
709
- case 110:
710
- return 10;
711
- case 102:
712
- return 12;
713
- case 114:
714
- return 13;
715
- case 116:
716
- return 9;
717
- case 118:
718
- return 11;
719
- default:
720
- return r;
721
- }
722
- }
723
- function _s(r) {
724
- let t = parseInt(r);
725
- if (isNaN(t)) throw new Error("Invalid integer literal when parsing " + r);
726
- return t;
727
- }
728
- var Us = [/@/, /^\s*$/, /[<>]/, /^[{}]$/, /&(#|[a-z])/i, /^\/\//];
729
- function Ee(r, t) {
730
- if (t != null && !(Array.isArray(t) && t.length == 2))
731
- throw new Error(`Expected '${r}' to be an array, [start, end].`);
732
- if (t != null) {
733
- let e = t[0],
734
- s = t[1];
735
- Us.forEach((i) => {
736
- if (i.test(e) || i.test(s))
737
- throw new Error(
738
- `['${e}', '${s}'] contains unusable interpolation symbol.`,
739
- );
740
- });
741
- }
742
- }
743
- var Qt = class r {
744
- static fromArray(t) {
745
- return t ? (Ee("interpolation", t), new r(t[0], t[1])) : Q;
746
- }
747
- constructor(t, e) {
748
- (this.start = t), (this.end = e);
749
- }
750
- },
751
- Q = new Qt("{{", "}}");
752
- var zt = class {
753
- constructor(t, e, s) {
754
- (this.strings = t), (this.expressions = e), (this.offsets = s);
755
- }
756
- },
757
- qt = class {
758
- constructor(t, e, s) {
759
- (this.templateBindings = t), (this.warnings = e), (this.errors = s);
760
- }
761
- },
762
- mt = class {
763
- constructor(t) {
764
- (this._lexer = t), (this.errors = []);
765
- }
766
- parseAction(t, e, s, i = Q) {
767
- this._checkNoInterpolation(t, e, i);
768
- let n = this._stripComments(t),
769
- a = this._lexer.tokenize(n),
770
- o = new z(t, e, s, a, 1, this.errors, 0).parseChain();
771
- return new R(o, t, e, s, this.errors);
772
- }
773
- parseBinding(t, e, s, i = Q) {
774
- let n = this._parseBindingAst(t, e, s, i);
775
- return new R(n, t, e, s, this.errors);
776
- }
777
- checkSimpleExpression(t) {
778
- let e = new Ht();
779
- return t.visit(e), e.errors;
780
- }
781
- parseSimpleBinding(t, e, s, i = Q) {
782
- let n = this._parseBindingAst(t, e, s, i),
783
- a = this.checkSimpleExpression(n);
784
- return (
785
- a.length > 0 &&
786
- this._reportError(
787
- `Host binding expression cannot contain ${a.join(" ")}`,
788
- t,
789
- e,
790
- ),
791
- new R(n, t, e, s, this.errors)
792
- );
793
- }
794
- _reportError(t, e, s, i) {
795
- this.errors.push(new Z(t, e, s, i));
796
- }
797
- _parseBindingAst(t, e, s, i) {
798
- this._checkNoInterpolation(t, e, i);
799
- let n = this._stripComments(t),
800
- a = this._lexer.tokenize(n);
801
- return new z(t, e, s, a, 0, this.errors, 0).parseChain();
802
- }
803
- parseTemplateBindings(t, e, s, i, n) {
804
- let a = this._lexer.tokenize(e);
805
- return new z(e, s, n, a, 0, this.errors, 0).parseTemplateBindings({
806
- source: t,
807
- span: new L(i, i + t.length),
808
- });
809
- }
810
- parseInterpolation(t, e, s, i, n = Q) {
811
- let {
812
- strings: a,
813
- expressions: o,
814
- offsets: p,
815
- } = this.splitInterpolation(t, e, i, n);
816
- if (o.length === 0) return null;
817
- let u = [];
818
- for (let f = 0; f < o.length; ++f) {
819
- let S = o[f].text,
820
- g = this._stripComments(S),
821
- y = this._lexer.tokenize(g),
822
- w = new z(t, e, s, y, 0, this.errors, p[f]).parseChain();
823
- u.push(w);
824
- }
825
- return this.createInterpolationAst(
826
- a.map((f) => f.text),
827
- u,
828
- t,
829
- e,
830
- s,
831
- );
832
- }
833
- parseInterpolationExpression(t, e, s) {
834
- let i = this._stripComments(t),
835
- n = this._lexer.tokenize(i),
836
- a = new z(t, e, s, n, 0, this.errors, 0).parseChain(),
837
- o = ["", ""];
838
- return this.createInterpolationAst(o, [a], t, e, s);
839
- }
840
- createInterpolationAst(t, e, s, i, n) {
841
- let a = new b(0, s.length),
842
- o = new ot(a, a.toAbsolute(n), t, e);
843
- return new R(o, s, i, n, this.errors);
844
- }
845
- splitInterpolation(t, e, s, i = Q) {
846
- let n = [],
847
- a = [],
848
- o = [],
849
- p = s ? Fs(s) : null,
850
- u = 0,
851
- f = !1,
852
- S = !1,
853
- { start: g, end: y } = i;
854
- for (; u < t.length; )
855
- if (f) {
856
- let w = u,
857
- H = w + g.length,
858
- j = this._getInterpolationEndIndex(t, y, H);
859
- if (j === -1) {
860
- (f = !1), (S = !0);
861
- break;
862
- }
863
- let T = j + y.length,
864
- Nt = t.substring(H, j);
865
- Nt.trim().length === 0 &&
866
- this._reportError(
867
- "Blank expressions are not allowed in interpolated strings",
868
- t,
869
- `at column ${u} in`,
870
- e,
871
- ),
872
- a.push({ text: Nt, start: w, end: T });
873
- let Ze = ((p == null ? void 0 : p.get(w)) ?? w) + g.length;
874
- o.push(Ze), (u = T), (f = !1);
875
- } else {
876
- let w = u;
877
- (u = t.indexOf(g, u)), u === -1 && (u = t.length);
878
- let H = t.substring(w, u);
879
- n.push({ text: H, start: w, end: u }), (f = !0);
880
- }
881
- if (!f)
882
- if (S) {
883
- let w = n[n.length - 1];
884
- (w.text += t.substring(u)), (w.end = t.length);
885
- } else n.push({ text: t.substring(u), start: u, end: t.length });
886
- return new zt(n, a, o);
887
- }
888
- wrapLiteralPrimitive(t, e, s) {
889
- let i = new b(0, t == null ? 0 : t.length);
890
- return new R(new E(i, i.toAbsolute(s), t), t, e, s, this.errors);
891
- }
892
- _stripComments(t) {
893
- let e = this._commentStart(t);
894
- return e != null ? t.substring(0, e) : t;
895
- }
896
- _commentStart(t) {
897
- let e = null;
898
- for (let s = 0; s < t.length - 1; s++) {
899
- let i = t.charCodeAt(s),
900
- n = t.charCodeAt(s + 1);
901
- if (i === 47 && n == 47 && e == null) return s;
902
- e === i ? (e = null) : e == null && Ft(i) && (e = i);
903
- }
904
- return null;
905
- }
906
- _checkNoInterpolation(t, e, { start: s, end: i }) {
907
- let n = -1,
908
- a = -1;
909
- for (let o of this._forEachUnquotedChar(t, 0))
910
- if (n === -1) t.startsWith(s) && (n = o);
911
- else if (((a = this._getInterpolationEndIndex(t, i, o)), a > -1)) break;
912
- n > -1 &&
913
- a > -1 &&
914
- this._reportError(
915
- `Got interpolation (${s}${i}) where expression was expected`,
916
- t,
917
- `at column ${n} in`,
918
- e,
919
- );
920
- }
921
- _getInterpolationEndIndex(t, e, s) {
922
- for (let i of this._forEachUnquotedChar(t, s)) {
923
- if (t.startsWith(e, i)) return i;
924
- if (t.startsWith("//", i)) return t.indexOf(e, i);
925
- }
926
- return -1;
927
- }
928
- *_forEachUnquotedChar(t, e) {
929
- let s = null,
930
- i = 0;
931
- for (let n = e; n < t.length; n++) {
932
- let a = t[n];
933
- Ft(t.charCodeAt(n)) && (s === null || s === a) && i % 2 === 0
934
- ? (s = s === null ? a : null)
935
- : s === null && (yield n),
936
- (i = a === "\\" ? i + 1 : 0);
937
- }
938
- }
939
- },
940
- gt;
941
- (function (r) {
942
- (r[(r.None = 0)] = "None"), (r[(r.Writable = 1)] = "Writable");
943
- })(gt || (gt = {}));
944
- var z = class {
945
- constructor(t, e, s, i, n, a, o) {
946
- (this.input = t),
947
- (this.location = e),
948
- (this.absoluteOffset = s),
949
- (this.tokens = i),
950
- (this.parseFlags = n),
951
- (this.errors = a),
952
- (this.offset = o),
953
- (this.rparensExpected = 0),
954
- (this.rbracketsExpected = 0),
955
- (this.rbracesExpected = 0),
956
- (this.context = gt.None),
957
- (this.sourceSpanCache = new Map()),
958
- (this.index = 0);
959
- }
960
- peek(t) {
961
- let e = this.index + t;
962
- return e < this.tokens.length ? this.tokens[e] : Bt;
963
- }
964
- get next() {
965
- return this.peek(0);
966
- }
967
- get atEOF() {
968
- return this.index >= this.tokens.length;
969
- }
970
- get inputIndex() {
971
- return this.atEOF ? this.currentEndIndex : this.next.index + this.offset;
972
- }
973
- get currentEndIndex() {
974
- return this.index > 0
975
- ? this.peek(-1).end + this.offset
976
- : this.tokens.length === 0
977
- ? this.input.length + this.offset
978
- : this.next.index + this.offset;
979
- }
980
- get currentAbsoluteOffset() {
981
- return this.absoluteOffset + this.inputIndex;
982
- }
983
- span(t, e) {
984
- let s = this.currentEndIndex;
985
- if ((e !== void 0 && e > this.currentEndIndex && (s = e), t > s)) {
986
- let i = s;
987
- (s = t), (t = i);
988
- }
989
- return new b(t, s);
990
- }
991
- sourceSpan(t, e) {
992
- let s = `${t}@${this.inputIndex}:${e}`;
993
- return (
994
- this.sourceSpanCache.has(s) ||
995
- this.sourceSpanCache.set(
996
- s,
997
- this.span(t, e).toAbsolute(this.absoluteOffset),
998
- ),
999
- this.sourceSpanCache.get(s)
1000
- );
1001
- }
1002
- advance() {
1003
- this.index++;
1004
- }
1005
- withContext(t, e) {
1006
- this.context |= t;
1007
- let s = e();
1008
- return (this.context ^= t), s;
1009
- }
1010
- consumeOptionalCharacter(t) {
1011
- return this.next.isCharacter(t) ? (this.advance(), !0) : !1;
1012
- }
1013
- peekKeywordLet() {
1014
- return this.next.isKeywordLet();
1015
- }
1016
- peekKeywordAs() {
1017
- return this.next.isKeywordAs();
1018
- }
1019
- expectCharacter(t) {
1020
- this.consumeOptionalCharacter(t) ||
1021
- this.error(`Missing expected ${String.fromCharCode(t)}`);
1022
- }
1023
- consumeOptionalOperator(t) {
1024
- return this.next.isOperator(t) ? (this.advance(), !0) : !1;
1025
- }
1026
- expectOperator(t) {
1027
- this.consumeOptionalOperator(t) ||
1028
- this.error(`Missing expected operator ${t}`);
1029
- }
1030
- prettyPrintToken(t) {
1031
- return t === Bt ? "end of input" : `token ${t}`;
1032
- }
1033
- expectIdentifierOrKeyword() {
1034
- let t = this.next;
1035
- return !t.isIdentifier() && !t.isKeyword()
1036
- ? (t.isPrivateIdentifier()
1037
- ? this._reportErrorForPrivateIdentifier(
1038
- t,
1039
- "expected identifier or keyword",
1040
- )
1041
- : this.error(
1042
- `Unexpected ${this.prettyPrintToken(t)}, expected identifier or keyword`,
1043
- ),
1044
- null)
1045
- : (this.advance(), t.toString());
1046
- }
1047
- expectIdentifierOrKeywordOrString() {
1048
- let t = this.next;
1049
- return !t.isIdentifier() && !t.isKeyword() && !t.isString()
1050
- ? (t.isPrivateIdentifier()
1051
- ? this._reportErrorForPrivateIdentifier(
1052
- t,
1053
- "expected identifier, keyword or string",
1054
- )
1055
- : this.error(
1056
- `Unexpected ${this.prettyPrintToken(t)}, expected identifier, keyword, or string`,
1057
- ),
1058
- "")
1059
- : (this.advance(), t.toString());
1060
- }
1061
- parseChain() {
1062
- let t = [],
1063
- e = this.inputIndex;
1064
- for (; this.index < this.tokens.length; ) {
1065
- let s = this.parsePipe();
1066
- if ((t.push(s), this.consumeOptionalCharacter(59)))
1067
- for (
1068
- this.parseFlags & 1 ||
1069
- this.error("Binding expression cannot contain chained expression");
1070
- this.consumeOptionalCharacter(59);
1071
-
1072
- );
1073
- else if (this.index < this.tokens.length) {
1074
- let i = this.index;
1075
- if ((this.error(`Unexpected token '${this.next}'`), this.index === i))
1076
- break;
1077
- }
1078
- }
1079
- if (t.length === 0) {
1080
- let s = this.offset,
1081
- i = this.offset + this.input.length;
1082
- return new $(this.span(s, i), this.sourceSpan(s, i));
1083
- }
1084
- return t.length == 1 ? t[0] : new X(this.span(e), this.sourceSpan(e), t);
1085
- }
1086
- parsePipe() {
1087
- let t = this.inputIndex,
1088
- e = this.parseExpression();
1089
- if (this.consumeOptionalOperator("|")) {
1090
- this.parseFlags & 1 &&
1091
- this.error("Cannot have a pipe in an action expression");
1092
- do {
1093
- let s = this.inputIndex,
1094
- i = this.expectIdentifierOrKeyword(),
1095
- n,
1096
- a;
1097
- i !== null
1098
- ? (n = this.sourceSpan(s))
1099
- : ((i = ""),
1100
- (a =
1101
- this.next.index !== -1
1102
- ? this.next.index
1103
- : this.input.length + this.offset),
1104
- (n = new b(a, a).toAbsolute(this.absoluteOffset)));
1105
- let o = [];
1106
- for (; this.consumeOptionalCharacter(58); )
1107
- o.push(this.parseExpression());
1108
- e = new it(this.span(t), this.sourceSpan(t, a), e, i, o, n);
1109
- } while (this.consumeOptionalOperator("|"));
1110
- }
1111
- return e;
1112
- }
1113
- parseExpression() {
1114
- return this.parseConditional();
1115
- }
1116
- parseConditional() {
1117
- let t = this.inputIndex,
1118
- e = this.parseLogicalOr();
1119
- if (this.consumeOptionalOperator("?")) {
1120
- let s = this.parsePipe(),
1121
- i;
1122
- if (this.consumeOptionalCharacter(58)) i = this.parsePipe();
1123
- else {
1124
- let n = this.inputIndex,
1125
- a = this.input.substring(t, n);
1126
- this.error(`Conditional expression ${a} requires all 3 expressions`),
1127
- (i = new $(this.span(t), this.sourceSpan(t)));
1128
- }
1129
- return new tt(this.span(t), this.sourceSpan(t), e, s, i);
1130
- } else return e;
1131
- }
1132
- parseLogicalOr() {
1133
- let t = this.inputIndex,
1134
- e = this.parseLogicalAnd();
1135
- for (; this.consumeOptionalOperator("||"); ) {
1136
- let s = this.parseLogicalAnd();
1137
- e = new A(this.span(t), this.sourceSpan(t), "||", e, s);
1138
- }
1139
- return e;
1140
- }
1141
- parseLogicalAnd() {
1142
- let t = this.inputIndex,
1143
- e = this.parseNullishCoalescing();
1144
- for (; this.consumeOptionalOperator("&&"); ) {
1145
- let s = this.parseNullishCoalescing();
1146
- e = new A(this.span(t), this.sourceSpan(t), "&&", e, s);
1147
- }
1148
- return e;
1149
- }
1150
- parseNullishCoalescing() {
1151
- let t = this.inputIndex,
1152
- e = this.parseEquality();
1153
- for (; this.consumeOptionalOperator("??"); ) {
1154
- let s = this.parseEquality();
1155
- e = new A(this.span(t), this.sourceSpan(t), "??", e, s);
1156
- }
1157
- return e;
1158
- }
1159
- parseEquality() {
1160
- let t = this.inputIndex,
1161
- e = this.parseRelational();
1162
- for (; this.next.type == l.Operator; ) {
1163
- let s = this.next.strValue;
1164
- switch (s) {
1165
- case "==":
1166
- case "===":
1167
- case "!=":
1168
- case "!==":
1169
- this.advance();
1170
- let i = this.parseRelational();
1171
- e = new A(this.span(t), this.sourceSpan(t), s, e, i);
1172
- continue;
1173
- }
1174
- break;
1175
- }
1176
- return e;
1177
- }
1178
- parseRelational() {
1179
- let t = this.inputIndex,
1180
- e = this.parseAdditive();
1181
- for (; this.next.type == l.Operator; ) {
1182
- let s = this.next.strValue;
1183
- switch (s) {
1184
- case "<":
1185
- case ">":
1186
- case "<=":
1187
- case ">=":
1188
- this.advance();
1189
- let i = this.parseAdditive();
1190
- e = new A(this.span(t), this.sourceSpan(t), s, e, i);
1191
- continue;
1192
- }
1193
- break;
1194
- }
1195
- return e;
1196
- }
1197
- parseAdditive() {
1198
- let t = this.inputIndex,
1199
- e = this.parseMultiplicative();
1200
- for (; this.next.type == l.Operator; ) {
1201
- let s = this.next.strValue;
1202
- switch (s) {
1203
- case "+":
1204
- case "-":
1205
- this.advance();
1206
- let i = this.parseMultiplicative();
1207
- e = new A(this.span(t), this.sourceSpan(t), s, e, i);
1208
- continue;
1209
- }
1210
- break;
1211
- }
1212
- return e;
1213
- }
1214
- parseMultiplicative() {
1215
- let t = this.inputIndex,
1216
- e = this.parsePrefix();
1217
- for (; this.next.type == l.Operator; ) {
1218
- let s = this.next.strValue;
1219
- switch (s) {
1220
- case "*":
1221
- case "%":
1222
- case "/":
1223
- this.advance();
1224
- let i = this.parsePrefix();
1225
- e = new A(this.span(t), this.sourceSpan(t), s, e, i);
1226
- continue;
1227
- }
1228
- break;
1229
- }
1230
- return e;
1231
- }
1232
- parsePrefix() {
1233
- if (this.next.type == l.Operator) {
1234
- let t = this.inputIndex,
1235
- e = this.next.strValue,
1236
- s;
1237
- switch (e) {
1238
- case "+":
1239
- return (
1240
- this.advance(),
1241
- (s = this.parsePrefix()),
1242
- F.createPlus(this.span(t), this.sourceSpan(t), s)
1243
- );
1244
- case "-":
1245
- return (
1246
- this.advance(),
1247
- (s = this.parsePrefix()),
1248
- F.createMinus(this.span(t), this.sourceSpan(t), s)
1249
- );
1250
- case "!":
1251
- return (
1252
- this.advance(),
1253
- (s = this.parsePrefix()),
1254
- new ct(this.span(t), this.sourceSpan(t), s)
1255
- );
1256
- }
1257
- }
1258
- return this.parseCallChain();
1259
- }
1260
- parseCallChain() {
1261
- let t = this.inputIndex,
1262
- e = this.parsePrimary();
1263
- for (;;)
1264
- if (this.consumeOptionalCharacter(46))
1265
- e = this.parseAccessMember(e, t, !1);
1266
- else if (this.consumeOptionalOperator("?."))
1267
- this.consumeOptionalCharacter(40)
1268
- ? (e = this.parseCall(e, t, !0))
1269
- : (e = this.consumeOptionalCharacter(91)
1270
- ? this.parseKeyedReadOrWrite(e, t, !0)
1271
- : this.parseAccessMember(e, t, !0));
1272
- else if (this.consumeOptionalCharacter(91))
1273
- e = this.parseKeyedReadOrWrite(e, t, !1);
1274
- else if (this.consumeOptionalCharacter(40))
1275
- e = this.parseCall(e, t, !1);
1276
- else if (this.consumeOptionalOperator("!"))
1277
- e = new ht(this.span(t), this.sourceSpan(t), e);
1278
- else return e;
1279
- }
1280
- parsePrimary() {
1281
- let t = this.inputIndex;
1282
- if (this.consumeOptionalCharacter(40)) {
1283
- this.rparensExpected++;
1284
- let e = this.parsePipe();
1285
- return this.rparensExpected--, this.expectCharacter(41), e;
1286
- } else {
1287
- if (this.next.isKeywordNull())
1288
- return this.advance(), new E(this.span(t), this.sourceSpan(t), null);
1289
- if (this.next.isKeywordUndefined())
1290
- return (
1291
- this.advance(), new E(this.span(t), this.sourceSpan(t), void 0)
1292
- );
1293
- if (this.next.isKeywordTrue())
1294
- return this.advance(), new E(this.span(t), this.sourceSpan(t), !0);
1295
- if (this.next.isKeywordFalse())
1296
- return this.advance(), new E(this.span(t), this.sourceSpan(t), !1);
1297
- if (this.next.isKeywordThis())
1298
- return this.advance(), new Lt(this.span(t), this.sourceSpan(t));
1299
- if (this.consumeOptionalCharacter(91)) {
1300
- this.rbracketsExpected++;
1301
- let e = this.parseExpressionList(93);
1302
- return (
1303
- this.rbracketsExpected--,
1304
- this.expectCharacter(93),
1305
- new nt(this.span(t), this.sourceSpan(t), e)
1306
- );
1307
- } else {
1308
- if (this.next.isCharacter(123)) return this.parseLiteralMap();
1309
- if (this.next.isIdentifier())
1310
- return this.parseAccessMember(
1311
- new K(this.span(t), this.sourceSpan(t)),
1312
- t,
1313
- !1,
1314
- );
1315
- if (this.next.isNumber()) {
1316
- let e = this.next.toNumber();
1317
- return this.advance(), new E(this.span(t), this.sourceSpan(t), e);
1318
- } else if (this.next.isString()) {
1319
- let e = this.next.toString();
1320
- return this.advance(), new E(this.span(t), this.sourceSpan(t), e);
1321
- } else
1322
- return this.next.isPrivateIdentifier()
1323
- ? (this._reportErrorForPrivateIdentifier(this.next, null),
1324
- new $(this.span(t), this.sourceSpan(t)))
1325
- : this.index >= this.tokens.length
1326
- ? (this.error(`Unexpected end of expression: ${this.input}`),
1327
- new $(this.span(t), this.sourceSpan(t)))
1328
- : (this.error(`Unexpected token ${this.next}`),
1329
- new $(this.span(t), this.sourceSpan(t)));
1330
- }
1331
- }
1332
- }
1333
- parseExpressionList(t) {
1334
- let e = [];
1335
- do
1336
- if (!this.next.isCharacter(t)) e.push(this.parsePipe());
1337
- else break;
1338
- while (this.consumeOptionalCharacter(44));
1339
- return e;
1340
- }
1341
- parseLiteralMap() {
1342
- let t = [],
1343
- e = [],
1344
- s = this.inputIndex;
1345
- if ((this.expectCharacter(123), !this.consumeOptionalCharacter(125))) {
1346
- this.rbracesExpected++;
1347
- do {
1348
- let i = this.inputIndex,
1349
- n = this.next.isString(),
1350
- a = this.expectIdentifierOrKeywordOrString(),
1351
- o = { key: a, quoted: n };
1352
- if ((t.push(o), n))
1353
- this.expectCharacter(58), e.push(this.parsePipe());
1354
- else if (this.consumeOptionalCharacter(58)) e.push(this.parsePipe());
1355
- else {
1356
- o.isShorthandInitialized = !0;
1357
- let p = this.span(i),
1358
- u = this.sourceSpan(i);
1359
- e.push(new M(p, u, u, new K(p, u), a));
1360
- }
1361
- } while (
1362
- this.consumeOptionalCharacter(44) &&
1363
- !this.next.isCharacter(125)
1364
- );
1365
- this.rbracesExpected--, this.expectCharacter(125);
1366
- }
1367
- return new at(this.span(s), this.sourceSpan(s), t, e);
1368
- }
1369
- parseAccessMember(t, e, s) {
1370
- let i = this.inputIndex,
1371
- n = this.withContext(gt.Writable, () => {
1372
- let p = this.expectIdentifierOrKeyword() ?? "";
1373
- return (
1374
- p.length === 0 &&
1375
- this.error("Expected identifier for property access", t.span.end),
1376
- p
1377
- );
1378
- }),
1379
- a = this.sourceSpan(i),
1380
- o;
1381
- if (s)
1382
- this.consumeOptionalOperator("=")
1383
- ? (this.error("The '?.' operator cannot be used in the assignment"),
1384
- (o = new $(this.span(e), this.sourceSpan(e))))
1385
- : (o = new _(this.span(e), this.sourceSpan(e), a, t, n));
1386
- else if (this.consumeOptionalOperator("=")) {
1387
- if (!(this.parseFlags & 1))
1388
- return (
1389
- this.error("Bindings cannot contain assignments"),
1390
- new $(this.span(e), this.sourceSpan(e))
1391
- );
1392
- let p = this.parseConditional();
1393
- o = new et(this.span(e), this.sourceSpan(e), a, t, n, p);
1394
- } else o = new M(this.span(e), this.sourceSpan(e), a, t, n);
1395
- return o;
1396
- }
1397
- parseCall(t, e, s) {
1398
- let i = this.inputIndex;
1399
- this.rparensExpected++;
1400
- let n = this.parseCallArguments(),
1401
- a = this.span(i, this.inputIndex).toAbsolute(this.absoluteOffset);
1402
- this.expectCharacter(41), this.rparensExpected--;
1403
- let o = this.span(e),
1404
- p = this.sourceSpan(e);
1405
- return s ? new D(o, p, t, n, a) : new pt(o, p, t, n, a);
1406
- }
1407
- parseCallArguments() {
1408
- if (this.next.isCharacter(41)) return [];
1409
- let t = [];
1410
- do t.push(this.parsePipe());
1411
- while (this.consumeOptionalCharacter(44));
1412
- return t;
1413
- }
1414
- expectTemplateBindingKey() {
1415
- let t = "",
1416
- e = !1,
1417
- s = this.currentAbsoluteOffset;
1418
- do
1419
- (t += this.expectIdentifierOrKeywordOrString()),
1420
- (e = this.consumeOptionalOperator("-")),
1421
- e && (t += "-");
1422
- while (e);
1423
- return { source: t, span: new L(s, s + t.length) };
1424
- }
1425
- parseTemplateBindings(t) {
1426
- let e = [];
1427
- for (
1428
- e.push(...this.parseDirectiveKeywordBindings(t));
1429
- this.index < this.tokens.length;
1430
-
1431
- ) {
1432
- let s = this.parseLetBinding();
1433
- if (s) e.push(s);
1434
- else {
1435
- let i = this.expectTemplateBindingKey(),
1436
- n = this.parseAsBinding(i);
1437
- n
1438
- ? e.push(n)
1439
- : ((i.source =
1440
- t.source +
1441
- i.source.charAt(0).toUpperCase() +
1442
- i.source.substring(1)),
1443
- e.push(...this.parseDirectiveKeywordBindings(i)));
1444
- }
1445
- this.consumeStatementTerminator();
1446
- }
1447
- return new qt(e, [], this.errors);
1448
- }
1449
- parseKeyedReadOrWrite(t, e, s) {
1450
- return this.withContext(gt.Writable, () => {
1451
- this.rbracketsExpected++;
1452
- let i = this.parsePipe();
1453
- if (
1454
- (i instanceof $ && this.error("Key access cannot be empty"),
1455
- this.rbracketsExpected--,
1456
- this.expectCharacter(93),
1457
- this.consumeOptionalOperator("="))
1458
- )
1459
- if (s)
1460
- this.error("The '?.' operator cannot be used in the assignment");
1461
- else {
1462
- let n = this.parseConditional();
1463
- return new rt(this.span(e), this.sourceSpan(e), t, i, n);
1464
- }
1465
- else
1466
- return s
1467
- ? new U(this.span(e), this.sourceSpan(e), t, i)
1468
- : new st(this.span(e), this.sourceSpan(e), t, i);
1469
- return new $(this.span(e), this.sourceSpan(e));
1470
- });
1471
- }
1472
- parseDirectiveKeywordBindings(t) {
1473
- let e = [];
1474
- this.consumeOptionalCharacter(58);
1475
- let s = this.getDirectiveBoundTarget(),
1476
- i = this.currentAbsoluteOffset,
1477
- n = this.parseAsBinding(t);
1478
- n ||
1479
- (this.consumeStatementTerminator(), (i = this.currentAbsoluteOffset));
1480
- let a = new L(t.span.start, i);
1481
- return e.push(new ut(a, t, s)), n && e.push(n), e;
1482
- }
1483
- getDirectiveBoundTarget() {
1484
- if (this.next === Bt || this.peekKeywordAs() || this.peekKeywordLet())
1485
- return null;
1486
- let t = this.parsePipe(),
1487
- { start: e, end: s } = t.span,
1488
- i = this.input.substring(e, s);
1489
- return new R(t, i, this.location, this.absoluteOffset + e, this.errors);
1490
- }
1491
- parseAsBinding(t) {
1492
- if (!this.peekKeywordAs()) return null;
1493
- this.advance();
1494
- let e = this.expectTemplateBindingKey();
1495
- this.consumeStatementTerminator();
1496
- let s = new L(t.span.start, this.currentAbsoluteOffset);
1497
- return new W(s, e, t);
1498
- }
1499
- parseLetBinding() {
1500
- if (!this.peekKeywordLet()) return null;
1501
- let t = this.currentAbsoluteOffset;
1502
- this.advance();
1503
- let e = this.expectTemplateBindingKey(),
1504
- s = null;
1505
- this.consumeOptionalOperator("=") &&
1506
- (s = this.expectTemplateBindingKey()),
1507
- this.consumeStatementTerminator();
1508
- let i = new L(t, this.currentAbsoluteOffset);
1509
- return new W(i, e, s);
1510
- }
1511
- consumeStatementTerminator() {
1512
- this.consumeOptionalCharacter(59) || this.consumeOptionalCharacter(44);
1513
- }
1514
- error(t, e = null) {
1515
- this.errors.push(
1516
- new Z(t, this.input, this.locationText(e), this.location),
1517
- ),
1518
- this.skip();
1519
- }
1520
- locationText(t = null) {
1521
- return (
1522
- t == null && (t = this.index),
1523
- t < this.tokens.length
1524
- ? `at column ${this.tokens[t].index + 1} in`
1525
- : "at the end of the expression"
1526
- );
1527
- }
1528
- _reportErrorForPrivateIdentifier(t, e) {
1529
- let s = `Private identifiers are not supported. Unexpected private identifier: ${t}`;
1530
- e !== null && (s += `, ${e}`), this.error(s);
1531
- }
1532
- skip() {
1533
- let t = this.next;
1534
- for (
1535
- ;
1536
- this.index < this.tokens.length &&
1537
- !t.isCharacter(59) &&
1538
- !t.isOperator("|") &&
1539
- (this.rparensExpected <= 0 || !t.isCharacter(41)) &&
1540
- (this.rbracesExpected <= 0 || !t.isCharacter(125)) &&
1541
- (this.rbracketsExpected <= 0 || !t.isCharacter(93)) &&
1542
- (!(this.context & gt.Writable) || !t.isOperator("="));
1543
-
1544
- )
1545
- this.next.isError() &&
1546
- this.errors.push(
1547
- new Z(
1548
- this.next.toString(),
1549
- this.input,
1550
- this.locationText(),
1551
- this.location,
1552
- ),
1553
- ),
1554
- this.advance(),
1555
- (t = this.next);
1556
- }
1557
- },
1558
- Ht = class extends Rt {
1559
- constructor() {
1560
- super(...arguments), (this.errors = []);
1561
- }
1562
- visitPipe() {
1563
- this.errors.push("pipes");
1564
- }
1565
- };
1566
- function Fs(r) {
1567
- let t = new Map(),
1568
- e = 0,
1569
- s = 0,
1570
- i = 0;
1571
- for (; i < r.length; ) {
1572
- let n = r[i];
1573
- if (n.type === 9) {
1574
- let [a, o] = n.parts;
1575
- (e += o.length), (s += a.length);
1576
- } else {
1577
- let a = n.parts.reduce((o, p) => o + p.length, 0);
1578
- (s += a), (e += a);
1579
- }
1580
- t.set(s, e), i++;
1581
- }
1582
- return t;
1583
- }
1584
- function Ce({ start: r, end: t }, e) {
1585
- let s = r,
1586
- i = t;
1587
- for (; i !== s && /\s/.test(e[i - 1]); ) i--;
1588
- for (; s !== i && /\s/.test(e[s]); ) s++;
1589
- return { start: s, end: i };
1590
- }
1591
- function Ws({ start: r, end: t }, e) {
1592
- let s = r,
1593
- i = t;
1594
- for (; i !== e.length && /\s/.test(e[i]); ) i++;
1595
- for (; s !== 0 && /\s/.test(e[s - 1]); ) s--;
1596
- return { start: s, end: i };
1597
- }
1598
- function Gs(r, t) {
1599
- return t[r.start - 1] === "(" && t[r.end] === ")"
1600
- ? { start: r.start - 1, end: r.end + 1 }
1601
- : r;
1602
- }
1603
- function Ae(r, t, e) {
1604
- let s = 0,
1605
- i = { start: r.start, end: r.end };
1606
- for (;;) {
1607
- let n = Ws(i, t),
1608
- a = Gs(n, t);
1609
- if (n.start === a.start && n.end === a.end) break;
1610
- (i.start = a.start), (i.end = a.end), s++;
1611
- }
1612
- return {
1613
- hasParens: (e ? s - 1 : s) !== 0,
1614
- outerSpan: Ce(e ? { start: i.start + 1, end: i.end - 1 } : i, t),
1615
- innerSpan: Ce(r, t),
1616
- };
1617
- }
1618
- function Oe(r) {
1619
- return typeof r == "string" ? (t) => t === r : (t) => r.test(t);
1620
- }
1621
- function Ie(r, t, e) {
1622
- let s = Oe(t);
1623
- for (let i = e; i >= 0; i--) {
1624
- let n = r[i];
1625
- if (s(n)) return i;
1626
- }
1627
- throw new Error(
1628
- `Cannot find front char ${t} from index ${e} in ${JSON.stringify(r)}`,
1629
- );
1630
- }
1631
- function ke(r, t, e) {
1632
- let s = Oe(t);
1633
- for (let i = e; i < r.length; i++) {
1634
- let n = r[i];
1635
- if (s(n)) return i;
1636
- }
1637
- throw new Error(
1638
- `Cannot find character ${t} from index ${e} in ${JSON.stringify(r)}`,
1639
- );
1640
- }
1641
- function Ne(r) {
1642
- return r.slice(0, 1).toLowerCase() + r.slice(1);
1643
- }
1644
- function Ct(r) {
1645
- let { start: t, end: e } = r;
1646
- return { start: t, end: e, range: [t, e] };
1647
- }
1648
- var Vs = (r) => mt.prototype._commentStart(r);
1649
- function Qs(r, t) {
1650
- let e = t ? Vs(r) : null;
1651
- if (e === null) return { text: r, comments: [] };
1652
- let s = {
1653
- type: "CommentLine",
1654
- value: r.slice(e + 2),
1655
- ...Ct({ start: e, end: r.length }),
1656
- };
1657
- return { text: r.slice(0, e), comments: [s] };
1658
- }
1659
- function At(r, t = !0) {
1660
- return (e) => {
1661
- let s = new yt(),
1662
- i = new mt(s),
1663
- { text: n, comments: a } = Qs(e, t),
1664
- o = r(n, i);
1665
- if (o.errors.length !== 0) {
1666
- let [{ message: p }] = o.errors;
1667
- throw new SyntaxError(
1668
- p.replace(/^Parser Error: | at column \d+ in [^]*$/g, ""),
1669
- );
1670
- }
1671
- return { result: o, comments: a, text: n };
1672
- };
1673
- }
1674
- var Le = At((r, t) => t.parseBinding(r, "", 0)),
1675
- zs = At((r, t) => t.parseSimpleBinding(r, "", 0)),
1676
- Re = At((r, t) => t.parseAction(r, "", 0)),
1677
- Pe = At((r, t) => t.parseInterpolationExpression(r, "", 0)),
1678
- be = At((r, t) => t.parseTemplateBindings("", r, "", 0, 0), !1);
1679
- var Hs = (r, t, e) => {
1680
- if (!(r && t == null))
1681
- return Array.isArray(t) || typeof t == "string"
1682
- ? t[e < 0 ? t.length + e : e]
1683
- : t.at(e);
1684
- },
1685
- Tt = Hs;
1686
- var jt = class {
1687
- text;
1688
- constructor(t) {
1689
- this.text = t;
1690
- }
1691
- getCharacterIndex(t, e) {
1692
- return ke(this.text, t, e);
1693
- }
1694
- getCharacterLastIndex(t, e) {
1695
- return Ie(this.text, t, e);
1696
- }
1697
- transformSpan(t, { stripSpaces: e = !1, hasParentParens: s = !1 } = {}) {
1698
- if (!e) return Ct(t);
1699
- let { outerSpan: i, innerSpan: n, hasParens: a } = Ae(t, this.text, s),
1700
- o = Ct(n);
1701
- return (
1702
- a &&
1703
- (o.extra = {
1704
- parenthesized: !0,
1705
- parenStart: i.start,
1706
- parenEnd: i.end,
1707
- }),
1708
- o
1709
- );
1710
- }
1711
- createNode(t, { stripSpaces: e = !0, hasParentParens: s = !1 } = {}) {
1712
- let { type: i, start: n, end: a } = t,
1713
- o = {
1714
- ...t,
1715
- ...this.transformSpan(
1716
- { start: n, end: a },
1717
- { stripSpaces: e, hasParentParens: s },
1718
- ),
1719
- };
1720
- switch (i) {
1721
- case "NumericLiteral":
1722
- case "StringLiteral": {
1723
- let p = this.text.slice(o.start, o.end),
1724
- { value: u } = o;
1725
- o.extra = { ...o.extra, raw: p, rawValue: u };
1726
- break;
1727
- }
1728
- case "ObjectProperty": {
1729
- let { shorthand: p } = o;
1730
- p && (o.extra = { ...o.extra, shorthand: p });
1731
- break;
1732
- }
1733
- }
1734
- return o;
1735
- }
1736
- },
1737
- Ke = jt;
1738
- function Zt(r) {
1739
- var t;
1740
- return !!((t = r.extra) != null && t.parenthesized);
1741
- }
1742
- function k(r) {
1743
- return Zt(r) ? r.extra.parenStart : r.start;
1744
- }
1745
- function N(r) {
1746
- return Zt(r) ? r.extra.parenEnd : r.end;
1747
- }
1748
- function Be(r) {
1749
- return (
1750
- (r.type === "OptionalCallExpression" ||
1751
- r.type === "OptionalMemberExpression") &&
1752
- !Zt(r)
1753
- );
1754
- }
1755
- function Te(r, t) {
1756
- let { start: e, end: s } = r.sourceSpan;
1757
- return e >= s || /^\s+$/.test(t.slice(e, s));
1758
- }
1759
- var kt,
1760
- St,
1761
- h,
1762
- d,
1763
- Ot,
1764
- v,
1765
- Yt,
1766
- It = class extends Ke {
1767
- constructor(e, s) {
1768
- super(s);
1769
- P(this, h);
1770
- P(this, kt);
1771
- P(this, St);
1772
- Y(this, kt, e), Y(this, St, s);
1773
- }
1774
- get node() {
1775
- return c(this, h, v).call(this, O(this, kt));
1776
- }
1777
- transformNode(e) {
1778
- return c(this, h, Yt).call(this, e);
1779
- }
1780
- };
1781
- (kt = new WeakMap()),
1782
- (St = new WeakMap()),
1783
- (h = new WeakSet()),
1784
- (d = function (e, { stripSpaces: s = !0, hasParentParens: i = !1 } = {}) {
1785
- return this.createNode(e, { stripSpaces: s, hasParentParens: i });
1786
- }),
1787
- (Ot = function (
1788
- e,
1789
- s,
1790
- { computed: i, optional: n, end: a = N(s), hasParentParens: o = !1 },
1791
- ) {
1792
- if (Te(e, O(this, St)) || e.sourceSpan.start === s.start) return s;
1793
- let p = c(this, h, v).call(this, e),
1794
- u = Be(p);
1795
- return c(this, h, d).call(
1796
- this,
1797
- {
1798
- type: n || u ? "OptionalMemberExpression" : "MemberExpression",
1799
- object: p,
1800
- property: s,
1801
- computed: i,
1802
- ...(n ? { optional: !0 } : u ? { optional: !1 } : void 0),
1803
- start: k(p),
1804
- end: a,
1805
- },
1806
- { hasParentParens: o },
1807
- );
1808
- }),
1809
- (v = function (e, s = !1) {
1810
- return c(this, h, Yt).call(this, e, s);
1811
- }),
1812
- (Yt = function (e, s = !1) {
1813
- if (e instanceof ot) {
1814
- let { expressions: i } = e;
1815
- if (i.length !== 1) throw new Error("Unexpected 'Interpolation'");
1816
- return c(this, h, v).call(this, i[0]);
1817
- }
1818
- if (e instanceof F)
1819
- return c(this, h, d).call(
1820
- this,
1821
- {
1822
- type: "UnaryExpression",
1823
- prefix: !0,
1824
- argument: c(this, h, v).call(this, e.expr),
1825
- operator: e.operator,
1826
- ...e.sourceSpan,
1827
- },
1828
- { hasParentParens: s },
1829
- );
1830
- if (e instanceof A) {
1831
- let { left: i, operation: n, right: a } = e,
1832
- o = c(this, h, v).call(this, i),
1833
- p = c(this, h, v).call(this, a),
1834
- u = k(o),
1835
- f = N(p),
1836
- S = { left: o, right: p, start: u, end: f };
1837
- return n === "&&" || n === "||" || n === "??"
1838
- ? c(this, h, d).call(
1839
- this,
1840
- { ...S, type: "LogicalExpression", operator: n },
1841
- { hasParentParens: s },
1842
- )
1843
- : c(this, h, d).call(
1844
- this,
1845
- { ...S, type: "BinaryExpression", operator: n },
1846
- { hasParentParens: s },
1847
- );
1848
- }
1849
- if (e instanceof it) {
1850
- let { exp: i, name: n, args: a } = e,
1851
- o = c(this, h, v).call(this, i),
1852
- p = k(o),
1853
- u = N(o),
1854
- f = this.getCharacterIndex(/\S/, this.getCharacterIndex("|", u) + 1),
1855
- S = c(this, h, d).call(this, {
1856
- type: "Identifier",
1857
- name: n,
1858
- start: f,
1859
- end: f + n.length,
1860
- }),
1861
- g = a.map((y) => c(this, h, v).call(this, y));
1862
- return c(this, h, d).call(
1863
- this,
1864
- {
1865
- type: "NGPipeExpression",
1866
- left: o,
1867
- right: S,
1868
- arguments: g,
1869
- start: p,
1870
- end: N(g.length === 0 ? S : Tt(!1, g, -1)),
1871
- },
1872
- { hasParentParens: s },
1873
- );
1874
- }
1875
- if (e instanceof X)
1876
- return c(this, h, d).call(
1877
- this,
1878
- {
1879
- type: "NGChainedExpression",
1880
- expressions: e.expressions.map((i) => c(this, h, v).call(this, i)),
1881
- ...e.sourceSpan,
1882
- },
1883
- { hasParentParens: s },
1884
- );
1885
- if (e instanceof tt) {
1886
- let { condition: i, trueExp: n, falseExp: a } = e,
1887
- o = c(this, h, v).call(this, i),
1888
- p = c(this, h, v).call(this, n),
1889
- u = c(this, h, v).call(this, a);
1890
- return c(this, h, d).call(
1891
- this,
1892
- {
1893
- type: "ConditionalExpression",
1894
- test: o,
1895
- consequent: p,
1896
- alternate: u,
1897
- start: k(o),
1898
- end: N(u),
1899
- },
1900
- { hasParentParens: s },
1901
- );
1902
- }
1903
- if (e instanceof $)
1904
- return c(this, h, d).call(
1905
- this,
1906
- { type: "NGEmptyExpression", ...e.sourceSpan },
1907
- { hasParentParens: s },
1908
- );
1909
- if (e instanceof K)
1910
- return c(this, h, d).call(
1911
- this,
1912
- { type: "ThisExpression", ...e.sourceSpan },
1913
- { hasParentParens: s },
1914
- );
1915
- if (e instanceof st || e instanceof U)
1916
- return c(this, h, Ot).call(
1917
- this,
1918
- e.receiver,
1919
- c(this, h, v).call(this, e.key),
1920
- {
1921
- computed: !0,
1922
- optional: e instanceof U,
1923
- end: e.sourceSpan.end,
1924
- hasParentParens: s,
1925
- },
1926
- );
1927
- if (e instanceof nt)
1928
- return c(this, h, d).call(
1929
- this,
1930
- {
1931
- type: "ArrayExpression",
1932
- elements: e.expressions.map((i) => c(this, h, v).call(this, i)),
1933
- ...e.sourceSpan,
1934
- },
1935
- { hasParentParens: s },
1936
- );
1937
- if (e instanceof at) {
1938
- let { keys: i, values: n } = e,
1939
- a = n.map((p) => c(this, h, v).call(this, p)),
1940
- o = i.map(({ key: p, quoted: u }, f) => {
1941
- let S = a[f],
1942
- g = k(S),
1943
- y = N(S),
1944
- w = this.getCharacterIndex(
1945
- /\S/,
1946
- f === 0
1947
- ? e.sourceSpan.start + 1
1948
- : this.getCharacterIndex(",", N(a[f - 1])) + 1,
1949
- ),
1950
- H =
1951
- g === w
1952
- ? y
1953
- : this.getCharacterLastIndex(
1954
- /\S/,
1955
- this.getCharacterLastIndex(":", g - 1) - 1,
1956
- ) + 1,
1957
- j = { start: w, end: H },
1958
- T = u
1959
- ? c(this, h, d).call(this, {
1960
- type: "StringLiteral",
1961
- value: p,
1962
- ...j,
1963
- })
1964
- : c(this, h, d).call(this, { type: "Identifier", name: p, ...j }),
1965
- Nt = T.end < T.start || w === g;
1966
- return c(this, h, d).call(this, {
1967
- type: "ObjectProperty",
1968
- key: T,
1969
- value: S,
1970
- shorthand: Nt,
1971
- computed: !1,
1972
- start: k(T),
1973
- end: y,
1974
- });
1975
- });
1976
- return c(this, h, d).call(
1977
- this,
1978
- { type: "ObjectExpression", properties: o, ...e.sourceSpan },
1979
- { hasParentParens: s },
1980
- );
1981
- }
1982
- if (e instanceof E) {
1983
- let { value: i } = e;
1984
- switch (typeof i) {
1985
- case "boolean":
1986
- return c(this, h, d).call(
1987
- this,
1988
- { type: "BooleanLiteral", value: i, ...e.sourceSpan },
1989
- { hasParentParens: s },
1990
- );
1991
- case "number":
1992
- return c(this, h, d).call(
1993
- this,
1994
- { type: "NumericLiteral", value: i, ...e.sourceSpan },
1995
- { hasParentParens: s },
1996
- );
1997
- case "object":
1998
- return c(this, h, d).call(
1999
- this,
2000
- { type: "NullLiteral", ...e.sourceSpan },
2001
- { hasParentParens: s },
2002
- );
2003
- case "string":
2004
- return c(this, h, d).call(
2005
- this,
2006
- { type: "StringLiteral", value: i, ...e.sourceSpan },
2007
- { hasParentParens: s },
2008
- );
2009
- case "undefined":
2010
- return c(this, h, d).call(
2011
- this,
2012
- { type: "Identifier", name: "undefined", ...e.sourceSpan },
2013
- { hasParentParens: s },
2014
- );
2015
- default:
2016
- throw new Error(`Unexpected LiteralPrimitive value type ${typeof i}`);
2017
- }
2018
- }
2019
- if (e instanceof pt || e instanceof D) {
2020
- let i = e instanceof D,
2021
- { receiver: n, args: a } = e,
2022
- o =
2023
- a.length === 1
2024
- ? [c(this, h, v).call(this, a[0], !0)]
2025
- : a.map((S) => c(this, h, v).call(this, S)),
2026
- p = c(this, h, v).call(this, n),
2027
- u = Be(p),
2028
- f = i || u ? "OptionalCallExpression" : "CallExpression";
2029
- return c(this, h, d).call(
2030
- this,
2031
- {
2032
- type: f,
2033
- callee: p,
2034
- arguments: o,
2035
- optional: f === "OptionalCallExpression" ? i : void 0,
2036
- start: k(p),
2037
- end: e.sourceSpan.end,
2038
- },
2039
- { hasParentParens: s },
2040
- );
2041
- }
2042
- if (e instanceof ht) {
2043
- let i = c(this, h, v).call(this, e.expression);
2044
- return c(this, h, d).call(
2045
- this,
2046
- {
2047
- type: "TSNonNullExpression",
2048
- expression: i,
2049
- start: k(i),
2050
- end: e.sourceSpan.end,
2051
- },
2052
- { hasParentParens: s },
2053
- );
2054
- }
2055
- if (e instanceof ct) {
2056
- let i = c(this, h, v).call(this, e.expression);
2057
- return c(this, h, d).call(
2058
- this,
2059
- {
2060
- type: "UnaryExpression",
2061
- prefix: !0,
2062
- operator: "!",
2063
- argument: i,
2064
- start: e.sourceSpan.start,
2065
- end: N(i),
2066
- },
2067
- { hasParentParens: s },
2068
- );
2069
- }
2070
- if (e instanceof M || e instanceof _) {
2071
- let { receiver: i, name: n } = e,
2072
- a = this.getCharacterLastIndex(/\S/, e.sourceSpan.end - 1) + 1,
2073
- o = c(this, h, d).call(
2074
- this,
2075
- { type: "Identifier", name: n, start: a - n.length, end: a },
2076
- Te(i, O(this, St)) ? { hasParentParens: s } : {},
2077
- );
2078
- return c(this, h, Ot).call(this, i, o, {
2079
- computed: !1,
2080
- optional: e instanceof _,
2081
- hasParentParens: s,
2082
- });
2083
- }
2084
- if (e instanceof rt) {
2085
- let i = c(this, h, v).call(this, e.key),
2086
- n = c(this, h, v).call(this, e.value),
2087
- a = c(this, h, Ot).call(this, e.receiver, i, {
2088
- computed: !0,
2089
- optional: !1,
2090
- end: this.getCharacterIndex("]", N(i)) + 1,
2091
- });
2092
- return c(this, h, d).call(
2093
- this,
2094
- {
2095
- type: "AssignmentExpression",
2096
- left: a,
2097
- operator: "=",
2098
- right: n,
2099
- start: k(a),
2100
- end: N(n),
2101
- },
2102
- { hasParentParens: s },
2103
- );
2104
- }
2105
- if (e instanceof et) {
2106
- let { receiver: i, name: n, value: a } = e,
2107
- o = c(this, h, v).call(this, a),
2108
- p =
2109
- this.getCharacterLastIndex(
2110
- /\S/,
2111
- this.getCharacterLastIndex("=", k(o) - 1) - 1,
2112
- ) + 1,
2113
- u = c(this, h, d).call(this, {
2114
- type: "Identifier",
2115
- name: n,
2116
- start: p - n.length,
2117
- end: p,
2118
- }),
2119
- f = c(this, h, Ot).call(this, i, u, { computed: !1, optional: !1 });
2120
- return c(this, h, d).call(
2121
- this,
2122
- {
2123
- type: "AssignmentExpression",
2124
- left: f,
2125
- operator: "=",
2126
- right: o,
2127
- start: k(f),
2128
- end: N(o),
2129
- },
2130
- { hasParentParens: s },
2131
- );
2132
- }
2133
- throw Object.assign(new Error("Unexpected node"), { node: e });
2134
- });
2135
- function Me(r, t) {
2136
- return new It(r, t).node;
2137
- }
2138
- function _e(r) {
2139
- return r instanceof ut;
2140
- }
2141
- function Ue(r) {
2142
- return r instanceof W;
2143
- }
2144
- var wt,
2145
- q,
2146
- x,
2147
- Fe,
2148
- C,
2149
- Xt,
2150
- te,
2151
- ee,
2152
- De,
2153
- We,
2154
- Ge,
2155
- Ve,
2156
- Jt = class extends It {
2157
- constructor(e, s) {
2158
- super(void 0, s);
2159
- P(this, x);
2160
- P(this, wt);
2161
- P(this, q);
2162
- Y(this, wt, e), Y(this, q, s);
2163
- for (let i of e) c(this, x, De).call(this, i);
2164
- }
2165
- get expressions() {
2166
- return c(this, x, Ge).call(this);
2167
- }
2168
- };
2169
- (wt = new WeakMap()),
2170
- (q = new WeakMap()),
2171
- (x = new WeakSet()),
2172
- (Fe = function () {
2173
- return O(this, wt)[0].key;
2174
- }),
2175
- (C = function (e, { stripSpaces: s = !0 } = {}) {
2176
- return this.createNode(e, { stripSpaces: s });
2177
- }),
2178
- (Xt = function (e) {
2179
- return this.transformNode(e);
2180
- }),
2181
- (te = function (e) {
2182
- return Ne(e.slice(O(this, x, Fe).source.length));
2183
- }),
2184
- (ee = function (e) {
2185
- let s = O(this, q);
2186
- if (s[e.start] !== '"' && s[e.start] !== "'") return;
2187
- let i = s[e.start],
2188
- n = !1;
2189
- for (let a = e.start + 1; a < s.length; a++)
2190
- switch (s[a]) {
2191
- case i:
2192
- if (!n) {
2193
- e.end = a + 1;
2194
- return;
2195
- }
2196
- default:
2197
- n = !1;
2198
- break;
2199
- case "\\":
2200
- n = !n;
2201
- break;
2202
- }
2203
- }),
2204
- (De = function (e) {
2205
- c(this, x, ee).call(this, e.key.span),
2206
- Ue(e) && e.value && c(this, x, ee).call(this, e.value.span);
2207
- }),
2208
- (We = function (e) {
2209
- if (!e.value || e.value.source) return e.value;
2210
- let s = this.getCharacterIndex(/\S/, e.sourceSpan.start);
2211
- return { source: "$implicit", span: { start: s, end: s } };
2212
- }),
2213
- (Ge = function () {
2214
- let e = O(this, wt),
2215
- [s] = e,
2216
- i =
2217
- O(this, q).slice(s.sourceSpan.start, s.sourceSpan.end).trim().length ===
2218
- 0
2219
- ? e.slice(1)
2220
- : e,
2221
- n = [],
2222
- a = null;
2223
- for (let [o, p] of i.entries()) {
2224
- if (a && _e(a) && Ue(p) && p.value && p.value.source === a.key.source) {
2225
- let u = c(this, x, C).call(this, {
2226
- type: "NGMicrosyntaxKey",
2227
- name: p.key.source,
2228
- ...p.key.span,
2229
- }),
2230
- f = (y, w) => ({
2231
- ...y,
2232
- ...this.transformSpan({ start: y.start, end: w }),
2233
- }),
2234
- S = (y) => ({ ...f(y, u.end), alias: u }),
2235
- g = n.pop();
2236
- if (g.type === "NGMicrosyntaxExpression") n.push(S(g));
2237
- else if (g.type === "NGMicrosyntaxKeyedExpression") {
2238
- let y = S(g.expression);
2239
- n.push(f({ ...g, expression: y }, y.end));
2240
- } else throw new Error(`Unexpected type ${g.type}`);
2241
- } else n.push(c(this, x, Ve).call(this, p, o));
2242
- a = p;
2243
- }
2244
- return c(this, x, C).call(this, {
2245
- type: "NGMicrosyntax",
2246
- body: n,
2247
- ...(n.length === 0
2248
- ? e[0].sourceSpan
2249
- : { start: n[0].start, end: Tt(!1, n, -1).end }),
2250
- });
2251
- }),
2252
- (Ve = function (e, s) {
2253
- if (_e(e)) {
2254
- let { key: i, value: n } = e;
2255
- return n
2256
- ? s === 0
2257
- ? c(this, x, C).call(this, {
2258
- type: "NGMicrosyntaxExpression",
2259
- expression: c(this, x, Xt).call(this, n.ast),
2260
- alias: null,
2261
- ...n.sourceSpan,
2262
- })
2263
- : c(this, x, C).call(this, {
2264
- type: "NGMicrosyntaxKeyedExpression",
2265
- key: c(this, x, C).call(this, {
2266
- type: "NGMicrosyntaxKey",
2267
- name: c(this, x, te).call(this, i.source),
2268
- ...i.span,
2269
- }),
2270
- expression: c(this, x, C).call(this, {
2271
- type: "NGMicrosyntaxExpression",
2272
- expression: c(this, x, Xt).call(this, n.ast),
2273
- alias: null,
2274
- ...n.sourceSpan,
2275
- }),
2276
- start: i.span.start,
2277
- end: n.sourceSpan.end,
2278
- })
2279
- : c(this, x, C).call(this, {
2280
- type: "NGMicrosyntaxKey",
2281
- name: c(this, x, te).call(this, i.source),
2282
- ...i.span,
2283
- });
2284
- } else {
2285
- let { key: i, sourceSpan: n } = e;
2286
- if (/^let\s$/.test(O(this, q).slice(n.start, n.start + 4))) {
2287
- let { value: o } = e;
2288
- return c(this, x, C).call(this, {
2289
- type: "NGMicrosyntaxLet",
2290
- key: c(this, x, C).call(this, {
2291
- type: "NGMicrosyntaxKey",
2292
- name: i.source,
2293
- ...i.span,
2294
- }),
2295
- value: o
2296
- ? c(this, x, C).call(this, {
2297
- type: "NGMicrosyntaxKey",
2298
- name: o.source,
2299
- ...o.span,
2300
- })
2301
- : null,
2302
- start: n.start,
2303
- end: o ? o.span.end : i.span.end,
2304
- });
2305
- } else {
2306
- let o = c(this, x, We).call(this, e);
2307
- return c(this, x, C).call(this, {
2308
- type: "NGMicrosyntaxAs",
2309
- key: c(this, x, C).call(this, {
2310
- type: "NGMicrosyntaxKey",
2311
- name: o.source,
2312
- ...o.span,
2313
- }),
2314
- alias: c(this, x, C).call(this, {
2315
- type: "NGMicrosyntaxKey",
2316
- name: i.source,
2317
- ...i.span,
2318
- }),
2319
- start: o.span.start,
2320
- end: i.span.end,
2321
- });
2322
- }
2323
- }
2324
- });
2325
- function Qe(r, t) {
2326
- return new Jt(r, t).expressions;
2327
- }
2328
- function Mt({ result: { ast: r }, text: t, comments: e }) {
2329
- return Object.assign(Me(r, t), { comments: e });
2330
- }
2331
- function ze({ result: { templateBindings: r }, text: t }) {
2332
- return Qe(r, t);
2333
- }
2334
- var qe = (r) => Mt(Le(r));
2335
- var He = (r) => Mt(Pe(r)),
2336
- se = (r) => Mt(Re(r)),
2337
- je = (r) => ze(be(r));
2338
- function re(r) {
2339
- var s, i, n;
2340
- let t = ((s = r.range) == null ? void 0 : s[0]) ?? r.start,
2341
- e =
2342
- (n =
2343
- ((i = r.declaration) == null ? void 0 : i.decorators) ??
2344
- r.decorators) == null
2345
- ? void 0
2346
- : n[0];
2347
- return e ? Math.min(re(e), t) : t;
2348
- }
2349
- function Ye(r) {
2350
- var t;
2351
- return ((t = r.range) == null ? void 0 : t[1]) ?? r.end;
2352
- }
2353
- function _t(r) {
2354
- return {
2355
- astFormat: "estree",
2356
- parse(t) {
2357
- let e = r(t);
2358
- return {
2359
- type: "NGRoot",
2360
- node:
2361
- r === se && e.type !== "NGChainedExpression"
2362
- ? { ...e, type: "NGChainedExpression", expressions: [e] }
2363
- : e,
2364
- };
2365
- },
2366
- locStart: re,
2367
- locEnd: Ye,
2368
- };
2369
- }
2370
- var js = _t(se),
2371
- Ys = _t(qe),
2372
- Zs = _t(He),
2373
- Js = _t(je);
2374
- var Ur = ne;
2375
- export { Ur as default, ie as parsers };
1
+ var Or=Object.defineProperty;var Dr=Object.getPrototypeOf;var Br=Reflect.get;var gn=t=>{throw TypeError(t)};var vn=(t,e)=>{for(var n in e)Or(t,n,{get:e[n],enumerable:!0})};var lt=(t,e,n)=>e.has(t)||gn("Cannot "+n);var j=(t,e,n)=>(lt(t,e,"read from private field"),n?n.call(t):e.get(t)),Me=(t,e,n)=>e.has(t)?gn("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),ct=(t,e,n,s)=>(lt(t,e,"write to private field"),s?s.call(t,n):e.set(t,n),n),v=(t,e,n)=>(lt(t,e,"access private method"),n);var wn=(t,e,n)=>Br(Dr(t),n,e);var Rr={};vn(Rr,{parsers:()=>fn});var fn={};vn(fn,{__ng_action:()=>no,__ng_binding:()=>so,__ng_directive:()=>io,__ng_interpolation:()=>ro});function Fr(t){return typeof t=="string"?e=>e===t:e=>t.test(e)}function Sn(t,e,n){let s=Fr(e);for(let r=n;r<t.length;r++){let i=t[r];if(s(i))return r}throw new Error(`Cannot find character ${e} from index ${n} in ${JSON.stringify(t)}`)}function En(t){return t.slice(0,1).toLowerCase()+t.slice(1)}function Re(t){let{start:e,end:n}=t;return{start:e,end:n,range:[e,n]}}function xn(t){return!!t.extra?.parenthesized}function ve(t){return t.type==="TSNonNullExpression"&&!xn(t)?ve(t.expression):(t.type==="OptionalCallExpression"||t.type==="OptionalMemberExpression")&&!xn(t)}var co=new RegExp(`(\\:not\\()|(([\\.\\#]?)[-\\w]+)|(?:\\[([-.\\w*\\\\$]+)(?:=(["']?)([^\\]"']*)\\5)?\\])|(\\))|(\\s*,\\s*)`,"g");var yn;(function(t){t[t.Emulated=0]="Emulated",t[t.None=2]="None",t[t.ShadowDom=3]="ShadowDom",t[t.ExperimentalIsolatedShadowDom=4]="ExperimentalIsolatedShadowDom"})(yn||(yn={}));var Cn;(function(t){t[t.OnPush=0]="OnPush",t[t.Default=1]="Default",t[t.Eager=1]="Eager"})(Cn||(Cn={}));var _n;(function(t){t[t.None=0]="None",t[t.SignalBased=1]="SignalBased",t[t.HasDecoratorInputTransform=2]="HasDecoratorInputTransform"})(_n||(_n={}));var P;(function(t){t[t.NONE=0]="NONE",t[t.HTML=1]="HTML",t[t.STYLE=2]="STYLE",t[t.SCRIPT=3]="SCRIPT",t[t.URL=4]="URL",t[t.RESOURCE_URL=5]="RESOURCE_URL",t[t.ATTRIBUTE_NO_BINDING=6]="ATTRIBUTE_NO_BINDING"})(P||(P={}));var kn;(function(t){t[t.Error=0]="Error",t[t.Warning=1]="Warning",t[t.Ignore=2]="Ignore"})(kn||(kn={}));var Tn;(function(t){t[t.Directive=0]="Directive",t[t.Component=1]="Component",t[t.Injectable=2]="Injectable",t[t.Pipe=3]="Pipe",t[t.NgModule=4]="NgModule"})(Tn||(Tn={}));var bn;(function(t){t[t.Directive=0]="Directive",t[t.Pipe=1]="Pipe",t[t.NgModule=2]="NgModule"})(bn||(bn={}));var An;(function(t){t[t.Emulated=0]="Emulated",t[t.None=2]="None",t[t.ShadowDom=3]="ShadowDom",t[t.ExperimentalIsolatedShadowDom=4]="ExperimentalIsolatedShadowDom"})(An||(An={}));var In;(function(t){t[t.Little=0]="Little",t[t.Big=1]="Big"})(In||(In={}));var Nn;(function(t){t[t.None=0]="None",t[t.Const=1]="Const"})(Nn||(Nn={}));var Pn;(function(t){t[t.Dynamic=0]="Dynamic",t[t.Bool=1]="Bool",t[t.String=2]="String",t[t.Int=3]="Int",t[t.Number=4]="Number",t[t.Function=5]="Function",t[t.Inferred=6]="Inferred",t[t.None=7]="None"})(Pn||(Pn={}));var Ln;(function(t){t[t.Minus=0]="Minus",t[t.Plus=1]="Plus"})(Ln||(Ln={}));var u;(function(t){t[t.Equals=0]="Equals",t[t.NotEquals=1]="NotEquals",t[t.Assign=2]="Assign",t[t.Identical=3]="Identical",t[t.NotIdentical=4]="NotIdentical",t[t.Minus=5]="Minus",t[t.Plus=6]="Plus",t[t.Divide=7]="Divide",t[t.Multiply=8]="Multiply",t[t.Modulo=9]="Modulo",t[t.And=10]="And",t[t.Or=11]="Or",t[t.BitwiseOr=12]="BitwiseOr",t[t.BitwiseAnd=13]="BitwiseAnd",t[t.Lower=14]="Lower",t[t.LowerEquals=15]="LowerEquals",t[t.Bigger=16]="Bigger",t[t.BiggerEquals=17]="BiggerEquals",t[t.NullishCoalesce=18]="NullishCoalesce",t[t.Exponentiation=19]="Exponentiation",t[t.In=20]="In",t[t.InstanceOf=21]="InstanceOf",t[t.AdditionAssignment=22]="AdditionAssignment",t[t.SubtractionAssignment=23]="SubtractionAssignment",t[t.MultiplicationAssignment=24]="MultiplicationAssignment",t[t.DivisionAssignment=25]="DivisionAssignment",t[t.RemainderAssignment=26]="RemainderAssignment",t[t.ExponentiationAssignment=27]="ExponentiationAssignment",t[t.AndAssignment=28]="AndAssignment",t[t.OrAssignment=29]="OrAssignment",t[t.NullishCoalesceAssignment=30]="NullishCoalesceAssignment"})(u||(u={}));function Vr(t,e){return t==null||e==null?t==e:t.isEquivalent(e)}function Ur(t,e,n){let s=t.length;if(s!==e.length)return!1;for(let r=0;r<s;r++)if(!n(t[r],e[r]))return!1;return!0}function oe(t,e){return Ur(t,e,(n,s)=>n.isEquivalent(s))}var S=class{type;sourceSpan;constructor(e,n){this.type=e||null,this.sourceSpan=n||null}prop(e,n){return new xt(this,e,null,n)}key(e,n,s){return new St(this,e,n,s)}callFn(e,n,s){return new dt(this,e,null,n,s)}instantiate(e,n,s){return new mt(this,e,n,s)}conditional(e,n=null,s){return new wt(this,e,n,null,s)}equals(e,n){return new w(u.Equals,this,e,null,n)}notEquals(e,n){return new w(u.NotEquals,this,e,null,n)}identical(e,n){return new w(u.Identical,this,e,null,n)}notIdentical(e,n){return new w(u.NotIdentical,this,e,null,n)}minus(e,n){return new w(u.Minus,this,e,null,n)}plus(e,n){return new w(u.Plus,this,e,null,n)}divide(e,n){return new w(u.Divide,this,e,null,n)}multiply(e,n){return new w(u.Multiply,this,e,null,n)}modulo(e,n){return new w(u.Modulo,this,e,null,n)}power(e,n){return new w(u.Exponentiation,this,e,null,n)}and(e,n){return new w(u.And,this,e,null,n)}bitwiseOr(e,n){return new w(u.BitwiseOr,this,e,null,n)}bitwiseAnd(e,n){return new w(u.BitwiseAnd,this,e,null,n)}or(e,n){return new w(u.Or,this,e,null,n)}lower(e,n){return new w(u.Lower,this,e,null,n)}lowerEquals(e,n){return new w(u.LowerEquals,this,e,null,n)}bigger(e,n){return new w(u.Bigger,this,e,null,n)}biggerEquals(e,n){return new w(u.BiggerEquals,this,e,null,n)}isBlank(e){return this.equals(TYPED_NULL_EXPR,e)}nullishCoalesce(e,n){return new w(u.NullishCoalesce,this,e,null,n)}toStmt(){return new De(this,null)}},ht=class t extends S{name;constructor(e,n,s){super(n,s),this.name=e}isEquivalent(e){return e instanceof t&&this.name===e.name}isConstant(){return!1}visitExpression(e,n){return e.visitReadVarExpr(this,n)}clone(){return new t(this.name,this.type,this.sourceSpan)}set(e){return new w(u.Assign,this,e,null,this.sourceSpan)}},ft=class t extends S{expr;constructor(e,n,s){super(n,s),this.expr=e}visitExpression(e,n){return e.visitTypeofExpr(this,n)}isEquivalent(e){return e instanceof t&&e.expr.isEquivalent(this.expr)}isConstant(){return this.expr.isConstant()}clone(){return new t(this.expr.clone())}};var dt=class t extends S{fn;args;pure;constructor(e,n,s,r,i=!1){super(s,r),this.fn=e,this.args=n,this.pure=i}get receiver(){return this.fn}isEquivalent(e){return e instanceof t&&this.fn.isEquivalent(e.fn)&&oe(this.args,e.args)&&this.pure===e.pure}isConstant(){return!1}visitExpression(e,n){return e.visitInvokeFunctionExpr(this,n)}clone(){return new t(this.fn.clone(),this.args.map(e=>e.clone()),this.type,this.sourceSpan,this.pure)}};var mt=class t extends S{classExpr;args;constructor(e,n,s,r){super(s,r),this.classExpr=e,this.args=n}isEquivalent(e){return e instanceof t&&this.classExpr.isEquivalent(e.classExpr)&&oe(this.args,e.args)}isConstant(){return!1}visitExpression(e,n){return e.visitInstantiateExpr(this,n)}clone(){return new t(this.classExpr.clone(),this.args.map(e=>e.clone()),this.type,this.sourceSpan)}},gt=class t extends S{body;flags;constructor(e,n,s){super(null,s),this.body=e,this.flags=n}isEquivalent(e){return e instanceof t&&this.body===e.body&&this.flags===e.flags}isConstant(){return!0}visitExpression(e,n){return e.visitRegularExpressionLiteral(this,n)}clone(){return new t(this.body,this.flags,this.sourceSpan)}},Oe=class t extends S{value;constructor(e,n,s){super(n,s),this.value=e}isEquivalent(e){return e instanceof t&&this.value===e.value}isConstant(){return!0}visitExpression(e,n){return e.visitLiteralExpr(this,n)}clone(){return new t(this.value,this.type,this.sourceSpan)}};var vt=class t extends S{value;typeParams;constructor(e,n,s=null,r){super(n,r),this.value=e,this.typeParams=s}isEquivalent(e){return e instanceof t&&this.value.name===e.value.name&&this.value.moduleName===e.value.moduleName}isConstant(){return!1}visitExpression(e,n){return e.visitExternalExpr(this,n)}clone(){return new t(this.value,this.type,this.typeParams,this.sourceSpan)}};var wt=class t extends S{condition;falseCase;trueCase;constructor(e,n,s=null,r,i){super(r||n.type,i),this.condition=e,this.falseCase=s,this.trueCase=n}isEquivalent(e){return e instanceof t&&this.condition.isEquivalent(e.condition)&&this.trueCase.isEquivalent(e.trueCase)&&Vr(this.falseCase,e.falseCase)}isConstant(){return!1}visitExpression(e,n){return e.visitConditionalExpr(this,n)}clone(){return new t(this.condition.clone(),this.trueCase.clone(),this.falseCase?.clone(),this.type,this.sourceSpan)}};var w=class t extends S{operator;rhs;lhs;constructor(e,n,s,r,i){super(r||n.type,i),this.operator=e,this.rhs=s,this.lhs=n}isEquivalent(e){return e instanceof t&&this.operator===e.operator&&this.lhs.isEquivalent(e.lhs)&&this.rhs.isEquivalent(e.rhs)}isConstant(){return!1}visitExpression(e,n){return e.visitBinaryOperatorExpr(this,n)}clone(){return new t(this.operator,this.lhs.clone(),this.rhs.clone(),this.type,this.sourceSpan)}isAssignment(){let e=this.operator;return e===u.Assign||e===u.AdditionAssignment||e===u.SubtractionAssignment||e===u.MultiplicationAssignment||e===u.DivisionAssignment||e===u.RemainderAssignment||e===u.ExponentiationAssignment||e===u.AndAssignment||e===u.OrAssignment||e===u.NullishCoalesceAssignment}},xt=class t extends S{receiver;name;constructor(e,n,s,r){super(s,r),this.receiver=e,this.name=n}get index(){return this.name}isEquivalent(e){return e instanceof t&&this.receiver.isEquivalent(e.receiver)&&this.name===e.name}isConstant(){return!1}visitExpression(e,n){return e.visitReadPropExpr(this,n)}set(e){return new w(u.Assign,this.receiver.prop(this.name),e,null,this.sourceSpan)}clone(){return new t(this.receiver.clone(),this.name,this.type,this.sourceSpan)}},St=class t extends S{receiver;index;constructor(e,n,s,r){super(s,r),this.receiver=e,this.index=n}isEquivalent(e){return e instanceof t&&this.receiver.isEquivalent(e.receiver)&&this.index.isEquivalent(e.index)}isConstant(){return!1}visitExpression(e,n){return e.visitReadKeyExpr(this,n)}set(e){return new w(u.Assign,this.receiver.key(this.index),e,null,this.sourceSpan)}clone(){return new t(this.receiver.clone(),this.index.clone(),this.type,this.sourceSpan)}},Et=class t extends S{entries;constructor(e,n,s){super(n,s),this.entries=e}isConstant(){return this.entries.every(e=>e.isConstant())}isEquivalent(e){return e instanceof t&&oe(this.entries,e.entries)}visitExpression(e,n){return e.visitLiteralArrayExpr(this,n)}clone(){return new t(this.entries.map(e=>e.clone()),this.type,this.sourceSpan)}};var yt=class t{expression;constructor(e){this.expression=e}isEquivalent(e){return e instanceof t&&this.expression.isEquivalent(e.expression)}clone(){return new t(this.expression.clone())}isConstant(){return this.expression.isConstant()}},Ct=class t extends S{entries;valueType=null;constructor(e,n,s){super(n,s),this.entries=e,n&&(this.valueType=n.valueType)}isEquivalent(e){return e instanceof t&&oe(this.entries,e.entries)}isConstant(){return this.entries.every(e=>e.isConstant())}visitExpression(e,n){return e.visitLiteralMapExpr(this,n)}clone(){let e=this.entries.map(n=>n.clone());return new t(e,this.type,this.sourceSpan)}};var _t=class t extends S{expression;constructor(e,n){super(null,n),this.expression=e}isEquivalent(e){return e instanceof t&&this.expression.isEquivalent(e.expression)}isConstant(){return this.expression.isConstant()}visitExpression(e,n){return e.visitSpreadElementExpr(this,n)}clone(){return new t(this.expression.clone(),this.sourceSpan)}},ae;(function(t){t[t.None=0]="None",t[t.Final=1]="Final",t[t.Private=2]="Private",t[t.Exported=4]="Exported",t[t.Static=8]="Static"})(ae||(ae={}));var le=class{modifiers;sourceSpan;leadingComments;constructor(e=ae.None,n=null,s){this.modifiers=e,this.sourceSpan=n,this.leadingComments=s}hasModifier(e){return(this.modifiers&e)!==0}addLeadingComment(e){this.leadingComments=this.leadingComments??[],this.leadingComments.push(e)}},kt=class t extends le{name;value;type;constructor(e,n,s,r,i,a){super(r,i,a),this.name=e,this.value=n,this.type=s||n&&n.type||null}isEquivalent(e){return e instanceof t&&this.name===e.name&&(this.value?!!e.value&&this.value.isEquivalent(e.value):!e.value)}visitStatement(e,n){return e.visitDeclareVarStmt(this,n)}};var De=class t extends le{expr;constructor(e,n,s){super(ae.None,n,s),this.expr=e}isEquivalent(e){return e instanceof t&&this.expr.isEquivalent(e.expr)}visitStatement(e,n){return e.visitExpressionStmt(this,n)}},Be=class t extends le{value;constructor(e,n=null,s){super(ae.None,n,s),this.value=e}isEquivalent(e){return e instanceof t&&this.value.isEquivalent(e.value)}visitStatement(e,n){return e.visitReturnStmt(this,n)}},Tt=class t extends le{condition;trueCase;falseCase;constructor(e,n,s=[],r,i){super(ae.None,r,i),this.condition=e,this.trueCase=n,this.falseCase=s}isEquivalent(e){return e instanceof t&&this.condition.isEquivalent(e.condition)&&oe(this.trueCase,e.trueCase)&&oe(this.falseCase,e.falseCase)}visitStatement(e,n){return e.visitIfStmt(this,n)}};var Mn=class t{static INSTANCE=new t;keyOf(e){if(e instanceof Oe&&typeof e.value=="string")return`"${e.value}"`;if(e instanceof Oe)return String(e.value);if(e instanceof gt)return`/${e.body}/${e.flags??""}`;if(e instanceof Et){let n=[];for(let s of e.entries)n.push(this.keyOf(s));return`[${n.join(",")}]`}else if(e instanceof Ct){let n=[];for(let s of e.entries)if(s instanceof yt)n.push("..."+this.keyOf(s.expression));else{let r=s.key;s.quoted&&(r=`"${r}"`),n.push(r+":"+this.keyOf(s.value))}return`{${n.join(",")}}`}else{if(e instanceof vt)return`import("${e.value.moduleName}", ${e.value.name})`;if(e instanceof ht)return`read(${e.name})`;if(e instanceof ft)return`typeof(${this.keyOf(e.expr)})`;if(e instanceof _t)return`...${this.keyOf(e.expression)}`;throw new Error(`${this.constructor.name} does not handle expressions of type ${e.constructor.name}`)}}};var o="@angular/core",c=class{static core={name:null,moduleName:o};static namespaceHTML={name:"\u0275\u0275namespaceHTML",moduleName:o};static namespaceMathML={name:"\u0275\u0275namespaceMathML",moduleName:o};static namespaceSVG={name:"\u0275\u0275namespaceSVG",moduleName:o};static element={name:"\u0275\u0275element",moduleName:o};static elementStart={name:"\u0275\u0275elementStart",moduleName:o};static elementEnd={name:"\u0275\u0275elementEnd",moduleName:o};static domElement={name:"\u0275\u0275domElement",moduleName:o};static domElementStart={name:"\u0275\u0275domElementStart",moduleName:o};static domElementEnd={name:"\u0275\u0275domElementEnd",moduleName:o};static domElementContainer={name:"\u0275\u0275domElementContainer",moduleName:o};static domElementContainerStart={name:"\u0275\u0275domElementContainerStart",moduleName:o};static domElementContainerEnd={name:"\u0275\u0275domElementContainerEnd",moduleName:o};static domTemplate={name:"\u0275\u0275domTemplate",moduleName:o};static domListener={name:"\u0275\u0275domListener",moduleName:o};static advance={name:"\u0275\u0275advance",moduleName:o};static syntheticHostProperty={name:"\u0275\u0275syntheticHostProperty",moduleName:o};static syntheticHostListener={name:"\u0275\u0275syntheticHostListener",moduleName:o};static attribute={name:"\u0275\u0275attribute",moduleName:o};static classProp={name:"\u0275\u0275classProp",moduleName:o};static elementContainerStart={name:"\u0275\u0275elementContainerStart",moduleName:o};static elementContainerEnd={name:"\u0275\u0275elementContainerEnd",moduleName:o};static elementContainer={name:"\u0275\u0275elementContainer",moduleName:o};static styleMap={name:"\u0275\u0275styleMap",moduleName:o};static classMap={name:"\u0275\u0275classMap",moduleName:o};static styleProp={name:"\u0275\u0275styleProp",moduleName:o};static interpolate={name:"\u0275\u0275interpolate",moduleName:o};static interpolate1={name:"\u0275\u0275interpolate1",moduleName:o};static interpolate2={name:"\u0275\u0275interpolate2",moduleName:o};static interpolate3={name:"\u0275\u0275interpolate3",moduleName:o};static interpolate4={name:"\u0275\u0275interpolate4",moduleName:o};static interpolate5={name:"\u0275\u0275interpolate5",moduleName:o};static interpolate6={name:"\u0275\u0275interpolate6",moduleName:o};static interpolate7={name:"\u0275\u0275interpolate7",moduleName:o};static interpolate8={name:"\u0275\u0275interpolate8",moduleName:o};static interpolateV={name:"\u0275\u0275interpolateV",moduleName:o};static nextContext={name:"\u0275\u0275nextContext",moduleName:o};static resetView={name:"\u0275\u0275resetView",moduleName:o};static templateCreate={name:"\u0275\u0275template",moduleName:o};static defer={name:"\u0275\u0275defer",moduleName:o};static deferWhen={name:"\u0275\u0275deferWhen",moduleName:o};static deferOnIdle={name:"\u0275\u0275deferOnIdle",moduleName:o};static deferOnImmediate={name:"\u0275\u0275deferOnImmediate",moduleName:o};static deferOnTimer={name:"\u0275\u0275deferOnTimer",moduleName:o};static deferOnHover={name:"\u0275\u0275deferOnHover",moduleName:o};static deferOnInteraction={name:"\u0275\u0275deferOnInteraction",moduleName:o};static deferOnViewport={name:"\u0275\u0275deferOnViewport",moduleName:o};static deferPrefetchWhen={name:"\u0275\u0275deferPrefetchWhen",moduleName:o};static deferPrefetchOnIdle={name:"\u0275\u0275deferPrefetchOnIdle",moduleName:o};static deferPrefetchOnImmediate={name:"\u0275\u0275deferPrefetchOnImmediate",moduleName:o};static deferPrefetchOnTimer={name:"\u0275\u0275deferPrefetchOnTimer",moduleName:o};static deferPrefetchOnHover={name:"\u0275\u0275deferPrefetchOnHover",moduleName:o};static deferPrefetchOnInteraction={name:"\u0275\u0275deferPrefetchOnInteraction",moduleName:o};static deferPrefetchOnViewport={name:"\u0275\u0275deferPrefetchOnViewport",moduleName:o};static deferHydrateWhen={name:"\u0275\u0275deferHydrateWhen",moduleName:o};static deferHydrateNever={name:"\u0275\u0275deferHydrateNever",moduleName:o};static deferHydrateOnIdle={name:"\u0275\u0275deferHydrateOnIdle",moduleName:o};static deferHydrateOnImmediate={name:"\u0275\u0275deferHydrateOnImmediate",moduleName:o};static deferHydrateOnTimer={name:"\u0275\u0275deferHydrateOnTimer",moduleName:o};static deferHydrateOnHover={name:"\u0275\u0275deferHydrateOnHover",moduleName:o};static deferHydrateOnInteraction={name:"\u0275\u0275deferHydrateOnInteraction",moduleName:o};static deferHydrateOnViewport={name:"\u0275\u0275deferHydrateOnViewport",moduleName:o};static deferEnableTimerScheduling={name:"\u0275\u0275deferEnableTimerScheduling",moduleName:o};static conditionalCreate={name:"\u0275\u0275conditionalCreate",moduleName:o};static conditionalBranchCreate={name:"\u0275\u0275conditionalBranchCreate",moduleName:o};static conditional={name:"\u0275\u0275conditional",moduleName:o};static repeater={name:"\u0275\u0275repeater",moduleName:o};static repeaterCreate={name:"\u0275\u0275repeaterCreate",moduleName:o};static repeaterTrackByIndex={name:"\u0275\u0275repeaterTrackByIndex",moduleName:o};static repeaterTrackByIdentity={name:"\u0275\u0275repeaterTrackByIdentity",moduleName:o};static componentInstance={name:"\u0275\u0275componentInstance",moduleName:o};static text={name:"\u0275\u0275text",moduleName:o};static enableBindings={name:"\u0275\u0275enableBindings",moduleName:o};static disableBindings={name:"\u0275\u0275disableBindings",moduleName:o};static getCurrentView={name:"\u0275\u0275getCurrentView",moduleName:o};static textInterpolate={name:"\u0275\u0275textInterpolate",moduleName:o};static textInterpolate1={name:"\u0275\u0275textInterpolate1",moduleName:o};static textInterpolate2={name:"\u0275\u0275textInterpolate2",moduleName:o};static textInterpolate3={name:"\u0275\u0275textInterpolate3",moduleName:o};static textInterpolate4={name:"\u0275\u0275textInterpolate4",moduleName:o};static textInterpolate5={name:"\u0275\u0275textInterpolate5",moduleName:o};static textInterpolate6={name:"\u0275\u0275textInterpolate6",moduleName:o};static textInterpolate7={name:"\u0275\u0275textInterpolate7",moduleName:o};static textInterpolate8={name:"\u0275\u0275textInterpolate8",moduleName:o};static textInterpolateV={name:"\u0275\u0275textInterpolateV",moduleName:o};static restoreView={name:"\u0275\u0275restoreView",moduleName:o};static pureFunction0={name:"\u0275\u0275pureFunction0",moduleName:o};static pureFunction1={name:"\u0275\u0275pureFunction1",moduleName:o};static pureFunction2={name:"\u0275\u0275pureFunction2",moduleName:o};static pureFunction3={name:"\u0275\u0275pureFunction3",moduleName:o};static pureFunction4={name:"\u0275\u0275pureFunction4",moduleName:o};static pureFunction5={name:"\u0275\u0275pureFunction5",moduleName:o};static pureFunction6={name:"\u0275\u0275pureFunction6",moduleName:o};static pureFunction7={name:"\u0275\u0275pureFunction7",moduleName:o};static pureFunction8={name:"\u0275\u0275pureFunction8",moduleName:o};static pureFunctionV={name:"\u0275\u0275pureFunctionV",moduleName:o};static pipeBind1={name:"\u0275\u0275pipeBind1",moduleName:o};static pipeBind2={name:"\u0275\u0275pipeBind2",moduleName:o};static pipeBind3={name:"\u0275\u0275pipeBind3",moduleName:o};static pipeBind4={name:"\u0275\u0275pipeBind4",moduleName:o};static pipeBindV={name:"\u0275\u0275pipeBindV",moduleName:o};static domProperty={name:"\u0275\u0275domProperty",moduleName:o};static ariaProperty={name:"\u0275\u0275ariaProperty",moduleName:o};static property={name:"\u0275\u0275property",moduleName:o};static control={name:"\u0275\u0275control",moduleName:o};static controlCreate={name:"\u0275\u0275controlCreate",moduleName:o};static animationEnterListener={name:"\u0275\u0275animateEnterListener",moduleName:o};static animationLeaveListener={name:"\u0275\u0275animateLeaveListener",moduleName:o};static animationEnter={name:"\u0275\u0275animateEnter",moduleName:o};static animationLeave={name:"\u0275\u0275animateLeave",moduleName:o};static i18n={name:"\u0275\u0275i18n",moduleName:o};static i18nAttributes={name:"\u0275\u0275i18nAttributes",moduleName:o};static i18nExp={name:"\u0275\u0275i18nExp",moduleName:o};static i18nStart={name:"\u0275\u0275i18nStart",moduleName:o};static i18nEnd={name:"\u0275\u0275i18nEnd",moduleName:o};static i18nApply={name:"\u0275\u0275i18nApply",moduleName:o};static i18nPostprocess={name:"\u0275\u0275i18nPostprocess",moduleName:o};static pipe={name:"\u0275\u0275pipe",moduleName:o};static projection={name:"\u0275\u0275projection",moduleName:o};static projectionDef={name:"\u0275\u0275projectionDef",moduleName:o};static reference={name:"\u0275\u0275reference",moduleName:o};static inject={name:"\u0275\u0275inject",moduleName:o};static injectAttribute={name:"\u0275\u0275injectAttribute",moduleName:o};static directiveInject={name:"\u0275\u0275directiveInject",moduleName:o};static invalidFactory={name:"\u0275\u0275invalidFactory",moduleName:o};static invalidFactoryDep={name:"\u0275\u0275invalidFactoryDep",moduleName:o};static templateRefExtractor={name:"\u0275\u0275templateRefExtractor",moduleName:o};static forwardRef={name:"forwardRef",moduleName:o};static resolveForwardRef={name:"resolveForwardRef",moduleName:o};static replaceMetadata={name:"\u0275\u0275replaceMetadata",moduleName:o};static getReplaceMetadataURL={name:"\u0275\u0275getReplaceMetadataURL",moduleName:o};static \u0275\u0275defineInjectable={name:"\u0275\u0275defineInjectable",moduleName:o};static declareInjectable={name:"\u0275\u0275ngDeclareInjectable",moduleName:o};static InjectableDeclaration={name:"\u0275\u0275InjectableDeclaration",moduleName:o};static resolveWindow={name:"\u0275\u0275resolveWindow",moduleName:o};static resolveDocument={name:"\u0275\u0275resolveDocument",moduleName:o};static resolveBody={name:"\u0275\u0275resolveBody",moduleName:o};static getComponentDepsFactory={name:"\u0275\u0275getComponentDepsFactory",moduleName:o};static defineComponent={name:"\u0275\u0275defineComponent",moduleName:o};static declareComponent={name:"\u0275\u0275ngDeclareComponent",moduleName:o};static setComponentScope={name:"\u0275\u0275setComponentScope",moduleName:o};static ChangeDetectionStrategy={name:"ChangeDetectionStrategy",moduleName:o};static ViewEncapsulation={name:"ViewEncapsulation",moduleName:o};static ComponentDeclaration={name:"\u0275\u0275ComponentDeclaration",moduleName:o};static FactoryDeclaration={name:"\u0275\u0275FactoryDeclaration",moduleName:o};static declareFactory={name:"\u0275\u0275ngDeclareFactory",moduleName:o};static FactoryTarget={name:"\u0275\u0275FactoryTarget",moduleName:o};static defineDirective={name:"\u0275\u0275defineDirective",moduleName:o};static declareDirective={name:"\u0275\u0275ngDeclareDirective",moduleName:o};static DirectiveDeclaration={name:"\u0275\u0275DirectiveDeclaration",moduleName:o};static InjectorDef={name:"\u0275\u0275InjectorDef",moduleName:o};static InjectorDeclaration={name:"\u0275\u0275InjectorDeclaration",moduleName:o};static defineInjector={name:"\u0275\u0275defineInjector",moduleName:o};static declareInjector={name:"\u0275\u0275ngDeclareInjector",moduleName:o};static NgModuleDeclaration={name:"\u0275\u0275NgModuleDeclaration",moduleName:o};static ModuleWithProviders={name:"ModuleWithProviders",moduleName:o};static defineNgModule={name:"\u0275\u0275defineNgModule",moduleName:o};static declareNgModule={name:"\u0275\u0275ngDeclareNgModule",moduleName:o};static setNgModuleScope={name:"\u0275\u0275setNgModuleScope",moduleName:o};static registerNgModuleType={name:"\u0275\u0275registerNgModuleType",moduleName:o};static PipeDeclaration={name:"\u0275\u0275PipeDeclaration",moduleName:o};static definePipe={name:"\u0275\u0275definePipe",moduleName:o};static declarePipe={name:"\u0275\u0275ngDeclarePipe",moduleName:o};static declareClassMetadata={name:"\u0275\u0275ngDeclareClassMetadata",moduleName:o};static declareClassMetadataAsync={name:"\u0275\u0275ngDeclareClassMetadataAsync",moduleName:o};static setClassMetadata={name:"\u0275setClassMetadata",moduleName:o};static setClassMetadataAsync={name:"\u0275setClassMetadataAsync",moduleName:o};static setClassDebugInfo={name:"\u0275setClassDebugInfo",moduleName:o};static queryRefresh={name:"\u0275\u0275queryRefresh",moduleName:o};static viewQuery={name:"\u0275\u0275viewQuery",moduleName:o};static loadQuery={name:"\u0275\u0275loadQuery",moduleName:o};static contentQuery={name:"\u0275\u0275contentQuery",moduleName:o};static viewQuerySignal={name:"\u0275\u0275viewQuerySignal",moduleName:o};static contentQuerySignal={name:"\u0275\u0275contentQuerySignal",moduleName:o};static queryAdvance={name:"\u0275\u0275queryAdvance",moduleName:o};static twoWayProperty={name:"\u0275\u0275twoWayProperty",moduleName:o};static twoWayBindingSet={name:"\u0275\u0275twoWayBindingSet",moduleName:o};static twoWayListener={name:"\u0275\u0275twoWayListener",moduleName:o};static declareLet={name:"\u0275\u0275declareLet",moduleName:o};static storeLet={name:"\u0275\u0275storeLet",moduleName:o};static readContextLet={name:"\u0275\u0275readContextLet",moduleName:o};static arrowFunction={name:"\u0275\u0275arrowFunction",moduleName:o};static attachSourceLocations={name:"\u0275\u0275attachSourceLocations",moduleName:o};static NgOnChangesFeature={name:"\u0275\u0275NgOnChangesFeature",moduleName:o};static ControlFeature={name:"\u0275\u0275ControlFeature",moduleName:o};static InheritDefinitionFeature={name:"\u0275\u0275InheritDefinitionFeature",moduleName:o};static ProvidersFeature={name:"\u0275\u0275ProvidersFeature",moduleName:o};static HostDirectivesFeature={name:"\u0275\u0275HostDirectivesFeature",moduleName:o};static ExternalStylesFeature={name:"\u0275\u0275ExternalStylesFeature",moduleName:o};static listener={name:"\u0275\u0275listener",moduleName:o};static getInheritedFactory={name:"\u0275\u0275getInheritedFactory",moduleName:o};static sanitizeHtml={name:"\u0275\u0275sanitizeHtml",moduleName:o};static sanitizeStyle={name:"\u0275\u0275sanitizeStyle",moduleName:o};static validateAttribute={name:"\u0275\u0275validateAttribute",moduleName:o};static sanitizeResourceUrl={name:"\u0275\u0275sanitizeResourceUrl",moduleName:o};static sanitizeScript={name:"\u0275\u0275sanitizeScript",moduleName:o};static sanitizeUrl={name:"\u0275\u0275sanitizeUrl",moduleName:o};static sanitizeUrlOrResourceUrl={name:"\u0275\u0275sanitizeUrlOrResourceUrl",moduleName:o};static trustConstantHtml={name:"\u0275\u0275trustConstantHtml",moduleName:o};static trustConstantResourceUrl={name:"\u0275\u0275trustConstantResourceUrl",moduleName:o};static inputDecorator={name:"Input",moduleName:o};static outputDecorator={name:"Output",moduleName:o};static viewChildDecorator={name:"ViewChild",moduleName:o};static viewChildrenDecorator={name:"ViewChildren",moduleName:o};static contentChildDecorator={name:"ContentChild",moduleName:o};static contentChildrenDecorator={name:"ContentChildren",moduleName:o};static InputSignalBrandWriteType={name:"\u0275INPUT_SIGNAL_BRAND_WRITE_TYPE",moduleName:o};static UnwrapDirectiveSignalInputs={name:"\u0275UnwrapDirectiveSignalInputs",moduleName:o};static unwrapWritableSignal={name:"\u0275unwrapWritableSignal",moduleName:o};static assertType={name:"\u0275assertType",moduleName:o}};var bt=class{full;major;minor;patch;constructor(e){this.full=e;let n=e.split(".");this.major=n[0],this.minor=n[1],this.patch=n.slice(2).join(".")}};var uo=new Map([[u.And,"&&"],[u.Bigger,">"],[u.BiggerEquals,">="],[u.BitwiseOr,"|"],[u.BitwiseAnd,"&"],[u.Divide,"/"],[u.Assign,"="],[u.Equals,"=="],[u.Identical,"==="],[u.Lower,"<"],[u.LowerEquals,"<="],[u.Minus,"-"],[u.Modulo,"%"],[u.Exponentiation,"**"],[u.Multiply,"*"],[u.NotEquals,"!="],[u.NotIdentical,"!=="],[u.NullishCoalesce,"??"],[u.Or,"||"],[u.Plus,"+"],[u.In,"in"],[u.InstanceOf,"instanceof"],[u.AdditionAssignment,"+="],[u.SubtractionAssignment,"-="],[u.MultiplicationAssignment,"*="],[u.DivisionAssignment,"/="],[u.RemainderAssignment,"%="],[u.ExponentiationAssignment,"**="],[u.AndAssignment,"&&="],[u.OrAssignment,"||="],[u.NullishCoalesceAssignment,"??="]]);var Rn;(function(t){t[t.Class=0]="Class",t[t.Function=1]="Function"})(Rn||(Rn={}));var K=class{start;end;constructor(e,n){this.start=e,this.end=n}toAbsolute(e){return new O(e+this.start,e+this.end)}},g=class{span;sourceSpan;constructor(e,n){this.span=e,this.sourceSpan=n}toString(){return"AST"}},Ae=class extends g{nameSpan;constructor(e,n,s){super(e,n),this.nameSpan=s}},A=class extends g{visit(e,n=null){return e.visitEmptyExpr?.(this,n)}},ce=class extends g{visit(e,n=null){return e.visitImplicitReceiver(this,n)}},At=class extends g{visit(e,n=null){return e.visitThisReceiver?.(this,n)}},It=class extends g{expressions;constructor(e,n,s){super(e,n),this.expressions=s}visit(e,n=null){return e.visitChain(this,n)}},Nt=class extends g{condition;trueExp;falseExp;constructor(e,n,s,r,i){super(e,n),this.condition=s,this.trueExp=r,this.falseExp=i}visit(e,n=null){return e.visitConditional(this,n)}},ye=class extends Ae{receiver;name;constructor(e,n,s,r,i){super(e,n,s),this.receiver=r,this.name=i}visit(e,n=null){return e.visitPropertyRead(this,n)}},Pt=class extends Ae{receiver;name;constructor(e,n,s,r,i){super(e,n,s),this.receiver=r,this.name=i}visit(e,n=null){return e.visitSafePropertyRead(this,n)}},Fe=class extends g{receiver;key;constructor(e,n,s,r){super(e,n),this.receiver=s,this.key=r}visit(e,n=null){return e.visitKeyedRead(this,n)}},Lt=class extends g{receiver;key;constructor(e,n,s,r){super(e,n),this.receiver=s,this.key=r}visit(e,n=null){return e.visitSafeKeyedRead(this,n)}},Ce;(function(t){t[t.ReferencedByName=0]="ReferencedByName",t[t.ReferencedDirectly=1]="ReferencedDirectly"})(Ce||(Ce={}));var Mt=class extends Ae{exp;name;args;type;constructor(e,n,s,r,i,a,p){super(e,n,p),this.exp=s,this.name=r,this.args=i,this.type=a}visit(e,n=null){return e.visitPipe(this,n)}},I=class extends g{value;constructor(e,n,s){super(e,n),this.value=s}visit(e,n=null){return e.visitLiteralPrimitive(this,n)}},Rt=class extends g{expressions;constructor(e,n,s){super(e,n),this.expressions=s}visit(e,n=null){return e.visitLiteralArray(this,n)}},$t=class extends g{expression;constructor(e,n,s){super(e,n),this.expression=s}visit(e,n=null){return e.visitSpreadElement(this,n)}},Ot=class extends g{keys;values;constructor(e,n,s,r){super(e,n),this.keys=s,this.values=r}visit(e,n=null){return e.visitLiteralMap(this,n)}},Hr=class extends g{strings;expressions;constructor(e,n,s,r){super(e,n),this.strings=s,this.expressions=r}visit(e,n=null){return e.visitInterpolation(this,n)}},E=class extends g{operation;left;right;constructor(e,n,s,r,i){super(e,n),this.operation=s,this.left=r,this.right=i}visit(e,n=null){return e.visitBinary(this,n)}static isAssignmentOperation(e){return e==="="||e==="+="||e==="-="||e==="*="||e==="/="||e==="%="||e==="**="||e==="&&="||e==="||="||e==="??="}},_e=class t extends E{operator;expr;left=null;right=null;operation=null;static createMinus(e,n,s){return new t(e,n,"-",s,"-",new I(e,n,0),s)}static createPlus(e,n,s){return new t(e,n,"+",s,"-",s,new I(e,n,0))}constructor(e,n,s,r,i,a,p){super(e,n,i,a,p),this.operator=s,this.expr=r}visit(e,n=null){return e.visitUnary!==void 0?e.visitUnary(this,n):e.visitBinary(this,n)}},Ve=class extends g{expression;constructor(e,n,s){super(e,n),this.expression=s}visit(e,n=null){return e.visitPrefixNot(this,n)}},Ue=class extends g{expression;constructor(e,n,s){super(e,n),this.expression=s}visit(e,n=null){return e.visitTypeofExpression(this,n)}},He=class extends g{expression;constructor(e,n,s){super(e,n),this.expression=s}visit(e,n=null){return e.visitVoidExpression(this,n)}},Dt=class extends g{expression;constructor(e,n,s){super(e,n),this.expression=s}visit(e,n=null){return e.visitNonNullAssert(this,n)}},Bt=class extends g{receiver;args;argumentSpan;constructor(e,n,s,r,i){super(e,n),this.receiver=s,this.args=r,this.argumentSpan=i}visit(e,n=null){return e.visitCall(this,n)}},Ft=class extends g{receiver;args;argumentSpan;constructor(e,n,s,r,i){super(e,n),this.receiver=s,this.args=r,this.argumentSpan=i}visit(e,n=null){return e.visitSafeCall(this,n)}},We=class extends g{tag;template;constructor(e,n,s,r){super(e,n),this.tag=s,this.template=r}visit(e,n){return e.visitTaggedTemplateLiteral(this,n)}},qe=class extends g{elements;expressions;constructor(e,n,s,r){super(e,n),this.elements=s,this.expressions=r}visit(e,n){return e.visitTemplateLiteral(this,n)}},je=class extends g{text;constructor(e,n,s){super(e,n),this.text=s}visit(e,n){return e.visitTemplateLiteralElement(this,n)}},Ie=class extends g{expression;constructor(e,n,s){super(e,n),this.expression=s}visit(e,n){return e.visitParenthesizedExpression(this,n)}},Vt=class{name;span;sourceSpan;constructor(e,n,s){this.name=e,this.span=n,this.sourceSpan=s}},Ut=class extends g{parameters;body;constructor(e,n,s,r){super(e,n),this.parameters=s,this.body=r}visit(e,n){return e.visitArrowFunction(this,n)}},Ht=class extends g{body;flags;constructor(e,n,s,r){super(e,n),this.body=s,this.flags=r}visit(e,n){return e.visitRegularExpressionLiteral(this,n)}},O=class{start;end;constructor(e,n){this.start=e,this.end=n}},U=class extends g{ast;source;location;errors;constructor(e,n,s,r,i){super(new K(0,n===null?0:n.length),new O(r,n===null?r:r+n.length)),this.ast=e,this.source=n,this.location=s,this.errors=i}visit(e,n=null){return e.visitASTWithSource?e.visitASTWithSource(this,n):this.ast.visit(e,n)}toString(){return`${this.source} in ${this.location}`}},ue=class{sourceSpan;key;value;constructor(e,n,s){this.sourceSpan=e,this.key=n,this.value=s}},Ne=class{sourceSpan;key;value;constructor(e,n,s){this.sourceSpan=e,this.key=n,this.value=s}},Wt=class{visit(e,n){e.visit(this,n)}visitUnary(e,n){this.visit(e.expr,n)}visitBinary(e,n){this.visit(e.left,n),this.visit(e.right,n)}visitChain(e,n){this.visitAll(e.expressions,n)}visitConditional(e,n){this.visit(e.condition,n),this.visit(e.trueExp,n),this.visit(e.falseExp,n)}visitPipe(e,n){this.visit(e.exp,n),this.visitAll(e.args,n)}visitImplicitReceiver(e,n){}visitThisReceiver(e,n){}visitInterpolation(e,n){this.visitAll(e.expressions,n)}visitKeyedRead(e,n){this.visit(e.receiver,n),this.visit(e.key,n)}visitLiteralArray(e,n){this.visitAll(e.expressions,n)}visitLiteralMap(e,n){this.visitAll(e.values,n)}visitLiteralPrimitive(e,n){}visitPrefixNot(e,n){this.visit(e.expression,n)}visitTypeofExpression(e,n){this.visit(e.expression,n)}visitVoidExpression(e,n){this.visit(e.expression,n)}visitNonNullAssert(e,n){this.visit(e.expression,n)}visitPropertyRead(e,n){this.visit(e.receiver,n)}visitSafePropertyRead(e,n){this.visit(e.receiver,n)}visitSafeKeyedRead(e,n){this.visit(e.receiver,n),this.visit(e.key,n)}visitCall(e,n){this.visit(e.receiver,n),this.visitAll(e.args,n)}visitSafeCall(e,n){this.visit(e.receiver,n),this.visitAll(e.args,n)}visitTemplateLiteral(e,n){for(let s=0;s<e.elements.length;s++){this.visit(e.elements[s],n);let r=s<e.expressions.length?e.expressions[s]:null;r!==null&&this.visit(r,n)}}visitTemplateLiteralElement(e,n){}visitTaggedTemplateLiteral(e,n){this.visit(e.tag,n),this.visit(e.template,n)}visitParenthesizedExpression(e,n){this.visit(e.expression,n)}visitArrowFunction(e,n){this.visit(e.body,n)}visitRegularExpressionLiteral(e,n){}visitSpreadElement(e,n){this.visit(e.expression,n)}visitEmptyExpr(e,n){}visitAll(e,n){for(let s of e)this.visit(s,n)}};var $n;(function(t){t[t.DEFAULT=0]="DEFAULT",t[t.LITERAL_ATTR=1]="LITERAL_ATTR",t[t.LEGACY_ANIMATION=2]="LEGACY_ANIMATION",t[t.TWO_WAY=3]="TWO_WAY",t[t.ANIMATION=4]="ANIMATION"})($n||($n={}));var On;(function(t){t[t.Regular=0]="Regular",t[t.LegacyAnimation=1]="LegacyAnimation",t[t.TwoWay=2]="TwoWay",t[t.Animation=3]="Animation"})(On||(On={}));var M;(function(t){t[t.Property=0]="Property",t[t.Attribute=1]="Attribute",t[t.Class=2]="Class",t[t.Style=3]="Style",t[t.LegacyAnimation=4]="LegacyAnimation",t[t.TwoWay=5]="TwoWay",t[t.Animation=6]="Animation"})(M||(M={}));var Dn;(function(t){t[t.RAW_TEXT=0]="RAW_TEXT",t[t.ESCAPABLE_RAW_TEXT=1]="ESCAPABLE_RAW_TEXT",t[t.PARSABLE_DATA=2]="PARSABLE_DATA"})(Dn||(Dn={}));var Wr="ctx";var we=0;var vs=9,$e=10,qr=11,jr=12,zr=13,ws=32,Gr=33,xs=34,Xr=35,Zt=36,Jr=37,Bn=38,Ss=39,X=40,N=41,Fn=42,Es=43,F=44,ys=45,z=46,ze=47,J=58,Ee=59,Yr=60,y=61,Vn=62,Un=63,Qr=48;var Kr=57,en=65,Zr=69;var tn=90,ie=91,ut=92,Q=93,ei=94,Ze=95,Cs=97;var ti=101,ni=102,si=110,ri=114,ii=116,oi=117,ai=118;var _s=122,ke=123,Hn=124,ne=125,ks=160;var qt=96;function li(t){return t>=vs&&t<=ws||t==ks}function G(t){return Qr<=t&&t<=Kr}function jt(t){return t>=Cs&&t<=_s||t>=en&&t<=tn}function Wn(t){return t===Ss||t===xs||t===qt}var Ge=class t{file;offset;line;col;constructor(e,n,s,r){this.file=e,this.offset=n,this.line=s,this.col=r}toString(){return this.offset!=null?`${this.file.url}@${this.line}:${this.col}`:this.file.url}moveBy(e){let n=this.file.content,s=n.length,r=this.offset,i=this.line,a=this.col;for(;r>0&&e<0;)if(r--,e++,n.charCodeAt(r)==$e){i--;let h=n.substring(0,r-1).lastIndexOf(String.fromCharCode($e));a=h>0?r-h:r}else a--;for(;r<s&&e>0;){let p=n.charCodeAt(r);r++,e--,p==$e?(i++,a=0):a++}return new t(this.file,r,i,a)}getContext(e,n){let s=this.file.content,r=this.offset;if(r!=null){r>s.length-1&&(r=s.length-1);let i=r,a=0,p=0;for(;a<e&&r>0&&(r--,a++,!(s[r]==`
2
+ `&&++p==n)););for(a=0,p=0;a<e&&i<s.length-1&&(i++,a++,!(s[i]==`
3
+ `&&++p==n)););return{before:s.substring(r,this.offset),after:s.substring(this.offset,i+1)}}return null}},Xe=class{content;url;constructor(e,n){this.content=e,this.url=n}},Je=class{start;end;fullStart;details;constructor(e,n,s=e,r=null){this.start=e,this.end=n,this.fullStart=s,this.details=r}toString(){return this.start.file.content.substring(this.start.offset,this.end.offset)}},Ye;(function(t){t[t.WARNING=0]="WARNING",t[t.ERROR=1]="ERROR"})(Ye||(Ye={}));var Pe=class extends Error{span;msg;level;relatedError;constructor(e,n,s=Ye.ERROR,r){super(n),this.span=e,this.msg=n,this.level=s,this.relatedError=r,Object.setPrototypeOf(this,new.target.prototype)}contextualMessage(){let e=this.span.start.getContext(100,3);return e?`${this.msg} ("${e.before}[${Ye[this.level]} ->]${e.after}")`:this.msg}toString(){let e=this.span.details?`, ${this.span.details}`:"";return`${this.contextualMessage()}: ${this.span.start}${e}`}};var qn;(function(t){t[t.Inline=0]="Inline",t[t.SideEffect=1]="SideEffect",t[t.Omit=2]="Omit"})(qn||(qn={}));var jn;(function(t){t[t.Global=0]="Global",t[t.Local=1]="Local"})(jn||(jn={}));var zn;(function(t){t[t.Directive=0]="Directive",t[t.Pipe=1]="Pipe",t[t.NgModule=2]="NgModule"})(zn||(zn={}));var ci="(:(where|is)\\()?";var Ts="-shadowcsshost",ui="-shadowcsscontext",zt="[^)(]*",pi=`(?:\\(${zt}\\)|${zt})+?`,hi=`(?:\\(${pi}\\)|${zt})+?`,nn=`(?:\\((${hi})\\))`,fo=new RegExp("(:nth-[-\\w]+)"+nn,"g"),mo=new RegExp(Ts+nn+"?([^,{]*)","gim"),fi=ui+nn+"?([^{]*)",go=new RegExp(`${ci}(${fi})`,"gim"),di=Ts+"-no-combinator",vo=new RegExp(`${di}(?![^(]*\\))`,"g");var bs="%COMMENT%",wo=new RegExp(bs,"g");var xo=new RegExp(`(\\s*(?:${bs}\\s*)*)([^;\\{\\}]+?)(\\s*)((?:{%BLOCK%}?\\s*;?)|(?:\\s*;))`,"g");var mi="%COMMA_IN_PLACEHOLDER%",gi="%SEMI_IN_PLACEHOLDER%",vi="%COLON_IN_PLACEHOLDER%",So=new RegExp(mi,"g"),Eo=new RegExp(gi,"g"),yo=new RegExp(vi,"g");var l;(function(t){t[t.ListEnd=0]="ListEnd",t[t.Statement=1]="Statement",t[t.Variable=2]="Variable",t[t.ElementStart=3]="ElementStart",t[t.Element=4]="Element",t[t.Template=5]="Template",t[t.ElementEnd=6]="ElementEnd",t[t.ContainerStart=7]="ContainerStart",t[t.Container=8]="Container",t[t.ContainerEnd=9]="ContainerEnd",t[t.DisableBindings=10]="DisableBindings",t[t.ConditionalCreate=11]="ConditionalCreate",t[t.ConditionalBranchCreate=12]="ConditionalBranchCreate",t[t.Conditional=13]="Conditional",t[t.EnableBindings=14]="EnableBindings",t[t.Text=15]="Text",t[t.Listener=16]="Listener",t[t.InterpolateText=17]="InterpolateText",t[t.Binding=18]="Binding",t[t.Property=19]="Property",t[t.StyleProp=20]="StyleProp",t[t.ClassProp=21]="ClassProp",t[t.StyleMap=22]="StyleMap",t[t.ClassMap=23]="ClassMap",t[t.Advance=24]="Advance",t[t.Pipe=25]="Pipe",t[t.Attribute=26]="Attribute",t[t.ExtractedAttribute=27]="ExtractedAttribute",t[t.Defer=28]="Defer",t[t.DeferOn=29]="DeferOn",t[t.DeferWhen=30]="DeferWhen",t[t.I18nMessage=31]="I18nMessage",t[t.DomProperty=32]="DomProperty",t[t.Namespace=33]="Namespace",t[t.ProjectionDef=34]="ProjectionDef",t[t.Projection=35]="Projection",t[t.RepeaterCreate=36]="RepeaterCreate",t[t.Repeater=37]="Repeater",t[t.TwoWayProperty=38]="TwoWayProperty",t[t.TwoWayListener=39]="TwoWayListener",t[t.DeclareLet=40]="DeclareLet",t[t.StoreLet=41]="StoreLet",t[t.I18nStart=42]="I18nStart",t[t.I18n=43]="I18n",t[t.I18nEnd=44]="I18nEnd",t[t.I18nExpression=45]="I18nExpression",t[t.I18nApply=46]="I18nApply",t[t.IcuStart=47]="IcuStart",t[t.IcuEnd=48]="IcuEnd",t[t.IcuPlaceholder=49]="IcuPlaceholder",t[t.I18nContext=50]="I18nContext",t[t.I18nAttributes=51]="I18nAttributes",t[t.SourceLocation=52]="SourceLocation",t[t.Animation=53]="Animation",t[t.AnimationString=54]="AnimationString",t[t.AnimationBinding=55]="AnimationBinding",t[t.AnimationListener=56]="AnimationListener",t[t.Control=57]="Control",t[t.ControlCreate=58]="ControlCreate"})(l||(l={}));var Z;(function(t){t[t.LexicalRead=0]="LexicalRead",t[t.Context=1]="Context",t[t.TrackContext=2]="TrackContext",t[t.ReadVariable=3]="ReadVariable",t[t.NextContext=4]="NextContext",t[t.Reference=5]="Reference",t[t.StoreLet=6]="StoreLet",t[t.ContextLetReference=7]="ContextLetReference",t[t.GetCurrentView=8]="GetCurrentView",t[t.RestoreView=9]="RestoreView",t[t.ResetView=10]="ResetView",t[t.PureFunctionExpr=11]="PureFunctionExpr",t[t.PureFunctionParameterExpr=12]="PureFunctionParameterExpr",t[t.PipeBinding=13]="PipeBinding",t[t.PipeBindingVariadic=14]="PipeBindingVariadic",t[t.SafePropertyRead=15]="SafePropertyRead",t[t.SafeKeyedRead=16]="SafeKeyedRead",t[t.SafeInvokeFunction=17]="SafeInvokeFunction",t[t.SafeTernaryExpr=18]="SafeTernaryExpr",t[t.EmptyExpr=19]="EmptyExpr",t[t.AssignTemporaryExpr=20]="AssignTemporaryExpr",t[t.ReadTemporaryExpr=21]="ReadTemporaryExpr",t[t.SlotLiteralExpr=22]="SlotLiteralExpr",t[t.ConditionalCase=23]="ConditionalCase",t[t.ConstCollected=24]="ConstCollected",t[t.TwoWayBindingSet=25]="TwoWayBindingSet",t[t.ArrowFunction=26]="ArrowFunction"})(Z||(Z={}));var Gn;(function(t){t[t.None=0]="None",t[t.AlwaysInline=1]="AlwaysInline"})(Gn||(Gn={}));var Xn;(function(t){t[t.Context=0]="Context",t[t.Identifier=1]="Identifier",t[t.SavedView=2]="SavedView",t[t.Alias=3]="Alias"})(Xn||(Xn={}));var R;(function(t){t[t.Attribute=0]="Attribute",t[t.ClassName=1]="ClassName",t[t.StyleProperty=2]="StyleProperty",t[t.Property=3]="Property",t[t.Template=4]="Template",t[t.I18n=5]="I18n",t[t.LegacyAnimation=6]="LegacyAnimation",t[t.TwoWayProperty=7]="TwoWayProperty",t[t.Animation=8]="Animation"})(R||(R={}));var Jn;(function(t){t[t.Creation=0]="Creation",t[t.Postproccessing=1]="Postproccessing"})(Jn||(Jn={}));var Yn;(function(t){t[t.I18nText=0]="I18nText",t[t.I18nAttribute=1]="I18nAttribute"})(Yn||(Yn={}));var Qn;(function(t){t[t.None=0]="None",t[t.ElementTag=1]="ElementTag",t[t.TemplateTag=2]="TemplateTag",t[t.OpenTag=4]="OpenTag",t[t.CloseTag=8]="CloseTag",t[t.ExpressionIndex=16]="ExpressionIndex"})(Qn||(Qn={}));var Kn;(function(t){t[t.HTML=0]="HTML",t[t.SVG=1]="SVG",t[t.Math=2]="Math"})(Kn||(Kn={}));var $;(function(t){t[t.Idle=0]="Idle",t[t.Immediate=1]="Immediate",t[t.Timer=2]="Timer",t[t.Hover=3]="Hover",t[t.Interaction=4]="Interaction",t[t.Viewport=5]="Viewport",t[t.Never=6]="Never"})($||($={}));var Zn;(function(t){t[t.RootI18n=0]="RootI18n",t[t.Icu=1]="Icu",t[t.Attr=2]="Attr"})(Zn||(Zn={}));var es;(function(t){t[t.NgTemplate=0]="NgTemplate",t[t.Structural=1]="Structural",t[t.Block=2]="Block"})(es||(es={}));var Gt=class t{static nextListId=0;debugListId=t.nextListId++;head={kind:l.ListEnd,next:null,prev:null,debugListId:this.debugListId};tail={kind:l.ListEnd,next:null,prev:null,debugListId:this.debugListId};constructor(){this.head.next=this.tail,this.tail.prev=this.head}push(e){if(Array.isArray(e)){for(let s of e)this.push(s);return}t.assertIsNotEnd(e),t.assertIsUnowned(e),e.debugListId=this.debugListId;let n=this.tail.prev;e.prev=n,n.next=e,e.next=this.tail,this.tail.prev=e}prepend(e){if(e.length===0)return;for(let r of e)t.assertIsNotEnd(r),t.assertIsUnowned(r),r.debugListId=this.debugListId;let n=this.head.next,s=this.head;for(let r of e)s.next=r,r.prev=s,s=r;s.next=n,n.prev=s}*[Symbol.iterator](){let e=this.head.next;for(;e!==this.tail;){t.assertIsOwned(e,this.debugListId);let n=e.next;yield e,e=n}}*reversed(){let e=this.tail.prev;for(;e!==this.head;){t.assertIsOwned(e,this.debugListId);let n=e.prev;yield e,e=n}}static replace(e,n){t.assertIsNotEnd(e),t.assertIsNotEnd(n),t.assertIsOwned(e),t.assertIsUnowned(n),n.debugListId=e.debugListId,e.prev!==null&&(e.prev.next=n,n.prev=e.prev),e.next!==null&&(e.next.prev=n,n.next=e.next),e.debugListId=null,e.prev=null,e.next=null}static replaceWithMany(e,n){if(n.length===0){t.remove(e);return}t.assertIsNotEnd(e),t.assertIsOwned(e);let s=e.debugListId;e.debugListId=null;for(let d of n)t.assertIsNotEnd(d),t.assertIsUnowned(d);let{prev:r,next:i}=e;e.prev=null,e.next=null;let a=r;for(let d of n)t.assertIsUnowned(d),d.debugListId=s,a.next=d,d.prev=a,d.next=null,a=d;let p=n[0],h=a;r!==null&&(r.next=p,p.prev=r),i!==null&&(i.prev=h,h.next=i)}static remove(e){t.assertIsNotEnd(e),t.assertIsOwned(e),e.prev.next=e.next,e.next.prev=e.prev,e.debugListId=null,e.prev=null,e.next=null}static insertBefore(e,n){if(Array.isArray(e)){for(let s of e)t.insertBefore(s,n);return}if(t.assertIsOwned(n),n.prev===null)throw new Error("AssertionError: illegal operation on list start");t.assertIsNotEnd(e),t.assertIsUnowned(e),e.debugListId=n.debugListId,e.prev=null,n.prev.next=e,e.prev=n.prev,e.next=n,n.prev=e}static insertAfter(e,n){if(t.assertIsOwned(n),n.next===null)throw new Error("AssertionError: illegal operation on list end");t.assertIsNotEnd(e),t.assertIsUnowned(e),e.debugListId=n.debugListId,n.next.prev=e,e.next=n.next,e.prev=n,n.next=e}static assertIsUnowned(e){if(e.debugListId!==null)throw new Error(`AssertionError: illegal operation on owned node: ${l[e.kind]}`)}static assertIsOwned(e,n){if(e.debugListId===null)throw new Error(`AssertionError: illegal operation on unowned node: ${l[e.kind]}`);if(n!==void 0&&e.debugListId!==n)throw new Error(`AssertionError: node belongs to the wrong list (expected ${n}, actual ${e.debugListId})`)}static assertIsNotEnd(e){if(e.kind===l.ListEnd)throw new Error("AssertionError: illegal operation on list head or tail")}};function wi(t){return{kind:l.Statement,statement:t,...xi}}var xi={debugListId:null,prev:null,next:null},Si=Symbol("ConsumesSlot"),As=Symbol("DependsOnSlotContext"),fe=Symbol("ConsumesVars"),et=Symbol("UsesVarOffset"),Co={[Si]:!0,numSlotsUsed:1},_o={[As]:!0},ko={[fe]:!0};var pe=class{strings;expressions;i18nPlaceholders;constructor(e,n,s){if(this.strings=e,this.expressions=n,this.i18nPlaceholders=s,s.length!==0&&s.length!==n.length)throw new Error(`Expected ${n.length} placeholders to match interpolation expression count, but got ${s.length}`)}};var ee=class extends S{constructor(e=null){super(null,e)}};var ts=class t extends ee{target;value;sourceSpan;kind=Z.StoreLet;[fe]=!0;[As]=!0;constructor(e,n,s){super(),this.target=e,this.value=n,this.sourceSpan=s}visitExpression(){}isEquivalent(e){return e instanceof t&&e.target===this.target&&e.value.isEquivalent(this.value)}isConstant(){return!1}transformInternalExpressions(e,n){this.value=(this.value,void 0)}clone(){return new t(this.target,this.value,this.sourceSpan)}};var ns=class t extends ee{kind=Z.PureFunctionExpr;[fe]=!0;[et]=!0;varOffset=null;body;args;fn=null;constructor(e,n){super(),this.body=e,this.args=n}visitExpression(e,n){this.body?.visitExpression(e,n);for(let s of this.args)s.visitExpression(e,n)}isEquivalent(e){return!(e instanceof t)||e.args.length!==this.args.length?!1:e.body!==null&&this.body!==null&&e.body.isEquivalent(this.body)&&e.args.every((n,s)=>n.isEquivalent(this.args[s]))}isConstant(){return!1}transformInternalExpressions(e,n){this.body!==null?this.body=(this.body,n|W.InChildOperation,void 0):this.fn!==null&&(this.fn=(this.fn,void 0));for(let s=0;s<this.args.length;s++)this.args[s]=(this.args[s],void 0)}clone(){let e=new t(this.body?.clone()??null,this.args.map(n=>n.clone()));return e.fn=this.fn?.clone()??null,e.varOffset=this.varOffset,e}};var ss=class t extends ee{target;targetSlot;name;args;kind=Z.PipeBinding;[fe]=!0;[et]=!0;varOffset=null;constructor(e,n,s,r){super(),this.target=e,this.targetSlot=n,this.name=s,this.args=r}visitExpression(e,n){for(let s of this.args)s.visitExpression(e,n)}isEquivalent(){return!1}isConstant(){return!1}transformInternalExpressions(e,n){for(let s=0;s<this.args.length;s++)this.args[s]=(this.args[s],void 0)}clone(){let e=new t(this.target,this.targetSlot,this.name,this.args.map(n=>n.clone()));return e.varOffset=this.varOffset,e}},rs=class t extends ee{target;targetSlot;name;args;numArgs;kind=Z.PipeBindingVariadic;[fe]=!0;[et]=!0;varOffset=null;constructor(e,n,s,r,i){super(),this.target=e,this.targetSlot=n,this.name=s,this.args=r,this.numArgs=i}visitExpression(e,n){this.args.visitExpression(e,n)}isEquivalent(){return!1}isConstant(){return!1}transformInternalExpressions(e,n){this.args=(this.args,void 0)}clone(){let e=new t(this.target,this.targetSlot,this.name,this.args.clone(),this.numArgs);return e.varOffset=this.varOffset,e}};var is=class t extends ee{parameters;body;kind=Z.ArrowFunction;[fe]=!0;[et]=!0;contextName=Wr;currentViewName="view";varOffset=null;ops;constructor(e,n){super(),this.parameters=e,this.body=n,this.ops=new Gt,this.ops.push([wi(new Be(n,n.sourceSpan))])}visitExpression(e,n){for(let s of this.ops)Ei(s,r=>{r.visitExpression(e,n)})}isEquivalent(e){return e instanceof t&&e.parameters.length===this.parameters.length&&e.parameters.every((n,s)=>n.isEquivalent(this.parameters[s]))&&e.body.isEquivalent(this.body)}isConstant(){return!1}transformInternalExpressions(e,n){for(let s of this.ops)Qe(s,e,n|(W.InChildOperation|W.InArrowFunctionOperation))}clone(){let e=new t(this.parameters,this.body);return e.varOffset=this.varOffset,e.ops=this.ops,e}};function Ei(t,e){Qe(t,(n,s)=>(e(n,s),n),W.None)}var W;(function(t){t[t.None=0]="None",t[t.InChildOperation=1]="InChildOperation",t[t.InArrowFunctionOperation=2]="InArrowFunctionOperation"})(W||(W={}));function pt(t,e,n){for(let s=0;s<t.expressions.length;s++)t.expressions[s]=(t.expressions[s],void 0)}function Qe(t,e,n){switch(t.kind){case l.StyleProp:case l.StyleMap:case l.ClassProp:case l.ClassMap:case l.AnimationString:case l.AnimationBinding:case l.Binding:t.expression instanceof pe?pt(t.expression,e,n):t.expression=(t.expression,void 0);break;case l.Property:case l.DomProperty:case l.Attribute:t.expression instanceof pe?pt(t.expression,e,n):t.expression=(t.expression,void 0),t.sanitizer=t.sanitizer&&(t.sanitizer,void 0);break;case l.TwoWayProperty:t.expression=(t.expression,void 0),t.sanitizer=t.sanitizer&&(t.sanitizer,void 0);break;case l.I18nExpression:t.expression=(t.expression,void 0);break;case l.InterpolateText:pt(t.interpolation,e,n);break;case l.Statement:Xt(t.statement,e,n);break;case l.Variable:t.initializer=(t.initializer,void 0);break;case l.Conditional:for(let s of t.conditions)s.expr!==null&&(s.expr=(s.expr,void 0));t.processed!==null&&(t.processed=(t.processed,void 0)),t.contextValue!==null&&(t.contextValue=(t.contextValue,void 0));break;case l.Animation:case l.AnimationListener:case l.Listener:case l.TwoWayListener:for(let s of t.handlerOps)Qe(s,e,n|W.InChildOperation);break;case l.ExtractedAttribute:t.expression=t.expression&&(t.expression,void 0),t.trustedValueFn=t.trustedValueFn&&(t.trustedValueFn,void 0);break;case l.RepeaterCreate:if(t.trackByOps===null)t.track=(t.track,void 0);else for(let s of t.trackByOps)Qe(s,e,n|W.InChildOperation);t.trackByFn!==null&&(t.trackByFn=(t.trackByFn,void 0));break;case l.Repeater:t.collection=(t.collection,void 0);break;case l.Defer:t.loadingConfig!==null&&(t.loadingConfig=(t.loadingConfig,void 0)),t.placeholderConfig!==null&&(t.placeholderConfig=(t.placeholderConfig,void 0)),t.resolverFn!==null&&(t.resolverFn=(t.resolverFn,void 0));break;case l.I18nMessage:for(let[s,r]of t.params)t.params.set(s,void 0);for(let[s,r]of t.postprocessingParams)t.postprocessingParams.set(s,void 0);break;case l.DeferWhen:t.expr=(t.expr,void 0);break;case l.StoreLet:t.value=(t.value,void 0);break;case l.Advance:case l.Container:case l.ContainerEnd:case l.ContainerStart:case l.DeferOn:case l.DisableBindings:case l.Element:case l.ElementEnd:case l.ElementStart:case l.EnableBindings:case l.I18n:case l.I18nApply:case l.I18nContext:case l.I18nEnd:case l.I18nStart:case l.IcuEnd:case l.IcuStart:case l.Namespace:case l.Pipe:case l.Projection:case l.ProjectionDef:case l.Template:case l.Text:case l.I18nAttributes:case l.IcuPlaceholder:case l.DeclareLet:case l.SourceLocation:case l.ConditionalCreate:case l.ConditionalBranchCreate:case l.Control:case l.ControlCreate:break;default:throw new Error(`AssertionError: transformExpressionsInOp doesn't handle ${l[t.kind]}`)}}function Xt(t,e,n){if(t instanceof De)t.expr=(t.expr,void 0);else if(t instanceof Be)t.value=(t.value,void 0);else if(t instanceof kt)t.value!==void 0&&(t.value=(t.value,void 0));else if(t instanceof Tt){t.condition=(t.condition,void 0);for(let s of t.trueCase)Xt(s,e,n);for(let s of t.falseCase)Xt(s,e,n)}else throw new Error(`Unhandled statement kind: ${t.constructor.name}`)}var To=new Set([l.Element,l.ElementStart,l.Container,l.ContainerStart,l.Template,l.RepeaterCreate,l.ConditionalCreate,l.ConditionalBranchCreate]);var os;(function(t){t[t.Tmpl=0]="Tmpl",t[t.Host=1]="Host",t[t.Both=2]="Both"})(os||(os={}));var as;(function(t){t[t.Full=0]="Full",t[t.DomOnly=1]="DomOnly"})(as||(as={}));var bo=new Map([[c.ariaProperty,c.ariaProperty],[c.attribute,c.attribute],[c.classProp,c.classProp],[c.element,c.element],[c.elementContainer,c.elementContainer],[c.elementContainerEnd,c.elementContainerEnd],[c.elementContainerStart,c.elementContainerStart],[c.elementEnd,c.elementEnd],[c.elementStart,c.elementStart],[c.domProperty,c.domProperty],[c.i18nExp,c.i18nExp],[c.listener,c.listener],[c.listener,c.listener],[c.property,c.property],[c.styleProp,c.styleProp],[c.syntheticHostListener,c.syntheticHostListener],[c.syntheticHostProperty,c.syntheticHostProperty],[c.templateCreate,c.templateCreate],[c.twoWayProperty,c.twoWayProperty],[c.twoWayListener,c.twoWayListener],[c.declareLet,c.declareLet],[c.conditionalCreate,c.conditionalBranchCreate],[c.conditionalBranchCreate,c.conditionalBranchCreate],[c.domElement,c.domElement],[c.domElementStart,c.domElementStart],[c.domElementEnd,c.domElementEnd],[c.domElementContainer,c.domElementContainer],[c.domElementContainerStart,c.domElementContainerStart],[c.domElementContainerEnd,c.domElementContainerEnd],[c.domListener,c.domListener],[c.domTemplate,c.domTemplate],[c.animationEnter,c.animationEnter],[c.animationLeave,c.animationLeave],[c.animationEnterListener,c.animationEnterListener],[c.animationLeaveListener,c.animationLeaveListener]]);var Ao=new Map([["&&",u.And],[">",u.Bigger],[">=",u.BiggerEquals],["|",u.BitwiseOr],["&",u.BitwiseAnd],["/",u.Divide],["=",u.Assign],["==",u.Equals],["===",u.Identical],["<",u.Lower],["<=",u.LowerEquals],["-",u.Minus],["%",u.Modulo],["**",u.Exponentiation],["*",u.Multiply],["!=",u.NotEquals],["!==",u.NotIdentical],["??",u.NullishCoalesce],["||",u.Or],["+",u.Plus],["in",u.In],["instanceof",u.InstanceOf],["+=",u.AdditionAssignment],["-=",u.SubtractionAssignment],["*=",u.MultiplicationAssignment],["/=",u.DivisionAssignment],["%=",u.RemainderAssignment],["**=",u.ExponentiationAssignment],["&&=",u.AndAssignment],["||=",u.OrAssignment],["??=",u.NullishCoalesceAssignment]]);var Io=Object.freeze([]);var No=new Map([[l.ElementEnd,[l.ElementStart,l.Element]],[l.ContainerEnd,[l.ContainerStart,l.Container]],[l.I18nEnd,[l.I18nStart,l.I18n]]]),Po=new Set([l.Pipe]);var yi={},Ci="\uE500";yi.ngsp=Ci;var ls;(function(t){t.HEX="hexadecimal",t.DEC="decimal"})(ls||(ls={}));var Is=` \f
4
+ \r \v\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF`,Lo=new RegExp(`[^${Is}]`),Mo=new RegExp(`[${Is}]{2,}`,"g");var f;(function(t){t[t.Character=0]="Character",t[t.Identifier=1]="Identifier",t[t.PrivateIdentifier=2]="PrivateIdentifier",t[t.Keyword=3]="Keyword",t[t.String=4]="String",t[t.Operator=5]="Operator",t[t.Number=6]="Number",t[t.RegExpBody=7]="RegExpBody",t[t.RegExpFlags=8]="RegExpFlags",t[t.Error=9]="Error"})(f||(f={}));var H;(function(t){t[t.Plain=0]="Plain",t[t.TemplateLiteralPart=1]="TemplateLiteralPart",t[t.TemplateLiteralEnd=2]="TemplateLiteralEnd"})(H||(H={}));var _i=["var","let","as","null","undefined","true","false","if","else","this","typeof","void","in","instanceof"],Le=class{tokenize(e){return new Jt(e).scan()}},b=class{index;end;type;numValue;strValue;constructor(e,n,s,r,i){this.index=e,this.end=n,this.type=s,this.numValue=r,this.strValue=i}isCharacter(e){return this.type===f.Character&&this.numValue===e}isNumber(){return this.type===f.Number}isString(){return this.type===f.String}isOperator(e){return this.type===f.Operator&&this.strValue===e}isIdentifier(){return this.type===f.Identifier}isPrivateIdentifier(){return this.type===f.PrivateIdentifier}isKeyword(){return this.type===f.Keyword}isKeywordLet(){return this.type===f.Keyword&&this.strValue==="let"}isKeywordAs(){return this.type===f.Keyword&&this.strValue==="as"}isKeywordNull(){return this.type===f.Keyword&&this.strValue==="null"}isKeywordUndefined(){return this.type===f.Keyword&&this.strValue==="undefined"}isKeywordTrue(){return this.type===f.Keyword&&this.strValue==="true"}isKeywordFalse(){return this.type===f.Keyword&&this.strValue==="false"}isKeywordThis(){return this.type===f.Keyword&&this.strValue==="this"}isKeywordTypeof(){return this.type===f.Keyword&&this.strValue==="typeof"}isKeywordVoid(){return this.type===f.Keyword&&this.strValue==="void"}isKeywordIn(){return this.type===f.Keyword&&this.strValue==="in"}isKeywordInstanceOf(){return this.type===f.Keyword&&this.strValue==="instanceof"}isError(){return this.type===f.Error}isRegExpBody(){return this.type===f.RegExpBody}isRegExpFlags(){return this.type===f.RegExpFlags}toNumber(){return this.type===f.Number?this.numValue:-1}isTemplateLiteralPart(){return this.isString()&&this.kind===H.TemplateLiteralPart}isTemplateLiteralEnd(){return this.isString()&&this.kind===H.TemplateLiteralEnd}isTemplateLiteralInterpolationStart(){return this.isOperator("${")}toString(){switch(this.type){case f.Character:case f.Identifier:case f.Keyword:case f.Operator:case f.PrivateIdentifier:case f.String:case f.Error:case f.RegExpBody:case f.RegExpFlags:return this.strValue;case f.Number:return this.numValue.toString();default:return null}}},Te=class extends b{kind;constructor(e,n,s,r){super(e,n,f.String,0,s),this.kind=r}};function xe(t,e,n){return new b(t,e,f.Character,n,String.fromCharCode(n))}function ki(t,e,n){return new b(t,e,f.Identifier,0,n)}function Ti(t,e,n){return new b(t,e,f.PrivateIdentifier,0,n)}function bi(t,e,n){return new b(t,e,f.Keyword,0,n)}function B(t,e,n){return new b(t,e,f.Operator,0,n)}function Ai(t,e,n){return new b(t,e,f.Number,n,"")}function Ii(t,e,n){return new b(t,e,f.Error,0,n)}function Ni(t,e,n){return new b(t,e,f.RegExpBody,0,n)}function Pi(t,e,n){return new b(t,e,f.RegExpFlags,0,n)}var Se=new b(-1,-1,f.Character,0,""),Jt=class{input;tokens=[];length;peek=0;index=-1;braceStack=[];constructor(e){this.input=e,this.length=e.length,this.advance()}scan(){let e=this.scanToken();for(;e!==null;)this.tokens.push(e),e=this.scanToken();return this.tokens}advance(){this.peek=++this.index>=this.length?we:this.input.charCodeAt(this.index)}scanToken(){let e=this.input,n=this.length,s=this.peek,r=this.index;for(;s<=ws;)if(++r>=n){s=we;break}else s=e.charCodeAt(r);if(this.peek=s,this.index=r,r>=n)return null;if(cs(s))return this.scanIdentifier();if(G(s))return this.scanNumber(r);let i=r;switch(s){case z:return this.advance(),G(this.peek)?this.scanNumber(i):this.peek!==z?xe(i,this.index,z):(this.advance(),this.peek===z?(this.advance(),B(i,this.index,"...")):this.error(`Unexpected character [${String.fromCharCode(s)}]`,0));case X:case N:case ie:case Q:case F:case J:case Ee:return this.scanCharacter(i,s);case ke:return this.scanOpenBrace(i,s);case ne:return this.scanCloseBrace(i,s);case Ss:case xs:return this.scanString();case qt:return this.advance(),this.scanTemplateLiteralPart(i);case Xr:return this.scanPrivateIdentifier();case Es:return this.scanComplexOperator(i,"+",y,"=");case ys:return this.scanComplexOperator(i,"-",y,"=");case ze:return this.isStartOfRegex()?this.scanRegex(r):this.scanComplexOperator(i,"/",y,"=");case Jr:return this.scanComplexOperator(i,"%",y,"=");case ei:return this.scanOperator(i,"^");case Fn:return this.scanStar(i);case Un:return this.scanQuestion(i);case Yr:case Vn:return this.scanComplexOperator(i,String.fromCharCode(s),y,"=");case Gr:return this.scanComplexOperator(i,"!",y,"=",y,"=");case y:return this.scanEquals(i);case Bn:return this.scanComplexOperator(i,"&",Bn,"&",y,"=");case Hn:return this.scanComplexOperator(i,"|",Hn,"|",y,"=");case ks:for(;li(this.peek);)this.advance();return this.scanToken()}return this.advance(),this.error(`Unexpected character [${String.fromCharCode(s)}]`,0)}scanCharacter(e,n){return this.advance(),xe(e,this.index,n)}scanOperator(e,n){return this.advance(),B(e,this.index,n)}scanOpenBrace(e,n){return this.braceStack.push("expression"),this.advance(),xe(e,this.index,n)}scanCloseBrace(e,n){return this.advance(),this.braceStack.pop()==="interpolation"?(this.tokens.push(xe(e,this.index,ne)),this.scanTemplateLiteralPart(this.index)):xe(e,this.index,n)}scanComplexOperator(e,n,s,r,i,a){this.advance();let p=n;return this.peek==s&&(this.advance(),p+=r),i!=null&&this.peek==i&&(this.advance(),p+=a),B(e,this.index,p)}scanEquals(e){this.advance();let n="=";if(this.peek===y)this.advance(),n+="=";else if(this.peek===Vn)return this.advance(),n+=">",B(e,this.index,n);return this.peek===y&&(this.advance(),n+="="),B(e,this.index,n)}scanIdentifier(){let e=this.index;for(this.advance();us(this.peek);)this.advance();let n=this.input.substring(e,this.index);return _i.indexOf(n)>-1?bi(e,this.index,n):ki(e,this.index,n)}scanPrivateIdentifier(){let e=this.index;if(this.advance(),!cs(this.peek))return this.error("Invalid character [#]",-1);for(;us(this.peek);)this.advance();let n=this.input.substring(e,this.index);return Ti(e,this.index,n)}scanNumber(e){let n=this.index===e,s=!1;for(this.advance();;){if(!G(this.peek))if(this.peek===Ze){if(!G(this.input.charCodeAt(this.index-1))||!G(this.input.charCodeAt(this.index+1)))return this.error("Invalid numeric separator",0);s=!0}else if(this.peek===z)n=!1;else if(Li(this.peek)){if(this.advance(),Mi(this.peek)&&this.advance(),!G(this.peek))return this.error("Invalid exponent",-1);n=!1}else break;this.advance()}let r=this.input.substring(e,this.index);s&&(r=r.replace(/_/g,""));let i=n?$i(r):parseFloat(r);return Ai(e,this.index,i)}scanString(){let e=this.index,n=this.peek;this.advance();let s="",r=this.index,i=this.input;for(;this.peek!=n;)if(this.peek==ut){let p=this.scanStringBackslash(s,r);if(typeof p!="string")return p;s=p,r=this.index}else{if(this.peek==we)return this.error("Unterminated quote",0);this.advance()}let a=i.substring(r,this.index);return this.advance(),new Te(e,this.index,s+a,H.Plain)}scanQuestion(e){this.advance();let n="?";return this.peek===Un?(n+="?",this.advance(),this.peek===y&&(n+="=",this.advance())):this.peek===z&&(n+=".",this.advance()),B(e,this.index,n)}scanTemplateLiteralPart(e){let n="",s=this.index;for(;this.peek!==qt;)if(this.peek===ut){let i=this.scanStringBackslash(n,s);if(typeof i!="string")return i;n=i,s=this.index}else if(this.peek===Zt){let i=this.index;if(this.advance(),this.peek===ke)return this.braceStack.push("interpolation"),this.tokens.push(new Te(e,i,n+this.input.substring(s,i),H.TemplateLiteralPart)),this.advance(),B(i,this.index,this.input.substring(i,this.index))}else{if(this.peek===we)return this.error("Unterminated template literal",0);this.advance()}let r=this.input.substring(s,this.index);return this.advance(),new Te(e,this.index,n+r,H.TemplateLiteralEnd)}error(e,n){let s=this.index+n;return Ii(s,this.index,`Lexer Error: ${e} at column ${s} in expression [${this.input}]`)}scanStringBackslash(e,n){e+=this.input.substring(n,this.index);let s;if(this.advance(),this.peek===oi){let r=this.input.substring(this.index+1,this.index+5);if(/^[0-9a-f]+$/i.test(r))s=parseInt(r,16);else return this.error(`Invalid unicode escape [\\u${r}]`,0);for(let i=0;i<5;i++)this.advance()}else s=Ri(this.peek),this.advance();return e+=String.fromCharCode(s),e}scanStar(e){this.advance();let n="*";return this.peek===Fn?(n+="*",this.advance(),this.peek===y&&(n+="=",this.advance())):this.peek===y&&(n+="=",this.advance()),B(e,this.index,n)}isStartOfRegex(){if(this.tokens.length===0)return!0;let e=this.tokens[this.tokens.length-1];if(e.isOperator("!")){let n=this.tokens.length>1?this.tokens[this.tokens.length-2]:null;return n===null||n.type!==f.Identifier&&!n.isCharacter(N)&&!n.isCharacter(Q)}return e.type===f.Operator||e.isCharacter(X)||e.isCharacter(ie)||e.isCharacter(F)||e.isCharacter(J)}scanRegex(e){this.advance();let n=this.index,s=!1,r=!1;for(;;){let h=this.peek;if(h===we)return this.error("Unterminated regular expression",0);if(s)s=!1;else if(h===ut)s=!0;else if(h===ie)r=!0;else if(h===Q)r=!1;else if(h===ze&&!r)break;this.advance()}let i=this.input.substring(n,this.index);this.advance();let a=Ni(e,this.index,i),p=this.scanRegexFlags(this.index);return p!==null?(this.tokens.push(a),p):a}scanRegexFlags(e){if(!jt(this.peek))return null;for(;jt(this.peek);)this.advance();return Pi(e,this.index,this.input.substring(e,this.index))}};function cs(t){return Cs<=t&&t<=_s||en<=t&&t<=tn||t==Ze||t==Zt}function us(t){return jt(t)||G(t)||t==Ze||t==Zt}function Li(t){return t==ti||t==Zr}function Mi(t){return t==ys||t==Es}function Ri(t){switch(t){case si:return $e;case ni:return jr;case ri:return zr;case ii:return vs;case ai:return qr;default:return t}}function $i(t){let e=parseInt(t);if(isNaN(e))throw new Error("Invalid integer literal when parsing "+t);return e}var Yt=class{strings;expressions;offsets;constructor(e,n,s){this.strings=e,this.expressions=n,this.offsets=s}},Qt=class{templateBindings;warnings;errors;constructor(e,n,s){this.templateBindings=e,this.warnings=n,this.errors=s}};function V(t){return t.start.toString()||"(unknown)"}var he=class{_lexer;_supportsDirectPipeReferences;constructor(e,n=!1){this._lexer=e,this._supportsDirectPipeReferences=n}parseAction(e,n,s){let r=[];this._checkNoInterpolation(r,e,n);let{stripped:i}=this._stripComments(e),a=this._lexer.tokenize(i),p=new Y(e,n,s,a,1,r,0,this._supportsDirectPipeReferences).parseChain();return new U(p,e,V(n),s,r)}parseBinding(e,n,s){let r=[],i=this._parseBindingAst(e,n,s,r);return new U(i,e,V(n),s,r)}checkSimpleExpression(e){let n=new Kt;return e.visit(n),n.errors}parseSimpleBinding(e,n,s){let r=[],i=this._parseBindingAst(e,n,s,r),a=this.checkSimpleExpression(i);return a.length>0&&r.push(re(`Host binding expression cannot contain ${a.join(" ")}`,e,"",n)),new U(i,e,V(n),s,r)}_parseBindingAst(e,n,s,r){this._checkNoInterpolation(r,e,n);let{stripped:i}=this._stripComments(e),a=this._lexer.tokenize(i);return new Y(e,n,s,a,0,r,0,this._supportsDirectPipeReferences).parseChain()}parseTemplateBindings(e,n,s,r,i){let a=this._lexer.tokenize(n),p=[];return new Y(n,s,i,a,0,p,0,this._supportsDirectPipeReferences).parseTemplateBindings({source:e,span:new O(r,r+e.length)})}parseInterpolation(e,n,s,r){let i=[],{strings:a,expressions:p,offsets:h}=this.splitInterpolation(e,n,i,r);if(p.length===0)return null;let d=[];for(let x=0;x<p.length;++x){let D=r?.[x*2+1]?.sourceSpan,k=p[x].text,{stripped:T,hasComments:C}=this._stripComments(k),q=this._lexer.tokenize(T);if(C&&T.trim().length===0&&q.length===0){i.push(re("Interpolation expression cannot only contain a comment",e,`at column ${p[x].start} in`,n));continue}let ge=new Y(D?k:e,D||n,s,q,0,i,h[x],this._supportsDirectPipeReferences).parseChain();d.push(ge)}return this.createInterpolationAst(a.map(x=>x.text),d,e,V(n),s,i)}parseInterpolationExpression(e,n,s){let{stripped:r}=this._stripComments(e),i=this._lexer.tokenize(r),a=[],p=new Y(e,n,s,i,0,a,0,this._supportsDirectPipeReferences).parseChain(),h=["",""];return this.createInterpolationAst(h,[p],e,V(n),s,a)}createInterpolationAst(e,n,s,r,i,a){let p=new K(0,s.length),h=new Hr(p,p.toAbsolute(i),e,n);return new U(h,s,r,i,a)}splitInterpolation(e,n,s,r){let i=[],a=[],p=[],h=r?Oi(r):null,d=0,x=!1,D=!1,k="{{",T="}}";for(;d<e.length;)if(x){let C=d,q=C+k.length,ge=this._getInterpolationEndIndex(e,T,q);if(ge===-1){x=!1,D=!0;break}let dn=ge+T.length,mn=e.substring(q,ge);mn.trim().length===0&&s.push(re("Blank expressions are not allowed in interpolated strings",e,`at column ${d} in`,n)),a.push({text:mn,start:C,end:dn});let $r=(h?.get(C)??C)+k.length;p.push($r),d=dn,x=!1}else{let C=d;d=e.indexOf(k,d),d===-1&&(d=e.length);let q=e.substring(C,d);i.push({text:q,start:C,end:d}),x=!0}if(!x)if(D){let C=i[i.length-1];C.text+=e.substring(d),C.end=e.length}else i.push({text:e.substring(d),start:d,end:e.length});return new Yt(i,a,p)}wrapLiteralPrimitive(e,n,s){let r=new K(0,e==null?0:e.length);return new U(new I(r,r.toAbsolute(s),e),e,typeof n=="string"?n:V(n),s,[])}_stripComments(e){let n=this._commentStart(e);return n!=null?{stripped:e.substring(0,n),hasComments:!0}:{stripped:e,hasComments:!1}}_commentStart(e){let n=null;for(let s=0;s<e.length-1;s++){let r=e.charCodeAt(s),i=e.charCodeAt(s+1);if(r===ze&&i==ze&&n==null)return s;n===r?n=null:n==null&&Wn(r)&&(n=r)}return null}_checkNoInterpolation(e,n,s){let r=-1,i=-1;for(let a of this._forEachUnquotedChar(n,0))if(r===-1)n.startsWith("{{")&&(r=a);else if(i=this._getInterpolationEndIndex(n,"}}",a),i>-1)break;r>-1&&i>-1&&e.push(re("Got interpolation ({{}}) where expression was expected",n,`at column ${r} in`,s))}_getInterpolationEndIndex(e,n,s){for(let r of this._forEachUnquotedChar(e,s)){if(e.startsWith(n,r))return r;if(e.startsWith("//",r))return e.indexOf(n,r)}return-1}*_forEachUnquotedChar(e,n){let s=null,r=0;for(let i=n;i<e.length;i++){let a=e[i];Wn(e.charCodeAt(i))&&(s===null||s===a)&&r%2===0?s=s===null?a:null:s===null&&(yield i),r=a==="\\"?r+1:0}}},se;(function(t){t[t.None=0]="None",t[t.Writable=1]="Writable"})(se||(se={}));var ps=new Set(["d","g","i","m","s","u","v","y"]),Y=class{input;parseSourceSpan;absoluteOffset;tokens;parseFlags;errors;offset;supportsDirectPipeReferences;rparensExpected=0;rbracketsExpected=0;rbracesExpected=0;context=se.None;sourceSpanCache=new Map;index=0;constructor(e,n,s,r,i,a,p,h){this.input=e,this.parseSourceSpan=n,this.absoluteOffset=s,this.tokens=r,this.parseFlags=i,this.errors=a,this.offset=p,this.supportsDirectPipeReferences=h}peek(e){let n=this.index+e;return n<this.tokens.length?this.tokens[n]:Se}get next(){return this.peek(0)}get atEOF(){return this.index>=this.tokens.length}get inputIndex(){return this.atEOF?this.currentEndIndex:this.next.index+this.offset}get currentEndIndex(){return this.index>0?this.peek(-1).end+this.offset:this.tokens.length===0?this.input.length+this.offset:this.next.index+this.offset}get currentAbsoluteOffset(){return this.absoluteOffset+this.inputIndex}span(e,n){let s=this.currentEndIndex;if(n!==void 0&&n>this.currentEndIndex&&(s=n),e>s){let r=s;s=e,e=r}return new K(e,s)}sourceSpan(e,n){let s=`${e}@${this.inputIndex}:${n}`;return this.sourceSpanCache.has(s)||this.sourceSpanCache.set(s,this.span(e,n).toAbsolute(this.absoluteOffset)),this.sourceSpanCache.get(s)}advance(){this.index++}withContext(e,n){this.context|=e;let s=n();return this.context^=e,s}consumeOptionalCharacter(e){return this.next.isCharacter(e)?(this.advance(),!0):!1}peekKeywordLet(){return this.next.isKeywordLet()}peekKeywordAs(){return this.next.isKeywordAs()}expectCharacter(e){this.consumeOptionalCharacter(e)||this.error(`Missing expected ${String.fromCharCode(e)}`)}consumeOptionalOperator(e){return this.next.isOperator(e)?(this.advance(),!0):!1}isAssignmentOperator(e){return e.type===f.Operator&&E.isAssignmentOperation(e.strValue)}expectOperator(e){this.consumeOptionalOperator(e)||this.error(`Missing expected operator ${e}`)}prettyPrintToken(e){return e===Se?"end of input":`token ${e}`}expectIdentifierOrKeyword(){let e=this.next;return!e.isIdentifier()&&!e.isKeyword()?(e.isPrivateIdentifier()?this._reportErrorForPrivateIdentifier(e,"expected identifier or keyword"):this.error(`Unexpected ${this.prettyPrintToken(e)}, expected identifier or keyword`),null):(this.advance(),e.toString())}expectIdentifierOrKeywordOrString(){let e=this.next;return!e.isIdentifier()&&!e.isKeyword()&&!e.isString()?(e.isPrivateIdentifier()?this._reportErrorForPrivateIdentifier(e,"expected identifier, keyword or string"):this.error(`Unexpected ${this.prettyPrintToken(e)}, expected identifier, keyword, or string`),""):(this.advance(),e.toString())}parseChain(){let e=[],n=this.inputIndex;for(;this.index<this.tokens.length;){let s=this.parsePipe();if(e.push(s),this.consumeOptionalCharacter(Ee))for(this.parseFlags&1||this.error("Binding expression cannot contain chained expression");this.consumeOptionalCharacter(Ee););else if(this.index<this.tokens.length){let r=this.index;if(this.error(`Unexpected token '${this.next}'`),this.index===r)break}}if(e.length===0){let s=this.offset,r=this.offset+this.input.length;return new A(this.span(s,r),this.sourceSpan(s,r))}return e.length==1?e[0]:new It(this.span(n),this.sourceSpan(n),e)}parsePipe(){let e=this.inputIndex,n=this.parseExpression();if(this.consumeOptionalOperator("|")){this.parseFlags&1&&this.error("Cannot have a pipe in an action expression");do{let s=this.inputIndex,r=this.expectIdentifierOrKeyword(),i,a;r!==null?i=this.sourceSpan(s):(r="",a=this.next.index!==-1?this.next.index:this.input.length+this.offset,i=new K(a,a).toAbsolute(this.absoluteOffset));let p=[];for(;this.consumeOptionalCharacter(J);)p.push(this.parseExpression());let h;if(this.supportsDirectPipeReferences){let d=r.charCodeAt(0);h=d===Ze||d>=en&&d<=tn?Ce.ReferencedDirectly:Ce.ReferencedByName}else h=Ce.ReferencedByName;n=new Mt(this.span(e),this.sourceSpan(e,a),n,r,p,h,i)}while(this.consumeOptionalOperator("|"))}return n}parseExpression(){return this.parseConditional()}parseConditional(){let e=this.inputIndex,n=this.parseLogicalOr();if(this.consumeOptionalOperator("?")){let s=this.parsePipe(),r;if(this.consumeOptionalCharacter(J))r=this.parsePipe();else{let i=this.inputIndex,a=this.input.substring(e,i);this.error(`Conditional expression ${a} requires all 3 expressions`),r=new A(this.span(e),this.sourceSpan(e))}return new Nt(this.span(e),this.sourceSpan(e),n,s,r)}else return n}parseLogicalOr(){let e=this.inputIndex,n=this.parseLogicalAnd();for(;this.consumeOptionalOperator("||");){let s=this.parseLogicalAnd();n=new E(this.span(e),this.sourceSpan(e),"||",n,s)}return n}parseLogicalAnd(){let e=this.inputIndex,n=this.parseNullishCoalescing();for(;this.consumeOptionalOperator("&&");){let s=this.parseNullishCoalescing();n=new E(this.span(e),this.sourceSpan(e),"&&",n,s)}return n}parseNullishCoalescing(){let e=this.inputIndex,n=this.parseEquality();for(;this.consumeOptionalOperator("??");){let s=this.parseEquality();n=new E(this.span(e),this.sourceSpan(e),"??",n,s)}return n}parseEquality(){let e=this.inputIndex,n=this.parseRelational();for(;this.next.type==f.Operator;){let s=this.next.strValue;switch(s){case"==":case"===":case"!=":case"!==":this.advance();let r=this.parseRelational();n=new E(this.span(e),this.sourceSpan(e),s,n,r);continue}break}return n}parseRelational(){let e=this.inputIndex,n=this.parseAdditive();for(;this.next.type==f.Operator||this.next.isKeywordIn()||this.next.isKeywordInstanceOf();){let s=this.next.strValue;switch(s){case"<":case">":case"<=":case">=":case"in":case"instanceof":this.advance();let r=this.parseAdditive();n=new E(this.span(e),this.sourceSpan(e),s,n,r);continue}break}return n}parseAdditive(){let e=this.inputIndex,n=this.parseMultiplicative();for(;this.next.type==f.Operator;){let s=this.next.strValue;switch(s){case"+":case"-":this.advance();let r=this.parseMultiplicative();n=new E(this.span(e),this.sourceSpan(e),s,n,r);continue}break}return n}parseMultiplicative(){let e=this.inputIndex,n=this.parseExponentiation();for(;this.next.type==f.Operator;){let s=this.next.strValue;switch(s){case"*":case"%":case"/":this.advance();let r=this.parseExponentiation();n=new E(this.span(e),this.sourceSpan(e),s,n,r);continue}break}return n}parseExponentiation(){let e=this.inputIndex,n=this.parsePrefix();for(;this.next.type==f.Operator&&this.next.strValue==="**";){(n instanceof _e||n instanceof Ve||n instanceof Ue||n instanceof He)&&this.error("Unary operator used immediately before exponentiation expression. Parenthesis must be used to disambiguate operator precedence"),this.advance();let s=this.parseExponentiation();n=new E(this.span(e),this.sourceSpan(e),"**",n,s)}return n}parsePrefix(){if(this.next.type==f.Operator){let e=this.inputIndex,n=this.next.strValue,s;switch(n){case"+":return this.advance(),s=this.parsePrefix(),_e.createPlus(this.span(e),this.sourceSpan(e),s);case"-":return this.advance(),s=this.parsePrefix(),_e.createMinus(this.span(e),this.sourceSpan(e),s);case"!":return this.advance(),s=this.parsePrefix(),new Ve(this.span(e),this.sourceSpan(e),s)}}else if(this.next.isKeywordTypeof()){let e=this.inputIndex;this.advance();let n=this.parsePrefix();return new Ue(this.span(e),this.sourceSpan(e),n)}else if(this.next.isKeywordVoid()){let e=this.inputIndex;this.advance();let n=this.parsePrefix();return new He(this.span(e),this.sourceSpan(e),n)}return this.parseCallChain()}parseCallChain(){let e=this.inputIndex,n=this.parsePrimary();for(;;)if(this.consumeOptionalCharacter(z))n=this.parseAccessMember(n,e,!1);else if(this.consumeOptionalOperator("?."))this.consumeOptionalCharacter(X)?n=this.parseCall(n,e,!0):n=this.consumeOptionalCharacter(ie)?this.parseKeyedReadOrWrite(n,e,!0):this.parseAccessMember(n,e,!0);else if(this.consumeOptionalCharacter(ie))n=this.parseKeyedReadOrWrite(n,e,!1);else if(this.consumeOptionalCharacter(X))n=this.parseCall(n,e,!1);else if(this.consumeOptionalOperator("!"))n=new Dt(this.span(e),this.sourceSpan(e),n);else if(this.next.isTemplateLiteralEnd())n=this.parseNoInterpolationTaggedTemplateLiteral(n,e);else if(this.next.isTemplateLiteralPart())n=this.parseTaggedTemplateLiteral(n,e);else return n}parsePrimary(){let e=this.inputIndex;if(this.isArrowFunction())return this.parseArrowFunction(e);if(this.consumeOptionalCharacter(X)){this.rparensExpected++;let n=this.parsePipe();return this.consumeOptionalCharacter(N)||(this.error("Missing closing parentheses"),this.consumeOptionalCharacter(N)),this.rparensExpected--,new Ie(this.span(e),this.sourceSpan(e),n)}else{if(this.next.isKeywordNull())return this.advance(),new I(this.span(e),this.sourceSpan(e),null);if(this.next.isKeywordUndefined())return this.advance(),new I(this.span(e),this.sourceSpan(e),void 0);if(this.next.isKeywordTrue())return this.advance(),new I(this.span(e),this.sourceSpan(e),!0);if(this.next.isKeywordFalse())return this.advance(),new I(this.span(e),this.sourceSpan(e),!1);if(this.next.isKeywordIn())return this.advance(),new I(this.span(e),this.sourceSpan(e),"in");if(this.next.isKeywordThis())return this.advance(),new At(this.span(e),this.sourceSpan(e));if(this.consumeOptionalCharacter(ie))return this.parseLiteralArray(e);if(this.next.isCharacter(ke))return this.parseLiteralMap();if(this.next.isIdentifier())return this.parseAccessMember(new ce(this.span(e),this.sourceSpan(e)),e,!1);if(this.next.isNumber()){let n=this.next.toNumber();return this.advance(),new I(this.span(e),this.sourceSpan(e),n)}else{if(this.next.isTemplateLiteralEnd())return this.parseNoInterpolationTemplateLiteral();if(this.next.isTemplateLiteralPart())return this.parseTemplateLiteral();if(this.next.isString()&&this.next.kind===H.Plain){let n=this.next.toString();return this.advance(),new I(this.span(e),this.sourceSpan(e),n)}else return this.next.isPrivateIdentifier()?(this._reportErrorForPrivateIdentifier(this.next,null),new A(this.span(e),this.sourceSpan(e))):this.next.isRegExpBody()?this.parseRegularExpressionLiteral():this.index>=this.tokens.length?(this.error(`Unexpected end of expression: ${this.input}`),new A(this.span(e),this.sourceSpan(e))):(this.error(`Unexpected token ${this.next}`),new A(this.span(e),this.sourceSpan(e)))}}}parseLiteralArray(e){this.rbracketsExpected++;let n=[];do if(this.next.isOperator("..."))n.push(this.parseSpreadElement());else if(!this.next.isCharacter(Q))n.push(this.parsePipe());else break;while(this.consumeOptionalCharacter(F));return this.rbracketsExpected--,this.expectCharacter(Q),new Rt(this.span(e),this.sourceSpan(e),n)}parseLiteralMap(){let e=[],n=[],s=this.inputIndex;if(this.expectCharacter(ke),!this.consumeOptionalCharacter(ne)){this.rbracesExpected++;do{let r=this.inputIndex;if(this.next.isOperator("...")){this.advance(),e.push({kind:"spread",span:this.span(r),sourceSpan:this.sourceSpan(r)}),n.push(this.parsePipe());continue}let i=this.next.isString(),a=this.expectIdentifierOrKeywordOrString(),p=this.span(r),h=this.sourceSpan(r),d={kind:"property",key:a,quoted:i,span:p,sourceSpan:h};e.push(d),i?(this.expectCharacter(J),n.push(this.parsePipe())):this.consumeOptionalCharacter(J)?n.push(this.parsePipe()):(d.isShorthandInitialized=!0,n.push(new ye(p,h,h,new ce(p,h),a)))}while(this.consumeOptionalCharacter(F)&&!this.next.isCharacter(ne));this.rbracesExpected--,this.expectCharacter(ne)}return new Ot(this.span(s),this.sourceSpan(s),e,n)}parseAccessMember(e,n,s){let r=this.inputIndex,i=this.withContext(se.Writable,()=>{let p=this.expectIdentifierOrKeyword()??"";return p.length===0&&this.error("Expected identifier for property access",e.span.end),p}),a=this.sourceSpan(r);if(s)return this.isAssignmentOperator(this.next)?(this.advance(),this.error("The '?.' operator cannot be used in the assignment"),new A(this.span(n),this.sourceSpan(n))):new Pt(this.span(n),this.sourceSpan(n),a,e,i);if(this.isAssignmentOperator(this.next)){let p=this.next.strValue;if(!(this.parseFlags&1))return this.advance(),this.error("Bindings cannot contain assignments"),new A(this.span(n),this.sourceSpan(n));let h=new ye(this.span(n),this.sourceSpan(n),a,e,i);this.advance();let d=this.parseConditional();return new E(this.span(n),this.sourceSpan(n),p,h,d)}else return new ye(this.span(n),this.sourceSpan(n),a,e,i)}parseCall(e,n,s){let r=this.inputIndex;this.rparensExpected++;let i=this.parseCallArguments(),a=this.span(r,this.inputIndex).toAbsolute(this.absoluteOffset);this.expectCharacter(N),this.rparensExpected--;let p=this.span(n),h=this.sourceSpan(n);return s?new Ft(p,h,e,i,a):new Bt(p,h,e,i,a)}parseCallArguments(){if(this.next.isCharacter(N))return[];let e=[];do e.push(this.next.isOperator("...")?this.parseSpreadElement():this.parsePipe());while(this.consumeOptionalCharacter(F));return e}parseSpreadElement(){this.next.isOperator("...")||this.error("Spread element must start with '...' operator");let e=this.inputIndex;this.advance();let n=this.parsePipe(),s=this.span(e),r=this.sourceSpan(e);return new $t(s,r,n)}expectTemplateBindingKey(){let e="",n=!1,s=this.currentAbsoluteOffset;do e+=this.expectIdentifierOrKeywordOrString(),n=this.consumeOptionalOperator("-"),n&&(e+="-");while(n);return{source:e,span:new O(s,s+e.length)}}parseTemplateBindings(e){let n=[];for(n.push(...this.parseDirectiveKeywordBindings(e));this.index<this.tokens.length;){let s=this.parseLetBinding();if(s)n.push(s);else{let r=this.expectTemplateBindingKey(),i=this.parseAsBinding(r);i?n.push(i):(r.source=e.source+r.source.charAt(0).toUpperCase()+r.source.substring(1),n.push(...this.parseDirectiveKeywordBindings(r)))}this.consumeStatementTerminator()}return new Qt(n,[],this.errors)}parseKeyedReadOrWrite(e,n,s){return this.withContext(se.Writable,()=>{this.rbracketsExpected++;let r=this.parsePipe();if(r instanceof A&&this.error("Key access cannot be empty"),this.rbracketsExpected--,this.expectCharacter(Q),this.isAssignmentOperator(this.next)){let i=this.next.strValue;if(s)this.advance(),this.error("The '?.' operator cannot be used in the assignment");else{let a=new Fe(this.span(n),this.sourceSpan(n),e,r);this.advance();let p=this.parseConditional();return new E(this.span(n),this.sourceSpan(n),i,a,p)}}else return s?new Lt(this.span(n),this.sourceSpan(n),e,r):new Fe(this.span(n),this.sourceSpan(n),e,r);return new A(this.span(n),this.sourceSpan(n))})}parseDirectiveKeywordBindings(e){let n=[];this.consumeOptionalCharacter(J);let s=this.getDirectiveBoundTarget(),r=this.currentAbsoluteOffset,i=this.parseAsBinding(e);i||(this.consumeStatementTerminator(),r=this.currentAbsoluteOffset);let a=new O(e.span.start,r);return n.push(new Ne(a,e,s)),i&&n.push(i),n}getDirectiveBoundTarget(){if(this.next===Se||this.peekKeywordAs()||this.peekKeywordLet())return null;let e=this.parsePipe(),{start:n,end:s}=e.span,r=this.input.substring(n,s);return new U(e,r,V(this.parseSourceSpan),this.absoluteOffset+n,this.errors)}parseAsBinding(e){if(!this.peekKeywordAs())return null;this.advance();let n=this.expectTemplateBindingKey();this.consumeStatementTerminator();let s=new O(e.span.start,this.currentAbsoluteOffset);return new ue(s,n,e)}parseLetBinding(){if(!this.peekKeywordLet())return null;let e=this.currentAbsoluteOffset;this.advance();let n=this.expectTemplateBindingKey(),s=null;this.consumeOptionalOperator("=")&&(s=this.expectTemplateBindingKey()),this.consumeStatementTerminator();let r=new O(e,this.currentAbsoluteOffset);return new ue(r,n,s)}parseNoInterpolationTaggedTemplateLiteral(e,n){let s=this.parseNoInterpolationTemplateLiteral();return new We(this.span(n),this.sourceSpan(n),e,s)}parseNoInterpolationTemplateLiteral(){let e=this.next.strValue,n=this.inputIndex;this.advance();let s=this.span(n),r=this.sourceSpan(n);return new qe(s,r,[new je(s,r,e)],[])}parseTaggedTemplateLiteral(e,n){let s=this.parseTemplateLiteral();return new We(this.span(n),this.sourceSpan(n),e,s)}parseTemplateLiteral(){let e=[],n=[],s=this.inputIndex;for(;this.next!==Se;){let r=this.next;if(r.isTemplateLiteralPart()||r.isTemplateLiteralEnd()){let i=this.inputIndex;if(this.advance(),e.push(new je(this.span(i),this.sourceSpan(i),r.strValue)),r.isTemplateLiteralEnd())break}else if(r.isTemplateLiteralInterpolationStart()){this.advance(),this.rbracesExpected++;let i=this.parsePipe();i instanceof A?this.error("Template literal interpolation cannot be empty"):n.push(i),this.rbracesExpected--}else this.advance()}return new qe(this.span(s),this.sourceSpan(s),e,n)}parseRegularExpressionLiteral(){let e=this.next;if(this.advance(),!e.isRegExpBody())return new A(this.span(this.inputIndex),this.sourceSpan(this.inputIndex));let n=null;if(this.next.isRegExpFlags()){n=this.next,this.advance();let i=new Set;for(let a=0;a<n.strValue.length;a++){let p=n.strValue[a];ps.has(p)?i.has(p)?this.error(`Duplicate regular expression flag "${p}"`,n.index+a):i.add(p):this.error(`Unsupported regular expression flag "${p}". The supported flags are: `+Array.from(ps,h=>`"${h}"`).join(", "),n.index+a)}}let s=e.index,r=n?n.end:e.end;return new Ht(this.span(s,r),this.sourceSpan(s,r),e.strValue,n?n.strValue:null)}parseArrowFunction(e){let n;if(this.next.isIdentifier()){let r=this.next;this.advance(),n=[this.getArrowFunctionIdentifierArg(r)]}else this.next.isCharacter(X)?(this.rparensExpected++,this.advance(),n=this.parseArrowFunctionParameters(),this.rparensExpected--):(n=[],this.error(`Unexpected token ${this.next}`));this.expectOperator("=>");let s;if(this.next.isCharacter(ke))this.error("Multi-line arrow functions are not supported. If you meant to return an object literal, wrap it with parentheses."),s=new A(this.span(e),this.sourceSpan(e));else{let r=this.parseFlags;this.parseFlags=1,s=this.parseExpression(),this.parseFlags=r}return new Ut(this.span(e),this.sourceSpan(e),n,s)}parseArrowFunctionParameters(){let e=[];if(!this.consumeOptionalCharacter(N))for(;this.next!==Se;)if(this.next.isIdentifier()){let n=this.next;if(this.advance(),e.push(this.getArrowFunctionIdentifierArg(n)),this.consumeOptionalCharacter(N))break;this.expectCharacter(F)}else{this.error(`Unexpected token ${this.next}`);break}return e}getArrowFunctionIdentifierArg(e){return new Vt(e.strValue,this.span(e.index),this.sourceSpan(e.index))}isArrowFunction(){let e=this.index,n=this.tokens;if(e>n.length-2)return!1;if(n[e].isIdentifier()&&n[e+1].isOperator("=>"))return!0;if(n[e].isCharacter(X)){let s=e+1;for(s;s<n.length&&!(!n[s].isIdentifier()&&!n[s].isCharacter(F));s++);return s<n.length-1&&n[s].isCharacter(N)&&n[s+1].isOperator("=>")}return!1}consumeStatementTerminator(){this.consumeOptionalCharacter(Ee)||this.consumeOptionalCharacter(F)}error(e,n=this.index){this.errors.push(re(e,this.input,this.getErrorLocationText(n),this.parseSourceSpan)),this.skip()}getErrorLocationText(e){return e<this.tokens.length?`at column ${this.tokens[e].index+1} in`:"at the end of the expression"}_reportErrorForPrivateIdentifier(e,n){let s=`Private identifiers are not supported. Unexpected private identifier: ${e}`;n!==null&&(s+=`, ${n}`),this.error(s)}skip(){let e=this.next;for(;this.index<this.tokens.length&&!e.isCharacter(Ee)&&!e.isOperator("|")&&(this.rparensExpected<=0||!e.isCharacter(N))&&(this.rbracesExpected<=0||!e.isCharacter(ne))&&(this.rbracketsExpected<=0||!e.isCharacter(Q))&&(!(this.context&se.Writable)||!this.isAssignmentOperator(e));)this.next.isError()&&this.errors.push(re(this.next.toString(),this.input,this.getErrorLocationText(this.next.index),this.parseSourceSpan)),this.advance(),e=this.next}};function re(t,e,n,s){n.length>0&&(n=` ${n} `);let r=V(s),i=`Parser Error: ${t}${n}[${e}] in ${r}`;return new Pe(s,i)}var Kt=class extends Wt{errors=[];visitPipe(){this.errors.push("pipes")}};function Oi(t){let e=new Map,n=0,s=0,r=0;for(;r<t.length;){let i=t[r];if(i.type===9){let[a,p]=i.parts;n+=p.length,s+=a.length}else{let a=i.parts.reduce((p,h)=>p+h.length,0);s+=a,n+=a}e.set(s,n),r++}return e}var Di=new Map(Object.entries({class:"className",for:"htmlFor",formaction:"formAction",innerHtml:"innerHTML",readonly:"readOnly",tabindex:"tabIndex","aria-activedescendant":"ariaActiveDescendantElement","aria-atomic":"ariaAtomic","aria-autocomplete":"ariaAutoComplete","aria-busy":"ariaBusy","aria-checked":"ariaChecked","aria-colcount":"ariaColCount","aria-colindex":"ariaColIndex","aria-colindextext":"ariaColIndexText","aria-colspan":"ariaColSpan","aria-controls":"ariaControlsElements","aria-current":"ariaCurrent","aria-describedby":"ariaDescribedByElements","aria-description":"ariaDescription","aria-details":"ariaDetailsElements","aria-disabled":"ariaDisabled","aria-errormessage":"ariaErrorMessageElements","aria-expanded":"ariaExpanded","aria-flowto":"ariaFlowToElements","aria-haspopup":"ariaHasPopup","aria-hidden":"ariaHidden","aria-invalid":"ariaInvalid","aria-keyshortcuts":"ariaKeyShortcuts","aria-label":"ariaLabel","aria-labelledby":"ariaLabelledByElements","aria-level":"ariaLevel","aria-live":"ariaLive","aria-modal":"ariaModal","aria-multiline":"ariaMultiLine","aria-multiselectable":"ariaMultiSelectable","aria-orientation":"ariaOrientation","aria-owns":"ariaOwnsElements","aria-placeholder":"ariaPlaceholder","aria-posinset":"ariaPosInSet","aria-pressed":"ariaPressed","aria-readonly":"ariaReadOnly","aria-required":"ariaRequired","aria-roledescription":"ariaRoleDescription","aria-rowcount":"ariaRowCount","aria-rowindex":"ariaRowIndex","aria-rowindextext":"ariaRowIndexText","aria-rowspan":"ariaRowSpan","aria-selected":"ariaSelected","aria-setsize":"ariaSetSize","aria-sort":"ariaSort","aria-valuemax":"ariaValueMax","aria-valuemin":"ariaValueMin","aria-valuenow":"ariaValueNow","aria-valuetext":"ariaValueText"})),Ro=Array.from(Di).reduce((t,[e,n])=>(t.set(e,n),t),new Map);var $o=new he(new Le);function L(t){return e=>e.kind===t}function be(t,e){return n=>n.kind===t&&e===n.expression instanceof pe}function Bi(t){return(t.kind===l.Property||t.kind===l.TwoWayProperty)&&!(t.expression instanceof pe)}var Oo=[{test:L(l.StyleMap),transform:Ke},{test:L(l.ClassMap),transform:Ke},{test:L(l.StyleProp)},{test:L(l.ClassProp)},{test:be(l.Attribute,!0)},{test:be(l.Property,!0)},{test:Bi},{test:be(l.Attribute,!1)},{test:L(l.Control)}],Do=[{test:be(l.DomProperty,!0)},{test:be(l.DomProperty,!1)},{test:L(l.Attribute)},{test:L(l.StyleMap),transform:Ke},{test:L(l.ClassMap),transform:Ke},{test:L(l.StyleProp)},{test:L(l.ClassProp)}],Bo=new Set([l.Listener,l.TwoWayListener,l.AnimationListener,l.StyleMap,l.ClassMap,l.StyleProp,l.ClassProp,l.Property,l.TwoWayProperty,l.DomProperty,l.Attribute,l.Animation,l.Control]);function Ke(t){return t.slice(t.length-1)}var Fo=new Map([[$.Idle,{none:c.deferOnIdle,prefetch:c.deferPrefetchOnIdle,hydrate:c.deferHydrateOnIdle}],[$.Immediate,{none:c.deferOnImmediate,prefetch:c.deferPrefetchOnImmediate,hydrate:c.deferHydrateOnImmediate}],[$.Timer,{none:c.deferOnTimer,prefetch:c.deferPrefetchOnTimer,hydrate:c.deferHydrateOnTimer}],[$.Hover,{none:c.deferOnHover,prefetch:c.deferPrefetchOnHover,hydrate:c.deferHydrateOnHover}],[$.Interaction,{none:c.deferOnInteraction,prefetch:c.deferPrefetchOnInteraction,hydrate:c.deferHydrateOnInteraction}],[$.Viewport,{none:c.deferOnViewport,prefetch:c.deferPrefetchOnViewport,hydrate:c.deferHydrateOnViewport}],[$.Never,{none:c.deferHydrateNever,prefetch:c.deferHydrateNever,hydrate:c.deferHydrateNever}]]);var Vo=[c.pipeBind1,c.pipeBind2,c.pipeBind3,c.pipeBind4];var Uo={constant:[c.interpolate,c.interpolate1,c.interpolate2,c.interpolate3,c.interpolate4,c.interpolate5,c.interpolate6,c.interpolate7,c.interpolate8],variable:c.interpolateV,mapping:t=>{if(t%2===0)throw new Error("Expected odd number of arguments");return(t-1)/2}};var Ho=new Map([["window",c.resolveWindow],["document",c.resolveDocument],["body",c.resolveBody]]);var Wo=new Map([[P.HTML,c.sanitizeHtml],[P.RESOURCE_URL,c.sanitizeResourceUrl],[P.SCRIPT,c.sanitizeScript],[P.STYLE,c.sanitizeStyle],[P.URL,c.sanitizeUrl],[P.ATTRIBUTE_NO_BINDING,c.validateAttribute]]),qo=new Map([[P.HTML,c.trustConstantHtml],[P.RESOURCE_URL,c.trustConstantResourceUrl]]);var hs;(function(t){t[t.None=0]="None",t[t.ViewContextRead=1]="ViewContextRead",t[t.ViewContextWrite=2]="ViewContextWrite",t[t.SideEffectful=4]="SideEffectful"})(hs||(hs={}));var jo=new Set([l.Container,l.ContainerStart,l.ContainerEnd,l.Element,l.ElementStart,l.ElementEnd,l.Template]);var zo=new Map([[M.Property,R.Property],[M.TwoWay,R.TwoWayProperty],[M.Attribute,R.Attribute],[M.Class,R.ClassName],[M.Style,R.StyleProperty],[M.LegacyAnimation,R.LegacyAnimation],[M.Animation,R.Animation]]);var Go=Symbol("queryAdvancePlaceholder");var fs;(function(t){t[t.NG_CONTENT=0]="NG_CONTENT",t[t.STYLE=1]="STYLE",t[t.STYLESHEET=2]="STYLESHEET",t[t.SCRIPT=3]="SCRIPT",t[t.OTHER=4]="OTHER"})(fs||(fs={}));var ds;(function(t){t.IDLE="idle",t.TIMER="timer",t.INTERACTION="interaction",t.IMMEDIATE="immediate",t.HOVER="hover",t.VIEWPORT="viewport",t.NEVER="never"})(ds||(ds={}));var Ns="%COMP%",Xo=`_nghost-${Ns}`,Jo=`_ngcontent-${Ns}`;var ms;(function(t){t[t.Extract=0]="Extract",t[t.Merge=1]="Merge"})(ms||(ms={}));var gs;(function(t){t[t.Selector=0]="Selector",t[t.HostDirective=1]="HostDirective"})(gs||(gs={}));var Yo=new bt("21.2.8");var Fi="test.html";function Ps(t){let e=new Xe(t,Fi),n=new Ge(e,0,0,0),s=n.moveBy(t.length);return{text:t,file:e,start:n,end:s,sourceSpan:new Je(n,s)}}var Vi;function Ls(){return Vi??(Vi=new he(new Le))}var Ui=t=>he.prototype._commentStart(t);function Hi(t){let e=Ui(t);return e===null?[]:[{type:"CommentLine",value:t.slice(e+2),...Re({start:e,end:t.length})}]}function Ms(t){let{result:e}=t;if(e.errors.length!==0){let[n]=e.errors;if(!(n instanceof Pe))throw n;let{message:s}=n;{let a=s.match(/ in .*?@\d+:\d+$/);a&&(s=s.slice(0,a.index))}let r=t.start;{let a=s.match(/at column (?<index>\d+)/);a&&(s=s.slice(0,a.index),r=r.moveBy(Number(a.groups.index)))}let i=new SyntaxError(s.trim(),{cause:n});throw Object.assign(i,{location:r,span:n.span}),i.cause??(i.cause=n),i}return t}var tt=t=>e=>{let n=Ps(e);return Ms({...n,result:Ls()[t](e,n.sourceSpan,0),comments:Hi(e)})},Rs=tt("parseAction"),$s=tt("parseBinding"),Os=tt("parseSimpleBinding"),Ds=tt("parseInterpolationExpression"),Bs=t=>{let e=Ps(t);return Ms({...e,result:Ls().parseTemplateBindings("",t,e.sourceSpan,0,0),comments:[]})};var nt=class{text;constructor(t){this.text=t}getCharacterIndex(t,e){return Sn(this.text,t,e)}transformSpan(t){return Re(t)}createNode(t,e){let n=t.start,s=t.end,r=t.range;e&&(Array.isArray(e)?([n,s]=e,r=e):({start:n,end:s}=e.sourceSpan??e,r=[n,s]));r?[n,s]=r:typeof n=="number"&&typeof s=="number"&&(r=[n,s]);if(!(typeof n=="number"&&typeof s=="number"&&r))throw new Error("Missing location information");let i={...t,start:n,end:s,range:r};switch(i.type){case"NumericLiteral":case"StringLiteral":case"RegExpLiteral":{let a=this.text.slice(n,s),{value:p}=i;i.extra={...i.extra,raw:a,rawValue:p};break}}return i}};var Fs=Object.defineProperty,Vs=(t,e)=>{let n={};for(var s in t)Fs(n,s,{get:t[s],enumerable:!0});return e&&Fs(n,Symbol.toStringTag,{value:"Module"}),n};var Us=(t,e)=>({type:"ArrayExpression",elements:e.transformChildren(t.expressions)});var Wi={id:null,generator:!1,async:!1,expression:!0},Hs=(t,e)=>({type:"ArrowFunctionExpression",params:t.parameters.map(n=>e.createNode({type:"Identifier",name:n.name},n.sourceSpan)),body:e.transformChild(t.body),...Wi});var Ws=(t,e)=>e.transformChild(t.ast);var qi=t=>t==="&&"||t==="||"||t==="??",qs=(t,e)=>{let{operation:n}=t,[s,r]=e.transformChildren([t.left,t.right]);return qi(n)?{type:"LogicalExpression",operator:n,left:s,right:r}:E.isAssignmentOperation(n)?{type:"AssignmentExpression",left:s,right:r,operator:n}:{left:s,right:r,type:"BinaryExpression",operator:n}};var ji={optional:!1},zi={optional:!0},js=({optional:t})=>(e,n)=>{let s=n.transformChildren(e.args),r=n.transformChild(e.receiver);return t||ve(r)?{type:"OptionalCallExpression",callee:r,arguments:s,optional:t}:{type:"CallExpression",callee:r,arguments:s}},zs=js(ji),Gs=js(zi);var Xs=(t,e)=>({type:"NGChainedExpression",expressions:e.transformChildren(t.expressions)});var Js=(t,e)=>{let[n,s,r]=e.transformChildren([t.condition,t.trueExp,t.falseExp]);return{type:"ConditionalExpression",test:n,consequent:s,alternate:r}};var Ys=()=>({type:"NGEmptyExpression"});var Qs=(t,e)=>{let{expressions:n}=t;if(n.length!==1)throw new Error("Unexpected 'Interpolation'");return e.transformChild(n[0])};var Ks=t=>{let{value:e}=t;switch(typeof e){case"boolean":return{type:"BooleanLiteral",value:e};case"number":return{type:"NumericLiteral",value:e};case"object":return{type:"NullLiteral"};case"string":return{type:"StringLiteral",value:e};case"undefined":return{type:"Identifier",name:"undefined"};default:throw new Error(`Unexpected 'LiteralPrimitive' value type ${typeof e}`)}},Zs=t=>({type:"RegExpLiteral",pattern:t.body,flags:t.flags??""});var Gi={computed:!0,optional:!1},Xi={computed:!0,optional:!0},Ji={computed:!1,optional:!1},Yi={computed:!1,optional:!0},st=({computed:t,optional:e})=>(n,s)=>{let{receiver:r}=n,i;if(t){let{key:p}=n;i=s.transformChild(p)}else{let p=r instanceof ce,{name:h,nameSpan:d}=n;if(i=s.create({type:"Identifier",name:h},d,p?s.ancestors:[]),p)return i}let a=s.transformChild(r);return e||ve(a)?{type:"OptionalMemberExpression",optional:e,property:i,object:a,computed:t}:{type:"MemberExpression",property:i,object:a,computed:t}},er=st(Gi),tr=st(Xi),nr=st(Ji),sr=st(Yi);var rr=(t,e)=>({type:"TSNonNullExpression",expression:e.transformChild(t.expression)});var ir=(t,e)=>{let{keys:n,values:s}=t,r=(i,a=t)=>e.create(i,a,[t,...e.ancestors]);return{type:"ObjectExpression",properties:n.map((i,a)=>{let p=s[a],h=[i.sourceSpan.start,p.sourceSpan.end];if(i.kind==="spread")return r({type:"SpreadElement",argument:e.transformChild(p)},h);let d=!!i.isShorthandInitialized;return r({type:"ObjectProperty",key:r(i.quoted?{type:"StringLiteral",value:i.key}:{type:"Identifier",name:i.key},i.sourceSpan),value:e.transformChild(p),shorthand:d,computed:!1,method:!1},h)})}};var or=(t,e)=>e.transformChild(t.expression);var ar=(t,e)=>({type:"NGPipeExpression",left:e.transformChild(t.exp),right:e.create({type:"Identifier",name:t.name},t.nameSpan),arguments:e.transformChildren(t.args)});var lr=(t,e)=>({type:"SpreadElement",argument:e.transformChild(t.expression)});var cr=(t,e)=>({type:"TaggedTemplateExpression",tag:e.transformChild(t.tag),quasi:e.transformChild(t.template)}),ur=(t,e)=>({type:"TemplateLiteral",quasis:e.transformChildren(t.elements),expressions:e.transformChildren(t.expressions)}),pr=(t,e)=>{let[n]=e.ancestors,{elements:s}=n,r=s.indexOf(t),i=r===0,a=r===s.length-1,p=t.sourceSpan.end-(a?1:0),h=t.sourceSpan.start+(i?1:0),d=e.text.slice(h,p);return{type:"TemplateElement",value:{cooked:t.text,raw:d},tail:a,range:[h,p]}};var hr=()=>({type:"ThisExpression"});var sn=t=>(e,n)=>({type:"UnaryExpression",prefix:!0,operator:t,argument:n.transformChild(e.expression)}),fr=sn("!"),dr=sn("typeof"),mr=sn("void"),gr=(t,e)=>({type:"UnaryExpression",prefix:!0,argument:e.transformChild(t.expr),operator:t.operator});var Qi=t=>{throw new Error(`Unexpected node type '${t.constructor.name}'`)},vr=Qi;var wr=Vs({visitASTWithSource:()=>Ws,visitArrowFunction:()=>Hs,visitBinary:()=>qs,visitCall:()=>zs,visitChain:()=>Xs,visitConditional:()=>Js,visitEmptyExpr:()=>Ys,visitImplicitReceiver:()=>vr,visitInterpolation:()=>Qs,visitKeyedRead:()=>er,visitLiteralArray:()=>Us,visitLiteralMap:()=>ir,visitLiteralPrimitive:()=>Ks,visitNonNullAssert:()=>rr,visitParenthesizedExpression:()=>or,visitPipe:()=>ar,visitPrefixNot:()=>fr,visitPropertyRead:()=>nr,visitRegularExpressionLiteral:()=>Zs,visitSafeCall:()=>Gs,visitSafeKeyedRead:()=>tr,visitSafePropertyRead:()=>sr,visitSpreadElement:()=>lr,visitTaggedTemplateLiteral:()=>cr,visitTemplateLiteral:()=>ur,visitTemplateLiteralElement:()=>pr,visitThisReceiver:()=>hr,visitTypeofExpression:()=>dr,visitUnary:()=>gr,visitVoidExpression:()=>mr});var xr=wr;var rt=class rn extends nt{node;ancestors;constructor({node:e,text:n,ancestors:s=[]}){super(n),this.node=e,this.ancestors=s}create(e,n,s=this.ancestors){return s[0]instanceof Ie&&(e.extra={...e.extra,parenthesized:!0}),super.createNode(e,e.range??n??this.node)}transformChild(e){return new rn({node:e,ancestors:[this.node,...this.ancestors],text:this.text}).transform()}transformChildren(e){return e.map(n=>this.transformChild(n))}transform(){let{node:e}=this,n=e.visit(xr,this);return this.create(n,this.node)}static transform(e,n){return new rn({node:e,text:n,ancestors:[]}).transform()}};var Sr=class extends rt{constructor(t){super({node:t,text:t.source})}};var Er=(t,e)=>rt.transform(t,e),yr=t=>new Sr(t).transform();var Cr=(t,e)=>(n,s,...r)=>n|1&&s==null?void 0:(e.call(s)??s[t]).apply(s,r);function Ki(t){return this[t<0?this.length+t:t]}var Zi=Cr("at",function(){if(Array.isArray(this)||typeof this=="string")return Ki}),_r=Zi;function kr(t){return t instanceof Ne}function Tr(t){return t instanceof ue}var de,te,m,br,_,on,an,ln,Ar,Ir,Nr,Pr,me,eo=(me=class extends nt{constructor(n,s){super(s);Me(this,m);Me(this,de);Me(this,te);ct(this,de,n),ct(this,te,s);for(let r of n)v(this,m,Ar).call(this,r)}get expressions(){return v(this,m,Nr).call(this)}},de=new WeakMap,te=new WeakMap,m=new WeakSet,br=function(){return j(this,de)[0].key},_=function(n,s){return wn(me.prototype,this,"createNode").call(this,n,s)},on=function(n){return Er(n,this.text)},an=function(n){return En(n.slice(j(this,m,br).source.length))},ln=function(n){let s=j(this,te);if(s[n.start]!=='"'&&s[n.start]!=="'")return;let r=s[n.start],i=!1;for(let a=n.start+1;a<s.length;a++)switch(s[a]){case r:if(!i){n.end=a+1;return}default:i=!1;break;case"\\":i=!i;break}},Ar=function(n){v(this,m,ln).call(this,n.key.span),Tr(n)&&n.value&&v(this,m,ln).call(this,n.value.span)},Ir=function(n){if(!n.value||n.value.source)return n.value;let s=this.getCharacterIndex(/\S/,n.sourceSpan.start);return{source:"$implicit",span:{start:s,end:s}}},Nr=function(){let n=j(this,de),[s]=n,r=j(this,te).slice(s.sourceSpan.start,s.sourceSpan.end).trim().length===0?n.slice(1):n,i=[],a=null;for(let[p,h]of r.entries()){if(a&&kr(a)&&Tr(h)&&h.value&&h.value.source===a.key.source){let d=v(this,m,_).call(this,{type:"NGMicrosyntaxKey",name:h.key.source},h.key.span),x=(T,C)=>({...T,...this.transformSpan({start:T.start,end:C})}),D=T=>({...x(T,d.end),alias:d}),k=i.pop();if(k.type==="NGMicrosyntaxExpression")i.push(D(k));else if(k.type==="NGMicrosyntaxKeyedExpression"){let T=D(k.expression);i.push(x({...k,expression:T},T.end))}else throw new Error(`Unexpected type ${k.type}`)}else i.push(v(this,m,Pr).call(this,h,p));a=h}return v(this,m,_).call(this,{type:"NGMicrosyntax",body:i},i.length===0?n[0].sourceSpan:{start:i[0].start,end:_r(0,i,-1).end})},Pr=function(n,s){if(kr(n)){let{key:r,value:i}=n;return i?s===0?v(this,m,_).call(this,{type:"NGMicrosyntaxExpression",expression:v(this,m,on).call(this,i.ast),alias:null},i):v(this,m,_).call(this,{type:"NGMicrosyntaxKeyedExpression",key:v(this,m,_).call(this,{type:"NGMicrosyntaxKey",name:v(this,m,an).call(this,r.source)},r.span),expression:v(this,m,_).call(this,{type:"NGMicrosyntaxExpression",expression:v(this,m,on).call(this,i.ast),alias:null},i)},[r.span.start,i.sourceSpan.end]):v(this,m,_).call(this,{type:"NGMicrosyntaxKey",name:v(this,m,an).call(this,r.source)},r.span)}else{let{key:r,sourceSpan:i}=n;if(/^let\s$/.test(j(this,te).slice(i.start,i.start+4))){let{value:a}=n;return v(this,m,_).call(this,{type:"NGMicrosyntaxLet",key:v(this,m,_).call(this,{type:"NGMicrosyntaxKey",name:r.source},r.span),value:a?v(this,m,_).call(this,{type:"NGMicrosyntaxKey",name:a.source},a.span):null},[i.start,a?a.span.end:r.span.end])}else{let a=v(this,m,Ir).call(this,n);return v(this,m,_).call(this,{type:"NGMicrosyntaxAs",key:v(this,m,_).call(this,{type:"NGMicrosyntaxKey",name:a.source},a.span),alias:v(this,m,_).call(this,{type:"NGMicrosyntaxKey",name:r.source},r.span)},[a.span.start,r.span.end])}}},me);function Lr(t,e){return new eo(t,e).expressions}var it=t=>e=>{let{result:n,comments:s}=t(e);return Object.assign(yr(n),{comments:s})},ot=it(Rs),cn=it($s),to=it(Os),un=it(Ds),pn=t=>Lr(Bs(t).result.templateBindings,t);function hn(t){let e=t.range?.[0]??t.start,n=(t.declaration?.decorators??t.decorators)?.[0];return n?Math.min(hn(n),e):e}function Mr(t){return t.range?.[1]??t.end}function at(t){return{astFormat:"estree",parse(e){let n=t(e),{comments:s}=n;return delete n.comments,t===ot&&n.type!=="NGChainedExpression"&&(n={...n,type:"NGChainedExpression",expressions:[n]}),{type:"NGRoot",node:n,comments:s}},locStart:hn,locEnd:Mr}}var no=at(ot),so=at(cn),ro=at(un),io=at(pn);export{Rr as default,fn as parsers};