driftjs-shared 0.0.5 → 0.0.7

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.
package/dist/index-es.js CHANGED
@@ -19,10 +19,7 @@ function t(e, t, n) {
19
19
  e(t);
20
20
  } catch {}
21
21
  }
22
- function n(e, n, r) {
23
- if (r) for (let i of r) Object.prototype.hasOwnProperty.call(e, i) && t(n, i, e[i]);
24
- }
25
- function r(e, t) {
22
+ function n(e, t) {
26
23
  if (!e || typeof e != "object") return !1;
27
24
  let n = e;
28
25
  for (; n && n !== Object.prototype;) {
@@ -32,3505 +29,85 @@ function r(e, t) {
32
29
  return !1;
33
30
  }
34
31
  //#endregion
35
- //#region ../compiler/dist/index-es.js
36
- var i = {
37
- Data: "Data",
38
- TagOpen: "TagOpen",
39
- EndTagOpen: "EndTagOpen",
40
- BeforeAttributeName: "BeforeAttributeName",
41
- AttributeName: "AttributeName",
42
- AfterAttributeName: "AfterAttributeName",
43
- BeforeAttributeValue: "BeforeAttributeValue",
44
- AttributeValueQuoted: "AttributeValueQuoted",
45
- AttributeValueInterpolation: "AttributeValueInterpolation",
46
- Comment: "Comment",
47
- Interpolation: "Interpolation",
48
- RawText: "RawText",
49
- EOF: "EOF"
50
- };
51
- i.Data, i.Comment, i.EndTagOpen, i.TagOpen, i.Interpolation, i.Data, i.EOF, i.TagOpen, i.BeforeAttributeName, i.EndTagOpen, i.BeforeAttributeName, i.BeforeAttributeName, i.AttributeName, i.Data, i.RawText, i.Data, i.AttributeName, i.AfterAttributeName, i.AfterAttributeName, i.BeforeAttributeValue, i.BeforeAttributeName, i.BeforeAttributeValue, i.AttributeValueQuoted, i.AttributeValueInterpolation, i.AttributeValueQuoted, i.BeforeAttributeName, i.AttributeValueInterpolation, i.BeforeAttributeName, i.Comment, i.Data, i.Interpolation, i.Data, i.BeforeAttributeName, i.RawText, i.RawText, i.EndTagOpen, i.EOF, i.EOF, i.EOF;
52
- var a = [
53
- 509,
54
- 0,
55
- 227,
56
- 0,
57
- 150,
58
- 4,
59
- 294,
60
- 9,
61
- 1368,
62
- 2,
63
- 2,
64
- 1,
65
- 6,
66
- 3,
67
- 41,
68
- 2,
69
- 5,
70
- 0,
71
- 166,
72
- 1,
73
- 574,
74
- 3,
75
- 9,
76
- 9,
77
- 7,
78
- 9,
79
- 32,
80
- 4,
81
- 318,
82
- 1,
83
- 78,
84
- 5,
85
- 71,
86
- 10,
87
- 50,
88
- 3,
89
- 123,
90
- 2,
91
- 54,
92
- 14,
93
- 32,
94
- 10,
95
- 3,
96
- 1,
97
- 11,
98
- 3,
99
- 46,
100
- 10,
101
- 8,
102
- 0,
103
- 46,
104
- 9,
105
- 7,
106
- 2,
107
- 37,
108
- 13,
109
- 2,
110
- 9,
111
- 6,
112
- 1,
113
- 45,
114
- 0,
115
- 13,
116
- 2,
117
- 49,
118
- 13,
119
- 9,
120
- 3,
121
- 2,
122
- 11,
123
- 83,
124
- 11,
125
- 7,
126
- 0,
127
- 3,
128
- 0,
129
- 158,
130
- 11,
131
- 6,
132
- 9,
133
- 7,
134
- 3,
135
- 56,
136
- 1,
137
- 2,
138
- 6,
139
- 3,
140
- 1,
141
- 3,
142
- 2,
143
- 10,
144
- 0,
145
- 11,
146
- 1,
147
- 3,
148
- 6,
149
- 4,
150
- 4,
151
- 68,
152
- 8,
153
- 2,
154
- 0,
155
- 3,
156
- 0,
157
- 2,
158
- 3,
159
- 2,
160
- 4,
161
- 2,
162
- 0,
163
- 15,
164
- 1,
165
- 83,
166
- 17,
167
- 10,
168
- 9,
169
- 5,
170
- 0,
171
- 82,
172
- 19,
173
- 13,
174
- 9,
175
- 214,
176
- 6,
177
- 3,
178
- 8,
179
- 28,
180
- 1,
181
- 83,
182
- 16,
183
- 16,
184
- 9,
185
- 82,
186
- 12,
187
- 9,
188
- 9,
189
- 7,
190
- 19,
191
- 58,
192
- 14,
193
- 5,
194
- 9,
195
- 243,
196
- 14,
197
- 166,
198
- 9,
199
- 71,
200
- 5,
201
- 2,
202
- 1,
203
- 3,
204
- 3,
205
- 2,
206
- 0,
207
- 2,
208
- 1,
209
- 13,
210
- 9,
211
- 120,
212
- 6,
213
- 3,
214
- 6,
215
- 4,
216
- 0,
217
- 29,
218
- 9,
219
- 41,
220
- 6,
221
- 2,
222
- 3,
223
- 9,
224
- 0,
225
- 10,
226
- 10,
227
- 47,
228
- 15,
229
- 199,
230
- 7,
231
- 137,
232
- 9,
233
- 54,
234
- 7,
235
- 2,
236
- 7,
237
- 17,
238
- 9,
239
- 57,
240
- 21,
241
- 2,
242
- 13,
243
- 123,
244
- 5,
245
- 4,
246
- 0,
247
- 2,
248
- 1,
249
- 2,
250
- 6,
251
- 2,
252
- 0,
253
- 9,
254
- 9,
255
- 49,
256
- 4,
257
- 2,
258
- 1,
259
- 2,
260
- 4,
261
- 9,
262
- 9,
263
- 55,
264
- 9,
265
- 266,
266
- 3,
267
- 10,
268
- 1,
269
- 2,
270
- 0,
271
- 49,
272
- 6,
273
- 4,
274
- 4,
275
- 14,
276
- 10,
277
- 5350,
278
- 0,
279
- 7,
280
- 14,
281
- 11465,
282
- 27,
283
- 2343,
284
- 9,
285
- 87,
286
- 9,
287
- 39,
288
- 4,
289
- 60,
290
- 6,
291
- 26,
292
- 9,
293
- 535,
294
- 9,
295
- 470,
296
- 0,
297
- 2,
298
- 54,
299
- 8,
300
- 3,
301
- 82,
302
- 0,
303
- 12,
304
- 1,
305
- 19628,
306
- 1,
307
- 4178,
308
- 9,
309
- 519,
310
- 45,
311
- 3,
312
- 22,
313
- 543,
314
- 4,
315
- 4,
316
- 5,
317
- 9,
318
- 7,
319
- 3,
320
- 6,
321
- 31,
322
- 3,
323
- 149,
324
- 2,
325
- 1418,
326
- 49,
327
- 513,
328
- 54,
329
- 5,
330
- 49,
331
- 9,
332
- 0,
333
- 15,
334
- 0,
335
- 23,
336
- 4,
337
- 2,
338
- 14,
339
- 1361,
340
- 6,
341
- 2,
342
- 16,
343
- 3,
344
- 6,
345
- 2,
346
- 1,
347
- 2,
348
- 4,
349
- 101,
350
- 0,
351
- 161,
352
- 6,
353
- 10,
354
- 9,
355
- 357,
356
- 0,
357
- 62,
358
- 13,
359
- 499,
360
- 13,
361
- 245,
362
- 1,
363
- 2,
364
- 9,
365
- 233,
366
- 0,
367
- 3,
368
- 0,
369
- 8,
370
- 1,
371
- 6,
372
- 0,
373
- 475,
374
- 6,
375
- 110,
376
- 6,
377
- 6,
378
- 9,
379
- 4759,
380
- 9,
381
- 787719,
382
- 239
383
- ], o = [
384
- 0,
385
- 11,
386
- 2,
387
- 25,
388
- 2,
389
- 18,
390
- 2,
391
- 1,
392
- 2,
393
- 14,
394
- 3,
395
- 13,
396
- 35,
397
- 122,
398
- 70,
399
- 52,
400
- 268,
401
- 28,
402
- 4,
403
- 48,
404
- 48,
405
- 31,
406
- 14,
407
- 29,
408
- 6,
409
- 37,
410
- 11,
411
- 29,
412
- 3,
413
- 35,
414
- 5,
415
- 7,
416
- 2,
417
- 4,
418
- 43,
419
- 157,
420
- 19,
421
- 35,
422
- 5,
423
- 35,
424
- 5,
425
- 39,
426
- 9,
427
- 51,
428
- 13,
429
- 10,
430
- 2,
431
- 14,
432
- 2,
433
- 6,
434
- 2,
435
- 1,
436
- 2,
437
- 10,
438
- 2,
439
- 14,
440
- 2,
441
- 6,
442
- 2,
443
- 1,
444
- 4,
445
- 51,
446
- 13,
447
- 310,
448
- 10,
449
- 21,
450
- 11,
451
- 7,
452
- 25,
453
- 5,
454
- 2,
455
- 41,
456
- 2,
457
- 8,
458
- 70,
459
- 5,
460
- 3,
461
- 0,
462
- 2,
463
- 43,
464
- 2,
465
- 1,
466
- 4,
467
- 0,
468
- 3,
469
- 22,
470
- 11,
471
- 22,
472
- 10,
473
- 30,
474
- 66,
475
- 18,
476
- 2,
477
- 1,
478
- 11,
479
- 21,
480
- 11,
481
- 25,
482
- 7,
483
- 25,
484
- 39,
485
- 55,
486
- 7,
487
- 1,
488
- 65,
489
- 0,
490
- 16,
491
- 3,
492
- 2,
493
- 2,
494
- 2,
495
- 28,
496
- 43,
497
- 28,
498
- 4,
499
- 28,
500
- 36,
501
- 7,
502
- 2,
503
- 27,
504
- 28,
505
- 53,
506
- 11,
507
- 21,
508
- 11,
509
- 18,
510
- 14,
511
- 17,
512
- 111,
513
- 72,
514
- 56,
515
- 50,
516
- 14,
517
- 50,
518
- 14,
519
- 35,
520
- 39,
521
- 27,
522
- 10,
523
- 22,
524
- 251,
525
- 41,
526
- 7,
527
- 1,
528
- 17,
529
- 5,
530
- 57,
531
- 28,
532
- 11,
533
- 0,
534
- 9,
535
- 21,
536
- 43,
537
- 17,
538
- 47,
539
- 20,
540
- 28,
541
- 22,
542
- 13,
543
- 52,
544
- 58,
545
- 1,
546
- 3,
547
- 0,
548
- 14,
549
- 44,
550
- 33,
551
- 24,
552
- 27,
553
- 35,
554
- 30,
555
- 0,
556
- 3,
557
- 0,
558
- 9,
559
- 34,
560
- 4,
561
- 0,
562
- 13,
563
- 47,
564
- 15,
565
- 3,
566
- 22,
567
- 0,
568
- 2,
569
- 0,
570
- 36,
571
- 17,
572
- 2,
573
- 24,
574
- 20,
575
- 1,
576
- 64,
577
- 6,
578
- 2,
579
- 0,
580
- 2,
581
- 3,
582
- 2,
583
- 14,
584
- 2,
585
- 9,
586
- 8,
587
- 46,
588
- 39,
589
- 7,
590
- 3,
591
- 1,
592
- 3,
593
- 21,
594
- 2,
595
- 6,
596
- 2,
597
- 1,
598
- 2,
599
- 4,
600
- 4,
601
- 0,
602
- 19,
603
- 0,
604
- 13,
605
- 4,
606
- 31,
607
- 9,
608
- 2,
609
- 0,
610
- 3,
611
- 0,
612
- 2,
613
- 37,
614
- 2,
615
- 0,
616
- 26,
617
- 0,
618
- 2,
619
- 0,
620
- 45,
621
- 52,
622
- 19,
623
- 3,
624
- 21,
625
- 2,
626
- 31,
627
- 47,
628
- 21,
629
- 1,
630
- 2,
631
- 0,
632
- 185,
633
- 46,
634
- 42,
635
- 3,
636
- 37,
637
- 47,
638
- 21,
639
- 0,
640
- 60,
641
- 42,
642
- 14,
643
- 0,
644
- 72,
645
- 26,
646
- 38,
647
- 6,
648
- 186,
649
- 43,
650
- 117,
651
- 63,
652
- 32,
653
- 7,
654
- 3,
655
- 0,
656
- 3,
657
- 7,
658
- 2,
659
- 1,
660
- 2,
661
- 23,
662
- 16,
663
- 0,
664
- 2,
665
- 0,
666
- 95,
667
- 7,
668
- 3,
669
- 38,
670
- 17,
671
- 0,
672
- 2,
673
- 0,
674
- 29,
675
- 0,
676
- 11,
677
- 39,
678
- 8,
679
- 0,
680
- 22,
681
- 0,
682
- 12,
683
- 45,
684
- 20,
685
- 0,
686
- 19,
687
- 72,
688
- 200,
689
- 32,
690
- 32,
691
- 8,
692
- 2,
693
- 36,
694
- 18,
695
- 0,
696
- 50,
697
- 29,
698
- 113,
699
- 6,
700
- 2,
701
- 1,
702
- 2,
703
- 37,
704
- 22,
705
- 0,
706
- 26,
707
- 5,
708
- 2,
709
- 1,
710
- 2,
711
- 31,
712
- 15,
713
- 0,
714
- 24,
715
- 43,
716
- 261,
717
- 18,
718
- 16,
719
- 0,
720
- 2,
721
- 12,
722
- 2,
723
- 33,
724
- 125,
725
- 0,
726
- 80,
727
- 921,
728
- 103,
729
- 110,
730
- 18,
731
- 195,
732
- 2637,
733
- 96,
734
- 16,
735
- 1071,
736
- 18,
737
- 5,
738
- 26,
739
- 3994,
740
- 6,
741
- 582,
742
- 6842,
743
- 29,
744
- 1763,
745
- 568,
746
- 8,
747
- 30,
748
- 18,
749
- 78,
750
- 18,
751
- 29,
752
- 19,
753
- 47,
754
- 17,
755
- 3,
756
- 32,
757
- 20,
758
- 6,
759
- 18,
760
- 433,
761
- 44,
762
- 212,
763
- 63,
764
- 33,
765
- 24,
766
- 3,
767
- 24,
768
- 45,
769
- 74,
770
- 6,
771
- 0,
772
- 67,
773
- 12,
774
- 65,
775
- 1,
776
- 2,
777
- 0,
778
- 15,
779
- 4,
780
- 10,
781
- 7381,
782
- 42,
783
- 31,
784
- 98,
785
- 114,
786
- 8702,
787
- 3,
788
- 2,
789
- 6,
790
- 2,
791
- 1,
792
- 2,
793
- 290,
794
- 16,
795
- 0,
796
- 30,
797
- 2,
798
- 3,
799
- 0,
800
- 15,
801
- 3,
802
- 9,
803
- 395,
804
- 2309,
805
- 106,
806
- 6,
807
- 12,
808
- 4,
809
- 8,
810
- 8,
811
- 9,
812
- 5991,
813
- 84,
814
- 2,
815
- 70,
816
- 2,
817
- 1,
818
- 3,
819
- 0,
820
- 3,
821
- 1,
822
- 3,
823
- 3,
824
- 2,
825
- 11,
826
- 2,
827
- 0,
828
- 2,
829
- 6,
830
- 2,
831
- 64,
832
- 2,
833
- 3,
834
- 3,
835
- 7,
836
- 2,
837
- 6,
838
- 2,
839
- 27,
840
- 2,
841
- 3,
842
- 2,
843
- 4,
844
- 2,
845
- 0,
846
- 4,
847
- 6,
848
- 2,
849
- 339,
850
- 3,
851
- 24,
852
- 2,
853
- 24,
854
- 2,
855
- 30,
856
- 2,
857
- 24,
858
- 2,
859
- 30,
860
- 2,
861
- 24,
862
- 2,
863
- 30,
864
- 2,
865
- 24,
866
- 2,
867
- 30,
868
- 2,
869
- 24,
870
- 2,
871
- 7,
872
- 1845,
873
- 30,
874
- 7,
875
- 5,
876
- 262,
877
- 61,
878
- 147,
879
- 44,
880
- 11,
881
- 6,
882
- 17,
883
- 0,
884
- 322,
885
- 29,
886
- 19,
887
- 43,
888
- 485,
889
- 27,
890
- 229,
891
- 29,
892
- 3,
893
- 0,
894
- 208,
895
- 30,
896
- 2,
897
- 2,
898
- 2,
899
- 1,
900
- 2,
901
- 6,
902
- 3,
903
- 4,
904
- 10,
905
- 1,
906
- 225,
907
- 6,
908
- 2,
909
- 3,
910
- 2,
911
- 1,
912
- 2,
913
- 14,
914
- 2,
915
- 196,
916
- 60,
917
- 67,
918
- 8,
919
- 0,
920
- 1205,
921
- 3,
922
- 2,
923
- 26,
924
- 2,
925
- 1,
926
- 2,
927
- 0,
928
- 3,
929
- 0,
930
- 2,
931
- 9,
932
- 2,
933
- 3,
934
- 2,
935
- 0,
936
- 2,
937
- 0,
938
- 7,
939
- 0,
940
- 5,
941
- 0,
942
- 2,
943
- 0,
944
- 2,
945
- 0,
946
- 2,
947
- 2,
948
- 2,
949
- 1,
950
- 2,
951
- 0,
952
- 3,
953
- 0,
954
- 2,
955
- 0,
956
- 2,
957
- 0,
958
- 2,
959
- 0,
960
- 2,
961
- 0,
962
- 2,
963
- 1,
964
- 2,
965
- 0,
966
- 3,
967
- 3,
968
- 2,
969
- 6,
970
- 2,
971
- 3,
972
- 2,
973
- 3,
974
- 2,
975
- 0,
976
- 2,
977
- 9,
978
- 2,
979
- 16,
980
- 6,
981
- 2,
982
- 2,
983
- 4,
984
- 2,
985
- 16,
986
- 4421,
987
- 42719,
988
- 33,
989
- 4381,
990
- 3,
991
- 5773,
992
- 3,
993
- 7472,
994
- 16,
995
- 621,
996
- 2467,
997
- 541,
998
- 1507,
999
- 4938,
1000
- 6,
1001
- 8489
1002
- ], s = "‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-᫝᫠-᫫ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・", c = "ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-࢏ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚ౜ౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ೜-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-Ƛ꟱-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ", l = {
1003
- 3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",
1004
- 5: "class enum extends super const export import",
1005
- 6: "enum",
1006
- strict: "implements interface let package private protected public static yield",
1007
- strictBind: "eval arguments"
1008
- }, u = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this", d = {
1009
- 5: u,
1010
- "5module": u + " export import",
1011
- 6: u + " const class extends export import super"
1012
- }, f = /^in(stanceof)?$/, p = RegExp("[" + c + "]"), m = RegExp("[" + c + s + "]");
1013
- function h(e, t) {
1014
- for (var n = 65536, r = 0; r < t.length; r += 2) {
1015
- if (n += t[r], n > e) return !1;
1016
- if (n += t[r + 1], n >= e) return !0;
1017
- }
1018
- return !1;
1019
- }
1020
- function g(e, t) {
1021
- return e < 65 ? e === 36 : e < 91 ? !0 : e < 97 ? e === 95 : e < 123 ? !0 : e <= 65535 ? e >= 170 && p.test(String.fromCharCode(e)) : t !== !1 && h(e, o);
1022
- }
1023
- function _(e, t) {
1024
- return e < 48 ? e === 36 : e < 58 ? !0 : e < 65 ? !1 : e < 91 ? !0 : e < 97 ? e === 95 : e < 123 ? !0 : e <= 65535 ? e >= 170 && m.test(String.fromCharCode(e)) : t === !1 ? !1 : h(e, o) || h(e, a);
1025
- }
1026
- var v = function(e, t) {
1027
- t === void 0 && (t = {}), this.label = e, this.keyword = t.keyword, this.beforeExpr = !!t.beforeExpr, this.startsExpr = !!t.startsExpr, this.isLoop = !!t.isLoop, this.isAssign = !!t.isAssign, this.prefix = !!t.prefix, this.postfix = !!t.postfix, this.binop = t.binop || null, this.updateContext = null;
1028
- };
1029
- function y(e, t) {
1030
- return new v(e, {
1031
- beforeExpr: !0,
1032
- binop: t
1033
- });
1034
- }
1035
- var b = { beforeExpr: !0 }, x = { startsExpr: !0 }, ee = {};
1036
- function S(e, t) {
1037
- return t === void 0 && (t = {}), t.keyword = e, ee[e] = new v(e, t);
1038
- }
1039
- var C = {
1040
- num: new v("num", x),
1041
- regexp: new v("regexp", x),
1042
- string: new v("string", x),
1043
- name: new v("name", x),
1044
- privateId: new v("privateId", x),
1045
- eof: new v("eof"),
1046
- bracketL: new v("[", {
1047
- beforeExpr: !0,
1048
- startsExpr: !0
1049
- }),
1050
- bracketR: new v("]"),
1051
- braceL: new v("{", {
1052
- beforeExpr: !0,
1053
- startsExpr: !0
1054
- }),
1055
- braceR: new v("}"),
1056
- parenL: new v("(", {
1057
- beforeExpr: !0,
1058
- startsExpr: !0
1059
- }),
1060
- parenR: new v(")"),
1061
- comma: new v(",", b),
1062
- semi: new v(";", b),
1063
- colon: new v(":", b),
1064
- dot: new v("."),
1065
- question: new v("?", b),
1066
- questionDot: new v("?."),
1067
- arrow: new v("=>", b),
1068
- template: new v("template"),
1069
- invalidTemplate: new v("invalidTemplate"),
1070
- ellipsis: new v("...", b),
1071
- backQuote: new v("`", x),
1072
- dollarBraceL: new v("${", {
1073
- beforeExpr: !0,
1074
- startsExpr: !0
1075
- }),
1076
- eq: new v("=", {
1077
- beforeExpr: !0,
1078
- isAssign: !0
1079
- }),
1080
- assign: new v("_=", {
1081
- beforeExpr: !0,
1082
- isAssign: !0
1083
- }),
1084
- incDec: new v("++/--", {
1085
- prefix: !0,
1086
- postfix: !0,
1087
- startsExpr: !0
1088
- }),
1089
- prefix: new v("!/~", {
1090
- beforeExpr: !0,
1091
- prefix: !0,
1092
- startsExpr: !0
1093
- }),
1094
- logicalOR: y("||", 1),
1095
- logicalAND: y("&&", 2),
1096
- bitwiseOR: y("|", 3),
1097
- bitwiseXOR: y("^", 4),
1098
- bitwiseAND: y("&", 5),
1099
- equality: y("==/!=/===/!==", 6),
1100
- relational: y("</>/<=/>=", 7),
1101
- bitShift: y("<</>>/>>>", 8),
1102
- plusMin: new v("+/-", {
1103
- beforeExpr: !0,
1104
- binop: 9,
1105
- prefix: !0,
1106
- startsExpr: !0
1107
- }),
1108
- modulo: y("%", 10),
1109
- star: y("*", 10),
1110
- slash: y("/", 10),
1111
- starstar: new v("**", { beforeExpr: !0 }),
1112
- coalesce: y("??", 1),
1113
- _break: S("break"),
1114
- _case: S("case", b),
1115
- _catch: S("catch"),
1116
- _continue: S("continue"),
1117
- _debugger: S("debugger"),
1118
- _default: S("default", b),
1119
- _do: S("do", {
1120
- isLoop: !0,
1121
- beforeExpr: !0
1122
- }),
1123
- _else: S("else", b),
1124
- _finally: S("finally"),
1125
- _for: S("for", { isLoop: !0 }),
1126
- _function: S("function", x),
1127
- _if: S("if"),
1128
- _return: S("return", b),
1129
- _switch: S("switch"),
1130
- _throw: S("throw", b),
1131
- _try: S("try"),
1132
- _var: S("var"),
1133
- _const: S("const"),
1134
- _while: S("while", { isLoop: !0 }),
1135
- _with: S("with"),
1136
- _new: S("new", {
1137
- beforeExpr: !0,
1138
- startsExpr: !0
1139
- }),
1140
- _this: S("this", x),
1141
- _super: S("super", x),
1142
- _class: S("class", x),
1143
- _extends: S("extends", b),
1144
- _export: S("export"),
1145
- _import: S("import", x),
1146
- _null: S("null", x),
1147
- _true: S("true", x),
1148
- _false: S("false", x),
1149
- _in: S("in", {
1150
- beforeExpr: !0,
1151
- binop: 7
1152
- }),
1153
- _instanceof: S("instanceof", {
1154
- beforeExpr: !0,
1155
- binop: 7
1156
- }),
1157
- _typeof: S("typeof", {
1158
- beforeExpr: !0,
1159
- prefix: !0,
1160
- startsExpr: !0
1161
- }),
1162
- _void: S("void", {
1163
- beforeExpr: !0,
1164
- prefix: !0,
1165
- startsExpr: !0
1166
- }),
1167
- _delete: S("delete", {
1168
- beforeExpr: !0,
1169
- prefix: !0,
1170
- startsExpr: !0
1171
- })
1172
- }, w = /\r\n?|\n|\u2028|\u2029/, te = new RegExp(w.source, "g");
1173
- function T(e) {
1174
- return e === 10 || e === 13 || e === 8232 || e === 8233;
1175
- }
1176
- function ne(e, t, n) {
1177
- n === void 0 && (n = e.length);
1178
- for (var r = t; r < n; r++) {
1179
- var i = e.charCodeAt(r);
1180
- if (T(i)) return r < n - 1 && i === 13 && e.charCodeAt(r + 1) === 10 ? r + 2 : r + 1;
1181
- }
1182
- return -1;
1183
- }
1184
- var re = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/, E = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g, ie = Object.prototype, ae = ie.hasOwnProperty, oe = ie.toString, D = Object.hasOwn || (function(e, t) {
1185
- return ae.call(e, t);
1186
- }), se = Array.isArray || (function(e) {
1187
- return oe.call(e) === "[object Array]";
1188
- }), ce = Object.create(null);
1189
- function O(e) {
1190
- return ce[e] || (ce[e] = RegExp("^(?:" + e.replace(/ /g, "|") + ")$"));
1191
- }
1192
- function k(e) {
1193
- return e <= 65535 ? String.fromCharCode(e) : (e -= 65536, String.fromCharCode((e >> 10) + 55296, (e & 1023) + 56320));
1194
- }
1195
- var le = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/, A = function(e, t) {
1196
- this.line = e, this.column = t;
1197
- };
1198
- A.prototype.offset = function(e) {
1199
- return new A(this.line, this.column + e);
1200
- };
1201
- var ue = function(e, t, n) {
1202
- this.start = t, this.end = n, e.sourceFile !== null && (this.source = e.sourceFile);
1203
- };
1204
- function de(e, t) {
1205
- for (var n = 1, r = 0;;) {
1206
- var i = ne(e, r, t);
1207
- if (i < 0) return new A(n, t - r);
1208
- ++n, r = i;
1209
- }
1210
- }
1211
- var fe = {
1212
- ecmaVersion: null,
1213
- sourceType: "script",
1214
- strict: !1,
1215
- onInsertedSemicolon: null,
1216
- onTrailingComma: null,
1217
- allowReserved: null,
1218
- allowReturnOutsideFunction: !1,
1219
- allowImportExportEverywhere: !1,
1220
- allowAwaitOutsideFunction: null,
1221
- allowSuperOutsideMethod: null,
1222
- allowHashBang: !1,
1223
- checkPrivateFields: !0,
1224
- locations: !1,
1225
- onToken: null,
1226
- onComment: null,
1227
- ranges: !1,
1228
- program: null,
1229
- sourceFile: null,
1230
- directSourceFile: null,
1231
- preserveParens: !1
1232
- }, pe = !1;
1233
- function me(e) {
1234
- var t = {};
1235
- for (var n in fe) t[n] = e && D(e, n) ? e[n] : fe[n];
1236
- if (t.ecmaVersion === "latest" ? t.ecmaVersion = 1e8 : t.ecmaVersion == null ? (!pe && typeof console == "object" && console.warn && (pe = !0, console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.")), t.ecmaVersion = 11) : t.ecmaVersion >= 2015 && (t.ecmaVersion -= 2009), t.allowReserved ??= t.ecmaVersion < 5, (!e || e.allowHashBang == null) && (t.allowHashBang = t.ecmaVersion >= 14), se(t.onToken)) {
1237
- var r = t.onToken;
1238
- t.onToken = function(e) {
1239
- return r.push(e);
1240
- };
1241
- }
1242
- if (se(t.onComment) && (t.onComment = he(t, t.onComment)), t.sourceType === "commonjs" && t.allowAwaitOutsideFunction) throw Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");
1243
- return t;
1244
- }
1245
- function he(e, t) {
1246
- return function(n, r, i, a, o, s) {
1247
- var c = {
1248
- type: n ? "Block" : "Line",
1249
- value: r,
1250
- start: i,
1251
- end: a
1252
- };
1253
- e.locations && (c.loc = new ue(this, o, s)), e.ranges && (c.range = [i, a]), t.push(c);
1254
- };
1255
- }
1256
- var j = 1, M = 2, ge = 4, _e = 8, ve = 16, ye = 32, be = 64, xe = 128, N = 256, P = 512, Se = 1024, Ce = j | M | N;
1257
- function we(e, t) {
1258
- return M | (e ? ge : 0) | (t ? _e : 0);
1259
- }
1260
- var Te = 0, Ee = 1, F = 2, De = 3, Oe = 4, ke = 5, I = function(e, t, n) {
1261
- this.options = e = me(e), this.sourceFile = e.sourceFile, this.keywords = O(d[e.ecmaVersion >= 6 ? 6 : e.sourceType === "module" ? "5module" : 5]);
1262
- var r = "";
1263
- e.allowReserved !== !0 && (r = l[e.ecmaVersion >= 6 ? 6 : e.ecmaVersion === 5 ? 5 : 3], e.sourceType === "module" && (r += " await")), this.reservedWords = O(r);
1264
- var i = (r ? r + " " : "") + l.strict;
1265
- this.reservedWordsStrict = O(i), this.reservedWordsStrictBind = O(i + " " + l.strictBind), this.input = String(t), this.containsEsc = !1, n ? (this.pos = n, this.lineStart = this.input.lastIndexOf("\n", n - 1) + 1, this.curLine = this.input.slice(0, this.lineStart).split(w).length) : (this.pos = this.lineStart = 0, this.curLine = 1), this.type = C.eof, this.value = null, this.start = this.end = this.pos, this.startLoc = this.endLoc = this.curPosition(), this.lastTokEndLoc = this.lastTokStartLoc = null, this.lastTokStart = this.lastTokEnd = this.pos, this.context = this.initialContext(), this.exprAllowed = !0, this.inModule = e.sourceType === "module", this.strict = this.inModule || e.strict === !0 || this.strictDirective(this.pos), this.potentialArrowAt = -1, this.potentialArrowInForAwait = !1, this.yieldPos = this.awaitPos = this.awaitIdentPos = 0, this.labels = [], this.undefinedExports = Object.create(null), this.pos === 0 && e.allowHashBang && this.input.slice(0, 2) === "#!" && this.skipLineComment(2), this.scopeStack = [], this.enterScope(this.options.sourceType === "commonjs" ? M : j), this.regexpState = null, this.privateNameStack = [];
1266
- }, L = {
1267
- inFunction: { configurable: !0 },
1268
- inGenerator: { configurable: !0 },
1269
- inAsync: { configurable: !0 },
1270
- canAwait: { configurable: !0 },
1271
- allowReturn: { configurable: !0 },
1272
- allowSuper: { configurable: !0 },
1273
- allowDirectSuper: { configurable: !0 },
1274
- treatFunctionsAsVar: { configurable: !0 },
1275
- allowNewDotTarget: { configurable: !0 },
1276
- allowUsing: { configurable: !0 },
1277
- inClassStaticBlock: { configurable: !0 }
1278
- };
1279
- I.prototype.parse = function() {
1280
- var e = this, t = this.options.program || this.startNode();
1281
- return this.nextToken(), this.catchStackOverflow(function() {
1282
- return e.parseTopLevel(t);
1283
- });
1284
- }, L.inFunction.get = function() {
1285
- return (this.currentVarScope().flags & M) > 0;
1286
- }, L.inGenerator.get = function() {
1287
- return (this.currentVarScope().flags & _e) > 0;
1288
- }, L.inAsync.get = function() {
1289
- return (this.currentVarScope().flags & ge) > 0;
1290
- }, L.canAwait.get = function() {
1291
- for (var e = this.scopeStack.length - 1; e >= 0; e--) {
1292
- var t = this.scopeStack[e].flags;
1293
- if (t & (N | P)) return !1;
1294
- if (t & M) return (t & ge) > 0;
1295
- }
1296
- return this.inModule && this.options.ecmaVersion >= 13 || this.options.allowAwaitOutsideFunction;
1297
- }, L.allowReturn.get = function() {
1298
- return !!(this.inFunction || this.options.allowReturnOutsideFunction && this.currentVarScope().flags & j);
1299
- }, L.allowSuper.get = function() {
1300
- return (this.currentThisScope().flags & be) > 0 || this.options.allowSuperOutsideMethod;
1301
- }, L.allowDirectSuper.get = function() {
1302
- return (this.currentThisScope().flags & xe) > 0;
1303
- }, L.treatFunctionsAsVar.get = function() {
1304
- return this.treatFunctionsAsVarInScope(this.currentScope());
1305
- }, L.allowNewDotTarget.get = function() {
1306
- for (var e = this.scopeStack.length - 1; e >= 0; e--) {
1307
- var t = this.scopeStack[e].flags;
1308
- if (t & (N | P) || t & M && !(t & ve)) return !0;
1309
- }
1310
- return !1;
1311
- }, L.allowUsing.get = function() {
1312
- var e = this.currentScope().flags;
1313
- return !(e & Se || !this.inModule && e & j);
1314
- }, L.inClassStaticBlock.get = function() {
1315
- return (this.currentVarScope().flags & N) > 0;
1316
- }, I.extend = function() {
1317
- for (var e = [], t = arguments.length; t--;) e[t] = arguments[t];
1318
- for (var n = this, r = 0; r < e.length; r++) n = e[r](n);
1319
- return n;
1320
- }, I.parse = function(e, t) {
1321
- return new this(t, e).parse();
1322
- }, I.parseExpressionAt = function(e, t, n) {
1323
- var r = new this(n, e, t);
1324
- return r.nextToken(), r.parseExpression();
1325
- }, I.tokenizer = function(e, t) {
1326
- return new this(t, e);
1327
- }, Object.defineProperties(I.prototype, L);
1328
- var R = I.prototype, Ae = /^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;
1329
- R.strictDirective = function(e) {
1330
- if (this.options.ecmaVersion < 5) return !1;
1331
- for (;;) {
1332
- E.lastIndex = e, e += E.exec(this.input)[0].length;
1333
- var t = Ae.exec(this.input.slice(e));
1334
- if (!t) return !1;
1335
- if ((t[1] || t[2]) === "use strict") {
1336
- E.lastIndex = e + t[0].length;
1337
- var n = E.exec(this.input), r = n.index + n[0].length, i = this.input.charAt(r);
1338
- return i === ";" || i === "}" || w.test(n[0]) && !(/[(`.[+\-/*%<>=,?^&]/.test(i) || i === "!" && this.input.charAt(r + 1) === "=");
1339
- }
1340
- e += t[0].length, E.lastIndex = e, e += E.exec(this.input)[0].length, this.input[e] === ";" && e++;
1341
- }
1342
- }, R.eat = function(e) {
1343
- return this.type === e ? (this.next(), !0) : !1;
1344
- }, R.isContextual = function(e) {
1345
- return this.type === C.name && this.value === e && !this.containsEsc;
1346
- }, R.eatContextual = function(e) {
1347
- return this.isContextual(e) ? (this.next(), !0) : !1;
1348
- }, R.catchStackOverflow = function(e) {
1349
- try {
1350
- return e();
1351
- } catch (e) {
1352
- if (e instanceof Error && (/\bstack\b.*\b(exceeded|overflow)\b/i.test(e.message) || /\btoo much recursion\b/i.test(e.message))) this.raise(this.start, "Not enough stack space to parse input");
1353
- else throw e;
1354
- }
1355
- }, R.expectContextual = function(e) {
1356
- this.eatContextual(e) || this.unexpected();
1357
- }, R.canInsertSemicolon = function() {
1358
- return this.type === C.eof || this.type === C.braceR || w.test(this.input.slice(this.lastTokEnd, this.start));
1359
- }, R.insertSemicolon = function() {
1360
- if (this.canInsertSemicolon()) return this.options.onInsertedSemicolon && this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc), !0;
1361
- }, R.semicolon = function() {
1362
- !this.eat(C.semi) && !this.insertSemicolon() && this.unexpected();
1363
- }, R.afterTrailingComma = function(e, t) {
1364
- if (this.type === e) return this.options.onTrailingComma && this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc), t || this.next(), !0;
1365
- }, R.expect = function(e) {
1366
- this.eat(e) || this.unexpected();
1367
- }, R.unexpected = function(e) {
1368
- this.raise(e ?? this.start, "Unexpected token");
1369
- };
1370
- var je = function() {
1371
- this.shorthandAssign = this.trailingComma = this.parenthesizedAssign = this.parenthesizedBind = this.doubleProto = -1;
1372
- };
1373
- R.checkPatternErrors = function(e, t) {
1374
- if (e) {
1375
- e.trailingComma > -1 && this.raiseRecoverable(e.trailingComma, "Comma is not permitted after the rest element");
1376
- var n = t ? e.parenthesizedAssign : e.parenthesizedBind;
1377
- n > -1 && this.raiseRecoverable(n, t ? "Assigning to rvalue" : "Parenthesized pattern");
1378
- }
1379
- }, R.checkExpressionErrors = function(e, t) {
1380
- if (!e) return !1;
1381
- var n = e.shorthandAssign, r = e.doubleProto;
1382
- if (!t) return n >= 0 || r >= 0;
1383
- n >= 0 && this.raise(n, "Shorthand property assignments are valid only in destructuring patterns"), r >= 0 && this.raiseRecoverable(r, "Redefinition of __proto__ property");
1384
- }, R.checkYieldAwaitInDefaultParams = function() {
1385
- this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos) && this.raise(this.yieldPos, "Yield expression cannot be a default value"), this.awaitPos && this.raise(this.awaitPos, "Await expression cannot be a default value");
1386
- }, R.isSimpleAssignTarget = function(e) {
1387
- return e.type === "ParenthesizedExpression" ? this.isSimpleAssignTarget(e.expression) : e.type === "Identifier" || e.type === "MemberExpression";
1388
- };
1389
- var z = I.prototype;
1390
- z.parseTopLevel = function(e) {
1391
- var t = Object.create(null);
1392
- for (e.body ||= []; this.type !== C.eof;) {
1393
- var n = this.parseStatement(null, !0, t);
1394
- e.body.push(n);
1395
- }
1396
- if (this.inModule) for (var r = 0, i = Object.keys(this.undefinedExports); r < i.length; r += 1) {
1397
- var a = i[r];
1398
- this.raiseRecoverable(this.undefinedExports[a].start, "Export '" + a + "' is not defined");
1399
- }
1400
- return this.adaptDirectivePrologue(e.body), this.next(), e.sourceType = this.options.sourceType === "commonjs" ? "script" : this.options.sourceType, this.finishNode(e, "Program");
1401
- };
1402
- var Me = { kind: "loop" }, Ne = { kind: "switch" };
1403
- z.isLet = function(e) {
1404
- if (this.options.ecmaVersion < 6 || !this.isContextual("let")) return !1;
1405
- E.lastIndex = this.pos;
1406
- var t = E.exec(this.input), n = this.pos + t[0].length, r = this.fullCharCodeAt(n);
1407
- if (r === 91 || r === 92) return !0;
1408
- if (e) return !1;
1409
- if (r === 123) return !0;
1410
- if (g(r)) {
1411
- var i = n;
1412
- do
1413
- n += r <= 65535 ? 1 : 2;
1414
- while (_(r = this.fullCharCodeAt(n)));
1415
- if (r === 92) return !0;
1416
- var a = this.input.slice(i, n);
1417
- if (!f.test(a)) return !0;
1418
- }
1419
- return !1;
1420
- }, z.isAsyncFunction = function() {
1421
- if (this.options.ecmaVersion < 8 || !this.isContextual("async")) return !1;
1422
- E.lastIndex = this.pos;
1423
- var e = E.exec(this.input), t = this.pos + e[0].length, n;
1424
- return !w.test(this.input.slice(this.pos, t)) && this.input.slice(t, t + 8) === "function" && (t + 8 === this.input.length || !(_(n = this.fullCharCodeAt(t + 8)) || n === 92));
1425
- }, z.isUsingKeyword = function(e, t) {
1426
- if (this.options.ecmaVersion < 17 || !this.isContextual(e ? "await" : "using")) return !1;
1427
- E.lastIndex = this.pos;
1428
- var n = E.exec(this.input), r = this.pos + n[0].length;
1429
- if (w.test(this.input.slice(this.pos, r))) return !1;
1430
- if (e) {
1431
- var i = r + 5, a;
1432
- if (this.input.slice(r, i) !== "using" || i === this.input.length || _(a = this.fullCharCodeAt(i)) || a === 92) return !1;
1433
- E.lastIndex = i;
1434
- var o = E.exec(this.input);
1435
- if (r = i + o[0].length, o && w.test(this.input.slice(i, r))) return !1;
1436
- }
1437
- var s = this.fullCharCodeAt(r);
1438
- if (!g(s) && s !== 92) return !1;
1439
- var c = r;
1440
- do
1441
- r += s <= 65535 ? 1 : 2;
1442
- while (_(s = this.fullCharCodeAt(r)));
1443
- if (s === 92) return !0;
1444
- var l = this.input.slice(c, r);
1445
- if (f.test(l)) return !1;
1446
- if (t && !e && l === "of") {
1447
- E.lastIndex = r;
1448
- var u = E.exec(this.input);
1449
- if (r += u[0].length, this.input.charCodeAt(r) !== 61 || (s = this.input.charCodeAt(r + 1)) === 61 || s === 62) return !1;
1450
- }
1451
- return !0;
1452
- }, z.isAwaitUsing = function(e) {
1453
- return this.isUsingKeyword(!0, e);
1454
- }, z.isUsing = function(e) {
1455
- return this.isUsingKeyword(!1, e);
1456
- }, z.parseStatement = function(e, t, n) {
1457
- var r = this.type, i = this.startNode(), a;
1458
- switch (this.isLet(e) && (r = C._var, a = "let"), r) {
1459
- case C._break:
1460
- case C._continue: return this.parseBreakContinueStatement(i, r.keyword);
1461
- case C._debugger: return this.parseDebuggerStatement(i);
1462
- case C._do: return this.parseDoStatement(i);
1463
- case C._for: return this.parseForStatement(i);
1464
- case C._function: return e && (this.strict || e !== "if" && e !== "label") && this.options.ecmaVersion >= 6 && this.unexpected(), this.parseFunctionStatement(i, !1, !e);
1465
- case C._class: return e && this.unexpected(), this.parseClass(i, !0);
1466
- case C._if: return this.parseIfStatement(i);
1467
- case C._return: return this.parseReturnStatement(i);
1468
- case C._switch: return this.parseSwitchStatement(i);
1469
- case C._throw: return this.parseThrowStatement(i);
1470
- case C._try: return this.parseTryStatement(i);
1471
- case C._const:
1472
- case C._var: return a ||= this.value, e && a !== "var" && this.unexpected(), this.parseVarStatement(i, a);
1473
- case C._while: return this.parseWhileStatement(i);
1474
- case C._with: return this.parseWithStatement(i);
1475
- case C.braceL: return this.parseBlock(!0, i);
1476
- case C.semi: return this.parseEmptyStatement(i);
1477
- case C._export:
1478
- case C._import:
1479
- if (this.options.ecmaVersion > 10 && r === C._import) {
1480
- E.lastIndex = this.pos;
1481
- var o = E.exec(this.input), s = this.pos + o[0].length, c = this.input.charCodeAt(s);
1482
- if (c === 40 || c === 46) return this.parseExpressionStatement(i, this.parseExpression());
1483
- }
1484
- return this.options.allowImportExportEverywhere || (t || this.raise(this.start, "'import' and 'export' may only appear at the top level"), this.inModule || this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'")), r === C._import ? this.parseImport(i) : this.parseExport(i, n);
1485
- default:
1486
- if (this.isAsyncFunction()) return e && this.unexpected(), this.next(), this.parseFunctionStatement(i, !0, !e);
1487
- var l = this.isAwaitUsing(!1) ? "await using" : this.isUsing(!1) ? "using" : null;
1488
- if (l) return this.allowUsing || this.raise(this.start, "Using declaration cannot appear in the top level when source type is `script` or in the bare case statement"), e && this.raise(this.start, "Using declaration is not allowed in single-statement positions"), l === "await using" && (this.canAwait || this.raise(this.start, "Await using cannot appear outside of async function"), this.next()), this.next(), this.parseVar(i, !1, l), this.semicolon(), this.finishNode(i, "VariableDeclaration");
1489
- var u = this.value, d = this.parseExpression();
1490
- return r === C.name && d.type === "Identifier" && this.eat(C.colon) ? this.parseLabeledStatement(i, u, d, e) : this.parseExpressionStatement(i, d);
1491
- }
1492
- }, z.parseBreakContinueStatement = function(e, t) {
1493
- var n = t === "break";
1494
- this.next(), this.eat(C.semi) || this.insertSemicolon() ? e.label = null : this.type === C.name ? (e.label = this.parseIdent(), this.semicolon()) : this.unexpected();
1495
- for (var r = 0; r < this.labels.length; ++r) {
1496
- var i = this.labels[r];
1497
- if ((e.label == null || i.name === e.label.name) && (i.kind != null && (n || i.kind === "loop") || e.label && n)) break;
1498
- }
1499
- return r === this.labels.length && this.raise(e.start, "Unsyntactic " + t), this.finishNode(e, n ? "BreakStatement" : "ContinueStatement");
1500
- }, z.parseDebuggerStatement = function(e) {
1501
- return this.next(), this.semicolon(), this.finishNode(e, "DebuggerStatement");
1502
- }, z.parseDoStatement = function(e) {
1503
- return this.next(), this.labels.push(Me), e.body = this.parseStatement("do"), this.labels.pop(), this.expect(C._while), e.test = this.parseParenExpression(), this.options.ecmaVersion >= 6 ? this.eat(C.semi) : this.semicolon(), this.finishNode(e, "DoWhileStatement");
1504
- }, z.parseForStatement = function(e) {
1505
- this.next();
1506
- var t = this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual("await") ? this.lastTokStart : -1;
1507
- if (this.labels.push(Me), this.enterScope(0), this.expect(C.parenL), this.type === C.semi) return t > -1 && this.unexpected(t), this.parseFor(e, null);
1508
- var n = this.isLet();
1509
- if (this.type === C._var || this.type === C._const || n) {
1510
- var r = this.startNode(), i = n ? "let" : this.value;
1511
- return this.next(), this.parseVar(r, !0, i), this.finishNode(r, "VariableDeclaration"), this.parseForAfterInit(e, r, t);
1512
- }
1513
- var a = this.isContextual("let"), o = !1, s = this.isUsing(!0) ? "using" : this.isAwaitUsing(!0) ? "await using" : null;
1514
- if (s) {
1515
- var c = this.startNode();
1516
- return this.next(), s === "await using" && (this.canAwait || this.raise(this.start, "Await using cannot appear outside of async function"), this.next()), this.parseVar(c, !0, s), this.finishNode(c, "VariableDeclaration"), this.parseForAfterInit(e, c, t);
1517
- }
1518
- var l = this.containsEsc, u = new je(), d = this.start, f = t > -1 ? this.parseExprSubscripts(u, "await") : this.parseExpression(!0, u);
1519
- return this.type === C._in || (o = this.options.ecmaVersion >= 6 && this.isContextual("of")) ? (t > -1 ? (this.type === C._in && this.unexpected(t), e.await = !0) : o && this.options.ecmaVersion >= 8 && (f.start === d && !l && f.type === "Identifier" && f.name === "async" ? this.unexpected() : this.options.ecmaVersion >= 9 && (e.await = !1)), a && o && this.raise(f.start, "The left-hand side of a for-of loop may not start with 'let'."), this.toAssignable(f, !1, u), this.checkLValPattern(f), this.parseForIn(e, f)) : (this.checkExpressionErrors(u, !0), t > -1 && this.unexpected(t), this.parseFor(e, f));
1520
- }, z.parseForAfterInit = function(e, t, n) {
1521
- return (this.type === C._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && t.declarations.length === 1 ? (this.type === C._in ? ((t.kind === "using" || t.kind === "await using") && !t.declarations[0].init && this.raise(this.start, "Using declaration is not allowed in for-in loops"), this.options.ecmaVersion >= 9 && n > -1 && this.unexpected(n)) : this.options.ecmaVersion >= 9 && (e.await = n > -1), this.parseForIn(e, t)) : (n > -1 && this.unexpected(n), this.parseFor(e, t));
1522
- }, z.parseFunctionStatement = function(e, t, n) {
1523
- return this.next(), this.parseFunction(e, B | (n ? 0 : Fe), !1, t);
1524
- }, z.parseIfStatement = function(e) {
1525
- return this.next(), e.test = this.parseParenExpression(), e.consequent = this.parseStatement("if"), e.alternate = this.eat(C._else) ? this.parseStatement("if") : null, this.finishNode(e, "IfStatement");
1526
- }, z.parseReturnStatement = function(e) {
1527
- return this.allowReturn || this.raise(this.start, "'return' outside of function"), this.next(), this.eat(C.semi) || this.insertSemicolon() ? e.argument = null : (e.argument = this.parseExpression(), this.semicolon()), this.finishNode(e, "ReturnStatement");
1528
- }, z.parseSwitchStatement = function(e) {
1529
- this.next(), e.discriminant = this.parseParenExpression(), e.cases = [], this.expect(C.braceL), this.labels.push(Ne), this.enterScope(Se);
1530
- for (var t, n = !1; this.type !== C.braceR;) if (this.type === C._case || this.type === C._default) {
1531
- var r = this.type === C._case;
1532
- t && this.finishNode(t, "SwitchCase"), e.cases.push(t = this.startNode()), t.consequent = [], this.next(), r ? t.test = this.parseExpression() : (n && this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"), n = !0, t.test = null), this.expect(C.colon);
1533
- } else t || this.unexpected(), t.consequent.push(this.parseStatement(null));
1534
- return this.exitScope(), t && this.finishNode(t, "SwitchCase"), this.next(), this.labels.pop(), this.finishNode(e, "SwitchStatement");
1535
- }, z.parseThrowStatement = function(e) {
1536
- return this.next(), w.test(this.input.slice(this.lastTokEnd, this.start)) && this.raise(this.lastTokEnd, "Illegal newline after throw"), e.argument = this.parseExpression(), this.semicolon(), this.finishNode(e, "ThrowStatement");
1537
- };
1538
- var Pe = [];
1539
- z.parseCatchClauseParam = function() {
1540
- var e = this.parseBindingAtom(), t = e.type === "Identifier";
1541
- return this.enterScope(t ? ye : 0), this.checkLValPattern(e, t ? Oe : F), this.expect(C.parenR), e;
1542
- }, z.parseTryStatement = function(e) {
1543
- if (this.next(), e.block = this.parseBlock(), e.handler = null, this.type === C._catch) {
1544
- var t = this.startNode();
1545
- this.next(), this.eat(C.parenL) ? t.param = this.parseCatchClauseParam() : (this.options.ecmaVersion < 10 && this.unexpected(), t.param = null, this.enterScope(0)), t.body = this.parseBlock(!1), this.exitScope(), e.handler = this.finishNode(t, "CatchClause");
1546
- }
1547
- return e.finalizer = this.eat(C._finally) ? this.parseBlock() : null, !e.handler && !e.finalizer && this.raise(e.start, "Missing catch or finally clause"), this.finishNode(e, "TryStatement");
1548
- }, z.parseVarStatement = function(e, t, n) {
1549
- return this.next(), this.parseVar(e, !1, t, n), this.semicolon(), this.finishNode(e, "VariableDeclaration");
1550
- }, z.parseWhileStatement = function(e) {
1551
- return this.next(), e.test = this.parseParenExpression(), this.labels.push(Me), e.body = this.parseStatement("while"), this.labels.pop(), this.finishNode(e, "WhileStatement");
1552
- }, z.parseWithStatement = function(e) {
1553
- return this.strict && this.raise(this.start, "'with' in strict mode"), this.next(), e.object = this.parseParenExpression(), e.body = this.parseStatement("with"), this.finishNode(e, "WithStatement");
1554
- }, z.parseEmptyStatement = function(e) {
1555
- return this.next(), this.finishNode(e, "EmptyStatement");
1556
- }, z.parseLabeledStatement = function(e, t, n, r) {
1557
- for (var i = 0, a = this.labels; i < a.length; i += 1) a[i].name === t && this.raise(n.start, "Label '" + t + "' is already declared");
1558
- for (var o = this.type.isLoop ? "loop" : this.type === C._switch ? "switch" : null, s = this.labels.length - 1; s >= 0; s--) {
1559
- var c = this.labels[s];
1560
- if (c.statementStart === e.start) c.statementStart = this.start, c.kind = o;
1561
- else break;
1562
- }
1563
- return this.labels.push({
1564
- name: t,
1565
- kind: o,
1566
- statementStart: this.start
1567
- }), e.body = this.parseStatement(r ? r.indexOf("label") === -1 ? r + "label" : r : "label"), this.labels.pop(), e.label = n, this.finishNode(e, "LabeledStatement");
1568
- }, z.parseExpressionStatement = function(e, t) {
1569
- return e.expression = t, this.semicolon(), this.finishNode(e, "ExpressionStatement");
1570
- }, z.parseBlock = function(e, t, n) {
1571
- for (e === void 0 && (e = !0), t === void 0 && (t = this.startNode()), t.body = [], this.expect(C.braceL), e && this.enterScope(0); this.type !== C.braceR;) {
1572
- var r = this.parseStatement(null);
1573
- t.body.push(r);
1574
- }
1575
- return n && (this.strict = !1), this.next(), e && this.exitScope(), this.finishNode(t, "BlockStatement");
1576
- }, z.parseFor = function(e, t) {
1577
- return e.init = t, this.expect(C.semi), e.test = this.type === C.semi ? null : this.parseExpression(), this.expect(C.semi), e.update = this.type === C.parenR ? null : this.parseExpression(), this.expect(C.parenR), e.body = this.parseStatement("for"), this.exitScope(), this.labels.pop(), this.finishNode(e, "ForStatement");
1578
- }, z.parseForIn = function(e, t) {
1579
- var n = this.type === C._in;
1580
- return this.next(), t.type === "VariableDeclaration" && t.declarations[0].init != null && (!n || this.options.ecmaVersion < 8 || this.strict || t.kind !== "var" || t.declarations[0].id.type !== "Identifier") && this.raise(t.start, (n ? "for-in" : "for-of") + " loop variable declaration may not have an initializer"), e.left = t, e.right = n ? this.parseExpression() : this.parseMaybeAssign(), this.expect(C.parenR), e.body = this.parseStatement("for"), this.exitScope(), this.labels.pop(), this.finishNode(e, n ? "ForInStatement" : "ForOfStatement");
1581
- }, z.parseVar = function(e, t, n, r) {
1582
- for (e.declarations = [], e.kind = n;;) {
1583
- var i = this.startNode();
1584
- if (this.parseVarId(i, n), this.eat(C.eq) ? i.init = this.parseMaybeAssign(t) : !r && n === "const" && !(this.type === C._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) ? this.unexpected() : !r && (n === "using" || n === "await using") && this.options.ecmaVersion >= 17 && this.type !== C._in && !this.isContextual("of") ? this.raise(this.lastTokEnd, "Missing initializer in " + n + " declaration") : !r && i.id.type !== "Identifier" && !(t && (this.type === C._in || this.isContextual("of"))) ? this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value") : i.init = null, e.declarations.push(this.finishNode(i, "VariableDeclarator")), !this.eat(C.comma)) break;
1585
- }
1586
- return e;
1587
- }, z.parseVarId = function(e, t) {
1588
- e.id = t === "using" || t === "await using" ? this.parseIdent() : this.parseBindingAtom(), this.checkLValPattern(e.id, t === "var" ? Ee : F, !1);
1589
- };
1590
- var B = 1, Fe = 2, Ie = 4;
1591
- z.parseFunction = function(e, t, n, r, i) {
1592
- this.initFunction(e), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !r) && (this.type === C.star && t & Fe && this.unexpected(), e.generator = this.eat(C.star)), this.options.ecmaVersion >= 8 && (e.async = !!r), t & B && (e.id = t & Ie && this.type !== C.name ? null : this.parseIdent(), e.id && !(t & Fe) && this.checkLValSimple(e.id, this.strict || e.generator || e.async ? this.treatFunctionsAsVar ? Ee : F : De));
1593
- var a = this.yieldPos, o = this.awaitPos, s = this.awaitIdentPos;
1594
- return this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(we(e.async, e.generator)), t & B || (e.id = this.type === C.name ? this.parseIdent() : null), this.parseFunctionParams(e), this.parseFunctionBody(e, n, !1, i), this.yieldPos = a, this.awaitPos = o, this.awaitIdentPos = s, this.finishNode(e, t & B ? "FunctionDeclaration" : "FunctionExpression");
1595
- }, z.parseFunctionParams = function(e) {
1596
- this.expect(C.parenL), e.params = this.parseBindingList(C.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams();
1597
- }, z.parseClass = function(e, t) {
1598
- this.next();
1599
- var n = this.strict;
1600
- this.strict = !0, this.parseClassId(e, t), this.parseClassSuper(e);
1601
- var r = this.enterClassBody(), i = this.startNode(), a = !1;
1602
- for (i.body = [], this.expect(C.braceL); this.type !== C.braceR;) {
1603
- var o = this.parseClassElement(e.superClass !== null);
1604
- o && (i.body.push(o), o.type === "MethodDefinition" && o.kind === "constructor" ? (a && this.raiseRecoverable(o.start, "Duplicate constructor in the same class"), a = !0) : o.key && o.key.type === "PrivateIdentifier" && Le(r, o) && this.raiseRecoverable(o.key.start, "Identifier '#" + o.key.name + "' has already been declared"));
1605
- }
1606
- return this.strict = n, this.next(), e.body = this.finishNode(i, "ClassBody"), this.exitClassBody(), this.finishNode(e, t ? "ClassDeclaration" : "ClassExpression");
1607
- }, z.parseClassElement = function(e) {
1608
- if (this.eat(C.semi)) return null;
1609
- var t = this.options.ecmaVersion, n = this.startNode(), r = "", i = !1, a = !1, o = "method", s = !1;
1610
- if (this.eatContextual("static")) {
1611
- if (t >= 13 && this.eat(C.braceL)) return this.parseClassStaticBlock(n), n;
1612
- this.isClassElementNameStart() || this.type === C.star ? s = !0 : r = "static";
1613
- }
1614
- if (n.static = s, !r && t >= 8 && this.eatContextual("async") && ((this.isClassElementNameStart() || this.type === C.star) && !this.canInsertSemicolon() ? a = !0 : r = "async"), !r && (t >= 9 || !a) && this.eat(C.star) && (i = !0), !r && !a && !i) {
1615
- var c = this.value;
1616
- (this.eatContextual("get") || this.eatContextual("set")) && (this.isClassElementNameStart() ? o = c : r = c);
1617
- }
1618
- if (r ? (n.computed = !1, n.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc), n.key.name = r, this.finishNode(n.key, "Identifier")) : this.parseClassElementName(n), t < 13 || this.type === C.parenL || o !== "method" || i || a) {
1619
- var l = !n.static && Re(n, "constructor"), u = l && e;
1620
- l && o !== "method" && this.raise(n.key.start, "Constructor can't have get/set modifier"), n.kind = l ? "constructor" : o, this.parseClassMethod(n, i, a, u);
1621
- } else this.parseClassField(n);
1622
- return n;
1623
- }, z.isClassElementNameStart = function() {
1624
- return this.type === C.name || this.type === C.privateId || this.type === C.num || this.type === C.string || this.type === C.bracketL || this.type.keyword;
1625
- }, z.parseClassElementName = function(e) {
1626
- this.type === C.privateId ? (this.value === "constructor" && this.raise(this.start, "Classes can't have an element named '#constructor'"), e.computed = !1, e.key = this.parsePrivateIdent()) : this.parsePropertyName(e);
1627
- }, z.parseClassMethod = function(e, t, n, r) {
1628
- var i = e.key;
1629
- e.kind === "constructor" ? (t && this.raise(i.start, "Constructor can't be a generator"), n && this.raise(i.start, "Constructor can't be an async method")) : e.static && Re(e, "prototype") && this.raise(i.start, "Classes may not have a static property named prototype");
1630
- var a = e.value = this.parseMethod(t, n, r);
1631
- return e.kind === "get" && a.params.length !== 0 && this.raiseRecoverable(a.start, "getter should have no params"), e.kind === "set" && a.params.length !== 1 && this.raiseRecoverable(a.start, "setter should have exactly one param"), e.kind === "set" && a.params[0].type === "RestElement" && this.raiseRecoverable(a.params[0].start, "Setter cannot use rest params"), this.finishNode(e, "MethodDefinition");
1632
- }, z.parseClassField = function(e) {
1633
- return Re(e, "constructor") ? this.raise(e.key.start, "Classes can't have a field named 'constructor'") : e.static && Re(e, "prototype") && this.raise(e.key.start, "Classes can't have a static field named 'prototype'"), this.eat(C.eq) ? (this.enterScope(P | be), e.value = this.parseMaybeAssign(), this.exitScope()) : e.value = null, this.semicolon(), this.finishNode(e, "PropertyDefinition");
1634
- }, z.parseClassStaticBlock = function(e) {
1635
- e.body = [];
1636
- var t = this.labels;
1637
- for (this.labels = [], this.enterScope(N | be); this.type !== C.braceR;) {
1638
- var n = this.parseStatement(null);
1639
- e.body.push(n);
1640
- }
1641
- return this.next(), this.exitScope(), this.labels = t, this.finishNode(e, "StaticBlock");
1642
- }, z.parseClassId = function(e, t) {
1643
- this.type === C.name ? (e.id = this.parseIdent(), t && this.checkLValSimple(e.id, F, !1)) : (t === !0 && this.unexpected(), e.id = null);
1644
- }, z.parseClassSuper = function(e) {
1645
- e.superClass = this.eat(C._extends) ? this.parseExprSubscripts(null, !1) : null;
1646
- }, z.enterClassBody = function() {
1647
- var e = {
1648
- declared: Object.create(null),
1649
- used: []
1650
- };
1651
- return this.privateNameStack.push(e), e.declared;
1652
- }, z.exitClassBody = function() {
1653
- var e = this.privateNameStack.pop(), t = e.declared, n = e.used;
1654
- if (this.options.checkPrivateFields) for (var r = this.privateNameStack.length, i = r === 0 ? null : this.privateNameStack[r - 1], a = 0; a < n.length; ++a) {
1655
- var o = n[a];
1656
- D(t, o.name) || (i ? i.used.push(o) : this.raiseRecoverable(o.start, "Private field '#" + o.name + "' must be declared in an enclosing class"));
1657
- }
1658
- };
1659
- function Le(e, t) {
1660
- var n = t.key.name, r = e[n], i = "true";
1661
- return t.type === "MethodDefinition" && (t.kind === "get" || t.kind === "set") && (i = (t.static ? "s" : "i") + t.kind), r === "iget" && i === "iset" || r === "iset" && i === "iget" || r === "sget" && i === "sset" || r === "sset" && i === "sget" ? (e[n] = "true", !1) : r ? !0 : (e[n] = i, !1);
1662
- }
1663
- function Re(e, t) {
1664
- var n = e.computed, r = e.key;
1665
- return !n && (r.type === "Identifier" && r.name === t || r.type === "Literal" && r.value === t);
1666
- }
1667
- z.parseExportAllDeclaration = function(e, t) {
1668
- return this.options.ecmaVersion >= 11 && (this.eatContextual("as") ? (e.exported = this.parseModuleExportName(), this.checkExport(t, e.exported, this.lastTokStart)) : e.exported = null), this.expectContextual("from"), this.type !== C.string && this.unexpected(), e.source = this.parseExprAtom(), this.options.ecmaVersion >= 16 && (e.attributes = this.parseWithClause()), this.semicolon(), this.finishNode(e, "ExportAllDeclaration");
1669
- }, z.parseExport = function(e, t) {
1670
- if (this.next(), this.eat(C.star)) return this.parseExportAllDeclaration(e, t);
1671
- if (this.eat(C._default)) return this.checkExport(t, "default", this.lastTokStart), e.declaration = this.parseExportDefaultDeclaration(), this.finishNode(e, "ExportDefaultDeclaration");
1672
- if (this.shouldParseExportStatement()) e.declaration = this.parseExportDeclaration(e), e.declaration.type === "VariableDeclaration" ? this.checkVariableExport(t, e.declaration.declarations) : this.checkExport(t, e.declaration.id, e.declaration.id.start), e.specifiers = [], e.source = null, this.options.ecmaVersion >= 16 && (e.attributes = []);
1673
- else {
1674
- if (e.declaration = null, e.specifiers = this.parseExportSpecifiers(t), this.eatContextual("from")) this.type !== C.string && this.unexpected(), e.source = this.parseExprAtom(), this.options.ecmaVersion >= 16 && (e.attributes = this.parseWithClause());
1675
- else {
1676
- for (var n = 0, r = e.specifiers; n < r.length; n += 1) {
1677
- var i = r[n];
1678
- this.checkUnreserved(i.local), this.checkLocalExport(i.local), i.local.type === "Literal" && this.raise(i.local.start, "A string literal cannot be used as an exported binding without `from`.");
1679
- }
1680
- e.source = null, this.options.ecmaVersion >= 16 && (e.attributes = []);
1681
- }
1682
- this.semicolon();
1683
- }
1684
- return this.finishNode(e, "ExportNamedDeclaration");
1685
- }, z.parseExportDeclaration = function(e) {
1686
- return this.parseStatement(null);
1687
- }, z.parseExportDefaultDeclaration = function() {
1688
- var e;
1689
- if (this.type === C._function || (e = this.isAsyncFunction())) {
1690
- var t = this.startNode();
1691
- return this.next(), e && this.next(), this.parseFunction(t, B | Ie, !1, e);
1692
- } else if (this.type === C._class) {
1693
- var n = this.startNode();
1694
- return this.parseClass(n, "nullableID");
1695
- } else {
1696
- var r = this.parseMaybeAssign();
1697
- return this.semicolon(), r;
1698
- }
1699
- }, z.checkExport = function(e, t, n) {
1700
- e && (typeof t != "string" && (t = t.type === "Identifier" ? t.name : t.value), D(e, t) && this.raiseRecoverable(n, "Duplicate export '" + t + "'"), e[t] = !0);
1701
- }, z.checkPatternExport = function(e, t) {
1702
- var n = t.type;
1703
- if (n === "Identifier") this.checkExport(e, t, t.start);
1704
- else if (n === "ObjectPattern") for (var r = 0, i = t.properties; r < i.length; r += 1) {
1705
- var a = i[r];
1706
- this.checkPatternExport(e, a);
1707
- }
1708
- else if (n === "ArrayPattern") for (var o = 0, s = t.elements; o < s.length; o += 1) {
1709
- var c = s[o];
1710
- c && this.checkPatternExport(e, c);
1711
- }
1712
- else n === "Property" ? this.checkPatternExport(e, t.value) : n === "AssignmentPattern" ? this.checkPatternExport(e, t.left) : n === "RestElement" && this.checkPatternExport(e, t.argument);
1713
- }, z.checkVariableExport = function(e, t) {
1714
- if (e) for (var n = 0, r = t; n < r.length; n += 1) {
1715
- var i = r[n];
1716
- this.checkPatternExport(e, i.id);
1717
- }
1718
- }, z.shouldParseExportStatement = function() {
1719
- return this.type.keyword === "var" || this.type.keyword === "const" || this.type.keyword === "class" || this.type.keyword === "function" || this.isLet() || this.isAsyncFunction();
1720
- }, z.parseExportSpecifier = function(e) {
1721
- var t = this.startNode();
1722
- return t.local = this.parseModuleExportName(), t.exported = this.eatContextual("as") ? this.parseModuleExportName() : t.local, this.checkExport(e, t.exported, t.exported.start), this.finishNode(t, "ExportSpecifier");
1723
- }, z.parseExportSpecifiers = function(e) {
1724
- var t = [], n = !0;
1725
- for (this.expect(C.braceL); !this.eat(C.braceR);) {
1726
- if (n) n = !1;
1727
- else if (this.expect(C.comma), this.afterTrailingComma(C.braceR)) break;
1728
- t.push(this.parseExportSpecifier(e));
1729
- }
1730
- return t;
1731
- }, z.parseImport = function(e) {
1732
- return this.next(), this.type === C.string ? (e.specifiers = Pe, e.source = this.parseExprAtom()) : (e.specifiers = this.parseImportSpecifiers(), this.expectContextual("from"), e.source = this.type === C.string ? this.parseExprAtom() : this.unexpected()), this.options.ecmaVersion >= 16 && (e.attributes = this.parseWithClause()), this.semicolon(), this.finishNode(e, "ImportDeclaration");
1733
- }, z.parseImportSpecifier = function() {
1734
- var e = this.startNode();
1735
- return e.imported = this.parseModuleExportName(), this.eatContextual("as") ? e.local = this.parseIdent() : (this.checkUnreserved(e.imported), e.local = e.imported), this.checkLValSimple(e.local, F), this.finishNode(e, "ImportSpecifier");
1736
- }, z.parseImportDefaultSpecifier = function() {
1737
- var e = this.startNode();
1738
- return e.local = this.parseIdent(), this.checkLValSimple(e.local, F), this.finishNode(e, "ImportDefaultSpecifier");
1739
- }, z.parseImportNamespaceSpecifier = function() {
1740
- var e = this.startNode();
1741
- return this.next(), this.expectContextual("as"), e.local = this.parseIdent(), this.checkLValSimple(e.local, F), this.finishNode(e, "ImportNamespaceSpecifier");
1742
- }, z.parseImportSpecifiers = function() {
1743
- var e = [], t = !0;
1744
- if (this.type === C.name && (e.push(this.parseImportDefaultSpecifier()), !this.eat(C.comma))) return e;
1745
- if (this.type === C.star) return e.push(this.parseImportNamespaceSpecifier()), e;
1746
- for (this.expect(C.braceL); !this.eat(C.braceR);) {
1747
- if (t) t = !1;
1748
- else if (this.expect(C.comma), this.afterTrailingComma(C.braceR)) break;
1749
- e.push(this.parseImportSpecifier());
1750
- }
1751
- return e;
1752
- }, z.parseWithClause = function() {
1753
- var e = [];
1754
- if (!this.eat(C._with)) return e;
1755
- this.expect(C.braceL);
1756
- for (var t = {}, n = !0; !this.eat(C.braceR);) {
1757
- if (n) n = !1;
1758
- else if (this.expect(C.comma), this.afterTrailingComma(C.braceR)) break;
1759
- var r = this.parseImportAttribute(), i = r.key.type === "Identifier" ? r.key.name : r.key.value;
1760
- D(t, i) && this.raiseRecoverable(r.key.start, "Duplicate attribute key '" + i + "'"), t[i] = !0, e.push(r);
1761
- }
1762
- return e;
1763
- }, z.parseImportAttribute = function() {
1764
- var e = this.startNode();
1765
- return e.key = this.type === C.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never"), this.expect(C.colon), this.type !== C.string && this.unexpected(), e.value = this.parseExprAtom(), this.finishNode(e, "ImportAttribute");
1766
- }, z.parseModuleExportName = function() {
1767
- if (this.options.ecmaVersion >= 13 && this.type === C.string) {
1768
- var e = this.parseLiteral(this.value);
1769
- return le.test(e.value) && this.raise(e.start, "An export name cannot include a lone surrogate."), e;
1770
- }
1771
- return this.parseIdent(!0);
1772
- }, z.adaptDirectivePrologue = function(e) {
1773
- for (var t = 0; t < e.length && this.isDirectiveCandidate(e[t]); ++t) e[t].directive = e[t].expression.raw.slice(1, -1);
1774
- }, z.isDirectiveCandidate = function(e) {
1775
- return this.options.ecmaVersion >= 5 && e.type === "ExpressionStatement" && e.expression.type === "Literal" && typeof e.expression.value == "string" && (this.input[e.start] === "\"" || this.input[e.start] === "'");
1776
- };
1777
- var V = I.prototype;
1778
- V.toAssignable = function(e, t, n) {
1779
- if (this.options.ecmaVersion >= 6 && e) switch (e.type) {
1780
- case "Identifier":
1781
- this.inAsync && e.name === "await" && this.raise(e.start, "Cannot use 'await' as identifier inside an async function");
1782
- break;
1783
- case "ObjectPattern":
1784
- case "ArrayPattern":
1785
- case "AssignmentPattern":
1786
- case "RestElement": break;
1787
- case "ObjectExpression":
1788
- e.type = "ObjectPattern", n && this.checkPatternErrors(n, !0);
1789
- for (var r = 0, i = e.properties; r < i.length; r += 1) {
1790
- var a = i[r];
1791
- this.toAssignable(a, t), a.type === "RestElement" && (a.argument.type === "ArrayPattern" || a.argument.type === "ObjectPattern") && this.raise(a.argument.start, "Unexpected token");
1792
- }
1793
- break;
1794
- case "Property":
1795
- e.kind !== "init" && this.raise(e.key.start, "Object pattern can't contain getter or setter"), this.toAssignable(e.value, t);
1796
- break;
1797
- case "ArrayExpression":
1798
- e.type = "ArrayPattern", n && this.checkPatternErrors(n, !0), this.toAssignableList(e.elements, t);
1799
- break;
1800
- case "SpreadElement":
1801
- e.type = "RestElement", this.toAssignable(e.argument, t), e.argument.type === "AssignmentPattern" && this.raise(e.argument.start, "Rest elements cannot have a default value");
1802
- break;
1803
- case "AssignmentExpression":
1804
- e.operator !== "=" && this.raise(e.left.end, "Only '=' operator can be used for specifying default value."), e.type = "AssignmentPattern", delete e.operator, this.toAssignable(e.left, t);
1805
- break;
1806
- case "ParenthesizedExpression":
1807
- this.toAssignable(e.expression, t, n);
1808
- break;
1809
- case "ChainExpression":
1810
- this.raiseRecoverable(e.start, "Optional chaining cannot appear in left-hand side");
1811
- break;
1812
- case "MemberExpression": if (!t) break;
1813
- default: this.raise(e.start, "Assigning to rvalue");
1814
- }
1815
- else n && this.checkPatternErrors(n, !0);
1816
- return e;
1817
- }, V.toAssignableList = function(e, t) {
1818
- for (var n = e.length, r = 0; r < n; r++) {
1819
- var i = e[r];
1820
- i && this.toAssignable(i, t);
1821
- }
1822
- if (n) {
1823
- var a = e[n - 1];
1824
- this.options.ecmaVersion === 6 && t && a && a.type === "RestElement" && a.argument.type !== "Identifier" && this.unexpected(a.argument.start);
1825
- }
1826
- return e;
1827
- }, V.parseSpread = function(e) {
1828
- var t = this.startNode();
1829
- return this.next(), t.argument = this.parseMaybeAssign(!1, e), this.finishNode(t, "SpreadElement");
1830
- }, V.parseRestBinding = function() {
1831
- var e = this.startNode();
1832
- return this.next(), this.options.ecmaVersion === 6 && this.type !== C.name && this.unexpected(), e.argument = this.parseBindingAtom(), this.finishNode(e, "RestElement");
1833
- }, V.parseBindingAtom = function() {
1834
- if (this.options.ecmaVersion >= 6) switch (this.type) {
1835
- case C.bracketL:
1836
- var e = this.startNode();
1837
- return this.next(), e.elements = this.parseBindingList(C.bracketR, !0, !0), this.finishNode(e, "ArrayPattern");
1838
- case C.braceL: return this.parseObj(!0);
1839
- }
1840
- return this.parseIdent();
1841
- }, V.parseBindingList = function(e, t, n, r) {
1842
- for (var i = [], a = !0; !this.eat(e);) if (a ? a = !1 : this.expect(C.comma), t && this.type === C.comma) i.push(null);
1843
- else if (n && this.afterTrailingComma(e)) break;
1844
- else if (this.type === C.ellipsis) {
1845
- var o = this.parseRestBinding();
1846
- this.parseBindingListItem(o), i.push(o), this.type === C.comma && this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"), this.expect(e);
1847
- break;
1848
- } else i.push(this.parseAssignableListItem(r));
1849
- return i;
1850
- }, V.parseAssignableListItem = function(e) {
1851
- var t = this.parseMaybeDefault(this.start, this.startLoc);
1852
- return this.parseBindingListItem(t), t;
1853
- }, V.parseBindingListItem = function(e) {
1854
- return e;
1855
- }, V.parseMaybeDefault = function(e, t, n) {
1856
- if (n ||= this.parseBindingAtom(), this.options.ecmaVersion < 6 || !this.eat(C.eq)) return n;
1857
- var r = this.startNodeAt(e, t);
1858
- return r.left = n, r.right = this.parseMaybeAssign(), this.finishNode(r, "AssignmentPattern");
1859
- }, V.checkLValSimple = function(e, t, n) {
1860
- t === void 0 && (t = Te);
1861
- var r = t !== Te;
1862
- switch (e.type) {
1863
- case "Identifier":
1864
- this.strict && this.reservedWordsStrictBind.test(e.name) && this.raiseRecoverable(e.start, (r ? "Binding " : "Assigning to ") + e.name + " in strict mode"), r && (t === F && e.name === "let" && this.raiseRecoverable(e.start, "let is disallowed as a lexically bound name"), n && (D(n, e.name) && this.raiseRecoverable(e.start, "Argument name clash"), n[e.name] = !0), t !== ke && this.declareName(e.name, t, e.start));
1865
- break;
1866
- case "ChainExpression":
1867
- this.raiseRecoverable(e.start, "Optional chaining cannot appear in left-hand side");
1868
- break;
1869
- case "MemberExpression":
1870
- r && this.raiseRecoverable(e.start, "Binding member expression");
1871
- break;
1872
- case "ParenthesizedExpression": return r && this.raiseRecoverable(e.start, "Binding parenthesized expression"), this.checkLValSimple(e.expression, t, n);
1873
- default: this.raise(e.start, (r ? "Binding" : "Assigning to") + " rvalue");
1874
- }
1875
- }, V.checkLValPattern = function(e, t, n) {
1876
- switch (t === void 0 && (t = Te), e.type) {
1877
- case "ObjectPattern":
1878
- for (var r = 0, i = e.properties; r < i.length; r += 1) {
1879
- var a = i[r];
1880
- this.checkLValInnerPattern(a, t, n);
1881
- }
1882
- break;
1883
- case "ArrayPattern":
1884
- for (var o = 0, s = e.elements; o < s.length; o += 1) {
1885
- var c = s[o];
1886
- c && this.checkLValInnerPattern(c, t, n);
1887
- }
1888
- break;
1889
- default: this.checkLValSimple(e, t, n);
1890
- }
1891
- }, V.checkLValInnerPattern = function(e, t, n) {
1892
- switch (t === void 0 && (t = Te), e.type) {
1893
- case "Property":
1894
- this.checkLValInnerPattern(e.value, t, n);
1895
- break;
1896
- case "AssignmentPattern":
1897
- this.checkLValPattern(e.left, t, n);
1898
- break;
1899
- case "RestElement":
1900
- this.checkLValPattern(e.argument, t, n);
1901
- break;
1902
- default: this.checkLValPattern(e, t, n);
1903
- }
1904
- };
1905
- var H = function(e, t, n, r, i) {
1906
- this.token = e, this.isExpr = !!t, this.preserveSpace = !!n, this.override = r, this.generator = !!i;
1907
- }, U = {
1908
- b_stat: new H("{", !1),
1909
- b_expr: new H("{", !0),
1910
- b_tmpl: new H("${", !1),
1911
- p_stat: new H("(", !1),
1912
- p_expr: new H("(", !0),
1913
- q_tmpl: new H("`", !0, !0, function(e) {
1914
- return e.tryReadTemplateToken();
1915
- }),
1916
- f_stat: new H("function", !1),
1917
- f_expr: new H("function", !0),
1918
- f_expr_gen: new H("function", !0, !1, null, !0),
1919
- f_gen: new H("function", !1, !1, null, !0)
1920
- }, W = I.prototype;
1921
- W.initialContext = function() {
1922
- return [U.b_stat];
1923
- }, W.curContext = function() {
1924
- return this.context[this.context.length - 1];
1925
- }, W.braceIsBlock = function(e) {
1926
- var t = this.curContext();
1927
- return t === U.f_expr || t === U.f_stat ? !0 : e === C.colon && (t === U.b_stat || t === U.b_expr) ? !t.isExpr : e === C._return || e === C.name && this.exprAllowed ? w.test(this.input.slice(this.lastTokEnd, this.start)) : e === C._else || e === C.semi || e === C.eof || e === C.parenR || e === C.arrow ? !0 : e === C.braceL ? t === U.b_stat : e === C._var || e === C._const || e === C.name ? !1 : !this.exprAllowed;
1928
- }, W.inGeneratorContext = function() {
1929
- for (var e = this.context.length - 1; e >= 1; e--) {
1930
- var t = this.context[e];
1931
- if (t.token === "function") return t.generator;
1932
- }
1933
- return !1;
1934
- }, W.updateContext = function(e) {
1935
- var t, n = this.type;
1936
- n.keyword && e === C.dot ? this.exprAllowed = !1 : (t = n.updateContext) ? t.call(this, e) : this.exprAllowed = n.beforeExpr;
1937
- }, W.overrideContext = function(e) {
1938
- this.curContext() !== e && (this.context[this.context.length - 1] = e);
1939
- }, C.parenR.updateContext = C.braceR.updateContext = function() {
1940
- if (this.context.length === 1) {
1941
- this.exprAllowed = !0;
1942
- return;
1943
- }
1944
- var e = this.context.pop();
1945
- e === U.b_stat && this.curContext().token === "function" && (e = this.context.pop()), this.exprAllowed = !e.isExpr;
1946
- }, C.braceL.updateContext = function(e) {
1947
- this.context.push(this.braceIsBlock(e) ? U.b_stat : U.b_expr), this.exprAllowed = !0;
1948
- }, C.dollarBraceL.updateContext = function() {
1949
- this.context.push(U.b_tmpl), this.exprAllowed = !0;
1950
- }, C.parenL.updateContext = function(e) {
1951
- var t = e === C._if || e === C._for || e === C._with || e === C._while;
1952
- this.context.push(t ? U.p_stat : U.p_expr), this.exprAllowed = !0;
1953
- }, C.incDec.updateContext = function() {}, C._function.updateContext = C._class.updateContext = function(e) {
1954
- e.beforeExpr && e !== C._else && !(e === C.semi && this.curContext() !== U.p_stat) && !(e === C._return && w.test(this.input.slice(this.lastTokEnd, this.start))) && !((e === C.colon || e === C.braceL) && this.curContext() === U.b_stat) ? this.context.push(U.f_expr) : this.context.push(U.f_stat), this.exprAllowed = !1;
1955
- }, C.colon.updateContext = function() {
1956
- this.curContext().token === "function" && this.context.pop(), this.exprAllowed = !0;
1957
- }, C.backQuote.updateContext = function() {
1958
- this.curContext() === U.q_tmpl ? this.context.pop() : this.context.push(U.q_tmpl), this.exprAllowed = !1;
1959
- }, C.star.updateContext = function(e) {
1960
- if (e === C._function) {
1961
- var t = this.context.length - 1;
1962
- this.context[t] === U.f_expr ? this.context[t] = U.f_expr_gen : this.context[t] = U.f_gen;
1963
- }
1964
- this.exprAllowed = !0;
1965
- }, C.name.updateContext = function(e) {
1966
- var t = !1;
1967
- this.options.ecmaVersion >= 6 && e !== C.dot && (this.value === "of" && !this.exprAllowed || this.value === "yield" && this.inGeneratorContext()) && (t = !0), this.exprAllowed = t;
1968
- };
1969
- var G = I.prototype;
1970
- G.checkPropClash = function(e, t, n) {
1971
- if (!(this.options.ecmaVersion >= 9 && e.type === "SpreadElement") && !(this.options.ecmaVersion >= 6 && (e.computed || e.method || e.shorthand))) {
1972
- var r = e.key, i;
1973
- switch (r.type) {
1974
- case "Identifier":
1975
- i = r.name;
1976
- break;
1977
- case "Literal":
1978
- i = String(r.value);
1979
- break;
1980
- default: return;
1981
- }
1982
- var a = e.kind;
1983
- if (this.options.ecmaVersion >= 6) {
1984
- i === "__proto__" && a === "init" && (t.proto && (n ? n.doubleProto < 0 && (n.doubleProto = r.start) : this.raiseRecoverable(r.start, "Redefinition of __proto__ property")), t.proto = !0);
1985
- return;
1986
- }
1987
- i = "$" + i;
1988
- var o = t[i];
1989
- o ? (a === "init" ? this.strict && o.init || o.get || o.set : o.init || o[a]) && this.raiseRecoverable(r.start, "Redefinition of property") : o = t[i] = {
1990
- init: !1,
1991
- get: !1,
1992
- set: !1
1993
- }, o[a] = !0;
1994
- }
1995
- }, G.parseExpression = function(e, t) {
1996
- var n = this;
1997
- return this.catchStackOverflow(function() {
1998
- var r = n.start, i = n.startLoc, a = n.parseMaybeAssign(e, t);
1999
- if (n.type === C.comma) {
2000
- var o = n.startNodeAt(r, i);
2001
- for (o.expressions = [a]; n.eat(C.comma);) o.expressions.push(n.parseMaybeAssign(e, t));
2002
- return n.finishNode(o, "SequenceExpression");
2003
- }
2004
- return a;
2005
- });
2006
- }, G.parseMaybeAssign = function(e, t, n) {
2007
- if (this.isContextual("yield")) {
2008
- if (this.inGenerator) return this.parseYield(e);
2009
- this.exprAllowed = !1;
2010
- }
2011
- var r = !1, i = -1, a = -1, o = -1;
2012
- t ? (i = t.parenthesizedAssign, a = t.trailingComma, o = t.doubleProto, t.parenthesizedAssign = t.trailingComma = -1) : (t = new je(), r = !0);
2013
- var s = this.start, c = this.startLoc;
2014
- (this.type === C.parenL || this.type === C.name) && (this.potentialArrowAt = this.start, this.potentialArrowInForAwait = e === "await");
2015
- var l = this.parseMaybeConditional(e, t);
2016
- if (n && (l = n.call(this, l, s, c)), this.type.isAssign) {
2017
- var u = this.startNodeAt(s, c);
2018
- return u.operator = this.value, this.type === C.eq && (l = this.toAssignable(l, !1, t)), r || (t.parenthesizedAssign = t.trailingComma = t.doubleProto = -1), t.shorthandAssign >= l.start && (t.shorthandAssign = -1), this.type === C.eq ? this.checkLValPattern(l) : this.checkLValSimple(l), u.left = l, this.next(), u.right = this.parseMaybeAssign(e), o > -1 && (t.doubleProto = o), this.finishNode(u, "AssignmentExpression");
2019
- } else r && this.checkExpressionErrors(t, !0);
2020
- return i > -1 && (t.parenthesizedAssign = i), a > -1 && (t.trailingComma = a), l;
2021
- }, G.parseMaybeConditional = function(e, t) {
2022
- var n = this.start, r = this.startLoc, i = this.parseExprOps(e, t);
2023
- if (this.checkExpressionErrors(t)) return i;
2024
- if (!(i.type === "ArrowFunctionExpression" && i.start === n) && this.eat(C.question)) {
2025
- var a = this.startNodeAt(n, r);
2026
- return a.test = i, a.consequent = this.parseMaybeAssign(), this.expect(C.colon), a.alternate = this.parseMaybeAssign(e), this.finishNode(a, "ConditionalExpression");
2027
- }
2028
- return i;
2029
- }, G.parseExprOps = function(e, t) {
2030
- var n = this.start, r = this.startLoc, i = this.parseMaybeUnary(t, !1, !1, e);
2031
- return this.checkExpressionErrors(t) || i.start === n && i.type === "ArrowFunctionExpression" ? i : this.parseExprOp(i, n, r, -1, e);
2032
- }, G.parseExprOp = function(e, t, n, r, i) {
2033
- var a = this.type.binop;
2034
- if (a != null && (!i || this.type !== C._in) && a > r) {
2035
- var o = this.type === C.logicalOR || this.type === C.logicalAND, s = this.type === C.coalesce;
2036
- s && (a = C.logicalAND.binop);
2037
- var c = this.value;
2038
- this.next();
2039
- var l = this.start, u = this.startLoc, d = this.parseExprOp(this.parseMaybeUnary(null, !1, !1, i), l, u, a, i), f = this.buildBinary(t, n, e, d, c, o || s);
2040
- return (o && this.type === C.coalesce || s && (this.type === C.logicalOR || this.type === C.logicalAND)) && this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"), this.parseExprOp(f, t, n, r, i);
2041
- }
2042
- return e;
2043
- }, G.buildBinary = function(e, t, n, r, i, a) {
2044
- r.type === "PrivateIdentifier" && this.raise(r.start, "Private identifier can only be left side of binary expression");
2045
- var o = this.startNodeAt(e, t);
2046
- return o.left = n, o.operator = i, o.right = r, this.finishNode(o, a ? "LogicalExpression" : "BinaryExpression");
2047
- }, G.parseMaybeUnary = function(e, t, n, r) {
2048
- var i = this.start, a = this.startLoc, o;
2049
- if (this.isContextual("await") && this.canAwait) o = this.parseAwait(r), t = !0;
2050
- else if (this.type.prefix) {
2051
- var s = this.startNode(), c = this.type === C.incDec;
2052
- s.operator = this.value, s.prefix = !0, this.next(), s.argument = this.parseMaybeUnary(null, !0, c, r), this.checkExpressionErrors(e, !0), c ? this.checkLValSimple(s.argument) : this.strict && s.operator === "delete" && ze(s.argument) ? this.raiseRecoverable(s.start, "Deleting local variable in strict mode") : s.operator === "delete" && Be(s.argument) ? this.raiseRecoverable(s.start, "Private fields can not be deleted") : t = !0, o = this.finishNode(s, c ? "UpdateExpression" : "UnaryExpression");
2053
- } else if (!t && this.type === C.privateId) (r || this.privateNameStack.length === 0) && this.options.checkPrivateFields && this.unexpected(), o = this.parsePrivateIdent(), this.type !== C._in && this.unexpected();
2054
- else {
2055
- if (o = this.parseExprSubscripts(e, r), this.checkExpressionErrors(e)) return o;
2056
- for (; this.type.postfix && !this.canInsertSemicolon();) {
2057
- var l = this.startNodeAt(i, a);
2058
- l.operator = this.value, l.prefix = !1, l.argument = o, this.checkLValSimple(o), this.next(), o = this.finishNode(l, "UpdateExpression");
2059
- }
2060
- }
2061
- if (!n && this.eat(C.starstar)) if (t) this.unexpected(this.lastTokStart);
2062
- else return this.buildBinary(i, a, o, this.parseMaybeUnary(null, !1, !1, r), "**", !1);
2063
- else return o;
2064
- };
2065
- function ze(e) {
2066
- return e.type === "Identifier" || e.type === "ParenthesizedExpression" && ze(e.expression);
32
+ //#region src/evaluator.ts
33
+ function r(e) {
34
+ return Array.isArray(e) ? e : e && typeof e[Symbol.iterator] == "function" ? Array.from(e) : [];
2067
35
  }
2068
- function Be(e) {
2069
- return e.type === "MemberExpression" && e.property.type === "PrivateIdentifier" || e.type === "ChainExpression" && Be(e.expression) || e.type === "ParenthesizedExpression" && Be(e.expression);
36
+ function i(e, i, a) {
37
+ return typeof e == "function" ? e(i, a, t, n, r) : typeof e.__drift_fn__ == "function" ? e.__drift_fn__(i, a, t, n, r) : (e._executableFn ||= typeof e.__drift_fn__ == "string" ? Function("return (" + e.__drift_fn__ + ")")() : e.__drift_fn__, e._executableFn(i, a, t, n, r));
2070
38
  }
2071
- G.parseExprSubscripts = function(e, t) {
2072
- var n = this.start, r = this.startLoc, i = this.parseExprAtom(e, t);
2073
- if (i.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")") return i;
2074
- var a = this.parseSubscripts(i, n, r, !1, t);
2075
- return e && a.type === "MemberExpression" && (e.parenthesizedAssign >= a.start && (e.parenthesizedAssign = -1), e.parenthesizedBind >= a.start && (e.parenthesizedBind = -1), e.trailingComma >= a.start && (e.trailingComma = -1)), a;
2076
- }, G.parseSubscripts = function(e, t, n, r, i) {
2077
- for (var a = this.options.ecmaVersion >= 8 && e.type === "Identifier" && e.name === "async" && this.lastTokEnd === e.end && !this.canInsertSemicolon() && e.end - e.start === 5 && this.potentialArrowAt === e.start, o = !1;;) {
2078
- var s = this.parseSubscript(e, t, n, r, a, o, i);
2079
- if (s.optional && (o = !0), s === e || s.type === "ArrowFunctionExpression") {
2080
- if (o) {
2081
- var c = this.startNodeAt(t, n);
2082
- c.expression = s, s = this.finishNode(c, "ChainExpression");
2083
- }
2084
- return s;
39
+ function a(e, o, s) {
40
+ if (e == null) return e;
41
+ if (typeof e == "function") return e(o, s, t, n, r);
42
+ if (typeof e == "object" && e) {
43
+ if ("__drift_fn__" in e || typeof e._executableFn == "function") return i(e, o, s);
44
+ if (Array.isArray(e)) {
45
+ let t;
46
+ for (let n of e) t = a(n, o, s);
47
+ return t;
2085
48
  }
2086
- e = s;
2087
- }
2088
- }, G.shouldParseAsyncArrow = function() {
2089
- return !this.canInsertSemicolon() && this.eat(C.arrow);
2090
- }, G.parseSubscriptAsyncArrow = function(e, t, n, r) {
2091
- return this.parseArrowExpression(this.startNodeAt(e, t), n, !0, r);
2092
- }, G.parseSubscript = function(e, t, n, r, i, a, o) {
2093
- var s = this.options.ecmaVersion >= 11, c = s && this.eat(C.questionDot);
2094
- r && c && this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions");
2095
- var l = this.eat(C.bracketL);
2096
- if (l || c && this.type !== C.parenL && this.type !== C.backQuote || this.eat(C.dot)) {
2097
- var u = this.startNodeAt(t, n);
2098
- u.object = e, l ? (u.property = this.parseExpression(), this.expect(C.bracketR)) : this.type === C.privateId && e.type !== "Super" ? u.property = this.parsePrivateIdent() : u.property = this.parseIdent(this.options.allowReserved !== "never"), u.computed = !!l, s && (u.optional = c), e = this.finishNode(u, "MemberExpression");
2099
- } else if (!r && this.eat(C.parenL)) {
2100
- var d = new je(), f = this.yieldPos, p = this.awaitPos, m = this.awaitIdentPos;
2101
- this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0;
2102
- var h = this.parseExprList(C.parenR, this.options.ecmaVersion >= 8, !1, d);
2103
- if (i && !c && this.shouldParseAsyncArrow()) return this.checkPatternErrors(d, !1), this.checkYieldAwaitInDefaultParams(), this.awaitIdentPos > 0 && this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"), this.yieldPos = f, this.awaitPos = p, this.awaitIdentPos = m, this.parseSubscriptAsyncArrow(t, n, h, o);
2104
- this.checkExpressionErrors(d, !0), this.yieldPos = f || this.yieldPos, this.awaitPos = p || this.awaitPos, this.awaitIdentPos = m || this.awaitIdentPos;
2105
- var g = this.startNodeAt(t, n);
2106
- g.callee = e, g.arguments = h, s && (g.optional = c), e = this.finishNode(g, "CallExpression");
2107
- } else if (this.type === C.backQuote) {
2108
- (c || a) && this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions");
2109
- var _ = this.startNodeAt(t, n);
2110
- _.tag = e, _.quasi = this.parseTemplate({ isTagged: !0 }), e = this.finishNode(_, "TaggedTemplateExpression");
2111
49
  }
2112
50
  return e;
2113
- }, G.parseExprAtom = function(e, t, n) {
2114
- this.type === C.slash && this.readRegexp();
2115
- var r, i = this.potentialArrowAt === this.start;
2116
- switch (this.type) {
2117
- case C._super: return this.allowSuper || this.raise(this.start, "'super' keyword outside a method"), r = this.startNode(), this.next(), this.type === C.parenL && !this.allowDirectSuper && this.raise(r.start, "super() call outside constructor of a subclass"), this.type !== C.dot && this.type !== C.bracketL && this.type !== C.parenL && this.unexpected(), this.finishNode(r, "Super");
2118
- case C._this: return r = this.startNode(), this.next(), this.finishNode(r, "ThisExpression");
2119
- case C.name:
2120
- var a = this.start, o = this.startLoc, s = this.containsEsc, c = this.parseIdent(!1);
2121
- if (this.options.ecmaVersion >= 8 && !s && c.name === "async" && !this.canInsertSemicolon() && this.eat(C._function)) return this.overrideContext(U.f_expr), this.parseFunction(this.startNodeAt(a, o), 0, !1, !0, t);
2122
- if (i && !this.canInsertSemicolon()) {
2123
- if (this.eat(C.arrow)) return this.parseArrowExpression(this.startNodeAt(a, o), [c], !1, t);
2124
- if (this.options.ecmaVersion >= 8 && c.name === "async" && this.type === C.name && !s && (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) return c = this.parseIdent(!1), (this.canInsertSemicolon() || !this.eat(C.arrow)) && this.unexpected(), this.parseArrowExpression(this.startNodeAt(a, o), [c], !0, t);
2125
- }
2126
- return c;
2127
- case C.regexp:
2128
- var l = this.value;
2129
- return r = this.parseLiteral(l.value), r.regex = {
2130
- pattern: l.pattern,
2131
- flags: l.flags
2132
- }, r;
2133
- case C.num:
2134
- case C.string: return this.parseLiteral(this.value);
2135
- case C._null:
2136
- case C._true:
2137
- case C._false: return r = this.startNode(), r.value = this.type === C._null ? null : this.type === C._true, r.raw = this.type.keyword, this.next(), this.finishNode(r, "Literal");
2138
- case C.parenL:
2139
- var u = this.start, d = this.parseParenAndDistinguishExpression(i, t);
2140
- return e && (e.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(d) && (e.parenthesizedAssign = u), e.parenthesizedBind < 0 && (e.parenthesizedBind = u)), d;
2141
- case C.bracketL: return r = this.startNode(), this.next(), r.elements = this.parseExprList(C.bracketR, !0, !0, e), this.finishNode(r, "ArrayExpression");
2142
- case C.braceL: return this.overrideContext(U.b_expr), this.parseObj(!1, e);
2143
- case C._function: return r = this.startNode(), this.next(), this.parseFunction(r, 0);
2144
- case C._class: return this.parseClass(this.startNode(), !1);
2145
- case C._new: return this.parseNew();
2146
- case C.backQuote: return this.parseTemplate();
2147
- case C._import: return this.options.ecmaVersion >= 11 ? this.parseExprImport(n) : this.unexpected();
2148
- default: return this.parseExprAtomDefault();
2149
- }
2150
- }, G.parseExprAtomDefault = function() {
2151
- this.unexpected();
2152
- }, G.parseExprImport = function(e) {
2153
- var t = this.startNode();
2154
- if (this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword import"), this.next(), this.type === C.parenL && !e) return this.parseDynamicImport(t);
2155
- if (this.type === C.dot) {
2156
- var n = this.startNodeAt(t.start, t.loc && t.loc.start);
2157
- return n.name = "import", t.meta = this.finishNode(n, "Identifier"), this.parseImportMeta(t);
2158
- } else this.unexpected();
2159
- }, G.parseDynamicImport = function(e) {
2160
- if (this.next(), e.source = this.parseMaybeAssign(), this.options.ecmaVersion >= 16) this.eat(C.parenR) ? e.options = null : (this.expect(C.comma), this.afterTrailingComma(C.parenR) ? e.options = null : (e.options = this.parseMaybeAssign(), this.eat(C.parenR) || (this.expect(C.comma), this.afterTrailingComma(C.parenR) || this.unexpected())));
2161
- else if (!this.eat(C.parenR)) {
2162
- var t = this.start;
2163
- this.eat(C.comma) && this.eat(C.parenR) ? this.raiseRecoverable(t, "Trailing comma is not allowed in import()") : this.unexpected(t);
2164
- }
2165
- return this.finishNode(e, "ImportExpression");
2166
- }, G.parseImportMeta = function(e) {
2167
- this.next();
2168
- var t = this.containsEsc;
2169
- return e.property = this.parseIdent(!0), e.property.name !== "meta" && this.raiseRecoverable(e.property.start, "The only valid meta property for import is 'import.meta'"), t && this.raiseRecoverable(e.start, "'import.meta' must not contain escaped characters"), this.options.sourceType !== "module" && !this.options.allowImportExportEverywhere && this.raiseRecoverable(e.start, "Cannot use 'import.meta' outside a module"), this.finishNode(e, "MetaProperty");
2170
- }, G.parseLiteral = function(e) {
2171
- var t = this.startNode();
2172
- return t.value = e, t.raw = this.input.slice(this.start, this.end), t.raw.charCodeAt(t.raw.length - 1) === 110 && (t.bigint = t.value == null ? t.raw.slice(0, -1).replace(/_/g, "") : t.value.toString()), this.next(), this.finishNode(t, "Literal");
2173
- }, G.parseParenExpression = function() {
2174
- this.expect(C.parenL);
2175
- var e = this.parseExpression();
2176
- return this.expect(C.parenR), e;
2177
- }, G.shouldParseArrow = function(e) {
2178
- return !this.canInsertSemicolon();
2179
- }, G.parseParenAndDistinguishExpression = function(e, t) {
2180
- var n = this.start, r = this.startLoc, i, a = this.options.ecmaVersion >= 8;
2181
- if (this.options.ecmaVersion >= 6) {
2182
- this.next();
2183
- var o = this.start, s = this.startLoc, c = [], l = !0, u = !1, d = new je(), f = this.yieldPos, p = this.awaitPos, m;
2184
- for (this.yieldPos = 0, this.awaitPos = 0; this.type !== C.parenR;) if (l ? l = !1 : this.expect(C.comma), a && this.afterTrailingComma(C.parenR, !0)) {
2185
- u = !0;
2186
- break;
2187
- } else if (this.type === C.ellipsis) {
2188
- m = this.start, c.push(this.parseParenItem(this.parseRestBinding())), this.type === C.comma && this.raiseRecoverable(this.start, "Comma is not permitted after the rest element");
2189
- break;
2190
- } else c.push(this.parseMaybeAssign(!1, d, this.parseParenItem));
2191
- var h = this.lastTokEnd, g = this.lastTokEndLoc;
2192
- if (this.expect(C.parenR), e && this.shouldParseArrow(c) && this.eat(C.arrow)) return this.checkPatternErrors(d, !1), this.checkYieldAwaitInDefaultParams(), this.yieldPos = f, this.awaitPos = p, this.parseParenArrowList(n, r, c, t);
2193
- (!c.length || u) && this.unexpected(this.lastTokStart), m && this.unexpected(m), this.checkExpressionErrors(d, !0), this.yieldPos = f || this.yieldPos, this.awaitPos = p || this.awaitPos, c.length > 1 ? (i = this.startNodeAt(o, s), i.expressions = c, this.finishNodeAt(i, "SequenceExpression", h, g)) : i = c[0];
2194
- } else i = this.parseParenExpression();
2195
- if (this.options.preserveParens) {
2196
- var _ = this.startNodeAt(n, r);
2197
- return _.expression = i, this.finishNode(_, "ParenthesizedExpression");
2198
- } else return i;
2199
- }, G.parseParenItem = function(e) {
2200
- return e;
2201
- }, G.parseParenArrowList = function(e, t, n, r) {
2202
- return this.parseArrowExpression(this.startNodeAt(e, t), n, !1, r);
2203
- };
2204
- var Ve = [];
2205
- G.parseNew = function() {
2206
- this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword new");
2207
- var e = this.startNode();
2208
- if (this.next(), this.options.ecmaVersion >= 6 && this.type === C.dot) {
2209
- var t = this.startNodeAt(e.start, e.loc && e.loc.start);
2210
- t.name = "new", e.meta = this.finishNode(t, "Identifier"), this.next();
2211
- var n = this.containsEsc;
2212
- return e.property = this.parseIdent(!0), e.property.name !== "target" && this.raiseRecoverable(e.property.start, "The only valid meta property for new is 'new.target'"), n && this.raiseRecoverable(e.start, "'new.target' must not contain escaped characters"), this.allowNewDotTarget || this.raiseRecoverable(e.start, "'new.target' can only be used in functions and class static block"), this.finishNode(e, "MetaProperty");
2213
- }
2214
- var r = this.start, i = this.startLoc;
2215
- return e.callee = this.parseSubscripts(this.parseExprAtom(null, !1, !0), r, i, !0, !1), e.callee.type === "Super" && this.raiseRecoverable(r, "Invalid use of 'super'"), this.eat(C.parenL) ? e.arguments = this.parseExprList(C.parenR, this.options.ecmaVersion >= 8, !1) : e.arguments = Ve, this.finishNode(e, "NewExpression");
2216
- }, G.parseTemplateElement = function(e) {
2217
- var t = e.isTagged, n = this.startNode();
2218
- return this.type === C.invalidTemplate ? (t || this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"), n.value = {
2219
- raw: this.value.replace(/\r\n?/g, "\n"),
2220
- cooked: null
2221
- }) : n.value = {
2222
- raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, "\n"),
2223
- cooked: this.value
2224
- }, this.next(), n.tail = this.type === C.backQuote, this.finishNode(n, "TemplateElement");
2225
- }, G.parseTemplate = function(e) {
2226
- e === void 0 && (e = {});
2227
- var t = e.isTagged;
2228
- t === void 0 && (t = !1);
2229
- var n = this.startNode();
2230
- this.next(), n.expressions = [];
2231
- var r = this.parseTemplateElement({ isTagged: t });
2232
- for (n.quasis = [r]; !r.tail;) this.type === C.eof && this.raise(this.pos, "Unterminated template literal"), this.expect(C.dollarBraceL), n.expressions.push(this.parseExpression()), this.expect(C.braceR), n.quasis.push(r = this.parseTemplateElement({ isTagged: t }));
2233
- return this.next(), this.finishNode(n, "TemplateLiteral");
2234
- }, G.isAsyncProp = function(e) {
2235
- return !e.computed && e.key.type === "Identifier" && e.key.name === "async" && (this.type === C.name || this.type === C.num || this.type === C.string || this.type === C.bracketL || this.type.keyword || this.options.ecmaVersion >= 9 && this.type === C.star) && !w.test(this.input.slice(this.lastTokEnd, this.start));
2236
- }, G.parseObj = function(e, t) {
2237
- var n = this.startNode(), r = !0, i = {};
2238
- for (n.properties = [], this.next(); !this.eat(C.braceR);) {
2239
- if (r) r = !1;
2240
- else if (this.expect(C.comma), this.options.ecmaVersion >= 5 && this.afterTrailingComma(C.braceR)) break;
2241
- var a = this.parseProperty(e, t);
2242
- e || this.checkPropClash(a, i, t), n.properties.push(a);
2243
- }
2244
- return this.finishNode(n, e ? "ObjectPattern" : "ObjectExpression");
2245
- }, G.parseProperty = function(e, t) {
2246
- var n = this.startNode(), r, i, a, o;
2247
- if (this.options.ecmaVersion >= 9 && this.eat(C.ellipsis)) return e ? (n.argument = this.parseIdent(!1), this.type === C.comma && this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"), this.finishNode(n, "RestElement")) : (n.argument = this.parseMaybeAssign(!1, t), this.type === C.comma && t && t.trailingComma < 0 && (t.trailingComma = this.start), this.finishNode(n, "SpreadElement"));
2248
- this.options.ecmaVersion >= 6 && (n.method = !1, n.shorthand = !1, (e || t) && (a = this.start, o = this.startLoc), e || (r = this.eat(C.star)));
2249
- var s = this.containsEsc;
2250
- return this.parsePropertyName(n), !e && !s && this.options.ecmaVersion >= 8 && !r && this.isAsyncProp(n) ? (i = !0, r = this.options.ecmaVersion >= 9 && this.eat(C.star), this.parsePropertyName(n)) : i = !1, this.parsePropertyValue(n, e, r, i, a, o, t, s), this.finishNode(n, "Property");
2251
- }, G.parseGetterSetter = function(e) {
2252
- var t = e.key.name;
2253
- this.parsePropertyName(e), e.value = this.parseMethod(!1), e.kind = t;
2254
- var n = e.kind === "get" ? 0 : 1;
2255
- if (e.value.params.length !== n) {
2256
- var r = e.value.start;
2257
- e.kind === "get" ? this.raiseRecoverable(r, "getter should have no params") : this.raiseRecoverable(r, "setter should have exactly one param");
2258
- } else e.kind === "set" && e.value.params[0].type === "RestElement" && this.raiseRecoverable(e.value.params[0].start, "Setter cannot use rest params");
2259
- }, G.parsePropertyValue = function(e, t, n, r, i, a, o, s) {
2260
- (n || r) && this.type === C.colon && this.unexpected(), this.eat(C.colon) ? (e.value = t ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(!1, o), e.kind = "init") : this.options.ecmaVersion >= 6 && this.type === C.parenL ? (t && this.unexpected(), e.method = !0, e.value = this.parseMethod(n, r), e.kind = "init") : !t && !s && this.options.ecmaVersion >= 5 && !e.computed && e.key.type === "Identifier" && (e.key.name === "get" || e.key.name === "set") && this.type !== C.comma && this.type !== C.braceR && this.type !== C.eq ? ((n || r) && this.unexpected(), this.parseGetterSetter(e)) : this.options.ecmaVersion >= 6 && !e.computed && e.key.type === "Identifier" ? ((n || r) && this.unexpected(), this.checkUnreserved(e.key), e.key.name === "await" && !this.awaitIdentPos && (this.awaitIdentPos = i), t ? e.value = this.parseMaybeDefault(i, a, this.copyNode(e.key)) : this.type === C.eq && o ? (o.shorthandAssign < 0 && (o.shorthandAssign = this.start), e.value = this.parseMaybeDefault(i, a, this.copyNode(e.key))) : e.value = this.copyNode(e.key), e.kind = "init", e.shorthand = !0) : this.unexpected();
2261
- }, G.parsePropertyName = function(e) {
2262
- if (this.options.ecmaVersion >= 6) {
2263
- if (this.eat(C.bracketL)) return e.computed = !0, e.key = this.parseMaybeAssign(), this.expect(C.bracketR), e.key;
2264
- e.computed = !1;
2265
- }
2266
- return e.key = this.type === C.num || this.type === C.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never");
2267
- }, G.initFunction = function(e) {
2268
- e.id = null, this.options.ecmaVersion >= 6 && (e.generator = e.expression = !1), this.options.ecmaVersion >= 8 && (e.async = !1);
2269
- }, G.parseMethod = function(e, t, n) {
2270
- var r = this.startNode(), i = this.yieldPos, a = this.awaitPos, o = this.awaitIdentPos;
2271
- return this.initFunction(r), this.options.ecmaVersion >= 6 && (r.generator = e), this.options.ecmaVersion >= 8 && (r.async = !!t), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(we(t, r.generator) | be | (n ? xe : 0)), this.expect(C.parenL), r.params = this.parseBindingList(C.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams(), this.parseFunctionBody(r, !1, !0, !1), this.yieldPos = i, this.awaitPos = a, this.awaitIdentPos = o, this.finishNode(r, "FunctionExpression");
2272
- }, G.parseArrowExpression = function(e, t, n, r) {
2273
- var i = this.yieldPos, a = this.awaitPos, o = this.awaitIdentPos;
2274
- return this.enterScope(we(n, !1) | ve), this.initFunction(e), this.options.ecmaVersion >= 8 && (e.async = !!n), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, e.params = this.toAssignableList(t, !0), this.parseFunctionBody(e, !0, !1, r), this.yieldPos = i, this.awaitPos = a, this.awaitIdentPos = o, this.finishNode(e, "ArrowFunctionExpression");
2275
- }, G.parseFunctionBody = function(e, t, n, r) {
2276
- var i = t && this.type !== C.braceL, a = this.strict, o = !1;
2277
- if (i) e.body = this.parseMaybeAssign(r), e.expression = !0, this.checkParams(e, !1);
2278
- else {
2279
- var s = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(e.params);
2280
- (!a || s) && (o = this.strictDirective(this.end), o && s && this.raiseRecoverable(e.start, "Illegal 'use strict' directive in function with non-simple parameter list"));
2281
- var c = this.labels;
2282
- this.labels = [], o && (this.strict = !0), this.checkParams(e, !a && !o && !t && !n && this.isSimpleParamList(e.params)), this.strict && e.id && this.checkLValSimple(e.id, ke), e.body = this.parseBlock(!1, void 0, o && !a), e.expression = !1, this.adaptDirectivePrologue(e.body.body), this.labels = c;
2283
- }
2284
- this.exitScope();
2285
- }, G.isSimpleParamList = function(e) {
2286
- for (var t = 0, n = e; t < n.length; t += 1) if (n[t].type !== "Identifier") return !1;
2287
- return !0;
2288
- }, G.checkParams = function(e, t) {
2289
- for (var n = Object.create(null), r = 0, i = e.params; r < i.length; r += 1) {
2290
- var a = i[r];
2291
- this.checkLValInnerPattern(a, Ee, t ? null : n);
2292
- }
2293
- }, G.parseExprList = function(e, t, n, r) {
2294
- for (var i = [], a = !0; !this.eat(e);) {
2295
- if (a) a = !1;
2296
- else if (this.expect(C.comma), t && this.afterTrailingComma(e)) break;
2297
- var o = void 0;
2298
- n && this.type === C.comma ? o = null : this.type === C.ellipsis ? (o = this.parseSpread(r), r && this.type === C.comma && r.trailingComma < 0 && (r.trailingComma = this.start)) : o = this.parseMaybeAssign(!1, r), i.push(o);
2299
- }
2300
- return i;
2301
- }, G.checkUnreserved = function(e) {
2302
- var t = e.start, n = e.end, r = e.name;
2303
- this.inGenerator && r === "yield" && this.raiseRecoverable(t, "Cannot use 'yield' as identifier inside a generator"), this.inAsync && r === "await" && this.raiseRecoverable(t, "Cannot use 'await' as identifier inside an async function"), !(this.currentThisScope().flags & Ce) && r === "arguments" && this.raiseRecoverable(t, "Cannot use 'arguments' in class field initializer"), this.inClassStaticBlock && (r === "arguments" || r === "await") && this.raise(t, "Cannot use " + r + " in class static initialization block"), this.keywords.test(r) && this.raise(t, "Unexpected keyword '" + r + "'"), !(this.options.ecmaVersion < 6 && this.input.slice(t, n).indexOf("\\") !== -1) && (this.strict ? this.reservedWordsStrict : this.reservedWords).test(r) && (!this.inAsync && r === "await" && this.raiseRecoverable(t, "Cannot use keyword 'await' outside an async function"), this.raiseRecoverable(t, "The keyword '" + r + "' is reserved"));
2304
- }, G.parseIdent = function(e) {
2305
- var t = this.parseIdentNode();
2306
- return this.next(!!e), this.finishNode(t, "Identifier"), e || (this.checkUnreserved(t), t.name === "await" && !this.awaitIdentPos && (this.awaitIdentPos = t.start)), t;
2307
- }, G.parseIdentNode = function() {
2308
- var e = this.startNode();
2309
- return this.type === C.name ? e.name = this.value : this.type.keyword ? (e.name = this.type.keyword, (e.name === "class" || e.name === "function") && (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46) && this.context.pop(), this.type = C.name) : this.unexpected(), e;
2310
- }, G.parsePrivateIdent = function() {
2311
- var e = this.startNode();
2312
- return this.type === C.privateId ? e.name = this.value : this.unexpected(), this.next(), this.finishNode(e, "PrivateIdentifier"), this.options.checkPrivateFields && (this.privateNameStack.length === 0 ? this.raise(e.start, "Private field '#" + e.name + "' must be declared in an enclosing class") : this.privateNameStack[this.privateNameStack.length - 1].used.push(e)), e;
2313
- }, G.parseYield = function(e) {
2314
- this.yieldPos ||= this.start;
2315
- var t = this.startNode();
2316
- return this.next(), this.type === C.semi || this.canInsertSemicolon() || this.type !== C.star && !this.type.startsExpr ? (t.delegate = !1, t.argument = null) : (t.delegate = this.eat(C.star), t.argument = this.parseMaybeAssign(e)), this.finishNode(t, "YieldExpression");
2317
- }, G.parseAwait = function(e) {
2318
- this.awaitPos ||= this.start;
2319
- var t = this.startNode();
2320
- return this.next(), t.argument = this.parseMaybeUnary(null, !0, !1, e), this.finishNode(t, "AwaitExpression");
2321
- };
2322
- var He = I.prototype;
2323
- He.raise = function(e, t) {
2324
- var n = de(this.input, e);
2325
- t += " (" + n.line + ":" + n.column + ")", this.sourceFile && (t += " in " + this.sourceFile);
2326
- var r = SyntaxError(t);
2327
- throw r.pos = e, r.loc = n, r.raisedAt = this.pos, r;
2328
- }, He.raiseRecoverable = He.raise, He.curPosition = function() {
2329
- if (this.options.locations) return new A(this.curLine, this.pos - this.lineStart);
2330
- };
2331
- var K = I.prototype, Ue = function(e) {
2332
- this.flags = e, this.var = [], this.lexical = [], this.functions = [];
2333
- };
2334
- K.enterScope = function(e) {
2335
- this.scopeStack.push(new Ue(e));
2336
- }, K.exitScope = function() {
2337
- this.scopeStack.pop();
2338
- }, K.treatFunctionsAsVarInScope = function(e) {
2339
- return e.flags & M || !this.inModule && e.flags & j;
2340
- }, K.declareName = function(e, t, n) {
2341
- var r = !1;
2342
- if (t === F) {
2343
- var i = this.currentScope();
2344
- r = i.lexical.indexOf(e) > -1 || i.functions.indexOf(e) > -1 || i.var.indexOf(e) > -1, i.lexical.push(e), this.inModule && i.flags & j && delete this.undefinedExports[e];
2345
- } else if (t === Oe) this.currentScope().lexical.push(e);
2346
- else if (t === De) {
2347
- var a = this.currentScope();
2348
- r = this.treatFunctionsAsVar ? a.lexical.indexOf(e) > -1 : a.lexical.indexOf(e) > -1 || a.var.indexOf(e) > -1, a.functions.push(e);
2349
- } else for (var o = this.scopeStack.length - 1; o >= 0; --o) {
2350
- var s = this.scopeStack[o];
2351
- if (s.lexical.indexOf(e) > -1 && !(s.flags & ye && s.lexical[0] === e) || !this.treatFunctionsAsVarInScope(s) && s.functions.indexOf(e) > -1) {
2352
- r = !0;
2353
- break;
2354
- }
2355
- if (s.var.push(e), this.inModule && s.flags & j && delete this.undefinedExports[e], s.flags & Ce) break;
2356
- }
2357
- r && this.raiseRecoverable(n, "Identifier '" + e + "' has already been declared");
2358
- }, K.checkLocalExport = function(e) {
2359
- this.scopeStack[0].lexical.indexOf(e.name) === -1 && this.scopeStack[0].var.indexOf(e.name) === -1 && (this.undefinedExports[e.name] = e);
2360
- }, K.currentScope = function() {
2361
- return this.scopeStack[this.scopeStack.length - 1];
2362
- }, K.currentVarScope = function() {
2363
- for (var e = this.scopeStack.length - 1;; e--) {
2364
- var t = this.scopeStack[e];
2365
- if (t.flags & (Ce | P | N)) return t;
2366
- }
2367
- }, K.currentThisScope = function() {
2368
- for (var e = this.scopeStack.length - 1;; e--) {
2369
- var t = this.scopeStack[e];
2370
- if (t.flags & (Ce | P | N) && !(t.flags & ve)) return t;
2371
- }
2372
- };
2373
- var We = function(e, t, n) {
2374
- this.type = "", this.start = t, this.end = 0, e.options.locations && (this.loc = new ue(e, n)), e.options.directSourceFile && (this.sourceFile = e.options.directSourceFile), e.options.ranges && (this.range = [t, 0]);
2375
- }, q = I.prototype;
2376
- q.startNode = function() {
2377
- return new We(this, this.start, this.startLoc);
2378
- }, q.startNodeAt = function(e, t) {
2379
- return new We(this, e, t);
2380
- };
2381
- function Ge(e, t, n, r) {
2382
- return e.type = t, e.end = n, this.options.locations && (e.loc.end = r), this.options.ranges && (e.range[1] = n), e;
2383
- }
2384
- q.finishNode = function(e, t) {
2385
- return Ge.call(this, e, t, this.lastTokEnd, this.lastTokEndLoc);
2386
- }, q.finishNodeAt = function(e, t, n, r) {
2387
- return Ge.call(this, e, t, n, r);
2388
- }, q.copyNode = function(e) {
2389
- var t = new We(this, e.start, this.startLoc);
2390
- for (var n in e) t[n] = e[n];
2391
- return t;
2392
- };
2393
- var Ke = "Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz", qe = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS", Je = qe + " Extended_Pictographic", Ye = Je, Xe = Ye + " EBase EComp EMod EPres ExtPict", Ze = Xe, Qe = {
2394
- 9: qe,
2395
- 10: Je,
2396
- 11: Ye,
2397
- 12: Xe,
2398
- 13: Ze,
2399
- 14: Ze
2400
- }, $e = {
2401
- 9: "",
2402
- 10: "",
2403
- 11: "",
2404
- 12: "",
2405
- 13: "",
2406
- 14: "Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji"
2407
- }, et = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu", tt = "Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb", nt = tt + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd", rt = nt + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho", it = rt + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi", at = it + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith", ot = {
2408
- 9: tt,
2409
- 10: nt,
2410
- 11: rt,
2411
- 12: it,
2412
- 13: at,
2413
- 14: at + " " + Ke
2414
- }, st = {};
2415
- function ct(e) {
2416
- var t = st[e] = {
2417
- binary: O(Qe[e] + " " + et),
2418
- binaryOfStrings: O($e[e]),
2419
- nonBinary: {
2420
- General_Category: O(et),
2421
- Script: O(ot[e])
2422
- }
2423
- };
2424
- t.nonBinary.Script_Extensions = t.nonBinary.Script, t.nonBinary.gc = t.nonBinary.General_Category, t.nonBinary.sc = t.nonBinary.Script, t.nonBinary.scx = t.nonBinary.Script_Extensions;
2425
- }
2426
- for (var lt = 0, ut = [
2427
- 9,
2428
- 10,
2429
- 11,
2430
- 12,
2431
- 13,
2432
- 14
2433
- ]; lt < ut.length; lt += 1) {
2434
- var dt = ut[lt];
2435
- ct(dt);
2436
- }
2437
- var J = I.prototype, ft = function(e, t) {
2438
- this.parent = e, this.base = t || this;
2439
- };
2440
- ft.prototype.separatedFrom = function(e) {
2441
- for (var t = this; t; t = t.parent) for (var n = e; n; n = n.parent) if (t.base === n.base && t !== n) return !0;
2442
- return !1;
2443
- }, ft.prototype.sibling = function() {
2444
- return new ft(this.parent, this.base);
2445
- };
2446
- var Y = function(e) {
2447
- this.parser = e, this.validFlags = "gim" + (e.options.ecmaVersion >= 6 ? "uy" : "") + (e.options.ecmaVersion >= 9 ? "s" : "") + (e.options.ecmaVersion >= 13 ? "d" : "") + (e.options.ecmaVersion >= 15 ? "v" : ""), this.unicodeProperties = st[e.options.ecmaVersion >= 14 ? 14 : e.options.ecmaVersion], this.source = "", this.flags = "", this.start = 0, this.switchU = !1, this.switchV = !1, this.switchN = !1, this.pos = 0, this.lastIntValue = 0, this.lastStringValue = "", this.lastAssertionIsQuantifiable = !1, this.numCapturingParens = 0, this.maxBackReference = 0, this.groupNames = Object.create(null), this.backReferenceNames = [], this.branchID = null;
2448
- };
2449
- Y.prototype.reset = function(e, t, n) {
2450
- var r = n.indexOf("v") !== -1, i = n.indexOf("u") !== -1;
2451
- this.start = e | 0, this.source = t + "", this.flags = n, r && this.parser.options.ecmaVersion >= 15 ? (this.switchU = !0, this.switchV = !0, this.switchN = !0) : (this.switchU = i && this.parser.options.ecmaVersion >= 6, this.switchV = !1, this.switchN = i && this.parser.options.ecmaVersion >= 9);
2452
- }, Y.prototype.raise = function(e) {
2453
- this.parser.raiseRecoverable(this.start, "Invalid regular expression: /" + this.source + "/: " + e);
2454
- }, Y.prototype.at = function(e, t) {
2455
- t === void 0 && (t = !1);
2456
- var n = this.source, r = n.length;
2457
- if (e >= r) return -1;
2458
- var i = n.charCodeAt(e);
2459
- if (!(t || this.switchU) || i <= 55295 || i >= 57344 || e + 1 >= r) return i;
2460
- var a = n.charCodeAt(e + 1);
2461
- return a >= 56320 && a <= 57343 ? (i << 10) + a - 56613888 : i;
2462
- }, Y.prototype.nextIndex = function(e, t) {
2463
- t === void 0 && (t = !1);
2464
- var n = this.source, r = n.length;
2465
- if (e >= r) return r;
2466
- var i = n.charCodeAt(e), a;
2467
- return !(t || this.switchU) || i <= 55295 || i >= 57344 || e + 1 >= r || (a = n.charCodeAt(e + 1)) < 56320 || a > 57343 ? e + 1 : e + 2;
2468
- }, Y.prototype.current = function(e) {
2469
- return e === void 0 && (e = !1), this.at(this.pos, e);
2470
- }, Y.prototype.lookahead = function(e) {
2471
- return e === void 0 && (e = !1), this.at(this.nextIndex(this.pos, e), e);
2472
- }, Y.prototype.advance = function(e) {
2473
- e === void 0 && (e = !1), this.pos = this.nextIndex(this.pos, e);
2474
- }, Y.prototype.eat = function(e, t) {
2475
- return t === void 0 && (t = !1), this.current(t) === e ? (this.advance(t), !0) : !1;
2476
- }, Y.prototype.eatChars = function(e, t) {
2477
- t === void 0 && (t = !1);
2478
- for (var n = this.pos, r = 0, i = e; r < i.length; r += 1) {
2479
- var a = i[r], o = this.at(n, t);
2480
- if (o === -1 || o !== a) return !1;
2481
- n = this.nextIndex(n, t);
2482
- }
2483
- return this.pos = n, !0;
2484
- }, J.validateRegExpFlags = function(e) {
2485
- for (var t = e.validFlags, n = e.flags, r = !1, i = !1, a = 0; a < n.length; a++) {
2486
- var o = n.charAt(a);
2487
- t.indexOf(o) === -1 && this.raise(e.start, "Invalid regular expression flag"), n.indexOf(o, a + 1) > -1 && this.raise(e.start, "Duplicate regular expression flag"), o === "u" && (r = !0), o === "v" && (i = !0);
2488
- }
2489
- this.options.ecmaVersion >= 15 && r && i && this.raise(e.start, "Invalid regular expression flag");
2490
- };
2491
- function pt(e) {
2492
- for (var t in e) return !0;
2493
- return !1;
2494
- }
2495
- J.validateRegExpPattern = function(e) {
2496
- this.regexp_pattern(e), !e.switchN && this.options.ecmaVersion >= 9 && pt(e.groupNames) && (e.switchN = !0, this.regexp_pattern(e));
2497
- }, J.regexp_pattern = function(e) {
2498
- e.pos = 0, e.lastIntValue = 0, e.lastStringValue = "", e.lastAssertionIsQuantifiable = !1, e.numCapturingParens = 0, e.maxBackReference = 0, e.groupNames = Object.create(null), e.backReferenceNames.length = 0, e.branchID = null, this.regexp_disjunction(e), e.pos !== e.source.length && (e.eat(41) && e.raise("Unmatched ')'"), (e.eat(93) || e.eat(125)) && e.raise("Lone quantifier brackets")), e.maxBackReference > e.numCapturingParens && e.raise("Invalid escape");
2499
- for (var t = 0, n = e.backReferenceNames; t < n.length; t += 1) {
2500
- var r = n[t];
2501
- e.groupNames[r] || e.raise("Invalid named capture referenced");
2502
- }
2503
- }, J.regexp_disjunction = function(e) {
2504
- var t = this.options.ecmaVersion >= 16;
2505
- for (t && (e.branchID = new ft(e.branchID, null)), this.regexp_alternative(e); e.eat(124);) t && (e.branchID = e.branchID.sibling()), this.regexp_alternative(e);
2506
- t && (e.branchID = e.branchID.parent), this.regexp_eatQuantifier(e, !0) && e.raise("Nothing to repeat"), e.eat(123) && e.raise("Lone quantifier brackets");
2507
- }, J.regexp_alternative = function(e) {
2508
- for (; e.pos < e.source.length && this.regexp_eatTerm(e););
2509
- }, J.regexp_eatTerm = function(e) {
2510
- return this.regexp_eatAssertion(e) ? (e.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(e) && e.switchU && e.raise("Invalid quantifier"), !0) : (e.switchU ? this.regexp_eatAtom(e) : this.regexp_eatExtendedAtom(e)) ? (this.regexp_eatQuantifier(e), !0) : !1;
2511
- }, J.regexp_eatAssertion = function(e) {
2512
- var t = e.pos;
2513
- if (e.lastAssertionIsQuantifiable = !1, e.eat(94) || e.eat(36)) return !0;
2514
- if (e.eat(92)) {
2515
- if (e.eat(66) || e.eat(98)) return !0;
2516
- e.pos = t;
2517
- }
2518
- if (e.eat(40) && e.eat(63)) {
2519
- var n = !1;
2520
- if (this.options.ecmaVersion >= 9 && (n = e.eat(60)), e.eat(61) || e.eat(33)) return this.regexp_disjunction(e), e.eat(41) || e.raise("Unterminated group"), e.lastAssertionIsQuantifiable = !n, !0;
2521
- }
2522
- return e.pos = t, !1;
2523
- }, J.regexp_eatQuantifier = function(e, t) {
2524
- return t === void 0 && (t = !1), this.regexp_eatQuantifierPrefix(e, t) ? (e.eat(63), !0) : !1;
2525
- }, J.regexp_eatQuantifierPrefix = function(e, t) {
2526
- return e.eat(42) || e.eat(43) || e.eat(63) || this.regexp_eatBracedQuantifier(e, t);
2527
- }, J.regexp_eatBracedQuantifier = function(e, t) {
2528
- var n = e.pos;
2529
- if (e.eat(123)) {
2530
- var r = 0, i = -1;
2531
- if (this.regexp_eatDecimalDigits(e) && (r = e.lastIntValue, e.eat(44) && this.regexp_eatDecimalDigits(e) && (i = e.lastIntValue), e.eat(125))) return i !== -1 && i < r && !t && e.raise("numbers out of order in {} quantifier"), !0;
2532
- e.switchU && !t && e.raise("Incomplete quantifier"), e.pos = n;
2533
- }
2534
- return !1;
2535
- }, J.regexp_eatAtom = function(e) {
2536
- return this.regexp_eatPatternCharacters(e) || e.eat(46) || this.regexp_eatReverseSolidusAtomEscape(e) || this.regexp_eatCharacterClass(e) || this.regexp_eatUncapturingGroup(e) || this.regexp_eatCapturingGroup(e);
2537
- }, J.regexp_eatReverseSolidusAtomEscape = function(e) {
2538
- var t = e.pos;
2539
- if (e.eat(92)) {
2540
- if (this.regexp_eatAtomEscape(e)) return !0;
2541
- e.pos = t;
2542
- }
2543
- return !1;
2544
- }, J.regexp_eatUncapturingGroup = function(e) {
2545
- var t = e.pos;
2546
- if (e.eat(40)) {
2547
- if (e.eat(63)) {
2548
- if (this.options.ecmaVersion >= 16) {
2549
- var n = this.regexp_eatModifiers(e), r = e.eat(45);
2550
- if (n || r) {
2551
- for (var i = 0; i < n.length; i++) {
2552
- var a = n.charAt(i);
2553
- n.indexOf(a, i + 1) > -1 && e.raise("Duplicate regular expression modifiers");
2554
- }
2555
- if (r) {
2556
- var o = this.regexp_eatModifiers(e);
2557
- !n && !o && e.current() === 58 && e.raise("Invalid regular expression modifiers");
2558
- for (var s = 0; s < o.length; s++) {
2559
- var c = o.charAt(s);
2560
- (o.indexOf(c, s + 1) > -1 || n.indexOf(c) > -1) && e.raise("Duplicate regular expression modifiers");
2561
- }
2562
- }
2563
- }
2564
- }
2565
- if (e.eat(58)) {
2566
- if (this.regexp_disjunction(e), e.eat(41)) return !0;
2567
- e.raise("Unterminated group");
2568
- }
2569
- }
2570
- e.pos = t;
2571
- }
2572
- return !1;
2573
- }, J.regexp_eatCapturingGroup = function(e) {
2574
- if (e.eat(40)) {
2575
- if (this.options.ecmaVersion >= 9 ? this.regexp_groupSpecifier(e) : e.current() === 63 && e.raise("Invalid group"), this.regexp_disjunction(e), e.eat(41)) return e.numCapturingParens += 1, !0;
2576
- e.raise("Unterminated group");
2577
- }
2578
- return !1;
2579
- }, J.regexp_eatModifiers = function(e) {
2580
- for (var t = "", n = 0; (n = e.current()) !== -1 && mt(n);) t += k(n), e.advance();
2581
- return t;
2582
- };
2583
- function mt(e) {
2584
- return e === 105 || e === 109 || e === 115;
2585
- }
2586
- J.regexp_eatExtendedAtom = function(e) {
2587
- return e.eat(46) || this.regexp_eatReverseSolidusAtomEscape(e) || this.regexp_eatCharacterClass(e) || this.regexp_eatUncapturingGroup(e) || this.regexp_eatCapturingGroup(e) || this.regexp_eatInvalidBracedQuantifier(e) || this.regexp_eatExtendedPatternCharacter(e);
2588
- }, J.regexp_eatInvalidBracedQuantifier = function(e) {
2589
- return this.regexp_eatBracedQuantifier(e, !0) && e.raise("Nothing to repeat"), !1;
2590
- }, J.regexp_eatSyntaxCharacter = function(e) {
2591
- var t = e.current();
2592
- return ht(t) ? (e.lastIntValue = t, e.advance(), !0) : !1;
2593
- };
2594
- function ht(e) {
2595
- return e === 36 || e >= 40 && e <= 43 || e === 46 || e === 63 || e >= 91 && e <= 94 || e >= 123 && e <= 125;
2596
- }
2597
- J.regexp_eatPatternCharacters = function(e) {
2598
- for (var t = e.pos, n = 0; (n = e.current()) !== -1 && !ht(n);) e.advance();
2599
- return e.pos !== t;
2600
- }, J.regexp_eatExtendedPatternCharacter = function(e) {
2601
- var t = e.current();
2602
- return t !== -1 && t !== 36 && !(t >= 40 && t <= 43) && t !== 46 && t !== 63 && t !== 91 && t !== 94 && t !== 124 ? (e.advance(), !0) : !1;
2603
- }, J.regexp_groupSpecifier = function(e) {
2604
- if (e.eat(63)) {
2605
- this.regexp_eatGroupName(e) || e.raise("Invalid group");
2606
- var t = this.options.ecmaVersion >= 16, n = e.groupNames[e.lastStringValue];
2607
- if (n) if (t) for (var r = 0, i = n; r < i.length; r += 1) i[r].separatedFrom(e.branchID) || e.raise("Duplicate capture group name");
2608
- else e.raise("Duplicate capture group name");
2609
- t ? (n || (e.groupNames[e.lastStringValue] = [])).push(e.branchID) : e.groupNames[e.lastStringValue] = !0;
2610
- }
2611
- }, J.regexp_eatGroupName = function(e) {
2612
- if (e.lastStringValue = "", e.eat(60)) {
2613
- if (this.regexp_eatRegExpIdentifierName(e) && e.eat(62)) return !0;
2614
- e.raise("Invalid capture group name");
2615
- }
2616
- return !1;
2617
- }, J.regexp_eatRegExpIdentifierName = function(e) {
2618
- if (e.lastStringValue = "", this.regexp_eatRegExpIdentifierStart(e)) {
2619
- for (e.lastStringValue += k(e.lastIntValue); this.regexp_eatRegExpIdentifierPart(e);) e.lastStringValue += k(e.lastIntValue);
2620
- return !0;
2621
- }
2622
- return !1;
2623
- }, J.regexp_eatRegExpIdentifierStart = function(e) {
2624
- var t = e.pos, n = this.options.ecmaVersion >= 11, r = e.current(n);
2625
- return e.advance(n), r === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(e, n) && (r = e.lastIntValue), gt(r) ? (e.lastIntValue = r, !0) : (e.pos = t, !1);
2626
- };
2627
- function gt(e) {
2628
- return g(e, !0) || e === 36 || e === 95;
2629
- }
2630
- J.regexp_eatRegExpIdentifierPart = function(e) {
2631
- var t = e.pos, n = this.options.ecmaVersion >= 11, r = e.current(n);
2632
- return e.advance(n), r === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(e, n) && (r = e.lastIntValue), _t(r) ? (e.lastIntValue = r, !0) : (e.pos = t, !1);
2633
- };
2634
- function _t(e) {
2635
- return _(e, !0) || e === 36 || e === 95 || e === 8204 || e === 8205;
2636
- }
2637
- J.regexp_eatAtomEscape = function(e) {
2638
- return this.regexp_eatBackReference(e) || this.regexp_eatCharacterClassEscape(e) || this.regexp_eatCharacterEscape(e) || e.switchN && this.regexp_eatKGroupName(e) ? !0 : (e.switchU && (e.current() === 99 && e.raise("Invalid unicode escape"), e.raise("Invalid escape")), !1);
2639
- }, J.regexp_eatBackReference = function(e) {
2640
- var t = e.pos;
2641
- if (this.regexp_eatDecimalEscape(e)) {
2642
- var n = e.lastIntValue;
2643
- if (e.switchU) return n > e.maxBackReference && (e.maxBackReference = n), !0;
2644
- if (n <= e.numCapturingParens) return !0;
2645
- e.pos = t;
2646
- }
2647
- return !1;
2648
- }, J.regexp_eatKGroupName = function(e) {
2649
- if (e.eat(107)) {
2650
- if (this.regexp_eatGroupName(e)) return e.backReferenceNames.push(e.lastStringValue), !0;
2651
- e.raise("Invalid named reference");
2652
- }
2653
- return !1;
2654
- }, J.regexp_eatCharacterEscape = function(e) {
2655
- return this.regexp_eatControlEscape(e) || this.regexp_eatCControlLetter(e) || this.regexp_eatZero(e) || this.regexp_eatHexEscapeSequence(e) || this.regexp_eatRegExpUnicodeEscapeSequence(e, !1) || !e.switchU && this.regexp_eatLegacyOctalEscapeSequence(e) || this.regexp_eatIdentityEscape(e);
2656
- }, J.regexp_eatCControlLetter = function(e) {
2657
- var t = e.pos;
2658
- if (e.eat(99)) {
2659
- if (this.regexp_eatControlLetter(e)) return !0;
2660
- e.pos = t;
2661
- }
2662
- return !1;
2663
- }, J.regexp_eatZero = function(e) {
2664
- return e.current() === 48 && !Dt(e.lookahead()) ? (e.lastIntValue = 0, e.advance(), !0) : !1;
2665
- }, J.regexp_eatControlEscape = function(e) {
2666
- var t = e.current();
2667
- return t === 116 ? (e.lastIntValue = 9, e.advance(), !0) : t === 110 ? (e.lastIntValue = 10, e.advance(), !0) : t === 118 ? (e.lastIntValue = 11, e.advance(), !0) : t === 102 ? (e.lastIntValue = 12, e.advance(), !0) : t === 114 ? (e.lastIntValue = 13, e.advance(), !0) : !1;
2668
- }, J.regexp_eatControlLetter = function(e) {
2669
- var t = e.current();
2670
- return vt(t) ? (e.lastIntValue = t % 32, e.advance(), !0) : !1;
2671
- };
2672
- function vt(e) {
2673
- return e >= 65 && e <= 90 || e >= 97 && e <= 122;
2674
- }
2675
- J.regexp_eatRegExpUnicodeEscapeSequence = function(e, t) {
2676
- t === void 0 && (t = !1);
2677
- var n = e.pos, r = t || e.switchU;
2678
- if (e.eat(117)) {
2679
- if (this.regexp_eatFixedHexDigits(e, 4)) {
2680
- var i = e.lastIntValue;
2681
- if (r && i >= 55296 && i <= 56319) {
2682
- var a = e.pos;
2683
- if (e.eat(92) && e.eat(117) && this.regexp_eatFixedHexDigits(e, 4)) {
2684
- var o = e.lastIntValue;
2685
- if (o >= 56320 && o <= 57343) return e.lastIntValue = (i - 55296) * 1024 + (o - 56320) + 65536, !0;
2686
- }
2687
- e.pos = a, e.lastIntValue = i;
2688
- }
2689
- return !0;
2690
- }
2691
- if (r && e.eat(123) && this.regexp_eatHexDigits(e) && e.eat(125) && yt(e.lastIntValue)) return !0;
2692
- r && e.raise("Invalid unicode escape"), e.pos = n;
2693
- }
2694
- return !1;
2695
- };
2696
- function yt(e) {
2697
- return e >= 0 && e <= 1114111;
2698
- }
2699
- J.regexp_eatIdentityEscape = function(e) {
2700
- if (e.switchU) return this.regexp_eatSyntaxCharacter(e) ? !0 : e.eat(47) ? (e.lastIntValue = 47, !0) : !1;
2701
- var t = e.current();
2702
- return t !== 99 && (!e.switchN || t !== 107) ? (e.lastIntValue = t, e.advance(), !0) : !1;
2703
- }, J.regexp_eatDecimalEscape = function(e) {
2704
- e.lastIntValue = 0;
2705
- var t = e.current();
2706
- if (t >= 49 && t <= 57) {
2707
- do
2708
- e.lastIntValue = 10 * e.lastIntValue + (t - 48), e.advance();
2709
- while ((t = e.current()) >= 48 && t <= 57);
2710
- return !0;
2711
- }
2712
- return !1;
2713
- };
2714
- var bt = 0, X = 1, Z = 2;
2715
- J.regexp_eatCharacterClassEscape = function(e) {
2716
- var t = e.current();
2717
- if (xt(t)) return e.lastIntValue = -1, e.advance(), X;
2718
- var n = !1;
2719
- if (e.switchU && this.options.ecmaVersion >= 9 && ((n = t === 80) || t === 112)) {
2720
- e.lastIntValue = -1, e.advance();
2721
- var r;
2722
- if (e.eat(123) && (r = this.regexp_eatUnicodePropertyValueExpression(e)) && e.eat(125)) return n && r === Z && e.raise("Invalid property name"), r;
2723
- e.raise("Invalid property name");
2724
- }
2725
- return bt;
2726
- };
2727
- function xt(e) {
2728
- return e === 100 || e === 68 || e === 115 || e === 83 || e === 119 || e === 87;
2729
- }
2730
- J.regexp_eatUnicodePropertyValueExpression = function(e) {
2731
- var t = e.pos;
2732
- if (this.regexp_eatUnicodePropertyName(e) && e.eat(61)) {
2733
- var n = e.lastStringValue;
2734
- if (this.regexp_eatUnicodePropertyValue(e)) {
2735
- var r = e.lastStringValue;
2736
- return this.regexp_validateUnicodePropertyNameAndValue(e, n, r), X;
2737
- }
2738
- }
2739
- if (e.pos = t, this.regexp_eatLoneUnicodePropertyNameOrValue(e)) {
2740
- var i = e.lastStringValue;
2741
- return this.regexp_validateUnicodePropertyNameOrValue(e, i);
2742
- }
2743
- return bt;
2744
- }, J.regexp_validateUnicodePropertyNameAndValue = function(e, t, n) {
2745
- D(e.unicodeProperties.nonBinary, t) || e.raise("Invalid property name"), e.unicodeProperties.nonBinary[t].test(n) || e.raise("Invalid property value");
2746
- }, J.regexp_validateUnicodePropertyNameOrValue = function(e, t) {
2747
- if (e.unicodeProperties.binary.test(t)) return X;
2748
- if (e.switchV && e.unicodeProperties.binaryOfStrings.test(t)) return Z;
2749
- e.raise("Invalid property name");
2750
- }, J.regexp_eatUnicodePropertyName = function(e) {
2751
- var t = 0;
2752
- for (e.lastStringValue = ""; St(t = e.current());) e.lastStringValue += k(t), e.advance();
2753
- return e.lastStringValue !== "";
2754
- };
2755
- function St(e) {
2756
- return vt(e) || e === 95;
2757
51
  }
2758
- J.regexp_eatUnicodePropertyValue = function(e) {
2759
- var t = 0;
2760
- for (e.lastStringValue = ""; Ct(t = e.current());) e.lastStringValue += k(t), e.advance();
2761
- return e.lastStringValue !== "";
2762
- };
2763
- function Ct(e) {
2764
- return St(e) || Dt(e);
2765
- }
2766
- J.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
2767
- return this.regexp_eatUnicodePropertyValue(e);
2768
- }, J.regexp_eatCharacterClass = function(e) {
2769
- if (e.eat(91)) {
2770
- var t = e.eat(94), n = this.regexp_classContents(e);
2771
- return e.eat(93) || e.raise("Unterminated character class"), t && n === Z && e.raise("Negated character class may contain strings"), !0;
2772
- }
2773
- return !1;
2774
- }, J.regexp_classContents = function(e) {
2775
- return e.current() === 93 ? X : e.switchV ? this.regexp_classSetExpression(e) : (this.regexp_nonEmptyClassRanges(e), X);
2776
- }, J.regexp_nonEmptyClassRanges = function(e) {
2777
- for (; this.regexp_eatClassAtom(e);) {
2778
- var t = e.lastIntValue;
2779
- if (e.eat(45) && this.regexp_eatClassAtom(e)) {
2780
- var n = e.lastIntValue;
2781
- e.switchU && (t === -1 || n === -1) && e.raise("Invalid character class"), t !== -1 && n !== -1 && t > n && e.raise("Range out of order in character class");
2782
- }
2783
- }
2784
- }, J.regexp_eatClassAtom = function(e) {
2785
- var t = e.pos;
2786
- if (e.eat(92)) {
2787
- if (this.regexp_eatClassEscape(e)) return !0;
2788
- if (e.switchU) {
2789
- var n = e.current();
2790
- (n === 99 || At(n)) && e.raise("Invalid class escape"), e.raise("Invalid escape");
2791
- }
2792
- e.pos = t;
2793
- }
2794
- var r = e.current();
2795
- return r === 93 ? !1 : (e.lastIntValue = r, e.advance(), !0);
2796
- }, J.regexp_eatClassEscape = function(e) {
2797
- var t = e.pos;
2798
- if (e.eat(98)) return e.lastIntValue = 8, !0;
2799
- if (e.switchU && e.eat(45)) return e.lastIntValue = 45, !0;
2800
- if (!e.switchU && e.eat(99)) {
2801
- if (this.regexp_eatClassControlLetter(e)) return !0;
2802
- e.pos = t;
2803
- }
2804
- return this.regexp_eatCharacterClassEscape(e) || this.regexp_eatCharacterEscape(e);
2805
- }, J.regexp_classSetExpression = function(e) {
2806
- var t = X, n;
2807
- if (!this.regexp_eatClassSetRange(e)) if (n = this.regexp_eatClassSetOperand(e)) {
2808
- n === Z && (t = Z);
2809
- for (var r = e.pos; e.eatChars([38, 38]);) {
2810
- if (e.current() !== 38 && (n = this.regexp_eatClassSetOperand(e))) {
2811
- n !== Z && (t = X);
2812
- continue;
2813
- }
2814
- e.raise("Invalid character in character class");
2815
- }
2816
- if (r !== e.pos) return t;
2817
- for (; e.eatChars([45, 45]);) this.regexp_eatClassSetOperand(e) || e.raise("Invalid character in character class");
2818
- if (r !== e.pos) return t;
2819
- } else e.raise("Invalid character in character class");
2820
- for (;;) if (!this.regexp_eatClassSetRange(e)) {
2821
- if (n = this.regexp_eatClassSetOperand(e), !n) return t;
2822
- n === Z && (t = Z);
2823
- }
2824
- }, J.regexp_eatClassSetRange = function(e) {
2825
- var t = e.pos;
2826
- if (this.regexp_eatClassSetCharacter(e)) {
2827
- var n = e.lastIntValue;
2828
- if (e.eat(45) && this.regexp_eatClassSetCharacter(e)) {
2829
- var r = e.lastIntValue;
2830
- return n !== -1 && r !== -1 && n > r && e.raise("Range out of order in character class"), !0;
2831
- }
2832
- e.pos = t;
2833
- }
2834
- return !1;
2835
- }, J.regexp_eatClassSetOperand = function(e) {
2836
- return this.regexp_eatClassSetCharacter(e) ? X : this.regexp_eatClassStringDisjunction(e) || this.regexp_eatNestedClass(e);
2837
- }, J.regexp_eatNestedClass = function(e) {
2838
- var t = e.pos;
2839
- if (e.eat(91)) {
2840
- var n = e.eat(94), r = this.regexp_classContents(e);
2841
- if (e.eat(93)) return n && r === Z && e.raise("Negated character class may contain strings"), r;
2842
- e.pos = t;
2843
- }
2844
- if (e.eat(92)) {
2845
- var i = this.regexp_eatCharacterClassEscape(e);
2846
- if (i) return i;
2847
- e.pos = t;
2848
- }
2849
- return null;
2850
- }, J.regexp_eatClassStringDisjunction = function(e) {
2851
- var t = e.pos;
2852
- if (e.eatChars([92, 113])) {
2853
- if (e.eat(123)) {
2854
- var n = this.regexp_classStringDisjunctionContents(e);
2855
- if (e.eat(125)) return n;
2856
- } else e.raise("Invalid escape");
2857
- e.pos = t;
2858
- }
2859
- return null;
2860
- }, J.regexp_classStringDisjunctionContents = function(e) {
2861
- for (var t = this.regexp_classString(e); e.eat(124);) this.regexp_classString(e) === Z && (t = Z);
2862
- return t;
2863
- }, J.regexp_classString = function(e) {
2864
- for (var t = 0; this.regexp_eatClassSetCharacter(e);) t++;
2865
- return t === 1 ? X : Z;
2866
- }, J.regexp_eatClassSetCharacter = function(e) {
2867
- var t = e.pos;
2868
- if (e.eat(92)) return this.regexp_eatCharacterEscape(e) || this.regexp_eatClassSetReservedPunctuator(e) ? !0 : e.eat(98) ? (e.lastIntValue = 8, !0) : (e.pos = t, !1);
2869
- var n = e.current();
2870
- return n < 0 || n === e.lookahead() && wt(n) || Tt(n) ? !1 : (e.advance(), e.lastIntValue = n, !0);
2871
- };
2872
- function wt(e) {
2873
- return e === 33 || e >= 35 && e <= 38 || e >= 42 && e <= 44 || e === 46 || e >= 58 && e <= 64 || e === 94 || e === 96 || e === 126;
52
+ function o(e) {
53
+ return !e || typeof e != "object" ? null : Array.isArray(e.bytecode) || ArrayBuffer.isView(e.bytecode) ? e : e.program && (Array.isArray(e.program.bytecode) || ArrayBuffer.isView(e.program.bytecode)) ? e.program : e.default ? o(e.default) : e.compiledModule ? o(e.compiledModule) : null;
2874
54
  }
2875
- function Tt(e) {
2876
- return e === 40 || e === 41 || e === 45 || e === 47 || e >= 91 && e <= 93 || e >= 123 && e <= 125;
2877
- }
2878
- J.regexp_eatClassSetReservedPunctuator = function(e) {
2879
- var t = e.current();
2880
- return Et(t) ? (e.lastIntValue = t, e.advance(), !0) : !1;
2881
- };
2882
- function Et(e) {
2883
- return e === 33 || e === 35 || e === 37 || e === 38 || e === 44 || e === 45 || e >= 58 && e <= 62 || e === 64 || e === 96 || e === 126;
2884
- }
2885
- J.regexp_eatClassControlLetter = function(e) {
2886
- var t = e.current();
2887
- return Dt(t) || t === 95 ? (e.lastIntValue = t % 32, e.advance(), !0) : !1;
2888
- }, J.regexp_eatHexEscapeSequence = function(e) {
2889
- var t = e.pos;
2890
- if (e.eat(120)) {
2891
- if (this.regexp_eatFixedHexDigits(e, 2)) return !0;
2892
- e.switchU && e.raise("Invalid escape"), e.pos = t;
55
+ function s(e, t, n) {
56
+ if (!e || typeof e != "object") return {};
57
+ let r = {};
58
+ for (let i of Object.keys(e)) {
59
+ if (i === "__drift_props__") continue;
60
+ let o = e[i];
61
+ r[i] = a(o, t, n);
2893
62
  }
2894
- return !1;
2895
- }, J.regexp_eatDecimalDigits = function(e) {
2896
- var t = e.pos, n = 0;
2897
- for (e.lastIntValue = 0; Dt(n = e.current());) e.lastIntValue = 10 * e.lastIntValue + (n - 48), e.advance();
2898
- return e.pos !== t;
2899
- };
2900
- function Dt(e) {
2901
- return e >= 48 && e <= 57;
2902
- }
2903
- J.regexp_eatHexDigits = function(e) {
2904
- var t = e.pos, n = 0;
2905
- for (e.lastIntValue = 0; Ot(n = e.current());) e.lastIntValue = 16 * e.lastIntValue + kt(n), e.advance();
2906
- return e.pos !== t;
2907
- };
2908
- function Ot(e) {
2909
- return e >= 48 && e <= 57 || e >= 65 && e <= 70 || e >= 97 && e <= 102;
63
+ return r;
2910
64
  }
2911
- function kt(e) {
2912
- return e >= 65 && e <= 70 ? 10 + (e - 65) : e >= 97 && e <= 102 ? 10 + (e - 97) : e - 48;
65
+ //#endregion
66
+ //#region src/context.ts
67
+ var c = Symbol.for("__drift_vm_stack__");
68
+ function l() {
69
+ let e = globalThis;
70
+ return e[c] || (e[c] = []), e[c];
2913
71
  }
2914
- J.regexp_eatLegacyOctalEscapeSequence = function(e) {
2915
- if (this.regexp_eatOctalDigit(e)) {
2916
- var t = e.lastIntValue;
2917
- if (this.regexp_eatOctalDigit(e)) {
2918
- var n = e.lastIntValue;
2919
- t <= 3 && this.regexp_eatOctalDigit(e) ? e.lastIntValue = t * 64 + n * 8 + e.lastIntValue : e.lastIntValue = t * 8 + n;
2920
- } else e.lastIntValue = t;
2921
- return !0;
2922
- }
2923
- return !1;
2924
- }, J.regexp_eatOctalDigit = function(e) {
2925
- var t = e.current();
2926
- return At(t) ? (e.lastIntValue = t - 48, e.advance(), !0) : (e.lastIntValue = 0, !1);
2927
- };
2928
- function At(e) {
2929
- return e >= 48 && e <= 55;
72
+ function u(e) {
73
+ l().push(e);
2930
74
  }
2931
- J.regexp_eatFixedHexDigits = function(e, t) {
2932
- var n = e.pos;
2933
- e.lastIntValue = 0;
2934
- for (var r = 0; r < t; ++r) {
2935
- var i = e.current();
2936
- if (!Ot(i)) return e.pos = n, !1;
2937
- e.lastIntValue = 16 * e.lastIntValue + kt(i), e.advance();
2938
- }
2939
- return !0;
2940
- };
2941
- var jt = function(e) {
2942
- this.type = e.type, this.value = e.value, this.start = e.start, this.end = e.end, e.options.locations && (this.loc = new ue(e, e.startLoc, e.endLoc)), e.options.ranges && (this.range = [e.start, e.end]);
2943
- }, Q = I.prototype;
2944
- Q.next = function(e) {
2945
- !e && this.type.keyword && this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword), this.options.onToken && this.options.onToken(new jt(this)), this.lastTokEnd = this.end, this.lastTokStart = this.start, this.lastTokEndLoc = this.endLoc, this.lastTokStartLoc = this.startLoc, this.nextToken();
2946
- }, Q.getToken = function() {
2947
- return this.next(), new jt(this);
2948
- }, typeof Symbol < "u" && (Q[Symbol.iterator] = function() {
2949
- var e = this;
2950
- return { next: function() {
2951
- var t = e.getToken();
2952
- return {
2953
- done: t.type === C.eof,
2954
- value: t
2955
- };
2956
- } };
2957
- }), Q.nextToken = function() {
2958
- var e = this.curContext();
2959
- if ((!e || !e.preserveSpace) && this.skipSpace(), this.start = this.pos, this.options.locations && (this.startLoc = this.curPosition()), this.pos >= this.input.length) return this.finishToken(C.eof);
2960
- if (e.override) return e.override(this);
2961
- this.readToken(this.fullCharCodeAtPos());
2962
- }, Q.readToken = function(e) {
2963
- return g(e, this.options.ecmaVersion >= 6) || e === 92 ? this.readWord() : this.getTokenFromCode(e);
2964
- }, Q.fullCharCodeAt = function(e) {
2965
- var t = this.input.charCodeAt(e);
2966
- if (t <= 55295 || t >= 56320) return t;
2967
- var n = this.input.charCodeAt(e + 1);
2968
- return n <= 56319 || n >= 57344 ? t : (t << 10) + n - 56613888;
2969
- }, Q.fullCharCodeAtPos = function() {
2970
- return this.fullCharCodeAt(this.pos);
2971
- }, Q.skipBlockComment = function() {
2972
- var e = this.options.onComment && this.curPosition(), t = this.pos, n = this.input.indexOf("*/", this.pos += 2);
2973
- if (n === -1 && this.raise(this.pos - 2, "Unterminated comment"), this.pos = n + 2, this.options.locations) for (var r = void 0, i = t; (r = ne(this.input, i, this.pos)) > -1;) ++this.curLine, i = this.lineStart = r;
2974
- this.options.onComment && this.options.onComment(!0, this.input.slice(t + 2, n), t, this.pos, e, this.curPosition());
2975
- }, Q.skipLineComment = function(e) {
2976
- for (var t = this.pos, n = this.options.onComment && this.curPosition(), r = this.input.charCodeAt(this.pos += e); this.pos < this.input.length && !T(r);) r = this.input.charCodeAt(++this.pos);
2977
- this.options.onComment && this.options.onComment(!1, this.input.slice(t + e, this.pos), t, this.pos, n, this.curPosition());
2978
- }, Q.skipSpace = function() {
2979
- loop: for (; this.pos < this.input.length;) {
2980
- var e = this.input.charCodeAt(this.pos);
2981
- switch (e) {
2982
- case 32:
2983
- case 160:
2984
- ++this.pos;
2985
- break;
2986
- case 13: this.input.charCodeAt(this.pos + 1) === 10 && ++this.pos;
2987
- case 10:
2988
- case 8232:
2989
- case 8233:
2990
- ++this.pos, this.options.locations && (++this.curLine, this.lineStart = this.pos);
2991
- break;
2992
- case 47:
2993
- switch (this.input.charCodeAt(this.pos + 1)) {
2994
- case 42:
2995
- this.skipBlockComment();
2996
- break;
2997
- case 47:
2998
- this.skipLineComment(2);
2999
- break;
3000
- default: break loop;
3001
- }
3002
- break;
3003
- default: if (e > 8 && e < 14 || e >= 5760 && re.test(String.fromCharCode(e))) ++this.pos;
3004
- else break loop;
3005
- }
3006
- }
3007
- }, Q.finishToken = function(e, t) {
3008
- this.end = this.pos, this.options.locations && (this.endLoc = this.curPosition());
3009
- var n = this.type;
3010
- this.type = e, this.value = t, this.updateContext(n);
3011
- }, Q.readToken_dot = function() {
3012
- var e = this.input.charCodeAt(this.pos + 1);
3013
- if (e >= 48 && e <= 57) return this.readNumber(!0);
3014
- var t = this.input.charCodeAt(this.pos + 2);
3015
- return this.options.ecmaVersion >= 6 && e === 46 && t === 46 ? (this.pos += 3, this.finishToken(C.ellipsis)) : (++this.pos, this.finishToken(C.dot));
3016
- }, Q.readToken_slash = function() {
3017
- var e = this.input.charCodeAt(this.pos + 1);
3018
- return this.exprAllowed ? (++this.pos, this.readRegexp()) : e === 61 ? this.finishOp(C.assign, 2) : this.finishOp(C.slash, 1);
3019
- }, Q.readToken_mult_modulo_exp = function(e) {
3020
- var t = this.input.charCodeAt(this.pos + 1), n = 1, r = e === 42 ? C.star : C.modulo;
3021
- return this.options.ecmaVersion >= 7 && e === 42 && t === 42 && (++n, r = C.starstar, t = this.input.charCodeAt(this.pos + 2)), t === 61 ? this.finishOp(C.assign, n + 1) : this.finishOp(r, n);
3022
- }, Q.readToken_pipe_amp = function(e) {
3023
- var t = this.input.charCodeAt(this.pos + 1);
3024
- return t === e ? this.options.ecmaVersion >= 12 && this.input.charCodeAt(this.pos + 2) === 61 ? this.finishOp(C.assign, 3) : this.finishOp(e === 124 ? C.logicalOR : C.logicalAND, 2) : t === 61 ? this.finishOp(C.assign, 2) : this.finishOp(e === 124 ? C.bitwiseOR : C.bitwiseAND, 1);
3025
- }, Q.readToken_caret = function() {
3026
- return this.input.charCodeAt(this.pos + 1) === 61 ? this.finishOp(C.assign, 2) : this.finishOp(C.bitwiseXOR, 1);
3027
- }, Q.readToken_plus_min = function(e) {
3028
- var t = this.input.charCodeAt(this.pos + 1);
3029
- return t === e ? t === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && (this.lastTokEnd === 0 || w.test(this.input.slice(this.lastTokEnd, this.pos))) ? (this.skipLineComment(3), this.skipSpace(), this.nextToken()) : this.finishOp(C.incDec, 2) : t === 61 ? this.finishOp(C.assign, 2) : this.finishOp(C.plusMin, 1);
3030
- }, Q.readToken_lt_gt = function(e) {
3031
- var t = this.input.charCodeAt(this.pos + 1), n = 1;
3032
- return t === e ? (n = e === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2, this.input.charCodeAt(this.pos + n) === 61 ? this.finishOp(C.assign, n + 1) : this.finishOp(C.bitShift, n)) : t === 33 && e === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && this.input.charCodeAt(this.pos + 3) === 45 ? (this.skipLineComment(4), this.skipSpace(), this.nextToken()) : (t === 61 && (n = 2), this.finishOp(C.relational, n));
3033
- }, Q.readToken_eq_excl = function(e) {
3034
- var t = this.input.charCodeAt(this.pos + 1);
3035
- return t === 61 ? this.finishOp(C.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2) : e === 61 && t === 62 && this.options.ecmaVersion >= 6 ? (this.pos += 2, this.finishToken(C.arrow)) : this.finishOp(e === 61 ? C.eq : C.prefix, 1);
3036
- }, Q.readToken_question = function() {
3037
- var e = this.options.ecmaVersion;
3038
- if (e >= 11) {
3039
- var t = this.input.charCodeAt(this.pos + 1);
3040
- if (t === 46) {
3041
- var n = this.input.charCodeAt(this.pos + 2);
3042
- if (n < 48 || n > 57) return this.finishOp(C.questionDot, 2);
3043
- }
3044
- if (t === 63) return e >= 12 && this.input.charCodeAt(this.pos + 2) === 61 ? this.finishOp(C.assign, 3) : this.finishOp(C.coalesce, 2);
3045
- }
3046
- return this.finishOp(C.question, 1);
3047
- }, Q.readToken_numberSign = function() {
3048
- var e = this.options.ecmaVersion, t = 35;
3049
- if (e >= 13 && (++this.pos, t = this.fullCharCodeAtPos(), g(t, !0) || t === 92)) return this.finishToken(C.privateId, this.readWord1());
3050
- this.raise(this.pos, "Unexpected character '" + k(t) + "'");
3051
- }, Q.getTokenFromCode = function(e) {
3052
- switch (e) {
3053
- case 46: return this.readToken_dot();
3054
- case 40: return ++this.pos, this.finishToken(C.parenL);
3055
- case 41: return ++this.pos, this.finishToken(C.parenR);
3056
- case 59: return ++this.pos, this.finishToken(C.semi);
3057
- case 44: return ++this.pos, this.finishToken(C.comma);
3058
- case 91: return ++this.pos, this.finishToken(C.bracketL);
3059
- case 93: return ++this.pos, this.finishToken(C.bracketR);
3060
- case 123: return ++this.pos, this.finishToken(C.braceL);
3061
- case 125: return ++this.pos, this.finishToken(C.braceR);
3062
- case 58: return ++this.pos, this.finishToken(C.colon);
3063
- case 96:
3064
- if (this.options.ecmaVersion < 6) break;
3065
- return ++this.pos, this.finishToken(C.backQuote);
3066
- case 48:
3067
- var t = this.input.charCodeAt(this.pos + 1);
3068
- if (t === 120 || t === 88) return this.readRadixNumber(16);
3069
- if (this.options.ecmaVersion >= 6) {
3070
- if (t === 111 || t === 79) return this.readRadixNumber(8);
3071
- if (t === 98 || t === 66) return this.readRadixNumber(2);
3072
- }
3073
- case 49:
3074
- case 50:
3075
- case 51:
3076
- case 52:
3077
- case 53:
3078
- case 54:
3079
- case 55:
3080
- case 56:
3081
- case 57: return this.readNumber(!1);
3082
- case 34:
3083
- case 39: return this.readString(e);
3084
- case 47: return this.readToken_slash();
3085
- case 37:
3086
- case 42: return this.readToken_mult_modulo_exp(e);
3087
- case 124:
3088
- case 38: return this.readToken_pipe_amp(e);
3089
- case 94: return this.readToken_caret();
3090
- case 43:
3091
- case 45: return this.readToken_plus_min(e);
3092
- case 60:
3093
- case 62: return this.readToken_lt_gt(e);
3094
- case 61:
3095
- case 33: return this.readToken_eq_excl(e);
3096
- case 63: return this.readToken_question();
3097
- case 126: return this.finishOp(C.prefix, 1);
3098
- case 35: return this.readToken_numberSign();
3099
- }
3100
- this.raise(this.pos, "Unexpected character '" + k(e) + "'");
3101
- }, Q.finishOp = function(e, t) {
3102
- var n = this.input.slice(this.pos, this.pos + t);
3103
- return this.pos += t, this.finishToken(e, n);
3104
- }, Q.readRegexp = function() {
3105
- for (var e, t, n = this.pos;;) {
3106
- this.pos >= this.input.length && this.raise(n, "Unterminated regular expression");
3107
- var r = this.input.charAt(this.pos);
3108
- if (w.test(r) && this.raise(n, "Unterminated regular expression"), e) e = !1;
3109
- else {
3110
- if (r === "[") t = !0;
3111
- else if (r === "]" && t) t = !1;
3112
- else if (r === "/" && !t) break;
3113
- e = r === "\\";
3114
- }
3115
- ++this.pos;
3116
- }
3117
- var i = this.input.slice(n, this.pos);
3118
- ++this.pos;
3119
- var a = this.pos, o = this.readWord1();
3120
- this.containsEsc && this.unexpected(a);
3121
- var s = this.regexpState ||= new Y(this);
3122
- s.reset(n, i, o), this.validateRegExpFlags(s), this.validateRegExpPattern(s);
3123
- var c = null;
3124
- try {
3125
- c = new RegExp(i, o);
3126
- } catch {}
3127
- return this.finishToken(C.regexp, {
3128
- pattern: i,
3129
- flags: o,
3130
- value: c
3131
- });
3132
- }, Q.readInt = function(e, t, n) {
3133
- for (var r = this.options.ecmaVersion >= 12 && t === void 0, i = n && this.input.charCodeAt(this.pos) === 48, a = this.pos, o = 0, s = 0, c = 0, l = t ?? Infinity; c < l; ++c, ++this.pos) {
3134
- var u = this.input.charCodeAt(this.pos), d = void 0;
3135
- if (r && u === 95) {
3136
- i && this.raiseRecoverable(this.pos, "Numeric separator is not allowed in legacy octal numeric literals"), s === 95 && this.raiseRecoverable(this.pos, "Numeric separator must be exactly one underscore"), c === 0 && this.raiseRecoverable(this.pos, "Numeric separator is not allowed at the first of digits"), s = u;
3137
- continue;
3138
- }
3139
- if (d = u >= 97 ? u - 97 + 10 : u >= 65 ? u - 65 + 10 : u >= 48 && u <= 57 ? u - 48 : Infinity, d >= e) break;
3140
- s = u, o = o * e + d;
3141
- }
3142
- return r && s === 95 && this.raiseRecoverable(this.pos - 1, "Numeric separator is not allowed at the last of digits"), this.pos === a || t != null && this.pos - a !== t ? null : o;
3143
- };
3144
- function Mt(e, t) {
3145
- return t ? parseInt(e, 8) : parseFloat(e.replace(/_/g, ""));
75
+ function d() {
76
+ l().pop();
3146
77
  }
3147
- function Nt(e) {
3148
- return typeof BigInt == "function" ? BigInt(e.replace(/_/g, "")) : null;
78
+ function f() {
79
+ let e = l();
80
+ return e.length > 0 ? e[e.length - 1] : null;
3149
81
  }
3150
- Q.readRadixNumber = function(e) {
3151
- var t = this.pos;
3152
- this.pos += 2;
3153
- var n = this.readInt(e);
3154
- return n ?? this.raise(this.start + 2, "Expected number in radix " + e), this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110 ? (n = Nt(this.input.slice(t, this.pos)), ++this.pos) : g(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(C.num, n);
3155
- }, Q.readNumber = function(e) {
3156
- var t = this.pos;
3157
- !e && this.readInt(10, void 0, !0) === null && this.raise(t, "Invalid number");
3158
- var n = this.pos - t >= 2 && this.input.charCodeAt(t) === 48;
3159
- n && this.strict && this.raise(t, "Invalid number");
3160
- var r = this.input.charCodeAt(this.pos);
3161
- if (!n && !e && this.options.ecmaVersion >= 11 && r === 110) {
3162
- var i = Nt(this.input.slice(t, this.pos));
3163
- return ++this.pos, g(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(C.num, i);
3164
- }
3165
- n && /[89]/.test(this.input.slice(t, this.pos)) && (n = !1), r === 46 && !n && (++this.pos, this.readInt(10), r = this.input.charCodeAt(this.pos)), (r === 69 || r === 101) && !n && (r = this.input.charCodeAt(++this.pos), (r === 43 || r === 45) && ++this.pos, this.readInt(10) === null && this.raise(t, "Invalid number")), g(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number");
3166
- var a = Mt(this.input.slice(t, this.pos), n);
3167
- return this.finishToken(C.num, a);
3168
- }, Q.readCodePoint = function() {
3169
- var e = this.input.charCodeAt(this.pos), t;
3170
- if (e === 123) {
3171
- this.options.ecmaVersion < 6 && this.unexpected();
3172
- var n = ++this.pos;
3173
- t = this.readHexChar(this.input.indexOf("}", this.pos) - this.pos), ++this.pos, t > 1114111 && this.invalidStringToken(n, "Code point out of bounds");
3174
- } else t = this.readHexChar(4);
3175
- return t;
3176
- }, Q.readString = function(e) {
3177
- for (var t = "", n = ++this.pos;;) {
3178
- this.pos >= this.input.length && this.raise(this.start, "Unterminated string constant");
3179
- var r = this.input.charCodeAt(this.pos);
3180
- if (r === e) break;
3181
- r === 92 ? (t += this.input.slice(n, this.pos), t += this.readEscapedChar(!1), n = this.pos) : r === 8232 || r === 8233 ? (this.options.ecmaVersion < 10 && this.raise(this.start, "Unterminated string constant"), ++this.pos, this.options.locations && (this.curLine++, this.lineStart = this.pos)) : (T(r) && this.raise(this.start, "Unterminated string constant"), ++this.pos);
3182
- }
3183
- return t += this.input.slice(n, this.pos++), this.finishToken(C.string, t);
3184
- };
3185
- var Pt = {};
3186
- Q.tryReadTemplateToken = function() {
3187
- this.inTemplateElement = !0;
3188
- try {
3189
- this.readTmplToken();
3190
- } catch (e) {
3191
- if (e === Pt) this.readInvalidTemplateToken();
3192
- else throw e;
3193
- }
3194
- this.inTemplateElement = !1;
3195
- }, Q.invalidStringToken = function(e, t) {
3196
- if (this.inTemplateElement && this.options.ecmaVersion >= 9) throw Pt;
3197
- this.raise(e, t);
3198
- }, Q.readTmplToken = function() {
3199
- for (var e = "", t = this.pos;;) {
3200
- this.pos >= this.input.length && this.raise(this.start, "Unterminated template");
3201
- var n = this.input.charCodeAt(this.pos);
3202
- if (n === 96 || n === 36 && this.input.charCodeAt(this.pos + 1) === 123) return this.pos === this.start && (this.type === C.template || this.type === C.invalidTemplate) ? n === 36 ? (this.pos += 2, this.finishToken(C.dollarBraceL)) : (++this.pos, this.finishToken(C.backQuote)) : (e += this.input.slice(t, this.pos), this.finishToken(C.template, e));
3203
- if (n === 92) e += this.input.slice(t, this.pos), e += this.readEscapedChar(!0), t = this.pos;
3204
- else if (T(n)) {
3205
- switch (e += this.input.slice(t, this.pos), ++this.pos, n) {
3206
- case 13: this.input.charCodeAt(this.pos) === 10 && ++this.pos;
3207
- case 10:
3208
- e += "\n";
3209
- break;
3210
- default:
3211
- e += String.fromCharCode(n);
3212
- break;
3213
- }
3214
- this.options.locations && (++this.curLine, this.lineStart = this.pos), t = this.pos;
3215
- } else ++this.pos;
3216
- }
3217
- }, Q.readInvalidTemplateToken = function() {
3218
- for (; this.pos < this.input.length; this.pos++) switch (this.input[this.pos]) {
3219
- case "\\":
3220
- ++this.pos;
3221
- break;
3222
- case "$": if (this.input[this.pos + 1] !== "{") break;
3223
- case "`": return this.finishToken(C.invalidTemplate, this.input.slice(this.start, this.pos));
3224
- case "\r": this.input[this.pos + 1] === "\n" && ++this.pos;
3225
- case "\n":
3226
- case "\u2028":
3227
- case "\u2029":
3228
- ++this.curLine, this.lineStart = this.pos + 1;
3229
- break;
3230
- }
3231
- this.raise(this.start, "Unterminated template");
3232
- }, Q.readEscapedChar = function(e) {
3233
- var t = this.input.charCodeAt(++this.pos);
3234
- switch (++this.pos, t) {
3235
- case 110: return "\n";
3236
- case 114: return "\r";
3237
- case 120: return String.fromCharCode(this.readHexChar(2));
3238
- case 117: return k(this.readCodePoint());
3239
- case 116: return " ";
3240
- case 98: return "\b";
3241
- case 118: return "\v";
3242
- case 102: return "\f";
3243
- case 13: this.input.charCodeAt(this.pos) === 10 && ++this.pos;
3244
- case 10: return this.options.locations && (this.lineStart = this.pos, ++this.curLine), "";
3245
- case 56:
3246
- case 57: if (this.strict && this.invalidStringToken(this.pos - 1, "Invalid escape sequence"), e) {
3247
- var n = this.pos - 1;
3248
- this.invalidStringToken(n, "Invalid escape sequence in template string");
3249
- }
3250
- default:
3251
- if (t >= 48 && t <= 55) {
3252
- var r = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0], i = parseInt(r, 8);
3253
- return i > 255 && (r = r.slice(0, -1), i = parseInt(r, 8)), this.pos += r.length - 1, t = this.input.charCodeAt(this.pos), (r !== "0" || t === 56 || t === 57) && (this.strict || e) && this.invalidStringToken(this.pos - 1 - r.length, e ? "Octal literal in template string" : "Octal literal in strict mode"), String.fromCharCode(i);
3254
- }
3255
- return T(t) ? (this.options.locations && (this.lineStart = this.pos, ++this.curLine), "") : String.fromCharCode(t);
3256
- }
3257
- }, Q.readHexChar = function(e) {
3258
- var t = this.pos, n = this.readInt(16, e);
3259
- return n === null && this.invalidStringToken(t, "Bad character escape sequence"), n;
3260
- }, Q.readWord1 = function() {
3261
- this.containsEsc = !1;
3262
- for (var e = "", t = !0, n = this.pos, r = this.options.ecmaVersion >= 6; this.pos < this.input.length;) {
3263
- var i = this.fullCharCodeAtPos();
3264
- if (_(i, r)) this.pos += i <= 65535 ? 1 : 2;
3265
- else if (i === 92) {
3266
- this.containsEsc = !0, e += this.input.slice(n, this.pos);
3267
- var a = this.pos;
3268
- this.input.charCodeAt(++this.pos) !== 117 && this.invalidStringToken(this.pos, "Expecting Unicode escape sequence \\uXXXX"), ++this.pos;
3269
- var o = this.readCodePoint();
3270
- (t ? g : _)(o, r) || this.invalidStringToken(a, "Invalid Unicode escape"), e += k(o), n = this.pos;
3271
- } else break;
3272
- t = !1;
3273
- }
3274
- return e + this.input.slice(n, this.pos);
3275
- }, Q.readWord = function() {
3276
- var e = this.readWord1(), t = C.name;
3277
- return this.keywords.test(e) && (t = ee[e]), this.finishToken(t, e);
3278
- }, I.acorn = {
3279
- Parser: I,
3280
- version: "8.17.0",
3281
- defaultOptions: fe,
3282
- Position: A,
3283
- SourceLocation: ue,
3284
- getLineInfo: de,
3285
- Node: We,
3286
- TokenType: v,
3287
- tokTypes: C,
3288
- keywordTypes: ee,
3289
- TokContext: H,
3290
- tokContexts: U,
3291
- isIdentifierChar: _,
3292
- isIdentifierStart: g,
3293
- Token: jt,
3294
- isNewLine: T,
3295
- lineBreak: w,
3296
- lineBreakG: te,
3297
- nonASCIIwhitespace: re
3298
- };
3299
- function Ft(e) {
3300
- return !e || typeof e != "object" ? null : e.type === "Identifier" ? e.name : e.type === "MemberExpression" ? Ft(e.object) : null;
3301
- }
3302
- function $(e, t) {
3303
- if (e == null) return "undefined";
3304
- if (typeof e != "object") return typeof e == "string" ? JSON.stringify(e) : String(e);
3305
- if (Array.isArray(e)) return e.map((e) => $(e, t)).join("; ");
3306
- switch (e.type) {
3307
- case "Identifier": return t && t.has(e.name) ? e.name : `((typeof inScopeChain === 'function' ? inScopeChain(scope, ${JSON.stringify(e.name)}) : Object.prototype.hasOwnProperty.call(scope || {}, ${JSON.stringify(e.name)})) ? scope[${JSON.stringify(e.name)}] : (typeof globalThis !== 'undefined' && Object.prototype.hasOwnProperty.call(globalThis, ${JSON.stringify(e.name)}) ? globalThis[${JSON.stringify(e.name)}] : undefined))`;
3308
- case "Literal": return typeof e.raw == "string" ? e.raw : typeof e.value == "string" ? JSON.stringify(e.value) : String(e.value);
3309
- case "BinaryExpression":
3310
- case "LogicalExpression": return `(${$(e.left, t)} ${e.operator} ${$(e.right, t)})`;
3311
- case "UnaryExpression": return `(${e.operator} ${$(e.argument, t)})`;
3312
- case "ConditionalExpression": return `(${$(e.test, t)} ? ${$(e.consequent, t)} : ${$(e.alternate, t)})`;
3313
- case "MemberExpression": return e.computed ? `(${$(e.object, t)}[${$(e.property, t)}])` : `(${$(e.object, t)}.${e.property.name})`;
3314
- case "CallExpression": {
3315
- let n = `(${$(e.callee, t)}(${e.arguments ? e.arguments.map((e) => $(e, t)).join(", ") : ""}))`;
3316
- if (e.callee?.type === "MemberExpression" && e.callee.property?.type === "Identifier") {
3317
- let r = Ft(e.callee.object), i = e.callee.property.name;
3318
- if (r && [
3319
- "push",
3320
- "pop",
3321
- "shift",
3322
- "unshift",
3323
- "splice",
3324
- "sort",
3325
- "reverse"
3326
- ].includes(i) && (!t || !t.has(r))) return `(() => { const _res = ${n}; if (typeof setScopeValue === 'function' && scope) setScopeValue(scope, ${JSON.stringify(r)}, scope[${JSON.stringify(r)}]); return _res; })()`;
3327
- }
3328
- return n;
3329
- }
3330
- case "AssignmentExpression": {
3331
- let n = $(e.right, t);
3332
- if (e.left?.type === "Identifier") {
3333
- let r = e.left.name;
3334
- if (t && t.has(r)) return `(${r} ${e.operator} ${n})`;
3335
- if (e.operator === "=") return `(typeof setScopeValue === 'function' ? setScopeValue(scope, ${JSON.stringify(r)}, ${n}) : ((scope || {})[${JSON.stringify(r)}] = ${n}))`;
3336
- {
3337
- let t = e.operator.slice(0, -1);
3338
- return `(typeof setScopeValue === 'function' ? setScopeValue(scope, ${JSON.stringify(r)}, (scope[${JSON.stringify(r)}] ${t} ${n})) : ((scope || {})[${JSON.stringify(r)}] ${e.operator} ${n}))`;
3339
- }
3340
- }
3341
- if (e.left?.type === "MemberExpression") {
3342
- let r = Ft(e.left), i = `(${$(e.left, t)} ${e.operator} ${n})`;
3343
- if (r && (!t || !t.has(r))) return `(() => { const _res = ${i}; if (typeof setScopeValue === 'function' && scope) setScopeValue(scope, ${JSON.stringify(r)}, scope[${JSON.stringify(r)}]); return _res; })()`;
3344
- }
3345
- if (e.left?.type === "ArrayPattern") {
3346
- let r = [], i = e.left.elements || [];
3347
- for (let e = 0; e < i.length; e++) {
3348
- let n = i[e];
3349
- if (n?.type === "Identifier") {
3350
- let i = n.name;
3351
- (!t || !t.has(i)) && r.push(`if (typeof setScopeValue === 'function' && scope) setScopeValue(scope, ${JSON.stringify(i)}, _val[${e}]);`);
3352
- }
3353
- }
3354
- return `(() => { const _val = ${n} || []; ${r.join(" ")} return _val; })()`;
3355
- }
3356
- if (e.left?.type === "ObjectPattern") {
3357
- let r = [], i = e.left.properties || [];
3358
- for (let e of i) if (e.type === "Property" && e.value?.type === "Identifier") {
3359
- let n = e.key?.name || (typeof e.key?.value == "string" ? e.key.value : String(e.key?.value)), i = e.value.name;
3360
- (!t || !t.has(i)) && r.push(`if (typeof setScopeValue === 'function' && scope) setScopeValue(scope, ${JSON.stringify(i)}, _val[${JSON.stringify(n)}]);`);
3361
- }
3362
- return `(() => { const _val = ${n} || {}; ${r.join(" ")} return _val; })()`;
3363
- }
3364
- return `(${$(e.left, t)} ${e.operator} ${n})`;
3365
- }
3366
- case "UpdateExpression":
3367
- if (e.argument?.type === "Identifier") {
3368
- let n = e.argument.name;
3369
- if (t && t.has(n)) return e.prefix ? `(${e.operator}${n})` : `(${n}${e.operator})`;
3370
- let r = e.operator === "++" ? "+" : "-";
3371
- return e.prefix ? `(typeof setScopeValue === 'function' ? (setScopeValue(scope, ${JSON.stringify(n)}, (Number(scope[${JSON.stringify(n)}]) || 0) ${r} 1), scope[${JSON.stringify(n)}]) : ((scope || {})[${JSON.stringify(n)}] = (Number((scope || {})[${JSON.stringify(n)}]) || 0) ${r} 1))` : `(() => { const _v = Number(scope[${JSON.stringify(n)}]) || 0; if (typeof setScopeValue === 'function') setScopeValue(scope, ${JSON.stringify(n)}, _v ${r} 1); else (scope || {})[${JSON.stringify(n)}] = _v ${r} 1; return _v; })()`;
3372
- }
3373
- if (e.argument?.type === "MemberExpression") {
3374
- let n = Ft(e.argument), r = e.prefix ? `(${e.operator}${$(e.argument, t)})` : `(${$(e.argument, t)}${e.operator})`;
3375
- if (n && (!t || !t.has(n))) return `(() => { const _res = ${r}; if (typeof setScopeValue === 'function' && scope) setScopeValue(scope, ${JSON.stringify(n)}, scope[${JSON.stringify(n)}]); return _res; })()`;
3376
- }
3377
- return e.prefix ? `(${e.operator}${$(e.argument, t)})` : `(${$(e.argument, t)}${e.operator})`;
3378
- case "SequenceExpression": return `(${e.expressions ? e.expressions.map((e) => $(e, t)).join(", ") : ""})`;
3379
- case "ArrayExpression": return `[${e.elements ? e.elements.map((e) => e?.type === "SpreadElement" ? "..." + $(e.argument, t) : $(e, t)).join(", ") : ""}]`;
3380
- case "ObjectExpression": return `{${e.properties ? e.properties.map((e) => e.type === "SpreadElement" ? "..." + $(e.argument, t) : `${e.computed ? "[" + $(e.key, t) + "]" : e.key.name}: ${$(e.value, t)}`).join(", ") : ""}}`;
3381
- case "SpreadElement": return `...${$(e.argument, t)}`;
3382
- case "TemplateLiteral": return `\`${e.quasis ? e.quasis.map((n, r) => (n.value?.raw ?? "") + (e.expressions && e.expressions[r] ? "${" + $(e.expressions[r], t) + "}" : "")).join("") : ""}\``;
3383
- case "TaggedTemplateExpression": return `${$(e.tag, t)}${$(e.quasi, t)}`;
3384
- case "ThisExpression": return "scope";
3385
- case "BlockStatement": {
3386
- let n = new Set(t);
3387
- return `{ ${(e.body ? e.body.map((e) => $(e, n)).filter(Boolean) : []).join("; ")}; }`;
3388
- }
3389
- case "ExpressionStatement": return $(e.expression, t);
3390
- case "ReturnStatement": return `return ${e.argument ? $(e.argument, t) : ""}`;
3391
- case "BreakStatement": return e.label ? `break ${e.label.name}` : "break";
3392
- case "ContinueStatement": return e.label ? `continue ${e.label.name}` : "continue";
3393
- case "IfStatement": return `if (${$(e.test, t)}) ${e.consequent.type === "BlockStatement" ? $(e.consequent, t) : `{ ${$(e.consequent, t)}; }`}${e.alternate ? ` else ${e.alternate.type === "BlockStatement" || e.alternate.type === "IfStatement" ? $(e.alternate, t) : `{ ${$(e.alternate, t)}; }`}` : ""}`;
3394
- case "ForStatement": {
3395
- let n = new Set(t);
3396
- if (e.init?.type === "VariableDeclaration" && e.init.declarations) for (let t of e.init.declarations) {
3397
- let e = t.id?.name;
3398
- e && n.add(e);
3399
- }
3400
- let r = "";
3401
- e.init?.type === "VariableDeclaration" && e.init.declarations ? r = "let " + e.init.declarations.map((e) => `${e.id.name} = ${e.init ? $(e.init, n) : "undefined"}`).join(", ") : e.init && (r = $(e.init, n));
3402
- let i = e.test ? $(e.test, n) : "", a = e.update ? $(e.update, n) : "", o = e.body ? $(e.body, n) : "";
3403
- return `(() => { for (${r}; ${i}; ${a}) ${o}; })()`;
3404
- }
3405
- case "ForOfStatement": {
3406
- let n = new Set(t), r = e.left?.type === "VariableDeclaration" ? e.left.declarations[0]?.id?.name : e.left?.name;
3407
- return r && n.add(r), `(() => { const _iter = (typeof resolveIterable === 'function' ? resolveIterable(${$(e.right, t)}) : (${$(e.right, t)} || [])); for (let ${r} of _iter) { if (scope) scope[${JSON.stringify(r)}] = ${r}; ${$(e.body, n)}; } })()`;
3408
- }
3409
- case "ForInStatement": {
3410
- let n = new Set(t), r = e.left?.type === "VariableDeclaration" ? e.left.declarations[0]?.id?.name : e.left?.name;
3411
- return r && n.add(r), `(() => { const _obj = ${$(e.right, t)}; if (_obj) { for (let ${r} in _obj) { if (scope) scope[${JSON.stringify(r)}] = ${r}; ${$(e.body, n)}; } } })()`;
3412
- }
3413
- case "WhileStatement": return `(() => { while (${$(e.test, t)}) ${$(e.body, t)}; })()`;
3414
- case "DoWhileStatement": return `(() => { do ${$(e.body, t)} while (${$(e.test, t)}); })()`;
3415
- case "ArrayPattern": return `[ ${e.elements ? e.elements.map((e) => e ? e.type === "RestElement" ? "..." + $(e.argument, t) : e.type === "AssignmentPattern" ? `${$(e.left, t)} = ${$(e.right, t)}` : e.name || $(e, t) : "").join(", ") : ""} ]`;
3416
- case "ObjectPattern": return `{ ${e.properties ? e.properties.map((e) => {
3417
- if (e.type === "Property") {
3418
- let n = e.key?.name || $(e.key, t), r = e.value?.name || $(e.value, t);
3419
- return n === r ? n : `${n}: ${r}`;
3420
- }
3421
- return e.type === "RestElement" ? `...${$(e.argument, t)}` : "";
3422
- }).filter(Boolean).join(", ") : ""} }`;
3423
- case "VariableDeclaration": {
3424
- let n = new Set(t), r = [];
3425
- if (e.declarations) for (let i of e.declarations) if (i.id?.type === "ObjectPattern") {
3426
- let e = i.init ? $(i.init, t) : "undefined";
3427
- for (let a of i.id.properties || []) if (a.type === "Property") {
3428
- let i = a.key?.name || (typeof a.key?.value == "string" ? a.key.value : $(a.key, t)), o = a.value?.name, s = null;
3429
- if (a.value?.type === "AssignmentPattern" ? (o = a.value.left?.name || $(a.value.left, t), s = $(a.value.right, t)) : o ||= $(a.value, t), o) {
3430
- n.add(o);
3431
- let t = `((${e} && (${JSON.stringify(i)} in ${e})) ? ${e}[${JSON.stringify(i)}] : ${s ?? "undefined"})`;
3432
- r.push(`(typeof setScopeValue === 'function' ? setScopeValue(scope, ${JSON.stringify(o)}, ${t}) : ((scope || {})[${JSON.stringify(o)}] = ${t}))`);
3433
- }
3434
- }
3435
- } else {
3436
- let e = i.id?.name || $(i.id, t);
3437
- i.id?.name && n.add(i.id.name);
3438
- let a = i.init ? $(i.init, t) : "undefined";
3439
- t && i.id?.name && t.has(i.id.name) ? r.push(`${i.id.name} = ${a}`) : r.push(`(typeof setScopeValue === 'function' ? setScopeValue(scope, ${JSON.stringify(e)}, ${a}) : ((scope || {})[${JSON.stringify(e)}] = ${a}))`);
3440
- }
3441
- return `(${r.filter(Boolean).join(", ") || "undefined"})`;
3442
- }
3443
- case "FunctionDeclaration": {
3444
- let n = e.id?.name, r = new Set(t);
3445
- n && r.add(n);
3446
- let i = [];
3447
- if (e.params) for (let n of e.params) if (n.type === "AssignmentPattern") {
3448
- let e = n.left?.name || $(n.left, t), a = $(n.right, t);
3449
- n.left?.name && r.add(n.left.name), i.push(`${e} = ${a}`);
3450
- } else {
3451
- let e = n.name || n.id?.name || n.left && n.left.name || $(n, t);
3452
- e && (i.push(e), r.add(e));
3453
- }
3454
- if (e.body?.type === "BlockStatement" && Array.isArray(e.body.body)) for (let t of e.body.body) if (t.type === "VariableDeclaration" && t.declarations) for (let e of t.declarations) e.id?.name && r.add(e.id.name);
3455
- else t.type === "FunctionDeclaration" && t.id?.name && r.add(t.id.name);
3456
- let a = i.join(", "), o = e.body?.type === "BlockStatement" ? `{ ${e.body.body.map((e) => $(e, r)).filter(Boolean).join("; ")}; }` : `{ ${$(e.body, r)}; }`, s = `function ${n || ""}(${a}) ${o}`;
3457
- return n ? `(typeof setScopeValue === 'function' ? setScopeValue(scope, ${JSON.stringify(n)}, ${s}) : ((scope || {})[${JSON.stringify(n)}] = ${s}))` : s;
3458
- }
3459
- case "ArrowFunctionExpression":
3460
- case "FunctionExpression": {
3461
- let n = new Set(t), r = [];
3462
- if (e.params) for (let i of e.params) if (i.type === "AssignmentPattern") {
3463
- let e = i.left?.name || $(i.left, t), a = $(i.right, t);
3464
- i.left?.name && n.add(i.left.name), r.push(`${e} = ${a}`);
3465
- } else {
3466
- let e = i.name || i.id?.name || i.left && i.left.name || $(i, t);
3467
- e && (r.push(e), n.add(e));
3468
- }
3469
- if (e.body?.type === "BlockStatement" && Array.isArray(e.body.body)) for (let t of e.body.body) if (t.type === "VariableDeclaration" && t.declarations) for (let e of t.declarations) e.id?.name && n.add(e.id.name);
3470
- else t.type === "FunctionDeclaration" && t.id?.name && n.add(t.id.name);
3471
- let i = r.join(", ");
3472
- return e.body?.type === "BlockStatement" ? `((${i}) => ${`{ ${e.body.body.map((e) => $(e, n)).filter(Boolean).join("; ")}; }`})` : `((${i}) => ${$(e.body, n)})`;
82
+ function p(e, t) {
83
+ let n = {
84
+ id: Symbol(t || "DriftContext"),
85
+ name: t,
86
+ defaultValue: e,
87
+ provide(e) {
88
+ m(n, e);
89
+ },
90
+ inject(e) {
91
+ return h(n, e);
3473
92
  }
3474
- case "NewExpression": return `new (${$(e.callee, t)})(${e.arguments ? e.arguments.map((e) => $(e, t)).join(", ") : ""})`;
3475
- case "EmptyStatement":
3476
- case "ImportDeclaration":
3477
- case "ImportSpecifier":
3478
- case "ImportDefaultSpecifier":
3479
- case "ImportNamespaceSpecifier": return "";
3480
- case "ParenthesizedExpression":
3481
- case "ChainExpression": return $(e.expression, t);
3482
- default: return "";
3483
- }
3484
- }
3485
- //#endregion
3486
- //#region src/evaluator.ts
3487
- function It(e) {
3488
- return Array.isArray(e) ? e : e && typeof e[Symbol.iterator] == "function" ? Array.from(e) : [];
3489
- }
3490
- function Lt(e, n, i) {
3491
- return typeof e.__drift_fn__ == "function" ? e.__drift_fn__(n, i, t, r, It) : (e._executableFn ||= typeof e.__drift_fn__ == "string" ? Function("return (" + e.__drift_fn__ + ")")() : e.__drift_fn__, e._executableFn(n, i, t, r, It));
3492
- }
3493
- function Rt(e, n, i) {
3494
- if (e == null) return e;
3495
- if (typeof e == "function") return e(n, i, t, r, It);
3496
- if (typeof e == "object" && e && "__drift_fn__" in e) return Lt(e, n, i);
3497
- if (typeof e != "object" || !e) return e;
3498
- let a = $(e);
3499
- if (!a || a.trim().length === 0) return;
3500
- let o;
3501
- try {
3502
- o = Function("scope", "declaredVars", "setScopeValue", "inScopeChain", "resolveIterable", "return (" + a + ")");
3503
- } catch {
3504
- o = Function("scope", "declaredVars", "setScopeValue", "inScopeChain", "resolveIterable", a);
3505
- }
3506
- return o(n, i, t, r, It);
3507
- }
3508
- function zt(e, t, n) {
3509
- return e == null ? e : typeof e == "string" ? r(t, e) ? t[e] : e : typeof e == "object" && (e.type || "__drift_fn__" in e || typeof e._executableFn == "function") ? Rt(e, t, n) : e;
93
+ };
94
+ return n;
3510
95
  }
3511
- function Bt(e) {
3512
- return !e || typeof e != "object" ? null : Array.isArray(e.bytecode) || ArrayBuffer.isView(e.bytecode) ? e : e.program && (Array.isArray(e.program.bytecode) || ArrayBuffer.isView(e.program.bytecode)) ? e.program : e.default ? Bt(e.default) : e.compiledModule ? Bt(e.compiledModule) : null;
96
+ function m(e, t) {
97
+ let n = f();
98
+ if (!n || !n.contextMap) throw Error("provide() can only be called inside the <script> block of a DriftJS component during instantiation.");
99
+ n.contextMap.set(e.id, t);
3513
100
  }
3514
- function Vt(e, t, n) {
3515
- if (!e || typeof e != "object") return {};
3516
- let r = {};
3517
- for (let i of Object.keys(e)) {
3518
- if (i === "__drift_props__") continue;
3519
- let a = e[i];
3520
- r[i] = Rt(a, t, n);
101
+ function h(e, t) {
102
+ let n = f();
103
+ if (!n) return t === void 0 ? e.defaultValue : t;
104
+ let r = n;
105
+ for (; r;) {
106
+ if (r.contextMap && r.contextMap.has(e.id)) return r.contextMap.get(e.id);
107
+ r = r.parentVM;
3521
108
  }
3522
- return r;
3523
- }
3524
- //#endregion
3525
- //#region src/interpreter.ts
3526
- function Ht(e, n, r) {
3527
- let i;
3528
- if (!e) return i;
3529
- if (typeof e == "function") return e(n, r, t);
3530
- if (typeof e == "object" && e && "__drift_fn__" in e) return Lt(e, n, r);
3531
- if (Array.isArray(e)) for (let t of e) i = Rt(t, n, r);
3532
- else e && typeof e == "object" && (i = Rt(e, n, r));
3533
- return i;
109
+ return t === void 0 ? e.defaultValue : t;
3534
110
  }
111
+ var g = m, _ = h;
3535
112
  //#endregion
3536
- export { e as MAX_REGISTERS, Rt as evaluateExpression, Vt as evaluatePropsSpec, Ht as executeBlockStatement, Lt as executePrecompiledFn, r as inScopeChain, Bt as resolveComponentModule, It as resolveIterable, zt as resolveValue, t as setScopeValue, n as syncDeclaredVars };
113
+ export { e as MAX_REGISTERS, p as createContext, a as evaluateExpression, s as evaluatePropsSpec, i as executePrecompiledFn, f as getActiveVM, n as inScopeChain, _ as inject, h as injectContext, d as popActiveVM, g as provide, m as provideContext, u as pushActiveVM, o as resolveComponentModule, r as resolveIterable, t as setScopeValue };