@stylex-variants/core 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/babel/index.d.ts +8 -0
- package/dist/babel.js +5060 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +8 -0
- package/dist/sxv.d.ts +8 -0
- package/dist/types.d.ts +15 -0
- package/package.json +64 -0
package/dist/babel.js
ADDED
|
@@ -0,0 +1,5060 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/@babel+helper-validator-identifier@8.0.6/node_modules/@babel/helper-validator-identifier/lib/identifier-browser.js
|
|
2
|
+
var e = "ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿ-ℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ--ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ", t = "·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄ-ؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・", n = RegExp("[" + e + "]"), r = RegExp("[" + e + t + "]"), i = [
|
|
3
|
+
0,
|
|
4
|
+
11,
|
|
5
|
+
2,
|
|
6
|
+
25,
|
|
7
|
+
2,
|
|
8
|
+
18,
|
|
9
|
+
2,
|
|
10
|
+
1,
|
|
11
|
+
2,
|
|
12
|
+
14,
|
|
13
|
+
3,
|
|
14
|
+
13,
|
|
15
|
+
35,
|
|
16
|
+
122,
|
|
17
|
+
70,
|
|
18
|
+
52,
|
|
19
|
+
268,
|
|
20
|
+
28,
|
|
21
|
+
4,
|
|
22
|
+
48,
|
|
23
|
+
48,
|
|
24
|
+
31,
|
|
25
|
+
14,
|
|
26
|
+
29,
|
|
27
|
+
6,
|
|
28
|
+
37,
|
|
29
|
+
11,
|
|
30
|
+
29,
|
|
31
|
+
3,
|
|
32
|
+
35,
|
|
33
|
+
5,
|
|
34
|
+
7,
|
|
35
|
+
2,
|
|
36
|
+
4,
|
|
37
|
+
43,
|
|
38
|
+
157,
|
|
39
|
+
19,
|
|
40
|
+
35,
|
|
41
|
+
5,
|
|
42
|
+
35,
|
|
43
|
+
5,
|
|
44
|
+
39,
|
|
45
|
+
9,
|
|
46
|
+
51,
|
|
47
|
+
13,
|
|
48
|
+
10,
|
|
49
|
+
2,
|
|
50
|
+
14,
|
|
51
|
+
2,
|
|
52
|
+
6,
|
|
53
|
+
2,
|
|
54
|
+
1,
|
|
55
|
+
2,
|
|
56
|
+
10,
|
|
57
|
+
2,
|
|
58
|
+
14,
|
|
59
|
+
2,
|
|
60
|
+
6,
|
|
61
|
+
2,
|
|
62
|
+
1,
|
|
63
|
+
4,
|
|
64
|
+
51,
|
|
65
|
+
13,
|
|
66
|
+
310,
|
|
67
|
+
10,
|
|
68
|
+
21,
|
|
69
|
+
11,
|
|
70
|
+
7,
|
|
71
|
+
25,
|
|
72
|
+
5,
|
|
73
|
+
2,
|
|
74
|
+
41,
|
|
75
|
+
2,
|
|
76
|
+
13,
|
|
77
|
+
65,
|
|
78
|
+
5,
|
|
79
|
+
3,
|
|
80
|
+
0,
|
|
81
|
+
2,
|
|
82
|
+
43,
|
|
83
|
+
2,
|
|
84
|
+
1,
|
|
85
|
+
4,
|
|
86
|
+
0,
|
|
87
|
+
3,
|
|
88
|
+
22,
|
|
89
|
+
11,
|
|
90
|
+
22,
|
|
91
|
+
10,
|
|
92
|
+
30,
|
|
93
|
+
66,
|
|
94
|
+
18,
|
|
95
|
+
2,
|
|
96
|
+
1,
|
|
97
|
+
11,
|
|
98
|
+
21,
|
|
99
|
+
11,
|
|
100
|
+
25,
|
|
101
|
+
7,
|
|
102
|
+
25,
|
|
103
|
+
39,
|
|
104
|
+
55,
|
|
105
|
+
7,
|
|
106
|
+
1,
|
|
107
|
+
65,
|
|
108
|
+
0,
|
|
109
|
+
16,
|
|
110
|
+
3,
|
|
111
|
+
2,
|
|
112
|
+
2,
|
|
113
|
+
2,
|
|
114
|
+
28,
|
|
115
|
+
43,
|
|
116
|
+
28,
|
|
117
|
+
4,
|
|
118
|
+
28,
|
|
119
|
+
36,
|
|
120
|
+
7,
|
|
121
|
+
2,
|
|
122
|
+
27,
|
|
123
|
+
28,
|
|
124
|
+
53,
|
|
125
|
+
11,
|
|
126
|
+
21,
|
|
127
|
+
11,
|
|
128
|
+
18,
|
|
129
|
+
14,
|
|
130
|
+
17,
|
|
131
|
+
111,
|
|
132
|
+
72,
|
|
133
|
+
56,
|
|
134
|
+
50,
|
|
135
|
+
14,
|
|
136
|
+
50,
|
|
137
|
+
14,
|
|
138
|
+
35,
|
|
139
|
+
39,
|
|
140
|
+
27,
|
|
141
|
+
10,
|
|
142
|
+
22,
|
|
143
|
+
251,
|
|
144
|
+
41,
|
|
145
|
+
7,
|
|
146
|
+
1,
|
|
147
|
+
17,
|
|
148
|
+
5,
|
|
149
|
+
18,
|
|
150
|
+
21,
|
|
151
|
+
18,
|
|
152
|
+
28,
|
|
153
|
+
11,
|
|
154
|
+
0,
|
|
155
|
+
9,
|
|
156
|
+
21,
|
|
157
|
+
43,
|
|
158
|
+
17,
|
|
159
|
+
47,
|
|
160
|
+
20,
|
|
161
|
+
28,
|
|
162
|
+
22,
|
|
163
|
+
13,
|
|
164
|
+
52,
|
|
165
|
+
58,
|
|
166
|
+
1,
|
|
167
|
+
3,
|
|
168
|
+
0,
|
|
169
|
+
14,
|
|
170
|
+
44,
|
|
171
|
+
33,
|
|
172
|
+
24,
|
|
173
|
+
27,
|
|
174
|
+
35,
|
|
175
|
+
30,
|
|
176
|
+
0,
|
|
177
|
+
3,
|
|
178
|
+
0,
|
|
179
|
+
9,
|
|
180
|
+
34,
|
|
181
|
+
4,
|
|
182
|
+
0,
|
|
183
|
+
13,
|
|
184
|
+
47,
|
|
185
|
+
15,
|
|
186
|
+
3,
|
|
187
|
+
22,
|
|
188
|
+
0,
|
|
189
|
+
2,
|
|
190
|
+
0,
|
|
191
|
+
36,
|
|
192
|
+
17,
|
|
193
|
+
2,
|
|
194
|
+
24,
|
|
195
|
+
20,
|
|
196
|
+
1,
|
|
197
|
+
64,
|
|
198
|
+
6,
|
|
199
|
+
2,
|
|
200
|
+
0,
|
|
201
|
+
2,
|
|
202
|
+
3,
|
|
203
|
+
2,
|
|
204
|
+
14,
|
|
205
|
+
2,
|
|
206
|
+
9,
|
|
207
|
+
8,
|
|
208
|
+
46,
|
|
209
|
+
39,
|
|
210
|
+
7,
|
|
211
|
+
3,
|
|
212
|
+
1,
|
|
213
|
+
3,
|
|
214
|
+
21,
|
|
215
|
+
2,
|
|
216
|
+
6,
|
|
217
|
+
2,
|
|
218
|
+
1,
|
|
219
|
+
2,
|
|
220
|
+
4,
|
|
221
|
+
4,
|
|
222
|
+
0,
|
|
223
|
+
19,
|
|
224
|
+
0,
|
|
225
|
+
13,
|
|
226
|
+
4,
|
|
227
|
+
31,
|
|
228
|
+
9,
|
|
229
|
+
2,
|
|
230
|
+
0,
|
|
231
|
+
3,
|
|
232
|
+
0,
|
|
233
|
+
2,
|
|
234
|
+
37,
|
|
235
|
+
2,
|
|
236
|
+
0,
|
|
237
|
+
26,
|
|
238
|
+
0,
|
|
239
|
+
2,
|
|
240
|
+
0,
|
|
241
|
+
45,
|
|
242
|
+
52,
|
|
243
|
+
19,
|
|
244
|
+
3,
|
|
245
|
+
21,
|
|
246
|
+
2,
|
|
247
|
+
31,
|
|
248
|
+
47,
|
|
249
|
+
21,
|
|
250
|
+
1,
|
|
251
|
+
2,
|
|
252
|
+
0,
|
|
253
|
+
185,
|
|
254
|
+
46,
|
|
255
|
+
42,
|
|
256
|
+
3,
|
|
257
|
+
37,
|
|
258
|
+
47,
|
|
259
|
+
21,
|
|
260
|
+
0,
|
|
261
|
+
60,
|
|
262
|
+
42,
|
|
263
|
+
14,
|
|
264
|
+
0,
|
|
265
|
+
72,
|
|
266
|
+
26,
|
|
267
|
+
38,
|
|
268
|
+
6,
|
|
269
|
+
186,
|
|
270
|
+
43,
|
|
271
|
+
117,
|
|
272
|
+
63,
|
|
273
|
+
32,
|
|
274
|
+
7,
|
|
275
|
+
3,
|
|
276
|
+
0,
|
|
277
|
+
3,
|
|
278
|
+
7,
|
|
279
|
+
2,
|
|
280
|
+
1,
|
|
281
|
+
2,
|
|
282
|
+
23,
|
|
283
|
+
16,
|
|
284
|
+
0,
|
|
285
|
+
2,
|
|
286
|
+
0,
|
|
287
|
+
95,
|
|
288
|
+
7,
|
|
289
|
+
3,
|
|
290
|
+
38,
|
|
291
|
+
17,
|
|
292
|
+
0,
|
|
293
|
+
2,
|
|
294
|
+
0,
|
|
295
|
+
29,
|
|
296
|
+
0,
|
|
297
|
+
11,
|
|
298
|
+
39,
|
|
299
|
+
8,
|
|
300
|
+
0,
|
|
301
|
+
22,
|
|
302
|
+
0,
|
|
303
|
+
12,
|
|
304
|
+
45,
|
|
305
|
+
20,
|
|
306
|
+
0,
|
|
307
|
+
19,
|
|
308
|
+
72,
|
|
309
|
+
18,
|
|
310
|
+
0,
|
|
311
|
+
182,
|
|
312
|
+
32,
|
|
313
|
+
32,
|
|
314
|
+
8,
|
|
315
|
+
2,
|
|
316
|
+
36,
|
|
317
|
+
18,
|
|
318
|
+
0,
|
|
319
|
+
50,
|
|
320
|
+
29,
|
|
321
|
+
113,
|
|
322
|
+
6,
|
|
323
|
+
2,
|
|
324
|
+
1,
|
|
325
|
+
2,
|
|
326
|
+
37,
|
|
327
|
+
22,
|
|
328
|
+
0,
|
|
329
|
+
26,
|
|
330
|
+
5,
|
|
331
|
+
2,
|
|
332
|
+
1,
|
|
333
|
+
2,
|
|
334
|
+
31,
|
|
335
|
+
15,
|
|
336
|
+
0,
|
|
337
|
+
24,
|
|
338
|
+
43,
|
|
339
|
+
22,
|
|
340
|
+
0,
|
|
341
|
+
239,
|
|
342
|
+
18,
|
|
343
|
+
16,
|
|
344
|
+
0,
|
|
345
|
+
2,
|
|
346
|
+
12,
|
|
347
|
+
2,
|
|
348
|
+
33,
|
|
349
|
+
125,
|
|
350
|
+
0,
|
|
351
|
+
80,
|
|
352
|
+
921,
|
|
353
|
+
103,
|
|
354
|
+
111,
|
|
355
|
+
6,
|
|
356
|
+
206,
|
|
357
|
+
13,
|
|
358
|
+
310,
|
|
359
|
+
2314,
|
|
360
|
+
96,
|
|
361
|
+
16,
|
|
362
|
+
1071,
|
|
363
|
+
18,
|
|
364
|
+
5,
|
|
365
|
+
26,
|
|
366
|
+
3994,
|
|
367
|
+
6,
|
|
368
|
+
582,
|
|
369
|
+
6842,
|
|
370
|
+
29,
|
|
371
|
+
1763,
|
|
372
|
+
568,
|
|
373
|
+
8,
|
|
374
|
+
30,
|
|
375
|
+
18,
|
|
376
|
+
78,
|
|
377
|
+
18,
|
|
378
|
+
29,
|
|
379
|
+
19,
|
|
380
|
+
47,
|
|
381
|
+
17,
|
|
382
|
+
3,
|
|
383
|
+
32,
|
|
384
|
+
20,
|
|
385
|
+
6,
|
|
386
|
+
18,
|
|
387
|
+
433,
|
|
388
|
+
44,
|
|
389
|
+
212,
|
|
390
|
+
63,
|
|
391
|
+
33,
|
|
392
|
+
24,
|
|
393
|
+
3,
|
|
394
|
+
24,
|
|
395
|
+
45,
|
|
396
|
+
74,
|
|
397
|
+
6,
|
|
398
|
+
0,
|
|
399
|
+
67,
|
|
400
|
+
12,
|
|
401
|
+
65,
|
|
402
|
+
1,
|
|
403
|
+
2,
|
|
404
|
+
0,
|
|
405
|
+
15,
|
|
406
|
+
4,
|
|
407
|
+
10,
|
|
408
|
+
7386,
|
|
409
|
+
37,
|
|
410
|
+
33,
|
|
411
|
+
96,
|
|
412
|
+
114,
|
|
413
|
+
14,
|
|
414
|
+
913,
|
|
415
|
+
15,
|
|
416
|
+
50,
|
|
417
|
+
7710,
|
|
418
|
+
3,
|
|
419
|
+
2,
|
|
420
|
+
6,
|
|
421
|
+
2,
|
|
422
|
+
1,
|
|
423
|
+
2,
|
|
424
|
+
296,
|
|
425
|
+
10,
|
|
426
|
+
0,
|
|
427
|
+
30,
|
|
428
|
+
2,
|
|
429
|
+
3,
|
|
430
|
+
0,
|
|
431
|
+
15,
|
|
432
|
+
4,
|
|
433
|
+
8,
|
|
434
|
+
395,
|
|
435
|
+
2309,
|
|
436
|
+
106,
|
|
437
|
+
6,
|
|
438
|
+
12,
|
|
439
|
+
4,
|
|
440
|
+
8,
|
|
441
|
+
8,
|
|
442
|
+
9,
|
|
443
|
+
5991,
|
|
444
|
+
84,
|
|
445
|
+
2,
|
|
446
|
+
70,
|
|
447
|
+
2,
|
|
448
|
+
1,
|
|
449
|
+
3,
|
|
450
|
+
0,
|
|
451
|
+
3,
|
|
452
|
+
1,
|
|
453
|
+
3,
|
|
454
|
+
3,
|
|
455
|
+
2,
|
|
456
|
+
11,
|
|
457
|
+
2,
|
|
458
|
+
0,
|
|
459
|
+
2,
|
|
460
|
+
6,
|
|
461
|
+
2,
|
|
462
|
+
64,
|
|
463
|
+
2,
|
|
464
|
+
3,
|
|
465
|
+
3,
|
|
466
|
+
7,
|
|
467
|
+
2,
|
|
468
|
+
6,
|
|
469
|
+
2,
|
|
470
|
+
27,
|
|
471
|
+
2,
|
|
472
|
+
3,
|
|
473
|
+
2,
|
|
474
|
+
4,
|
|
475
|
+
2,
|
|
476
|
+
0,
|
|
477
|
+
4,
|
|
478
|
+
6,
|
|
479
|
+
2,
|
|
480
|
+
340,
|
|
481
|
+
2,
|
|
482
|
+
24,
|
|
483
|
+
2,
|
|
484
|
+
24,
|
|
485
|
+
2,
|
|
486
|
+
30,
|
|
487
|
+
2,
|
|
488
|
+
24,
|
|
489
|
+
2,
|
|
490
|
+
30,
|
|
491
|
+
2,
|
|
492
|
+
24,
|
|
493
|
+
2,
|
|
494
|
+
30,
|
|
495
|
+
2,
|
|
496
|
+
24,
|
|
497
|
+
2,
|
|
498
|
+
30,
|
|
499
|
+
2,
|
|
500
|
+
24,
|
|
501
|
+
2,
|
|
502
|
+
7,
|
|
503
|
+
1845,
|
|
504
|
+
129,
|
|
505
|
+
15,
|
|
506
|
+
6,
|
|
507
|
+
55,
|
|
508
|
+
50,
|
|
509
|
+
49,
|
|
510
|
+
61,
|
|
511
|
+
147,
|
|
512
|
+
44,
|
|
513
|
+
11,
|
|
514
|
+
6,
|
|
515
|
+
17,
|
|
516
|
+
0,
|
|
517
|
+
322,
|
|
518
|
+
29,
|
|
519
|
+
19,
|
|
520
|
+
43,
|
|
521
|
+
485,
|
|
522
|
+
27,
|
|
523
|
+
229,
|
|
524
|
+
29,
|
|
525
|
+
3,
|
|
526
|
+
0,
|
|
527
|
+
208,
|
|
528
|
+
30,
|
|
529
|
+
2,
|
|
530
|
+
2,
|
|
531
|
+
2,
|
|
532
|
+
1,
|
|
533
|
+
2,
|
|
534
|
+
6,
|
|
535
|
+
3,
|
|
536
|
+
4,
|
|
537
|
+
10,
|
|
538
|
+
1,
|
|
539
|
+
225,
|
|
540
|
+
6,
|
|
541
|
+
2,
|
|
542
|
+
3,
|
|
543
|
+
2,
|
|
544
|
+
1,
|
|
545
|
+
2,
|
|
546
|
+
14,
|
|
547
|
+
2,
|
|
548
|
+
196,
|
|
549
|
+
60,
|
|
550
|
+
67,
|
|
551
|
+
8,
|
|
552
|
+
0,
|
|
553
|
+
1205,
|
|
554
|
+
3,
|
|
555
|
+
2,
|
|
556
|
+
26,
|
|
557
|
+
2,
|
|
558
|
+
1,
|
|
559
|
+
2,
|
|
560
|
+
0,
|
|
561
|
+
3,
|
|
562
|
+
0,
|
|
563
|
+
2,
|
|
564
|
+
9,
|
|
565
|
+
2,
|
|
566
|
+
3,
|
|
567
|
+
2,
|
|
568
|
+
0,
|
|
569
|
+
2,
|
|
570
|
+
0,
|
|
571
|
+
7,
|
|
572
|
+
0,
|
|
573
|
+
5,
|
|
574
|
+
0,
|
|
575
|
+
2,
|
|
576
|
+
0,
|
|
577
|
+
2,
|
|
578
|
+
0,
|
|
579
|
+
2,
|
|
580
|
+
2,
|
|
581
|
+
2,
|
|
582
|
+
1,
|
|
583
|
+
2,
|
|
584
|
+
0,
|
|
585
|
+
3,
|
|
586
|
+
0,
|
|
587
|
+
2,
|
|
588
|
+
0,
|
|
589
|
+
2,
|
|
590
|
+
0,
|
|
591
|
+
2,
|
|
592
|
+
0,
|
|
593
|
+
2,
|
|
594
|
+
0,
|
|
595
|
+
2,
|
|
596
|
+
1,
|
|
597
|
+
2,
|
|
598
|
+
0,
|
|
599
|
+
3,
|
|
600
|
+
3,
|
|
601
|
+
2,
|
|
602
|
+
6,
|
|
603
|
+
2,
|
|
604
|
+
3,
|
|
605
|
+
2,
|
|
606
|
+
3,
|
|
607
|
+
2,
|
|
608
|
+
0,
|
|
609
|
+
2,
|
|
610
|
+
9,
|
|
611
|
+
2,
|
|
612
|
+
16,
|
|
613
|
+
6,
|
|
614
|
+
2,
|
|
615
|
+
2,
|
|
616
|
+
4,
|
|
617
|
+
2,
|
|
618
|
+
16,
|
|
619
|
+
4421,
|
|
620
|
+
42719,
|
|
621
|
+
33,
|
|
622
|
+
4382,
|
|
623
|
+
2,
|
|
624
|
+
5773,
|
|
625
|
+
3,
|
|
626
|
+
7472,
|
|
627
|
+
16,
|
|
628
|
+
621,
|
|
629
|
+
2467,
|
|
630
|
+
541,
|
|
631
|
+
1507,
|
|
632
|
+
4938,
|
|
633
|
+
6,
|
|
634
|
+
8489,
|
|
635
|
+
39815,
|
|
636
|
+
11327
|
|
637
|
+
], a = [
|
|
638
|
+
509,
|
|
639
|
+
0,
|
|
640
|
+
227,
|
|
641
|
+
0,
|
|
642
|
+
150,
|
|
643
|
+
4,
|
|
644
|
+
294,
|
|
645
|
+
9,
|
|
646
|
+
1368,
|
|
647
|
+
2,
|
|
648
|
+
2,
|
|
649
|
+
1,
|
|
650
|
+
6,
|
|
651
|
+
3,
|
|
652
|
+
41,
|
|
653
|
+
2,
|
|
654
|
+
5,
|
|
655
|
+
0,
|
|
656
|
+
166,
|
|
657
|
+
1,
|
|
658
|
+
574,
|
|
659
|
+
3,
|
|
660
|
+
9,
|
|
661
|
+
9,
|
|
662
|
+
7,
|
|
663
|
+
9,
|
|
664
|
+
32,
|
|
665
|
+
4,
|
|
666
|
+
318,
|
|
667
|
+
1,
|
|
668
|
+
31,
|
|
669
|
+
4,
|
|
670
|
+
33,
|
|
671
|
+
15,
|
|
672
|
+
71,
|
|
673
|
+
10,
|
|
674
|
+
50,
|
|
675
|
+
3,
|
|
676
|
+
123,
|
|
677
|
+
2,
|
|
678
|
+
54,
|
|
679
|
+
14,
|
|
680
|
+
32,
|
|
681
|
+
10,
|
|
682
|
+
3,
|
|
683
|
+
1,
|
|
684
|
+
11,
|
|
685
|
+
3,
|
|
686
|
+
46,
|
|
687
|
+
10,
|
|
688
|
+
8,
|
|
689
|
+
0,
|
|
690
|
+
46,
|
|
691
|
+
9,
|
|
692
|
+
7,
|
|
693
|
+
2,
|
|
694
|
+
37,
|
|
695
|
+
13,
|
|
696
|
+
2,
|
|
697
|
+
9,
|
|
698
|
+
6,
|
|
699
|
+
1,
|
|
700
|
+
45,
|
|
701
|
+
0,
|
|
702
|
+
13,
|
|
703
|
+
2,
|
|
704
|
+
49,
|
|
705
|
+
13,
|
|
706
|
+
9,
|
|
707
|
+
3,
|
|
708
|
+
2,
|
|
709
|
+
11,
|
|
710
|
+
83,
|
|
711
|
+
11,
|
|
712
|
+
7,
|
|
713
|
+
0,
|
|
714
|
+
3,
|
|
715
|
+
0,
|
|
716
|
+
158,
|
|
717
|
+
11,
|
|
718
|
+
6,
|
|
719
|
+
9,
|
|
720
|
+
7,
|
|
721
|
+
3,
|
|
722
|
+
56,
|
|
723
|
+
1,
|
|
724
|
+
2,
|
|
725
|
+
6,
|
|
726
|
+
3,
|
|
727
|
+
1,
|
|
728
|
+
3,
|
|
729
|
+
2,
|
|
730
|
+
10,
|
|
731
|
+
0,
|
|
732
|
+
11,
|
|
733
|
+
1,
|
|
734
|
+
3,
|
|
735
|
+
6,
|
|
736
|
+
4,
|
|
737
|
+
4,
|
|
738
|
+
68,
|
|
739
|
+
8,
|
|
740
|
+
2,
|
|
741
|
+
0,
|
|
742
|
+
3,
|
|
743
|
+
0,
|
|
744
|
+
2,
|
|
745
|
+
3,
|
|
746
|
+
2,
|
|
747
|
+
4,
|
|
748
|
+
2,
|
|
749
|
+
0,
|
|
750
|
+
15,
|
|
751
|
+
1,
|
|
752
|
+
83,
|
|
753
|
+
17,
|
|
754
|
+
10,
|
|
755
|
+
9,
|
|
756
|
+
5,
|
|
757
|
+
0,
|
|
758
|
+
82,
|
|
759
|
+
19,
|
|
760
|
+
13,
|
|
761
|
+
9,
|
|
762
|
+
214,
|
|
763
|
+
6,
|
|
764
|
+
3,
|
|
765
|
+
8,
|
|
766
|
+
28,
|
|
767
|
+
1,
|
|
768
|
+
83,
|
|
769
|
+
16,
|
|
770
|
+
16,
|
|
771
|
+
9,
|
|
772
|
+
82,
|
|
773
|
+
12,
|
|
774
|
+
9,
|
|
775
|
+
9,
|
|
776
|
+
7,
|
|
777
|
+
19,
|
|
778
|
+
58,
|
|
779
|
+
14,
|
|
780
|
+
5,
|
|
781
|
+
9,
|
|
782
|
+
243,
|
|
783
|
+
14,
|
|
784
|
+
166,
|
|
785
|
+
9,
|
|
786
|
+
71,
|
|
787
|
+
5,
|
|
788
|
+
2,
|
|
789
|
+
1,
|
|
790
|
+
3,
|
|
791
|
+
3,
|
|
792
|
+
2,
|
|
793
|
+
0,
|
|
794
|
+
2,
|
|
795
|
+
1,
|
|
796
|
+
13,
|
|
797
|
+
9,
|
|
798
|
+
120,
|
|
799
|
+
6,
|
|
800
|
+
3,
|
|
801
|
+
6,
|
|
802
|
+
4,
|
|
803
|
+
0,
|
|
804
|
+
29,
|
|
805
|
+
9,
|
|
806
|
+
41,
|
|
807
|
+
6,
|
|
808
|
+
2,
|
|
809
|
+
3,
|
|
810
|
+
9,
|
|
811
|
+
0,
|
|
812
|
+
10,
|
|
813
|
+
10,
|
|
814
|
+
47,
|
|
815
|
+
15,
|
|
816
|
+
199,
|
|
817
|
+
7,
|
|
818
|
+
137,
|
|
819
|
+
9,
|
|
820
|
+
54,
|
|
821
|
+
7,
|
|
822
|
+
2,
|
|
823
|
+
7,
|
|
824
|
+
17,
|
|
825
|
+
9,
|
|
826
|
+
57,
|
|
827
|
+
21,
|
|
828
|
+
2,
|
|
829
|
+
13,
|
|
830
|
+
123,
|
|
831
|
+
5,
|
|
832
|
+
4,
|
|
833
|
+
0,
|
|
834
|
+
2,
|
|
835
|
+
1,
|
|
836
|
+
2,
|
|
837
|
+
6,
|
|
838
|
+
2,
|
|
839
|
+
0,
|
|
840
|
+
9,
|
|
841
|
+
9,
|
|
842
|
+
49,
|
|
843
|
+
4,
|
|
844
|
+
2,
|
|
845
|
+
1,
|
|
846
|
+
2,
|
|
847
|
+
4,
|
|
848
|
+
9,
|
|
849
|
+
9,
|
|
850
|
+
55,
|
|
851
|
+
9,
|
|
852
|
+
7,
|
|
853
|
+
0,
|
|
854
|
+
259,
|
|
855
|
+
3,
|
|
856
|
+
10,
|
|
857
|
+
1,
|
|
858
|
+
2,
|
|
859
|
+
0,
|
|
860
|
+
49,
|
|
861
|
+
6,
|
|
862
|
+
4,
|
|
863
|
+
4,
|
|
864
|
+
14,
|
|
865
|
+
10,
|
|
866
|
+
5350,
|
|
867
|
+
0,
|
|
868
|
+
7,
|
|
869
|
+
14,
|
|
870
|
+
11465,
|
|
871
|
+
27,
|
|
872
|
+
2343,
|
|
873
|
+
9,
|
|
874
|
+
87,
|
|
875
|
+
9,
|
|
876
|
+
39,
|
|
877
|
+
4,
|
|
878
|
+
60,
|
|
879
|
+
6,
|
|
880
|
+
26,
|
|
881
|
+
9,
|
|
882
|
+
535,
|
|
883
|
+
9,
|
|
884
|
+
470,
|
|
885
|
+
0,
|
|
886
|
+
2,
|
|
887
|
+
54,
|
|
888
|
+
8,
|
|
889
|
+
3,
|
|
890
|
+
82,
|
|
891
|
+
0,
|
|
892
|
+
12,
|
|
893
|
+
1,
|
|
894
|
+
19628,
|
|
895
|
+
1,
|
|
896
|
+
4178,
|
|
897
|
+
9,
|
|
898
|
+
519,
|
|
899
|
+
45,
|
|
900
|
+
3,
|
|
901
|
+
22,
|
|
902
|
+
481,
|
|
903
|
+
1,
|
|
904
|
+
61,
|
|
905
|
+
4,
|
|
906
|
+
4,
|
|
907
|
+
5,
|
|
908
|
+
9,
|
|
909
|
+
7,
|
|
910
|
+
3,
|
|
911
|
+
6,
|
|
912
|
+
31,
|
|
913
|
+
3,
|
|
914
|
+
149,
|
|
915
|
+
2,
|
|
916
|
+
12,
|
|
917
|
+
2,
|
|
918
|
+
9,
|
|
919
|
+
1,
|
|
920
|
+
3,
|
|
921
|
+
0,
|
|
922
|
+
33,
|
|
923
|
+
1,
|
|
924
|
+
1357,
|
|
925
|
+
49,
|
|
926
|
+
513,
|
|
927
|
+
54,
|
|
928
|
+
5,
|
|
929
|
+
49,
|
|
930
|
+
9,
|
|
931
|
+
0,
|
|
932
|
+
15,
|
|
933
|
+
0,
|
|
934
|
+
23,
|
|
935
|
+
4,
|
|
936
|
+
2,
|
|
937
|
+
14,
|
|
938
|
+
1361,
|
|
939
|
+
6,
|
|
940
|
+
2,
|
|
941
|
+
16,
|
|
942
|
+
3,
|
|
943
|
+
6,
|
|
944
|
+
2,
|
|
945
|
+
1,
|
|
946
|
+
2,
|
|
947
|
+
4,
|
|
948
|
+
101,
|
|
949
|
+
0,
|
|
950
|
+
161,
|
|
951
|
+
6,
|
|
952
|
+
10,
|
|
953
|
+
9,
|
|
954
|
+
357,
|
|
955
|
+
0,
|
|
956
|
+
62,
|
|
957
|
+
13,
|
|
958
|
+
499,
|
|
959
|
+
13,
|
|
960
|
+
245,
|
|
961
|
+
1,
|
|
962
|
+
2,
|
|
963
|
+
9,
|
|
964
|
+
233,
|
|
965
|
+
0,
|
|
966
|
+
3,
|
|
967
|
+
0,
|
|
968
|
+
8,
|
|
969
|
+
1,
|
|
970
|
+
6,
|
|
971
|
+
0,
|
|
972
|
+
475,
|
|
973
|
+
6,
|
|
974
|
+
110,
|
|
975
|
+
6,
|
|
976
|
+
6,
|
|
977
|
+
9,
|
|
978
|
+
4759,
|
|
979
|
+
9,
|
|
980
|
+
787719,
|
|
981
|
+
239
|
|
982
|
+
];
|
|
983
|
+
function o(e, t) {
|
|
984
|
+
let n = 65536;
|
|
985
|
+
for (let r = 0, i = t.length; r < i; r += 2) {
|
|
986
|
+
if (n += t[r], n > e) return !1;
|
|
987
|
+
if (n += t[r + 1], n >= e) return !0;
|
|
988
|
+
}
|
|
989
|
+
return !1;
|
|
990
|
+
}
|
|
991
|
+
function s(e) {
|
|
992
|
+
return e < 65 ? e === 36 : e <= 90 ? !0 : e < 97 ? e === 95 : e <= 122 ? !0 : e <= 65535 ? e >= 170 && n.test(String.fromCharCode(e)) : o(e, i);
|
|
993
|
+
}
|
|
994
|
+
function c(e) {
|
|
995
|
+
return e < 48 ? e === 36 : e < 58 ? !0 : e < 65 ? !1 : e <= 90 ? !0 : e < 97 ? e === 95 : e <= 122 ? !0 : e <= 65535 ? e >= 170 && r.test(String.fromCharCode(e)) : o(e, i) || o(e, a);
|
|
996
|
+
}
|
|
997
|
+
function l(e) {
|
|
998
|
+
let t = !0;
|
|
999
|
+
for (let n = 0; n < e.length; n++) {
|
|
1000
|
+
let r = e.charCodeAt(n);
|
|
1001
|
+
if ((r & 64512) == 55296 && n + 1 < e.length) {
|
|
1002
|
+
let t = e.charCodeAt(++n);
|
|
1003
|
+
(t & 64512) == 56320 && (r = 65536 + ((r & 1023) << 10) + (t & 1023));
|
|
1004
|
+
}
|
|
1005
|
+
if (t) {
|
|
1006
|
+
if (t = !1, !s(r)) return !1;
|
|
1007
|
+
} else if (!c(r)) return !1;
|
|
1008
|
+
}
|
|
1009
|
+
return !t;
|
|
1010
|
+
}
|
|
1011
|
+
//#endregion
|
|
1012
|
+
//#region ../../node_modules/.pnpm/@babel+helper-validator-identifier@8.0.6/node_modules/@babel/helper-validator-identifier/lib/index.js
|
|
1013
|
+
var u = {
|
|
1014
|
+
keyword: /* @__PURE__ */ "break.case.catch.continue.debugger.default.do.else.finally.for.function.if.return.switch.throw.try.var.const.while.with.new.this.super.class.extends.export.import.null.true.false.in.instanceof.typeof.void.delete".split("."),
|
|
1015
|
+
strict: [
|
|
1016
|
+
"implements",
|
|
1017
|
+
"interface",
|
|
1018
|
+
"let",
|
|
1019
|
+
"package",
|
|
1020
|
+
"private",
|
|
1021
|
+
"protected",
|
|
1022
|
+
"public",
|
|
1023
|
+
"static",
|
|
1024
|
+
"yield"
|
|
1025
|
+
],
|
|
1026
|
+
strictBind: ["eval", "arguments"]
|
|
1027
|
+
}, d = new Set(u.keyword), f = new Set(u.strict);
|
|
1028
|
+
new Set(u.strictBind);
|
|
1029
|
+
function p(e, t) {
|
|
1030
|
+
return t && e === "await" || e === "enum";
|
|
1031
|
+
}
|
|
1032
|
+
function m(e, t) {
|
|
1033
|
+
return p(e, t) || f.has(e);
|
|
1034
|
+
}
|
|
1035
|
+
function ee(e) {
|
|
1036
|
+
return d.has(e);
|
|
1037
|
+
}
|
|
1038
|
+
//#endregion
|
|
1039
|
+
//#region ../../node_modules/.pnpm/@babel+helper-string-parser@8.0.6/node_modules/@babel/helper-string-parser/lib/index.js
|
|
1040
|
+
var te = function(e) {
|
|
1041
|
+
return e >= 48 && e <= 57;
|
|
1042
|
+
}, ne = {
|
|
1043
|
+
decBinOct: /* @__PURE__ */ new Set([
|
|
1044
|
+
46,
|
|
1045
|
+
66,
|
|
1046
|
+
69,
|
|
1047
|
+
79,
|
|
1048
|
+
95,
|
|
1049
|
+
98,
|
|
1050
|
+
101,
|
|
1051
|
+
111
|
|
1052
|
+
]),
|
|
1053
|
+
hex: /* @__PURE__ */ new Set([
|
|
1054
|
+
46,
|
|
1055
|
+
88,
|
|
1056
|
+
95,
|
|
1057
|
+
120
|
|
1058
|
+
])
|
|
1059
|
+
}, h = {
|
|
1060
|
+
bin: (e) => e === 48 || e === 49,
|
|
1061
|
+
oct: (e) => e >= 48 && e <= 55,
|
|
1062
|
+
dec: (e) => e >= 48 && e <= 57,
|
|
1063
|
+
hex: (e) => e >= 48 && e <= 57 || e >= 65 && e <= 70 || e >= 97 && e <= 102
|
|
1064
|
+
};
|
|
1065
|
+
function g(e, t, n, r, i, a) {
|
|
1066
|
+
let o = n, s = r, c = i, l = "", u = null, d = n, { length: f } = t;
|
|
1067
|
+
for (;;) {
|
|
1068
|
+
if (n >= f) {
|
|
1069
|
+
a.unterminated(o, s, c), l += t.slice(d, n);
|
|
1070
|
+
break;
|
|
1071
|
+
}
|
|
1072
|
+
let p = t.charCodeAt(n);
|
|
1073
|
+
if (_(e, p, t, n)) {
|
|
1074
|
+
l += t.slice(d, n);
|
|
1075
|
+
break;
|
|
1076
|
+
}
|
|
1077
|
+
if (p === 92) {
|
|
1078
|
+
l += t.slice(d, n);
|
|
1079
|
+
let o = re(t, n, r, i, e === "template", a);
|
|
1080
|
+
o.ch === null && !u ? u = {
|
|
1081
|
+
pos: n,
|
|
1082
|
+
lineStart: r,
|
|
1083
|
+
curLine: i
|
|
1084
|
+
} : l += o.ch, {pos: n, lineStart: r, curLine: i} = o, d = n;
|
|
1085
|
+
} else p === 8232 || p === 8233 ? (++n, ++i, r = n) : p === 10 || p === 13 ? e === "template" ? (l += t.slice(d, n) + "\n", ++n, p === 13 && t.charCodeAt(n) === 10 && ++n, ++i, d = r = n) : a.unterminated(o, s, c) : ++n;
|
|
1086
|
+
}
|
|
1087
|
+
return {
|
|
1088
|
+
pos: n,
|
|
1089
|
+
str: l,
|
|
1090
|
+
firstInvalidLoc: u,
|
|
1091
|
+
lineStart: r,
|
|
1092
|
+
curLine: i
|
|
1093
|
+
};
|
|
1094
|
+
}
|
|
1095
|
+
function _(e, t, n, r) {
|
|
1096
|
+
return e === "template" ? t === 96 || t === 36 && n.charCodeAt(r + 1) === 123 : t === (e === "double" ? 34 : 39);
|
|
1097
|
+
}
|
|
1098
|
+
function re(e, t, n, r, i, a) {
|
|
1099
|
+
let o = !i;
|
|
1100
|
+
t++;
|
|
1101
|
+
let s = (e) => ({
|
|
1102
|
+
pos: t,
|
|
1103
|
+
ch: e,
|
|
1104
|
+
lineStart: n,
|
|
1105
|
+
curLine: r
|
|
1106
|
+
}), c = e.charCodeAt(t++);
|
|
1107
|
+
switch (c) {
|
|
1108
|
+
case 110: return s("\n");
|
|
1109
|
+
case 114: return s("\r");
|
|
1110
|
+
case 120: {
|
|
1111
|
+
let i;
|
|
1112
|
+
return {code: i, pos: t} = ie(e, t, n, r, 2, !1, o, a), s(i === null ? null : String.fromCharCode(i));
|
|
1113
|
+
}
|
|
1114
|
+
case 117: {
|
|
1115
|
+
let i;
|
|
1116
|
+
return {code: i, pos: t} = ae(e, t, n, r, o, a), s(i === null ? null : String.fromCodePoint(i));
|
|
1117
|
+
}
|
|
1118
|
+
case 116: return s(" ");
|
|
1119
|
+
case 98: return s("\b");
|
|
1120
|
+
case 118: return s("\v");
|
|
1121
|
+
case 102: return s("\f");
|
|
1122
|
+
case 13: e.charCodeAt(t) === 10 && ++t;
|
|
1123
|
+
case 10: n = t, ++r;
|
|
1124
|
+
case 8232:
|
|
1125
|
+
case 8233: return s("");
|
|
1126
|
+
case 56:
|
|
1127
|
+
case 57:
|
|
1128
|
+
if (i) return s(null);
|
|
1129
|
+
a.strictNumericEscape(t - 1, n, r);
|
|
1130
|
+
default:
|
|
1131
|
+
if (c >= 48 && c <= 55) {
|
|
1132
|
+
let o = t - 1, c = /^[0-7]+/.exec(e.slice(o, t + 2))[0], l = parseInt(c, 8);
|
|
1133
|
+
l > 255 && (c = c.slice(0, -1), l = parseInt(c, 8)), t += c.length - 1;
|
|
1134
|
+
let u = e.charCodeAt(t);
|
|
1135
|
+
if (c !== "0" || u === 56 || u === 57) {
|
|
1136
|
+
if (i) return s(null);
|
|
1137
|
+
a.strictNumericEscape(o, n, r);
|
|
1138
|
+
}
|
|
1139
|
+
return s(String.fromCharCode(l));
|
|
1140
|
+
}
|
|
1141
|
+
return s(String.fromCharCode(c));
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
function ie(e, t, n, r, i, a, o, s) {
|
|
1145
|
+
let c = t, l;
|
|
1146
|
+
return {n: l, pos: t} = v(e, t, n, r, 16, i, a, !1, s, !o), l === null && (o ? s.invalidEscapeSequence(c, n, r) : t = c - 1), {
|
|
1147
|
+
code: l,
|
|
1148
|
+
pos: t
|
|
1149
|
+
};
|
|
1150
|
+
}
|
|
1151
|
+
function v(e, t, n, r, i, a, o, s, c, l) {
|
|
1152
|
+
let u = t, d = i === 16 ? ne.hex : ne.decBinOct, f = i === 16 ? h.hex : i === 10 ? h.dec : i === 8 ? h.oct : h.bin, p = !1, m = 0;
|
|
1153
|
+
for (let u = 0, ee = a ?? Infinity; u < ee; ++u) {
|
|
1154
|
+
let a = e.charCodeAt(t), u;
|
|
1155
|
+
if (a === 95 && s !== "bail") {
|
|
1156
|
+
let i = e.charCodeAt(t - 1), a = e.charCodeAt(t + 1);
|
|
1157
|
+
if (!s) {
|
|
1158
|
+
if (l) return {
|
|
1159
|
+
n: null,
|
|
1160
|
+
pos: t
|
|
1161
|
+
};
|
|
1162
|
+
c.numericSeparatorInEscapeSequence(t, n, r);
|
|
1163
|
+
} else if (Number.isNaN(a) || !f(a) || d.has(i) || d.has(a)) {
|
|
1164
|
+
if (l) return {
|
|
1165
|
+
n: null,
|
|
1166
|
+
pos: t
|
|
1167
|
+
};
|
|
1168
|
+
c.unexpectedNumericSeparator(t, n, r);
|
|
1169
|
+
}
|
|
1170
|
+
++t;
|
|
1171
|
+
continue;
|
|
1172
|
+
}
|
|
1173
|
+
if (u = a >= 97 ? a - 97 + 10 : a >= 65 ? a - 65 + 10 : te(a) ? a - 48 : Infinity, u >= i) {
|
|
1174
|
+
if (u <= 9) {
|
|
1175
|
+
if (l) return {
|
|
1176
|
+
n: null,
|
|
1177
|
+
pos: t
|
|
1178
|
+
};
|
|
1179
|
+
c.invalidDigit(t, n, r, i), u = 0;
|
|
1180
|
+
} else if (o) u = 0, p = !0;
|
|
1181
|
+
else break;
|
|
1182
|
+
}
|
|
1183
|
+
++t, m = m * i + u;
|
|
1184
|
+
}
|
|
1185
|
+
return t === u || a != null && t - u !== a || p ? {
|
|
1186
|
+
n: null,
|
|
1187
|
+
pos: t
|
|
1188
|
+
} : {
|
|
1189
|
+
n: m,
|
|
1190
|
+
pos: t
|
|
1191
|
+
};
|
|
1192
|
+
}
|
|
1193
|
+
function ae(e, t, n, r, i, a) {
|
|
1194
|
+
let o = e.charCodeAt(t), s;
|
|
1195
|
+
if (o === 123) {
|
|
1196
|
+
if (++t, {code: s, pos: t} = ie(e, t, n, r, e.indexOf("}", t) - t, !0, i, a), ++t, s !== null && s > 1114111) {
|
|
1197
|
+
if (i) a.invalidCodePoint(t, n, r);
|
|
1198
|
+
else return {
|
|
1199
|
+
code: null,
|
|
1200
|
+
pos: t
|
|
1201
|
+
};
|
|
1202
|
+
}
|
|
1203
|
+
} else ({code: s, pos: t} = ie(e, t, n, r, 4, !1, i, a));
|
|
1204
|
+
return {
|
|
1205
|
+
code: s,
|
|
1206
|
+
pos: t
|
|
1207
|
+
};
|
|
1208
|
+
}
|
|
1209
|
+
//#endregion
|
|
1210
|
+
//#region ../../node_modules/.pnpm/@babel+types@8.0.6/node_modules/@babel/types/lib/index.js
|
|
1211
|
+
function y(e, t) {
|
|
1212
|
+
let n = Object.keys(t);
|
|
1213
|
+
for (let r of n) if (e[r] !== t[r]) return !1;
|
|
1214
|
+
return !0;
|
|
1215
|
+
}
|
|
1216
|
+
function b(e, t, n) {
|
|
1217
|
+
return t?.type === e && (n == null || y(t, n));
|
|
1218
|
+
}
|
|
1219
|
+
function oe(e, t) {
|
|
1220
|
+
return b("ArrayExpression", e, t);
|
|
1221
|
+
}
|
|
1222
|
+
function se(e, t) {
|
|
1223
|
+
return b("AssignmentExpression", e, t);
|
|
1224
|
+
}
|
|
1225
|
+
function ce(e, t) {
|
|
1226
|
+
return b("File", e, t);
|
|
1227
|
+
}
|
|
1228
|
+
function le(e, t) {
|
|
1229
|
+
return b("FunctionDeclaration", e, t);
|
|
1230
|
+
}
|
|
1231
|
+
function ue(e, t) {
|
|
1232
|
+
return b("FunctionExpression", e, t);
|
|
1233
|
+
}
|
|
1234
|
+
function x(e, t) {
|
|
1235
|
+
return b("Identifier", e, t);
|
|
1236
|
+
}
|
|
1237
|
+
function de(e, t) {
|
|
1238
|
+
return b("StringLiteral", e, t);
|
|
1239
|
+
}
|
|
1240
|
+
function fe(e, t) {
|
|
1241
|
+
return b("NumericLiteral", e, t);
|
|
1242
|
+
}
|
|
1243
|
+
function pe(e, t) {
|
|
1244
|
+
return b("MemberExpression", e, t);
|
|
1245
|
+
}
|
|
1246
|
+
function S(e, t) {
|
|
1247
|
+
return b("ObjectExpression", e, t);
|
|
1248
|
+
}
|
|
1249
|
+
function C(e, t) {
|
|
1250
|
+
return b("ObjectProperty", e, t);
|
|
1251
|
+
}
|
|
1252
|
+
function me(e, t) {
|
|
1253
|
+
return b("ThisExpression", e, t);
|
|
1254
|
+
}
|
|
1255
|
+
function he(e, t) {
|
|
1256
|
+
return b("UnaryExpression", e, t);
|
|
1257
|
+
}
|
|
1258
|
+
function ge(e, t) {
|
|
1259
|
+
return b("UpdateExpression", e, t);
|
|
1260
|
+
}
|
|
1261
|
+
function _e(e, t) {
|
|
1262
|
+
return b("ClassExpression", e, t);
|
|
1263
|
+
}
|
|
1264
|
+
function ve(e, t) {
|
|
1265
|
+
return b("ExportAllDeclaration", e, t);
|
|
1266
|
+
}
|
|
1267
|
+
function ye(e, t) {
|
|
1268
|
+
return b("ImportNamespaceSpecifier", e, t);
|
|
1269
|
+
}
|
|
1270
|
+
function be(e, t) {
|
|
1271
|
+
return b("MetaProperty", e, t);
|
|
1272
|
+
}
|
|
1273
|
+
function xe(e, t) {
|
|
1274
|
+
return b("Super", e, t);
|
|
1275
|
+
}
|
|
1276
|
+
function Se(e, t) {
|
|
1277
|
+
return b("PrivateName", e, t);
|
|
1278
|
+
}
|
|
1279
|
+
function Ce(e, t) {
|
|
1280
|
+
if (!e) return !1;
|
|
1281
|
+
switch (e.type) {
|
|
1282
|
+
case "ArrayExpression":
|
|
1283
|
+
case "AssignmentExpression":
|
|
1284
|
+
case "BinaryExpression":
|
|
1285
|
+
case "CallExpression":
|
|
1286
|
+
case "ConditionalExpression":
|
|
1287
|
+
case "FunctionExpression":
|
|
1288
|
+
case "Identifier":
|
|
1289
|
+
case "StringLiteral":
|
|
1290
|
+
case "NumericLiteral":
|
|
1291
|
+
case "NullLiteral":
|
|
1292
|
+
case "BooleanLiteral":
|
|
1293
|
+
case "RegExpLiteral":
|
|
1294
|
+
case "LogicalExpression":
|
|
1295
|
+
case "MemberExpression":
|
|
1296
|
+
case "NewExpression":
|
|
1297
|
+
case "ObjectExpression":
|
|
1298
|
+
case "SequenceExpression":
|
|
1299
|
+
case "ParenthesizedExpression":
|
|
1300
|
+
case "ThisExpression":
|
|
1301
|
+
case "UnaryExpression":
|
|
1302
|
+
case "UpdateExpression":
|
|
1303
|
+
case "ArrowFunctionExpression":
|
|
1304
|
+
case "ClassExpression":
|
|
1305
|
+
case "MetaProperty":
|
|
1306
|
+
case "TaggedTemplateExpression":
|
|
1307
|
+
case "TemplateLiteral":
|
|
1308
|
+
case "YieldExpression":
|
|
1309
|
+
case "AwaitExpression":
|
|
1310
|
+
case "ImportExpression":
|
|
1311
|
+
case "BigIntLiteral":
|
|
1312
|
+
case "OptionalMemberExpression":
|
|
1313
|
+
case "OptionalCallExpression":
|
|
1314
|
+
case "TypeCastExpression":
|
|
1315
|
+
case "JSXElement":
|
|
1316
|
+
case "JSXFragment":
|
|
1317
|
+
case "BindExpression":
|
|
1318
|
+
case "DoExpression":
|
|
1319
|
+
case "ModuleExpression":
|
|
1320
|
+
case "TopicReference":
|
|
1321
|
+
case "TSInstantiationExpression":
|
|
1322
|
+
case "TSAsExpression":
|
|
1323
|
+
case "TSSatisfiesExpression":
|
|
1324
|
+
case "TSTypeAssertion":
|
|
1325
|
+
case "TSNonNullExpression": break;
|
|
1326
|
+
case "Placeholder":
|
|
1327
|
+
switch (e.expectedNode) {
|
|
1328
|
+
case "Expression":
|
|
1329
|
+
case "Identifier":
|
|
1330
|
+
case "StringLiteral": break;
|
|
1331
|
+
default: return !1;
|
|
1332
|
+
}
|
|
1333
|
+
break;
|
|
1334
|
+
default: return !1;
|
|
1335
|
+
}
|
|
1336
|
+
return t == null || y(e, t);
|
|
1337
|
+
}
|
|
1338
|
+
function we(e, t) {
|
|
1339
|
+
if (!e) return !1;
|
|
1340
|
+
switch (e.type) {
|
|
1341
|
+
case "FunctionDeclaration":
|
|
1342
|
+
case "VariableDeclaration":
|
|
1343
|
+
case "ClassDeclaration":
|
|
1344
|
+
case "ExportAllDeclaration":
|
|
1345
|
+
case "ExportDefaultDeclaration":
|
|
1346
|
+
case "ExportNamedDeclaration":
|
|
1347
|
+
case "ImportDeclaration":
|
|
1348
|
+
case "DeclareClass":
|
|
1349
|
+
case "DeclareFunction":
|
|
1350
|
+
case "DeclareInterface":
|
|
1351
|
+
case "DeclareModule":
|
|
1352
|
+
case "DeclareModuleExports":
|
|
1353
|
+
case "DeclareTypeAlias":
|
|
1354
|
+
case "DeclareOpaqueType":
|
|
1355
|
+
case "DeclareVariable":
|
|
1356
|
+
case "DeclareExportDeclaration":
|
|
1357
|
+
case "DeclareExportAllDeclaration":
|
|
1358
|
+
case "InterfaceDeclaration":
|
|
1359
|
+
case "OpaqueType":
|
|
1360
|
+
case "TypeAlias":
|
|
1361
|
+
case "EnumDeclaration":
|
|
1362
|
+
case "TSDeclareFunction":
|
|
1363
|
+
case "TSInterfaceDeclaration":
|
|
1364
|
+
case "TSTypeAliasDeclaration":
|
|
1365
|
+
case "TSEnumDeclaration":
|
|
1366
|
+
case "TSModuleDeclaration":
|
|
1367
|
+
case "TSImportEqualsDeclaration": break;
|
|
1368
|
+
case "Placeholder": if (e.expectedNode === "Declaration") break;
|
|
1369
|
+
default: return !1;
|
|
1370
|
+
}
|
|
1371
|
+
return t == null || y(e, t);
|
|
1372
|
+
}
|
|
1373
|
+
function Te(e, t) {
|
|
1374
|
+
if (!e) return !1;
|
|
1375
|
+
switch (e.type) {
|
|
1376
|
+
case "ExportAllDeclaration":
|
|
1377
|
+
case "ExportDefaultDeclaration":
|
|
1378
|
+
case "ExportNamedDeclaration": break;
|
|
1379
|
+
default: return !1;
|
|
1380
|
+
}
|
|
1381
|
+
return t == null || y(e, t);
|
|
1382
|
+
}
|
|
1383
|
+
function Ee(e) {
|
|
1384
|
+
return pe(e) || be(e);
|
|
1385
|
+
}
|
|
1386
|
+
function De(e, t, n) {
|
|
1387
|
+
if (!Ee(e)) return !1;
|
|
1388
|
+
let r = Array.isArray(t) ? t : t.split("."), i = [], a;
|
|
1389
|
+
for (a = e; Ee(a); a = a.object ?? a.meta) i.push(a.property);
|
|
1390
|
+
if (i.push(a), i.length < r.length || !n && i.length > r.length) return !1;
|
|
1391
|
+
for (let e = 0, t = i.length - 1; e < r.length; e++, t--) {
|
|
1392
|
+
let n = i[t], a;
|
|
1393
|
+
if (x(n)) a = n.name;
|
|
1394
|
+
else if (de(n)) a = n.value;
|
|
1395
|
+
else if (me(n)) a = "this";
|
|
1396
|
+
else if (xe(n)) a = "super";
|
|
1397
|
+
else if (Se(n)) a = "#" + n.id.name;
|
|
1398
|
+
else return !1;
|
|
1399
|
+
if (r[e] !== a) return !1;
|
|
1400
|
+
}
|
|
1401
|
+
return !0;
|
|
1402
|
+
}
|
|
1403
|
+
function Oe(e, t) {
|
|
1404
|
+
let n = e.split(".");
|
|
1405
|
+
return (e) => De(e, n, t);
|
|
1406
|
+
}
|
|
1407
|
+
Oe("React.Component");
|
|
1408
|
+
function ke(e, t) {
|
|
1409
|
+
return e === t ? !0 : e == null || We[t] ? !1 : !!T[t]?.includes(e);
|
|
1410
|
+
}
|
|
1411
|
+
function Ae(e, t) {
|
|
1412
|
+
return !!(e === t || _t[e]?.includes(t));
|
|
1413
|
+
}
|
|
1414
|
+
function w(e, t, n) {
|
|
1415
|
+
return t ? ke(t.type, e) ? n === void 0 || y(t, n) : !n && t.type === "Placeholder" && e in T && Ae(t.expectedNode, e) : !1;
|
|
1416
|
+
}
|
|
1417
|
+
function je(e, t = !0) {
|
|
1418
|
+
return typeof e != "string" || t && (ee(e) || m(e, !0)) ? !1 : l(e);
|
|
1419
|
+
}
|
|
1420
|
+
var Me = [
|
|
1421
|
+
"leadingComments",
|
|
1422
|
+
"trailingComments",
|
|
1423
|
+
"innerComments"
|
|
1424
|
+
], Ne = [
|
|
1425
|
+
"||",
|
|
1426
|
+
"&&",
|
|
1427
|
+
"??"
|
|
1428
|
+
], Pe = ["++", "--"], Fe = [
|
|
1429
|
+
"==",
|
|
1430
|
+
"===",
|
|
1431
|
+
"!=",
|
|
1432
|
+
"!==",
|
|
1433
|
+
"in",
|
|
1434
|
+
"instanceof",
|
|
1435
|
+
">",
|
|
1436
|
+
"<",
|
|
1437
|
+
">=",
|
|
1438
|
+
"<="
|
|
1439
|
+
], Ie = [
|
|
1440
|
+
"-",
|
|
1441
|
+
"/",
|
|
1442
|
+
"%",
|
|
1443
|
+
"*",
|
|
1444
|
+
"**",
|
|
1445
|
+
"&",
|
|
1446
|
+
"|",
|
|
1447
|
+
">>",
|
|
1448
|
+
">>>",
|
|
1449
|
+
"<<",
|
|
1450
|
+
"^"
|
|
1451
|
+
], Le = [
|
|
1452
|
+
"+",
|
|
1453
|
+
...Ie,
|
|
1454
|
+
...Fe,
|
|
1455
|
+
"|>"
|
|
1456
|
+
], Re = [
|
|
1457
|
+
"=",
|
|
1458
|
+
"+=",
|
|
1459
|
+
...Ie.map((e) => e + "="),
|
|
1460
|
+
...Ne.map((e) => e + "=")
|
|
1461
|
+
], ze = ["delete", "!"], Be = [
|
|
1462
|
+
"+",
|
|
1463
|
+
"-",
|
|
1464
|
+
"~"
|
|
1465
|
+
], Ve = ["typeof"], He = [
|
|
1466
|
+
"void",
|
|
1467
|
+
"throw",
|
|
1468
|
+
...ze,
|
|
1469
|
+
...Be,
|
|
1470
|
+
...Ve
|
|
1471
|
+
], Ue = {}, We = {}, T = {}, Ge = {}, Ke = {}, qe = {}, Je = {}, Ye = {};
|
|
1472
|
+
function Xe(e) {
|
|
1473
|
+
return Array.isArray(e) ? "array" : e === null ? "null" : typeof e;
|
|
1474
|
+
}
|
|
1475
|
+
function E(e, ...t) {
|
|
1476
|
+
return Object.assign(e, ...t);
|
|
1477
|
+
}
|
|
1478
|
+
function D(e) {
|
|
1479
|
+
return { validate: e };
|
|
1480
|
+
}
|
|
1481
|
+
function O(...e) {
|
|
1482
|
+
return D(I(...e));
|
|
1483
|
+
}
|
|
1484
|
+
function k(e) {
|
|
1485
|
+
return {
|
|
1486
|
+
validate: e,
|
|
1487
|
+
optional: !0
|
|
1488
|
+
};
|
|
1489
|
+
}
|
|
1490
|
+
function A(e, t) {
|
|
1491
|
+
return {
|
|
1492
|
+
validate: e,
|
|
1493
|
+
default: t,
|
|
1494
|
+
optional: !1
|
|
1495
|
+
};
|
|
1496
|
+
}
|
|
1497
|
+
function j(...e) {
|
|
1498
|
+
return {
|
|
1499
|
+
validate: I(...e),
|
|
1500
|
+
optional: !0
|
|
1501
|
+
};
|
|
1502
|
+
}
|
|
1503
|
+
function Ze(e) {
|
|
1504
|
+
return R(L("array"), P(e));
|
|
1505
|
+
}
|
|
1506
|
+
function M(...e) {
|
|
1507
|
+
return Ze(I(...e));
|
|
1508
|
+
}
|
|
1509
|
+
function N(...e) {
|
|
1510
|
+
return D(M(...e));
|
|
1511
|
+
}
|
|
1512
|
+
function P(e) {
|
|
1513
|
+
let t = jt;
|
|
1514
|
+
function n(n, r, i) {
|
|
1515
|
+
if (!Array.isArray(i)) return;
|
|
1516
|
+
let a = 0, o = { toString() {
|
|
1517
|
+
return `${r}[${a}]`;
|
|
1518
|
+
} };
|
|
1519
|
+
for (; a < i.length; a++) {
|
|
1520
|
+
let r = i[a];
|
|
1521
|
+
e(n, o, r), t(n, o, r);
|
|
1522
|
+
}
|
|
1523
|
+
}
|
|
1524
|
+
return n.each = e, n;
|
|
1525
|
+
}
|
|
1526
|
+
function F(...e) {
|
|
1527
|
+
function t(t, n, r) {
|
|
1528
|
+
if (!e.includes(r)) throw TypeError(`Property ${n} expected value to be one of ${JSON.stringify(e)} but got ${JSON.stringify(r)}`);
|
|
1529
|
+
}
|
|
1530
|
+
return t.oneOf = e, t;
|
|
1531
|
+
}
|
|
1532
|
+
var Qe = [];
|
|
1533
|
+
function I(...e) {
|
|
1534
|
+
let t = /* @__PURE__ */ new Set();
|
|
1535
|
+
Qe.push({
|
|
1536
|
+
types: e,
|
|
1537
|
+
set: t
|
|
1538
|
+
});
|
|
1539
|
+
function n(n, r, i) {
|
|
1540
|
+
let a = i?.type;
|
|
1541
|
+
if (a != null) {
|
|
1542
|
+
if (t.has(a)) {
|
|
1543
|
+
jt(n, r, i);
|
|
1544
|
+
return;
|
|
1545
|
+
}
|
|
1546
|
+
if (a === "Placeholder") {
|
|
1547
|
+
for (let t of e) if (w(t, i)) {
|
|
1548
|
+
jt(n, r, i);
|
|
1549
|
+
return;
|
|
1550
|
+
}
|
|
1551
|
+
}
|
|
1552
|
+
}
|
|
1553
|
+
throw TypeError(`Property ${r} of ${n.type} expected node to be of a type ${JSON.stringify(e)} but instead got ${JSON.stringify(a)}`);
|
|
1554
|
+
}
|
|
1555
|
+
return n.oneOfNodeTypes = e, n;
|
|
1556
|
+
}
|
|
1557
|
+
function $e(...e) {
|
|
1558
|
+
function t(t, n, r) {
|
|
1559
|
+
let i = Xe(r);
|
|
1560
|
+
for (let a of e) if (i === a || w(a, r)) {
|
|
1561
|
+
jt(t, n, r);
|
|
1562
|
+
return;
|
|
1563
|
+
}
|
|
1564
|
+
throw TypeError(`Property ${n} of ${t.type} expected node to be of a type ${JSON.stringify(e)} but instead got ${JSON.stringify(r?.type)}`);
|
|
1565
|
+
}
|
|
1566
|
+
return t.oneOfNodeOrValueTypes = e, t;
|
|
1567
|
+
}
|
|
1568
|
+
function L(e) {
|
|
1569
|
+
function t(t, n, r) {
|
|
1570
|
+
if (Xe(r) !== e) throw TypeError(`Property ${n} expected type of ${e} but got ${Xe(r)}`);
|
|
1571
|
+
}
|
|
1572
|
+
return t.type = e, t;
|
|
1573
|
+
}
|
|
1574
|
+
function et(e) {
|
|
1575
|
+
let t = Object.keys(e);
|
|
1576
|
+
function n(n, r, i) {
|
|
1577
|
+
let a = [];
|
|
1578
|
+
for (let r of t) try {
|
|
1579
|
+
At(n, r, i[r], e[r]);
|
|
1580
|
+
} catch (e) {
|
|
1581
|
+
if (e instanceof TypeError) {
|
|
1582
|
+
a.push(e.message);
|
|
1583
|
+
continue;
|
|
1584
|
+
}
|
|
1585
|
+
throw e;
|
|
1586
|
+
}
|
|
1587
|
+
if (a.length) throw TypeError(`Property ${r} of ${n.type} expected to have the following:\n${a.join("\n")}`);
|
|
1588
|
+
}
|
|
1589
|
+
return n.shapeOf = e, n;
|
|
1590
|
+
}
|
|
1591
|
+
function tt() {
|
|
1592
|
+
function e(e) {
|
|
1593
|
+
let t = e;
|
|
1594
|
+
for (; e;) {
|
|
1595
|
+
let { type: e } = t;
|
|
1596
|
+
if (e === "OptionalCallExpression") {
|
|
1597
|
+
if (t.optional) return;
|
|
1598
|
+
t = t.callee;
|
|
1599
|
+
continue;
|
|
1600
|
+
}
|
|
1601
|
+
if (e === "OptionalMemberExpression") {
|
|
1602
|
+
if (t.optional) return;
|
|
1603
|
+
t = t.object;
|
|
1604
|
+
continue;
|
|
1605
|
+
}
|
|
1606
|
+
break;
|
|
1607
|
+
}
|
|
1608
|
+
throw TypeError(`Non-optional ${e.type} must chain from an optional OptionalMemberExpression or OptionalCallExpression. Found chain from ${t?.type}`);
|
|
1609
|
+
}
|
|
1610
|
+
return e;
|
|
1611
|
+
}
|
|
1612
|
+
function R(...e) {
|
|
1613
|
+
function t(...t) {
|
|
1614
|
+
for (let n of e) n(...t);
|
|
1615
|
+
}
|
|
1616
|
+
if (t.chainOf = e, e.length >= 2 && "type" in e[0] && e[0].type === "array" && !("each" in e[1])) throw Error("An assertValueType(\"array\") validator can only be followed by an assertEach(...) validator.");
|
|
1617
|
+
return t;
|
|
1618
|
+
}
|
|
1619
|
+
var nt = /* @__PURE__ */ new Set([
|
|
1620
|
+
"aliases",
|
|
1621
|
+
"builder",
|
|
1622
|
+
"deprecatedAlias",
|
|
1623
|
+
"fields",
|
|
1624
|
+
"inherits",
|
|
1625
|
+
"visitor",
|
|
1626
|
+
"validate",
|
|
1627
|
+
"unionShape"
|
|
1628
|
+
]), rt = /* @__PURE__ */ new Set([
|
|
1629
|
+
"default",
|
|
1630
|
+
"optional",
|
|
1631
|
+
"deprecated",
|
|
1632
|
+
"validate"
|
|
1633
|
+
]), it = {};
|
|
1634
|
+
function z(...e) {
|
|
1635
|
+
return (t, n = {}) => {
|
|
1636
|
+
let r = n.aliases;
|
|
1637
|
+
r || (n.inherits && (r = it[n.inherits].aliases?.slice()), r ??= [], n.aliases = r);
|
|
1638
|
+
let i = e.filter((e) => !r.includes(e));
|
|
1639
|
+
r.unshift(...i), B(t, n);
|
|
1640
|
+
};
|
|
1641
|
+
}
|
|
1642
|
+
function B(e, t = {}) {
|
|
1643
|
+
let n = t.inherits && it[t.inherits] || {}, r = t.visitor || n.visitor || [], i = t.aliases || n.aliases || [], a = t.builder || n.builder || t.visitor || [], o = t.fields;
|
|
1644
|
+
if (!o && (o = {}, n.fields)) {
|
|
1645
|
+
let e = Object.getOwnPropertyNames(n.fields);
|
|
1646
|
+
for (let t of e) {
|
|
1647
|
+
let e = n.fields[t], r = e.default;
|
|
1648
|
+
if (Array.isArray(r) ? r.length > 0 : r && typeof r == "object") throw Error("field defaults can only be primitives or empty arrays currently");
|
|
1649
|
+
o[t] = {
|
|
1650
|
+
default: Array.isArray(r) ? [] : r,
|
|
1651
|
+
optional: e.optional,
|
|
1652
|
+
deprecated: e.deprecated,
|
|
1653
|
+
validate: e.validate
|
|
1654
|
+
};
|
|
1655
|
+
}
|
|
1656
|
+
}
|
|
1657
|
+
for (let n of Object.keys(t)) if (!nt.has(n)) throw Error(`Unknown type option "${n}" on ${e}`);
|
|
1658
|
+
t.deprecatedAlias && (qe[t.deprecatedAlias] = e);
|
|
1659
|
+
for (let e of r.concat(a)) o[e] = o[e] || {};
|
|
1660
|
+
for (let t of Object.keys(o)) {
|
|
1661
|
+
let n = o[t];
|
|
1662
|
+
n.default === null && (n.optional ??= !0), n.default === void 0 ? (n.default = null, n.optional ??= !1) : !n.validate && n.default != null && (n.validate = L(Xe(n.default)));
|
|
1663
|
+
for (let r of Object.keys(n)) if (!rt.has(r)) throw Error(`Unknown field key "${r}" on ${e}.${t}`);
|
|
1664
|
+
}
|
|
1665
|
+
Ue[e] = t.visitor = r, Ke[e] = t.builder = a, Ge[e] = t.fields = o, We[e] = t.aliases = i, i.forEach((t) => {
|
|
1666
|
+
T[t] = T[t] || [], T[t].push(e);
|
|
1667
|
+
}), t.validate && (Je[e] = t.validate), t.unionShape && (Ye[e] = t.unionShape), it[e] = t;
|
|
1668
|
+
}
|
|
1669
|
+
var at = /*#__PURE__*/ Object.defineProperty({
|
|
1670
|
+
__proto__: null,
|
|
1671
|
+
ALIAS_KEYS: We,
|
|
1672
|
+
BUILDER_KEYS: Ke,
|
|
1673
|
+
DEPRECATED_KEYS: qe,
|
|
1674
|
+
FLIPPED_ALIAS_KEYS: T,
|
|
1675
|
+
NODE_FIELDS: Ge,
|
|
1676
|
+
NODE_PARENT_VALIDATIONS: Je,
|
|
1677
|
+
NODE_UNION_SHAPES__PRIVATE: Ye,
|
|
1678
|
+
VISITOR_KEYS: Ue,
|
|
1679
|
+
allExpandedTypes: Qe,
|
|
1680
|
+
arrayOf: Ze,
|
|
1681
|
+
arrayOfType: M,
|
|
1682
|
+
assertEach: P,
|
|
1683
|
+
assertNodeOrValueType: $e,
|
|
1684
|
+
assertNodeType: I,
|
|
1685
|
+
assertOneOf: F,
|
|
1686
|
+
assertOptionalChainStart: tt,
|
|
1687
|
+
assertShape: et,
|
|
1688
|
+
assertValueType: L,
|
|
1689
|
+
chain: R,
|
|
1690
|
+
combine: E,
|
|
1691
|
+
default: B,
|
|
1692
|
+
defineAliasedType: z,
|
|
1693
|
+
validate: D,
|
|
1694
|
+
validateArrayOfType: N,
|
|
1695
|
+
validateDefault: A,
|
|
1696
|
+
validateOptional: k,
|
|
1697
|
+
validateOptionalType: j,
|
|
1698
|
+
validateType: O
|
|
1699
|
+
}, Symbol.toStringTag, { value: "Module" }), V = (e = !1) => ({ unionShape: {
|
|
1700
|
+
discriminator: "computed",
|
|
1701
|
+
shapes: [{
|
|
1702
|
+
name: "computed",
|
|
1703
|
+
value: [!0],
|
|
1704
|
+
properties: { key: { validate: I("Expression") } }
|
|
1705
|
+
}, {
|
|
1706
|
+
name: "nonComputed",
|
|
1707
|
+
value: [!1],
|
|
1708
|
+
properties: { key: { validate: e ? I("Identifier", "StringLiteral", "NumericLiteral", "BigIntLiteral", "PrivateName") : I("Identifier", "StringLiteral", "NumericLiteral", "BigIntLiteral") } }
|
|
1709
|
+
}]
|
|
1710
|
+
} }), ot = { unionShape: {
|
|
1711
|
+
discriminator: "computed",
|
|
1712
|
+
shapes: [{
|
|
1713
|
+
name: "computed",
|
|
1714
|
+
value: [!0],
|
|
1715
|
+
properties: { property: { validate: I("Expression") } }
|
|
1716
|
+
}, {
|
|
1717
|
+
name: "nonComputed",
|
|
1718
|
+
value: [!1],
|
|
1719
|
+
properties: { property: { validate: I("Identifier", "PrivateName") } }
|
|
1720
|
+
}]
|
|
1721
|
+
} }, H = z("Standardized");
|
|
1722
|
+
H("ArrayExpression", {
|
|
1723
|
+
fields: { elements: {
|
|
1724
|
+
validate: Ze($e("null", "Expression", "SpreadElement")),
|
|
1725
|
+
default: void 0
|
|
1726
|
+
} },
|
|
1727
|
+
visitor: ["elements"],
|
|
1728
|
+
aliases: ["Expression"]
|
|
1729
|
+
}), H("AssignmentExpression", {
|
|
1730
|
+
fields: {
|
|
1731
|
+
operator: { validate: E(function() {
|
|
1732
|
+
let e = F(...Re), t = F("=");
|
|
1733
|
+
return function(n, r, i) {
|
|
1734
|
+
(w("Pattern", n.left) ? t : e)(n, r, i);
|
|
1735
|
+
};
|
|
1736
|
+
}(), { oneOf: Re }) },
|
|
1737
|
+
left: { validate: I("Identifier", "MemberExpression", "OptionalMemberExpression", "ArrayPattern", "ObjectPattern", "TSAsExpression", "TSSatisfiesExpression", "TSTypeAssertion", "TSNonNullExpression") },
|
|
1738
|
+
right: { validate: I("Expression") }
|
|
1739
|
+
},
|
|
1740
|
+
builder: [
|
|
1741
|
+
"operator",
|
|
1742
|
+
"left",
|
|
1743
|
+
"right"
|
|
1744
|
+
],
|
|
1745
|
+
visitor: ["left", "right"],
|
|
1746
|
+
aliases: ["Expression"]
|
|
1747
|
+
}), H("BinaryExpression", {
|
|
1748
|
+
builder: [
|
|
1749
|
+
"operator",
|
|
1750
|
+
"left",
|
|
1751
|
+
"right"
|
|
1752
|
+
],
|
|
1753
|
+
fields: {
|
|
1754
|
+
operator: { validate: F(...Le) },
|
|
1755
|
+
left: { validate: function() {
|
|
1756
|
+
let e = I("Expression"), t = I("Expression", "PrivateName");
|
|
1757
|
+
return E(function(n, r, i) {
|
|
1758
|
+
(n.operator === "in" ? t : e)(n, r, i);
|
|
1759
|
+
}, { oneOfNodeTypes: ["Expression", "PrivateName"] });
|
|
1760
|
+
}() },
|
|
1761
|
+
right: { validate: I("Expression") }
|
|
1762
|
+
},
|
|
1763
|
+
unionShape: {
|
|
1764
|
+
discriminator: "operator",
|
|
1765
|
+
shapes: [{
|
|
1766
|
+
name: "in",
|
|
1767
|
+
value: ["in"],
|
|
1768
|
+
properties: { left: { validate: I("Expression", "PrivateName") } }
|
|
1769
|
+
}, {
|
|
1770
|
+
name: "notIn",
|
|
1771
|
+
value: Le.filter((e) => e !== "in"),
|
|
1772
|
+
properties: { left: { validate: I("Expression") } }
|
|
1773
|
+
}]
|
|
1774
|
+
},
|
|
1775
|
+
visitor: ["left", "right"],
|
|
1776
|
+
aliases: ["Binary", "Expression"]
|
|
1777
|
+
}), H("InterpreterDirective", {
|
|
1778
|
+
builder: ["value"],
|
|
1779
|
+
fields: { value: { validate: L("string") } }
|
|
1780
|
+
}), H("Directive", {
|
|
1781
|
+
visitor: ["value"],
|
|
1782
|
+
fields: { value: { validate: I("DirectiveLiteral") } }
|
|
1783
|
+
}), H("DirectiveLiteral", {
|
|
1784
|
+
builder: ["value"],
|
|
1785
|
+
fields: { value: { validate: L("string") } }
|
|
1786
|
+
}), H("BlockStatement", {
|
|
1787
|
+
builder: ["body", "directives"],
|
|
1788
|
+
visitor: ["directives", "body"],
|
|
1789
|
+
fields: {
|
|
1790
|
+
directives: {
|
|
1791
|
+
validate: M("Directive"),
|
|
1792
|
+
default: []
|
|
1793
|
+
},
|
|
1794
|
+
body: N("Statement")
|
|
1795
|
+
},
|
|
1796
|
+
aliases: [
|
|
1797
|
+
"Scopable",
|
|
1798
|
+
"BlockParent",
|
|
1799
|
+
"Block",
|
|
1800
|
+
"Statement"
|
|
1801
|
+
]
|
|
1802
|
+
}), H("BreakStatement", {
|
|
1803
|
+
visitor: ["label"],
|
|
1804
|
+
fields: { label: {
|
|
1805
|
+
validate: I("Identifier"),
|
|
1806
|
+
optional: !0
|
|
1807
|
+
} },
|
|
1808
|
+
aliases: [
|
|
1809
|
+
"Statement",
|
|
1810
|
+
"Terminatorless",
|
|
1811
|
+
"CompletionStatement"
|
|
1812
|
+
]
|
|
1813
|
+
}), H("CallExpression", {
|
|
1814
|
+
visitor: [
|
|
1815
|
+
"callee",
|
|
1816
|
+
"typeArguments",
|
|
1817
|
+
"arguments"
|
|
1818
|
+
],
|
|
1819
|
+
builder: ["callee", "arguments"],
|
|
1820
|
+
aliases: ["Expression"],
|
|
1821
|
+
fields: {
|
|
1822
|
+
callee: { validate: I("Expression", "Super", "Import", "V8IntrinsicIdentifier") },
|
|
1823
|
+
arguments: N("Expression", "SpreadElement", "ArgumentPlaceholder"),
|
|
1824
|
+
typeArguments: {
|
|
1825
|
+
validate: I("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
|
|
1826
|
+
optional: !0
|
|
1827
|
+
}
|
|
1828
|
+
}
|
|
1829
|
+
}), H("CatchClause", {
|
|
1830
|
+
visitor: ["param", "body"],
|
|
1831
|
+
fields: {
|
|
1832
|
+
param: {
|
|
1833
|
+
validate: I("Identifier", "ArrayPattern", "ObjectPattern"),
|
|
1834
|
+
optional: !0
|
|
1835
|
+
},
|
|
1836
|
+
body: { validate: I("BlockStatement") }
|
|
1837
|
+
},
|
|
1838
|
+
aliases: ["Scopable", "BlockParent"]
|
|
1839
|
+
}), H("ConditionalExpression", {
|
|
1840
|
+
visitor: [
|
|
1841
|
+
"test",
|
|
1842
|
+
"consequent",
|
|
1843
|
+
"alternate"
|
|
1844
|
+
],
|
|
1845
|
+
fields: {
|
|
1846
|
+
test: { validate: I("Expression") },
|
|
1847
|
+
consequent: { validate: I("Expression") },
|
|
1848
|
+
alternate: { validate: I("Expression") }
|
|
1849
|
+
},
|
|
1850
|
+
aliases: ["Expression", "Conditional"]
|
|
1851
|
+
}), H("ContinueStatement", {
|
|
1852
|
+
visitor: ["label"],
|
|
1853
|
+
fields: { label: {
|
|
1854
|
+
validate: I("Identifier"),
|
|
1855
|
+
optional: !0
|
|
1856
|
+
} },
|
|
1857
|
+
aliases: [
|
|
1858
|
+
"Statement",
|
|
1859
|
+
"Terminatorless",
|
|
1860
|
+
"CompletionStatement"
|
|
1861
|
+
]
|
|
1862
|
+
}), H("DebuggerStatement", { aliases: ["Statement"] }), H("DoWhileStatement", {
|
|
1863
|
+
builder: ["test", "body"],
|
|
1864
|
+
visitor: ["body", "test"],
|
|
1865
|
+
fields: {
|
|
1866
|
+
test: { validate: I("Expression") },
|
|
1867
|
+
body: { validate: I("Statement") }
|
|
1868
|
+
},
|
|
1869
|
+
aliases: [
|
|
1870
|
+
"Statement",
|
|
1871
|
+
"BlockParent",
|
|
1872
|
+
"Loop",
|
|
1873
|
+
"While",
|
|
1874
|
+
"Scopable"
|
|
1875
|
+
]
|
|
1876
|
+
}), H("EmptyStatement", { aliases: ["Statement"] }), H("ExpressionStatement", {
|
|
1877
|
+
visitor: ["expression"],
|
|
1878
|
+
fields: { expression: { validate: I("Expression") } },
|
|
1879
|
+
aliases: ["Statement", "ExpressionWrapper"]
|
|
1880
|
+
}), H("File", {
|
|
1881
|
+
builder: [
|
|
1882
|
+
"program",
|
|
1883
|
+
"comments",
|
|
1884
|
+
"tokens"
|
|
1885
|
+
],
|
|
1886
|
+
visitor: ["program"],
|
|
1887
|
+
fields: {
|
|
1888
|
+
program: { validate: I("Program") },
|
|
1889
|
+
comments: {
|
|
1890
|
+
validate: P(I("CommentBlock", "CommentLine")),
|
|
1891
|
+
optional: !0
|
|
1892
|
+
},
|
|
1893
|
+
tokens: {
|
|
1894
|
+
validate: P(Object.assign(() => {}, { type: "any" })),
|
|
1895
|
+
optional: !0
|
|
1896
|
+
}
|
|
1897
|
+
}
|
|
1898
|
+
}), H("ForInStatement", {
|
|
1899
|
+
visitor: [
|
|
1900
|
+
"left",
|
|
1901
|
+
"right",
|
|
1902
|
+
"body"
|
|
1903
|
+
],
|
|
1904
|
+
aliases: [
|
|
1905
|
+
"Scopable",
|
|
1906
|
+
"Statement",
|
|
1907
|
+
"For",
|
|
1908
|
+
"BlockParent",
|
|
1909
|
+
"Loop",
|
|
1910
|
+
"ForXStatement"
|
|
1911
|
+
],
|
|
1912
|
+
fields: {
|
|
1913
|
+
left: { validate: I("VariableDeclaration", "Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern", "TSAsExpression", "TSSatisfiesExpression", "TSTypeAssertion", "TSNonNullExpression") },
|
|
1914
|
+
right: { validate: I("Expression") },
|
|
1915
|
+
body: { validate: I("Statement") }
|
|
1916
|
+
}
|
|
1917
|
+
}), H("ForStatement", {
|
|
1918
|
+
visitor: [
|
|
1919
|
+
"init",
|
|
1920
|
+
"test",
|
|
1921
|
+
"update",
|
|
1922
|
+
"body"
|
|
1923
|
+
],
|
|
1924
|
+
aliases: [
|
|
1925
|
+
"Scopable",
|
|
1926
|
+
"Statement",
|
|
1927
|
+
"For",
|
|
1928
|
+
"BlockParent",
|
|
1929
|
+
"Loop"
|
|
1930
|
+
],
|
|
1931
|
+
fields: {
|
|
1932
|
+
init: {
|
|
1933
|
+
validate: I("VariableDeclaration", "Expression"),
|
|
1934
|
+
optional: !0
|
|
1935
|
+
},
|
|
1936
|
+
test: {
|
|
1937
|
+
validate: I("Expression"),
|
|
1938
|
+
optional: !0
|
|
1939
|
+
},
|
|
1940
|
+
update: {
|
|
1941
|
+
validate: I("Expression"),
|
|
1942
|
+
optional: !0
|
|
1943
|
+
},
|
|
1944
|
+
body: { validate: I("Statement") }
|
|
1945
|
+
}
|
|
1946
|
+
});
|
|
1947
|
+
var st = () => ({
|
|
1948
|
+
params: N("FunctionParameter"),
|
|
1949
|
+
generator: { default: !1 },
|
|
1950
|
+
async: { default: !1 }
|
|
1951
|
+
}), ct = () => ({
|
|
1952
|
+
returnType: {
|
|
1953
|
+
validate: I("TypeAnnotation", "TSTypeAnnotation"),
|
|
1954
|
+
optional: !0
|
|
1955
|
+
},
|
|
1956
|
+
typeParameters: {
|
|
1957
|
+
validate: I("TypeParameterDeclaration", "TSTypeParameterDeclaration"),
|
|
1958
|
+
optional: !0
|
|
1959
|
+
}
|
|
1960
|
+
}), lt = () => ({
|
|
1961
|
+
...st(),
|
|
1962
|
+
declare: {
|
|
1963
|
+
validate: L("boolean"),
|
|
1964
|
+
optional: !0
|
|
1965
|
+
},
|
|
1966
|
+
id: {
|
|
1967
|
+
validate: I("Identifier"),
|
|
1968
|
+
optional: !0
|
|
1969
|
+
}
|
|
1970
|
+
});
|
|
1971
|
+
H("FunctionDeclaration", {
|
|
1972
|
+
builder: [
|
|
1973
|
+
"id",
|
|
1974
|
+
"params",
|
|
1975
|
+
"body",
|
|
1976
|
+
"generator",
|
|
1977
|
+
"async"
|
|
1978
|
+
],
|
|
1979
|
+
visitor: [
|
|
1980
|
+
"id",
|
|
1981
|
+
"typeParameters",
|
|
1982
|
+
"params",
|
|
1983
|
+
"predicate",
|
|
1984
|
+
"returnType",
|
|
1985
|
+
"body"
|
|
1986
|
+
],
|
|
1987
|
+
fields: {
|
|
1988
|
+
...lt(),
|
|
1989
|
+
...ct(),
|
|
1990
|
+
body: { validate: I("BlockStatement") },
|
|
1991
|
+
predicate: {
|
|
1992
|
+
validate: I("FlowPredicate"),
|
|
1993
|
+
optional: !0
|
|
1994
|
+
}
|
|
1995
|
+
},
|
|
1996
|
+
aliases: [
|
|
1997
|
+
"Scopable",
|
|
1998
|
+
"Function",
|
|
1999
|
+
"BlockParent",
|
|
2000
|
+
"FunctionParent",
|
|
2001
|
+
"Statement",
|
|
2002
|
+
"Pureish",
|
|
2003
|
+
"Declaration"
|
|
2004
|
+
],
|
|
2005
|
+
validate: function() {
|
|
2006
|
+
let e = I("Identifier");
|
|
2007
|
+
return function(t, n, r) {
|
|
2008
|
+
w("ExportDefaultDeclaration", t) || e(r, "id", r.id);
|
|
2009
|
+
};
|
|
2010
|
+
}()
|
|
2011
|
+
}), H("FunctionExpression", {
|
|
2012
|
+
inherits: "FunctionDeclaration",
|
|
2013
|
+
aliases: [
|
|
2014
|
+
"Scopable",
|
|
2015
|
+
"Function",
|
|
2016
|
+
"BlockParent",
|
|
2017
|
+
"FunctionParent",
|
|
2018
|
+
"Expression",
|
|
2019
|
+
"Pureish"
|
|
2020
|
+
],
|
|
2021
|
+
fields: {
|
|
2022
|
+
...st(),
|
|
2023
|
+
...ct(),
|
|
2024
|
+
id: {
|
|
2025
|
+
validate: I("Identifier"),
|
|
2026
|
+
optional: !0
|
|
2027
|
+
},
|
|
2028
|
+
body: { validate: I("BlockStatement") },
|
|
2029
|
+
predicate: {
|
|
2030
|
+
validate: I("FlowPredicate"),
|
|
2031
|
+
optional: !0
|
|
2032
|
+
}
|
|
2033
|
+
}
|
|
2034
|
+
});
|
|
2035
|
+
var ut = () => ({
|
|
2036
|
+
typeAnnotation: {
|
|
2037
|
+
validate: I("TypeAnnotation", "TSTypeAnnotation"),
|
|
2038
|
+
optional: !0
|
|
2039
|
+
},
|
|
2040
|
+
optional: {
|
|
2041
|
+
validate: L("boolean"),
|
|
2042
|
+
optional: !0
|
|
2043
|
+
},
|
|
2044
|
+
decorators: {
|
|
2045
|
+
validate: M("Decorator"),
|
|
2046
|
+
optional: !0
|
|
2047
|
+
}
|
|
2048
|
+
});
|
|
2049
|
+
H("Identifier", {
|
|
2050
|
+
builder: ["name"],
|
|
2051
|
+
visitor: ["typeAnnotation", "decorators"],
|
|
2052
|
+
aliases: [
|
|
2053
|
+
"Expression",
|
|
2054
|
+
"FunctionParameter",
|
|
2055
|
+
"PatternLike",
|
|
2056
|
+
"LVal",
|
|
2057
|
+
"TSEntityName"
|
|
2058
|
+
],
|
|
2059
|
+
fields: {
|
|
2060
|
+
...ut(),
|
|
2061
|
+
name: { validate: R(L("string"), E(function(e, t, n) {
|
|
2062
|
+
if (!je(n, !1)) throw TypeError(`"${n}" is not a valid identifier name`);
|
|
2063
|
+
}, { type: "string" })) }
|
|
2064
|
+
},
|
|
2065
|
+
validate: function(e, t, n) {
|
|
2066
|
+
let r = /\.(\w+)$/.exec(t.toString());
|
|
2067
|
+
if (!r) return;
|
|
2068
|
+
let [, i] = r, a = { computed: !1 };
|
|
2069
|
+
if (i === "property") {
|
|
2070
|
+
if (w("MemberExpression", e, a) || w("OptionalMemberExpression", e, a)) return;
|
|
2071
|
+
} else if (i === "key") {
|
|
2072
|
+
if (w("Property", e, a) || w("Method", e, a)) return;
|
|
2073
|
+
} else if (i === "exported") {
|
|
2074
|
+
if (w("ExportSpecifier", e)) return;
|
|
2075
|
+
} else if (i === "imported") {
|
|
2076
|
+
if (w("ImportSpecifier", e, { imported: n })) return;
|
|
2077
|
+
} else if (i === "meta" && w("MetaProperty", e, { meta: n })) return;
|
|
2078
|
+
if ((ee(n.name) || p(n.name, !1)) && n.name !== "this") throw TypeError(`"${n.name}" is not a valid identifier`);
|
|
2079
|
+
}
|
|
2080
|
+
}), H("IfStatement", {
|
|
2081
|
+
visitor: [
|
|
2082
|
+
"test",
|
|
2083
|
+
"consequent",
|
|
2084
|
+
"alternate"
|
|
2085
|
+
],
|
|
2086
|
+
aliases: ["Statement", "Conditional"],
|
|
2087
|
+
fields: {
|
|
2088
|
+
test: { validate: I("Expression") },
|
|
2089
|
+
consequent: { validate: I("Statement") },
|
|
2090
|
+
alternate: {
|
|
2091
|
+
optional: !0,
|
|
2092
|
+
validate: I("Statement")
|
|
2093
|
+
}
|
|
2094
|
+
}
|
|
2095
|
+
}), H("LabeledStatement", {
|
|
2096
|
+
visitor: ["label", "body"],
|
|
2097
|
+
aliases: ["Statement"],
|
|
2098
|
+
fields: {
|
|
2099
|
+
label: { validate: I("Identifier") },
|
|
2100
|
+
body: { validate: I("Statement") }
|
|
2101
|
+
}
|
|
2102
|
+
}), H("StringLiteral", {
|
|
2103
|
+
builder: ["value"],
|
|
2104
|
+
fields: { value: { validate: L("string") } },
|
|
2105
|
+
aliases: [
|
|
2106
|
+
"Expression",
|
|
2107
|
+
"Pureish",
|
|
2108
|
+
"Literal",
|
|
2109
|
+
"Immutable"
|
|
2110
|
+
]
|
|
2111
|
+
}), H("NumericLiteral", {
|
|
2112
|
+
builder: ["value"],
|
|
2113
|
+
deprecatedAlias: "NumberLiteral",
|
|
2114
|
+
fields: { value: { validate: R(L("number"), E(function(e, t, n) {
|
|
2115
|
+
if (1 / n < 0 || !Number.isFinite(n)) {
|
|
2116
|
+
let e = /* @__PURE__ */ Error(`NumericLiterals must be non-negative finite numbers. You can use t.valueToNode(${n}) instead.`);
|
|
2117
|
+
if (!(/* @__PURE__ */ Error()).stack.includes("regenerator")) throw e;
|
|
2118
|
+
}
|
|
2119
|
+
}, { type: "number" })) } },
|
|
2120
|
+
aliases: [
|
|
2121
|
+
"Expression",
|
|
2122
|
+
"Pureish",
|
|
2123
|
+
"Literal",
|
|
2124
|
+
"Immutable"
|
|
2125
|
+
]
|
|
2126
|
+
}), H("NullLiteral", { aliases: [
|
|
2127
|
+
"Expression",
|
|
2128
|
+
"Pureish",
|
|
2129
|
+
"Literal",
|
|
2130
|
+
"Immutable"
|
|
2131
|
+
] }), H("BooleanLiteral", {
|
|
2132
|
+
builder: ["value"],
|
|
2133
|
+
fields: { value: { validate: L("boolean") } },
|
|
2134
|
+
aliases: [
|
|
2135
|
+
"Expression",
|
|
2136
|
+
"Pureish",
|
|
2137
|
+
"Literal",
|
|
2138
|
+
"Immutable"
|
|
2139
|
+
]
|
|
2140
|
+
}), H("RegExpLiteral", {
|
|
2141
|
+
builder: ["pattern", "flags"],
|
|
2142
|
+
deprecatedAlias: "RegexLiteral",
|
|
2143
|
+
aliases: [
|
|
2144
|
+
"Expression",
|
|
2145
|
+
"Pureish",
|
|
2146
|
+
"Literal"
|
|
2147
|
+
],
|
|
2148
|
+
fields: {
|
|
2149
|
+
pattern: { validate: L("string") },
|
|
2150
|
+
flags: {
|
|
2151
|
+
validate: R(L("string"), E(function(e, t, n) {
|
|
2152
|
+
let r = /[^dgimsuvy]/.exec(n);
|
|
2153
|
+
if (r) throw TypeError(`"${r[0]}" is not a valid RegExp flag`);
|
|
2154
|
+
}, { type: "string" })),
|
|
2155
|
+
default: ""
|
|
2156
|
+
}
|
|
2157
|
+
}
|
|
2158
|
+
}), H("LogicalExpression", {
|
|
2159
|
+
builder: [
|
|
2160
|
+
"operator",
|
|
2161
|
+
"left",
|
|
2162
|
+
"right"
|
|
2163
|
+
],
|
|
2164
|
+
visitor: ["left", "right"],
|
|
2165
|
+
aliases: ["Binary", "Expression"],
|
|
2166
|
+
fields: {
|
|
2167
|
+
operator: { validate: F(...Ne) },
|
|
2168
|
+
left: { validate: I("Expression") },
|
|
2169
|
+
right: { validate: I("Expression") }
|
|
2170
|
+
}
|
|
2171
|
+
}), H("MemberExpression", {
|
|
2172
|
+
builder: [
|
|
2173
|
+
"object",
|
|
2174
|
+
"property",
|
|
2175
|
+
"computed"
|
|
2176
|
+
],
|
|
2177
|
+
visitor: ["object", "property"],
|
|
2178
|
+
aliases: [
|
|
2179
|
+
"Expression",
|
|
2180
|
+
"LVal",
|
|
2181
|
+
"PatternLike"
|
|
2182
|
+
],
|
|
2183
|
+
...ot,
|
|
2184
|
+
fields: {
|
|
2185
|
+
object: { validate: I("Expression", "Super") },
|
|
2186
|
+
property: { validate: function() {
|
|
2187
|
+
let e = I("Identifier", "PrivateName"), t = I("Expression");
|
|
2188
|
+
return E(function(n, r, i) {
|
|
2189
|
+
(n.computed ? t : e)(n, r, i);
|
|
2190
|
+
}, { oneOfNodeTypes: [
|
|
2191
|
+
"Expression",
|
|
2192
|
+
"Identifier",
|
|
2193
|
+
"PrivateName"
|
|
2194
|
+
] });
|
|
2195
|
+
}() },
|
|
2196
|
+
computed: { default: !1 }
|
|
2197
|
+
}
|
|
2198
|
+
}), H("NewExpression", {
|
|
2199
|
+
inherits: "CallExpression",
|
|
2200
|
+
fields: {
|
|
2201
|
+
callee: { validate: I("Expression", "V8IntrinsicIdentifier") },
|
|
2202
|
+
arguments: N("Expression", "SpreadElement", "ArgumentPlaceholder"),
|
|
2203
|
+
typeArguments: {
|
|
2204
|
+
validate: I("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
|
|
2205
|
+
optional: !0
|
|
2206
|
+
}
|
|
2207
|
+
}
|
|
2208
|
+
}), H("Program", {
|
|
2209
|
+
visitor: ["directives", "body"],
|
|
2210
|
+
builder: [
|
|
2211
|
+
"body",
|
|
2212
|
+
"directives",
|
|
2213
|
+
"sourceType",
|
|
2214
|
+
"interpreter"
|
|
2215
|
+
],
|
|
2216
|
+
fields: {
|
|
2217
|
+
sourceType: {
|
|
2218
|
+
validate: F("script", "module"),
|
|
2219
|
+
default: "script"
|
|
2220
|
+
},
|
|
2221
|
+
interpreter: {
|
|
2222
|
+
validate: I("InterpreterDirective"),
|
|
2223
|
+
default: null,
|
|
2224
|
+
optional: !0
|
|
2225
|
+
},
|
|
2226
|
+
directives: {
|
|
2227
|
+
validate: M("Directive"),
|
|
2228
|
+
default: []
|
|
2229
|
+
},
|
|
2230
|
+
body: N("Statement")
|
|
2231
|
+
},
|
|
2232
|
+
aliases: [
|
|
2233
|
+
"Scopable",
|
|
2234
|
+
"BlockParent",
|
|
2235
|
+
"Block"
|
|
2236
|
+
]
|
|
2237
|
+
}), H("ObjectExpression", {
|
|
2238
|
+
visitor: ["properties"],
|
|
2239
|
+
aliases: ["Expression"],
|
|
2240
|
+
fields: { properties: N("ObjectMethod", "ObjectProperty", "SpreadElement") }
|
|
2241
|
+
}), H("ObjectMethod", {
|
|
2242
|
+
builder: [
|
|
2243
|
+
"kind",
|
|
2244
|
+
"key",
|
|
2245
|
+
"params",
|
|
2246
|
+
"body",
|
|
2247
|
+
"computed",
|
|
2248
|
+
"generator",
|
|
2249
|
+
"async"
|
|
2250
|
+
],
|
|
2251
|
+
visitor: [
|
|
2252
|
+
"decorators",
|
|
2253
|
+
"key",
|
|
2254
|
+
"typeParameters",
|
|
2255
|
+
"params",
|
|
2256
|
+
"returnType",
|
|
2257
|
+
"body"
|
|
2258
|
+
],
|
|
2259
|
+
...V(),
|
|
2260
|
+
fields: {
|
|
2261
|
+
...st(),
|
|
2262
|
+
...ct(),
|
|
2263
|
+
kind: { validate: F("method", "get", "set") },
|
|
2264
|
+
computed: { default: !1 },
|
|
2265
|
+
key: { validate: function() {
|
|
2266
|
+
let e = I("Identifier", "StringLiteral", "NumericLiteral", "BigIntLiteral"), t = I("Expression");
|
|
2267
|
+
return E(function(n, r, i) {
|
|
2268
|
+
(n.computed ? t : e)(n, r, i);
|
|
2269
|
+
}, { oneOfNodeTypes: [
|
|
2270
|
+
"Expression",
|
|
2271
|
+
"Identifier",
|
|
2272
|
+
"StringLiteral",
|
|
2273
|
+
"NumericLiteral",
|
|
2274
|
+
"BigIntLiteral"
|
|
2275
|
+
] });
|
|
2276
|
+
}() },
|
|
2277
|
+
decorators: {
|
|
2278
|
+
validate: M("Decorator"),
|
|
2279
|
+
optional: !0
|
|
2280
|
+
},
|
|
2281
|
+
body: { validate: I("BlockStatement") }
|
|
2282
|
+
},
|
|
2283
|
+
aliases: [
|
|
2284
|
+
"UserWhitespacable",
|
|
2285
|
+
"Function",
|
|
2286
|
+
"Scopable",
|
|
2287
|
+
"BlockParent",
|
|
2288
|
+
"FunctionParent",
|
|
2289
|
+
"Method",
|
|
2290
|
+
"ObjectMember"
|
|
2291
|
+
]
|
|
2292
|
+
}), H("ObjectProperty", {
|
|
2293
|
+
builder: [
|
|
2294
|
+
"key",
|
|
2295
|
+
"value",
|
|
2296
|
+
"computed",
|
|
2297
|
+
"shorthand"
|
|
2298
|
+
],
|
|
2299
|
+
...V(!0),
|
|
2300
|
+
fields: {
|
|
2301
|
+
computed: { default: !1 },
|
|
2302
|
+
key: { validate: function() {
|
|
2303
|
+
let e = I("Identifier", "StringLiteral", "NumericLiteral", "BigIntLiteral", "PrivateName"), t = I("Expression");
|
|
2304
|
+
return E(function(n, r, i) {
|
|
2305
|
+
(n.computed ? t : e)(n, r, i);
|
|
2306
|
+
}, { oneOfNodeTypes: [
|
|
2307
|
+
"Expression",
|
|
2308
|
+
"Identifier",
|
|
2309
|
+
"StringLiteral",
|
|
2310
|
+
"NumericLiteral",
|
|
2311
|
+
"BigIntLiteral",
|
|
2312
|
+
"PrivateName"
|
|
2313
|
+
] });
|
|
2314
|
+
}() },
|
|
2315
|
+
value: { validate: I("Expression", "PatternLike") },
|
|
2316
|
+
shorthand: {
|
|
2317
|
+
validate: R(L("boolean"), E(function(e, t, n) {
|
|
2318
|
+
if (n) {
|
|
2319
|
+
if (e.computed) throw TypeError("Property shorthand of ObjectProperty cannot be true if computed is true");
|
|
2320
|
+
if (!w("Identifier", e.key)) throw TypeError("Property shorthand of ObjectProperty cannot be true if key is not an Identifier");
|
|
2321
|
+
}
|
|
2322
|
+
}, { type: "boolean" })),
|
|
2323
|
+
default: !1
|
|
2324
|
+
},
|
|
2325
|
+
decorators: {
|
|
2326
|
+
validate: M("Decorator"),
|
|
2327
|
+
optional: !0
|
|
2328
|
+
}
|
|
2329
|
+
},
|
|
2330
|
+
visitor: [
|
|
2331
|
+
"decorators",
|
|
2332
|
+
"key",
|
|
2333
|
+
"value"
|
|
2334
|
+
],
|
|
2335
|
+
aliases: [
|
|
2336
|
+
"UserWhitespacable",
|
|
2337
|
+
"Property",
|
|
2338
|
+
"ObjectMember"
|
|
2339
|
+
],
|
|
2340
|
+
validate: function() {
|
|
2341
|
+
let e = I("Identifier", "Pattern", "TSAsExpression", "TSSatisfiesExpression", "TSNonNullExpression", "TSTypeAssertion"), t = I("Expression");
|
|
2342
|
+
return function(n, r, i) {
|
|
2343
|
+
(w("ObjectPattern", n) ? e : t)(i, "value", i.value);
|
|
2344
|
+
};
|
|
2345
|
+
}()
|
|
2346
|
+
}), H("RestElement", {
|
|
2347
|
+
visitor: ["argument", "typeAnnotation"],
|
|
2348
|
+
builder: ["argument"],
|
|
2349
|
+
aliases: ["FunctionParameter", "PatternLike"],
|
|
2350
|
+
deprecatedAlias: "RestProperty",
|
|
2351
|
+
fields: {
|
|
2352
|
+
...ut(),
|
|
2353
|
+
argument: { validate: I("Identifier", "ArrayPattern", "ObjectPattern", "MemberExpression", "TSAsExpression", "TSSatisfiesExpression", "TSTypeAssertion", "TSNonNullExpression") }
|
|
2354
|
+
},
|
|
2355
|
+
validate: function(e, t) {
|
|
2356
|
+
let n = /(\w+)\[(\d+)\]/.exec(t.toString());
|
|
2357
|
+
if (!n) throw Error("Internal Babel error: malformed key.");
|
|
2358
|
+
let [, r, i] = n;
|
|
2359
|
+
if (e[r].length > +i + 1) throw TypeError(`RestElement must be last element of ${r}`);
|
|
2360
|
+
}
|
|
2361
|
+
}), H("ReturnStatement", {
|
|
2362
|
+
visitor: ["argument"],
|
|
2363
|
+
aliases: [
|
|
2364
|
+
"Statement",
|
|
2365
|
+
"Terminatorless",
|
|
2366
|
+
"CompletionStatement"
|
|
2367
|
+
],
|
|
2368
|
+
fields: { argument: {
|
|
2369
|
+
validate: I("Expression"),
|
|
2370
|
+
optional: !0
|
|
2371
|
+
} }
|
|
2372
|
+
}), H("SequenceExpression", {
|
|
2373
|
+
visitor: ["expressions"],
|
|
2374
|
+
fields: { expressions: N("Expression") },
|
|
2375
|
+
aliases: ["Expression"]
|
|
2376
|
+
}), H("ParenthesizedExpression", {
|
|
2377
|
+
visitor: ["expression"],
|
|
2378
|
+
aliases: ["Expression", "ExpressionWrapper"],
|
|
2379
|
+
fields: { expression: { validate: I("Expression") } }
|
|
2380
|
+
}), H("SwitchCase", {
|
|
2381
|
+
visitor: ["test", "consequent"],
|
|
2382
|
+
fields: {
|
|
2383
|
+
test: {
|
|
2384
|
+
validate: I("Expression"),
|
|
2385
|
+
optional: !0
|
|
2386
|
+
},
|
|
2387
|
+
consequent: N("Statement")
|
|
2388
|
+
}
|
|
2389
|
+
}), H("SwitchStatement", {
|
|
2390
|
+
visitor: ["discriminant", "cases"],
|
|
2391
|
+
aliases: [
|
|
2392
|
+
"Statement",
|
|
2393
|
+
"BlockParent",
|
|
2394
|
+
"Scopable"
|
|
2395
|
+
],
|
|
2396
|
+
fields: {
|
|
2397
|
+
discriminant: { validate: I("Expression") },
|
|
2398
|
+
cases: N("SwitchCase")
|
|
2399
|
+
}
|
|
2400
|
+
}), H("ThisExpression", { aliases: ["Expression", "TSEntityName"] }), H("ThrowStatement", {
|
|
2401
|
+
visitor: ["argument"],
|
|
2402
|
+
aliases: [
|
|
2403
|
+
"Statement",
|
|
2404
|
+
"Terminatorless",
|
|
2405
|
+
"CompletionStatement"
|
|
2406
|
+
],
|
|
2407
|
+
fields: { argument: { validate: I("Expression") } }
|
|
2408
|
+
}), H("TryStatement", {
|
|
2409
|
+
visitor: [
|
|
2410
|
+
"block",
|
|
2411
|
+
"handler",
|
|
2412
|
+
"finalizer"
|
|
2413
|
+
],
|
|
2414
|
+
aliases: ["Statement"],
|
|
2415
|
+
fields: {
|
|
2416
|
+
block: { validate: R(I("BlockStatement"), E(function(e) {
|
|
2417
|
+
if (!e.handler && !e.finalizer) throw TypeError("TryStatement expects either a handler or finalizer, or both");
|
|
2418
|
+
}, { oneOfNodeTypes: ["BlockStatement"] })) },
|
|
2419
|
+
handler: {
|
|
2420
|
+
optional: !0,
|
|
2421
|
+
validate: I("CatchClause")
|
|
2422
|
+
},
|
|
2423
|
+
finalizer: {
|
|
2424
|
+
optional: !0,
|
|
2425
|
+
validate: I("BlockStatement")
|
|
2426
|
+
}
|
|
2427
|
+
}
|
|
2428
|
+
}), H("UnaryExpression", {
|
|
2429
|
+
builder: [
|
|
2430
|
+
"operator",
|
|
2431
|
+
"argument",
|
|
2432
|
+
"prefix"
|
|
2433
|
+
],
|
|
2434
|
+
fields: {
|
|
2435
|
+
prefix: { default: !0 },
|
|
2436
|
+
argument: { validate: I("Expression") },
|
|
2437
|
+
operator: { validate: F(...He) }
|
|
2438
|
+
},
|
|
2439
|
+
visitor: ["argument"],
|
|
2440
|
+
aliases: ["UnaryLike", "Expression"]
|
|
2441
|
+
}), H("UpdateExpression", {
|
|
2442
|
+
builder: [
|
|
2443
|
+
"operator",
|
|
2444
|
+
"argument",
|
|
2445
|
+
"prefix"
|
|
2446
|
+
],
|
|
2447
|
+
fields: {
|
|
2448
|
+
prefix: { default: !1 },
|
|
2449
|
+
argument: { validate: I("Identifier", "MemberExpression") },
|
|
2450
|
+
operator: { validate: F(...Pe) }
|
|
2451
|
+
},
|
|
2452
|
+
visitor: ["argument"],
|
|
2453
|
+
aliases: ["Expression"]
|
|
2454
|
+
}), H("VariableDeclaration", {
|
|
2455
|
+
builder: ["kind", "declarations"],
|
|
2456
|
+
visitor: ["declarations"],
|
|
2457
|
+
aliases: ["Statement", "Declaration"],
|
|
2458
|
+
fields: {
|
|
2459
|
+
declare: {
|
|
2460
|
+
validate: L("boolean"),
|
|
2461
|
+
optional: !0
|
|
2462
|
+
},
|
|
2463
|
+
kind: { validate: F("var", "let", "const", "using", "await using") },
|
|
2464
|
+
declarations: N("VariableDeclarator")
|
|
2465
|
+
},
|
|
2466
|
+
validate: (() => {
|
|
2467
|
+
let e = I("Identifier", "Placeholder"), t = I("Identifier", "ArrayPattern", "ObjectPattern", "Placeholder"), n = I("Identifier", "VoidPattern", "Placeholder");
|
|
2468
|
+
return function(r, i, a) {
|
|
2469
|
+
let { kind: o, declarations: s } = a, c = w("ForXStatement", r, { left: a });
|
|
2470
|
+
if (c && s.length !== 1) throw TypeError(`Exactly one VariableDeclarator is required in the VariableDeclaration of a ${r.type}`);
|
|
2471
|
+
for (let r of s) o === "const" || o === "let" || o === "var" ? !c && !r.init ? e(r, "id", r.id) : t(r, "id", r.id) : n(r, "id", r.id);
|
|
2472
|
+
};
|
|
2473
|
+
})()
|
|
2474
|
+
}), H("VariableDeclarator", {
|
|
2475
|
+
visitor: ["id", "init"],
|
|
2476
|
+
fields: {
|
|
2477
|
+
id: { validate: I("Identifier", "ArrayPattern", "ObjectPattern", "VoidPattern") },
|
|
2478
|
+
definite: {
|
|
2479
|
+
optional: !0,
|
|
2480
|
+
validate: L("boolean")
|
|
2481
|
+
},
|
|
2482
|
+
init: {
|
|
2483
|
+
optional: !0,
|
|
2484
|
+
validate: I("Expression")
|
|
2485
|
+
}
|
|
2486
|
+
}
|
|
2487
|
+
}), H("WhileStatement", {
|
|
2488
|
+
visitor: ["test", "body"],
|
|
2489
|
+
aliases: [
|
|
2490
|
+
"Statement",
|
|
2491
|
+
"BlockParent",
|
|
2492
|
+
"Loop",
|
|
2493
|
+
"While",
|
|
2494
|
+
"Scopable"
|
|
2495
|
+
],
|
|
2496
|
+
fields: {
|
|
2497
|
+
test: { validate: I("Expression") },
|
|
2498
|
+
body: { validate: I("Statement") }
|
|
2499
|
+
}
|
|
2500
|
+
}), H("WithStatement", {
|
|
2501
|
+
visitor: ["object", "body"],
|
|
2502
|
+
aliases: ["Statement"],
|
|
2503
|
+
fields: {
|
|
2504
|
+
object: { validate: I("Expression") },
|
|
2505
|
+
body: { validate: I("Statement") }
|
|
2506
|
+
}
|
|
2507
|
+
}), H("AssignmentPattern", {
|
|
2508
|
+
visitor: [
|
|
2509
|
+
"left",
|
|
2510
|
+
"right",
|
|
2511
|
+
"decorators"
|
|
2512
|
+
],
|
|
2513
|
+
builder: ["left", "right"],
|
|
2514
|
+
aliases: [
|
|
2515
|
+
"FunctionParameter",
|
|
2516
|
+
"Pattern",
|
|
2517
|
+
"PatternLike"
|
|
2518
|
+
],
|
|
2519
|
+
fields: {
|
|
2520
|
+
...ut(),
|
|
2521
|
+
left: { validate: I("Identifier", "ObjectPattern", "ArrayPattern", "MemberExpression", "TSAsExpression", "TSSatisfiesExpression", "TSTypeAssertion", "TSNonNullExpression") },
|
|
2522
|
+
right: { validate: I("Expression") }
|
|
2523
|
+
}
|
|
2524
|
+
}), H("ArrayPattern", {
|
|
2525
|
+
visitor: ["elements", "typeAnnotation"],
|
|
2526
|
+
builder: ["elements"],
|
|
2527
|
+
aliases: [
|
|
2528
|
+
"FunctionParameter",
|
|
2529
|
+
"Pattern",
|
|
2530
|
+
"PatternLike",
|
|
2531
|
+
"LVal"
|
|
2532
|
+
],
|
|
2533
|
+
fields: {
|
|
2534
|
+
...ut(),
|
|
2535
|
+
elements: { validate: R(L("array"), P($e("null", "PatternLike"))) }
|
|
2536
|
+
}
|
|
2537
|
+
}), H("ArrowFunctionExpression", {
|
|
2538
|
+
builder: [
|
|
2539
|
+
"params",
|
|
2540
|
+
"body",
|
|
2541
|
+
"async"
|
|
2542
|
+
],
|
|
2543
|
+
visitor: [
|
|
2544
|
+
"typeParameters",
|
|
2545
|
+
"params",
|
|
2546
|
+
"predicate",
|
|
2547
|
+
"returnType",
|
|
2548
|
+
"body"
|
|
2549
|
+
],
|
|
2550
|
+
aliases: [
|
|
2551
|
+
"Scopable",
|
|
2552
|
+
"Function",
|
|
2553
|
+
"BlockParent",
|
|
2554
|
+
"FunctionParent",
|
|
2555
|
+
"Expression",
|
|
2556
|
+
"Pureish"
|
|
2557
|
+
],
|
|
2558
|
+
fields: {
|
|
2559
|
+
...st(),
|
|
2560
|
+
generator: {
|
|
2561
|
+
default: null,
|
|
2562
|
+
optional: !0,
|
|
2563
|
+
validate: E((e, t, n) => {
|
|
2564
|
+
if (n) throw TypeError("ArrowFunctionExpression cannot be a generator");
|
|
2565
|
+
}, { type: "boolean" })
|
|
2566
|
+
},
|
|
2567
|
+
...ct(),
|
|
2568
|
+
expression: {
|
|
2569
|
+
optional: !0,
|
|
2570
|
+
validate: L("boolean")
|
|
2571
|
+
},
|
|
2572
|
+
body: { validate: I("BlockStatement", "Expression") },
|
|
2573
|
+
predicate: {
|
|
2574
|
+
validate: I("FlowPredicate"),
|
|
2575
|
+
optional: !0
|
|
2576
|
+
}
|
|
2577
|
+
}
|
|
2578
|
+
}), H("ClassBody", {
|
|
2579
|
+
visitor: ["body"],
|
|
2580
|
+
fields: { body: N("ClassMethod", "ClassPrivateMethod", "ClassProperty", "ClassPrivateProperty", "ClassAccessorProperty", "TSDeclareMethod", "TSIndexSignature", "StaticBlock") }
|
|
2581
|
+
}), H("ClassExpression", {
|
|
2582
|
+
builder: [
|
|
2583
|
+
"id",
|
|
2584
|
+
"superClass",
|
|
2585
|
+
"body",
|
|
2586
|
+
"decorators"
|
|
2587
|
+
],
|
|
2588
|
+
visitor: [
|
|
2589
|
+
"decorators",
|
|
2590
|
+
"id",
|
|
2591
|
+
"typeParameters",
|
|
2592
|
+
"superClass",
|
|
2593
|
+
"superTypeArguments",
|
|
2594
|
+
"mixins",
|
|
2595
|
+
"implements",
|
|
2596
|
+
"body"
|
|
2597
|
+
],
|
|
2598
|
+
aliases: [
|
|
2599
|
+
"Scopable",
|
|
2600
|
+
"Class",
|
|
2601
|
+
"Expression"
|
|
2602
|
+
],
|
|
2603
|
+
fields: {
|
|
2604
|
+
id: {
|
|
2605
|
+
validate: I("Identifier"),
|
|
2606
|
+
optional: !0
|
|
2607
|
+
},
|
|
2608
|
+
typeParameters: {
|
|
2609
|
+
validate: I("TypeParameterDeclaration", "TSTypeParameterDeclaration"),
|
|
2610
|
+
optional: !0
|
|
2611
|
+
},
|
|
2612
|
+
body: { validate: I("ClassBody") },
|
|
2613
|
+
superClass: {
|
|
2614
|
+
optional: !0,
|
|
2615
|
+
validate: I("Expression")
|
|
2616
|
+
},
|
|
2617
|
+
superTypeArguments: {
|
|
2618
|
+
validate: I("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
|
|
2619
|
+
optional: !0
|
|
2620
|
+
},
|
|
2621
|
+
implements: {
|
|
2622
|
+
validate: M("TSClassImplements", "ClassImplements"),
|
|
2623
|
+
optional: !0
|
|
2624
|
+
},
|
|
2625
|
+
decorators: {
|
|
2626
|
+
validate: M("Decorator"),
|
|
2627
|
+
optional: !0
|
|
2628
|
+
},
|
|
2629
|
+
mixins: {
|
|
2630
|
+
validate: I("InterfaceExtends"),
|
|
2631
|
+
optional: !0
|
|
2632
|
+
}
|
|
2633
|
+
}
|
|
2634
|
+
}), H("ClassDeclaration", {
|
|
2635
|
+
inherits: "ClassExpression",
|
|
2636
|
+
aliases: [
|
|
2637
|
+
"Scopable",
|
|
2638
|
+
"Class",
|
|
2639
|
+
"Statement",
|
|
2640
|
+
"Declaration"
|
|
2641
|
+
],
|
|
2642
|
+
fields: {
|
|
2643
|
+
id: {
|
|
2644
|
+
validate: I("Identifier"),
|
|
2645
|
+
optional: !0
|
|
2646
|
+
},
|
|
2647
|
+
typeParameters: {
|
|
2648
|
+
validate: I("TypeParameterDeclaration", "TSTypeParameterDeclaration"),
|
|
2649
|
+
optional: !0
|
|
2650
|
+
},
|
|
2651
|
+
body: { validate: I("ClassBody") },
|
|
2652
|
+
superClass: {
|
|
2653
|
+
optional: !0,
|
|
2654
|
+
validate: I("Expression")
|
|
2655
|
+
},
|
|
2656
|
+
superTypeArguments: {
|
|
2657
|
+
validate: I("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
|
|
2658
|
+
optional: !0
|
|
2659
|
+
},
|
|
2660
|
+
implements: {
|
|
2661
|
+
validate: M("TSClassImplements", "ClassImplements"),
|
|
2662
|
+
optional: !0
|
|
2663
|
+
},
|
|
2664
|
+
decorators: {
|
|
2665
|
+
validate: M("Decorator"),
|
|
2666
|
+
optional: !0
|
|
2667
|
+
},
|
|
2668
|
+
mixins: {
|
|
2669
|
+
validate: I("InterfaceExtends"),
|
|
2670
|
+
optional: !0
|
|
2671
|
+
},
|
|
2672
|
+
declare: {
|
|
2673
|
+
validate: L("boolean"),
|
|
2674
|
+
optional: !0
|
|
2675
|
+
},
|
|
2676
|
+
abstract: {
|
|
2677
|
+
validate: L("boolean"),
|
|
2678
|
+
optional: !0
|
|
2679
|
+
}
|
|
2680
|
+
},
|
|
2681
|
+
validate: function() {
|
|
2682
|
+
let e = I("Identifier");
|
|
2683
|
+
return function(t, n, r) {
|
|
2684
|
+
w("ExportDefaultDeclaration", t) || e(r, "id", r.id);
|
|
2685
|
+
};
|
|
2686
|
+
}()
|
|
2687
|
+
});
|
|
2688
|
+
var dt = { attributes: {
|
|
2689
|
+
optional: !0,
|
|
2690
|
+
validate: M("ImportAttribute")
|
|
2691
|
+
} };
|
|
2692
|
+
H("ExportAllDeclaration", {
|
|
2693
|
+
visitor: ["source", "attributes"],
|
|
2694
|
+
aliases: [
|
|
2695
|
+
"Statement",
|
|
2696
|
+
"Declaration",
|
|
2697
|
+
"ImportOrExportDeclaration",
|
|
2698
|
+
"ExportDeclaration"
|
|
2699
|
+
],
|
|
2700
|
+
fields: {
|
|
2701
|
+
source: { validate: I("StringLiteral") },
|
|
2702
|
+
exportKind: k(F("type", "value")),
|
|
2703
|
+
...dt
|
|
2704
|
+
}
|
|
2705
|
+
}), H("ExportDefaultDeclaration", {
|
|
2706
|
+
visitor: ["declaration"],
|
|
2707
|
+
aliases: [
|
|
2708
|
+
"Statement",
|
|
2709
|
+
"Declaration",
|
|
2710
|
+
"ImportOrExportDeclaration",
|
|
2711
|
+
"ExportDeclaration"
|
|
2712
|
+
],
|
|
2713
|
+
fields: {
|
|
2714
|
+
declaration: O("FunctionDeclaration", "ClassDeclaration", "Expression", "TSDeclareFunction", "TSInterfaceDeclaration", "EnumDeclaration"),
|
|
2715
|
+
exportKind: k(F("value"))
|
|
2716
|
+
}
|
|
2717
|
+
}), H("ExportNamedDeclaration", {
|
|
2718
|
+
builder: [
|
|
2719
|
+
"declaration",
|
|
2720
|
+
"specifiers",
|
|
2721
|
+
"source",
|
|
2722
|
+
"attributes"
|
|
2723
|
+
],
|
|
2724
|
+
visitor: [
|
|
2725
|
+
"declaration",
|
|
2726
|
+
"specifiers",
|
|
2727
|
+
"source",
|
|
2728
|
+
"attributes"
|
|
2729
|
+
],
|
|
2730
|
+
aliases: [
|
|
2731
|
+
"Statement",
|
|
2732
|
+
"Declaration",
|
|
2733
|
+
"ImportOrExportDeclaration",
|
|
2734
|
+
"ExportDeclaration"
|
|
2735
|
+
],
|
|
2736
|
+
fields: {
|
|
2737
|
+
declaration: {
|
|
2738
|
+
optional: !0,
|
|
2739
|
+
validate: R(I("Declaration"), E(function(e, t, n) {
|
|
2740
|
+
if (n && e.specifiers.length) throw TypeError("Only declaration or specifiers is allowed on ExportNamedDeclaration");
|
|
2741
|
+
if (n && e.source) throw TypeError("Cannot export a declaration from a source");
|
|
2742
|
+
}, { oneOfNodeTypes: [
|
|
2743
|
+
"VariableDeclaration",
|
|
2744
|
+
"FunctionDeclaration",
|
|
2745
|
+
"ClassDeclaration",
|
|
2746
|
+
"TSDeclareFunction",
|
|
2747
|
+
"TSEnumDeclaration",
|
|
2748
|
+
"TSImportEqualsDeclaration",
|
|
2749
|
+
"TSInterfaceDeclaration",
|
|
2750
|
+
"TSModuleDeclaration",
|
|
2751
|
+
"TSTypeAliasDeclaration",
|
|
2752
|
+
"EnumDeclaration",
|
|
2753
|
+
"InterfaceDeclaration",
|
|
2754
|
+
"OpaqueType",
|
|
2755
|
+
"TypeAlias"
|
|
2756
|
+
] }))
|
|
2757
|
+
},
|
|
2758
|
+
...dt,
|
|
2759
|
+
specifiers: {
|
|
2760
|
+
default: [],
|
|
2761
|
+
validate: Ze(function() {
|
|
2762
|
+
let e = I("ExportSpecifier", "ExportDefaultSpecifier", "ExportNamespaceSpecifier"), t = I("ExportSpecifier");
|
|
2763
|
+
return E(function(n, r, i) {
|
|
2764
|
+
(n.source ? e : t)(n, r, i);
|
|
2765
|
+
}, { oneOfNodeTypes: [
|
|
2766
|
+
"ExportSpecifier",
|
|
2767
|
+
"ExportDefaultSpecifier",
|
|
2768
|
+
"ExportNamespaceSpecifier"
|
|
2769
|
+
] });
|
|
2770
|
+
}())
|
|
2771
|
+
},
|
|
2772
|
+
source: {
|
|
2773
|
+
validate: I("StringLiteral"),
|
|
2774
|
+
optional: !0
|
|
2775
|
+
},
|
|
2776
|
+
exportKind: k(F("type", "value"))
|
|
2777
|
+
}
|
|
2778
|
+
}), H("ExportSpecifier", {
|
|
2779
|
+
visitor: ["local", "exported"],
|
|
2780
|
+
aliases: ["ModuleSpecifier"],
|
|
2781
|
+
fields: {
|
|
2782
|
+
local: { validate: I("Identifier", "StringLiteral") },
|
|
2783
|
+
exported: { validate: I("Identifier", "StringLiteral") },
|
|
2784
|
+
exportKind: {
|
|
2785
|
+
validate: F("type", "value"),
|
|
2786
|
+
optional: !0
|
|
2787
|
+
}
|
|
2788
|
+
}
|
|
2789
|
+
}), H("ForOfStatement", {
|
|
2790
|
+
visitor: [
|
|
2791
|
+
"left",
|
|
2792
|
+
"right",
|
|
2793
|
+
"body"
|
|
2794
|
+
],
|
|
2795
|
+
builder: [
|
|
2796
|
+
"left",
|
|
2797
|
+
"right",
|
|
2798
|
+
"body",
|
|
2799
|
+
"await"
|
|
2800
|
+
],
|
|
2801
|
+
aliases: [
|
|
2802
|
+
"Scopable",
|
|
2803
|
+
"Statement",
|
|
2804
|
+
"For",
|
|
2805
|
+
"BlockParent",
|
|
2806
|
+
"Loop",
|
|
2807
|
+
"ForXStatement"
|
|
2808
|
+
],
|
|
2809
|
+
fields: {
|
|
2810
|
+
left: { validate: function() {
|
|
2811
|
+
let e = I("VariableDeclaration"), t = I("Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern", "TSAsExpression", "TSSatisfiesExpression", "TSTypeAssertion", "TSNonNullExpression");
|
|
2812
|
+
return E(function(n, r, i) {
|
|
2813
|
+
w("VariableDeclaration", i) ? e(n, r, i) : t(n, r, i);
|
|
2814
|
+
}, { oneOfNodeTypes: [
|
|
2815
|
+
"VariableDeclaration",
|
|
2816
|
+
"Identifier",
|
|
2817
|
+
"MemberExpression",
|
|
2818
|
+
"ArrayPattern",
|
|
2819
|
+
"ObjectPattern",
|
|
2820
|
+
"TSAsExpression",
|
|
2821
|
+
"TSSatisfiesExpression",
|
|
2822
|
+
"TSTypeAssertion",
|
|
2823
|
+
"TSNonNullExpression"
|
|
2824
|
+
] });
|
|
2825
|
+
}() },
|
|
2826
|
+
right: { validate: I("Expression") },
|
|
2827
|
+
body: { validate: I("Statement") },
|
|
2828
|
+
await: { default: !1 }
|
|
2829
|
+
}
|
|
2830
|
+
}), H("ImportDeclaration", {
|
|
2831
|
+
builder: [
|
|
2832
|
+
"specifiers",
|
|
2833
|
+
"source",
|
|
2834
|
+
"attributes"
|
|
2835
|
+
],
|
|
2836
|
+
visitor: [
|
|
2837
|
+
"specifiers",
|
|
2838
|
+
"source",
|
|
2839
|
+
"attributes"
|
|
2840
|
+
],
|
|
2841
|
+
aliases: [
|
|
2842
|
+
"Statement",
|
|
2843
|
+
"Declaration",
|
|
2844
|
+
"ImportOrExportDeclaration"
|
|
2845
|
+
],
|
|
2846
|
+
fields: {
|
|
2847
|
+
...dt,
|
|
2848
|
+
module: {
|
|
2849
|
+
optional: !0,
|
|
2850
|
+
validate: L("boolean")
|
|
2851
|
+
},
|
|
2852
|
+
phase: {
|
|
2853
|
+
default: null,
|
|
2854
|
+
validate: F("source", "defer")
|
|
2855
|
+
},
|
|
2856
|
+
specifiers: N("ImportSpecifier", "ImportDefaultSpecifier", "ImportNamespaceSpecifier"),
|
|
2857
|
+
source: { validate: I("StringLiteral") },
|
|
2858
|
+
importKind: {
|
|
2859
|
+
validate: F("type", "typeof", "value"),
|
|
2860
|
+
optional: !0
|
|
2861
|
+
}
|
|
2862
|
+
}
|
|
2863
|
+
}), H("ImportDefaultSpecifier", {
|
|
2864
|
+
visitor: ["local"],
|
|
2865
|
+
aliases: ["ModuleSpecifier"],
|
|
2866
|
+
fields: { local: { validate: I("Identifier") } }
|
|
2867
|
+
}), H("ImportNamespaceSpecifier", {
|
|
2868
|
+
visitor: ["local"],
|
|
2869
|
+
aliases: ["ModuleSpecifier"],
|
|
2870
|
+
fields: { local: { validate: I("Identifier") } }
|
|
2871
|
+
}), H("ImportSpecifier", {
|
|
2872
|
+
visitor: ["imported", "local"],
|
|
2873
|
+
builder: ["local", "imported"],
|
|
2874
|
+
aliases: ["ModuleSpecifier"],
|
|
2875
|
+
fields: {
|
|
2876
|
+
local: { validate: I("Identifier") },
|
|
2877
|
+
imported: { validate: I("Identifier", "StringLiteral") },
|
|
2878
|
+
importKind: {
|
|
2879
|
+
validate: F("type", "typeof", "value"),
|
|
2880
|
+
optional: !0
|
|
2881
|
+
}
|
|
2882
|
+
}
|
|
2883
|
+
}), H("MetaProperty", {
|
|
2884
|
+
visitor: ["meta", "property"],
|
|
2885
|
+
aliases: ["Expression"],
|
|
2886
|
+
fields: {
|
|
2887
|
+
meta: { validate: R(I("Identifier"), E(function(e, t, n) {
|
|
2888
|
+
let r;
|
|
2889
|
+
switch (n.name) {
|
|
2890
|
+
case "function":
|
|
2891
|
+
r = "sent";
|
|
2892
|
+
break;
|
|
2893
|
+
case "new":
|
|
2894
|
+
r = "target";
|
|
2895
|
+
break;
|
|
2896
|
+
case "import": r = "meta";
|
|
2897
|
+
}
|
|
2898
|
+
if (!w("Identifier", e.property, { name: r })) throw TypeError("Unrecognised MetaProperty");
|
|
2899
|
+
}, { oneOfNodeTypes: ["Identifier"] })) },
|
|
2900
|
+
property: { validate: I("Identifier") }
|
|
2901
|
+
}
|
|
2902
|
+
});
|
|
2903
|
+
var ft = () => ({
|
|
2904
|
+
abstract: {
|
|
2905
|
+
validate: L("boolean"),
|
|
2906
|
+
default: !1,
|
|
2907
|
+
optional: !0
|
|
2908
|
+
},
|
|
2909
|
+
accessibility: {
|
|
2910
|
+
validate: F("public", "private", "protected"),
|
|
2911
|
+
optional: !0
|
|
2912
|
+
},
|
|
2913
|
+
static: { default: !1 },
|
|
2914
|
+
override: {
|
|
2915
|
+
optional: !0,
|
|
2916
|
+
validate: L("boolean"),
|
|
2917
|
+
default: !1
|
|
2918
|
+
},
|
|
2919
|
+
computed: { default: !1 },
|
|
2920
|
+
optional: {
|
|
2921
|
+
validate: L("boolean"),
|
|
2922
|
+
optional: !0
|
|
2923
|
+
},
|
|
2924
|
+
key: { validate: R(function() {
|
|
2925
|
+
let e = I("Identifier", "StringLiteral", "NumericLiteral", "BigIntLiteral"), t = I("Expression", "PrivateName");
|
|
2926
|
+
return function(n, r, i) {
|
|
2927
|
+
(n.computed ? t : e)(n, r, i);
|
|
2928
|
+
};
|
|
2929
|
+
}(), I("Identifier", "StringLiteral", "NumericLiteral", "BigIntLiteral", "Expression", "PrivateName")) }
|
|
2930
|
+
}), pt = (e = !0) => ({
|
|
2931
|
+
...st(),
|
|
2932
|
+
...ft(),
|
|
2933
|
+
params: N("FunctionParameter", "TSParameterProperty"),
|
|
2934
|
+
kind: {
|
|
2935
|
+
validate: F("get", "set", "method", "constructor"),
|
|
2936
|
+
default: "method"
|
|
2937
|
+
},
|
|
2938
|
+
access: {
|
|
2939
|
+
validate: R(L("string"), F("public", "private", "protected")),
|
|
2940
|
+
optional: !0
|
|
2941
|
+
},
|
|
2942
|
+
...e ? { decorators: {
|
|
2943
|
+
validate: M("Decorator"),
|
|
2944
|
+
optional: !0
|
|
2945
|
+
} } : {}
|
|
2946
|
+
});
|
|
2947
|
+
H("ClassMethod", {
|
|
2948
|
+
aliases: [
|
|
2949
|
+
"Function",
|
|
2950
|
+
"Scopable",
|
|
2951
|
+
"BlockParent",
|
|
2952
|
+
"FunctionParent",
|
|
2953
|
+
"Method"
|
|
2954
|
+
],
|
|
2955
|
+
builder: [
|
|
2956
|
+
"kind",
|
|
2957
|
+
"key",
|
|
2958
|
+
"params",
|
|
2959
|
+
"body",
|
|
2960
|
+
"computed",
|
|
2961
|
+
"static",
|
|
2962
|
+
"generator",
|
|
2963
|
+
"async"
|
|
2964
|
+
],
|
|
2965
|
+
visitor: [
|
|
2966
|
+
"decorators",
|
|
2967
|
+
"key",
|
|
2968
|
+
"typeParameters",
|
|
2969
|
+
"params",
|
|
2970
|
+
"returnType",
|
|
2971
|
+
"body"
|
|
2972
|
+
],
|
|
2973
|
+
...V(),
|
|
2974
|
+
fields: {
|
|
2975
|
+
...pt(),
|
|
2976
|
+
...ct(),
|
|
2977
|
+
body: { validate: I("BlockStatement") }
|
|
2978
|
+
}
|
|
2979
|
+
}), H("ObjectPattern", {
|
|
2980
|
+
visitor: [
|
|
2981
|
+
"decorators",
|
|
2982
|
+
"properties",
|
|
2983
|
+
"typeAnnotation"
|
|
2984
|
+
],
|
|
2985
|
+
builder: ["properties"],
|
|
2986
|
+
aliases: [
|
|
2987
|
+
"FunctionParameter",
|
|
2988
|
+
"Pattern",
|
|
2989
|
+
"PatternLike",
|
|
2990
|
+
"LVal"
|
|
2991
|
+
],
|
|
2992
|
+
fields: {
|
|
2993
|
+
...ut(),
|
|
2994
|
+
properties: N("RestElement", "ObjectProperty")
|
|
2995
|
+
}
|
|
2996
|
+
}), H("SpreadElement", {
|
|
2997
|
+
visitor: ["argument"],
|
|
2998
|
+
aliases: ["UnaryLike"],
|
|
2999
|
+
deprecatedAlias: "SpreadProperty",
|
|
3000
|
+
fields: { argument: { validate: I("Expression") } }
|
|
3001
|
+
}), H("Super"), H("TaggedTemplateExpression", {
|
|
3002
|
+
visitor: [
|
|
3003
|
+
"tag",
|
|
3004
|
+
"typeArguments",
|
|
3005
|
+
"quasi"
|
|
3006
|
+
],
|
|
3007
|
+
builder: ["tag", "quasi"],
|
|
3008
|
+
aliases: ["Expression"],
|
|
3009
|
+
fields: {
|
|
3010
|
+
tag: { validate: I("Expression") },
|
|
3011
|
+
quasi: { validate: I("TemplateLiteral") },
|
|
3012
|
+
typeArguments: {
|
|
3013
|
+
validate: I("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
|
|
3014
|
+
optional: !0
|
|
3015
|
+
}
|
|
3016
|
+
}
|
|
3017
|
+
}), H("TemplateElement", {
|
|
3018
|
+
builder: ["value", "tail"],
|
|
3019
|
+
fields: {
|
|
3020
|
+
value: { validate: R(et({
|
|
3021
|
+
raw: { validate: L("string") },
|
|
3022
|
+
cooked: {
|
|
3023
|
+
validate: L("string"),
|
|
3024
|
+
optional: !0
|
|
3025
|
+
}
|
|
3026
|
+
}), function(e) {
|
|
3027
|
+
let t = e.value.raw, n = !1, r = () => {
|
|
3028
|
+
throw Error("Internal @babel/types error.");
|
|
3029
|
+
}, { str: i, firstInvalidLoc: a } = g("template", t, 0, 0, 0, {
|
|
3030
|
+
unterminated() {
|
|
3031
|
+
n = !0;
|
|
3032
|
+
},
|
|
3033
|
+
strictNumericEscape: r,
|
|
3034
|
+
invalidEscapeSequence: r,
|
|
3035
|
+
numericSeparatorInEscapeSequence: r,
|
|
3036
|
+
unexpectedNumericSeparator: r,
|
|
3037
|
+
invalidDigit: r,
|
|
3038
|
+
invalidCodePoint: r
|
|
3039
|
+
});
|
|
3040
|
+
if (!n) throw Error("Invalid raw");
|
|
3041
|
+
e.value.cooked = a ? null : i;
|
|
3042
|
+
}) },
|
|
3043
|
+
tail: { default: !1 }
|
|
3044
|
+
}
|
|
3045
|
+
}), H("TemplateLiteral", {
|
|
3046
|
+
visitor: ["quasis", "expressions"],
|
|
3047
|
+
aliases: ["Expression", "Literal"],
|
|
3048
|
+
fields: {
|
|
3049
|
+
quasis: N("TemplateElement"),
|
|
3050
|
+
expressions: { validate: R(L("array"), P(I("Expression", "TSType")), function(e, t, n) {
|
|
3051
|
+
if (e.quasis.length !== n.length + 1) throw TypeError(`Number of ${e.type} quasis should be exactly one more than the number of expressions.\nExpected ${n.length + 1} quasis but got ${e.quasis.length}`);
|
|
3052
|
+
}) }
|
|
3053
|
+
}
|
|
3054
|
+
}), H("YieldExpression", {
|
|
3055
|
+
builder: ["argument", "delegate"],
|
|
3056
|
+
visitor: ["argument"],
|
|
3057
|
+
aliases: ["Expression", "Terminatorless"],
|
|
3058
|
+
fields: {
|
|
3059
|
+
delegate: {
|
|
3060
|
+
validate: R(L("boolean"), E(function(e, t, n) {
|
|
3061
|
+
if (n && !e.argument) throw TypeError("Property delegate of YieldExpression cannot be true if there is no argument");
|
|
3062
|
+
}, { type: "boolean" })),
|
|
3063
|
+
default: !1
|
|
3064
|
+
},
|
|
3065
|
+
argument: {
|
|
3066
|
+
optional: !0,
|
|
3067
|
+
validate: I("Expression")
|
|
3068
|
+
}
|
|
3069
|
+
}
|
|
3070
|
+
}), H("AwaitExpression", {
|
|
3071
|
+
builder: ["argument"],
|
|
3072
|
+
visitor: ["argument"],
|
|
3073
|
+
aliases: ["Expression", "Terminatorless"],
|
|
3074
|
+
fields: { argument: { validate: I("Expression") } }
|
|
3075
|
+
}), H("ImportExpression", {
|
|
3076
|
+
visitor: ["source", "options"],
|
|
3077
|
+
aliases: ["Expression"],
|
|
3078
|
+
fields: {
|
|
3079
|
+
phase: {
|
|
3080
|
+
default: null,
|
|
3081
|
+
validate: F("source", "defer")
|
|
3082
|
+
},
|
|
3083
|
+
source: { validate: I("Expression") },
|
|
3084
|
+
options: {
|
|
3085
|
+
validate: I("Expression"),
|
|
3086
|
+
optional: !0
|
|
3087
|
+
}
|
|
3088
|
+
}
|
|
3089
|
+
}), H("Import"), H("BigIntLiteral", {
|
|
3090
|
+
builder: ["value"],
|
|
3091
|
+
fields: { value: { validate: L("bigint") } },
|
|
3092
|
+
aliases: [
|
|
3093
|
+
"Expression",
|
|
3094
|
+
"Pureish",
|
|
3095
|
+
"Literal",
|
|
3096
|
+
"Immutable"
|
|
3097
|
+
]
|
|
3098
|
+
}), H("ExportNamespaceSpecifier", {
|
|
3099
|
+
visitor: ["exported"],
|
|
3100
|
+
aliases: ["ModuleSpecifier"],
|
|
3101
|
+
fields: { exported: { validate: I("Identifier", "StringLiteral") } }
|
|
3102
|
+
}), H("OptionalMemberExpression", {
|
|
3103
|
+
builder: [
|
|
3104
|
+
"object",
|
|
3105
|
+
"property",
|
|
3106
|
+
"computed",
|
|
3107
|
+
"optional"
|
|
3108
|
+
],
|
|
3109
|
+
visitor: ["object", "property"],
|
|
3110
|
+
aliases: ["Expression"],
|
|
3111
|
+
...ot,
|
|
3112
|
+
fields: {
|
|
3113
|
+
object: { validate: I("Expression") },
|
|
3114
|
+
property: { validate: function() {
|
|
3115
|
+
let e = I("Identifier", "PrivateName"), t = I("Expression");
|
|
3116
|
+
return E(function(n, r, i) {
|
|
3117
|
+
(n.computed ? t : e)(n, r, i);
|
|
3118
|
+
}, { oneOfNodeTypes: ["Expression", "PrivateName"] });
|
|
3119
|
+
}() },
|
|
3120
|
+
computed: { default: !1 },
|
|
3121
|
+
optional: { validate: R(L("boolean"), tt()) }
|
|
3122
|
+
}
|
|
3123
|
+
}), H("OptionalCallExpression", {
|
|
3124
|
+
visitor: [
|
|
3125
|
+
"callee",
|
|
3126
|
+
"typeArguments",
|
|
3127
|
+
"arguments"
|
|
3128
|
+
],
|
|
3129
|
+
builder: [
|
|
3130
|
+
"callee",
|
|
3131
|
+
"arguments",
|
|
3132
|
+
"optional"
|
|
3133
|
+
],
|
|
3134
|
+
aliases: ["Expression"],
|
|
3135
|
+
fields: {
|
|
3136
|
+
callee: { validate: I("Expression") },
|
|
3137
|
+
arguments: N("Expression", "SpreadElement", "ArgumentPlaceholder"),
|
|
3138
|
+
optional: { validate: R(L("boolean"), tt()) },
|
|
3139
|
+
typeArguments: {
|
|
3140
|
+
validate: I("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
|
|
3141
|
+
optional: !0
|
|
3142
|
+
}
|
|
3143
|
+
}
|
|
3144
|
+
}), H("ClassProperty", {
|
|
3145
|
+
visitor: [
|
|
3146
|
+
"decorators",
|
|
3147
|
+
"variance",
|
|
3148
|
+
"key",
|
|
3149
|
+
"typeAnnotation",
|
|
3150
|
+
"value"
|
|
3151
|
+
],
|
|
3152
|
+
builder: [
|
|
3153
|
+
"key",
|
|
3154
|
+
"value",
|
|
3155
|
+
"typeAnnotation",
|
|
3156
|
+
"decorators",
|
|
3157
|
+
"computed",
|
|
3158
|
+
"static"
|
|
3159
|
+
],
|
|
3160
|
+
aliases: ["Property"],
|
|
3161
|
+
...V(),
|
|
3162
|
+
fields: {
|
|
3163
|
+
...ft(),
|
|
3164
|
+
value: {
|
|
3165
|
+
validate: I("Expression"),
|
|
3166
|
+
optional: !0
|
|
3167
|
+
},
|
|
3168
|
+
definite: {
|
|
3169
|
+
validate: L("boolean"),
|
|
3170
|
+
optional: !0
|
|
3171
|
+
},
|
|
3172
|
+
typeAnnotation: {
|
|
3173
|
+
validate: I("TypeAnnotation", "TSTypeAnnotation"),
|
|
3174
|
+
optional: !0
|
|
3175
|
+
},
|
|
3176
|
+
decorators: {
|
|
3177
|
+
validate: M("Decorator"),
|
|
3178
|
+
optional: !0
|
|
3179
|
+
},
|
|
3180
|
+
readonly: {
|
|
3181
|
+
validate: L("boolean"),
|
|
3182
|
+
optional: !0
|
|
3183
|
+
},
|
|
3184
|
+
declare: {
|
|
3185
|
+
validate: L("boolean"),
|
|
3186
|
+
optional: !0
|
|
3187
|
+
},
|
|
3188
|
+
variance: {
|
|
3189
|
+
validate: I("Variance"),
|
|
3190
|
+
optional: !0
|
|
3191
|
+
}
|
|
3192
|
+
}
|
|
3193
|
+
}), H("ClassPrivateProperty", {
|
|
3194
|
+
visitor: [
|
|
3195
|
+
"decorators",
|
|
3196
|
+
"variance",
|
|
3197
|
+
"key",
|
|
3198
|
+
"typeAnnotation",
|
|
3199
|
+
"value"
|
|
3200
|
+
],
|
|
3201
|
+
builder: [
|
|
3202
|
+
"key",
|
|
3203
|
+
"value",
|
|
3204
|
+
"decorators",
|
|
3205
|
+
"static"
|
|
3206
|
+
],
|
|
3207
|
+
aliases: ["Property", "Private"],
|
|
3208
|
+
fields: {
|
|
3209
|
+
key: { validate: I("PrivateName") },
|
|
3210
|
+
value: {
|
|
3211
|
+
validate: I("Expression"),
|
|
3212
|
+
optional: !0
|
|
3213
|
+
},
|
|
3214
|
+
typeAnnotation: {
|
|
3215
|
+
validate: I("TypeAnnotation", "TSTypeAnnotation"),
|
|
3216
|
+
optional: !0
|
|
3217
|
+
},
|
|
3218
|
+
decorators: {
|
|
3219
|
+
validate: M("Decorator"),
|
|
3220
|
+
optional: !0
|
|
3221
|
+
},
|
|
3222
|
+
static: {
|
|
3223
|
+
validate: L("boolean"),
|
|
3224
|
+
default: !1
|
|
3225
|
+
},
|
|
3226
|
+
readonly: {
|
|
3227
|
+
validate: L("boolean"),
|
|
3228
|
+
optional: !0
|
|
3229
|
+
},
|
|
3230
|
+
optional: {
|
|
3231
|
+
validate: L("boolean"),
|
|
3232
|
+
optional: !0
|
|
3233
|
+
},
|
|
3234
|
+
definite: {
|
|
3235
|
+
validate: L("boolean"),
|
|
3236
|
+
optional: !0
|
|
3237
|
+
},
|
|
3238
|
+
variance: {
|
|
3239
|
+
validate: I("Variance"),
|
|
3240
|
+
optional: !0
|
|
3241
|
+
}
|
|
3242
|
+
}
|
|
3243
|
+
}), H("ClassPrivateMethod", {
|
|
3244
|
+
builder: [
|
|
3245
|
+
"kind",
|
|
3246
|
+
"key",
|
|
3247
|
+
"params",
|
|
3248
|
+
"body",
|
|
3249
|
+
"static"
|
|
3250
|
+
],
|
|
3251
|
+
visitor: [
|
|
3252
|
+
"decorators",
|
|
3253
|
+
"key",
|
|
3254
|
+
"typeParameters",
|
|
3255
|
+
"params",
|
|
3256
|
+
"returnType",
|
|
3257
|
+
"body"
|
|
3258
|
+
],
|
|
3259
|
+
aliases: [
|
|
3260
|
+
"Function",
|
|
3261
|
+
"Scopable",
|
|
3262
|
+
"BlockParent",
|
|
3263
|
+
"FunctionParent",
|
|
3264
|
+
"Method",
|
|
3265
|
+
"Private"
|
|
3266
|
+
],
|
|
3267
|
+
fields: {
|
|
3268
|
+
...pt(),
|
|
3269
|
+
...ct(),
|
|
3270
|
+
kind: {
|
|
3271
|
+
validate: F("get", "set", "method"),
|
|
3272
|
+
default: "method"
|
|
3273
|
+
},
|
|
3274
|
+
key: { validate: I("PrivateName") },
|
|
3275
|
+
body: { validate: I("BlockStatement") }
|
|
3276
|
+
}
|
|
3277
|
+
}), H("PrivateName", {
|
|
3278
|
+
visitor: ["id"],
|
|
3279
|
+
aliases: ["Private"],
|
|
3280
|
+
fields: { id: { validate: I("Identifier") } }
|
|
3281
|
+
}), H("StaticBlock", {
|
|
3282
|
+
visitor: ["body"],
|
|
3283
|
+
fields: { body: N("Statement") },
|
|
3284
|
+
aliases: [
|
|
3285
|
+
"Scopable",
|
|
3286
|
+
"BlockParent",
|
|
3287
|
+
"FunctionParent"
|
|
3288
|
+
]
|
|
3289
|
+
}), H("ImportAttribute", {
|
|
3290
|
+
visitor: ["key", "value"],
|
|
3291
|
+
fields: {
|
|
3292
|
+
key: { validate: I("Identifier", "StringLiteral") },
|
|
3293
|
+
value: { validate: I("StringLiteral") }
|
|
3294
|
+
}
|
|
3295
|
+
});
|
|
3296
|
+
var U = z("Flow"), mt = (e) => {
|
|
3297
|
+
let t = e === "DeclareClass";
|
|
3298
|
+
U(e, {
|
|
3299
|
+
builder: [
|
|
3300
|
+
"id",
|
|
3301
|
+
"typeParameters",
|
|
3302
|
+
"extends",
|
|
3303
|
+
"body"
|
|
3304
|
+
],
|
|
3305
|
+
visitor: [
|
|
3306
|
+
"id",
|
|
3307
|
+
"typeParameters",
|
|
3308
|
+
"extends",
|
|
3309
|
+
...t ? ["mixins", "implements"] : [],
|
|
3310
|
+
"body"
|
|
3311
|
+
],
|
|
3312
|
+
aliases: [
|
|
3313
|
+
"FlowDeclaration",
|
|
3314
|
+
"Statement",
|
|
3315
|
+
"Declaration"
|
|
3316
|
+
],
|
|
3317
|
+
fields: {
|
|
3318
|
+
id: O("Identifier"),
|
|
3319
|
+
typeParameters: j("TypeParameterDeclaration"),
|
|
3320
|
+
extends: k(M("InterfaceExtends")),
|
|
3321
|
+
...t ? {
|
|
3322
|
+
mixins: k(M("InterfaceExtends")),
|
|
3323
|
+
implements: k(M("ClassImplements"))
|
|
3324
|
+
} : {},
|
|
3325
|
+
body: O("ObjectTypeAnnotation")
|
|
3326
|
+
}
|
|
3327
|
+
});
|
|
3328
|
+
};
|
|
3329
|
+
U("AnyTypeAnnotation", { aliases: ["FlowType", "FlowBaseAnnotation"] }), U("ArrayTypeAnnotation", {
|
|
3330
|
+
visitor: ["elementType"],
|
|
3331
|
+
aliases: ["FlowType"],
|
|
3332
|
+
fields: { elementType: O("FlowType") }
|
|
3333
|
+
}), U("BooleanTypeAnnotation", { aliases: ["FlowType", "FlowBaseAnnotation"] }), U("BooleanLiteralTypeAnnotation", {
|
|
3334
|
+
builder: ["value"],
|
|
3335
|
+
aliases: ["FlowType"],
|
|
3336
|
+
fields: { value: D(L("boolean")) }
|
|
3337
|
+
}), U("NullLiteralTypeAnnotation", { aliases: ["FlowType", "FlowBaseAnnotation"] }), U("ClassImplements", {
|
|
3338
|
+
visitor: ["id", "typeParameters"],
|
|
3339
|
+
fields: {
|
|
3340
|
+
id: O("Identifier"),
|
|
3341
|
+
typeParameters: j("TypeParameterInstantiation")
|
|
3342
|
+
}
|
|
3343
|
+
}), mt("DeclareClass"), U("DeclareFunction", {
|
|
3344
|
+
builder: ["id"],
|
|
3345
|
+
visitor: ["id", "predicate"],
|
|
3346
|
+
aliases: [
|
|
3347
|
+
"FlowDeclaration",
|
|
3348
|
+
"Statement",
|
|
3349
|
+
"Declaration"
|
|
3350
|
+
],
|
|
3351
|
+
fields: {
|
|
3352
|
+
id: O("Identifier"),
|
|
3353
|
+
predicate: j("FlowPredicate")
|
|
3354
|
+
}
|
|
3355
|
+
}), mt("DeclareInterface"), U("DeclareModule", {
|
|
3356
|
+
builder: [
|
|
3357
|
+
"id",
|
|
3358
|
+
"body",
|
|
3359
|
+
"kind"
|
|
3360
|
+
],
|
|
3361
|
+
visitor: ["id", "body"],
|
|
3362
|
+
aliases: [
|
|
3363
|
+
"FlowDeclaration",
|
|
3364
|
+
"Statement",
|
|
3365
|
+
"Declaration"
|
|
3366
|
+
],
|
|
3367
|
+
fields: {
|
|
3368
|
+
id: O("Identifier", "StringLiteral"),
|
|
3369
|
+
body: O("BlockStatement"),
|
|
3370
|
+
kind: k(F("CommonJS", "ES"))
|
|
3371
|
+
}
|
|
3372
|
+
}), U("DeclareModuleExports", {
|
|
3373
|
+
visitor: ["typeAnnotation"],
|
|
3374
|
+
aliases: [
|
|
3375
|
+
"FlowDeclaration",
|
|
3376
|
+
"Statement",
|
|
3377
|
+
"Declaration"
|
|
3378
|
+
],
|
|
3379
|
+
fields: { typeAnnotation: O("TypeAnnotation") }
|
|
3380
|
+
}), U("DeclareTypeAlias", {
|
|
3381
|
+
visitor: [
|
|
3382
|
+
"id",
|
|
3383
|
+
"typeParameters",
|
|
3384
|
+
"right"
|
|
3385
|
+
],
|
|
3386
|
+
aliases: [
|
|
3387
|
+
"FlowDeclaration",
|
|
3388
|
+
"Statement",
|
|
3389
|
+
"Declaration"
|
|
3390
|
+
],
|
|
3391
|
+
fields: {
|
|
3392
|
+
id: O("Identifier"),
|
|
3393
|
+
typeParameters: j("TypeParameterDeclaration"),
|
|
3394
|
+
right: O("FlowType")
|
|
3395
|
+
}
|
|
3396
|
+
}), U("DeclareOpaqueType", {
|
|
3397
|
+
visitor: [
|
|
3398
|
+
"id",
|
|
3399
|
+
"typeParameters",
|
|
3400
|
+
"supertype"
|
|
3401
|
+
],
|
|
3402
|
+
aliases: [
|
|
3403
|
+
"FlowDeclaration",
|
|
3404
|
+
"Statement",
|
|
3405
|
+
"Declaration"
|
|
3406
|
+
],
|
|
3407
|
+
fields: {
|
|
3408
|
+
id: O("Identifier"),
|
|
3409
|
+
typeParameters: j("TypeParameterDeclaration"),
|
|
3410
|
+
supertype: j("FlowType"),
|
|
3411
|
+
impltype: j("FlowType")
|
|
3412
|
+
}
|
|
3413
|
+
}), U("DeclareVariable", {
|
|
3414
|
+
visitor: ["id"],
|
|
3415
|
+
aliases: [
|
|
3416
|
+
"FlowDeclaration",
|
|
3417
|
+
"Statement",
|
|
3418
|
+
"Declaration"
|
|
3419
|
+
],
|
|
3420
|
+
fields: { id: O("Identifier") }
|
|
3421
|
+
}), U("DeclareExportDeclaration", {
|
|
3422
|
+
visitor: [
|
|
3423
|
+
"declaration",
|
|
3424
|
+
"specifiers",
|
|
3425
|
+
"source",
|
|
3426
|
+
"attributes"
|
|
3427
|
+
],
|
|
3428
|
+
aliases: [
|
|
3429
|
+
"FlowDeclaration",
|
|
3430
|
+
"Statement",
|
|
3431
|
+
"Declaration"
|
|
3432
|
+
],
|
|
3433
|
+
fields: {
|
|
3434
|
+
declaration: j("Flow"),
|
|
3435
|
+
specifiers: k(M("ExportSpecifier", "ExportNamespaceSpecifier")),
|
|
3436
|
+
source: j("StringLiteral"),
|
|
3437
|
+
default: k(L("boolean")),
|
|
3438
|
+
...dt
|
|
3439
|
+
}
|
|
3440
|
+
}), U("DeclareExportAllDeclaration", {
|
|
3441
|
+
visitor: ["source", "attributes"],
|
|
3442
|
+
aliases: [
|
|
3443
|
+
"FlowDeclaration",
|
|
3444
|
+
"Statement",
|
|
3445
|
+
"Declaration"
|
|
3446
|
+
],
|
|
3447
|
+
fields: {
|
|
3448
|
+
source: O("StringLiteral"),
|
|
3449
|
+
exportKind: k(F("type", "value")),
|
|
3450
|
+
...dt
|
|
3451
|
+
}
|
|
3452
|
+
}), U("DeclaredPredicate", {
|
|
3453
|
+
visitor: ["value"],
|
|
3454
|
+
aliases: ["FlowPredicate"],
|
|
3455
|
+
fields: { value: O("Expression") }
|
|
3456
|
+
}), U("ExistsTypeAnnotation", { aliases: ["FlowType"] }), U("FunctionTypeAnnotation", {
|
|
3457
|
+
builder: [
|
|
3458
|
+
"typeParameters",
|
|
3459
|
+
"params",
|
|
3460
|
+
"rest",
|
|
3461
|
+
"returnType"
|
|
3462
|
+
],
|
|
3463
|
+
visitor: [
|
|
3464
|
+
"typeParameters",
|
|
3465
|
+
"this",
|
|
3466
|
+
"params",
|
|
3467
|
+
"rest",
|
|
3468
|
+
"returnType"
|
|
3469
|
+
],
|
|
3470
|
+
aliases: ["FlowType"],
|
|
3471
|
+
fields: {
|
|
3472
|
+
typeParameters: j("TypeParameterDeclaration"),
|
|
3473
|
+
params: N("FunctionTypeParam"),
|
|
3474
|
+
rest: j("FunctionTypeParam"),
|
|
3475
|
+
this: j("FunctionTypeParam"),
|
|
3476
|
+
returnType: O("FlowType")
|
|
3477
|
+
}
|
|
3478
|
+
}), U("FunctionTypeParam", {
|
|
3479
|
+
visitor: ["name", "typeAnnotation"],
|
|
3480
|
+
fields: {
|
|
3481
|
+
name: j("Identifier"),
|
|
3482
|
+
typeAnnotation: O("FlowType"),
|
|
3483
|
+
optional: k(L("boolean"))
|
|
3484
|
+
}
|
|
3485
|
+
}), U("GenericTypeAnnotation", {
|
|
3486
|
+
visitor: ["id", "typeParameters"],
|
|
3487
|
+
aliases: ["FlowType"],
|
|
3488
|
+
fields: {
|
|
3489
|
+
id: O("Identifier", "QualifiedTypeIdentifier"),
|
|
3490
|
+
typeParameters: j("TypeParameterInstantiation")
|
|
3491
|
+
}
|
|
3492
|
+
}), U("InferredPredicate", { aliases: ["FlowPredicate"] }), U("InterfaceExtends", {
|
|
3493
|
+
visitor: ["id", "typeParameters"],
|
|
3494
|
+
fields: {
|
|
3495
|
+
id: O("Identifier", "QualifiedTypeIdentifier"),
|
|
3496
|
+
typeParameters: j("TypeParameterInstantiation")
|
|
3497
|
+
}
|
|
3498
|
+
}), mt("InterfaceDeclaration"), U("InterfaceTypeAnnotation", {
|
|
3499
|
+
visitor: ["extends", "body"],
|
|
3500
|
+
aliases: ["FlowType"],
|
|
3501
|
+
fields: {
|
|
3502
|
+
extends: k(M("InterfaceExtends")),
|
|
3503
|
+
body: O("ObjectTypeAnnotation")
|
|
3504
|
+
}
|
|
3505
|
+
}), U("IntersectionTypeAnnotation", {
|
|
3506
|
+
visitor: ["types"],
|
|
3507
|
+
aliases: ["FlowType"],
|
|
3508
|
+
fields: { types: D(M("FlowType")) }
|
|
3509
|
+
}), U("MixedTypeAnnotation", { aliases: ["FlowType", "FlowBaseAnnotation"] }), U("EmptyTypeAnnotation", { aliases: ["FlowType", "FlowBaseAnnotation"] }), U("NullableTypeAnnotation", {
|
|
3510
|
+
visitor: ["typeAnnotation"],
|
|
3511
|
+
aliases: ["FlowType"],
|
|
3512
|
+
fields: { typeAnnotation: O("FlowType") }
|
|
3513
|
+
}), U("NumberLiteralTypeAnnotation", {
|
|
3514
|
+
builder: ["value"],
|
|
3515
|
+
aliases: ["FlowType"],
|
|
3516
|
+
fields: { value: D(L("number")) }
|
|
3517
|
+
}), U("BigIntLiteralTypeAnnotation", {
|
|
3518
|
+
builder: ["value"],
|
|
3519
|
+
aliases: ["FlowType"],
|
|
3520
|
+
fields: { value: D(L("bigint")) }
|
|
3521
|
+
}), U("NumberTypeAnnotation", { aliases: ["FlowType", "FlowBaseAnnotation"] }), U("ObjectTypeAnnotation", {
|
|
3522
|
+
visitor: [
|
|
3523
|
+
"properties",
|
|
3524
|
+
"indexers",
|
|
3525
|
+
"callProperties",
|
|
3526
|
+
"internalSlots"
|
|
3527
|
+
],
|
|
3528
|
+
aliases: ["FlowType"],
|
|
3529
|
+
builder: [
|
|
3530
|
+
"properties",
|
|
3531
|
+
"indexers",
|
|
3532
|
+
"callProperties",
|
|
3533
|
+
"internalSlots",
|
|
3534
|
+
"exact"
|
|
3535
|
+
],
|
|
3536
|
+
fields: {
|
|
3537
|
+
properties: D(M("ObjectTypeProperty", "ObjectTypeSpreadProperty")),
|
|
3538
|
+
indexers: {
|
|
3539
|
+
validate: M("ObjectTypeIndexer"),
|
|
3540
|
+
optional: !1,
|
|
3541
|
+
default: []
|
|
3542
|
+
},
|
|
3543
|
+
callProperties: {
|
|
3544
|
+
validate: M("ObjectTypeCallProperty"),
|
|
3545
|
+
optional: !1,
|
|
3546
|
+
default: []
|
|
3547
|
+
},
|
|
3548
|
+
internalSlots: {
|
|
3549
|
+
validate: M("ObjectTypeInternalSlot"),
|
|
3550
|
+
optional: !1,
|
|
3551
|
+
default: []
|
|
3552
|
+
},
|
|
3553
|
+
exact: {
|
|
3554
|
+
validate: L("boolean"),
|
|
3555
|
+
default: !1
|
|
3556
|
+
},
|
|
3557
|
+
inexact: k(L("boolean"))
|
|
3558
|
+
}
|
|
3559
|
+
}), U("ObjectTypeInternalSlot", {
|
|
3560
|
+
visitor: ["id", "value"],
|
|
3561
|
+
builder: [
|
|
3562
|
+
"id",
|
|
3563
|
+
"value",
|
|
3564
|
+
"optional",
|
|
3565
|
+
"static",
|
|
3566
|
+
"method"
|
|
3567
|
+
],
|
|
3568
|
+
aliases: ["UserWhitespacable"],
|
|
3569
|
+
fields: {
|
|
3570
|
+
id: O("Identifier"),
|
|
3571
|
+
value: O("FlowType"),
|
|
3572
|
+
optional: D(L("boolean")),
|
|
3573
|
+
static: D(L("boolean")),
|
|
3574
|
+
method: D(L("boolean"))
|
|
3575
|
+
}
|
|
3576
|
+
}), U("ObjectTypeCallProperty", {
|
|
3577
|
+
visitor: ["value"],
|
|
3578
|
+
aliases: ["UserWhitespacable"],
|
|
3579
|
+
fields: {
|
|
3580
|
+
value: O("FlowType"),
|
|
3581
|
+
static: A(L("boolean"), !1)
|
|
3582
|
+
}
|
|
3583
|
+
}), U("ObjectTypeIndexer", {
|
|
3584
|
+
visitor: [
|
|
3585
|
+
"variance",
|
|
3586
|
+
"id",
|
|
3587
|
+
"key",
|
|
3588
|
+
"value"
|
|
3589
|
+
],
|
|
3590
|
+
builder: [
|
|
3591
|
+
"id",
|
|
3592
|
+
"key",
|
|
3593
|
+
"value",
|
|
3594
|
+
"variance"
|
|
3595
|
+
],
|
|
3596
|
+
aliases: ["UserWhitespacable"],
|
|
3597
|
+
fields: {
|
|
3598
|
+
id: j("Identifier"),
|
|
3599
|
+
key: O("FlowType"),
|
|
3600
|
+
value: O("FlowType"),
|
|
3601
|
+
static: A(L("boolean"), !1),
|
|
3602
|
+
variance: j("Variance")
|
|
3603
|
+
}
|
|
3604
|
+
}), U("ObjectTypeProperty", {
|
|
3605
|
+
visitor: [
|
|
3606
|
+
"key",
|
|
3607
|
+
"value",
|
|
3608
|
+
"variance"
|
|
3609
|
+
],
|
|
3610
|
+
aliases: ["UserWhitespacable"],
|
|
3611
|
+
fields: {
|
|
3612
|
+
key: O("Identifier", "StringLiteral", "NumericLiteral"),
|
|
3613
|
+
value: O("FlowType"),
|
|
3614
|
+
kind: {
|
|
3615
|
+
validate: F("init", "get", "set"),
|
|
3616
|
+
default: "init",
|
|
3617
|
+
optional: !1
|
|
3618
|
+
},
|
|
3619
|
+
static: A(L("boolean"), !1),
|
|
3620
|
+
proto: A(L("boolean"), !1),
|
|
3621
|
+
optional: A(L("boolean"), !1),
|
|
3622
|
+
variance: j("Variance"),
|
|
3623
|
+
method: A(L("boolean"), !1)
|
|
3624
|
+
}
|
|
3625
|
+
}), U("ObjectTypeSpreadProperty", {
|
|
3626
|
+
visitor: ["argument"],
|
|
3627
|
+
aliases: ["UserWhitespacable"],
|
|
3628
|
+
fields: { argument: O("FlowType") }
|
|
3629
|
+
}), U("OpaqueType", {
|
|
3630
|
+
visitor: [
|
|
3631
|
+
"id",
|
|
3632
|
+
"typeParameters",
|
|
3633
|
+
"supertype",
|
|
3634
|
+
"impltype"
|
|
3635
|
+
],
|
|
3636
|
+
aliases: [
|
|
3637
|
+
"FlowDeclaration",
|
|
3638
|
+
"Statement",
|
|
3639
|
+
"Declaration"
|
|
3640
|
+
],
|
|
3641
|
+
fields: {
|
|
3642
|
+
id: O("Identifier"),
|
|
3643
|
+
typeParameters: j("TypeParameterDeclaration"),
|
|
3644
|
+
supertype: j("FlowType"),
|
|
3645
|
+
impltype: O("FlowType")
|
|
3646
|
+
}
|
|
3647
|
+
}), U("QualifiedTypeIdentifier", {
|
|
3648
|
+
visitor: ["qualification", "id"],
|
|
3649
|
+
builder: ["id", "qualification"],
|
|
3650
|
+
fields: {
|
|
3651
|
+
id: O("Identifier"),
|
|
3652
|
+
qualification: O("Identifier", "QualifiedTypeIdentifier")
|
|
3653
|
+
}
|
|
3654
|
+
}), U("StringLiteralTypeAnnotation", {
|
|
3655
|
+
builder: ["value"],
|
|
3656
|
+
aliases: ["FlowType"],
|
|
3657
|
+
fields: { value: D(L("string")) }
|
|
3658
|
+
}), U("StringTypeAnnotation", { aliases: ["FlowType", "FlowBaseAnnotation"] }), U("SymbolTypeAnnotation", { aliases: ["FlowType", "FlowBaseAnnotation"] }), U("ThisTypeAnnotation", { aliases: ["FlowType", "FlowBaseAnnotation"] }), U("TupleTypeAnnotation", {
|
|
3659
|
+
visitor: ["types"],
|
|
3660
|
+
aliases: ["FlowType"],
|
|
3661
|
+
fields: { types: D(M("FlowType")) }
|
|
3662
|
+
}), U("TypeofTypeAnnotation", {
|
|
3663
|
+
visitor: ["argument"],
|
|
3664
|
+
aliases: ["FlowType"],
|
|
3665
|
+
fields: { argument: O("FlowType", "Identifier") }
|
|
3666
|
+
}), U("TypeAlias", {
|
|
3667
|
+
visitor: [
|
|
3668
|
+
"id",
|
|
3669
|
+
"typeParameters",
|
|
3670
|
+
"right"
|
|
3671
|
+
],
|
|
3672
|
+
aliases: [
|
|
3673
|
+
"FlowDeclaration",
|
|
3674
|
+
"Statement",
|
|
3675
|
+
"Declaration"
|
|
3676
|
+
],
|
|
3677
|
+
fields: {
|
|
3678
|
+
id: O("Identifier"),
|
|
3679
|
+
typeParameters: j("TypeParameterDeclaration"),
|
|
3680
|
+
right: O("FlowType")
|
|
3681
|
+
}
|
|
3682
|
+
}), U("TypeAnnotation", {
|
|
3683
|
+
visitor: ["typeAnnotation"],
|
|
3684
|
+
fields: { typeAnnotation: O("FlowType", "Identifier") }
|
|
3685
|
+
}), U("TypeCastExpression", {
|
|
3686
|
+
visitor: ["expression", "typeAnnotation"],
|
|
3687
|
+
aliases: ["ExpressionWrapper", "Expression"],
|
|
3688
|
+
fields: {
|
|
3689
|
+
expression: O("Expression"),
|
|
3690
|
+
typeAnnotation: O("TypeAnnotation")
|
|
3691
|
+
}
|
|
3692
|
+
}), U("TypeParameter", {
|
|
3693
|
+
builder: [
|
|
3694
|
+
"name",
|
|
3695
|
+
"bound",
|
|
3696
|
+
"default",
|
|
3697
|
+
"variance"
|
|
3698
|
+
],
|
|
3699
|
+
visitor: [
|
|
3700
|
+
"bound",
|
|
3701
|
+
"default",
|
|
3702
|
+
"variance"
|
|
3703
|
+
],
|
|
3704
|
+
fields: {
|
|
3705
|
+
name: D(L("string")),
|
|
3706
|
+
bound: j("TypeAnnotation"),
|
|
3707
|
+
default: j("FlowType"),
|
|
3708
|
+
variance: j("Variance")
|
|
3709
|
+
}
|
|
3710
|
+
}), U("TypeParameterDeclaration", {
|
|
3711
|
+
visitor: ["params"],
|
|
3712
|
+
fields: { params: D(M("TypeParameter")) }
|
|
3713
|
+
}), U("TypeParameterInstantiation", {
|
|
3714
|
+
visitor: ["params"],
|
|
3715
|
+
fields: { params: D(M("FlowType")) }
|
|
3716
|
+
}), U("UnionTypeAnnotation", {
|
|
3717
|
+
visitor: ["types"],
|
|
3718
|
+
aliases: ["FlowType"],
|
|
3719
|
+
fields: { types: D(M("FlowType")) }
|
|
3720
|
+
}), U("Variance", {
|
|
3721
|
+
builder: ["kind"],
|
|
3722
|
+
fields: { kind: D(F("minus", "plus")) }
|
|
3723
|
+
}), U("VoidTypeAnnotation", { aliases: ["FlowType", "FlowBaseAnnotation"] }), U("EnumDeclaration", {
|
|
3724
|
+
aliases: ["Statement", "Declaration"],
|
|
3725
|
+
visitor: ["id", "body"],
|
|
3726
|
+
fields: {
|
|
3727
|
+
id: O("Identifier"),
|
|
3728
|
+
body: O("EnumBooleanBody", "EnumNumberBody", "EnumStringBody", "EnumSymbolBody")
|
|
3729
|
+
}
|
|
3730
|
+
});
|
|
3731
|
+
var ht = {
|
|
3732
|
+
explicitType: A(L("boolean"), !1),
|
|
3733
|
+
hasUnknownMembers: A(L("boolean"), !1)
|
|
3734
|
+
};
|
|
3735
|
+
U("EnumBooleanBody", {
|
|
3736
|
+
aliases: ["EnumBody"],
|
|
3737
|
+
visitor: ["members"],
|
|
3738
|
+
fields: {
|
|
3739
|
+
...ht,
|
|
3740
|
+
members: N("EnumBooleanMember")
|
|
3741
|
+
}
|
|
3742
|
+
}), U("EnumNumberBody", {
|
|
3743
|
+
aliases: ["EnumBody"],
|
|
3744
|
+
visitor: ["members"],
|
|
3745
|
+
fields: {
|
|
3746
|
+
...ht,
|
|
3747
|
+
members: N("EnumNumberMember")
|
|
3748
|
+
}
|
|
3749
|
+
}), U("EnumStringBody", {
|
|
3750
|
+
aliases: ["EnumBody"],
|
|
3751
|
+
visitor: ["members"],
|
|
3752
|
+
fields: {
|
|
3753
|
+
...ht,
|
|
3754
|
+
members: N("EnumStringMember", "EnumDefaultedMember")
|
|
3755
|
+
}
|
|
3756
|
+
}), U("EnumSymbolBody", {
|
|
3757
|
+
aliases: ["EnumBody"],
|
|
3758
|
+
visitor: ["members"],
|
|
3759
|
+
fields: {
|
|
3760
|
+
members: N("EnumDefaultedMember"),
|
|
3761
|
+
hasUnknownMembers: A(L("boolean"), !1)
|
|
3762
|
+
}
|
|
3763
|
+
}), U("EnumBooleanMember", {
|
|
3764
|
+
aliases: ["EnumMember"],
|
|
3765
|
+
visitor: ["id", "init"],
|
|
3766
|
+
fields: {
|
|
3767
|
+
id: O("Identifier"),
|
|
3768
|
+
init: O("BooleanLiteral")
|
|
3769
|
+
}
|
|
3770
|
+
}), U("EnumNumberMember", {
|
|
3771
|
+
aliases: ["EnumMember"],
|
|
3772
|
+
visitor: ["id", "init"],
|
|
3773
|
+
fields: {
|
|
3774
|
+
id: O("Identifier"),
|
|
3775
|
+
init: O("NumericLiteral")
|
|
3776
|
+
}
|
|
3777
|
+
}), U("EnumStringMember", {
|
|
3778
|
+
aliases: ["EnumMember"],
|
|
3779
|
+
visitor: ["id", "init"],
|
|
3780
|
+
fields: {
|
|
3781
|
+
id: O("Identifier"),
|
|
3782
|
+
init: O("StringLiteral")
|
|
3783
|
+
}
|
|
3784
|
+
}), U("EnumDefaultedMember", {
|
|
3785
|
+
aliases: ["EnumMember"],
|
|
3786
|
+
visitor: ["id"],
|
|
3787
|
+
fields: { id: O("Identifier") }
|
|
3788
|
+
}), U("IndexedAccessType", {
|
|
3789
|
+
visitor: ["objectType", "indexType"],
|
|
3790
|
+
aliases: ["FlowType"],
|
|
3791
|
+
fields: {
|
|
3792
|
+
objectType: O("FlowType"),
|
|
3793
|
+
indexType: O("FlowType")
|
|
3794
|
+
}
|
|
3795
|
+
}), U("OptionalIndexedAccessType", {
|
|
3796
|
+
visitor: ["objectType", "indexType"],
|
|
3797
|
+
aliases: ["FlowType"],
|
|
3798
|
+
fields: {
|
|
3799
|
+
objectType: O("FlowType"),
|
|
3800
|
+
indexType: O("FlowType"),
|
|
3801
|
+
optional: A(L("boolean"), !1)
|
|
3802
|
+
}
|
|
3803
|
+
});
|
|
3804
|
+
var W = z("JSX");
|
|
3805
|
+
W("JSXAttribute", {
|
|
3806
|
+
visitor: ["name", "value"],
|
|
3807
|
+
aliases: ["Immutable"],
|
|
3808
|
+
fields: {
|
|
3809
|
+
name: { validate: I("JSXIdentifier", "JSXNamespacedName") },
|
|
3810
|
+
value: {
|
|
3811
|
+
optional: !0,
|
|
3812
|
+
validate: I("JSXElement", "JSXFragment", "StringLiteral", "JSXExpressionContainer")
|
|
3813
|
+
}
|
|
3814
|
+
}
|
|
3815
|
+
}), W("JSXClosingElement", {
|
|
3816
|
+
visitor: ["name"],
|
|
3817
|
+
aliases: ["Immutable"],
|
|
3818
|
+
fields: { name: { validate: I("JSXIdentifier", "JSXMemberExpression", "JSXNamespacedName") } }
|
|
3819
|
+
}), W("JSXElement", {
|
|
3820
|
+
builder: [
|
|
3821
|
+
"openingElement",
|
|
3822
|
+
"closingElement",
|
|
3823
|
+
"children"
|
|
3824
|
+
],
|
|
3825
|
+
visitor: [
|
|
3826
|
+
"openingElement",
|
|
3827
|
+
"children",
|
|
3828
|
+
"closingElement"
|
|
3829
|
+
],
|
|
3830
|
+
aliases: ["Immutable", "Expression"],
|
|
3831
|
+
fields: {
|
|
3832
|
+
openingElement: { validate: I("JSXOpeningElement") },
|
|
3833
|
+
closingElement: {
|
|
3834
|
+
optional: !0,
|
|
3835
|
+
validate: I("JSXClosingElement")
|
|
3836
|
+
},
|
|
3837
|
+
children: N("JSXText", "JSXExpressionContainer", "JSXSpreadChild", "JSXElement", "JSXFragment")
|
|
3838
|
+
}
|
|
3839
|
+
}), W("JSXEmptyExpression", {}), W("JSXExpressionContainer", {
|
|
3840
|
+
visitor: ["expression"],
|
|
3841
|
+
aliases: ["Immutable"],
|
|
3842
|
+
fields: { expression: { validate: I("Expression", "JSXEmptyExpression") } }
|
|
3843
|
+
}), W("JSXSpreadChild", {
|
|
3844
|
+
visitor: ["expression"],
|
|
3845
|
+
aliases: ["Immutable"],
|
|
3846
|
+
fields: { expression: { validate: I("Expression") } }
|
|
3847
|
+
}), W("JSXIdentifier", {
|
|
3848
|
+
builder: ["name"],
|
|
3849
|
+
fields: { name: { validate: L("string") } }
|
|
3850
|
+
}), W("JSXMemberExpression", {
|
|
3851
|
+
visitor: ["object", "property"],
|
|
3852
|
+
fields: {
|
|
3853
|
+
object: { validate: I("JSXMemberExpression", "JSXIdentifier") },
|
|
3854
|
+
property: { validate: I("JSXIdentifier") }
|
|
3855
|
+
}
|
|
3856
|
+
}), W("JSXNamespacedName", {
|
|
3857
|
+
visitor: ["namespace", "name"],
|
|
3858
|
+
fields: {
|
|
3859
|
+
namespace: { validate: I("JSXIdentifier") },
|
|
3860
|
+
name: { validate: I("JSXIdentifier") }
|
|
3861
|
+
}
|
|
3862
|
+
}), W("JSXOpeningElement", {
|
|
3863
|
+
builder: [
|
|
3864
|
+
"name",
|
|
3865
|
+
"attributes",
|
|
3866
|
+
"selfClosing"
|
|
3867
|
+
],
|
|
3868
|
+
visitor: [
|
|
3869
|
+
"name",
|
|
3870
|
+
"typeArguments",
|
|
3871
|
+
"attributes"
|
|
3872
|
+
],
|
|
3873
|
+
aliases: ["Immutable"],
|
|
3874
|
+
fields: {
|
|
3875
|
+
name: { validate: I("JSXIdentifier", "JSXMemberExpression", "JSXNamespacedName") },
|
|
3876
|
+
selfClosing: { default: !1 },
|
|
3877
|
+
attributes: N("JSXAttribute", "JSXSpreadAttribute"),
|
|
3878
|
+
typeArguments: {
|
|
3879
|
+
validate: I("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
|
|
3880
|
+
optional: !0
|
|
3881
|
+
}
|
|
3882
|
+
}
|
|
3883
|
+
}), W("JSXSpreadAttribute", {
|
|
3884
|
+
visitor: ["argument"],
|
|
3885
|
+
fields: { argument: { validate: I("Expression") } }
|
|
3886
|
+
}), W("JSXText", {
|
|
3887
|
+
aliases: ["Immutable"],
|
|
3888
|
+
builder: ["value"],
|
|
3889
|
+
fields: { value: { validate: L("string") } }
|
|
3890
|
+
}), W("JSXFragment", {
|
|
3891
|
+
builder: [
|
|
3892
|
+
"openingFragment",
|
|
3893
|
+
"closingFragment",
|
|
3894
|
+
"children"
|
|
3895
|
+
],
|
|
3896
|
+
visitor: [
|
|
3897
|
+
"openingFragment",
|
|
3898
|
+
"children",
|
|
3899
|
+
"closingFragment"
|
|
3900
|
+
],
|
|
3901
|
+
aliases: ["Immutable", "Expression"],
|
|
3902
|
+
fields: {
|
|
3903
|
+
openingFragment: { validate: I("JSXOpeningFragment") },
|
|
3904
|
+
closingFragment: { validate: I("JSXClosingFragment") },
|
|
3905
|
+
children: N("JSXText", "JSXExpressionContainer", "JSXSpreadChild", "JSXElement", "JSXFragment")
|
|
3906
|
+
}
|
|
3907
|
+
}), W("JSXOpeningFragment", { aliases: ["Immutable"] }), W("JSXClosingFragment", { aliases: ["Immutable"] });
|
|
3908
|
+
var gt = [
|
|
3909
|
+
"Identifier",
|
|
3910
|
+
"StringLiteral",
|
|
3911
|
+
"Expression",
|
|
3912
|
+
"Statement",
|
|
3913
|
+
"Declaration",
|
|
3914
|
+
"BlockStatement",
|
|
3915
|
+
"ClassBody",
|
|
3916
|
+
"Pattern"
|
|
3917
|
+
], _t = {
|
|
3918
|
+
Declaration: ["Statement"],
|
|
3919
|
+
Pattern: ["PatternLike", "LVal"]
|
|
3920
|
+
};
|
|
3921
|
+
for (let e of gt) {
|
|
3922
|
+
let t = We[e];
|
|
3923
|
+
t?.length && (_t[e] = t);
|
|
3924
|
+
}
|
|
3925
|
+
var vt = {};
|
|
3926
|
+
Object.keys(_t).forEach((e) => {
|
|
3927
|
+
_t[e].forEach((t) => {
|
|
3928
|
+
Object.hasOwn(vt, t) || (vt[t] = []), vt[t].push(e);
|
|
3929
|
+
});
|
|
3930
|
+
});
|
|
3931
|
+
var yt = z("Miscellaneous");
|
|
3932
|
+
yt("Placeholder", {
|
|
3933
|
+
visitor: [],
|
|
3934
|
+
builder: ["expectedNode", "name"],
|
|
3935
|
+
fields: {
|
|
3936
|
+
name: { validate: I("Identifier") },
|
|
3937
|
+
expectedNode: { validate: F(...gt) },
|
|
3938
|
+
...ut()
|
|
3939
|
+
}
|
|
3940
|
+
}), yt("V8IntrinsicIdentifier", {
|
|
3941
|
+
builder: ["name"],
|
|
3942
|
+
fields: { name: { validate: L("string") } }
|
|
3943
|
+
}), B("ArgumentPlaceholder", {}), B("BindExpression", {
|
|
3944
|
+
visitor: ["object", "callee"],
|
|
3945
|
+
aliases: ["Expression"],
|
|
3946
|
+
fields: {
|
|
3947
|
+
object: { validate: $e("null", "Expression") },
|
|
3948
|
+
callee: { validate: I("Expression") }
|
|
3949
|
+
}
|
|
3950
|
+
}), B("ClassAccessorProperty", {
|
|
3951
|
+
visitor: [
|
|
3952
|
+
"decorators",
|
|
3953
|
+
"key",
|
|
3954
|
+
"typeAnnotation",
|
|
3955
|
+
"value"
|
|
3956
|
+
],
|
|
3957
|
+
builder: [
|
|
3958
|
+
"key",
|
|
3959
|
+
"value",
|
|
3960
|
+
"typeAnnotation",
|
|
3961
|
+
"decorators",
|
|
3962
|
+
"computed",
|
|
3963
|
+
"static"
|
|
3964
|
+
],
|
|
3965
|
+
aliases: ["Property", "Accessor"],
|
|
3966
|
+
...V(!0),
|
|
3967
|
+
fields: {
|
|
3968
|
+
...ft(),
|
|
3969
|
+
key: { validate: R(function() {
|
|
3970
|
+
let e = I("Identifier", "StringLiteral", "NumericLiteral", "BigIntLiteral", "PrivateName"), t = I("Expression");
|
|
3971
|
+
return function(n, r, i) {
|
|
3972
|
+
(n.computed ? t : e)(n, r, i);
|
|
3973
|
+
};
|
|
3974
|
+
}(), I("Identifier", "StringLiteral", "NumericLiteral", "BigIntLiteral", "Expression", "PrivateName")) },
|
|
3975
|
+
value: {
|
|
3976
|
+
validate: I("Expression"),
|
|
3977
|
+
optional: !0
|
|
3978
|
+
},
|
|
3979
|
+
definite: {
|
|
3980
|
+
validate: L("boolean"),
|
|
3981
|
+
optional: !0
|
|
3982
|
+
},
|
|
3983
|
+
typeAnnotation: {
|
|
3984
|
+
validate: I("TypeAnnotation", "TSTypeAnnotation"),
|
|
3985
|
+
optional: !0
|
|
3986
|
+
},
|
|
3987
|
+
decorators: {
|
|
3988
|
+
validate: M("Decorator"),
|
|
3989
|
+
optional: !0
|
|
3990
|
+
},
|
|
3991
|
+
readonly: {
|
|
3992
|
+
validate: L("boolean"),
|
|
3993
|
+
optional: !0
|
|
3994
|
+
},
|
|
3995
|
+
declare: {
|
|
3996
|
+
validate: L("boolean"),
|
|
3997
|
+
optional: !0
|
|
3998
|
+
},
|
|
3999
|
+
variance: {
|
|
4000
|
+
validate: I("Variance"),
|
|
4001
|
+
optional: !0
|
|
4002
|
+
}
|
|
4003
|
+
}
|
|
4004
|
+
}), B("Decorator", {
|
|
4005
|
+
visitor: ["expression"],
|
|
4006
|
+
fields: { expression: { validate: I("Expression") } }
|
|
4007
|
+
}), B("DoExpression", {
|
|
4008
|
+
visitor: ["body"],
|
|
4009
|
+
builder: ["body", "async"],
|
|
4010
|
+
aliases: ["Expression"],
|
|
4011
|
+
fields: {
|
|
4012
|
+
body: { validate: I("BlockStatement") },
|
|
4013
|
+
async: {
|
|
4014
|
+
validate: L("boolean"),
|
|
4015
|
+
default: !1
|
|
4016
|
+
}
|
|
4017
|
+
}
|
|
4018
|
+
}), B("ExportDefaultSpecifier", {
|
|
4019
|
+
visitor: ["exported"],
|
|
4020
|
+
aliases: ["ModuleSpecifier"],
|
|
4021
|
+
fields: { exported: { validate: I("Identifier") } }
|
|
4022
|
+
}), B("ModuleExpression", {
|
|
4023
|
+
visitor: ["body"],
|
|
4024
|
+
fields: { body: { validate: I("Program") } },
|
|
4025
|
+
aliases: ["Expression"]
|
|
4026
|
+
}), B("TopicReference", { aliases: ["Expression"] }), B("VoidPattern", { aliases: [
|
|
4027
|
+
"Pattern",
|
|
4028
|
+
"PatternLike",
|
|
4029
|
+
"FunctionParameter"
|
|
4030
|
+
] });
|
|
4031
|
+
var G = z("TypeScript"), K = L("boolean"), bt = () => ({
|
|
4032
|
+
returnType: {
|
|
4033
|
+
validate: I("TSTypeAnnotation"),
|
|
4034
|
+
optional: !0
|
|
4035
|
+
},
|
|
4036
|
+
typeParameters: {
|
|
4037
|
+
validate: I("TSTypeParameterDeclaration"),
|
|
4038
|
+
optional: !0
|
|
4039
|
+
}
|
|
4040
|
+
});
|
|
4041
|
+
G("TSParameterProperty", {
|
|
4042
|
+
aliases: [],
|
|
4043
|
+
visitor: ["parameter"],
|
|
4044
|
+
fields: {
|
|
4045
|
+
accessibility: {
|
|
4046
|
+
validate: F("public", "private", "protected"),
|
|
4047
|
+
optional: !0
|
|
4048
|
+
},
|
|
4049
|
+
readonly: {
|
|
4050
|
+
validate: L("boolean"),
|
|
4051
|
+
optional: !0
|
|
4052
|
+
},
|
|
4053
|
+
parameter: { validate: I("Identifier", "AssignmentPattern") },
|
|
4054
|
+
override: {
|
|
4055
|
+
validate: L("boolean"),
|
|
4056
|
+
optional: !0
|
|
4057
|
+
},
|
|
4058
|
+
decorators: {
|
|
4059
|
+
validate: M("Decorator"),
|
|
4060
|
+
optional: !0
|
|
4061
|
+
}
|
|
4062
|
+
}
|
|
4063
|
+
}), G("TSDeclareFunction", {
|
|
4064
|
+
aliases: ["Statement", "Declaration"],
|
|
4065
|
+
visitor: [
|
|
4066
|
+
"id",
|
|
4067
|
+
"typeParameters",
|
|
4068
|
+
"params",
|
|
4069
|
+
"returnType"
|
|
4070
|
+
],
|
|
4071
|
+
fields: {
|
|
4072
|
+
...lt(),
|
|
4073
|
+
...bt()
|
|
4074
|
+
}
|
|
4075
|
+
}), G("TSDeclareMethod", {
|
|
4076
|
+
visitor: [
|
|
4077
|
+
"key",
|
|
4078
|
+
"typeParameters",
|
|
4079
|
+
"params",
|
|
4080
|
+
"returnType"
|
|
4081
|
+
],
|
|
4082
|
+
...V(!0),
|
|
4083
|
+
fields: {
|
|
4084
|
+
...pt(!1),
|
|
4085
|
+
...bt()
|
|
4086
|
+
}
|
|
4087
|
+
}), G("TSQualifiedName", {
|
|
4088
|
+
aliases: ["TSEntityName"],
|
|
4089
|
+
visitor: ["left", "right"],
|
|
4090
|
+
fields: {
|
|
4091
|
+
left: O("TSEntityName"),
|
|
4092
|
+
right: O("Identifier")
|
|
4093
|
+
}
|
|
4094
|
+
});
|
|
4095
|
+
var xt = () => ({
|
|
4096
|
+
typeParameters: j("TSTypeParameterDeclaration"),
|
|
4097
|
+
params: N("ArrayPattern", "Identifier", "ObjectPattern", "RestElement"),
|
|
4098
|
+
returnType: j("TSTypeAnnotation")
|
|
4099
|
+
}), St = {
|
|
4100
|
+
aliases: ["TSTypeElement"],
|
|
4101
|
+
visitor: [
|
|
4102
|
+
"typeParameters",
|
|
4103
|
+
"params",
|
|
4104
|
+
"returnType"
|
|
4105
|
+
],
|
|
4106
|
+
fields: xt()
|
|
4107
|
+
};
|
|
4108
|
+
G("TSCallSignatureDeclaration", St), G("TSConstructSignatureDeclaration", St);
|
|
4109
|
+
var Ct = () => ({
|
|
4110
|
+
key: O("Expression"),
|
|
4111
|
+
computed: { default: !1 },
|
|
4112
|
+
optional: k(K)
|
|
4113
|
+
});
|
|
4114
|
+
G("TSPropertySignature", {
|
|
4115
|
+
aliases: ["TSTypeElement"],
|
|
4116
|
+
visitor: ["key", "typeAnnotation"],
|
|
4117
|
+
fields: {
|
|
4118
|
+
...Ct(),
|
|
4119
|
+
readonly: k(K),
|
|
4120
|
+
typeAnnotation: j("TSTypeAnnotation"),
|
|
4121
|
+
kind: {
|
|
4122
|
+
optional: !0,
|
|
4123
|
+
validate: F("get", "set")
|
|
4124
|
+
}
|
|
4125
|
+
}
|
|
4126
|
+
}), G("TSMethodSignature", {
|
|
4127
|
+
aliases: ["TSTypeElement"],
|
|
4128
|
+
visitor: [
|
|
4129
|
+
"key",
|
|
4130
|
+
"typeParameters",
|
|
4131
|
+
"params",
|
|
4132
|
+
"returnType"
|
|
4133
|
+
],
|
|
4134
|
+
fields: {
|
|
4135
|
+
...xt(),
|
|
4136
|
+
...Ct(),
|
|
4137
|
+
kind: {
|
|
4138
|
+
validate: F("method", "get", "set"),
|
|
4139
|
+
default: "method"
|
|
4140
|
+
}
|
|
4141
|
+
}
|
|
4142
|
+
}), G("TSIndexSignature", {
|
|
4143
|
+
aliases: ["TSTypeElement"],
|
|
4144
|
+
visitor: ["parameters", "typeAnnotation"],
|
|
4145
|
+
fields: {
|
|
4146
|
+
readonly: k(K),
|
|
4147
|
+
static: k(K),
|
|
4148
|
+
parameters: N("Identifier"),
|
|
4149
|
+
typeAnnotation: j("TSTypeAnnotation")
|
|
4150
|
+
}
|
|
4151
|
+
});
|
|
4152
|
+
for (let e of [
|
|
4153
|
+
"TSAnyKeyword",
|
|
4154
|
+
"TSBooleanKeyword",
|
|
4155
|
+
"TSBigIntKeyword",
|
|
4156
|
+
"TSIntrinsicKeyword",
|
|
4157
|
+
"TSNeverKeyword",
|
|
4158
|
+
"TSNullKeyword",
|
|
4159
|
+
"TSNumberKeyword",
|
|
4160
|
+
"TSObjectKeyword",
|
|
4161
|
+
"TSStringKeyword",
|
|
4162
|
+
"TSSymbolKeyword",
|
|
4163
|
+
"TSUndefinedKeyword",
|
|
4164
|
+
"TSUnknownKeyword",
|
|
4165
|
+
"TSVoidKeyword"
|
|
4166
|
+
]) G(e, {
|
|
4167
|
+
aliases: ["TSType", "TSBaseType"],
|
|
4168
|
+
visitor: [],
|
|
4169
|
+
fields: {}
|
|
4170
|
+
});
|
|
4171
|
+
G("TSThisType", {
|
|
4172
|
+
aliases: ["TSType", "TSBaseType"],
|
|
4173
|
+
visitor: [],
|
|
4174
|
+
fields: {}
|
|
4175
|
+
});
|
|
4176
|
+
var wt = {
|
|
4177
|
+
aliases: ["TSType"],
|
|
4178
|
+
visitor: [
|
|
4179
|
+
"typeParameters",
|
|
4180
|
+
"params",
|
|
4181
|
+
"returnType"
|
|
4182
|
+
]
|
|
4183
|
+
};
|
|
4184
|
+
G("TSFunctionType", {
|
|
4185
|
+
...wt,
|
|
4186
|
+
fields: xt()
|
|
4187
|
+
}), G("TSConstructorType", {
|
|
4188
|
+
...wt,
|
|
4189
|
+
fields: {
|
|
4190
|
+
...xt(),
|
|
4191
|
+
abstract: k(K)
|
|
4192
|
+
}
|
|
4193
|
+
}), G("TSTypeReference", {
|
|
4194
|
+
aliases: ["TSType"],
|
|
4195
|
+
visitor: ["typeName", "typeArguments"],
|
|
4196
|
+
fields: {
|
|
4197
|
+
typeName: O("TSEntityName"),
|
|
4198
|
+
typeArguments: j("TSTypeParameterInstantiation")
|
|
4199
|
+
}
|
|
4200
|
+
}), G("TSTypePredicate", {
|
|
4201
|
+
aliases: ["TSType"],
|
|
4202
|
+
visitor: ["parameterName", "typeAnnotation"],
|
|
4203
|
+
builder: [
|
|
4204
|
+
"parameterName",
|
|
4205
|
+
"typeAnnotation",
|
|
4206
|
+
"asserts"
|
|
4207
|
+
],
|
|
4208
|
+
fields: {
|
|
4209
|
+
parameterName: O("Identifier", "TSThisType"),
|
|
4210
|
+
typeAnnotation: j("TSTypeAnnotation"),
|
|
4211
|
+
asserts: k(K)
|
|
4212
|
+
}
|
|
4213
|
+
}), G("TSTypeQuery", {
|
|
4214
|
+
aliases: ["TSType"],
|
|
4215
|
+
visitor: ["exprName", "typeArguments"],
|
|
4216
|
+
fields: {
|
|
4217
|
+
exprName: O("TSEntityName", "TSImportType"),
|
|
4218
|
+
typeArguments: j("TSTypeParameterInstantiation")
|
|
4219
|
+
}
|
|
4220
|
+
}), G("TSTypeLiteral", {
|
|
4221
|
+
aliases: ["TSType"],
|
|
4222
|
+
visitor: ["members"],
|
|
4223
|
+
fields: { members: N("TSTypeElement") }
|
|
4224
|
+
}), G("TSArrayType", {
|
|
4225
|
+
aliases: ["TSType"],
|
|
4226
|
+
visitor: ["elementType"],
|
|
4227
|
+
fields: { elementType: O("TSType") }
|
|
4228
|
+
}), G("TSTupleType", {
|
|
4229
|
+
aliases: ["TSType"],
|
|
4230
|
+
visitor: ["elementTypes"],
|
|
4231
|
+
fields: { elementTypes: N("TSType", "TSNamedTupleMember") }
|
|
4232
|
+
}), G("TSOptionalType", {
|
|
4233
|
+
aliases: ["TSType"],
|
|
4234
|
+
visitor: ["typeAnnotation"],
|
|
4235
|
+
fields: { typeAnnotation: O("TSType") }
|
|
4236
|
+
}), G("TSRestType", {
|
|
4237
|
+
aliases: ["TSType"],
|
|
4238
|
+
visitor: ["typeAnnotation"],
|
|
4239
|
+
fields: { typeAnnotation: O("TSType") }
|
|
4240
|
+
}), G("TSNamedTupleMember", {
|
|
4241
|
+
aliases: ["TSType"],
|
|
4242
|
+
visitor: ["label", "elementType"],
|
|
4243
|
+
builder: [
|
|
4244
|
+
"label",
|
|
4245
|
+
"elementType",
|
|
4246
|
+
"optional"
|
|
4247
|
+
],
|
|
4248
|
+
fields: {
|
|
4249
|
+
label: O("Identifier"),
|
|
4250
|
+
optional: {
|
|
4251
|
+
validate: K,
|
|
4252
|
+
default: !1
|
|
4253
|
+
},
|
|
4254
|
+
elementType: O("TSType")
|
|
4255
|
+
}
|
|
4256
|
+
});
|
|
4257
|
+
var Tt = {
|
|
4258
|
+
aliases: ["TSType"],
|
|
4259
|
+
visitor: ["types"],
|
|
4260
|
+
fields: { types: N("TSType") }
|
|
4261
|
+
};
|
|
4262
|
+
G("TSUnionType", Tt), G("TSIntersectionType", Tt), G("TSConditionalType", {
|
|
4263
|
+
aliases: ["TSType"],
|
|
4264
|
+
visitor: [
|
|
4265
|
+
"checkType",
|
|
4266
|
+
"extendsType",
|
|
4267
|
+
"trueType",
|
|
4268
|
+
"falseType"
|
|
4269
|
+
],
|
|
4270
|
+
fields: {
|
|
4271
|
+
checkType: O("TSType"),
|
|
4272
|
+
extendsType: O("TSType"),
|
|
4273
|
+
trueType: O("TSType"),
|
|
4274
|
+
falseType: O("TSType")
|
|
4275
|
+
}
|
|
4276
|
+
}), G("TSInferType", {
|
|
4277
|
+
aliases: ["TSType"],
|
|
4278
|
+
visitor: ["typeParameter"],
|
|
4279
|
+
fields: { typeParameter: O("TSTypeParameter") }
|
|
4280
|
+
}), G("TSParenthesizedType", {
|
|
4281
|
+
aliases: ["TSType"],
|
|
4282
|
+
visitor: ["typeAnnotation"],
|
|
4283
|
+
fields: { typeAnnotation: O("TSType") }
|
|
4284
|
+
}), G("TSTypeOperator", {
|
|
4285
|
+
aliases: ["TSType"],
|
|
4286
|
+
visitor: ["typeAnnotation"],
|
|
4287
|
+
builder: ["typeAnnotation", "operator"],
|
|
4288
|
+
fields: {
|
|
4289
|
+
operator: {
|
|
4290
|
+
validate: F("keyof", "readonly", "unique"),
|
|
4291
|
+
default: void 0
|
|
4292
|
+
},
|
|
4293
|
+
typeAnnotation: O("TSType")
|
|
4294
|
+
}
|
|
4295
|
+
}), G("TSIndexedAccessType", {
|
|
4296
|
+
aliases: ["TSType"],
|
|
4297
|
+
visitor: ["objectType", "indexType"],
|
|
4298
|
+
fields: {
|
|
4299
|
+
objectType: O("TSType"),
|
|
4300
|
+
indexType: O("TSType")
|
|
4301
|
+
}
|
|
4302
|
+
}), G("TSMappedType", {
|
|
4303
|
+
aliases: ["TSType"],
|
|
4304
|
+
visitor: [
|
|
4305
|
+
"key",
|
|
4306
|
+
"constraint",
|
|
4307
|
+
"nameType",
|
|
4308
|
+
"typeAnnotation"
|
|
4309
|
+
],
|
|
4310
|
+
builder: [
|
|
4311
|
+
"key",
|
|
4312
|
+
"constraint",
|
|
4313
|
+
"nameType",
|
|
4314
|
+
"typeAnnotation"
|
|
4315
|
+
],
|
|
4316
|
+
fields: {
|
|
4317
|
+
key: O("Identifier"),
|
|
4318
|
+
constraint: O("TSType"),
|
|
4319
|
+
readonly: k(F(!0, !1, "+", "-")),
|
|
4320
|
+
optional: k(F(!0, !1, "+", "-")),
|
|
4321
|
+
typeAnnotation: j("TSType"),
|
|
4322
|
+
nameType: j("TSType")
|
|
4323
|
+
}
|
|
4324
|
+
}), G("TSTemplateLiteralType", {
|
|
4325
|
+
aliases: ["TSType", "TSBaseType"],
|
|
4326
|
+
visitor: ["quasis", "types"],
|
|
4327
|
+
fields: {
|
|
4328
|
+
quasis: N("TemplateElement"),
|
|
4329
|
+
types: { validate: R(L("array"), P(I("TSType")), function(e, t, n) {
|
|
4330
|
+
if (e.quasis.length !== n.length + 1) throw TypeError(`Number of ${e.type} quasis should be exactly one more than the number of types.\nExpected ${n.length + 1} quasis but got ${e.quasis.length}`);
|
|
4331
|
+
}) }
|
|
4332
|
+
}
|
|
4333
|
+
}), G("TSLiteralType", {
|
|
4334
|
+
aliases: ["TSType", "TSBaseType"],
|
|
4335
|
+
visitor: ["literal"],
|
|
4336
|
+
fields: { literal: { validate: function() {
|
|
4337
|
+
let e = I("NumericLiteral", "BigIntLiteral"), t = F("-"), n = I("NumericLiteral", "StringLiteral", "BooleanLiteral", "BigIntLiteral", "TemplateLiteral");
|
|
4338
|
+
return E(function(r, i, a) {
|
|
4339
|
+
w("UnaryExpression", a) ? (t(a, "operator", a.operator), e(a, "argument", a.argument)) : n(r, i, a);
|
|
4340
|
+
}, { oneOfNodeTypes: [
|
|
4341
|
+
"NumericLiteral",
|
|
4342
|
+
"StringLiteral",
|
|
4343
|
+
"BooleanLiteral",
|
|
4344
|
+
"BigIntLiteral",
|
|
4345
|
+
"TemplateLiteral",
|
|
4346
|
+
"UnaryExpression"
|
|
4347
|
+
] });
|
|
4348
|
+
}() } }
|
|
4349
|
+
}), G("TSClassImplements", {
|
|
4350
|
+
aliases: ["TSType"],
|
|
4351
|
+
visitor: ["expression", "typeArguments"],
|
|
4352
|
+
fields: {
|
|
4353
|
+
expression: O("Expression"),
|
|
4354
|
+
typeArguments: j("TSTypeParameterInstantiation")
|
|
4355
|
+
}
|
|
4356
|
+
}), G("TSInterfaceHeritage", {
|
|
4357
|
+
aliases: ["TSType"],
|
|
4358
|
+
visitor: ["expression", "typeArguments"],
|
|
4359
|
+
fields: {
|
|
4360
|
+
expression: O("Expression"),
|
|
4361
|
+
typeArguments: j("TSTypeParameterInstantiation")
|
|
4362
|
+
}
|
|
4363
|
+
}), G("TSInterfaceDeclaration", {
|
|
4364
|
+
aliases: ["Statement", "Declaration"],
|
|
4365
|
+
visitor: [
|
|
4366
|
+
"id",
|
|
4367
|
+
"typeParameters",
|
|
4368
|
+
"extends",
|
|
4369
|
+
"body"
|
|
4370
|
+
],
|
|
4371
|
+
fields: {
|
|
4372
|
+
declare: k(K),
|
|
4373
|
+
id: O("Identifier"),
|
|
4374
|
+
typeParameters: j("TSTypeParameterDeclaration"),
|
|
4375
|
+
extends: k(M("TSInterfaceHeritage")),
|
|
4376
|
+
body: O("TSInterfaceBody")
|
|
4377
|
+
}
|
|
4378
|
+
}), G("TSInterfaceBody", {
|
|
4379
|
+
visitor: ["body"],
|
|
4380
|
+
fields: { body: N("TSTypeElement") }
|
|
4381
|
+
}), G("TSTypeAliasDeclaration", {
|
|
4382
|
+
aliases: ["Statement", "Declaration"],
|
|
4383
|
+
visitor: [
|
|
4384
|
+
"id",
|
|
4385
|
+
"typeParameters",
|
|
4386
|
+
"typeAnnotation"
|
|
4387
|
+
],
|
|
4388
|
+
fields: {
|
|
4389
|
+
declare: k(K),
|
|
4390
|
+
id: O("Identifier"),
|
|
4391
|
+
typeParameters: j("TSTypeParameterDeclaration"),
|
|
4392
|
+
typeAnnotation: O("TSType")
|
|
4393
|
+
}
|
|
4394
|
+
}), G("TSInstantiationExpression", {
|
|
4395
|
+
aliases: ["Expression"],
|
|
4396
|
+
visitor: ["expression", "typeArguments"],
|
|
4397
|
+
fields: {
|
|
4398
|
+
expression: O("Expression"),
|
|
4399
|
+
typeArguments: j("TSTypeParameterInstantiation")
|
|
4400
|
+
}
|
|
4401
|
+
});
|
|
4402
|
+
var Et = {
|
|
4403
|
+
aliases: [
|
|
4404
|
+
"Expression",
|
|
4405
|
+
"LVal",
|
|
4406
|
+
"PatternLike"
|
|
4407
|
+
],
|
|
4408
|
+
visitor: ["expression", "typeAnnotation"],
|
|
4409
|
+
fields: {
|
|
4410
|
+
expression: O("Expression"),
|
|
4411
|
+
typeAnnotation: O("TSType")
|
|
4412
|
+
}
|
|
4413
|
+
};
|
|
4414
|
+
G("TSAsExpression", Et), G("TSSatisfiesExpression", Et), G("TSTypeAssertion", {
|
|
4415
|
+
aliases: [
|
|
4416
|
+
"Expression",
|
|
4417
|
+
"LVal",
|
|
4418
|
+
"PatternLike"
|
|
4419
|
+
],
|
|
4420
|
+
visitor: ["typeAnnotation", "expression"],
|
|
4421
|
+
fields: {
|
|
4422
|
+
typeAnnotation: O("TSType"),
|
|
4423
|
+
expression: O("Expression")
|
|
4424
|
+
}
|
|
4425
|
+
}), G("TSEnumBody", {
|
|
4426
|
+
visitor: ["members"],
|
|
4427
|
+
fields: { members: N("TSEnumMember") }
|
|
4428
|
+
}), G("TSEnumDeclaration", {
|
|
4429
|
+
aliases: ["Statement", "Declaration"],
|
|
4430
|
+
visitor: ["id", "body"],
|
|
4431
|
+
fields: {
|
|
4432
|
+
declare: k(K),
|
|
4433
|
+
const: k(K),
|
|
4434
|
+
id: O("Identifier"),
|
|
4435
|
+
body: O("TSEnumBody")
|
|
4436
|
+
}
|
|
4437
|
+
}), G("TSEnumMember", {
|
|
4438
|
+
visitor: ["id", "initializer"],
|
|
4439
|
+
fields: {
|
|
4440
|
+
id: O("Identifier", "StringLiteral"),
|
|
4441
|
+
initializer: j("Expression")
|
|
4442
|
+
}
|
|
4443
|
+
}), G("TSModuleDeclaration", {
|
|
4444
|
+
aliases: ["Statement", "Declaration"],
|
|
4445
|
+
visitor: ["id", "body"],
|
|
4446
|
+
fields: {
|
|
4447
|
+
kind: {
|
|
4448
|
+
validate: F("global", "namespace", "module"),
|
|
4449
|
+
default: "namespace"
|
|
4450
|
+
},
|
|
4451
|
+
declare: k(K),
|
|
4452
|
+
id: { validate: R(I("TSEntityName", "StringLiteral"), E(function(e, t, n) {
|
|
4453
|
+
if (e.kind === "namespace" && w("StringLiteral", n)) throw TypeError("TSModuleDeclaration of kind 'namespace' cannot have a StringLiteral id.");
|
|
4454
|
+
}, { oneOfNodeTypes: ["TSEntityName", "StringLiteral"] })) },
|
|
4455
|
+
body: O("TSModuleBlock")
|
|
4456
|
+
}
|
|
4457
|
+
}), G("TSModuleBlock", {
|
|
4458
|
+
aliases: [
|
|
4459
|
+
"Scopable",
|
|
4460
|
+
"Block",
|
|
4461
|
+
"BlockParent",
|
|
4462
|
+
"FunctionParent"
|
|
4463
|
+
],
|
|
4464
|
+
visitor: ["body"],
|
|
4465
|
+
fields: { body: N("Statement") }
|
|
4466
|
+
}), G("TSImportType", {
|
|
4467
|
+
aliases: ["TSType"],
|
|
4468
|
+
builder: [
|
|
4469
|
+
"source",
|
|
4470
|
+
"qualifier",
|
|
4471
|
+
"typeArguments"
|
|
4472
|
+
],
|
|
4473
|
+
visitor: [
|
|
4474
|
+
"source",
|
|
4475
|
+
"options",
|
|
4476
|
+
"qualifier",
|
|
4477
|
+
"typeArguments"
|
|
4478
|
+
],
|
|
4479
|
+
fields: {
|
|
4480
|
+
source: O("StringLiteral"),
|
|
4481
|
+
qualifier: j("TSEntityName"),
|
|
4482
|
+
typeArguments: j("TSTypeParameterInstantiation"),
|
|
4483
|
+
options: {
|
|
4484
|
+
validate: I("ObjectExpression"),
|
|
4485
|
+
optional: !0
|
|
4486
|
+
}
|
|
4487
|
+
}
|
|
4488
|
+
}), G("TSImportEqualsDeclaration", {
|
|
4489
|
+
aliases: ["Statement", "Declaration"],
|
|
4490
|
+
visitor: ["id", "moduleReference"],
|
|
4491
|
+
fields: {
|
|
4492
|
+
id: O("Identifier"),
|
|
4493
|
+
moduleReference: O("TSEntityName", "TSExternalModuleReference"),
|
|
4494
|
+
importKind: {
|
|
4495
|
+
validate: F("type", "value"),
|
|
4496
|
+
optional: !0
|
|
4497
|
+
}
|
|
4498
|
+
}
|
|
4499
|
+
}), G("TSExternalModuleReference", {
|
|
4500
|
+
visitor: ["expression"],
|
|
4501
|
+
fields: { expression: O("StringLiteral") }
|
|
4502
|
+
}), G("TSNonNullExpression", {
|
|
4503
|
+
aliases: [
|
|
4504
|
+
"Expression",
|
|
4505
|
+
"LVal",
|
|
4506
|
+
"PatternLike"
|
|
4507
|
+
],
|
|
4508
|
+
visitor: ["expression"],
|
|
4509
|
+
fields: { expression: O("Expression") }
|
|
4510
|
+
}), G("TSExportAssignment", {
|
|
4511
|
+
aliases: ["Statement"],
|
|
4512
|
+
visitor: ["expression"],
|
|
4513
|
+
fields: { expression: O("Expression") }
|
|
4514
|
+
}), G("TSNamespaceExportDeclaration", {
|
|
4515
|
+
aliases: ["Statement"],
|
|
4516
|
+
visitor: ["id"],
|
|
4517
|
+
fields: { id: O("Identifier") }
|
|
4518
|
+
}), G("TSTypeAnnotation", {
|
|
4519
|
+
visitor: ["typeAnnotation"],
|
|
4520
|
+
fields: { typeAnnotation: { validate: I("TSType") } }
|
|
4521
|
+
}), G("TSTypeParameterInstantiation", {
|
|
4522
|
+
visitor: ["params"],
|
|
4523
|
+
fields: { params: N("TSType") }
|
|
4524
|
+
}), G("TSTypeParameterDeclaration", {
|
|
4525
|
+
visitor: ["params"],
|
|
4526
|
+
fields: { params: N("TSTypeParameter") }
|
|
4527
|
+
}), G("TSTypeParameter", {
|
|
4528
|
+
builder: [
|
|
4529
|
+
"constraint",
|
|
4530
|
+
"default",
|
|
4531
|
+
"name"
|
|
4532
|
+
],
|
|
4533
|
+
visitor: [
|
|
4534
|
+
"name",
|
|
4535
|
+
"constraint",
|
|
4536
|
+
"default"
|
|
4537
|
+
],
|
|
4538
|
+
fields: {
|
|
4539
|
+
name: { validate: I("Identifier") },
|
|
4540
|
+
in: {
|
|
4541
|
+
validate: L("boolean"),
|
|
4542
|
+
optional: !0
|
|
4543
|
+
},
|
|
4544
|
+
out: {
|
|
4545
|
+
validate: L("boolean"),
|
|
4546
|
+
optional: !0
|
|
4547
|
+
},
|
|
4548
|
+
const: {
|
|
4549
|
+
validate: L("boolean"),
|
|
4550
|
+
optional: !0
|
|
4551
|
+
},
|
|
4552
|
+
constraint: {
|
|
4553
|
+
validate: I("TSType"),
|
|
4554
|
+
optional: !0
|
|
4555
|
+
},
|
|
4556
|
+
default: {
|
|
4557
|
+
validate: I("TSType"),
|
|
4558
|
+
optional: !0
|
|
4559
|
+
}
|
|
4560
|
+
}
|
|
4561
|
+
});
|
|
4562
|
+
var Dt = { ModuleDeclaration: "ImportOrExportDeclaration" };
|
|
4563
|
+
Object.keys(Dt).forEach((e) => {
|
|
4564
|
+
T[e] = T[Dt[e]];
|
|
4565
|
+
});
|
|
4566
|
+
for (let { types: e, set: t } of Qe) for (let n of e) {
|
|
4567
|
+
let e = T[n];
|
|
4568
|
+
e ? e.forEach(t.add, t) : t.add(n);
|
|
4569
|
+
}
|
|
4570
|
+
[].concat(Object.keys(Ue), Object.keys(T), Object.keys(qe));
|
|
4571
|
+
function Ot(e, t, n) {
|
|
4572
|
+
if (!e) return;
|
|
4573
|
+
let r = Ge[e.type];
|
|
4574
|
+
if (!r) return;
|
|
4575
|
+
let i = r[t];
|
|
4576
|
+
At(e, t, n, i), jt(e, t, n);
|
|
4577
|
+
}
|
|
4578
|
+
function kt(e, t, n, r, i) {
|
|
4579
|
+
if (e?.validate && !(e.optional && r == null) && (e.validate(t, n, r), i)) {
|
|
4580
|
+
let e = r.type;
|
|
4581
|
+
if (e == null) return;
|
|
4582
|
+
Je[e]?.(t, n, r);
|
|
4583
|
+
}
|
|
4584
|
+
}
|
|
4585
|
+
function At(e, t, n, r) {
|
|
4586
|
+
r?.validate && (r.optional && n == null || r.validate(e, t, n));
|
|
4587
|
+
}
|
|
4588
|
+
function jt(e, t, n) {
|
|
4589
|
+
let r = n?.type;
|
|
4590
|
+
r != null && Je[r]?.(e, t, n);
|
|
4591
|
+
}
|
|
4592
|
+
var { validateInternal: q } = /* @__PURE__ */ Object.defineProperty({
|
|
4593
|
+
__proto__: null,
|
|
4594
|
+
default: Ot,
|
|
4595
|
+
validateChild: jt,
|
|
4596
|
+
validateField: At,
|
|
4597
|
+
validateInternal: kt
|
|
4598
|
+
}, Symbol.toStringTag, { value: "Module" }), { NODE_FIELDS: J } = at;
|
|
4599
|
+
function Mt(e, t, n) {
|
|
4600
|
+
let r = {
|
|
4601
|
+
type: "BinaryExpression",
|
|
4602
|
+
operator: e,
|
|
4603
|
+
left: t,
|
|
4604
|
+
right: n
|
|
4605
|
+
}, i = J.BinaryExpression;
|
|
4606
|
+
return q(i.operator, r, "operator", e), q(i.left, r, "left", t, 1), q(i.right, r, "right", n, 1), r;
|
|
4607
|
+
}
|
|
4608
|
+
function Nt(e, t = []) {
|
|
4609
|
+
let n = {
|
|
4610
|
+
type: "BlockStatement",
|
|
4611
|
+
body: e,
|
|
4612
|
+
directives: t
|
|
4613
|
+
}, r = J.BlockStatement;
|
|
4614
|
+
return q(r.body, n, "body", e, 1), q(r.directives, n, "directives", t, 1), n;
|
|
4615
|
+
}
|
|
4616
|
+
function Pt(e, t) {
|
|
4617
|
+
let n = {
|
|
4618
|
+
type: "CallExpression",
|
|
4619
|
+
callee: e,
|
|
4620
|
+
arguments: t
|
|
4621
|
+
}, r = J.CallExpression;
|
|
4622
|
+
return q(r.callee, n, "callee", e, 1), q(r.arguments, n, "arguments", t, 1), n;
|
|
4623
|
+
}
|
|
4624
|
+
function Ft(e, t, n) {
|
|
4625
|
+
let r = {
|
|
4626
|
+
type: "ConditionalExpression",
|
|
4627
|
+
test: e,
|
|
4628
|
+
consequent: t,
|
|
4629
|
+
alternate: n
|
|
4630
|
+
}, i = J.ConditionalExpression;
|
|
4631
|
+
return q(i.test, r, "test", e, 1), q(i.consequent, r, "consequent", t, 1), q(i.alternate, r, "alternate", n, 1), r;
|
|
4632
|
+
}
|
|
4633
|
+
function Y(e) {
|
|
4634
|
+
let t = {
|
|
4635
|
+
type: "Identifier",
|
|
4636
|
+
name: e
|
|
4637
|
+
}, n = J.Identifier;
|
|
4638
|
+
return q(n.name, t, "name", e), t;
|
|
4639
|
+
}
|
|
4640
|
+
function X(e) {
|
|
4641
|
+
let t = {
|
|
4642
|
+
type: "StringLiteral",
|
|
4643
|
+
value: e
|
|
4644
|
+
}, n = J.StringLiteral;
|
|
4645
|
+
return q(n.value, t, "value", e), t;
|
|
4646
|
+
}
|
|
4647
|
+
function It(e, t, n) {
|
|
4648
|
+
let r = {
|
|
4649
|
+
type: "LogicalExpression",
|
|
4650
|
+
operator: e,
|
|
4651
|
+
left: t,
|
|
4652
|
+
right: n
|
|
4653
|
+
}, i = J.LogicalExpression;
|
|
4654
|
+
return q(i.operator, r, "operator", e), q(i.left, r, "left", t, 1), q(i.right, r, "right", n, 1), r;
|
|
4655
|
+
}
|
|
4656
|
+
function Z(e, t, n = !1) {
|
|
4657
|
+
let r = {
|
|
4658
|
+
type: "MemberExpression",
|
|
4659
|
+
object: e,
|
|
4660
|
+
property: t,
|
|
4661
|
+
computed: n
|
|
4662
|
+
}, i = J.MemberExpression;
|
|
4663
|
+
return q(i.object, r, "object", e, 1), q(i.property, r, "property", t, 1), q(i.computed, r, "computed", n), r;
|
|
4664
|
+
}
|
|
4665
|
+
function Lt(e) {
|
|
4666
|
+
let t = {
|
|
4667
|
+
type: "ObjectExpression",
|
|
4668
|
+
properties: e
|
|
4669
|
+
}, n = J.ObjectExpression;
|
|
4670
|
+
return q(n.properties, t, "properties", e, 1), t;
|
|
4671
|
+
}
|
|
4672
|
+
function Rt(e, t, n = !1, r = !1) {
|
|
4673
|
+
let i = {
|
|
4674
|
+
type: "ObjectProperty",
|
|
4675
|
+
key: e,
|
|
4676
|
+
value: t,
|
|
4677
|
+
computed: n,
|
|
4678
|
+
shorthand: r
|
|
4679
|
+
}, a = J.ObjectProperty;
|
|
4680
|
+
return q(a.key, i, "key", e, 1), q(a.value, i, "value", t, 1), q(a.computed, i, "computed", n), q(a.shorthand, i, "shorthand", r), i;
|
|
4681
|
+
}
|
|
4682
|
+
function zt(e = null) {
|
|
4683
|
+
let t = {
|
|
4684
|
+
type: "ReturnStatement",
|
|
4685
|
+
argument: e
|
|
4686
|
+
}, n = J.ReturnStatement;
|
|
4687
|
+
return q(n.argument, t, "argument", e, 1), t;
|
|
4688
|
+
}
|
|
4689
|
+
function Bt(e, t) {
|
|
4690
|
+
let n = {
|
|
4691
|
+
type: "VariableDeclaration",
|
|
4692
|
+
kind: e,
|
|
4693
|
+
declarations: t
|
|
4694
|
+
}, r = J.VariableDeclaration;
|
|
4695
|
+
return q(r.kind, n, "kind", e), q(r.declarations, n, "declarations", t, 1), n;
|
|
4696
|
+
}
|
|
4697
|
+
function Vt(e, t = null) {
|
|
4698
|
+
let n = {
|
|
4699
|
+
type: "VariableDeclarator",
|
|
4700
|
+
id: e,
|
|
4701
|
+
init: t
|
|
4702
|
+
}, r = J.VariableDeclarator;
|
|
4703
|
+
return q(r.id, n, "id", e, 1), q(r.init, n, "init", t, 1), n;
|
|
4704
|
+
}
|
|
4705
|
+
function Ht(e, t) {
|
|
4706
|
+
let n = {
|
|
4707
|
+
type: "AssignmentPattern",
|
|
4708
|
+
left: e,
|
|
4709
|
+
right: t
|
|
4710
|
+
}, r = J.AssignmentPattern;
|
|
4711
|
+
return q(r.left, n, "left", e, 1), q(r.right, n, "right", t, 1), n;
|
|
4712
|
+
}
|
|
4713
|
+
function Ut(e, t, n = !1) {
|
|
4714
|
+
let r = {
|
|
4715
|
+
type: "ArrowFunctionExpression",
|
|
4716
|
+
params: e,
|
|
4717
|
+
body: t,
|
|
4718
|
+
async: n
|
|
4719
|
+
}, i = J.ArrowFunctionExpression;
|
|
4720
|
+
return q(i.params, r, "params", e, 1), q(i.body, r, "body", t, 1), q(i.async, r, "async", n), r;
|
|
4721
|
+
}
|
|
4722
|
+
function Wt(e, t, n = null) {
|
|
4723
|
+
let r = {
|
|
4724
|
+
type: "ImportDeclaration",
|
|
4725
|
+
specifiers: e,
|
|
4726
|
+
source: t,
|
|
4727
|
+
attributes: n
|
|
4728
|
+
}, i = J.ImportDeclaration;
|
|
4729
|
+
return q(i.specifiers, r, "specifiers", e, 1), q(i.source, r, "source", t, 1), q(i.attributes, r, "attributes", n, 1), r;
|
|
4730
|
+
}
|
|
4731
|
+
function Gt(e) {
|
|
4732
|
+
let t = {
|
|
4733
|
+
type: "ImportNamespaceSpecifier",
|
|
4734
|
+
local: e
|
|
4735
|
+
}, n = J.ImportNamespaceSpecifier;
|
|
4736
|
+
return q(n.local, t, "local", e, 1), t;
|
|
4737
|
+
}
|
|
4738
|
+
function Kt(e) {
|
|
4739
|
+
let t = {
|
|
4740
|
+
type: "SpreadElement",
|
|
4741
|
+
argument: e
|
|
4742
|
+
}, n = J.SpreadElement;
|
|
4743
|
+
return q(n.argument, t, "argument", e, 1), t;
|
|
4744
|
+
}
|
|
4745
|
+
var { hasOwn: Q } = Object;
|
|
4746
|
+
function qt(e, t, n, r) {
|
|
4747
|
+
return e && typeof e.type == "string" ? Xt(e, t, n, r) : e;
|
|
4748
|
+
}
|
|
4749
|
+
function Jt(e, t, n, r) {
|
|
4750
|
+
return Array.isArray(e) ? e.map((e) => qt(e, t, n, r)) : qt(e, t, n, r);
|
|
4751
|
+
}
|
|
4752
|
+
function Yt(e, t = !0, n = !1) {
|
|
4753
|
+
return e && Xt(e, t, n, /* @__PURE__ */ new Map());
|
|
4754
|
+
}
|
|
4755
|
+
function Xt(e, t = !0, n = !1, r) {
|
|
4756
|
+
if (!e) return e;
|
|
4757
|
+
let { type: i } = e, a = { type: e.type };
|
|
4758
|
+
if (x(e)) a.name = e.name, Q(e, "optional") && typeof e.optional == "boolean" && (a.optional = e.optional), Q(e, "typeAnnotation") && (a.typeAnnotation = t ? Jt(e.typeAnnotation, !0, n, r) : e.typeAnnotation), Q(e, "decorators") && (a.decorators = t ? Jt(e.decorators, !0, n, r) : e.decorators);
|
|
4759
|
+
else if (Q(Ge, i)) for (let o of Object.keys(Ge[i])) Q(e, o) && (a[o] = t ? ce(e) && o === "comments" ? Zt(e.comments, t, n, r) : Jt(e[o], !0, n, r) : e[o]);
|
|
4760
|
+
else throw Error(`Unknown node type: "${i}"`);
|
|
4761
|
+
return Q(e, "loc") && (a.loc = n ? null : e.loc), Q(e, "leadingComments") && (a.leadingComments = Zt(e.leadingComments, t, n, r)), Q(e, "innerComments") && (a.innerComments = Zt(e.innerComments, t, n, r)), Q(e, "trailingComments") && (a.trailingComments = Zt(e.trailingComments, t, n, r)), Q(e, "extra") && (a.extra = { ...e.extra }), a;
|
|
4762
|
+
}
|
|
4763
|
+
function Zt(e, t, n, r) {
|
|
4764
|
+
return !e || !t ? e : e.map((e) => {
|
|
4765
|
+
let t = r.get(e);
|
|
4766
|
+
if (t) return t;
|
|
4767
|
+
let { type: i, value: a, loc: o } = e, s = {
|
|
4768
|
+
type: i,
|
|
4769
|
+
value: a,
|
|
4770
|
+
loc: o
|
|
4771
|
+
};
|
|
4772
|
+
return n && (s.loc = void 0), r.set(e, s), s;
|
|
4773
|
+
});
|
|
4774
|
+
}
|
|
4775
|
+
T.Standardized, T.Expression, T.Binary, T.Scopable, T.BlockParent, T.Block, T.Statement, T.Terminatorless, T.CompletionStatement, T.Conditional, T.Loop, T.While, T.ExpressionWrapper, T.For, T.ForXStatement, T.Function, T.FunctionParent, T.Pureish, T.Declaration, T.FunctionParameter, T.PatternLike, T.LVal, T.TSEntityName, T.Literal, T.Immutable, T.UserWhitespacable, T.Method, T.ObjectMember, T.Property, T.UnaryLike, T.Pattern, T.Class, T.ImportOrExportDeclaration, T.ExportDeclaration, T.ModuleSpecifier, T.Private, T.Flow, T.FlowType, T.FlowBaseAnnotation, T.FlowDeclaration, T.FlowPredicate, T.EnumBody, T.EnumMember, T.JSX, T.Miscellaneous, T.Accessor, T.TypeScript, T.TSTypeElement, T.TSType, T.TSBaseType;
|
|
4776
|
+
var Qt = Symbol(), $t = Symbol();
|
|
4777
|
+
function en(e, t, n) {
|
|
4778
|
+
if (!e) return !1;
|
|
4779
|
+
let r = Ue[e.type];
|
|
4780
|
+
if (!r) return !1;
|
|
4781
|
+
n ||= {};
|
|
4782
|
+
let i = t(e, n);
|
|
4783
|
+
if (i !== void 0) switch (i) {
|
|
4784
|
+
case Qt: return !1;
|
|
4785
|
+
case $t: return !0;
|
|
4786
|
+
}
|
|
4787
|
+
for (let i of r) {
|
|
4788
|
+
let r = e[i];
|
|
4789
|
+
if (r) {
|
|
4790
|
+
if (Array.isArray(r)) {
|
|
4791
|
+
for (let e of r) if (en(e, t, n)) return !0;
|
|
4792
|
+
} else if (en(r, t, n)) return !0;
|
|
4793
|
+
}
|
|
4794
|
+
}
|
|
4795
|
+
return !1;
|
|
4796
|
+
}
|
|
4797
|
+
en.skip = Qt, en.stop = $t;
|
|
4798
|
+
var tn = [
|
|
4799
|
+
"tokens",
|
|
4800
|
+
"start",
|
|
4801
|
+
"end",
|
|
4802
|
+
"loc",
|
|
4803
|
+
"raw",
|
|
4804
|
+
"rawValue"
|
|
4805
|
+
], nn = [
|
|
4806
|
+
...Me,
|
|
4807
|
+
"comments",
|
|
4808
|
+
...tn
|
|
4809
|
+
];
|
|
4810
|
+
function rn(e, t = {}) {
|
|
4811
|
+
let n = t.preserveComments ? tn : nn;
|
|
4812
|
+
for (let t of n) e[t] != null && (e[t] = void 0);
|
|
4813
|
+
for (let t of Object.keys(e)) t.startsWith("_") && e[t] != null && (e[t] = void 0);
|
|
4814
|
+
let r = Object.getOwnPropertySymbols(e);
|
|
4815
|
+
for (let t of r) e[t] = null;
|
|
4816
|
+
}
|
|
4817
|
+
function an(e, t) {
|
|
4818
|
+
return en(e, rn, t), e;
|
|
4819
|
+
}
|
|
4820
|
+
function on(e, t = e.key) {
|
|
4821
|
+
let n;
|
|
4822
|
+
return e.kind === "method" ? on.increment() + "" : (n = x(t) ? t.name : de(t) ? JSON.stringify(t.value) : JSON.stringify(an(Yt(t))), e.computed && (n = `[${n}]`), e.static && (n = `static:${n}`), n);
|
|
4823
|
+
}
|
|
4824
|
+
on.uid = 0, on.increment = function() {
|
|
4825
|
+
return on.uid >= 2 ** 53 - 1 ? on.uid = 0 : on.uid++;
|
|
4826
|
+
}, Function.call.bind(Object.prototype.toString);
|
|
4827
|
+
function sn(e, t, n, r) {
|
|
4828
|
+
let i = [].concat(e), a = Object.create(null);
|
|
4829
|
+
for (; i.length;) {
|
|
4830
|
+
let e = i.shift();
|
|
4831
|
+
if (!e || r && (se(e) || he(e) || ge(e))) continue;
|
|
4832
|
+
if (x(e)) {
|
|
4833
|
+
t ? (a[e.name] = a[e.name] || []).push(e) : a[e.name] = e;
|
|
4834
|
+
continue;
|
|
4835
|
+
}
|
|
4836
|
+
if (Te(e) && !ve(e)) {
|
|
4837
|
+
we(e.declaration) && i.push(e.declaration);
|
|
4838
|
+
continue;
|
|
4839
|
+
}
|
|
4840
|
+
if (n) {
|
|
4841
|
+
if (le(e)) {
|
|
4842
|
+
i.push(e.id);
|
|
4843
|
+
continue;
|
|
4844
|
+
}
|
|
4845
|
+
if (ue(e) || _e(e)) continue;
|
|
4846
|
+
}
|
|
4847
|
+
let o = sn.keys[e.type];
|
|
4848
|
+
if (o) for (let t = 0; t < o.length; t++) {
|
|
4849
|
+
let n = e[o[t]];
|
|
4850
|
+
n && (Array.isArray(n) ? i.push(...n) : i.push(n));
|
|
4851
|
+
}
|
|
4852
|
+
}
|
|
4853
|
+
return a;
|
|
4854
|
+
}
|
|
4855
|
+
sn.keys = {
|
|
4856
|
+
DeclareClass: ["id"],
|
|
4857
|
+
DeclareFunction: ["id"],
|
|
4858
|
+
DeclareModule: ["id"],
|
|
4859
|
+
DeclareVariable: ["id"],
|
|
4860
|
+
DeclareInterface: ["id"],
|
|
4861
|
+
DeclareTypeAlias: ["id"],
|
|
4862
|
+
DeclareOpaqueType: ["id"],
|
|
4863
|
+
InterfaceDeclaration: ["id"],
|
|
4864
|
+
TypeAlias: ["id"],
|
|
4865
|
+
OpaqueType: ["id"],
|
|
4866
|
+
CatchClause: ["param"],
|
|
4867
|
+
LabeledStatement: ["label"],
|
|
4868
|
+
UnaryExpression: ["argument"],
|
|
4869
|
+
AssignmentExpression: ["left"],
|
|
4870
|
+
ImportSpecifier: ["local"],
|
|
4871
|
+
ImportNamespaceSpecifier: ["local"],
|
|
4872
|
+
ImportDefaultSpecifier: ["local"],
|
|
4873
|
+
ImportDeclaration: ["specifiers"],
|
|
4874
|
+
TSImportEqualsDeclaration: ["id"],
|
|
4875
|
+
ExportSpecifier: ["exported"],
|
|
4876
|
+
ExportNamespaceSpecifier: ["exported"],
|
|
4877
|
+
ExportDefaultSpecifier: ["exported"],
|
|
4878
|
+
FunctionDeclaration: ["id", "params"],
|
|
4879
|
+
FunctionExpression: ["id", "params"],
|
|
4880
|
+
ArrowFunctionExpression: ["params"],
|
|
4881
|
+
ObjectMethod: ["params"],
|
|
4882
|
+
ClassMethod: ["params"],
|
|
4883
|
+
ClassPrivateMethod: ["params"],
|
|
4884
|
+
ForInStatement: ["left"],
|
|
4885
|
+
ForOfStatement: ["left"],
|
|
4886
|
+
ClassDeclaration: ["id"],
|
|
4887
|
+
ClassExpression: ["id"],
|
|
4888
|
+
RestElement: ["argument"],
|
|
4889
|
+
UpdateExpression: ["argument"],
|
|
4890
|
+
ObjectProperty: ["value"],
|
|
4891
|
+
AssignmentPattern: ["left"],
|
|
4892
|
+
ArrayPattern: ["elements"],
|
|
4893
|
+
ObjectPattern: ["properties"],
|
|
4894
|
+
VariableDeclaration: ["declarations"],
|
|
4895
|
+
VariableDeclarator: ["id"]
|
|
4896
|
+
};
|
|
4897
|
+
//#endregion
|
|
4898
|
+
//#region src/babel/index.ts
|
|
4899
|
+
function $(e, t) {
|
|
4900
|
+
return e.properties.find((e) => C(e) && (x(e.key) && e.key.name === t || de(e.key) && e.key.value === t));
|
|
4901
|
+
}
|
|
4902
|
+
function cn(e) {
|
|
4903
|
+
if (x(e.key)) return e.key.name;
|
|
4904
|
+
if (de(e.key) || fe(e.key)) return String(e.key.value);
|
|
4905
|
+
}
|
|
4906
|
+
function ln(e) {
|
|
4907
|
+
return Pt(Y("String"), [e]);
|
|
4908
|
+
}
|
|
4909
|
+
function un(e, t, n) {
|
|
4910
|
+
let r = Z(e, X(t), !0), i = n.get(t);
|
|
4911
|
+
return i ? It("??", r, Yt(i, !0)) : r;
|
|
4912
|
+
}
|
|
4913
|
+
function dn(e, t, n) {
|
|
4914
|
+
return Mt("===", un(e, t.groupName, n), Yt(t.value, !0));
|
|
4915
|
+
}
|
|
4916
|
+
function fn() {
|
|
4917
|
+
return {
|
|
4918
|
+
name: "stylex-variants",
|
|
4919
|
+
visitor: {
|
|
4920
|
+
ImportDeclaration(e, t) {
|
|
4921
|
+
if (e.node.source.value === "@stylex-variants/core") {
|
|
4922
|
+
let n = e.get("specifiers");
|
|
4923
|
+
for (let r of n) r.isImportSpecifier() && x(r.node.imported, { name: "sxv" }) && r.node.importKind !== "type" && e.node.importKind !== "type" && (t.sxvImports ??= []).push(r);
|
|
4924
|
+
return;
|
|
4925
|
+
}
|
|
4926
|
+
if (e.node.source.value === "@stylexjs/stylex") {
|
|
4927
|
+
let n = e.node.specifiers.find((e) => ye(e));
|
|
4928
|
+
n && (t.stylexLocalName = n.local.name);
|
|
4929
|
+
}
|
|
4930
|
+
},
|
|
4931
|
+
CallExpression(e, t) {
|
|
4932
|
+
if (!x(e.node.callee)) return;
|
|
4933
|
+
let n = e.scope.getBinding(e.node.callee.name);
|
|
4934
|
+
if (!n?.path.isImportSpecifier() || !x(n.path.node.imported, { name: "sxv" }) || !n.path.parentPath.isImportDeclaration() || n.path.parentPath.node.source.value !== "@stylex-variants/core") return;
|
|
4935
|
+
let [r] = e.node.arguments;
|
|
4936
|
+
if (e.node.arguments.length !== 1 || !S(r)) throw e.buildCodeFrameError("sxv requires one inline object configuration.");
|
|
4937
|
+
let i = (t) => {
|
|
4938
|
+
for (let n of t.properties) if (!C(n) || n.computed || cn(n) === void 0 || !Ce(n.value)) throw e.buildCodeFrameError("sxv configuration requires static properties; spreads, methods and computed keys are not supported.");
|
|
4939
|
+
}, a = (t) => {
|
|
4940
|
+
if (!S(t)) throw e.buildCodeFrameError("sxv styles must be inline objects; dynamic style functions are not supported in this release.");
|
|
4941
|
+
};
|
|
4942
|
+
i(r);
|
|
4943
|
+
for (let t of r.properties) {
|
|
4944
|
+
if (!C(t)) continue;
|
|
4945
|
+
let n = cn(t);
|
|
4946
|
+
if (n === "base" && a(t.value), n === "variants" || n === "defaultVariants") {
|
|
4947
|
+
if (!S(t.value)) throw e.buildCodeFrameError("sxv variants and defaultVariants must be inline objects.");
|
|
4948
|
+
if (i(t.value), n === "variants") for (let n of t.value.properties) {
|
|
4949
|
+
if (!C(n) || !S(n.value)) throw e.buildCodeFrameError("sxv variant groups must be inline objects.");
|
|
4950
|
+
i(n.value);
|
|
4951
|
+
for (let e of n.value.properties) C(e) && a(e.value);
|
|
4952
|
+
}
|
|
4953
|
+
}
|
|
4954
|
+
if (n === "compoundVariants") {
|
|
4955
|
+
if (!oe(t.value)) throw e.buildCodeFrameError("sxv compoundVariants must be an inline array.");
|
|
4956
|
+
for (let n of t.value.elements) {
|
|
4957
|
+
if (!S(n)) throw e.buildCodeFrameError("sxv compound variants must be inline objects.");
|
|
4958
|
+
i(n);
|
|
4959
|
+
let t = $(n, "style");
|
|
4960
|
+
if (t && a(t.value), !t) throw e.buildCodeFrameError("sxv compound variants require a style property.");
|
|
4961
|
+
}
|
|
4962
|
+
}
|
|
4963
|
+
}
|
|
4964
|
+
let o = $(r, "base"), s = $(r, "variants"), c = $(r, "defaultVariants"), l = $(r, "compoundVariants"), u = e.findParent((e) => e.isProgram());
|
|
4965
|
+
if (!u || !u.isProgram()) return;
|
|
4966
|
+
t.stylexLocalName = void 0;
|
|
4967
|
+
for (let n of u.get("body")) if (n.isImportDeclaration() && n.node.source.value === "@stylexjs/stylex" && n.node.importKind !== "type") for (let r of n.get("specifiers")) r.isImportNamespaceSpecifier() && e.scope.getBinding(r.node.local.name)?.path === r && (t.stylexLocalName = r.node.local.name);
|
|
4968
|
+
if (!t.stylexLocalName) {
|
|
4969
|
+
let e = u.scope.generateUidIdentifier("stylex"), n = Wt([Gt(e)], X("@stylexjs/stylex")), [r] = u.unshiftContainer("body", n);
|
|
4970
|
+
r && u.scope.registerDeclaration(r), t.stylexLocalName = e.name;
|
|
4971
|
+
}
|
|
4972
|
+
let d = Y(t.stylexLocalName), f = e.scope.generateUidIdentifier("styles"), p = [];
|
|
4973
|
+
o && Ce(o.value) && p.push(Rt(Y("base"), o.value));
|
|
4974
|
+
let m = [];
|
|
4975
|
+
if (s && S(s.value)) for (let e of s.value.properties) {
|
|
4976
|
+
if (!C(e) || !S(e.value)) continue;
|
|
4977
|
+
let t = cn(e);
|
|
4978
|
+
if (t !== void 0) for (let n of e.value.properties) {
|
|
4979
|
+
if (!C(n) || !Ce(n.value)) continue;
|
|
4980
|
+
let e = cn(n);
|
|
4981
|
+
if (e === void 0) continue;
|
|
4982
|
+
let r = `variant_${t.length}_${t}_${e}`;
|
|
4983
|
+
p.push(Rt(X(r), n.value)), m.push({
|
|
4984
|
+
groupName: t,
|
|
4985
|
+
valueName: e,
|
|
4986
|
+
styleName: r
|
|
4987
|
+
});
|
|
4988
|
+
}
|
|
4989
|
+
}
|
|
4990
|
+
let ee = [];
|
|
4991
|
+
l && oe(l.value) && l.value.elements.forEach((e, t) => {
|
|
4992
|
+
if (!e || !S(e)) return;
|
|
4993
|
+
let n = $(e, "style");
|
|
4994
|
+
if (!n || !Ce(n.value)) return;
|
|
4995
|
+
let r = `compound_${t}`, i = [];
|
|
4996
|
+
for (let t of e.properties) {
|
|
4997
|
+
if (!C(t)) continue;
|
|
4998
|
+
let e = cn(t);
|
|
4999
|
+
e !== void 0 && e !== "style" && Ce(t.value) && i.push({
|
|
5000
|
+
groupName: e,
|
|
5001
|
+
value: t.value
|
|
5002
|
+
});
|
|
5003
|
+
}
|
|
5004
|
+
p.push(Rt(X(r), n.value)), ee.push({
|
|
5005
|
+
styleName: r,
|
|
5006
|
+
conditions: i
|
|
5007
|
+
});
|
|
5008
|
+
});
|
|
5009
|
+
let te = Bt("const", [Vt(f, Pt(Z(d, Y("create")), [Lt(p)]))]), ne = e.getStatementParent();
|
|
5010
|
+
if (!ne) return;
|
|
5011
|
+
ne.insertBefore(te);
|
|
5012
|
+
let h = /* @__PURE__ */ new Map();
|
|
5013
|
+
if (c && S(c.value)) for (let e of c.value.properties) {
|
|
5014
|
+
if (!C(e) || !Ce(e.value)) continue;
|
|
5015
|
+
let t = cn(e);
|
|
5016
|
+
t !== void 0 && h.set(t, e.value);
|
|
5017
|
+
}
|
|
5018
|
+
let g = e.scope.generateUidIdentifier("props"), _ = [];
|
|
5019
|
+
o && _.push(Z(f, Y("base")));
|
|
5020
|
+
let re = /* @__PURE__ */ new Map();
|
|
5021
|
+
for (let e of m) {
|
|
5022
|
+
let t = re.get(e.groupName) ?? [];
|
|
5023
|
+
t.push(e), re.set(e.groupName, t);
|
|
5024
|
+
}
|
|
5025
|
+
for (let [e] of re) {
|
|
5026
|
+
let t = ln(un(g, e, h)), n = Mt("+", X(`variant_${e.length}_${e}_`), t);
|
|
5027
|
+
_.push(Z(f, n, !0));
|
|
5028
|
+
}
|
|
5029
|
+
for (let e of ee) {
|
|
5030
|
+
if (e.conditions.length === 0) {
|
|
5031
|
+
_.push(Z(f, X(e.styleName), !0));
|
|
5032
|
+
continue;
|
|
5033
|
+
}
|
|
5034
|
+
let t = e.conditions.map((e) => dn(g, e, h)).reduce((e, t) => It("&&", e, t)), n = Z(f, X(e.styleName), !0);
|
|
5035
|
+
_.push(It("&&", t, n));
|
|
5036
|
+
}
|
|
5037
|
+
let ie = Pt(Z(d, Y("props")), _), v = e.scope.generateUidIdentifier("result"), ae = Ft(Z(g, Y("className")), Ft(Z(v, Y("className")), Mt("+", Mt("+", Z(v, Y("className")), X(" ")), Z(g, Y("className"))), Z(g, Y("className"))), Z(v, Y("className"))), y = Ft(Z(g, Y("style")), Pt(Z(Y("Object"), Y("assign")), [
|
|
5038
|
+
Lt([]),
|
|
5039
|
+
Z(v, Y("style")),
|
|
5040
|
+
Z(g, Y("style"))
|
|
5041
|
+
]), Z(v, Y("style"))), b = Ut([Ht(g, Lt([]))], Nt([Bt("const", [Vt(v, ie)]), zt(Lt([
|
|
5042
|
+
Kt(v),
|
|
5043
|
+
Rt(Y("className"), ae),
|
|
5044
|
+
Rt(Y("style"), y)
|
|
5045
|
+
]))]));
|
|
5046
|
+
e.replaceWith(b);
|
|
5047
|
+
},
|
|
5048
|
+
Program: { exit(e, t) {
|
|
5049
|
+
e.scope.crawl();
|
|
5050
|
+
for (let n of t.sxvImports ?? []) {
|
|
5051
|
+
if (e.scope.getBinding(n.node.local.name)?.referenced) continue;
|
|
5052
|
+
let t = n.parentPath;
|
|
5053
|
+
n.remove(), t.isImportDeclaration() && t.node.specifiers.length === 0 && t.remove();
|
|
5054
|
+
}
|
|
5055
|
+
} }
|
|
5056
|
+
}
|
|
5057
|
+
};
|
|
5058
|
+
}
|
|
5059
|
+
//#endregion
|
|
5060
|
+
export { fn as default };
|