@restura/core 0.1.0-alpha.6 → 0.1.0-alpha.8

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.
@@ -0,0 +1,1547 @@
1
+ import {
2
+ __publicField,
3
+ __spreadProps,
4
+ __spreadValues
5
+ } from "./chunk-TL4KRYOF.mjs";
6
+
7
+ // ../../node_modules/.pnpm/prettier@3.3.3/node_modules/prettier/plugins/angular.mjs
8
+ var Je = Object.defineProperty;
9
+ var ae = (r3) => {
10
+ throw TypeError(r3);
11
+ };
12
+ var oe = (r3, t) => {
13
+ for (var e in t) Je(r3, e, { get: t[e], enumerable: true });
14
+ };
15
+ var Ut = (r3, t, e) => t.has(r3) || ae("Cannot " + e);
16
+ var O = (r3, t, e) => (Ut(r3, t, "read from private field"), e ? e.call(r3) : t.get(r3));
17
+ var P = (r3, t, e) => t.has(r3) ? ae("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(r3) : t.set(r3, e);
18
+ var Y = (r3, t, e, s) => (Ut(r3, t, "write to private field"), s ? s.call(r3, e) : t.set(r3, e), e);
19
+ var c = (r3, t, e) => (Ut(r3, t, "access private method"), e);
20
+ var ne = {};
21
+ oe(ne, { parsers: () => ie });
22
+ var ie = {};
23
+ oe(ie, { __ng_action: () => js, __ng_binding: () => Ys, __ng_directive: () => Js, __ng_interpolation: () => Zs });
24
+ var Z = class {
25
+ constructor(t, e, s, i) {
26
+ this.input = e, this.errLocation = s, this.ctxLocation = i, this.message = `Parser Error: ${t} ${s} [${e}] in ${i}`;
27
+ }
28
+ };
29
+ var b = class {
30
+ constructor(t, e) {
31
+ this.start = t, this.end = e;
32
+ }
33
+ toAbsolute(t) {
34
+ return new L(t + this.start, t + this.end);
35
+ }
36
+ };
37
+ var m = class {
38
+ constructor(t, e) {
39
+ this.span = t, this.sourceSpan = e;
40
+ }
41
+ toString() {
42
+ return "AST";
43
+ }
44
+ };
45
+ var J = class extends m {
46
+ constructor(t, e, s) {
47
+ super(t, e), this.nameSpan = s;
48
+ }
49
+ };
50
+ var $ = class extends m {
51
+ visit(t, e = null) {
52
+ }
53
+ };
54
+ var K = class extends m {
55
+ visit(t, e = null) {
56
+ return t.visitImplicitReceiver(this, e);
57
+ }
58
+ };
59
+ var Lt = class extends K {
60
+ visit(t, e = null) {
61
+ var s;
62
+ return (s = t.visitThisReceiver) == null ? void 0 : s.call(t, this, e);
63
+ }
64
+ };
65
+ var X = class extends m {
66
+ constructor(t, e, s) {
67
+ super(t, e), this.expressions = s;
68
+ }
69
+ visit(t, e = null) {
70
+ return t.visitChain(this, e);
71
+ }
72
+ };
73
+ var tt = class extends m {
74
+ constructor(t, e, s, i, n) {
75
+ super(t, e), this.condition = s, this.trueExp = i, this.falseExp = n;
76
+ }
77
+ visit(t, e = null) {
78
+ return t.visitConditional(this, e);
79
+ }
80
+ };
81
+ var M = class extends J {
82
+ constructor(t, e, s, i, n) {
83
+ super(t, e, s), this.receiver = i, this.name = n;
84
+ }
85
+ visit(t, e = null) {
86
+ return t.visitPropertyRead(this, e);
87
+ }
88
+ };
89
+ var et = class extends J {
90
+ constructor(t, e, s, i, n, a) {
91
+ super(t, e, s), this.receiver = i, this.name = n, this.value = a;
92
+ }
93
+ visit(t, e = null) {
94
+ return t.visitPropertyWrite(this, e);
95
+ }
96
+ };
97
+ var _ = class extends J {
98
+ constructor(t, e, s, i, n) {
99
+ super(t, e, s), this.receiver = i, this.name = n;
100
+ }
101
+ visit(t, e = null) {
102
+ return t.visitSafePropertyRead(this, e);
103
+ }
104
+ };
105
+ var st = class extends m {
106
+ constructor(t, e, s, i) {
107
+ super(t, e), this.receiver = s, this.key = i;
108
+ }
109
+ visit(t, e = null) {
110
+ return t.visitKeyedRead(this, e);
111
+ }
112
+ };
113
+ var U = class extends m {
114
+ constructor(t, e, s, i) {
115
+ super(t, e), this.receiver = s, this.key = i;
116
+ }
117
+ visit(t, e = null) {
118
+ return t.visitSafeKeyedRead(this, e);
119
+ }
120
+ };
121
+ var rt = class extends m {
122
+ constructor(t, e, s, i, n) {
123
+ super(t, e), this.receiver = s, this.key = i, this.value = n;
124
+ }
125
+ visit(t, e = null) {
126
+ return t.visitKeyedWrite(this, e);
127
+ }
128
+ };
129
+ var it = class extends J {
130
+ constructor(t, e, s, i, n, a) {
131
+ super(t, e, a), this.exp = s, this.name = i, this.args = n;
132
+ }
133
+ visit(t, e = null) {
134
+ return t.visitPipe(this, e);
135
+ }
136
+ };
137
+ var E = class extends m {
138
+ constructor(t, e, s) {
139
+ super(t, e), this.value = s;
140
+ }
141
+ visit(t, e = null) {
142
+ return t.visitLiteralPrimitive(this, e);
143
+ }
144
+ };
145
+ var nt = class extends m {
146
+ constructor(t, e, s) {
147
+ super(t, e), this.expressions = s;
148
+ }
149
+ visit(t, e = null) {
150
+ return t.visitLiteralArray(this, e);
151
+ }
152
+ };
153
+ var at = class extends m {
154
+ constructor(t, e, s, i) {
155
+ super(t, e), this.keys = s, this.values = i;
156
+ }
157
+ visit(t, e = null) {
158
+ return t.visitLiteralMap(this, e);
159
+ }
160
+ };
161
+ var ot = class extends m {
162
+ constructor(t, e, s, i) {
163
+ super(t, e), this.strings = s, this.expressions = i;
164
+ }
165
+ visit(t, e = null) {
166
+ return t.visitInterpolation(this, e);
167
+ }
168
+ };
169
+ var A = class extends m {
170
+ constructor(t, e, s, i, n) {
171
+ super(t, e), this.operation = s, this.left = i, this.right = n;
172
+ }
173
+ visit(t, e = null) {
174
+ return t.visitBinary(this, e);
175
+ }
176
+ };
177
+ var F = class r extends A {
178
+ static createMinus(t, e, s) {
179
+ return new r(t, e, "-", s, "-", new E(t, e, 0), s);
180
+ }
181
+ static createPlus(t, e, s) {
182
+ return new r(t, e, "+", s, "-", s, new E(t, e, 0));
183
+ }
184
+ constructor(t, e, s, i, n, a, o) {
185
+ super(t, e, n, a, o), this.operator = s, this.expr = i, this.left = null, this.right = null, this.operation = null;
186
+ }
187
+ visit(t, e = null) {
188
+ return t.visitUnary !== void 0 ? t.visitUnary(this, e) : t.visitBinary(this, e);
189
+ }
190
+ };
191
+ var ct = class extends m {
192
+ constructor(t, e, s) {
193
+ super(t, e), this.expression = s;
194
+ }
195
+ visit(t, e = null) {
196
+ return t.visitPrefixNot(this, e);
197
+ }
198
+ };
199
+ var ht = class extends m {
200
+ constructor(t, e, s) {
201
+ super(t, e), this.expression = s;
202
+ }
203
+ visit(t, e = null) {
204
+ return t.visitNonNullAssert(this, e);
205
+ }
206
+ };
207
+ var pt = class extends m {
208
+ constructor(t, e, s, i, n) {
209
+ super(t, e), this.receiver = s, this.args = i, this.argumentSpan = n;
210
+ }
211
+ visit(t, e = null) {
212
+ return t.visitCall(this, e);
213
+ }
214
+ };
215
+ var D = class extends m {
216
+ constructor(t, e, s, i, n) {
217
+ super(t, e), this.receiver = s, this.args = i, this.argumentSpan = n;
218
+ }
219
+ visit(t, e = null) {
220
+ return t.visitSafeCall(this, e);
221
+ }
222
+ };
223
+ var L = class {
224
+ constructor(t, e) {
225
+ this.start = t, this.end = e;
226
+ }
227
+ };
228
+ var R = class extends m {
229
+ constructor(t, e, s, i, n) {
230
+ super(new b(0, e === null ? 0 : e.length), new L(i, e === null ? i : i + e.length)), this.ast = t, this.source = e, this.location = s, this.errors = n;
231
+ }
232
+ visit(t, e = null) {
233
+ return t.visitASTWithSource ? t.visitASTWithSource(this, e) : this.ast.visit(t, e);
234
+ }
235
+ toString() {
236
+ return `${this.source} in ${this.location}`;
237
+ }
238
+ };
239
+ var W = class {
240
+ constructor(t, e, s) {
241
+ this.sourceSpan = t, this.key = e, this.value = s;
242
+ }
243
+ };
244
+ var ut = class {
245
+ constructor(t, e, s) {
246
+ this.sourceSpan = t, this.key = e, this.value = s;
247
+ }
248
+ };
249
+ var Rt = class {
250
+ visit(t, e) {
251
+ t.visit(this, e);
252
+ }
253
+ visitUnary(t, e) {
254
+ this.visit(t.expr, e);
255
+ }
256
+ visitBinary(t, e) {
257
+ this.visit(t.left, e), this.visit(t.right, e);
258
+ }
259
+ visitChain(t, e) {
260
+ this.visitAll(t.expressions, e);
261
+ }
262
+ visitConditional(t, e) {
263
+ this.visit(t.condition, e), this.visit(t.trueExp, e), this.visit(t.falseExp, e);
264
+ }
265
+ visitPipe(t, e) {
266
+ this.visit(t.exp, e), this.visitAll(t.args, e);
267
+ }
268
+ visitImplicitReceiver(t, e) {
269
+ }
270
+ visitThisReceiver(t, e) {
271
+ }
272
+ visitInterpolation(t, e) {
273
+ this.visitAll(t.expressions, e);
274
+ }
275
+ visitKeyedRead(t, e) {
276
+ this.visit(t.receiver, e), this.visit(t.key, e);
277
+ }
278
+ visitKeyedWrite(t, e) {
279
+ this.visit(t.receiver, e), this.visit(t.key, e), this.visit(t.value, e);
280
+ }
281
+ visitLiteralArray(t, e) {
282
+ this.visitAll(t.expressions, e);
283
+ }
284
+ visitLiteralMap(t, e) {
285
+ this.visitAll(t.values, e);
286
+ }
287
+ visitLiteralPrimitive(t, e) {
288
+ }
289
+ visitPrefixNot(t, e) {
290
+ this.visit(t.expression, e);
291
+ }
292
+ visitNonNullAssert(t, e) {
293
+ this.visit(t.expression, e);
294
+ }
295
+ visitPropertyRead(t, e) {
296
+ this.visit(t.receiver, e);
297
+ }
298
+ visitPropertyWrite(t, e) {
299
+ this.visit(t.receiver, e), this.visit(t.value, e);
300
+ }
301
+ visitSafePropertyRead(t, e) {
302
+ this.visit(t.receiver, e);
303
+ }
304
+ visitSafeKeyedRead(t, e) {
305
+ this.visit(t.receiver, e), this.visit(t.key, e);
306
+ }
307
+ visitCall(t, e) {
308
+ this.visit(t.receiver, e), this.visitAll(t.args, e);
309
+ }
310
+ visitSafeCall(t, e) {
311
+ this.visit(t.receiver, e), this.visitAll(t.args, e);
312
+ }
313
+ visitAll(t, e) {
314
+ for (let s of t) this.visit(s, e);
315
+ }
316
+ };
317
+ var ce;
318
+ (function(r3) {
319
+ r3[r3.DEFAULT = 0] = "DEFAULT", r3[r3.LITERAL_ATTR = 1] = "LITERAL_ATTR", r3[r3.ANIMATION = 2] = "ANIMATION", r3[r3.TWO_WAY = 3] = "TWO_WAY";
320
+ })(ce || (ce = {}));
321
+ var he;
322
+ (function(r3) {
323
+ r3[r3.Regular = 0] = "Regular", r3[r3.Animation = 1] = "Animation", r3[r3.TwoWay = 2] = "TwoWay";
324
+ })(he || (he = {}));
325
+ var pe;
326
+ (function(r3) {
327
+ r3[r3.Property = 0] = "Property", r3[r3.Attribute = 1] = "Attribute", r3[r3.Class = 2] = "Class", r3[r3.Style = 3] = "Style", r3[r3.Animation = 4] = "Animation", r3[r3.TwoWay = 5] = "TwoWay";
328
+ })(pe || (pe = {}));
329
+ function ue(r3) {
330
+ return r3 >= 9 && r3 <= 32 || r3 == 160;
331
+ }
332
+ function B(r3) {
333
+ return 48 <= r3 && r3 <= 57;
334
+ }
335
+ function le(r3) {
336
+ return r3 >= 97 && r3 <= 122 || r3 >= 65 && r3 <= 90;
337
+ }
338
+ function Ft(r3) {
339
+ return r3 === 39 || r3 === 34 || r3 === 96;
340
+ }
341
+ var l;
342
+ (function(r3) {
343
+ r3[r3.Character = 0] = "Character", r3[r3.Identifier = 1] = "Identifier", r3[r3.PrivateIdentifier = 2] = "PrivateIdentifier", r3[r3.Keyword = 3] = "Keyword", r3[r3.String = 4] = "String", r3[r3.Operator = 5] = "Operator", r3[r3.Number = 6] = "Number", r3[r3.Error = 7] = "Error";
344
+ })(l || (l = {}));
345
+ var ks = ["var", "let", "as", "null", "undefined", "true", "false", "if", "else", "this"];
346
+ var yt = class {
347
+ tokenize(t) {
348
+ let e = new Gt(t), s = [], i = e.scanToken();
349
+ for (; i != null; ) s.push(i), i = e.scanToken();
350
+ return s;
351
+ }
352
+ };
353
+ var I = class {
354
+ constructor(t, e, s, i, n) {
355
+ this.index = t, this.end = e, this.type = s, this.numValue = i, this.strValue = n;
356
+ }
357
+ isCharacter(t) {
358
+ return this.type == l.Character && this.numValue == t;
359
+ }
360
+ isNumber() {
361
+ return this.type == l.Number;
362
+ }
363
+ isString() {
364
+ return this.type == l.String;
365
+ }
366
+ isOperator(t) {
367
+ return this.type == l.Operator && this.strValue == t;
368
+ }
369
+ isIdentifier() {
370
+ return this.type == l.Identifier;
371
+ }
372
+ isPrivateIdentifier() {
373
+ return this.type == l.PrivateIdentifier;
374
+ }
375
+ isKeyword() {
376
+ return this.type == l.Keyword;
377
+ }
378
+ isKeywordLet() {
379
+ return this.type == l.Keyword && this.strValue == "let";
380
+ }
381
+ isKeywordAs() {
382
+ return this.type == l.Keyword && this.strValue == "as";
383
+ }
384
+ isKeywordNull() {
385
+ return this.type == l.Keyword && this.strValue == "null";
386
+ }
387
+ isKeywordUndefined() {
388
+ return this.type == l.Keyword && this.strValue == "undefined";
389
+ }
390
+ isKeywordTrue() {
391
+ return this.type == l.Keyword && this.strValue == "true";
392
+ }
393
+ isKeywordFalse() {
394
+ return this.type == l.Keyword && this.strValue == "false";
395
+ }
396
+ isKeywordThis() {
397
+ return this.type == l.Keyword && this.strValue == "this";
398
+ }
399
+ isError() {
400
+ return this.type == l.Error;
401
+ }
402
+ toNumber() {
403
+ return this.type == l.Number ? this.numValue : -1;
404
+ }
405
+ toString() {
406
+ switch (this.type) {
407
+ case l.Character:
408
+ case l.Identifier:
409
+ case l.Keyword:
410
+ case l.Operator:
411
+ case l.PrivateIdentifier:
412
+ case l.String:
413
+ case l.Error:
414
+ return this.strValue;
415
+ case l.Number:
416
+ return this.numValue.toString();
417
+ default:
418
+ return null;
419
+ }
420
+ }
421
+ };
422
+ function ge(r3, t, e) {
423
+ return new I(r3, t, l.Character, e, String.fromCharCode(e));
424
+ }
425
+ function Ns(r3, t, e) {
426
+ return new I(r3, t, l.Identifier, 0, e);
427
+ }
428
+ function Ls(r3, t, e) {
429
+ return new I(r3, t, l.PrivateIdentifier, 0, e);
430
+ }
431
+ function Rs(r3, t, e) {
432
+ return new I(r3, t, l.Keyword, 0, e);
433
+ }
434
+ function Wt(r3, t, e) {
435
+ return new I(r3, t, l.Operator, 0, e);
436
+ }
437
+ function Ps(r3, t, e) {
438
+ return new I(r3, t, l.String, 0, e);
439
+ }
440
+ function bs(r3, t, e) {
441
+ return new I(r3, t, l.Number, e, "");
442
+ }
443
+ function Ks(r3, t, e) {
444
+ return new I(r3, t, l.Error, 0, e);
445
+ }
446
+ var Bt = new I(-1, -1, l.Character, 0, "");
447
+ var Gt = class {
448
+ constructor(t) {
449
+ this.input = t, this.peek = 0, this.index = -1, this.length = t.length, this.advance();
450
+ }
451
+ advance() {
452
+ this.peek = ++this.index >= this.length ? 0 : this.input.charCodeAt(this.index);
453
+ }
454
+ scanToken() {
455
+ let t = this.input, e = this.length, s = this.peek, i = this.index;
456
+ for (; s <= 32; ) if (++i >= e) {
457
+ s = 0;
458
+ break;
459
+ } else s = t.charCodeAt(i);
460
+ if (this.peek = s, this.index = i, i >= e) return null;
461
+ if (me(s)) return this.scanIdentifier();
462
+ if (B(s)) return this.scanNumber(i);
463
+ let n = i;
464
+ switch (s) {
465
+ case 46:
466
+ return this.advance(), B(this.peek) ? this.scanNumber(n) : ge(n, this.index, 46);
467
+ case 40:
468
+ case 41:
469
+ case 123:
470
+ case 125:
471
+ case 91:
472
+ case 93:
473
+ case 44:
474
+ case 58:
475
+ case 59:
476
+ return this.scanCharacter(n, s);
477
+ case 39:
478
+ case 34:
479
+ return this.scanString();
480
+ case 35:
481
+ return this.scanPrivateIdentifier();
482
+ case 43:
483
+ case 45:
484
+ case 42:
485
+ case 47:
486
+ case 37:
487
+ case 94:
488
+ return this.scanOperator(n, String.fromCharCode(s));
489
+ case 63:
490
+ return this.scanQuestion(n);
491
+ case 60:
492
+ case 62:
493
+ return this.scanComplexOperator(n, String.fromCharCode(s), 61, "=");
494
+ case 33:
495
+ case 61:
496
+ return this.scanComplexOperator(n, String.fromCharCode(s), 61, "=", 61, "=");
497
+ case 38:
498
+ return this.scanComplexOperator(n, "&", 38, "&");
499
+ case 124:
500
+ return this.scanComplexOperator(n, "|", 124, "|");
501
+ case 160:
502
+ for (; ue(this.peek); ) this.advance();
503
+ return this.scanToken();
504
+ }
505
+ return this.advance(), this.error(`Unexpected character [${String.fromCharCode(s)}]`, 0);
506
+ }
507
+ scanCharacter(t, e) {
508
+ return this.advance(), ge(t, this.index, e);
509
+ }
510
+ scanOperator(t, e) {
511
+ return this.advance(), Wt(t, this.index, e);
512
+ }
513
+ scanComplexOperator(t, e, s, i, n, a) {
514
+ this.advance();
515
+ let o = e;
516
+ return this.peek == s && (this.advance(), o += i), n != null && this.peek == n && (this.advance(), o += a), Wt(t, this.index, o);
517
+ }
518
+ scanIdentifier() {
519
+ let t = this.index;
520
+ for (this.advance(); Se(this.peek); ) this.advance();
521
+ let e = this.input.substring(t, this.index);
522
+ return ks.indexOf(e) > -1 ? Rs(t, this.index, e) : Ns(t, this.index, e);
523
+ }
524
+ scanPrivateIdentifier() {
525
+ let t = this.index;
526
+ if (this.advance(), !me(this.peek)) return this.error("Invalid character [#]", -1);
527
+ for (; Se(this.peek); ) this.advance();
528
+ let e = this.input.substring(t, this.index);
529
+ return Ls(t, this.index, e);
530
+ }
531
+ scanNumber(t) {
532
+ let e = this.index === t, s = false;
533
+ for (this.advance(); ; ) {
534
+ if (!B(this.peek)) if (this.peek === 95) {
535
+ if (!B(this.input.charCodeAt(this.index - 1)) || !B(this.input.charCodeAt(this.index + 1))) return this.error("Invalid numeric separator", 0);
536
+ s = true;
537
+ } else if (this.peek === 46) e = false;
538
+ else if (Bs(this.peek)) {
539
+ if (this.advance(), Ts(this.peek) && this.advance(), !B(this.peek)) return this.error("Invalid exponent", -1);
540
+ e = false;
541
+ } else break;
542
+ this.advance();
543
+ }
544
+ let i = this.input.substring(t, this.index);
545
+ s && (i = i.replace(/_/g, ""));
546
+ let n = e ? _s(i) : parseFloat(i);
547
+ return bs(t, this.index, n);
548
+ }
549
+ scanString() {
550
+ let t = this.index, e = this.peek;
551
+ this.advance();
552
+ let s = "", i = this.index, n = this.input;
553
+ for (; this.peek != e; ) if (this.peek == 92) {
554
+ s += n.substring(i, this.index);
555
+ let o;
556
+ if (this.advance(), this.peek == 117) {
557
+ let p = n.substring(this.index + 1, this.index + 5);
558
+ if (/^[0-9a-f]+$/i.test(p)) o = parseInt(p, 16);
559
+ else return this.error(`Invalid unicode escape [\\u${p}]`, 0);
560
+ for (let u = 0; u < 5; u++) this.advance();
561
+ } else o = Ms(this.peek), this.advance();
562
+ s += String.fromCharCode(o), i = this.index;
563
+ } else {
564
+ if (this.peek == 0) return this.error("Unterminated quote", 0);
565
+ this.advance();
566
+ }
567
+ let a = n.substring(i, this.index);
568
+ return this.advance(), Ps(t, this.index, s + a);
569
+ }
570
+ scanQuestion(t) {
571
+ this.advance();
572
+ let e = "?";
573
+ return (this.peek === 63 || this.peek === 46) && (e += this.peek === 46 ? "." : "?", this.advance()), Wt(t, this.index, e);
574
+ }
575
+ error(t, e) {
576
+ let s = this.index + e;
577
+ return Ks(s, this.index, `Lexer Error: ${t} at column ${s} in expression [${this.input}]`);
578
+ }
579
+ };
580
+ function me(r3) {
581
+ return 97 <= r3 && r3 <= 122 || 65 <= r3 && r3 <= 90 || r3 == 95 || r3 == 36;
582
+ }
583
+ function Se(r3) {
584
+ return le(r3) || B(r3) || r3 == 95 || r3 == 36;
585
+ }
586
+ function Bs(r3) {
587
+ return r3 == 101 || r3 == 69;
588
+ }
589
+ function Ts(r3) {
590
+ return r3 == 45 || r3 == 43;
591
+ }
592
+ function Ms(r3) {
593
+ switch (r3) {
594
+ case 110:
595
+ return 10;
596
+ case 102:
597
+ return 12;
598
+ case 114:
599
+ return 13;
600
+ case 116:
601
+ return 9;
602
+ case 118:
603
+ return 11;
604
+ default:
605
+ return r3;
606
+ }
607
+ }
608
+ function _s(r3) {
609
+ let t = parseInt(r3);
610
+ if (isNaN(t)) throw new Error("Invalid integer literal when parsing " + r3);
611
+ return t;
612
+ }
613
+ var Us = [/@/, /^\s*$/, /[<>]/, /^[{}]$/, /&(#|[a-z])/i, /^\/\//];
614
+ function Ee(r3, t) {
615
+ if (t != null && !(Array.isArray(t) && t.length == 2)) throw new Error(`Expected '${r3}' to be an array, [start, end].`);
616
+ if (t != null) {
617
+ let e = t[0], s = t[1];
618
+ Us.forEach((i) => {
619
+ if (i.test(e) || i.test(s)) throw new Error(`['${e}', '${s}'] contains unusable interpolation symbol.`);
620
+ });
621
+ }
622
+ }
623
+ var Qt = class r2 {
624
+ static fromArray(t) {
625
+ return t ? (Ee("interpolation", t), new r2(t[0], t[1])) : Q;
626
+ }
627
+ constructor(t, e) {
628
+ this.start = t, this.end = e;
629
+ }
630
+ };
631
+ var Q = new Qt("{{", "}}");
632
+ var zt = class {
633
+ constructor(t, e, s) {
634
+ this.strings = t, this.expressions = e, this.offsets = s;
635
+ }
636
+ };
637
+ var qt = class {
638
+ constructor(t, e, s) {
639
+ this.templateBindings = t, this.warnings = e, this.errors = s;
640
+ }
641
+ };
642
+ var mt = class {
643
+ constructor(t) {
644
+ this._lexer = t, this.errors = [];
645
+ }
646
+ parseAction(t, e, s, i = Q) {
647
+ this._checkNoInterpolation(t, e, i);
648
+ let n = this._stripComments(t), a = this._lexer.tokenize(n), o = new z(t, e, s, a, 1, this.errors, 0).parseChain();
649
+ return new R(o, t, e, s, this.errors);
650
+ }
651
+ parseBinding(t, e, s, i = Q) {
652
+ let n = this._parseBindingAst(t, e, s, i);
653
+ return new R(n, t, e, s, this.errors);
654
+ }
655
+ checkSimpleExpression(t) {
656
+ let e = new Ht();
657
+ return t.visit(e), e.errors;
658
+ }
659
+ parseSimpleBinding(t, e, s, i = Q) {
660
+ let n = this._parseBindingAst(t, e, s, i), a = this.checkSimpleExpression(n);
661
+ return a.length > 0 && this._reportError(`Host binding expression cannot contain ${a.join(" ")}`, t, e), new R(n, t, e, s, this.errors);
662
+ }
663
+ _reportError(t, e, s, i) {
664
+ this.errors.push(new Z(t, e, s, i));
665
+ }
666
+ _parseBindingAst(t, e, s, i) {
667
+ this._checkNoInterpolation(t, e, i);
668
+ let n = this._stripComments(t), a = this._lexer.tokenize(n);
669
+ return new z(t, e, s, a, 0, this.errors, 0).parseChain();
670
+ }
671
+ parseTemplateBindings(t, e, s, i, n) {
672
+ let a = this._lexer.tokenize(e);
673
+ return new z(e, s, n, a, 0, this.errors, 0).parseTemplateBindings({ source: t, span: new L(i, i + t.length) });
674
+ }
675
+ parseInterpolation(t, e, s, i, n = Q) {
676
+ let { strings: a, expressions: o, offsets: p } = this.splitInterpolation(t, e, i, n);
677
+ if (o.length === 0) return null;
678
+ let u = [];
679
+ for (let f = 0; f < o.length; ++f) {
680
+ let S = o[f].text, g = this._stripComments(S), y = this._lexer.tokenize(g), w = new z(t, e, s, y, 0, this.errors, p[f]).parseChain();
681
+ u.push(w);
682
+ }
683
+ return this.createInterpolationAst(a.map((f) => f.text), u, t, e, s);
684
+ }
685
+ parseInterpolationExpression(t, e, s) {
686
+ let i = this._stripComments(t), n = this._lexer.tokenize(i), a = new z(t, e, s, n, 0, this.errors, 0).parseChain(), o = ["", ""];
687
+ return this.createInterpolationAst(o, [a], t, e, s);
688
+ }
689
+ createInterpolationAst(t, e, s, i, n) {
690
+ let a = new b(0, s.length), o = new ot(a, a.toAbsolute(n), t, e);
691
+ return new R(o, s, i, n, this.errors);
692
+ }
693
+ splitInterpolation(t, e, s, i = Q) {
694
+ var _a;
695
+ let n = [], a = [], o = [], p = s ? Fs(s) : null, u = 0, f = false, S = false, { start: g, end: y } = i;
696
+ for (; u < t.length; ) if (f) {
697
+ let w = u, H = w + g.length, j = this._getInterpolationEndIndex(t, y, H);
698
+ if (j === -1) {
699
+ f = false, S = true;
700
+ break;
701
+ }
702
+ let T = j + y.length, Nt = t.substring(H, j);
703
+ Nt.trim().length === 0 && this._reportError("Blank expressions are not allowed in interpolated strings", t, `at column ${u} in`, e), a.push({ text: Nt, start: w, end: T });
704
+ let Ze = ((_a = p == null ? void 0 : p.get(w)) != null ? _a : w) + g.length;
705
+ o.push(Ze), u = T, f = false;
706
+ } else {
707
+ let w = u;
708
+ u = t.indexOf(g, u), u === -1 && (u = t.length);
709
+ let H = t.substring(w, u);
710
+ n.push({ text: H, start: w, end: u }), f = true;
711
+ }
712
+ if (!f) if (S) {
713
+ let w = n[n.length - 1];
714
+ w.text += t.substring(u), w.end = t.length;
715
+ } else n.push({ text: t.substring(u), start: u, end: t.length });
716
+ return new zt(n, a, o);
717
+ }
718
+ wrapLiteralPrimitive(t, e, s) {
719
+ let i = new b(0, t == null ? 0 : t.length);
720
+ return new R(new E(i, i.toAbsolute(s), t), t, e, s, this.errors);
721
+ }
722
+ _stripComments(t) {
723
+ let e = this._commentStart(t);
724
+ return e != null ? t.substring(0, e) : t;
725
+ }
726
+ _commentStart(t) {
727
+ let e = null;
728
+ for (let s = 0; s < t.length - 1; s++) {
729
+ let i = t.charCodeAt(s), n = t.charCodeAt(s + 1);
730
+ if (i === 47 && n == 47 && e == null) return s;
731
+ e === i ? e = null : e == null && Ft(i) && (e = i);
732
+ }
733
+ return null;
734
+ }
735
+ _checkNoInterpolation(t, e, { start: s, end: i }) {
736
+ let n = -1, a = -1;
737
+ for (let o of this._forEachUnquotedChar(t, 0)) if (n === -1) t.startsWith(s) && (n = o);
738
+ else if (a = this._getInterpolationEndIndex(t, i, o), a > -1) break;
739
+ n > -1 && a > -1 && this._reportError(`Got interpolation (${s}${i}) where expression was expected`, t, `at column ${n} in`, e);
740
+ }
741
+ _getInterpolationEndIndex(t, e, s) {
742
+ for (let i of this._forEachUnquotedChar(t, s)) {
743
+ if (t.startsWith(e, i)) return i;
744
+ if (t.startsWith("//", i)) return t.indexOf(e, i);
745
+ }
746
+ return -1;
747
+ }
748
+ *_forEachUnquotedChar(t, e) {
749
+ let s = null, i = 0;
750
+ for (let n = e; n < t.length; n++) {
751
+ let a = t[n];
752
+ Ft(t.charCodeAt(n)) && (s === null || s === a) && i % 2 === 0 ? s = s === null ? a : null : s === null && (yield n), i = a === "\\" ? i + 1 : 0;
753
+ }
754
+ }
755
+ };
756
+ var gt;
757
+ (function(r3) {
758
+ r3[r3.None = 0] = "None", r3[r3.Writable = 1] = "Writable";
759
+ })(gt || (gt = {}));
760
+ var z = class {
761
+ constructor(t, e, s, i, n, a, o) {
762
+ this.input = t, this.location = e, this.absoluteOffset = s, this.tokens = i, this.parseFlags = n, this.errors = a, this.offset = o, this.rparensExpected = 0, this.rbracketsExpected = 0, this.rbracesExpected = 0, this.context = gt.None, this.sourceSpanCache = /* @__PURE__ */ new Map(), this.index = 0;
763
+ }
764
+ peek(t) {
765
+ let e = this.index + t;
766
+ return e < this.tokens.length ? this.tokens[e] : Bt;
767
+ }
768
+ get next() {
769
+ return this.peek(0);
770
+ }
771
+ get atEOF() {
772
+ return this.index >= this.tokens.length;
773
+ }
774
+ get inputIndex() {
775
+ return this.atEOF ? this.currentEndIndex : this.next.index + this.offset;
776
+ }
777
+ get currentEndIndex() {
778
+ return this.index > 0 ? this.peek(-1).end + this.offset : this.tokens.length === 0 ? this.input.length + this.offset : this.next.index + this.offset;
779
+ }
780
+ get currentAbsoluteOffset() {
781
+ return this.absoluteOffset + this.inputIndex;
782
+ }
783
+ span(t, e) {
784
+ let s = this.currentEndIndex;
785
+ if (e !== void 0 && e > this.currentEndIndex && (s = e), t > s) {
786
+ let i = s;
787
+ s = t, t = i;
788
+ }
789
+ return new b(t, s);
790
+ }
791
+ sourceSpan(t, e) {
792
+ let s = `${t}@${this.inputIndex}:${e}`;
793
+ return this.sourceSpanCache.has(s) || this.sourceSpanCache.set(s, this.span(t, e).toAbsolute(this.absoluteOffset)), this.sourceSpanCache.get(s);
794
+ }
795
+ advance() {
796
+ this.index++;
797
+ }
798
+ withContext(t, e) {
799
+ this.context |= t;
800
+ let s = e();
801
+ return this.context ^= t, s;
802
+ }
803
+ consumeOptionalCharacter(t) {
804
+ return this.next.isCharacter(t) ? (this.advance(), true) : false;
805
+ }
806
+ peekKeywordLet() {
807
+ return this.next.isKeywordLet();
808
+ }
809
+ peekKeywordAs() {
810
+ return this.next.isKeywordAs();
811
+ }
812
+ expectCharacter(t) {
813
+ this.consumeOptionalCharacter(t) || this.error(`Missing expected ${String.fromCharCode(t)}`);
814
+ }
815
+ consumeOptionalOperator(t) {
816
+ return this.next.isOperator(t) ? (this.advance(), true) : false;
817
+ }
818
+ expectOperator(t) {
819
+ this.consumeOptionalOperator(t) || this.error(`Missing expected operator ${t}`);
820
+ }
821
+ prettyPrintToken(t) {
822
+ return t === Bt ? "end of input" : `token ${t}`;
823
+ }
824
+ expectIdentifierOrKeyword() {
825
+ let t = this.next;
826
+ return !t.isIdentifier() && !t.isKeyword() ? (t.isPrivateIdentifier() ? this._reportErrorForPrivateIdentifier(t, "expected identifier or keyword") : this.error(`Unexpected ${this.prettyPrintToken(t)}, expected identifier or keyword`), null) : (this.advance(), t.toString());
827
+ }
828
+ expectIdentifierOrKeywordOrString() {
829
+ let t = this.next;
830
+ return !t.isIdentifier() && !t.isKeyword() && !t.isString() ? (t.isPrivateIdentifier() ? this._reportErrorForPrivateIdentifier(t, "expected identifier, keyword or string") : this.error(`Unexpected ${this.prettyPrintToken(t)}, expected identifier, keyword, or string`), "") : (this.advance(), t.toString());
831
+ }
832
+ parseChain() {
833
+ let t = [], e = this.inputIndex;
834
+ for (; this.index < this.tokens.length; ) {
835
+ let s = this.parsePipe();
836
+ if (t.push(s), this.consumeOptionalCharacter(59)) for (this.parseFlags & 1 || this.error("Binding expression cannot contain chained expression"); this.consumeOptionalCharacter(59); ) ;
837
+ else if (this.index < this.tokens.length) {
838
+ let i = this.index;
839
+ if (this.error(`Unexpected token '${this.next}'`), this.index === i) break;
840
+ }
841
+ }
842
+ if (t.length === 0) {
843
+ let s = this.offset, i = this.offset + this.input.length;
844
+ return new $(this.span(s, i), this.sourceSpan(s, i));
845
+ }
846
+ return t.length == 1 ? t[0] : new X(this.span(e), this.sourceSpan(e), t);
847
+ }
848
+ parsePipe() {
849
+ let t = this.inputIndex, e = this.parseExpression();
850
+ if (this.consumeOptionalOperator("|")) {
851
+ this.parseFlags & 1 && this.error("Cannot have a pipe in an action expression");
852
+ do {
853
+ let s = this.inputIndex, i = this.expectIdentifierOrKeyword(), n, a;
854
+ i !== null ? n = this.sourceSpan(s) : (i = "", a = this.next.index !== -1 ? this.next.index : this.input.length + this.offset, n = new b(a, a).toAbsolute(this.absoluteOffset));
855
+ let o = [];
856
+ for (; this.consumeOptionalCharacter(58); ) o.push(this.parseExpression());
857
+ e = new it(this.span(t), this.sourceSpan(t, a), e, i, o, n);
858
+ } while (this.consumeOptionalOperator("|"));
859
+ }
860
+ return e;
861
+ }
862
+ parseExpression() {
863
+ return this.parseConditional();
864
+ }
865
+ parseConditional() {
866
+ let t = this.inputIndex, e = this.parseLogicalOr();
867
+ if (this.consumeOptionalOperator("?")) {
868
+ let s = this.parsePipe(), i;
869
+ if (this.consumeOptionalCharacter(58)) i = this.parsePipe();
870
+ else {
871
+ let n = this.inputIndex, a = this.input.substring(t, n);
872
+ this.error(`Conditional expression ${a} requires all 3 expressions`), i = new $(this.span(t), this.sourceSpan(t));
873
+ }
874
+ return new tt(this.span(t), this.sourceSpan(t), e, s, i);
875
+ } else return e;
876
+ }
877
+ parseLogicalOr() {
878
+ let t = this.inputIndex, e = this.parseLogicalAnd();
879
+ for (; this.consumeOptionalOperator("||"); ) {
880
+ let s = this.parseLogicalAnd();
881
+ e = new A(this.span(t), this.sourceSpan(t), "||", e, s);
882
+ }
883
+ return e;
884
+ }
885
+ parseLogicalAnd() {
886
+ let t = this.inputIndex, e = this.parseNullishCoalescing();
887
+ for (; this.consumeOptionalOperator("&&"); ) {
888
+ let s = this.parseNullishCoalescing();
889
+ e = new A(this.span(t), this.sourceSpan(t), "&&", e, s);
890
+ }
891
+ return e;
892
+ }
893
+ parseNullishCoalescing() {
894
+ let t = this.inputIndex, e = this.parseEquality();
895
+ for (; this.consumeOptionalOperator("??"); ) {
896
+ let s = this.parseEquality();
897
+ e = new A(this.span(t), this.sourceSpan(t), "??", e, s);
898
+ }
899
+ return e;
900
+ }
901
+ parseEquality() {
902
+ let t = this.inputIndex, e = this.parseRelational();
903
+ for (; this.next.type == l.Operator; ) {
904
+ let s = this.next.strValue;
905
+ switch (s) {
906
+ case "==":
907
+ case "===":
908
+ case "!=":
909
+ case "!==":
910
+ this.advance();
911
+ let i = this.parseRelational();
912
+ e = new A(this.span(t), this.sourceSpan(t), s, e, i);
913
+ continue;
914
+ }
915
+ break;
916
+ }
917
+ return e;
918
+ }
919
+ parseRelational() {
920
+ let t = this.inputIndex, e = this.parseAdditive();
921
+ for (; this.next.type == l.Operator; ) {
922
+ let s = this.next.strValue;
923
+ switch (s) {
924
+ case "<":
925
+ case ">":
926
+ case "<=":
927
+ case ">=":
928
+ this.advance();
929
+ let i = this.parseAdditive();
930
+ e = new A(this.span(t), this.sourceSpan(t), s, e, i);
931
+ continue;
932
+ }
933
+ break;
934
+ }
935
+ return e;
936
+ }
937
+ parseAdditive() {
938
+ let t = this.inputIndex, e = this.parseMultiplicative();
939
+ for (; this.next.type == l.Operator; ) {
940
+ let s = this.next.strValue;
941
+ switch (s) {
942
+ case "+":
943
+ case "-":
944
+ this.advance();
945
+ let i = this.parseMultiplicative();
946
+ e = new A(this.span(t), this.sourceSpan(t), s, e, i);
947
+ continue;
948
+ }
949
+ break;
950
+ }
951
+ return e;
952
+ }
953
+ parseMultiplicative() {
954
+ let t = this.inputIndex, e = this.parsePrefix();
955
+ for (; this.next.type == l.Operator; ) {
956
+ let s = this.next.strValue;
957
+ switch (s) {
958
+ case "*":
959
+ case "%":
960
+ case "/":
961
+ this.advance();
962
+ let i = this.parsePrefix();
963
+ e = new A(this.span(t), this.sourceSpan(t), s, e, i);
964
+ continue;
965
+ }
966
+ break;
967
+ }
968
+ return e;
969
+ }
970
+ parsePrefix() {
971
+ if (this.next.type == l.Operator) {
972
+ let t = this.inputIndex, e = this.next.strValue, s;
973
+ switch (e) {
974
+ case "+":
975
+ return this.advance(), s = this.parsePrefix(), F.createPlus(this.span(t), this.sourceSpan(t), s);
976
+ case "-":
977
+ return this.advance(), s = this.parsePrefix(), F.createMinus(this.span(t), this.sourceSpan(t), s);
978
+ case "!":
979
+ return this.advance(), s = this.parsePrefix(), new ct(this.span(t), this.sourceSpan(t), s);
980
+ }
981
+ }
982
+ return this.parseCallChain();
983
+ }
984
+ parseCallChain() {
985
+ let t = this.inputIndex, e = this.parsePrimary();
986
+ for (; ; ) if (this.consumeOptionalCharacter(46)) e = this.parseAccessMember(e, t, false);
987
+ else if (this.consumeOptionalOperator("?.")) this.consumeOptionalCharacter(40) ? e = this.parseCall(e, t, true) : e = this.consumeOptionalCharacter(91) ? this.parseKeyedReadOrWrite(e, t, true) : this.parseAccessMember(e, t, true);
988
+ else if (this.consumeOptionalCharacter(91)) e = this.parseKeyedReadOrWrite(e, t, false);
989
+ else if (this.consumeOptionalCharacter(40)) e = this.parseCall(e, t, false);
990
+ else if (this.consumeOptionalOperator("!")) e = new ht(this.span(t), this.sourceSpan(t), e);
991
+ else return e;
992
+ }
993
+ parsePrimary() {
994
+ let t = this.inputIndex;
995
+ if (this.consumeOptionalCharacter(40)) {
996
+ this.rparensExpected++;
997
+ let e = this.parsePipe();
998
+ return this.rparensExpected--, this.expectCharacter(41), e;
999
+ } else {
1000
+ if (this.next.isKeywordNull()) return this.advance(), new E(this.span(t), this.sourceSpan(t), null);
1001
+ if (this.next.isKeywordUndefined()) return this.advance(), new E(this.span(t), this.sourceSpan(t), void 0);
1002
+ if (this.next.isKeywordTrue()) return this.advance(), new E(this.span(t), this.sourceSpan(t), true);
1003
+ if (this.next.isKeywordFalse()) return this.advance(), new E(this.span(t), this.sourceSpan(t), false);
1004
+ if (this.next.isKeywordThis()) return this.advance(), new Lt(this.span(t), this.sourceSpan(t));
1005
+ if (this.consumeOptionalCharacter(91)) {
1006
+ this.rbracketsExpected++;
1007
+ let e = this.parseExpressionList(93);
1008
+ return this.rbracketsExpected--, this.expectCharacter(93), new nt(this.span(t), this.sourceSpan(t), e);
1009
+ } else {
1010
+ if (this.next.isCharacter(123)) return this.parseLiteralMap();
1011
+ if (this.next.isIdentifier()) return this.parseAccessMember(new K(this.span(t), this.sourceSpan(t)), t, false);
1012
+ if (this.next.isNumber()) {
1013
+ let e = this.next.toNumber();
1014
+ return this.advance(), new E(this.span(t), this.sourceSpan(t), e);
1015
+ } else if (this.next.isString()) {
1016
+ let e = this.next.toString();
1017
+ return this.advance(), new E(this.span(t), this.sourceSpan(t), e);
1018
+ } else return this.next.isPrivateIdentifier() ? (this._reportErrorForPrivateIdentifier(this.next, null), new $(this.span(t), this.sourceSpan(t))) : this.index >= this.tokens.length ? (this.error(`Unexpected end of expression: ${this.input}`), new $(this.span(t), this.sourceSpan(t))) : (this.error(`Unexpected token ${this.next}`), new $(this.span(t), this.sourceSpan(t)));
1019
+ }
1020
+ }
1021
+ }
1022
+ parseExpressionList(t) {
1023
+ let e = [];
1024
+ do
1025
+ if (!this.next.isCharacter(t)) e.push(this.parsePipe());
1026
+ else break;
1027
+ while (this.consumeOptionalCharacter(44));
1028
+ return e;
1029
+ }
1030
+ parseLiteralMap() {
1031
+ let t = [], e = [], s = this.inputIndex;
1032
+ if (this.expectCharacter(123), !this.consumeOptionalCharacter(125)) {
1033
+ this.rbracesExpected++;
1034
+ do {
1035
+ let i = this.inputIndex, n = this.next.isString(), a = this.expectIdentifierOrKeywordOrString(), o = { key: a, quoted: n };
1036
+ if (t.push(o), n) this.expectCharacter(58), e.push(this.parsePipe());
1037
+ else if (this.consumeOptionalCharacter(58)) e.push(this.parsePipe());
1038
+ else {
1039
+ o.isShorthandInitialized = true;
1040
+ let p = this.span(i), u = this.sourceSpan(i);
1041
+ e.push(new M(p, u, u, new K(p, u), a));
1042
+ }
1043
+ } while (this.consumeOptionalCharacter(44) && !this.next.isCharacter(125));
1044
+ this.rbracesExpected--, this.expectCharacter(125);
1045
+ }
1046
+ return new at(this.span(s), this.sourceSpan(s), t, e);
1047
+ }
1048
+ parseAccessMember(t, e, s) {
1049
+ let i = this.inputIndex, n = this.withContext(gt.Writable, () => {
1050
+ var _a;
1051
+ let p = (_a = this.expectIdentifierOrKeyword()) != null ? _a : "";
1052
+ return p.length === 0 && this.error("Expected identifier for property access", t.span.end), p;
1053
+ }), a = this.sourceSpan(i), o;
1054
+ if (s) this.consumeOptionalOperator("=") ? (this.error("The '?.' operator cannot be used in the assignment"), o = new $(this.span(e), this.sourceSpan(e))) : o = new _(this.span(e), this.sourceSpan(e), a, t, n);
1055
+ else if (this.consumeOptionalOperator("=")) {
1056
+ if (!(this.parseFlags & 1)) return this.error("Bindings cannot contain assignments"), new $(this.span(e), this.sourceSpan(e));
1057
+ let p = this.parseConditional();
1058
+ o = new et(this.span(e), this.sourceSpan(e), a, t, n, p);
1059
+ } else o = new M(this.span(e), this.sourceSpan(e), a, t, n);
1060
+ return o;
1061
+ }
1062
+ parseCall(t, e, s) {
1063
+ let i = this.inputIndex;
1064
+ this.rparensExpected++;
1065
+ let n = this.parseCallArguments(), a = this.span(i, this.inputIndex).toAbsolute(this.absoluteOffset);
1066
+ this.expectCharacter(41), this.rparensExpected--;
1067
+ let o = this.span(e), p = this.sourceSpan(e);
1068
+ return s ? new D(o, p, t, n, a) : new pt(o, p, t, n, a);
1069
+ }
1070
+ parseCallArguments() {
1071
+ if (this.next.isCharacter(41)) return [];
1072
+ let t = [];
1073
+ do
1074
+ t.push(this.parsePipe());
1075
+ while (this.consumeOptionalCharacter(44));
1076
+ return t;
1077
+ }
1078
+ expectTemplateBindingKey() {
1079
+ let t = "", e = false, s = this.currentAbsoluteOffset;
1080
+ do
1081
+ t += this.expectIdentifierOrKeywordOrString(), e = this.consumeOptionalOperator("-"), e && (t += "-");
1082
+ while (e);
1083
+ return { source: t, span: new L(s, s + t.length) };
1084
+ }
1085
+ parseTemplateBindings(t) {
1086
+ let e = [];
1087
+ for (e.push(...this.parseDirectiveKeywordBindings(t)); this.index < this.tokens.length; ) {
1088
+ let s = this.parseLetBinding();
1089
+ if (s) e.push(s);
1090
+ else {
1091
+ let i = this.expectTemplateBindingKey(), n = this.parseAsBinding(i);
1092
+ n ? e.push(n) : (i.source = t.source + i.source.charAt(0).toUpperCase() + i.source.substring(1), e.push(...this.parseDirectiveKeywordBindings(i)));
1093
+ }
1094
+ this.consumeStatementTerminator();
1095
+ }
1096
+ return new qt(e, [], this.errors);
1097
+ }
1098
+ parseKeyedReadOrWrite(t, e, s) {
1099
+ return this.withContext(gt.Writable, () => {
1100
+ this.rbracketsExpected++;
1101
+ let i = this.parsePipe();
1102
+ if (i instanceof $ && this.error("Key access cannot be empty"), this.rbracketsExpected--, this.expectCharacter(93), this.consumeOptionalOperator("=")) if (s) this.error("The '?.' operator cannot be used in the assignment");
1103
+ else {
1104
+ let n = this.parseConditional();
1105
+ return new rt(this.span(e), this.sourceSpan(e), t, i, n);
1106
+ }
1107
+ else return s ? new U(this.span(e), this.sourceSpan(e), t, i) : new st(this.span(e), this.sourceSpan(e), t, i);
1108
+ return new $(this.span(e), this.sourceSpan(e));
1109
+ });
1110
+ }
1111
+ parseDirectiveKeywordBindings(t) {
1112
+ let e = [];
1113
+ this.consumeOptionalCharacter(58);
1114
+ let s = this.getDirectiveBoundTarget(), i = this.currentAbsoluteOffset, n = this.parseAsBinding(t);
1115
+ n || (this.consumeStatementTerminator(), i = this.currentAbsoluteOffset);
1116
+ let a = new L(t.span.start, i);
1117
+ return e.push(new ut(a, t, s)), n && e.push(n), e;
1118
+ }
1119
+ getDirectiveBoundTarget() {
1120
+ if (this.next === Bt || this.peekKeywordAs() || this.peekKeywordLet()) return null;
1121
+ let t = this.parsePipe(), { start: e, end: s } = t.span, i = this.input.substring(e, s);
1122
+ return new R(t, i, this.location, this.absoluteOffset + e, this.errors);
1123
+ }
1124
+ parseAsBinding(t) {
1125
+ if (!this.peekKeywordAs()) return null;
1126
+ this.advance();
1127
+ let e = this.expectTemplateBindingKey();
1128
+ this.consumeStatementTerminator();
1129
+ let s = new L(t.span.start, this.currentAbsoluteOffset);
1130
+ return new W(s, e, t);
1131
+ }
1132
+ parseLetBinding() {
1133
+ if (!this.peekKeywordLet()) return null;
1134
+ let t = this.currentAbsoluteOffset;
1135
+ this.advance();
1136
+ let e = this.expectTemplateBindingKey(), s = null;
1137
+ this.consumeOptionalOperator("=") && (s = this.expectTemplateBindingKey()), this.consumeStatementTerminator();
1138
+ let i = new L(t, this.currentAbsoluteOffset);
1139
+ return new W(i, e, s);
1140
+ }
1141
+ consumeStatementTerminator() {
1142
+ this.consumeOptionalCharacter(59) || this.consumeOptionalCharacter(44);
1143
+ }
1144
+ error(t, e = null) {
1145
+ this.errors.push(new Z(t, this.input, this.locationText(e), this.location)), this.skip();
1146
+ }
1147
+ locationText(t = null) {
1148
+ return t == null && (t = this.index), t < this.tokens.length ? `at column ${this.tokens[t].index + 1} in` : "at the end of the expression";
1149
+ }
1150
+ _reportErrorForPrivateIdentifier(t, e) {
1151
+ let s = `Private identifiers are not supported. Unexpected private identifier: ${t}`;
1152
+ e !== null && (s += `, ${e}`), this.error(s);
1153
+ }
1154
+ skip() {
1155
+ let t = this.next;
1156
+ for (; this.index < this.tokens.length && !t.isCharacter(59) && !t.isOperator("|") && (this.rparensExpected <= 0 || !t.isCharacter(41)) && (this.rbracesExpected <= 0 || !t.isCharacter(125)) && (this.rbracketsExpected <= 0 || !t.isCharacter(93)) && (!(this.context & gt.Writable) || !t.isOperator("=")); ) this.next.isError() && this.errors.push(new Z(this.next.toString(), this.input, this.locationText(), this.location)), this.advance(), t = this.next;
1157
+ }
1158
+ };
1159
+ var Ht = class extends Rt {
1160
+ constructor() {
1161
+ super(...arguments), this.errors = [];
1162
+ }
1163
+ visitPipe() {
1164
+ this.errors.push("pipes");
1165
+ }
1166
+ };
1167
+ function Fs(r3) {
1168
+ let t = /* @__PURE__ */ new Map(), e = 0, s = 0, i = 0;
1169
+ for (; i < r3.length; ) {
1170
+ let n = r3[i];
1171
+ if (n.type === 9) {
1172
+ let [a, o] = n.parts;
1173
+ e += o.length, s += a.length;
1174
+ } else {
1175
+ let a = n.parts.reduce((o, p) => o + p.length, 0);
1176
+ s += a, e += a;
1177
+ }
1178
+ t.set(s, e), i++;
1179
+ }
1180
+ return t;
1181
+ }
1182
+ function Ce({ start: r3, end: t }, e) {
1183
+ let s = r3, i = t;
1184
+ for (; i !== s && /\s/.test(e[i - 1]); ) i--;
1185
+ for (; s !== i && /\s/.test(e[s]); ) s++;
1186
+ return { start: s, end: i };
1187
+ }
1188
+ function Ws({ start: r3, end: t }, e) {
1189
+ let s = r3, i = t;
1190
+ for (; i !== e.length && /\s/.test(e[i]); ) i++;
1191
+ for (; s !== 0 && /\s/.test(e[s - 1]); ) s--;
1192
+ return { start: s, end: i };
1193
+ }
1194
+ function Gs(r3, t) {
1195
+ return t[r3.start - 1] === "(" && t[r3.end] === ")" ? { start: r3.start - 1, end: r3.end + 1 } : r3;
1196
+ }
1197
+ function Ae(r3, t, e) {
1198
+ let s = 0, i = { start: r3.start, end: r3.end };
1199
+ for (; ; ) {
1200
+ let n = Ws(i, t), a = Gs(n, t);
1201
+ if (n.start === a.start && n.end === a.end) break;
1202
+ i.start = a.start, i.end = a.end, s++;
1203
+ }
1204
+ return { hasParens: (e ? s - 1 : s) !== 0, outerSpan: Ce(e ? { start: i.start + 1, end: i.end - 1 } : i, t), innerSpan: Ce(r3, t) };
1205
+ }
1206
+ function Oe(r3) {
1207
+ return typeof r3 == "string" ? (t) => t === r3 : (t) => r3.test(t);
1208
+ }
1209
+ function Ie(r3, t, e) {
1210
+ let s = Oe(t);
1211
+ for (let i = e; i >= 0; i--) {
1212
+ let n = r3[i];
1213
+ if (s(n)) return i;
1214
+ }
1215
+ throw new Error(`Cannot find front char ${t} from index ${e} in ${JSON.stringify(r3)}`);
1216
+ }
1217
+ function ke(r3, t, e) {
1218
+ let s = Oe(t);
1219
+ for (let i = e; i < r3.length; i++) {
1220
+ let n = r3[i];
1221
+ if (s(n)) return i;
1222
+ }
1223
+ throw new Error(`Cannot find character ${t} from index ${e} in ${JSON.stringify(r3)}`);
1224
+ }
1225
+ function Ne(r3) {
1226
+ return r3.slice(0, 1).toLowerCase() + r3.slice(1);
1227
+ }
1228
+ function Ct(r3) {
1229
+ let { start: t, end: e } = r3;
1230
+ return { start: t, end: e, range: [t, e] };
1231
+ }
1232
+ var Vs = (r3) => mt.prototype._commentStart(r3);
1233
+ function Qs(r3, t) {
1234
+ let e = t ? Vs(r3) : null;
1235
+ if (e === null) return { text: r3, comments: [] };
1236
+ let s = __spreadValues({ type: "CommentLine", value: r3.slice(e + 2) }, Ct({ start: e, end: r3.length }));
1237
+ return { text: r3.slice(0, e), comments: [s] };
1238
+ }
1239
+ function At(r3, t = true) {
1240
+ return (e) => {
1241
+ let s = new yt(), i = new mt(s), { text: n, comments: a } = Qs(e, t), o = r3(n, i);
1242
+ if (o.errors.length !== 0) {
1243
+ let [{ message: p }] = o.errors;
1244
+ throw new SyntaxError(p.replace(/^Parser Error: | at column \d+ in [^]*$/g, ""));
1245
+ }
1246
+ return { result: o, comments: a, text: n };
1247
+ };
1248
+ }
1249
+ var Le = At((r3, t) => t.parseBinding(r3, "", 0));
1250
+ var zs = At((r3, t) => t.parseSimpleBinding(r3, "", 0));
1251
+ var Re = At((r3, t) => t.parseAction(r3, "", 0));
1252
+ var Pe = At((r3, t) => t.parseInterpolationExpression(r3, "", 0));
1253
+ var be = At((r3, t) => t.parseTemplateBindings("", r3, "", 0, 0), false);
1254
+ var Hs = (r3, t, e) => {
1255
+ if (!(r3 && t == null)) return Array.isArray(t) || typeof t == "string" ? t[e < 0 ? t.length + e : e] : t.at(e);
1256
+ };
1257
+ var Tt = Hs;
1258
+ var jt = class {
1259
+ constructor(t) {
1260
+ __publicField(this, "text");
1261
+ this.text = t;
1262
+ }
1263
+ getCharacterIndex(t, e) {
1264
+ return ke(this.text, t, e);
1265
+ }
1266
+ getCharacterLastIndex(t, e) {
1267
+ return Ie(this.text, t, e);
1268
+ }
1269
+ transformSpan(t, { stripSpaces: e = false, hasParentParens: s = false } = {}) {
1270
+ if (!e) return Ct(t);
1271
+ let { outerSpan: i, innerSpan: n, hasParens: a } = Ae(t, this.text, s), o = Ct(n);
1272
+ return a && (o.extra = { parenthesized: true, parenStart: i.start, parenEnd: i.end }), o;
1273
+ }
1274
+ createNode(t, { stripSpaces: e = true, hasParentParens: s = false } = {}) {
1275
+ let { type: i, start: n, end: a } = t, o = __spreadValues(__spreadValues({}, t), this.transformSpan({ start: n, end: a }, { stripSpaces: e, hasParentParens: s }));
1276
+ switch (i) {
1277
+ case "NumericLiteral":
1278
+ case "StringLiteral": {
1279
+ let p = this.text.slice(o.start, o.end), { value: u } = o;
1280
+ o.extra = __spreadProps(__spreadValues({}, o.extra), { raw: p, rawValue: u });
1281
+ break;
1282
+ }
1283
+ case "ObjectProperty": {
1284
+ let { shorthand: p } = o;
1285
+ p && (o.extra = __spreadProps(__spreadValues({}, o.extra), { shorthand: p }));
1286
+ break;
1287
+ }
1288
+ }
1289
+ return o;
1290
+ }
1291
+ };
1292
+ var Ke = jt;
1293
+ function Zt(r3) {
1294
+ var t;
1295
+ return !!((t = r3.extra) != null && t.parenthesized);
1296
+ }
1297
+ function k(r3) {
1298
+ return Zt(r3) ? r3.extra.parenStart : r3.start;
1299
+ }
1300
+ function N(r3) {
1301
+ return Zt(r3) ? r3.extra.parenEnd : r3.end;
1302
+ }
1303
+ function Be(r3) {
1304
+ return (r3.type === "OptionalCallExpression" || r3.type === "OptionalMemberExpression") && !Zt(r3);
1305
+ }
1306
+ function Te(r3, t) {
1307
+ let { start: e, end: s } = r3.sourceSpan;
1308
+ return e >= s || /^\s+$/.test(t.slice(e, s));
1309
+ }
1310
+ var kt;
1311
+ var St;
1312
+ var h;
1313
+ var d;
1314
+ var Ot;
1315
+ var v;
1316
+ var Yt;
1317
+ var It = class extends Ke {
1318
+ constructor(e, s) {
1319
+ super(s);
1320
+ P(this, h);
1321
+ P(this, kt);
1322
+ P(this, St);
1323
+ Y(this, kt, e), Y(this, St, s);
1324
+ }
1325
+ get node() {
1326
+ return c(this, h, v).call(this, O(this, kt));
1327
+ }
1328
+ transformNode(e) {
1329
+ return c(this, h, Yt).call(this, e);
1330
+ }
1331
+ };
1332
+ kt = /* @__PURE__ */ new WeakMap(), St = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new WeakSet(), d = function(e, { stripSpaces: s = true, hasParentParens: i = false } = {}) {
1333
+ return this.createNode(e, { stripSpaces: s, hasParentParens: i });
1334
+ }, Ot = function(e, s, { computed: i, optional: n, end: a = N(s), hasParentParens: o = false }) {
1335
+ if (Te(e, O(this, St)) || e.sourceSpan.start === s.start) return s;
1336
+ let p = c(this, h, v).call(this, e), u = Be(p);
1337
+ return c(this, h, d).call(this, __spreadProps(__spreadValues({ type: n || u ? "OptionalMemberExpression" : "MemberExpression", object: p, property: s, computed: i }, n ? { optional: true } : u ? { optional: false } : void 0), { start: k(p), end: a }), { hasParentParens: o });
1338
+ }, v = function(e, s = false) {
1339
+ return c(this, h, Yt).call(this, e, s);
1340
+ }, Yt = function(e, s = false) {
1341
+ if (e instanceof ot) {
1342
+ let { expressions: i } = e;
1343
+ if (i.length !== 1) throw new Error("Unexpected 'Interpolation'");
1344
+ return c(this, h, v).call(this, i[0]);
1345
+ }
1346
+ if (e instanceof F) return c(this, h, d).call(this, __spreadValues({ type: "UnaryExpression", prefix: true, argument: c(this, h, v).call(this, e.expr), operator: e.operator }, e.sourceSpan), { hasParentParens: s });
1347
+ if (e instanceof A) {
1348
+ let { left: i, operation: n, right: a } = e, o = c(this, h, v).call(this, i), p = c(this, h, v).call(this, a), u = k(o), f = N(p), S = { left: o, right: p, start: u, end: f };
1349
+ return n === "&&" || n === "||" || n === "??" ? c(this, h, d).call(this, __spreadProps(__spreadValues({}, S), { type: "LogicalExpression", operator: n }), { hasParentParens: s }) : c(this, h, d).call(this, __spreadProps(__spreadValues({}, S), { type: "BinaryExpression", operator: n }), { hasParentParens: s });
1350
+ }
1351
+ if (e instanceof it) {
1352
+ let { exp: i, name: n, args: a } = e, o = c(this, h, v).call(this, i), p = k(o), u = N(o), f = this.getCharacterIndex(/\S/, this.getCharacterIndex("|", u) + 1), S = c(this, h, d).call(this, { type: "Identifier", name: n, start: f, end: f + n.length }), g = a.map((y) => c(this, h, v).call(this, y));
1353
+ return c(this, h, d).call(this, { type: "NGPipeExpression", left: o, right: S, arguments: g, start: p, end: N(g.length === 0 ? S : Tt(false, g, -1)) }, { hasParentParens: s });
1354
+ }
1355
+ if (e instanceof X) return c(this, h, d).call(this, __spreadValues({ type: "NGChainedExpression", expressions: e.expressions.map((i) => c(this, h, v).call(this, i)) }, e.sourceSpan), { hasParentParens: s });
1356
+ if (e instanceof tt) {
1357
+ let { condition: i, trueExp: n, falseExp: a } = e, o = c(this, h, v).call(this, i), p = c(this, h, v).call(this, n), u = c(this, h, v).call(this, a);
1358
+ return c(this, h, d).call(this, { type: "ConditionalExpression", test: o, consequent: p, alternate: u, start: k(o), end: N(u) }, { hasParentParens: s });
1359
+ }
1360
+ if (e instanceof $) return c(this, h, d).call(this, __spreadValues({ type: "NGEmptyExpression" }, e.sourceSpan), { hasParentParens: s });
1361
+ if (e instanceof K) return c(this, h, d).call(this, __spreadValues({ type: "ThisExpression" }, e.sourceSpan), { hasParentParens: s });
1362
+ if (e instanceof st || e instanceof U) return c(this, h, Ot).call(this, e.receiver, c(this, h, v).call(this, e.key), { computed: true, optional: e instanceof U, end: e.sourceSpan.end, hasParentParens: s });
1363
+ if (e instanceof nt) return c(this, h, d).call(this, __spreadValues({ type: "ArrayExpression", elements: e.expressions.map((i) => c(this, h, v).call(this, i)) }, e.sourceSpan), { hasParentParens: s });
1364
+ if (e instanceof at) {
1365
+ let { keys: i, values: n } = e, a = n.map((p) => c(this, h, v).call(this, p)), o = i.map(({ key: p, quoted: u }, f) => {
1366
+ let S = a[f], g = k(S), y = N(S), w = this.getCharacterIndex(/\S/, f === 0 ? e.sourceSpan.start + 1 : this.getCharacterIndex(",", N(a[f - 1])) + 1), H = g === w ? y : this.getCharacterLastIndex(/\S/, this.getCharacterLastIndex(":", g - 1) - 1) + 1, j = { start: w, end: H }, T = u ? c(this, h, d).call(this, __spreadValues({ type: "StringLiteral", value: p }, j)) : c(this, h, d).call(this, __spreadValues({ type: "Identifier", name: p }, j)), Nt = T.end < T.start || w === g;
1367
+ return c(this, h, d).call(this, { type: "ObjectProperty", key: T, value: S, shorthand: Nt, computed: false, start: k(T), end: y });
1368
+ });
1369
+ return c(this, h, d).call(this, __spreadValues({ type: "ObjectExpression", properties: o }, e.sourceSpan), { hasParentParens: s });
1370
+ }
1371
+ if (e instanceof E) {
1372
+ let { value: i } = e;
1373
+ switch (typeof i) {
1374
+ case "boolean":
1375
+ return c(this, h, d).call(this, __spreadValues({ type: "BooleanLiteral", value: i }, e.sourceSpan), { hasParentParens: s });
1376
+ case "number":
1377
+ return c(this, h, d).call(this, __spreadValues({ type: "NumericLiteral", value: i }, e.sourceSpan), { hasParentParens: s });
1378
+ case "object":
1379
+ return c(this, h, d).call(this, __spreadValues({ type: "NullLiteral" }, e.sourceSpan), { hasParentParens: s });
1380
+ case "string":
1381
+ return c(this, h, d).call(this, __spreadValues({ type: "StringLiteral", value: i }, e.sourceSpan), { hasParentParens: s });
1382
+ case "undefined":
1383
+ return c(this, h, d).call(this, __spreadValues({ type: "Identifier", name: "undefined" }, e.sourceSpan), { hasParentParens: s });
1384
+ default:
1385
+ throw new Error(`Unexpected LiteralPrimitive value type ${typeof i}`);
1386
+ }
1387
+ }
1388
+ if (e instanceof pt || e instanceof D) {
1389
+ let i = e instanceof D, { receiver: n, args: a } = e, o = a.length === 1 ? [c(this, h, v).call(this, a[0], true)] : a.map((S) => c(this, h, v).call(this, S)), p = c(this, h, v).call(this, n), u = Be(p), f = i || u ? "OptionalCallExpression" : "CallExpression";
1390
+ return c(this, h, d).call(this, { type: f, callee: p, arguments: o, optional: f === "OptionalCallExpression" ? i : void 0, start: k(p), end: e.sourceSpan.end }, { hasParentParens: s });
1391
+ }
1392
+ if (e instanceof ht) {
1393
+ let i = c(this, h, v).call(this, e.expression);
1394
+ return c(this, h, d).call(this, { type: "TSNonNullExpression", expression: i, start: k(i), end: e.sourceSpan.end }, { hasParentParens: s });
1395
+ }
1396
+ if (e instanceof ct) {
1397
+ let i = c(this, h, v).call(this, e.expression);
1398
+ return c(this, h, d).call(this, { type: "UnaryExpression", prefix: true, operator: "!", argument: i, start: e.sourceSpan.start, end: N(i) }, { hasParentParens: s });
1399
+ }
1400
+ if (e instanceof M || e instanceof _) {
1401
+ let { receiver: i, name: n } = e, a = this.getCharacterLastIndex(/\S/, e.sourceSpan.end - 1) + 1, o = c(this, h, d).call(this, { type: "Identifier", name: n, start: a - n.length, end: a }, Te(i, O(this, St)) ? { hasParentParens: s } : {});
1402
+ return c(this, h, Ot).call(this, i, o, { computed: false, optional: e instanceof _, hasParentParens: s });
1403
+ }
1404
+ if (e instanceof rt) {
1405
+ let i = c(this, h, v).call(this, e.key), n = c(this, h, v).call(this, e.value), a = c(this, h, Ot).call(this, e.receiver, i, { computed: true, optional: false, end: this.getCharacterIndex("]", N(i)) + 1 });
1406
+ return c(this, h, d).call(this, { type: "AssignmentExpression", left: a, operator: "=", right: n, start: k(a), end: N(n) }, { hasParentParens: s });
1407
+ }
1408
+ if (e instanceof et) {
1409
+ let { receiver: i, name: n, value: a } = e, o = c(this, h, v).call(this, a), p = this.getCharacterLastIndex(/\S/, this.getCharacterLastIndex("=", k(o) - 1) - 1) + 1, u = c(this, h, d).call(this, { type: "Identifier", name: n, start: p - n.length, end: p }), f = c(this, h, Ot).call(this, i, u, { computed: false, optional: false });
1410
+ return c(this, h, d).call(this, { type: "AssignmentExpression", left: f, operator: "=", right: o, start: k(f), end: N(o) }, { hasParentParens: s });
1411
+ }
1412
+ throw Object.assign(new Error("Unexpected node"), { node: e });
1413
+ };
1414
+ function Me(r3, t) {
1415
+ return new It(r3, t).node;
1416
+ }
1417
+ function _e(r3) {
1418
+ return r3 instanceof ut;
1419
+ }
1420
+ function Ue(r3) {
1421
+ return r3 instanceof W;
1422
+ }
1423
+ var wt;
1424
+ var q;
1425
+ var x;
1426
+ var Fe;
1427
+ var C;
1428
+ var Xt;
1429
+ var te;
1430
+ var ee;
1431
+ var De;
1432
+ var We;
1433
+ var Ge;
1434
+ var Ve;
1435
+ var Jt = class extends It {
1436
+ constructor(e, s) {
1437
+ super(void 0, s);
1438
+ P(this, x);
1439
+ P(this, wt);
1440
+ P(this, q);
1441
+ Y(this, wt, e), Y(this, q, s);
1442
+ for (let i of e) c(this, x, De).call(this, i);
1443
+ }
1444
+ get expressions() {
1445
+ return c(this, x, Ge).call(this);
1446
+ }
1447
+ };
1448
+ wt = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakSet(), Fe = function() {
1449
+ return O(this, wt)[0].key;
1450
+ }, C = function(e, { stripSpaces: s = true } = {}) {
1451
+ return this.createNode(e, { stripSpaces: s });
1452
+ }, Xt = function(e) {
1453
+ return this.transformNode(e);
1454
+ }, te = function(e) {
1455
+ return Ne(e.slice(O(this, x, Fe).source.length));
1456
+ }, ee = function(e) {
1457
+ let s = O(this, q);
1458
+ if (s[e.start] !== '"' && s[e.start] !== "'") return;
1459
+ let i = s[e.start], n = false;
1460
+ for (let a = e.start + 1; a < s.length; a++) switch (s[a]) {
1461
+ case i:
1462
+ if (!n) {
1463
+ e.end = a + 1;
1464
+ return;
1465
+ }
1466
+ default:
1467
+ n = false;
1468
+ break;
1469
+ case "\\":
1470
+ n = !n;
1471
+ break;
1472
+ }
1473
+ }, De = function(e) {
1474
+ c(this, x, ee).call(this, e.key.span), Ue(e) && e.value && c(this, x, ee).call(this, e.value.span);
1475
+ }, We = function(e) {
1476
+ if (!e.value || e.value.source) return e.value;
1477
+ let s = this.getCharacterIndex(/\S/, e.sourceSpan.start);
1478
+ return { source: "$implicit", span: { start: s, end: s } };
1479
+ }, Ge = function() {
1480
+ let e = O(this, wt), [s] = e, i = O(this, q).slice(s.sourceSpan.start, s.sourceSpan.end).trim().length === 0 ? e.slice(1) : e, n = [], a = null;
1481
+ for (let [o, p] of i.entries()) {
1482
+ if (a && _e(a) && Ue(p) && p.value && p.value.source === a.key.source) {
1483
+ let u = c(this, x, C).call(this, __spreadValues({ type: "NGMicrosyntaxKey", name: p.key.source }, p.key.span)), f = (y, w) => __spreadValues(__spreadValues({}, y), this.transformSpan({ start: y.start, end: w })), S = (y) => __spreadProps(__spreadValues({}, f(y, u.end)), { alias: u }), g = n.pop();
1484
+ if (g.type === "NGMicrosyntaxExpression") n.push(S(g));
1485
+ else if (g.type === "NGMicrosyntaxKeyedExpression") {
1486
+ let y = S(g.expression);
1487
+ n.push(f(__spreadProps(__spreadValues({}, g), { expression: y }), y.end));
1488
+ } else throw new Error(`Unexpected type ${g.type}`);
1489
+ } else n.push(c(this, x, Ve).call(this, p, o));
1490
+ a = p;
1491
+ }
1492
+ return c(this, x, C).call(this, __spreadValues({ type: "NGMicrosyntax", body: n }, n.length === 0 ? e[0].sourceSpan : { start: n[0].start, end: Tt(false, n, -1).end }));
1493
+ }, Ve = function(e, s) {
1494
+ if (_e(e)) {
1495
+ let { key: i, value: n } = e;
1496
+ return n ? s === 0 ? c(this, x, C).call(this, __spreadValues({ type: "NGMicrosyntaxExpression", expression: c(this, x, Xt).call(this, n.ast), alias: null }, n.sourceSpan)) : c(this, x, C).call(this, { type: "NGMicrosyntaxKeyedExpression", key: c(this, x, C).call(this, __spreadValues({ type: "NGMicrosyntaxKey", name: c(this, x, te).call(this, i.source) }, i.span)), expression: c(this, x, C).call(this, __spreadValues({ type: "NGMicrosyntaxExpression", expression: c(this, x, Xt).call(this, n.ast), alias: null }, n.sourceSpan)), start: i.span.start, end: n.sourceSpan.end }) : c(this, x, C).call(this, __spreadValues({ type: "NGMicrosyntaxKey", name: c(this, x, te).call(this, i.source) }, i.span));
1497
+ } else {
1498
+ let { key: i, sourceSpan: n } = e;
1499
+ if (/^let\s$/.test(O(this, q).slice(n.start, n.start + 4))) {
1500
+ let { value: o } = e;
1501
+ return c(this, x, C).call(this, { type: "NGMicrosyntaxLet", key: c(this, x, C).call(this, __spreadValues({ type: "NGMicrosyntaxKey", name: i.source }, i.span)), value: o ? c(this, x, C).call(this, __spreadValues({ type: "NGMicrosyntaxKey", name: o.source }, o.span)) : null, start: n.start, end: o ? o.span.end : i.span.end });
1502
+ } else {
1503
+ let o = c(this, x, We).call(this, e);
1504
+ return c(this, x, C).call(this, { type: "NGMicrosyntaxAs", key: c(this, x, C).call(this, __spreadValues({ type: "NGMicrosyntaxKey", name: o.source }, o.span)), alias: c(this, x, C).call(this, __spreadValues({ type: "NGMicrosyntaxKey", name: i.source }, i.span)), start: o.span.start, end: i.span.end });
1505
+ }
1506
+ }
1507
+ };
1508
+ function Qe(r3, t) {
1509
+ return new Jt(r3, t).expressions;
1510
+ }
1511
+ function Mt({ result: { ast: r3 }, text: t, comments: e }) {
1512
+ return Object.assign(Me(r3, t), { comments: e });
1513
+ }
1514
+ function ze({ result: { templateBindings: r3 }, text: t }) {
1515
+ return Qe(r3, t);
1516
+ }
1517
+ var qe = (r3) => Mt(Le(r3));
1518
+ var He = (r3) => Mt(Pe(r3));
1519
+ var se = (r3) => Mt(Re(r3));
1520
+ var je = (r3) => ze(be(r3));
1521
+ function re(r3) {
1522
+ var _a, _b;
1523
+ var s, i, n;
1524
+ let t = (_a = (s = r3.range) == null ? void 0 : s[0]) != null ? _a : r3.start, e = (n = (_b = (i = r3.declaration) == null ? void 0 : i.decorators) != null ? _b : r3.decorators) == null ? void 0 : n[0];
1525
+ return e ? Math.min(re(e), t) : t;
1526
+ }
1527
+ function Ye(r3) {
1528
+ var _a;
1529
+ var t;
1530
+ return (_a = (t = r3.range) == null ? void 0 : t[1]) != null ? _a : r3.end;
1531
+ }
1532
+ function _t(r3) {
1533
+ return { astFormat: "estree", parse(t) {
1534
+ let e = r3(t);
1535
+ return { type: "NGRoot", node: r3 === se && e.type !== "NGChainedExpression" ? __spreadProps(__spreadValues({}, e), { type: "NGChainedExpression", expressions: [e] }) : e };
1536
+ }, locStart: re, locEnd: Ye };
1537
+ }
1538
+ var js = _t(se);
1539
+ var Ys = _t(qe);
1540
+ var Zs = _t(He);
1541
+ var Js = _t(je);
1542
+ var Ur = ne;
1543
+ export {
1544
+ Ur as default,
1545
+ ie as parsers
1546
+ };
1547
+ //# sourceMappingURL=angular-FYEH6QOL.mjs.map