prettier-plugin-embed 0.5.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +118 -406
- package/dist/embedded/es/options.d.ts +1 -1
- package/dist/embedded/html/options.d.ts +1 -1
- package/dist/embedded/json/options.d.ts +1 -1
- package/dist/embedded/register.d.ts +20 -20
- package/dist/embedded/ruby/options.d.ts +1 -1
- package/dist/embedded/sql/options.d.ts +1 -1
- package/dist/embedded/toml/plugin-toml-types.d.ts +2 -2
- package/dist/embedded/ts/options.d.ts +1 -1
- package/dist/embedded/types.d.ts +1 -1
- package/dist/embedded/utils.d.ts +13 -4
- package/dist/embedded/xml/parser.d.ts +6 -4
- package/dist/import-module-worker.js +45 -0
- package/dist/index.js +1767 -3209
- package/dist/options.d.ts +6 -6
- package/dist/parsers.d.ts +6 -6
- package/dist/type-utils.d.ts +5 -0
- package/dist/types.d.ts +1 -1
- package/dist/utils.d.ts +3 -3
- package/package.json +38 -47
package/dist/index.js
CHANGED
|
@@ -1,3214 +1,1772 @@
|
|
|
1
|
-
import { builders as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
`
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
function
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
1
|
+
import { builders as e, utils as t } from "prettier/doc";
|
|
2
|
+
import { createRequire as n } from "node:module";
|
|
3
|
+
import r from "node:path";
|
|
4
|
+
import { pathToFileURL as i } from "node:url";
|
|
5
|
+
import a from "prettier/parser-babel";
|
|
6
|
+
import o from "prettier/parser-espree";
|
|
7
|
+
import s from "prettier/parser-flow";
|
|
8
|
+
import c from "prettier/parser-meriyah";
|
|
9
|
+
import l from "prettier/parser-typescript";
|
|
10
|
+
import { printers as u } from "prettier/plugins/estree.mjs";
|
|
11
|
+
import { resolveConfigFile as d } from "prettier";
|
|
12
|
+
//#region \0rolldown/runtime.js
|
|
13
|
+
var f = Object.defineProperty, p = (e, t) => {
|
|
14
|
+
let n = {};
|
|
15
|
+
for (var r in e) f(n, r, {
|
|
16
|
+
get: e[r],
|
|
17
|
+
enumerable: !0
|
|
18
|
+
});
|
|
19
|
+
return t || f(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
20
|
+
}, { group: m, indent: h, line: ee, softline: g, lineSuffixBoundary: te, addAlignmentToDoc: ne, align: re, hardline: ie } = e, { mapDoc: ae, replaceEndOfLine: oe } = t;
|
|
21
|
+
function _(e, t) {
|
|
22
|
+
let n = e.quasis.map((e, n, { length: r }) => n === r - 1 ? e.value.cooked : e.value.cooked + t(n)).join(""), r = n.match(/^\s+/)?.[0] ?? "", i = n.match(/\s+$/)?.[0] ?? "";
|
|
23
|
+
return {
|
|
24
|
+
trimmedText: n.slice(r.length, -i.length || void 0),
|
|
25
|
+
leadingWhitespaces: r,
|
|
26
|
+
trailingWhitespaces: i
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
function v(e, t, n, r, i, a = !1) {
|
|
30
|
+
let o = a || t.preserveEmbeddedExteriorWhitespaces?.includes(n), s = t.noEmbeddedMultiLineIndentation?.includes(n), c = m(e);
|
|
31
|
+
if (o) return m([
|
|
32
|
+
"`",
|
|
33
|
+
r,
|
|
34
|
+
s ? c : h([c]),
|
|
35
|
+
i,
|
|
36
|
+
"`"
|
|
37
|
+
]);
|
|
38
|
+
let l = r.length ? ee : g, u = i.length ? ee : g;
|
|
39
|
+
return m([
|
|
40
|
+
"`",
|
|
41
|
+
s ? [l, c] : h([l, c]),
|
|
42
|
+
u,
|
|
43
|
+
"`"
|
|
44
|
+
]);
|
|
45
|
+
}
|
|
46
|
+
function se(e, t) {
|
|
47
|
+
let n = 0;
|
|
48
|
+
for (let r of e) r === " " ? n = n + t - n % t : n++;
|
|
49
|
+
return n;
|
|
50
|
+
}
|
|
51
|
+
function ce(e, t) {
|
|
52
|
+
let n = e.lastIndexOf("\n"), r = e.slice(n + 1), i = /^[\t ]*/.exec(r)[0];
|
|
53
|
+
return se(i, t);
|
|
54
|
+
}
|
|
55
|
+
function le(e, t, n) {
|
|
56
|
+
let r = t, i = e.quasis[r].value.raw;
|
|
57
|
+
if (i.includes("\n")) return {
|
|
58
|
+
indentSize: ce(i, n),
|
|
59
|
+
previousQuasiText: i
|
|
60
|
+
};
|
|
61
|
+
for (; r-- > 0;) {
|
|
62
|
+
let t = e.quasis[r].value.raw;
|
|
63
|
+
if (t.includes("\n")) return {
|
|
64
|
+
indentSize: ce(t, n),
|
|
65
|
+
previousQuasiText: i
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
indentSize: 0,
|
|
70
|
+
previousQuasiText: i
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
function ue(e, t, n, r, i, a = !0) {
|
|
74
|
+
let { node: o } = e, s = t();
|
|
75
|
+
if (o?.comments?.length && (s = m([h([g, s]), g])), !a) return m([
|
|
76
|
+
"${",
|
|
77
|
+
s,
|
|
78
|
+
te,
|
|
79
|
+
"}"
|
|
80
|
+
]);
|
|
81
|
+
let { indentSize: c, previousQuasiText: l } = le(n, r, i), u = s;
|
|
82
|
+
return u = c === 0 && l.endsWith("\n") ? re(-Infinity, u) : ne(u, c, i), m([
|
|
83
|
+
"${",
|
|
84
|
+
u,
|
|
85
|
+
te,
|
|
86
|
+
"}"
|
|
87
|
+
]);
|
|
88
|
+
}
|
|
89
|
+
function y(e, t, n, r = !0) {
|
|
90
|
+
let i = n?.tabWidth ?? 2, a = e.node;
|
|
91
|
+
return e.map((e, n) => ue(e, t, a, n, i, r), "expressions");
|
|
92
|
+
}
|
|
93
|
+
function b(e, t, n, r = !1, i, a) {
|
|
94
|
+
return ae(e, (e) => {
|
|
95
|
+
if (typeof e != "string") return e;
|
|
96
|
+
let o = [], s = e.split(t), c = "";
|
|
97
|
+
for (let e = 0; e < s.length; e++) {
|
|
98
|
+
let t = s[e];
|
|
99
|
+
if (e % 2 == 0) {
|
|
100
|
+
if (e === 0 || t.includes("\n")) {
|
|
101
|
+
let e = t.slice(t.lastIndexOf("\n") + 1);
|
|
102
|
+
c = /^[\t ]*/.exec(e)[0];
|
|
103
|
+
}
|
|
104
|
+
if (!t) continue;
|
|
105
|
+
if (t = t.replaceAll(/([\\`]|\${)/g, "\\$1"), r === "literalline") o.push(oe(t));
|
|
106
|
+
else if (r === "hardline") for (let e of t.split(/(\n)/)) e === "\n" ? o.push(ie) : o.push(e);
|
|
107
|
+
else o.push(t);
|
|
108
|
+
} else {
|
|
109
|
+
let r = Number(t), l = s[e - 1];
|
|
110
|
+
if (i?.has(r) && !/\n[\t ]*$/.test(l)) {
|
|
111
|
+
let e = o.at(-1);
|
|
112
|
+
typeof e == "string" && (o[o.length - 1] = e.replace(/[\t ]+$/, "")), o.push(ie), a !== void 0 && o.push(c);
|
|
113
|
+
}
|
|
114
|
+
let u = n[r];
|
|
115
|
+
o.push(a === void 0 ? u : re(se(c, a), u));
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return o;
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
function de(e, t, n) {
|
|
122
|
+
if (t === n) {
|
|
123
|
+
e.unshift(t);
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
let r = 0, i = e.length;
|
|
127
|
+
for (; r < i;) {
|
|
128
|
+
let a = r + i >>> 1;
|
|
129
|
+
if (e[a] === n) {
|
|
130
|
+
e.push(t);
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
e[a] < t ? r = a + 1 : i = a;
|
|
134
|
+
}
|
|
135
|
+
e.splice(r, 0, t);
|
|
136
|
+
}
|
|
137
|
+
var x = (() => {
|
|
138
|
+
let e = [...Array(26).keys()].map((e) => String.fromCharCode(e + 97)).concat([...Array(10).keys()].map((e) => `${e}`));
|
|
139
|
+
return () => {
|
|
140
|
+
let t = "";
|
|
141
|
+
for (let n = 0; n < 16; ++n) t += e[Number.parseInt((Math.random() * e.length).toFixed(0), 10) % e.length];
|
|
142
|
+
return t;
|
|
143
|
+
};
|
|
127
144
|
})();
|
|
128
|
-
function
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
}
|
|
138
|
-
function
|
|
139
|
-
|
|
140
|
-
}
|
|
141
|
-
function
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
function
|
|
145
|
-
|
|
146
|
-
}
|
|
147
|
-
function
|
|
148
|
-
|
|
149
|
-
}
|
|
150
|
-
function
|
|
151
|
-
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
]
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
},
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
category: "Embed",
|
|
488
|
-
type: "string",
|
|
489
|
-
array: !0,
|
|
490
|
-
default: [{ value: [$] }],
|
|
491
|
-
description: "Tags that make their subsequent template literals be identified as embedded HTML language."
|
|
492
|
-
},
|
|
493
|
-
[Ar]: {
|
|
494
|
-
category: "Embed",
|
|
495
|
-
type: "choice",
|
|
496
|
-
default: "html",
|
|
497
|
-
description: "The parser used to parse the embedded HTML language.",
|
|
498
|
-
choices: Tr.map((t) => ({
|
|
499
|
-
value: t,
|
|
500
|
-
description: `Use the "${t}" parser.`
|
|
501
|
-
}))
|
|
502
|
-
}
|
|
503
|
-
}, Mr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
504
|
-
__proto__: null,
|
|
505
|
-
embedder: Dr,
|
|
506
|
-
language: ue,
|
|
507
|
-
options: Sr
|
|
508
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: _t, group: w, indent: yt, softline: Dt } = A, Lr = async (t, e, n, i, { commentOrTag: r, embeddedOverrideOptions: o }) => {
|
|
509
|
-
const s = {
|
|
510
|
-
...i,
|
|
511
|
-
...o
|
|
512
|
-
}, { node: l } = n, { createPlaceholder: p, placeholderRegex: f } = N(), d = l.quasis.map(
|
|
513
|
-
(m, h, { length: _ }) => h === _ - 1 ? m.value.cooked : m.value.cooked + p(h)
|
|
514
|
-
).join(""), u = d.match(/^\s+/)?.[0] ?? "", c = d.match(/\s+$/)?.[0] ?? "", y = d.slice(
|
|
515
|
-
u.length,
|
|
516
|
-
-c.length || void 0
|
|
517
|
-
), b = L(n, e), D = await t(y, {
|
|
518
|
-
...s,
|
|
519
|
-
parser: "ini"
|
|
520
|
-
}), a = M(D, f, b);
|
|
521
|
-
if (s.preserveEmbeddedExteriorWhitespaces?.includes(r))
|
|
522
|
-
return w([
|
|
523
|
-
"`",
|
|
524
|
-
u,
|
|
525
|
-
s.noEmbeddedMultiLineIndentation?.includes(r) ? [w(a)] : yt([w(a)]),
|
|
526
|
-
c,
|
|
527
|
-
"`"
|
|
528
|
-
]);
|
|
529
|
-
const g = u.length ? _t : Dt, E = c.length ? _t : Dt;
|
|
530
|
-
return w([
|
|
531
|
-
"`",
|
|
532
|
-
s.noEmbeddedMultiLineIndentation?.includes(r) ? [g, w(a)] : yt([g, w(a)]),
|
|
533
|
-
E,
|
|
534
|
-
"`"
|
|
535
|
-
]);
|
|
536
|
-
}, ve = "embeddedIni", Nr = ["ini", "cfg", "pro"], kr = T(ve), $t = S(ve), Tt = v(ve), Or = {
|
|
537
|
-
[kr]: {
|
|
538
|
-
category: "Embed",
|
|
539
|
-
type: "string",
|
|
540
|
-
array: !0,
|
|
541
|
-
default: [{ value: [...Nr] }],
|
|
542
|
-
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded INI language. This option requires the `prettier-plugin-ini` plugin.",
|
|
543
|
-
deprecated: `Please use \`${$t}\` or \`${Tt}\`.`
|
|
544
|
-
},
|
|
545
|
-
[$t]: {
|
|
546
|
-
category: "Embed",
|
|
547
|
-
type: "string",
|
|
548
|
-
array: !0,
|
|
549
|
-
default: [{ value: [$] }],
|
|
550
|
-
description: "Block comments that make their subsequent template literals be identified as embedded INI language. This option requires the `prettier-plugin-ini` plugin."
|
|
551
|
-
},
|
|
552
|
-
[Tt]: {
|
|
553
|
-
category: "Embed",
|
|
554
|
-
type: "string",
|
|
555
|
-
array: !0,
|
|
556
|
-
default: [{ value: [$] }],
|
|
557
|
-
description: "Tags that make their subsequent template literals be identified as embedded INI language. This option requires the `prettier-plugin-ini` plugin."
|
|
558
|
-
}
|
|
559
|
-
}, Gr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
560
|
-
__proto__: null,
|
|
561
|
-
embedder: Lr,
|
|
562
|
-
language: ve,
|
|
563
|
-
options: Or
|
|
564
|
-
}, Symbol.toStringTag, { value: "Module" })), { group: U, line: vt, softline: At, indent: St } = A, Ir = async (t, e, n, i, { commentOrTag: r, embeddedOverrideOptions: o }) => {
|
|
565
|
-
const s = {
|
|
566
|
-
...i,
|
|
567
|
-
...o
|
|
568
|
-
}, { node: l } = n, { createPlaceholder: p, placeholderRegex: f } = N(), d = l.quasis.map(
|
|
569
|
-
(m, h, { length: _ }) => h === _ - 1 ? m.value.cooked : m.value.cooked + p(h)
|
|
570
|
-
).join(""), u = d.match(/^\s+/)?.[0] ?? "", c = d.match(/\s+$/)?.[0] ?? "", y = d.slice(
|
|
571
|
-
u.length,
|
|
572
|
-
-c.length || void 0
|
|
573
|
-
), b = L(n, e), D = await t(y, {
|
|
574
|
-
...s,
|
|
575
|
-
parser: "java"
|
|
576
|
-
}), a = M(
|
|
577
|
-
D,
|
|
578
|
-
f,
|
|
579
|
-
b,
|
|
580
|
-
"hardline"
|
|
581
|
-
);
|
|
582
|
-
if (s.preserveEmbeddedExteriorWhitespaces?.includes(r))
|
|
583
|
-
return U([
|
|
584
|
-
"`",
|
|
585
|
-
u,
|
|
586
|
-
s.noEmbeddedMultiLineIndentation?.includes(r) ? [U(a)] : St([U(a)]),
|
|
587
|
-
c,
|
|
588
|
-
"`"
|
|
589
|
-
]);
|
|
590
|
-
const g = u.length ? vt : At, E = c.length ? vt : At;
|
|
591
|
-
return U([
|
|
592
|
-
"`",
|
|
593
|
-
s.noEmbeddedMultiLineIndentation?.includes(r) ? [g, U(a)] : St([g, U(a)]),
|
|
594
|
-
E,
|
|
595
|
-
"`"
|
|
596
|
-
]);
|
|
597
|
-
}, Ae = "embeddedJava", xr = ["java"], Pr = T(Ae), Mt = S(Ae), Lt = v(Ae), qr = {
|
|
598
|
-
[Pr]: {
|
|
599
|
-
category: "Embed",
|
|
600
|
-
type: "string",
|
|
601
|
-
array: !0,
|
|
602
|
-
default: [{ value: [...xr] }],
|
|
603
|
-
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Java language. This option requires the `prettier-plugin-java` plugin.",
|
|
604
|
-
deprecated: `Please use \`${Mt}\` or \`${Lt}\`.`
|
|
605
|
-
},
|
|
606
|
-
[Mt]: {
|
|
607
|
-
category: "Embed",
|
|
608
|
-
type: "string",
|
|
609
|
-
array: !0,
|
|
610
|
-
default: [{ value: [$] }],
|
|
611
|
-
description: "Block comments that make their subsequent template literals be identified as embedded Java language. This option requires the `prettier-plugin-java` plugin."
|
|
612
|
-
},
|
|
613
|
-
[Lt]: {
|
|
614
|
-
category: "Embed",
|
|
615
|
-
type: "string",
|
|
616
|
-
array: !0,
|
|
617
|
-
default: [{ value: [$] }],
|
|
618
|
-
description: "Tags that make their subsequent template literals be identified as embedded Java language. This option requires the `prettier-plugin-java` plugin."
|
|
619
|
-
}
|
|
620
|
-
}, jr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
621
|
-
__proto__: null,
|
|
622
|
-
embedder: Ir,
|
|
623
|
-
language: Ae,
|
|
624
|
-
options: qr
|
|
625
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: Nt, group: C, indent: kt, softline: Ot } = A, Rr = async (t, e, n, i, { commentOrTag: r, embeddedOverrideOptions: o }) => {
|
|
626
|
-
const s = {
|
|
627
|
-
...i,
|
|
628
|
-
...o
|
|
629
|
-
}, { node: l } = n, { createPlaceholder: p, placeholderRegex: f } = Br(), d = l.quasis.map(
|
|
630
|
-
(m, h, { length: _ }) => h === _ - 1 ? m.value.cooked : m.value.cooked + p(h)
|
|
631
|
-
).join(""), u = d.match(/^\s+/)?.[0] ?? "", c = d.match(/\s+$/)?.[0] ?? "", y = d.slice(
|
|
632
|
-
u.length,
|
|
633
|
-
-c.length || void 0
|
|
634
|
-
), b = L(n, e), D = await t(y, {
|
|
635
|
-
...s,
|
|
636
|
-
parser: s.embeddedJsonParser ?? "json"
|
|
637
|
-
}), a = M(D, f, b);
|
|
638
|
-
if (s.preserveEmbeddedExteriorWhitespaces?.includes(r))
|
|
639
|
-
return C([
|
|
640
|
-
"`",
|
|
641
|
-
u,
|
|
642
|
-
s.noEmbeddedMultiLineIndentation?.includes(r) ? [C(a)] : kt([C(a)]),
|
|
643
|
-
c,
|
|
644
|
-
"`"
|
|
645
|
-
]);
|
|
646
|
-
const g = u.length ? Nt : Ot, E = c.length ? Nt : Ot;
|
|
647
|
-
return C([
|
|
648
|
-
"`",
|
|
649
|
-
s.noEmbeddedMultiLineIndentation?.includes(r) ? [g, C(a)] : kt([g, C(a)]),
|
|
650
|
-
E,
|
|
651
|
-
"`"
|
|
652
|
-
]);
|
|
653
|
-
};
|
|
654
|
-
function Br() {
|
|
655
|
-
const t = ye(), e = ye(), n = (r) => `'0${t}${r}${e}'`, i = new RegExp(
|
|
656
|
-
`["']?0${t}(\\d+)${e}['"]?`,
|
|
657
|
-
"ig"
|
|
658
|
-
);
|
|
659
|
-
return {
|
|
660
|
-
createPlaceholder: n,
|
|
661
|
-
placeholderRegex: i
|
|
662
|
-
};
|
|
663
|
-
}
|
|
664
|
-
const pe = "embeddedJson", wr = ["json", "jsonl"], Ur = ["json", "json5", "jsonc", "json-stringify"], Cr = T(pe), Gt = S(pe), It = v(pe), Wr = G(pe), Fr = {
|
|
665
|
-
[Cr]: {
|
|
666
|
-
category: "Embed",
|
|
667
|
-
type: "string",
|
|
668
|
-
array: !0,
|
|
669
|
-
default: [{ value: [...wr] }],
|
|
670
|
-
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded JSON language.",
|
|
671
|
-
deprecated: `Please use \`${Gt}\` or \`${It}\`.`
|
|
672
|
-
},
|
|
673
|
-
[Gt]: {
|
|
674
|
-
category: "Embed",
|
|
675
|
-
type: "string",
|
|
676
|
-
array: !0,
|
|
677
|
-
default: [{ value: [$] }],
|
|
678
|
-
description: "Block comments that make their subsequent template literals be identified as embedded JSON language."
|
|
679
|
-
},
|
|
680
|
-
[It]: {
|
|
681
|
-
category: "Embed",
|
|
682
|
-
type: "string",
|
|
683
|
-
array: !0,
|
|
684
|
-
default: [{ value: [$] }],
|
|
685
|
-
description: "Tags that make their subsequent template literals be identified as embedded JSON language."
|
|
686
|
-
},
|
|
687
|
-
[Wr]: {
|
|
688
|
-
category: "Embed",
|
|
689
|
-
type: "choice",
|
|
690
|
-
default: "json",
|
|
691
|
-
description: "The parser used to parse the embedded JSON language.",
|
|
692
|
-
choices: Ur.map((t) => ({
|
|
693
|
-
value: t,
|
|
694
|
-
description: `Use the "${t}" parser.`
|
|
695
|
-
}))
|
|
696
|
-
}
|
|
697
|
-
}, zr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
698
|
-
__proto__: null,
|
|
699
|
-
embedder: Rr,
|
|
700
|
-
language: pe,
|
|
701
|
-
options: Fr
|
|
702
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: xt, group: W, indent: Pt, softline: qt } = A, Jr = async (t, e, n, i, { commentOrTag: r, embeddedOverrideOptions: o }) => {
|
|
703
|
-
const s = {
|
|
704
|
-
...i,
|
|
705
|
-
...o
|
|
706
|
-
}, { node: l } = n, { createPlaceholder: p, placeholderRegex: f } = N("$p"), d = l.quasis.map(
|
|
707
|
-
(m, h, { length: _ }) => h === _ - 1 ? m.value.cooked : m.value.cooked + p(h)
|
|
708
|
-
).join(""), u = d.match(/^\s+/)?.[0] ?? "", c = d.match(/\s+$/)?.[0] ?? "", y = d.slice(
|
|
709
|
-
u.length,
|
|
710
|
-
-c.length || void 0
|
|
711
|
-
), b = L(n, e), D = await t(y, {
|
|
712
|
-
...s,
|
|
713
|
-
parser: "JSONata"
|
|
714
|
-
}), a = M(D, f, b);
|
|
715
|
-
if (s.preserveEmbeddedExteriorWhitespaces?.includes(r))
|
|
716
|
-
return W([
|
|
717
|
-
"`",
|
|
718
|
-
u,
|
|
719
|
-
s.noEmbeddedMultiLineIndentation?.includes(r) ? [W(a)] : Pt([W(a)]),
|
|
720
|
-
c,
|
|
721
|
-
"`"
|
|
722
|
-
]);
|
|
723
|
-
const g = u.length ? xt : qt, E = c.length ? xt : qt;
|
|
724
|
-
return W([
|
|
725
|
-
"`",
|
|
726
|
-
s.noEmbeddedMultiLineIndentation?.includes(r) ? [g, W(a)] : Pt([g, W(a)]),
|
|
727
|
-
E,
|
|
728
|
-
"`"
|
|
729
|
-
]);
|
|
730
|
-
}, Se = "embeddedJsonata", Xr = ["jsonata"], Hr = T(Se), jt = S(Se), Rt = v(Se), Qr = {
|
|
731
|
-
[Hr]: {
|
|
732
|
-
category: "Embed",
|
|
733
|
-
type: "string",
|
|
734
|
-
array: !0,
|
|
735
|
-
default: [{ value: [...Xr] }],
|
|
736
|
-
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded JSONata language. This option requires the `@stedi/prettier-plugin-jsonata` plugin.",
|
|
737
|
-
deprecated: `Please use \`${jt}\` or \`${Rt}\`.`
|
|
738
|
-
},
|
|
739
|
-
[jt]: {
|
|
740
|
-
category: "Embed",
|
|
741
|
-
type: "string",
|
|
742
|
-
array: !0,
|
|
743
|
-
default: [{ value: [$] }],
|
|
744
|
-
description: "Block comments that make their subsequent template literals be identified as embedded JSONata language. This option requires the `@stedi/prettier-plugin-jsonata` plugin."
|
|
745
|
-
},
|
|
746
|
-
[Rt]: {
|
|
747
|
-
category: "Embed",
|
|
748
|
-
type: "string",
|
|
749
|
-
array: !0,
|
|
750
|
-
default: [{ value: [$] }],
|
|
751
|
-
description: "Tags that make their subsequent template literals be identified as embedded JSONata language. This option requires the `@stedi/prettier-plugin-jsonata` plugin."
|
|
752
|
-
}
|
|
753
|
-
}, Vr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
754
|
-
__proto__: null,
|
|
755
|
-
embedder: Jr,
|
|
756
|
-
language: Se,
|
|
757
|
-
options: Qr
|
|
758
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: Bt, group: F, indent: wt, softline: Ut } = A, Yr = async (t, e, n, i, { commentOrTag: r, embeddedOverrideOptions: o }) => {
|
|
759
|
-
const s = {
|
|
760
|
-
...i,
|
|
761
|
-
...o
|
|
762
|
-
}, { node: l } = n, { createPlaceholder: p, placeholderRegex: f } = N(), d = l.quasis.map(
|
|
763
|
-
(m, h, { length: _ }) => h === _ - 1 ? m.value.cooked : m.value.cooked + p(h)
|
|
764
|
-
).join(""), u = d.match(/^\s+/)?.[0] ?? "", c = d.match(/\s+$/)?.[0] ?? "", y = d.slice(
|
|
765
|
-
u.length,
|
|
766
|
-
-c.length || void 0
|
|
767
|
-
), b = L(n, e), D = await t(y, {
|
|
768
|
-
...s,
|
|
769
|
-
parser: "latex-parser"
|
|
770
|
-
}), a = M(D, f, b);
|
|
771
|
-
if (s.preserveEmbeddedExteriorWhitespaces?.includes(r))
|
|
772
|
-
return F([
|
|
773
|
-
"`",
|
|
774
|
-
u,
|
|
775
|
-
s.noEmbeddedMultiLineIndentation?.includes(r) ? [F(a)] : wt([F(a)]),
|
|
776
|
-
c,
|
|
777
|
-
"`"
|
|
778
|
-
]);
|
|
779
|
-
const g = u.length ? Bt : Ut, E = c.length ? Bt : Ut;
|
|
780
|
-
return F([
|
|
781
|
-
"`",
|
|
782
|
-
s.noEmbeddedMultiLineIndentation?.includes(r) ? [g, F(a)] : wt([g, F(a)]),
|
|
783
|
-
E,
|
|
784
|
-
"`"
|
|
785
|
-
]);
|
|
786
|
-
}, Me = "embeddedLatex", Kr = [
|
|
787
|
-
"latex",
|
|
788
|
-
"tex",
|
|
789
|
-
"aux",
|
|
790
|
-
"cls",
|
|
791
|
-
"bbl",
|
|
792
|
-
"bib",
|
|
793
|
-
"toc",
|
|
794
|
-
"sty"
|
|
795
|
-
], Zr = T(Me), Ct = S(Me), Wt = v(Me), es = {
|
|
796
|
-
[Zr]: {
|
|
797
|
-
category: "Embed",
|
|
798
|
-
type: "string",
|
|
799
|
-
array: !0,
|
|
800
|
-
default: [{ value: [...Kr] }],
|
|
801
|
-
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded LaTeX language. This option requires the `prettier-plugin-latex` plugin.",
|
|
802
|
-
deprecated: `Please use \`${Ct}\` or \`${Wt}\`.`
|
|
803
|
-
},
|
|
804
|
-
[Ct]: {
|
|
805
|
-
category: "Embed",
|
|
806
|
-
type: "string",
|
|
807
|
-
array: !0,
|
|
808
|
-
default: [{ value: [$] }],
|
|
809
|
-
description: "Block comments that make their subsequent template literals be identified as embedded LaTeX language. This option requires the `prettier-plugin-latex` plugin."
|
|
810
|
-
},
|
|
811
|
-
[Wt]: {
|
|
812
|
-
category: "Embed",
|
|
813
|
-
type: "string",
|
|
814
|
-
array: !0,
|
|
815
|
-
default: [{ value: [$] }],
|
|
816
|
-
description: "Tags that make their subsequent template literals be identified as embedded LaTeX language. This option requires the `prettier-plugin-latex` plugin."
|
|
817
|
-
}
|
|
818
|
-
}, ts = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
819
|
-
__proto__: null,
|
|
820
|
-
embedder: Yr,
|
|
821
|
-
language: Me,
|
|
822
|
-
options: es
|
|
823
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
824
|
-
function Ft(t, e) {
|
|
825
|
-
var n = Object.keys(t);
|
|
826
|
-
if (Object.getOwnPropertySymbols) {
|
|
827
|
-
var i = Object.getOwnPropertySymbols(t);
|
|
828
|
-
e && (i = i.filter(function(r) {
|
|
829
|
-
return Object.getOwnPropertyDescriptor(t, r).enumerable;
|
|
830
|
-
})), n.push.apply(n, i);
|
|
831
|
-
}
|
|
832
|
-
return n;
|
|
833
|
-
}
|
|
834
|
-
function zt(t) {
|
|
835
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
836
|
-
var n = arguments[e] != null ? arguments[e] : {};
|
|
837
|
-
e % 2 ? Ft(Object(n), !0).forEach(function(i) {
|
|
838
|
-
ns(t, i, n[i]);
|
|
839
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : Ft(Object(n)).forEach(function(i) {
|
|
840
|
-
Object.defineProperty(t, i, Object.getOwnPropertyDescriptor(n, i));
|
|
841
|
-
});
|
|
842
|
-
}
|
|
843
|
-
return t;
|
|
844
|
-
}
|
|
845
|
-
function ns(t, e, n) {
|
|
846
|
-
return e = is(e), e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
|
|
847
|
-
}
|
|
848
|
-
function is(t) {
|
|
849
|
-
var e = rs(t, "string");
|
|
850
|
-
return typeof e == "symbol" ? e : String(e);
|
|
851
|
-
}
|
|
852
|
-
function rs(t, e) {
|
|
853
|
-
if (typeof t != "object" || t === null) return t;
|
|
854
|
-
var n = t[Symbol.toPrimitive];
|
|
855
|
-
if (n !== void 0) {
|
|
856
|
-
var i = n.call(t, e);
|
|
857
|
-
if (typeof i != "object") return i;
|
|
858
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
859
|
-
}
|
|
860
|
-
return (e === "string" ? String : Number)(t);
|
|
861
|
-
}
|
|
862
|
-
const _i = yi({});
|
|
863
|
-
function yi(t) {
|
|
864
|
-
return e.withOptions = (n) => yi(zt(zt({}, t), n)), e;
|
|
865
|
-
function e(n, ...i) {
|
|
866
|
-
const r = typeof n == "string" ? [n] : n.raw, {
|
|
867
|
-
alignValues: o = !1,
|
|
868
|
-
escapeSpecialCharacters: s = Array.isArray(n),
|
|
869
|
-
trimWhitespace: l = !0
|
|
870
|
-
} = t;
|
|
871
|
-
let p = "";
|
|
872
|
-
for (let u = 0; u < r.length; u++) {
|
|
873
|
-
let c = r[u];
|
|
874
|
-
if (s && (c = c.replace(/\\\n[ \t]*/g, "").replace(/\\`/g, "`").replace(/\\\$/g, "$").replace(/\\\{/g, "{")), p += c, u < i.length) {
|
|
875
|
-
const y = o ? ss(i[u], p) : i[u];
|
|
876
|
-
p += y;
|
|
877
|
-
}
|
|
878
|
-
}
|
|
879
|
-
const f = p.split(`
|
|
880
|
-
`);
|
|
881
|
-
let d = null;
|
|
882
|
-
for (const u of f) {
|
|
883
|
-
const c = u.match(/^(\s+)\S+/);
|
|
884
|
-
if (c) {
|
|
885
|
-
const y = c[1].length;
|
|
886
|
-
d ? d = Math.min(d, y) : d = y;
|
|
887
|
-
}
|
|
888
|
-
}
|
|
889
|
-
if (d !== null) {
|
|
890
|
-
const u = d;
|
|
891
|
-
p = f.map((c) => c[0] === " " || c[0] === " " ? c.slice(u) : c).join(`
|
|
892
|
-
`);
|
|
893
|
-
}
|
|
894
|
-
return l && (p = p.trim()), s && (p = p.replace(/\\n/g, `
|
|
895
|
-
`)), typeof Bun < "u" && (p = p.replace(
|
|
896
|
-
// Matches e.g. \\u{1f60a} or \\u5F1F
|
|
897
|
-
/\\u(?:\{([\da-fA-F]{1,6})\}|([\da-fA-F]{4}))/g,
|
|
898
|
-
(u, c, y) => {
|
|
899
|
-
var b;
|
|
900
|
-
const D = (b = c ?? y) !== null && b !== void 0 ? b : "";
|
|
901
|
-
return String.fromCodePoint(parseInt(D, 16));
|
|
902
|
-
}
|
|
903
|
-
)), p;
|
|
904
|
-
}
|
|
905
|
-
}
|
|
906
|
-
function ss(t, e) {
|
|
907
|
-
if (typeof t != "string" || !t.includes(`
|
|
908
|
-
`))
|
|
909
|
-
return t;
|
|
910
|
-
const i = e.slice(e.lastIndexOf(`
|
|
911
|
-
`) + 1).match(/^(\s+)/);
|
|
912
|
-
if (i) {
|
|
913
|
-
const r = i[1];
|
|
914
|
-
return t.replace(/\n/g, `
|
|
915
|
-
${r}`);
|
|
916
|
-
}
|
|
917
|
-
return t;
|
|
918
|
-
}
|
|
919
|
-
const { line: Jt, group: se, indent: Xt, softline: je, dedentToRoot: Ht, literalline: os } = A, as = async (t, e, n, i, { commentOrTag: r, embeddedOverrideOptions: o }) => {
|
|
920
|
-
const s = {
|
|
921
|
-
...i,
|
|
922
|
-
...o
|
|
923
|
-
}, { node: l } = n, { createPlaceholder: p, placeholderRegex: f } = N(), d = l.quasis.map(
|
|
924
|
-
(m, h, { length: _ }) => h === _ - 1 ? m.value.cooked : m.value.cooked + p(h)
|
|
925
|
-
).join(""), u = d.match(/^\s+/)?.[0] ?? "", c = d.match(/\s+$/)?.[0] ?? "", y = d.slice(
|
|
926
|
-
u.length,
|
|
927
|
-
-c.length || void 0
|
|
928
|
-
), b = L(n, e), D = await t(
|
|
929
|
-
// use `dedent` to fix unstable embedded markdown indentation with the `useTabs` option
|
|
930
|
-
// https://github.com/Sec-ant/prettier-plugin-embed/pull/91#issuecomment-1963760555
|
|
931
|
-
// https://github.com/prettier/prettier/blob/1079517b32e5bb145afa7acba448af51f8a7b6e6/src/language-js/embed/markdown.js#L15-L19
|
|
932
|
-
_i(y),
|
|
933
|
-
{
|
|
934
|
-
...s,
|
|
935
|
-
parser: s.embeddedMarkdownParser ?? "markdown",
|
|
936
|
-
// this will change the code fence delimiter from ``` to ~~~
|
|
937
|
-
// https://github.com/prettier/prettier/blob/1079517b32e5bb145afa7acba448af51f8a7b6e6/src/language-markdown/embed.js#L15
|
|
938
|
-
__inJsTemplate: !0
|
|
939
|
-
}
|
|
940
|
-
), a = M(
|
|
941
|
-
D,
|
|
942
|
-
f,
|
|
943
|
-
b,
|
|
944
|
-
"hardline"
|
|
945
|
-
);
|
|
946
|
-
if (s.preserveEmbeddedExteriorWhitespaces?.includes(r))
|
|
947
|
-
return se([
|
|
948
|
-
"`",
|
|
949
|
-
u,
|
|
950
|
-
s.noEmbeddedMultiLineIndentation?.includes(r) ? Ht(se(a)) : Xt([se(a)]),
|
|
951
|
-
c,
|
|
952
|
-
"`"
|
|
953
|
-
]);
|
|
954
|
-
const g = u.length ? Jt : je, E = c.length ? Jt : je;
|
|
955
|
-
return s.noEmbeddedMultiLineIndentation?.includes(r) ? ["`", os, Ht(a), je, "`"] : se([
|
|
956
|
-
"`",
|
|
957
|
-
Xt([g, se(a)]),
|
|
958
|
-
E,
|
|
959
|
-
"`"
|
|
960
|
-
]);
|
|
961
|
-
}, ge = "embeddedMarkdown", ls = ["md", "markdown"], cs = ["markdown", "mdx", "remark"], ds = T(ge), Qt = S(ge), Vt = v(ge), us = G(ge), ps = {
|
|
962
|
-
[ds]: {
|
|
963
|
-
category: "Embed",
|
|
964
|
-
type: "string",
|
|
965
|
-
array: !0,
|
|
966
|
-
default: [{ value: [...ls] }],
|
|
967
|
-
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Markdown language.",
|
|
968
|
-
deprecated: `Please use \`${Qt}\` or \`${Vt}\`.`
|
|
969
|
-
},
|
|
970
|
-
[Qt]: {
|
|
971
|
-
category: "Embed",
|
|
972
|
-
type: "string",
|
|
973
|
-
array: !0,
|
|
974
|
-
default: [{ value: [$] }],
|
|
975
|
-
description: "Block comments that make their subsequent template literals be identified as embedded Markdown language."
|
|
976
|
-
},
|
|
977
|
-
[Vt]: {
|
|
978
|
-
category: "Embed",
|
|
979
|
-
type: "string",
|
|
980
|
-
array: !0,
|
|
981
|
-
default: [{ value: [$] }],
|
|
982
|
-
description: "Tags that make their subsequent template literals be identified as embedded Markdown language."
|
|
983
|
-
},
|
|
984
|
-
[us]: {
|
|
985
|
-
category: "Embed",
|
|
986
|
-
type: "choice",
|
|
987
|
-
default: "markdown",
|
|
988
|
-
description: "The parser used to parse the embedded Markdown language.",
|
|
989
|
-
choices: cs.map((t) => ({
|
|
990
|
-
value: t,
|
|
991
|
-
description: `Use the "${t}" parser.`
|
|
992
|
-
}))
|
|
993
|
-
}
|
|
994
|
-
}, gs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
995
|
-
__proto__: null,
|
|
996
|
-
embedder: as,
|
|
997
|
-
language: ge,
|
|
998
|
-
options: ps
|
|
999
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: Yt, group: z, indent: Kt, softline: Zt } = A, ms = async (t, e, n, i, { commentOrTag: r, embeddedOverrideOptions: o }) => {
|
|
1000
|
-
const s = {
|
|
1001
|
-
...i,
|
|
1002
|
-
...o
|
|
1003
|
-
}, { node: l } = n, { createPlaceholder: p, placeholderRegex: f } = N(), d = l.quasis.map(
|
|
1004
|
-
(m, h, { length: _ }) => h === _ - 1 ? m.value.cooked : m.value.cooked + p(h)
|
|
1005
|
-
).join(""), u = d.match(/^\s+/)?.[0] ?? "", c = d.match(/\s+$/)?.[0] ?? "", y = d.slice(
|
|
1006
|
-
u.length,
|
|
1007
|
-
-c.length || void 0
|
|
1008
|
-
), b = L(n, e), D = await t(y, {
|
|
1009
|
-
...s,
|
|
1010
|
-
parser: "nginx"
|
|
1011
|
-
}), a = M(D, f, b);
|
|
1012
|
-
if (s.preserveEmbeddedExteriorWhitespaces?.includes(r))
|
|
1013
|
-
return z([
|
|
1014
|
-
"`",
|
|
1015
|
-
u,
|
|
1016
|
-
s.noEmbeddedMultiLineIndentation?.includes(r) ? [z(a)] : Kt([z(a)]),
|
|
1017
|
-
c,
|
|
1018
|
-
"`"
|
|
1019
|
-
]);
|
|
1020
|
-
const g = u.length ? Yt : Zt, E = c.length ? Yt : Zt;
|
|
1021
|
-
return z([
|
|
1022
|
-
"`",
|
|
1023
|
-
s.noEmbeddedMultiLineIndentation?.includes(r) ? [g, z(a)] : Kt([g, z(a)]),
|
|
1024
|
-
E,
|
|
1025
|
-
"`"
|
|
1026
|
-
]);
|
|
1027
|
-
}, Le = "embeddedNginx", hs = ["nginx"], fs = T(Le), en = S(Le), tn = v(Le), Es = {
|
|
1028
|
-
[fs]: {
|
|
1029
|
-
category: "Embed",
|
|
1030
|
-
type: "string",
|
|
1031
|
-
array: !0,
|
|
1032
|
-
default: [{ value: [...hs] }],
|
|
1033
|
-
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded NGINX language. This option requires the `prettier-plugin-nginx` plugin.",
|
|
1034
|
-
deprecated: `Please use \`${en}\` or \`${tn}\`.`
|
|
1035
|
-
},
|
|
1036
|
-
[en]: {
|
|
1037
|
-
category: "Embed",
|
|
1038
|
-
type: "string",
|
|
1039
|
-
array: !0,
|
|
1040
|
-
default: [{ value: [$] }],
|
|
1041
|
-
description: "Block comments that make their subsequent template literals be identified as embedded NGINX language. This option requires the `prettier-plugin-nginx` plugin."
|
|
1042
|
-
},
|
|
1043
|
-
[tn]: {
|
|
1044
|
-
category: "Embed",
|
|
1045
|
-
type: "string",
|
|
1046
|
-
array: !0,
|
|
1047
|
-
default: [{ value: [$] }],
|
|
1048
|
-
description: "Tags that make their subsequent template literals be identified as embedded NGINX language. This option requires the `prettier-plugin-nginx` plugin."
|
|
1049
|
-
}
|
|
1050
|
-
}, bs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1051
|
-
__proto__: null,
|
|
1052
|
-
embedder: ms,
|
|
1053
|
-
language: Le,
|
|
1054
|
-
options: Es
|
|
1055
|
-
}, Symbol.toStringTag, { value: "Module" })), me = "embeddedNoop", _s = T(me), nn = S(me), rn = v(me), ys = {
|
|
1056
|
-
[_s]: {
|
|
1057
|
-
category: "Embed",
|
|
1058
|
-
type: "string",
|
|
1059
|
-
array: !0,
|
|
1060
|
-
default: [{ value: [] }],
|
|
1061
|
-
description: "Tag or comment identifiers that prevent their subsequent template literals from being identified as embedded languages and thus from being formatted.",
|
|
1062
|
-
deprecated: `Please use \`${nn}\` or \`${rn}\`.`
|
|
1063
|
-
},
|
|
1064
|
-
[nn]: {
|
|
1065
|
-
category: "Embed",
|
|
1066
|
-
type: "string",
|
|
1067
|
-
array: !0,
|
|
1068
|
-
default: [{ value: [$] }],
|
|
1069
|
-
description: "Block comments that prevent their subsequent template literals from being identified as embedded languages and thus from being formatted."
|
|
1070
|
-
},
|
|
1071
|
-
[rn]: {
|
|
1072
|
-
category: "Embed",
|
|
1073
|
-
type: "string",
|
|
1074
|
-
array: !0,
|
|
1075
|
-
default: [{ value: [$] }],
|
|
1076
|
-
description: "Tags that prevent their subsequent template literals from being identified as embedded languages and thus from being formatted."
|
|
1077
|
-
}
|
|
1078
|
-
}, Ds = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1079
|
-
__proto__: null,
|
|
1080
|
-
language: me,
|
|
1081
|
-
options: ys
|
|
1082
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: sn, group: J, indent: on, softline: an } = A, $s = async (t, e, n, i, { commentOrTag: r, embeddedOverrideOptions: o }) => {
|
|
1083
|
-
const s = {
|
|
1084
|
-
...i,
|
|
1085
|
-
...o
|
|
1086
|
-
}, { node: l } = n, { createPlaceholder: p, placeholderRegex: f } = N(), d = l.quasis.map(
|
|
1087
|
-
(m, h, { length: _ }) => h === _ - 1 ? m.value.cooked : m.value.cooked + p(h)
|
|
1088
|
-
).join(""), u = d.match(/^\s+/)?.[0] ?? "", c = d.match(/\s+$/)?.[0] ?? "", y = d.slice(
|
|
1089
|
-
u.length,
|
|
1090
|
-
-c.length || void 0
|
|
1091
|
-
), b = L(n, e), D = await t(y, {
|
|
1092
|
-
...s,
|
|
1093
|
-
parser: "pegjs-parser"
|
|
1094
|
-
}), a = M(D, f, b);
|
|
1095
|
-
if (s.preserveEmbeddedExteriorWhitespaces?.includes(r))
|
|
1096
|
-
return J([
|
|
1097
|
-
"`",
|
|
1098
|
-
u,
|
|
1099
|
-
s.noEmbeddedMultiLineIndentation?.includes(r) ? [J(a)] : on([J(a)]),
|
|
1100
|
-
c,
|
|
1101
|
-
"`"
|
|
1102
|
-
]);
|
|
1103
|
-
const g = u.length ? sn : an, E = c.length ? sn : an;
|
|
1104
|
-
return J([
|
|
1105
|
-
"`",
|
|
1106
|
-
s.noEmbeddedMultiLineIndentation?.includes(r) ? [g, J(a)] : on([g, J(a)]),
|
|
1107
|
-
E,
|
|
1108
|
-
"`"
|
|
1109
|
-
]);
|
|
1110
|
-
}, Ne = "embeddedPegjs", Ts = ["pegjs", "peggy", "peg"], vs = T(Ne), ln = S(Ne), cn = v(Ne), As = {
|
|
1111
|
-
[vs]: {
|
|
1112
|
-
category: "Embed",
|
|
1113
|
-
type: "string",
|
|
1114
|
-
array: !0,
|
|
1115
|
-
default: [{ value: [...Ts] }],
|
|
1116
|
-
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Pegjs language. This option requires the `prettier-plugin-pegjs` plugin.",
|
|
1117
|
-
deprecated: `Please use \`${ln}\` or \`${cn}\`.`
|
|
1118
|
-
},
|
|
1119
|
-
[ln]: {
|
|
1120
|
-
category: "Embed",
|
|
1121
|
-
type: "string",
|
|
1122
|
-
array: !0,
|
|
1123
|
-
default: [{ value: [$] }],
|
|
1124
|
-
description: "Block comments that make their subsequent template literals be identified as embedded Pegjs language. This option requires the `prettier-plugin-pegjs` plugin."
|
|
1125
|
-
},
|
|
1126
|
-
[cn]: {
|
|
1127
|
-
category: "Embed",
|
|
1128
|
-
type: "string",
|
|
1129
|
-
array: !0,
|
|
1130
|
-
default: [{ value: [$] }],
|
|
1131
|
-
description: "Tags that make their subsequent template literals be identified as embedded Pegjs language. This option requires the `prettier-plugin-pegjs` plugin."
|
|
1132
|
-
}
|
|
1133
|
-
}, Ss = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1134
|
-
__proto__: null,
|
|
1135
|
-
embedder: $s,
|
|
1136
|
-
language: Ne,
|
|
1137
|
-
options: As
|
|
1138
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: dn, group: X, indent: un, softline: pn } = A, Ms = async (t, e, n, i, { commentOrTag: r, embeddedOverrideOptions: o }) => {
|
|
1139
|
-
const s = {
|
|
1140
|
-
...i,
|
|
1141
|
-
...o
|
|
1142
|
-
}, { node: l } = n, { createPlaceholder: p, placeholderRegex: f } = N("$p"), d = l.quasis.map(
|
|
1143
|
-
(m, h, { length: _ }) => h === _ - 1 ? m.value.cooked : m.value.cooked + p(h)
|
|
1144
|
-
).join(""), u = d.match(/^\s+/)?.[0] ?? "", c = d.match(/\s+$/)?.[0] ?? "", y = d.slice(
|
|
1145
|
-
u.length,
|
|
1146
|
-
-c.length || void 0
|
|
1147
|
-
), b = L(n, e), D = await t(y, {
|
|
1148
|
-
...s,
|
|
1149
|
-
parser: "php"
|
|
1150
|
-
}), a = M(D, f, b);
|
|
1151
|
-
if (s.preserveEmbeddedExteriorWhitespaces?.includes(r))
|
|
1152
|
-
return X([
|
|
1153
|
-
"`",
|
|
1154
|
-
u,
|
|
1155
|
-
s.noEmbeddedMultiLineIndentation?.includes(r) ? [X(a)] : un([X(a)]),
|
|
1156
|
-
c,
|
|
1157
|
-
"`"
|
|
1158
|
-
]);
|
|
1159
|
-
const g = u.length ? dn : pn, E = c.length ? dn : pn;
|
|
1160
|
-
return X([
|
|
1161
|
-
"`",
|
|
1162
|
-
s.noEmbeddedMultiLineIndentation?.includes(r) ? [g, X(a)] : un([g, X(a)]),
|
|
1163
|
-
E,
|
|
1164
|
-
"`"
|
|
1165
|
-
]);
|
|
1166
|
-
}, ke = "embeddedPhp", Ls = ["php", "php5"], Ns = T(ke), gn = S(ke), mn = v(ke), ks = {
|
|
1167
|
-
[Ns]: {
|
|
1168
|
-
category: "Embed",
|
|
1169
|
-
type: "string",
|
|
1170
|
-
array: !0,
|
|
1171
|
-
default: [{ value: [...Ls] }],
|
|
1172
|
-
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded PHP language. This option requires the `@prettier/plugin-php` plugin.",
|
|
1173
|
-
deprecated: `Please use \`${gn}\` or \`${mn}\`.`
|
|
1174
|
-
},
|
|
1175
|
-
[gn]: {
|
|
1176
|
-
category: "Embed",
|
|
1177
|
-
type: "string",
|
|
1178
|
-
array: !0,
|
|
1179
|
-
default: [{ value: [$] }],
|
|
1180
|
-
description: "Block comments that make their subsequent template literals be identified as embedded PHP language. This option requires the `@prettier/plugin-php` plugin."
|
|
1181
|
-
},
|
|
1182
|
-
[mn]: {
|
|
1183
|
-
category: "Embed",
|
|
1184
|
-
type: "string",
|
|
1185
|
-
array: !0,
|
|
1186
|
-
default: [{ value: [$] }],
|
|
1187
|
-
description: "Tags that make their subsequent template literals be identified as embedded PHP language. This option requires the `@prettier/plugin-php` plugin."
|
|
1188
|
-
}
|
|
1189
|
-
}, Os = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1190
|
-
__proto__: null,
|
|
1191
|
-
embedder: Ms,
|
|
1192
|
-
language: ke,
|
|
1193
|
-
options: ks
|
|
1194
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: hn, group: H, indent: fn, softline: En } = A, Gs = async (t, e, n, i, { commentOrTag: r, embeddedOverrideOptions: o }) => {
|
|
1195
|
-
const s = {
|
|
1196
|
-
...i,
|
|
1197
|
-
...o
|
|
1198
|
-
}, { node: l } = n, { createPlaceholder: p, placeholderRegex: f } = N(), d = l.quasis.map(
|
|
1199
|
-
(m, h, { length: _ }) => h === _ - 1 ? m.value.cooked : m.value.cooked + p(h)
|
|
1200
|
-
).join(""), u = d.match(/^\s+/)?.[0] ?? "", c = d.match(/\s+$/)?.[0] ?? "", y = d.slice(
|
|
1201
|
-
u.length,
|
|
1202
|
-
-c.length || void 0
|
|
1203
|
-
), b = L(n, e), D = await t(y, {
|
|
1204
|
-
...s,
|
|
1205
|
-
parser: "prisma-parse"
|
|
1206
|
-
}), a = M(
|
|
1207
|
-
D,
|
|
1208
|
-
f,
|
|
1209
|
-
b,
|
|
1210
|
-
"hardline"
|
|
1211
|
-
);
|
|
1212
|
-
if (s.preserveEmbeddedExteriorWhitespaces?.includes(r))
|
|
1213
|
-
return H([
|
|
1214
|
-
"`",
|
|
1215
|
-
u,
|
|
1216
|
-
s.noEmbeddedMultiLineIndentation?.includes(r) ? [H(a)] : fn([H(a)]),
|
|
1217
|
-
c,
|
|
1218
|
-
"`"
|
|
1219
|
-
]);
|
|
1220
|
-
const g = u.length ? hn : En, E = c.length ? hn : En;
|
|
1221
|
-
return H([
|
|
1222
|
-
"`",
|
|
1223
|
-
s.noEmbeddedMultiLineIndentation?.includes(r) ? [g, H(a)] : fn([g, H(a)]),
|
|
1224
|
-
E,
|
|
1225
|
-
"`"
|
|
1226
|
-
]);
|
|
1227
|
-
}, Oe = "embeddedPrisma", Is = ["prisma"], xs = T(Oe), bn = S(Oe), _n = v(Oe), Ps = {
|
|
1228
|
-
[xs]: {
|
|
1229
|
-
category: "Embed",
|
|
1230
|
-
type: "string",
|
|
1231
|
-
array: !0,
|
|
1232
|
-
default: [{ value: [...Is] }],
|
|
1233
|
-
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Prisma language. This option requires the `prettier-plugin-prisma` plugin.",
|
|
1234
|
-
deprecated: `Please use \`${bn}\` or \`${_n}\`.`
|
|
1235
|
-
},
|
|
1236
|
-
[bn]: {
|
|
1237
|
-
category: "Embed",
|
|
1238
|
-
type: "string",
|
|
1239
|
-
array: !0,
|
|
1240
|
-
default: [{ value: [$] }],
|
|
1241
|
-
description: "Block comments that make their subsequent template literals be identified as embedded Prisma language. This option requires the `prettier-plugin-prisma` plugin."
|
|
1242
|
-
},
|
|
1243
|
-
[_n]: {
|
|
1244
|
-
category: "Embed",
|
|
1245
|
-
type: "string",
|
|
1246
|
-
array: !0,
|
|
1247
|
-
default: [{ value: [$] }],
|
|
1248
|
-
description: "Tags that make their subsequent template literals be identified as embedded Prisma language. This option requires the `prettier-plugin-prisma` plugin."
|
|
1249
|
-
}
|
|
1250
|
-
}, qs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1251
|
-
__proto__: null,
|
|
1252
|
-
embedder: Gs,
|
|
1253
|
-
language: Oe,
|
|
1254
|
-
options: Ps
|
|
1255
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: yn, group: Q, indent: Dn, softline: $n } = A, js = async (t, e, n, i, { commentOrTag: r, embeddedOverrideOptions: o }) => {
|
|
1256
|
-
const s = {
|
|
1257
|
-
...i,
|
|
1258
|
-
...o
|
|
1259
|
-
}, { node: l } = n, { createPlaceholder: p, placeholderRegex: f } = N(), d = l.quasis.map(
|
|
1260
|
-
(m, h, { length: _ }) => h === _ - 1 ? m.value.cooked : m.value.cooked + p(h)
|
|
1261
|
-
).join(""), u = d.match(/^\s+/)?.[0] ?? "", c = d.match(/\s+$/)?.[0] ?? "", y = d.slice(
|
|
1262
|
-
u.length,
|
|
1263
|
-
-c.length || void 0
|
|
1264
|
-
), b = L(n, e), D = await t(y, {
|
|
1265
|
-
...s,
|
|
1266
|
-
parser: "dot-properties"
|
|
1267
|
-
}), a = M(D, f, b);
|
|
1268
|
-
if (s.preserveEmbeddedExteriorWhitespaces?.includes(r))
|
|
1269
|
-
return Q([
|
|
1270
|
-
"`",
|
|
1271
|
-
u,
|
|
1272
|
-
s.noEmbeddedMultiLineIndentation?.includes(r) ? [Q(a)] : Dn([Q(a)]),
|
|
1273
|
-
c,
|
|
1274
|
-
"`"
|
|
1275
|
-
]);
|
|
1276
|
-
const g = u.length ? yn : $n, E = c.length ? yn : $n;
|
|
1277
|
-
return Q([
|
|
1278
|
-
"`",
|
|
1279
|
-
s.noEmbeddedMultiLineIndentation?.includes(r) ? [g, Q(a)] : Dn([g, Q(a)]),
|
|
1280
|
-
E,
|
|
1281
|
-
"`"
|
|
1282
|
-
]);
|
|
1283
|
-
}, Ge = "embeddedProperties", Rs = ["properties"], Bs = T(Ge), Tn = S(Ge), vn = v(Ge), ws = {
|
|
1284
|
-
[Bs]: {
|
|
1285
|
-
category: "Embed",
|
|
1286
|
-
type: "string",
|
|
1287
|
-
array: !0,
|
|
1288
|
-
default: [{ value: [...Rs] }],
|
|
1289
|
-
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Properties language. This option requires the `prettier-plugin-properties` plugin.",
|
|
1290
|
-
deprecated: `Please use \`${Tn}\` or \`${vn}\`.`
|
|
1291
|
-
},
|
|
1292
|
-
[Tn]: {
|
|
1293
|
-
category: "Embed",
|
|
1294
|
-
type: "string",
|
|
1295
|
-
array: !0,
|
|
1296
|
-
default: [{ value: [$] }],
|
|
1297
|
-
description: "Block comments that make their subsequent template literals be identified as embedded Properties language. This option requires the `prettier-plugin-properties` plugin."
|
|
1298
|
-
},
|
|
1299
|
-
[vn]: {
|
|
1300
|
-
category: "Embed",
|
|
1301
|
-
type: "string",
|
|
1302
|
-
array: !0,
|
|
1303
|
-
default: [{ value: [$] }],
|
|
1304
|
-
description: "Tags that make their subsequent template literals be identified as embedded Properties language. This option requires the `prettier-plugin-properties` plugin."
|
|
1305
|
-
}
|
|
1306
|
-
}, Us = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1307
|
-
__proto__: null,
|
|
1308
|
-
embedder: js,
|
|
1309
|
-
language: Ge,
|
|
1310
|
-
options: ws
|
|
1311
|
-
}, Symbol.toStringTag, { value: "Module" })), { group: V, line: An, softline: Sn, indent: Mn } = A, Cs = async (t, e, n, i, { commentOrTag: r, embeddedOverrideOptions: o }) => {
|
|
1312
|
-
const s = {
|
|
1313
|
-
...i,
|
|
1314
|
-
...o
|
|
1315
|
-
}, { node: l } = n, { createPlaceholder: p, placeholderRegex: f } = N(), d = l.quasis.map(
|
|
1316
|
-
(m, h, { length: _ }) => h === _ - 1 ? m.value.cooked : m.value.cooked + p(h)
|
|
1317
|
-
).join(""), u = d.match(/^\s+/)?.[0] ?? "", c = d.match(/\s+$/)?.[0] ?? "", y = d.slice(
|
|
1318
|
-
u.length,
|
|
1319
|
-
-c.length || void 0
|
|
1320
|
-
), b = L(n, e), D = await t(y, {
|
|
1321
|
-
...s,
|
|
1322
|
-
parser: "pug"
|
|
1323
|
-
}), a = M(
|
|
1324
|
-
D,
|
|
1325
|
-
f,
|
|
1326
|
-
b,
|
|
1327
|
-
"hardline"
|
|
1328
|
-
);
|
|
1329
|
-
if (s.preserveEmbeddedExteriorWhitespaces?.includes(r))
|
|
1330
|
-
return V([
|
|
1331
|
-
"`",
|
|
1332
|
-
u,
|
|
1333
|
-
s.noEmbeddedMultiLineIndentation?.includes(r) ? [V(a)] : Mn([V(a)]),
|
|
1334
|
-
c,
|
|
1335
|
-
"`"
|
|
1336
|
-
]);
|
|
1337
|
-
const g = u.length ? An : Sn, E = c.length ? An : Sn;
|
|
1338
|
-
return V([
|
|
1339
|
-
"`",
|
|
1340
|
-
s.noEmbeddedMultiLineIndentation?.includes(r) ? [g, V(a)] : Mn([g, V(a)]),
|
|
1341
|
-
E,
|
|
1342
|
-
"`"
|
|
1343
|
-
]);
|
|
1344
|
-
}, Ie = "embeddedPug", Ws = ["pug", "jade"], Fs = T(Ie), Ln = S(Ie), Nn = v(Ie), zs = {
|
|
1345
|
-
[Fs]: {
|
|
1346
|
-
category: "Embed",
|
|
1347
|
-
type: "string",
|
|
1348
|
-
array: !0,
|
|
1349
|
-
default: [{ value: [...Ws] }],
|
|
1350
|
-
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Pug language. This option requires the `@prettier/plugin-pug` plugin.",
|
|
1351
|
-
deprecated: `Please use \`${Ln}\` or \`${Nn}\`.`
|
|
1352
|
-
},
|
|
1353
|
-
[Ln]: {
|
|
1354
|
-
category: "Embed",
|
|
1355
|
-
type: "string",
|
|
1356
|
-
array: !0,
|
|
1357
|
-
default: [{ value: [$] }],
|
|
1358
|
-
description: "Block comments that make their subsequent template literals be identified as embedded Pug language. This option requires the `@prettier/plugin-pug` plugin."
|
|
1359
|
-
},
|
|
1360
|
-
[Nn]: {
|
|
1361
|
-
category: "Embed",
|
|
1362
|
-
type: "string",
|
|
1363
|
-
array: !0,
|
|
1364
|
-
default: [{ value: [$] }],
|
|
1365
|
-
description: "Tags that make their subsequent template literals be identified as embedded Pug language. This option requires the `@prettier/plugin-pug` plugin."
|
|
1366
|
-
}
|
|
1367
|
-
}, Js = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1368
|
-
__proto__: null,
|
|
1369
|
-
embedder: Cs,
|
|
1370
|
-
language: Ie,
|
|
1371
|
-
options: zs
|
|
1372
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: kn, group: Y, indent: On, softline: Gn } = A, Xs = async (t, e, n, i, { commentOrTag: r, embeddedOverrideOptions: o }) => {
|
|
1373
|
-
const s = {
|
|
1374
|
-
...i,
|
|
1375
|
-
...o
|
|
1376
|
-
}, { node: l } = n, { createPlaceholder: p, placeholderRegex: f } = N(), d = l.quasis.map(
|
|
1377
|
-
(m, h, { length: _ }) => h === _ - 1 ? m.value.cooked : m.value.cooked + p(h)
|
|
1378
|
-
).join(""), u = d.match(/^\s+/)?.[0] ?? "", c = d.match(/\s+$/)?.[0] ?? "", y = d.slice(
|
|
1379
|
-
u.length,
|
|
1380
|
-
-c.length || void 0
|
|
1381
|
-
), b = L(n, e), D = await t(y, {
|
|
1382
|
-
...s,
|
|
1383
|
-
parser: s.embeddedRubyParser ?? "ruby"
|
|
1384
|
-
}), a = M(D, f, b);
|
|
1385
|
-
if (s.preserveEmbeddedExteriorWhitespaces?.includes(r))
|
|
1386
|
-
return Y([
|
|
1387
|
-
"`",
|
|
1388
|
-
u,
|
|
1389
|
-
s.noEmbeddedMultiLineIndentation?.includes(r) ? [Y(a)] : On([Y(a)]),
|
|
1390
|
-
c,
|
|
1391
|
-
"`"
|
|
1392
|
-
]);
|
|
1393
|
-
const g = u.length ? kn : Gn, E = c.length ? kn : Gn;
|
|
1394
|
-
return Y([
|
|
1395
|
-
"`",
|
|
1396
|
-
s.noEmbeddedMultiLineIndentation?.includes(r) ? [g, Y(a)] : On([g, Y(a)]),
|
|
1397
|
-
E,
|
|
1398
|
-
"`"
|
|
1399
|
-
]);
|
|
1400
|
-
}, he = "embeddedRuby", Hs = ["ruby"], Qs = ["ruby", "rbs", "haml"], Vs = T(he), In = S(he), xn = v(he), Ys = G(he), Ks = {
|
|
1401
|
-
[Vs]: {
|
|
1402
|
-
category: "Embed",
|
|
1403
|
-
type: "string",
|
|
1404
|
-
array: !0,
|
|
1405
|
-
default: [{ value: [...Hs] }],
|
|
1406
|
-
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Ruby language. This option requires the `@prettier/plugin-ruby` plugin.",
|
|
1407
|
-
deprecated: `Please use \`${In}\` or \`${xn}\`.`
|
|
1408
|
-
},
|
|
1409
|
-
[In]: {
|
|
1410
|
-
category: "Embed",
|
|
1411
|
-
type: "string",
|
|
1412
|
-
array: !0,
|
|
1413
|
-
default: [{ value: [$] }],
|
|
1414
|
-
description: "Block comments that make their subsequent template literals be identified as embedded Ruby language. This option requires the `@prettier/plugin-ruby` plugin."
|
|
1415
|
-
},
|
|
1416
|
-
[xn]: {
|
|
1417
|
-
category: "Embed",
|
|
1418
|
-
type: "string",
|
|
1419
|
-
array: !0,
|
|
1420
|
-
default: [{ value: [$] }],
|
|
1421
|
-
description: "Tags that make their subsequent template literals be identified as embedded Ruby language. This option requires the `@prettier/plugin-ruby` plugin."
|
|
1422
|
-
},
|
|
1423
|
-
[Ys]: {
|
|
1424
|
-
category: "Embed",
|
|
1425
|
-
type: "choice",
|
|
1426
|
-
default: "ruby",
|
|
1427
|
-
description: "The parser used to parse the embedded Ruby language. This option requires the `@prettier/plugin-ruby` plugin.",
|
|
1428
|
-
choices: Qs.map((t) => ({
|
|
1429
|
-
value: t,
|
|
1430
|
-
description: `Use the "${t}" parser.`
|
|
1431
|
-
}))
|
|
1432
|
-
}
|
|
1433
|
-
}, Zs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1434
|
-
__proto__: null,
|
|
1435
|
-
embedder: Xs,
|
|
1436
|
-
language: he,
|
|
1437
|
-
options: Ks
|
|
1438
|
-
}, Symbol.toStringTag, { value: "Module" })), { group: K, line: Pn, softline: qn, indent: jn } = A, eo = async (t, e, n, i, { commentOrTag: r, embeddedOverrideOptions: o }) => {
|
|
1439
|
-
const s = {
|
|
1440
|
-
...i,
|
|
1441
|
-
...o
|
|
1442
|
-
}, { node: l } = n, { createPlaceholder: p, placeholderRegex: f } = N(), d = l.quasis.map(
|
|
1443
|
-
(m, h, { length: _ }) => h === _ - 1 ? m.value.cooked : m.value.cooked + p(h)
|
|
1444
|
-
).join(""), u = d.match(/^\s+/)?.[0] ?? "", c = d.match(/\s+$/)?.[0] ?? "", y = d.slice(
|
|
1445
|
-
u.length,
|
|
1446
|
-
-c.length || void 0
|
|
1447
|
-
), b = L(n, e), D = await t(y, {
|
|
1448
|
-
...s,
|
|
1449
|
-
parser: "sh"
|
|
1450
|
-
}), a = M(
|
|
1451
|
-
D,
|
|
1452
|
-
f,
|
|
1453
|
-
b,
|
|
1454
|
-
"hardline"
|
|
1455
|
-
);
|
|
1456
|
-
if (s.preserveEmbeddedExteriorWhitespaces?.includes(r))
|
|
1457
|
-
return K([
|
|
1458
|
-
"`",
|
|
1459
|
-
u,
|
|
1460
|
-
s.noEmbeddedMultiLineIndentation?.includes(r) ? [K(a)] : jn([K(a)]),
|
|
1461
|
-
c,
|
|
1462
|
-
"`"
|
|
1463
|
-
]);
|
|
1464
|
-
const g = u.length ? Pn : qn, E = c.length ? Pn : qn;
|
|
1465
|
-
return K([
|
|
1466
|
-
"`",
|
|
1467
|
-
s.noEmbeddedMultiLineIndentation?.includes(r) ? [g, K(a)] : jn([g, K(a)]),
|
|
1468
|
-
E,
|
|
1469
|
-
"`"
|
|
1470
|
-
]);
|
|
1471
|
-
}, xe = "embeddedSh", to = ["sh"], no = T(xe), Rn = S(xe), Bn = v(xe), io = {
|
|
1472
|
-
[no]: {
|
|
1473
|
-
category: "Embed",
|
|
1474
|
-
type: "string",
|
|
1475
|
-
array: !0,
|
|
1476
|
-
default: [{ value: [...to] }],
|
|
1477
|
-
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Shell language. This option requires the `prettier-plugin-sh` plugin.",
|
|
1478
|
-
deprecated: `Please use \`${Rn}\` or \`${Bn}\`.`
|
|
1479
|
-
},
|
|
1480
|
-
[Rn]: {
|
|
1481
|
-
category: "Embed",
|
|
1482
|
-
type: "string",
|
|
1483
|
-
array: !0,
|
|
1484
|
-
default: [{ value: [$] }],
|
|
1485
|
-
description: "Block comments that make their subsequent template literals be identified as embedded Shell language. This option requires the `prettier-plugin-sh` plugin."
|
|
1486
|
-
},
|
|
1487
|
-
[Bn]: {
|
|
1488
|
-
category: "Embed",
|
|
1489
|
-
type: "string",
|
|
1490
|
-
array: !0,
|
|
1491
|
-
default: [{ value: [$] }],
|
|
1492
|
-
description: "Tags that make their subsequent template literals be identified as embedded Shell language. This option requires the `prettier-plugin-sh` plugin."
|
|
1493
|
-
}
|
|
1494
|
-
}, ro = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1495
|
-
__proto__: null,
|
|
1496
|
-
embedder: eo,
|
|
1497
|
-
language: xe,
|
|
1498
|
-
options: io
|
|
1499
|
-
}, Symbol.toStringTag, { value: "Module" })), { group: Z, line: wn, softline: Un, indent: Cn } = A, so = async (t, e, n, i, { commentOrTag: r, embeddedOverrideOptions: o }) => {
|
|
1500
|
-
const s = {
|
|
1501
|
-
...i,
|
|
1502
|
-
...o
|
|
1503
|
-
}, l = s.embeddedSqlPlugin ?? "prettier-plugin-sql", { node: p } = n, { createPlaceholder: f, placeholderRegex: d } = N(), u = p.quasis.map(
|
|
1504
|
-
(m, h, { length: _ }) => h === _ - 1 ? m.value.cooked : m.value.cooked + f(h)
|
|
1505
|
-
).join(""), c = u.match(/^\s+/)?.[0] ?? "", y = u.match(/\s+$/)?.[0] ?? "", b = u.slice(
|
|
1506
|
-
c.length,
|
|
1507
|
-
-y.length || void 0
|
|
1508
|
-
), D = L(n, e);
|
|
1509
|
-
let a;
|
|
1510
|
-
if (l === "prettier-plugin-sql-cst") {
|
|
1511
|
-
const m = await t(b, {
|
|
1512
|
-
...s,
|
|
1513
|
-
parser: s.embeddedSqlParser ?? "sqlite"
|
|
1514
|
-
});
|
|
1515
|
-
a = M(m, d, D);
|
|
1516
|
-
} else {
|
|
1517
|
-
const m = await t(_i(b), {
|
|
1518
|
-
...s,
|
|
1519
|
-
parser: "sql"
|
|
1520
|
-
});
|
|
1521
|
-
a = M(
|
|
1522
|
-
m,
|
|
1523
|
-
d,
|
|
1524
|
-
D,
|
|
1525
|
-
"hardline"
|
|
1526
|
-
);
|
|
1527
|
-
}
|
|
1528
|
-
if (s.preserveEmbeddedExteriorWhitespaces?.includes(r))
|
|
1529
|
-
return Z([
|
|
1530
|
-
"`",
|
|
1531
|
-
c,
|
|
1532
|
-
s.noEmbeddedMultiLineIndentation?.includes(r) ? [Z(a)] : Cn([Z(a)]),
|
|
1533
|
-
y,
|
|
1534
|
-
"`"
|
|
1535
|
-
]);
|
|
1536
|
-
const g = c.length ? wn : Un, E = y.length ? wn : Un;
|
|
1537
|
-
return Z([
|
|
1538
|
-
"`",
|
|
1539
|
-
s.noEmbeddedMultiLineIndentation?.includes(r) ? [g, Z(a)] : Cn([g, Z(a)]),
|
|
1540
|
-
E,
|
|
1541
|
-
"`"
|
|
1542
|
-
]);
|
|
1543
|
-
}, re = "embeddedSql", oo = ["sql"], ao = ["prettier-plugin-sql", "prettier-plugin-sql-cst"], lo = [
|
|
1544
|
-
"sqlite",
|
|
1545
|
-
"bigquery",
|
|
1546
|
-
"mysql",
|
|
1547
|
-
"mariadb",
|
|
1548
|
-
"postgresql"
|
|
1549
|
-
], co = T(re), Wn = S(re), Fn = v(re), uo = Qi(re), po = G(re), go = {
|
|
1550
|
-
[co]: {
|
|
1551
|
-
category: "Embed",
|
|
1552
|
-
type: "string",
|
|
1553
|
-
array: !0,
|
|
1554
|
-
default: [{ value: [...oo] }],
|
|
1555
|
-
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded SQL language. This option requires the `prettier-plugin-sql` plugin or the `prettier-plugin-sql-cst` plugin.",
|
|
1556
|
-
deprecated: `Please use \`${Wn}\` or \`${Fn}\`.`
|
|
1557
|
-
},
|
|
1558
|
-
[Wn]: {
|
|
1559
|
-
category: "Embed",
|
|
1560
|
-
type: "string",
|
|
1561
|
-
array: !0,
|
|
1562
|
-
default: [{ value: [$] }],
|
|
1563
|
-
description: "Block comments that make their subsequent template literals be identified as embedded SQL language. This option requires the `prettier-plugin-sql` plugin or the `prettier-plugin-sql-cst` plugin."
|
|
1564
|
-
},
|
|
1565
|
-
[Fn]: {
|
|
1566
|
-
category: "Embed",
|
|
1567
|
-
type: "string",
|
|
1568
|
-
array: !0,
|
|
1569
|
-
default: [{ value: [$] }],
|
|
1570
|
-
description: "Tags that make their subsequent template literals be identified as embedded SQL language. This option requires the `prettier-plugin-sql` plugin or the `prettier-plugin-sql-cst` plugin."
|
|
1571
|
-
},
|
|
1572
|
-
[uo]: {
|
|
1573
|
-
category: "Embed",
|
|
1574
|
-
type: "choice",
|
|
1575
|
-
default: "prettier-plugin-sql",
|
|
1576
|
-
description: "The plugin used to format the embedded SQL language. This option requires the `prettier-plugin-sql` plugin or the `prettier-plugin-sql-cst` plugin.",
|
|
1577
|
-
choices: ao.map((t) => ({
|
|
1578
|
-
value: t,
|
|
1579
|
-
description: `Use the "${t}" plugin.`
|
|
1580
|
-
}))
|
|
1581
|
-
},
|
|
1582
|
-
[po]: {
|
|
1583
|
-
category: "Embed",
|
|
1584
|
-
type: "choice",
|
|
1585
|
-
default: "sqlite",
|
|
1586
|
-
description: "Specify the embedded SQL language parser. This option is only needed with the `prettier-plugin-sql-cst` plugin.",
|
|
1587
|
-
choices: lo.map((t) => ({
|
|
1588
|
-
value: t,
|
|
1589
|
-
description: `Use the "${t}" parser.`
|
|
1590
|
-
}))
|
|
1591
|
-
}
|
|
1592
|
-
}, mo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1593
|
-
__proto__: null,
|
|
1594
|
-
embedder: so,
|
|
1595
|
-
language: re,
|
|
1596
|
-
options: go
|
|
1597
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: zn, group: ee, indent: Jn, softline: Xn } = A, ho = async (t, e, n, i, { commentOrTag: r, embeddedOverrideOptions: o }) => {
|
|
1598
|
-
const s = {
|
|
1599
|
-
...i,
|
|
1600
|
-
...o
|
|
1601
|
-
}, { node: l } = n, { createPlaceholder: p, placeholderRegex: f } = N(), d = l.quasis.map(
|
|
1602
|
-
(m, h, { length: _ }) => h === _ - 1 ? m.value.cooked : m.value.cooked + p(h)
|
|
1603
|
-
).join(""), u = d.match(/^\s+/)?.[0] ?? "", c = d.match(/\s+$/)?.[0] ?? "", y = d.slice(
|
|
1604
|
-
u.length,
|
|
1605
|
-
-c.length || void 0
|
|
1606
|
-
), b = L(n, e), D = await t(y, {
|
|
1607
|
-
...s,
|
|
1608
|
-
parser: "toml"
|
|
1609
|
-
}), a = M(
|
|
1610
|
-
D,
|
|
1611
|
-
f,
|
|
1612
|
-
b,
|
|
1613
|
-
"hardline"
|
|
1614
|
-
);
|
|
1615
|
-
if (s.preserveEmbeddedExteriorWhitespaces?.includes(r))
|
|
1616
|
-
return ee([
|
|
1617
|
-
"`",
|
|
1618
|
-
u,
|
|
1619
|
-
s.noEmbeddedMultiLineIndentation?.includes(r) ? [ee(a)] : Jn([ee(a)]),
|
|
1620
|
-
c,
|
|
1621
|
-
"`"
|
|
1622
|
-
]);
|
|
1623
|
-
const g = u.length ? zn : Xn, E = c.length ? zn : Xn;
|
|
1624
|
-
return ee([
|
|
1625
|
-
"`",
|
|
1626
|
-
s.noEmbeddedMultiLineIndentation?.includes(r) ? [g, ee(a)] : Jn([g, ee(a)]),
|
|
1627
|
-
E,
|
|
1628
|
-
"`"
|
|
1629
|
-
]);
|
|
1630
|
-
}, Pe = "embeddedToml", fo = ["toml"], Eo = T(Pe), Hn = S(Pe), Qn = v(Pe), bo = {
|
|
1631
|
-
[Eo]: {
|
|
1632
|
-
category: "Embed",
|
|
1633
|
-
type: "string",
|
|
1634
|
-
array: !0,
|
|
1635
|
-
default: [{ value: [...fo] }],
|
|
1636
|
-
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded TOML language. This option requires the `prettier-plugin-toml` plugin.",
|
|
1637
|
-
deprecated: `Please use \`${Hn}\` or \`${Qn}\`.`
|
|
1638
|
-
},
|
|
1639
|
-
[Hn]: {
|
|
1640
|
-
category: "Embed",
|
|
1641
|
-
type: "string",
|
|
1642
|
-
array: !0,
|
|
1643
|
-
default: [{ value: [$] }],
|
|
1644
|
-
description: "Block comments that make their subsequent template literals be identified as embedded TOML language. This option requires the `prettier-plugin-toml` plugin."
|
|
1645
|
-
},
|
|
1646
|
-
[Qn]: {
|
|
1647
|
-
category: "Embed",
|
|
1648
|
-
type: "string",
|
|
1649
|
-
array: !0,
|
|
1650
|
-
default: [{ value: [$] }],
|
|
1651
|
-
description: "Tags that make their subsequent template literals be identified as embedded TOML language. This option requires the `prettier-plugin-toml` plugin."
|
|
1652
|
-
}
|
|
1653
|
-
}, _o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1654
|
-
__proto__: null,
|
|
1655
|
-
embedder: ho,
|
|
1656
|
-
language: Pe,
|
|
1657
|
-
options: bo
|
|
1658
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: Vn, group: te, indent: Yn, softline: Kn } = A, yo = async (t, e, n, i, { commentOrTag: r, embeddedOverrideOptions: o }) => {
|
|
1659
|
-
const s = {
|
|
1660
|
-
...i,
|
|
1661
|
-
...o
|
|
1662
|
-
}, { node: l } = n, { createPlaceholder: p, placeholderRegex: f } = N(), d = l.quasis.map(
|
|
1663
|
-
(m, h, { length: _ }) => h === _ - 1 ? m.value.cooked : m.value.cooked + p(h)
|
|
1664
|
-
).join(""), u = d.match(/^\s+/)?.[0] ?? "", c = d.match(/\s+$/)?.[0] ?? "", y = d.slice(
|
|
1665
|
-
u.length,
|
|
1666
|
-
-c.length || void 0
|
|
1667
|
-
), b = L(n, e), D = await t(y, {
|
|
1668
|
-
...s,
|
|
1669
|
-
parser: s.embeddedTsParser ?? "typescript",
|
|
1670
|
-
// set filepath to undefined to enable jsx auto detection:
|
|
1671
|
-
// https://github.com/prettier/prettier/blob/427a84d24203e2d54160cde153a1e6a6390fe65a/src/language-js/parse/typescript.js#L49-L53
|
|
1672
|
-
filepath: void 0
|
|
1673
|
-
}), a = M(D, f, b);
|
|
1674
|
-
if (s.preserveEmbeddedExteriorWhitespaces?.includes(r))
|
|
1675
|
-
return te([
|
|
1676
|
-
"`",
|
|
1677
|
-
u,
|
|
1678
|
-
s.noEmbeddedMultiLineIndentation?.includes(r) ? [te(a)] : Yn([te(a)]),
|
|
1679
|
-
c,
|
|
1680
|
-
"`"
|
|
1681
|
-
]);
|
|
1682
|
-
const g = u.length ? Vn : Kn, E = c.length ? Vn : Kn;
|
|
1683
|
-
return te([
|
|
1684
|
-
"`",
|
|
1685
|
-
s.noEmbeddedMultiLineIndentation?.includes(r) ? [g, te(a)] : Yn([g, te(a)]),
|
|
1686
|
-
E,
|
|
1687
|
-
"`"
|
|
1688
|
-
]);
|
|
1689
|
-
}, fe = "embeddedTs", Do = [
|
|
1690
|
-
"ts",
|
|
1691
|
-
"tsx",
|
|
1692
|
-
"cts",
|
|
1693
|
-
"mts",
|
|
1694
|
-
"typescript"
|
|
1695
|
-
], $o = ["typescript", "babel-ts"], To = T(fe), Zn = S(fe), ei = v(fe), vo = G(fe), Ao = {
|
|
1696
|
-
[To]: {
|
|
1697
|
-
category: "Embed",
|
|
1698
|
-
type: "string",
|
|
1699
|
-
array: !0,
|
|
1700
|
-
default: [{ value: [...Do] }],
|
|
1701
|
-
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded TypeScript language.",
|
|
1702
|
-
deprecated: `Please use \`${Zn}\` or \`${ei}\`.`
|
|
1703
|
-
},
|
|
1704
|
-
[Zn]: {
|
|
1705
|
-
category: "Embed",
|
|
1706
|
-
type: "string",
|
|
1707
|
-
array: !0,
|
|
1708
|
-
default: [{ value: [$] }],
|
|
1709
|
-
description: "Block comments that make their subsequent template literals be identified as embedded TypeScript language."
|
|
1710
|
-
},
|
|
1711
|
-
[ei]: {
|
|
1712
|
-
category: "Embed",
|
|
1713
|
-
type: "string",
|
|
1714
|
-
array: !0,
|
|
1715
|
-
default: [{ value: [$] }],
|
|
1716
|
-
description: "Tags that make their subsequent template literals be identified as embedded TypeScript language."
|
|
1717
|
-
},
|
|
1718
|
-
[vo]: {
|
|
1719
|
-
category: "Embed",
|
|
1720
|
-
type: "choice",
|
|
1721
|
-
default: "typescript",
|
|
1722
|
-
description: "The parser used to parse the embedded TypeScript language.",
|
|
1723
|
-
choices: $o.map((t) => ({
|
|
1724
|
-
value: t,
|
|
1725
|
-
description: `Use the "${t}" parser.`
|
|
1726
|
-
}))
|
|
1727
|
-
}
|
|
1728
|
-
}, So = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1729
|
-
__proto__: null,
|
|
1730
|
-
embedder: yo,
|
|
1731
|
-
language: fe,
|
|
1732
|
-
options: Ao
|
|
1733
|
-
}, Symbol.toStringTag, { value: "Module" })), Ee = "embeddedXml", { line: ti, group: ne, indent: ni, softline: Re } = A, Mo = async (t, e, n, i, { commentOrTag: r, embeddedOverrideOptions: o }) => {
|
|
1734
|
-
const s = {
|
|
1735
|
-
...i,
|
|
1736
|
-
...o
|
|
1737
|
-
}, { node: l } = n, { createPlaceholder: p, placeholderRegex: f } = N(), d = l.quasis.map(
|
|
1738
|
-
(h, _, { length: k }) => _ === k - 1 ? h.value.cooked : h.value.cooked + p(_)
|
|
1739
|
-
).join(""), u = d.match(/^\s+/)?.[0] ?? "", c = d.match(/\s+$/)?.[0] ?? "", y = d.slice(
|
|
1740
|
-
u.length,
|
|
1741
|
-
-c.length || void 0
|
|
1742
|
-
), b = L(n, e), D = [];
|
|
1743
|
-
let a = 0;
|
|
1744
|
-
for (; a !== void 0; ) {
|
|
1745
|
-
const h = y.slice(a);
|
|
1746
|
-
if (h.length === 0)
|
|
1747
|
-
break;
|
|
1748
|
-
a > 0 && s.xmlWhitespaceSensitivity !== "strict" && D.push(Re), s.__embeddedXmlFragmentRecoverIndex?.splice(
|
|
1749
|
-
0,
|
|
1750
|
-
s.__embeddedXmlFragmentRecoverIndex.length
|
|
1751
|
-
);
|
|
1752
|
-
let _ = await t(h, {
|
|
1753
|
-
...s,
|
|
1754
|
-
parser: Ee
|
|
1755
|
-
});
|
|
1756
|
-
const [k, O] = s.__embeddedXmlFragmentRecoverIndex ?? [];
|
|
1757
|
-
k === void 0 ? a = void 0 : O === void 0 ? a += k : (_ = h.slice(k, O + 1), a += O + 1), D.push(_);
|
|
1758
|
-
}
|
|
1759
|
-
const g = M(D, f, b);
|
|
1760
|
-
if (s.xmlWhitespaceSensitivity === "strict" || s.preserveEmbeddedExteriorWhitespaces?.includes(r))
|
|
1761
|
-
return ne([
|
|
1762
|
-
"`",
|
|
1763
|
-
u,
|
|
1764
|
-
s.noEmbeddedMultiLineIndentation?.includes(r) ? [ne(g)] : ni([ne(g)]),
|
|
1765
|
-
c,
|
|
1766
|
-
"`"
|
|
1767
|
-
]);
|
|
1768
|
-
const E = u.length ? ti : Re, m = c.length ? ti : Re;
|
|
1769
|
-
return ne([
|
|
1770
|
-
"`",
|
|
1771
|
-
s.noEmbeddedMultiLineIndentation?.includes(r) ? [E, ne(g)] : ni([E, ne(g)]),
|
|
1772
|
-
m,
|
|
1773
|
-
"`"
|
|
1774
|
-
]);
|
|
1775
|
-
}, Lo = ["xml", "opml", "rss", "svg"], No = T(Ee), ii = S(Ee), ri = v(Ee), ko = {
|
|
1776
|
-
[No]: {
|
|
1777
|
-
category: "Embed",
|
|
1778
|
-
type: "string",
|
|
1779
|
-
array: !0,
|
|
1780
|
-
default: [{ value: [...Lo] }],
|
|
1781
|
-
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded XML language. This option requires the `@prettier/plugin-xml` plugin.",
|
|
1782
|
-
deprecated: `Please use \`${ii}\` or \`${ri}\`.`
|
|
1783
|
-
},
|
|
1784
|
-
[ii]: {
|
|
1785
|
-
category: "Embed",
|
|
1786
|
-
type: "string",
|
|
1787
|
-
array: !0,
|
|
1788
|
-
default: [{ value: [$] }],
|
|
1789
|
-
description: "Block comments that make their subsequent template literals be identified as embedded XML language. This option requires the `@prettier/plugin-xml` plugin."
|
|
1790
|
-
},
|
|
1791
|
-
[ri]: {
|
|
1792
|
-
category: "Embed",
|
|
1793
|
-
type: "string",
|
|
1794
|
-
array: !0,
|
|
1795
|
-
default: [{ value: [$] }],
|
|
1796
|
-
description: "Tags that make their subsequent template literals be identified as embedded XML language. This option requires the `@prettier/plugin-xml` plugin."
|
|
1797
|
-
},
|
|
1798
|
-
/**
|
|
1799
|
-
* @internal
|
|
1800
|
-
*/
|
|
1801
|
-
__embeddedXmlFragmentRecoverIndex: {
|
|
1802
|
-
category: "Embed",
|
|
1803
|
-
type: "int",
|
|
1804
|
-
array: !0,
|
|
1805
|
-
default: [{ value: [] }],
|
|
1806
|
-
description: "This option is read only and is used internally as a workaround to support xml fragments"
|
|
1807
|
-
}
|
|
145
|
+
function S(e = "p", t = "") {
|
|
146
|
+
let n = x(), r = x(), i = fe(e), a = fe(t);
|
|
147
|
+
return {
|
|
148
|
+
createPlaceholder: (i) => `${e}${n}${i}${r}${t}`,
|
|
149
|
+
placeholderRegex: RegExp(`${i}${n}(\\d+)${r}${a}`, "ig")
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
function fe(e) {
|
|
153
|
+
return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
154
|
+
}
|
|
155
|
+
function C(e) {
|
|
156
|
+
return `${e}Identifiers`;
|
|
157
|
+
}
|
|
158
|
+
function w(e) {
|
|
159
|
+
return `${e}Comments`;
|
|
160
|
+
}
|
|
161
|
+
function T(e) {
|
|
162
|
+
return `${e}Tags`;
|
|
163
|
+
}
|
|
164
|
+
function pe(e) {
|
|
165
|
+
return `${e}Plugin`;
|
|
166
|
+
}
|
|
167
|
+
function E(e) {
|
|
168
|
+
return `${e}Parser`;
|
|
169
|
+
}
|
|
170
|
+
var D = "9ff2b366e8ca4c97b9aed1a29b5b94ed", me = async (e, t, n, r, { commentOrTag: i, embeddedOverrideOptions: a }) => {
|
|
171
|
+
let o = {
|
|
172
|
+
...r,
|
|
173
|
+
...a
|
|
174
|
+
}, { node: s } = n, { createPlaceholder: c, placeholderRegex: l } = S("@prettier-placeholder"), { trimmedText: u, leadingWhitespaces: d, trailingWhitespaces: f } = _(s, c), p = y(n, t);
|
|
175
|
+
return v(b(await e(u, {
|
|
176
|
+
...o,
|
|
177
|
+
parser: o.embeddedCssParser ?? "scss"
|
|
178
|
+
}), l, p, "literalline"), o, i, d, f);
|
|
179
|
+
}, O = "embeddedCss", he = ["css"], ge = [
|
|
180
|
+
"css",
|
|
181
|
+
"less",
|
|
182
|
+
"scss"
|
|
183
|
+
], _e = C(O), ve = w(O), ye = T(O), be = E(O), xe = {
|
|
184
|
+
[_e]: {
|
|
185
|
+
category: "Embed",
|
|
186
|
+
type: "string",
|
|
187
|
+
array: !0,
|
|
188
|
+
default: [{ value: [...he] }],
|
|
189
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded CSS language.",
|
|
190
|
+
deprecated: `Please use \`${ve}\` or \`${ye}\`.`
|
|
191
|
+
},
|
|
192
|
+
[ve]: {
|
|
193
|
+
category: "Embed",
|
|
194
|
+
type: "string",
|
|
195
|
+
array: !0,
|
|
196
|
+
default: [{ value: [D] }],
|
|
197
|
+
description: "Block comments that make their subsequent template literals be identified as embedded CSS language."
|
|
198
|
+
},
|
|
199
|
+
[ye]: {
|
|
200
|
+
category: "Embed",
|
|
201
|
+
type: "string",
|
|
202
|
+
array: !0,
|
|
203
|
+
default: [{ value: [D] }],
|
|
204
|
+
description: "Tags that make their subsequent template literals be identified as embedded CSS language."
|
|
205
|
+
},
|
|
206
|
+
[be]: {
|
|
207
|
+
category: "Embed",
|
|
208
|
+
type: "choice",
|
|
209
|
+
default: "scss",
|
|
210
|
+
description: "The parser used to parse the embedded CSS language.",
|
|
211
|
+
choices: ge.map((e) => ({
|
|
212
|
+
value: e,
|
|
213
|
+
description: `Use the "${e}" parser.`
|
|
214
|
+
}))
|
|
215
|
+
}
|
|
216
|
+
}, Se = /* @__PURE__ */ p({
|
|
217
|
+
embedder: () => me,
|
|
218
|
+
language: () => O,
|
|
219
|
+
options: () => xe
|
|
220
|
+
}), Ce = async (e, t, n, r, { commentOrTag: i, embeddedOverrideOptions: a }) => {
|
|
221
|
+
let o = {
|
|
222
|
+
...r,
|
|
223
|
+
...a
|
|
224
|
+
}, { node: s } = n, { createPlaceholder: c, placeholderRegex: l } = S(), { trimmedText: u, leadingWhitespaces: d, trailingWhitespaces: f } = _(s, c), p = y(n, t);
|
|
225
|
+
return v(b(await e(u, {
|
|
226
|
+
...o,
|
|
227
|
+
parser: o.embeddedEsParser ?? "babel"
|
|
228
|
+
}), l, p), o, i, d, f);
|
|
229
|
+
}, k = "embeddedEs", we = [
|
|
230
|
+
"js",
|
|
231
|
+
"jsx",
|
|
232
|
+
"es",
|
|
233
|
+
"es6",
|
|
234
|
+
"mjs",
|
|
235
|
+
"cjs",
|
|
236
|
+
"pac",
|
|
237
|
+
"javascript"
|
|
238
|
+
], Te = [
|
|
239
|
+
"babel",
|
|
240
|
+
"babel-flow",
|
|
241
|
+
"acorn",
|
|
242
|
+
"espree",
|
|
243
|
+
"flow",
|
|
244
|
+
"meriyah"
|
|
245
|
+
], Ee = C(k), De = w(k), Oe = T(k), ke = E(k), Ae = {
|
|
246
|
+
[Ee]: {
|
|
247
|
+
category: "Embed",
|
|
248
|
+
type: "string",
|
|
249
|
+
array: !0,
|
|
250
|
+
default: [{ value: [...we] }],
|
|
251
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded ECMAScript/JavaScript language.",
|
|
252
|
+
deprecated: `Please use \`${De}\` or \`${Oe}\`.`
|
|
253
|
+
},
|
|
254
|
+
[De]: {
|
|
255
|
+
category: "Embed",
|
|
256
|
+
type: "string",
|
|
257
|
+
array: !0,
|
|
258
|
+
default: [{ value: [D] }],
|
|
259
|
+
description: "Block comments that make their subsequent template literals be identified as embedded ECMAScript/JavaScript language."
|
|
260
|
+
},
|
|
261
|
+
[Oe]: {
|
|
262
|
+
category: "Embed",
|
|
263
|
+
type: "string",
|
|
264
|
+
array: !0,
|
|
265
|
+
default: [{ value: [D] }],
|
|
266
|
+
description: "Tags that make their subsequent template literals be identified as embedded ECMAScript/JavaScript language."
|
|
267
|
+
},
|
|
268
|
+
[ke]: {
|
|
269
|
+
category: "Embed",
|
|
270
|
+
type: "choice",
|
|
271
|
+
default: "babel",
|
|
272
|
+
description: "The parser used to parse the embedded ECMASCript/JavaScript language.",
|
|
273
|
+
choices: Te.map((e) => ({
|
|
274
|
+
value: e,
|
|
275
|
+
description: `Use the "${e}" parser.`
|
|
276
|
+
}))
|
|
277
|
+
}
|
|
278
|
+
}, je = /* @__PURE__ */ p({
|
|
279
|
+
embedder: () => Ce,
|
|
280
|
+
language: () => k,
|
|
281
|
+
options: () => Ae
|
|
282
|
+
}), Me = async (e, t, n, r, { commentOrTag: i, embeddedOverrideOptions: a }) => {
|
|
283
|
+
let o = {
|
|
284
|
+
...r,
|
|
285
|
+
...a
|
|
286
|
+
}, { node: s } = n, { createPlaceholder: c, placeholderRegex: l } = S(), { trimmedText: u, leadingWhitespaces: d, trailingWhitespaces: f } = _(s, c), p = y(n, t);
|
|
287
|
+
return v(b(await e(u, {
|
|
288
|
+
...o,
|
|
289
|
+
parser: "glsl-parser"
|
|
290
|
+
}), l, p), o, i, d, f);
|
|
291
|
+
}, A = "embeddedGlsl", Ne = ["glsl", "shader"], Pe = C(A), Fe = w(A), Ie = T(A), Le = {
|
|
292
|
+
[Pe]: {
|
|
293
|
+
category: "Embed",
|
|
294
|
+
type: "string",
|
|
295
|
+
array: !0,
|
|
296
|
+
default: [{ value: [...Ne] }],
|
|
297
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded GLSL language. This option requires the `prettier-plugin-glsl` plugin.",
|
|
298
|
+
deprecated: `Please use \`${Fe}\` or \`${Ie}\`.`
|
|
299
|
+
},
|
|
300
|
+
[Fe]: {
|
|
301
|
+
category: "Embed",
|
|
302
|
+
type: "string",
|
|
303
|
+
array: !0,
|
|
304
|
+
default: [{ value: [D] }],
|
|
305
|
+
description: "Block comments that make their subsequent template literals be identified as embedded GLSL language. This option requires the `prettier-plugin-glsl` plugin."
|
|
306
|
+
},
|
|
307
|
+
[Ie]: {
|
|
308
|
+
category: "Embed",
|
|
309
|
+
type: "string",
|
|
310
|
+
array: !0,
|
|
311
|
+
default: [{ value: [D] }],
|
|
312
|
+
description: "Tags that make their subsequent template literals be identified as embedded GLSL language. This option requires the `prettier-plugin-glsl` plugin."
|
|
313
|
+
}
|
|
314
|
+
}, Re = /* @__PURE__ */ p({
|
|
315
|
+
embedder: () => Me,
|
|
316
|
+
language: () => A,
|
|
317
|
+
options: () => Le
|
|
318
|
+
}), ze = async (e, t, n, r, { commentOrTag: i, embeddedOverrideOptions: a }) => {
|
|
319
|
+
let o = {
|
|
320
|
+
...r,
|
|
321
|
+
...a
|
|
322
|
+
}, { node: s } = n, { createPlaceholder: c, placeholderRegex: l } = S(), { trimmedText: u, leadingWhitespaces: d, trailingWhitespaces: f } = _(s, c), p = y(n, t);
|
|
323
|
+
return v(b(await e(u, {
|
|
324
|
+
...o,
|
|
325
|
+
parser: "graphql"
|
|
326
|
+
}), l, p), o, i, d, f);
|
|
327
|
+
}, j = "embeddedGraphql", Be = ["graphql", "gql"], Ve = C(j), He = w(j), Ue = T(j), We = {
|
|
328
|
+
[Ve]: {
|
|
329
|
+
category: "Embed",
|
|
330
|
+
type: "string",
|
|
331
|
+
array: !0,
|
|
332
|
+
default: [{ value: [...Be] }],
|
|
333
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded GraphQL language.",
|
|
334
|
+
deprecated: `Please use \`${He}\` or \`${Ue}\`.`
|
|
335
|
+
},
|
|
336
|
+
[He]: {
|
|
337
|
+
category: "Embed",
|
|
338
|
+
type: "string",
|
|
339
|
+
array: !0,
|
|
340
|
+
default: [{ value: [D] }],
|
|
341
|
+
description: "Block comments that make their subsequent template literals be identified as embedded GraphQL language."
|
|
342
|
+
},
|
|
343
|
+
[Ue]: {
|
|
344
|
+
category: "Embed",
|
|
345
|
+
type: "string",
|
|
346
|
+
array: !0,
|
|
347
|
+
default: [{ value: [D] }],
|
|
348
|
+
description: "Tags that make their subsequent template literals be identified as embedded GraphQL language."
|
|
349
|
+
}
|
|
350
|
+
}, Ge = /* @__PURE__ */ p({
|
|
351
|
+
embedder: () => ze,
|
|
352
|
+
language: () => j,
|
|
353
|
+
options: () => We
|
|
354
|
+
}), { mapDoc: Ke } = t, qe = async (e, t, n, r, { commentOrTag: i, embeddedOverrideOptions: a }) => {
|
|
355
|
+
let o = {
|
|
356
|
+
...r,
|
|
357
|
+
...a
|
|
358
|
+
}, { node: s } = n, { createPlaceholder: c, placeholderRegex: l } = S(), { trimmedText: u, leadingWhitespaces: d, trailingWhitespaces: f } = _(s, c), p = y(n, t);
|
|
359
|
+
return v(Ke(await e(u, {
|
|
360
|
+
...o,
|
|
361
|
+
parser: o.embeddedHtmlParser ?? "html"
|
|
362
|
+
}), (e) => {
|
|
363
|
+
if (typeof e != "string") return e;
|
|
364
|
+
let t = [], n = e.split(l);
|
|
365
|
+
for (let e = 0; e < n.length; e++) {
|
|
366
|
+
let r = n[e];
|
|
367
|
+
if (e % 2 == 0) {
|
|
368
|
+
if (!r) continue;
|
|
369
|
+
r = r.replaceAll(/([\\`]|\${)/g, "\\$1"), o.__embeddedInHtml && (r = r.replaceAll(/<\/(?=script\b)/gi, "<\\/")), t.push(r);
|
|
370
|
+
} else {
|
|
371
|
+
let e = Number(r);
|
|
372
|
+
t.push(p[e]);
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
return t;
|
|
376
|
+
}), o, i, d, f, o.htmlWhitespaceSensitivity === "strict" || o.htmlWhitespaceSensitivity === "css");
|
|
377
|
+
}, M = "embeddedHtml", Je = ["html", "xhtml"], Ye = [
|
|
378
|
+
"html",
|
|
379
|
+
"vue",
|
|
380
|
+
"angular",
|
|
381
|
+
"lwc"
|
|
382
|
+
], Xe = C(M), Ze = w(M), Qe = T(M), $e = E(M), et = {
|
|
383
|
+
[Xe]: {
|
|
384
|
+
category: "Embed",
|
|
385
|
+
type: "string",
|
|
386
|
+
array: !0,
|
|
387
|
+
default: [{ value: [...Je] }],
|
|
388
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded HTML language.",
|
|
389
|
+
deprecated: `Please use \`${Ze}\` or \`${Qe}\`.`
|
|
390
|
+
},
|
|
391
|
+
[Ze]: {
|
|
392
|
+
category: "Embed",
|
|
393
|
+
type: "string",
|
|
394
|
+
array: !0,
|
|
395
|
+
default: [{ value: [D] }],
|
|
396
|
+
description: "Block comments that make their subsequent template literals be identified as embedded HTML language."
|
|
397
|
+
},
|
|
398
|
+
[Qe]: {
|
|
399
|
+
category: "Embed",
|
|
400
|
+
type: "string",
|
|
401
|
+
array: !0,
|
|
402
|
+
default: [{ value: [D] }],
|
|
403
|
+
description: "Tags that make their subsequent template literals be identified as embedded HTML language."
|
|
404
|
+
},
|
|
405
|
+
[$e]: {
|
|
406
|
+
category: "Embed",
|
|
407
|
+
type: "choice",
|
|
408
|
+
default: "html",
|
|
409
|
+
description: "The parser used to parse the embedded HTML language.",
|
|
410
|
+
choices: Ye.map((e) => ({
|
|
411
|
+
value: e,
|
|
412
|
+
description: `Use the "${e}" parser.`
|
|
413
|
+
}))
|
|
414
|
+
}
|
|
415
|
+
}, tt = /* @__PURE__ */ p({
|
|
416
|
+
embedder: () => qe,
|
|
417
|
+
language: () => M,
|
|
418
|
+
options: () => et
|
|
419
|
+
}), nt = async (e, t, n, r, { commentOrTag: i, embeddedOverrideOptions: a }) => {
|
|
420
|
+
let o = {
|
|
421
|
+
...r,
|
|
422
|
+
...a
|
|
423
|
+
}, { node: s } = n, { createPlaceholder: c, placeholderRegex: l } = S(), { trimmedText: u, leadingWhitespaces: d, trailingWhitespaces: f } = _(s, c), p = y(n, t);
|
|
424
|
+
return v(b(await e(u, {
|
|
425
|
+
...o,
|
|
426
|
+
parser: "ini"
|
|
427
|
+
}), l, p), o, i, d, f);
|
|
428
|
+
}, N = "embeddedIni", rt = [
|
|
429
|
+
"ini",
|
|
430
|
+
"cfg",
|
|
431
|
+
"pro"
|
|
432
|
+
], it = C(N), at = w(N), ot = T(N), st = {
|
|
433
|
+
[it]: {
|
|
434
|
+
category: "Embed",
|
|
435
|
+
type: "string",
|
|
436
|
+
array: !0,
|
|
437
|
+
default: [{ value: [...rt] }],
|
|
438
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded INI language. This option requires the `prettier-plugin-ini` plugin.",
|
|
439
|
+
deprecated: `Please use \`${at}\` or \`${ot}\`.`
|
|
440
|
+
},
|
|
441
|
+
[at]: {
|
|
442
|
+
category: "Embed",
|
|
443
|
+
type: "string",
|
|
444
|
+
array: !0,
|
|
445
|
+
default: [{ value: [D] }],
|
|
446
|
+
description: "Block comments that make their subsequent template literals be identified as embedded INI language. This option requires the `prettier-plugin-ini` plugin."
|
|
447
|
+
},
|
|
448
|
+
[ot]: {
|
|
449
|
+
category: "Embed",
|
|
450
|
+
type: "string",
|
|
451
|
+
array: !0,
|
|
452
|
+
default: [{ value: [D] }],
|
|
453
|
+
description: "Tags that make their subsequent template literals be identified as embedded INI language. This option requires the `prettier-plugin-ini` plugin."
|
|
454
|
+
}
|
|
455
|
+
}, ct = /* @__PURE__ */ p({
|
|
456
|
+
embedder: () => nt,
|
|
457
|
+
language: () => N,
|
|
458
|
+
options: () => st
|
|
459
|
+
}), lt = async (e, t, n, r, { commentOrTag: i, embeddedOverrideOptions: a }) => {
|
|
460
|
+
let o = {
|
|
461
|
+
...r,
|
|
462
|
+
...a
|
|
463
|
+
}, { node: s } = n, { createPlaceholder: c, placeholderRegex: l } = S(), { trimmedText: u, leadingWhitespaces: d, trailingWhitespaces: f } = _(s, c), p = y(n, t);
|
|
464
|
+
return v(b(await e(u, {
|
|
465
|
+
...o,
|
|
466
|
+
parser: "java"
|
|
467
|
+
}), l, p, "hardline"), o, i, d, f);
|
|
468
|
+
}, P = "embeddedJava", ut = ["java"], dt = C(P), ft = w(P), pt = T(P), mt = {
|
|
469
|
+
[dt]: {
|
|
470
|
+
category: "Embed",
|
|
471
|
+
type: "string",
|
|
472
|
+
array: !0,
|
|
473
|
+
default: [{ value: [...ut] }],
|
|
474
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Java language. This option requires the `prettier-plugin-java` plugin.",
|
|
475
|
+
deprecated: `Please use \`${ft}\` or \`${pt}\`.`
|
|
476
|
+
},
|
|
477
|
+
[ft]: {
|
|
478
|
+
category: "Embed",
|
|
479
|
+
type: "string",
|
|
480
|
+
array: !0,
|
|
481
|
+
default: [{ value: [D] }],
|
|
482
|
+
description: "Block comments that make their subsequent template literals be identified as embedded Java language. This option requires the `prettier-plugin-java` plugin."
|
|
483
|
+
},
|
|
484
|
+
[pt]: {
|
|
485
|
+
category: "Embed",
|
|
486
|
+
type: "string",
|
|
487
|
+
array: !0,
|
|
488
|
+
default: [{ value: [D] }],
|
|
489
|
+
description: "Tags that make their subsequent template literals be identified as embedded Java language. This option requires the `prettier-plugin-java` plugin."
|
|
490
|
+
}
|
|
491
|
+
}, ht = /* @__PURE__ */ p({
|
|
492
|
+
embedder: () => lt,
|
|
493
|
+
language: () => P,
|
|
494
|
+
options: () => mt
|
|
495
|
+
}), gt = async (e, t, n, r, { commentOrTag: i, embeddedOverrideOptions: a }) => {
|
|
496
|
+
let o = {
|
|
497
|
+
...r,
|
|
498
|
+
...a
|
|
499
|
+
}, { node: s } = n, { createPlaceholder: c, placeholderRegex: l } = _t(), { trimmedText: u, leadingWhitespaces: d, trailingWhitespaces: f } = _(s, c), p = y(n, t);
|
|
500
|
+
return v(b(await e(u, {
|
|
501
|
+
...o,
|
|
502
|
+
parser: o.embeddedJsonParser ?? "json"
|
|
503
|
+
}), l, p), o, i, d, f);
|
|
1808
504
|
};
|
|
1809
|
-
function
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
}
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
return Object.assign(n, e), n;
|
|
1942
|
-
}
|
|
1943
|
-
function si(t) {
|
|
1944
|
-
const e = {
|
|
1945
|
-
loc: {
|
|
1946
|
-
start: {
|
|
1947
|
-
line: t.token.startLine ?? Number.NaN,
|
|
1948
|
-
column: t.token.startColumn ?? Number.NaN
|
|
1949
|
-
},
|
|
1950
|
-
end: {
|
|
1951
|
-
line: t.token.endLine ?? Number.NaN,
|
|
1952
|
-
column: t.token.endColumn ?? Number.NaN
|
|
1953
|
-
}
|
|
1954
|
-
}
|
|
1955
|
-
}, n = new SyntaxError(
|
|
1956
|
-
`${t.message} (${e.loc.start.line}:${e.loc.start.column})`,
|
|
1957
|
-
{
|
|
1958
|
-
cause: t
|
|
1959
|
-
}
|
|
1960
|
-
);
|
|
1961
|
-
return Object.assign(n, e), n;
|
|
1962
|
-
}
|
|
1963
|
-
const Go = {
|
|
1964
|
-
async parse(t, e) {
|
|
1965
|
-
const { parse: n } = await import("@xml-tools/parser"), { lexErrors: i, parseErrors: r, cst: o } = n(t);
|
|
1966
|
-
if (i.length > 0) {
|
|
1967
|
-
const s = i[0];
|
|
1968
|
-
throw Oo(s);
|
|
1969
|
-
}
|
|
1970
|
-
if (r.length > 0) {
|
|
1971
|
-
let s = !1;
|
|
1972
|
-
for (const l of r) {
|
|
1973
|
-
if (!["MismatchedTokenException", "NotAllInputParsedException"].includes(
|
|
1974
|
-
l.name
|
|
1975
|
-
))
|
|
1976
|
-
throw si(l);
|
|
1977
|
-
if (l.message === "Expecting token of type --> OPEN <-- but found --> '' <--") {
|
|
1978
|
-
s = !0;
|
|
1979
|
-
continue;
|
|
1980
|
-
}
|
|
1981
|
-
if (/Expecting token of type --> EOF <-- but found --> '[\s\S]+' <--/.test(
|
|
1982
|
-
l.message
|
|
1983
|
-
) || /Redundant input, expecting EOF but found: /.test(l.message)) {
|
|
1984
|
-
e.__embeddedXmlFragmentRecoverIndex?.splice(
|
|
1985
|
-
0,
|
|
1986
|
-
e.__embeddedXmlFragmentRecoverIndex.length,
|
|
1987
|
-
l.token.startOffset
|
|
1988
|
-
);
|
|
1989
|
-
break;
|
|
1990
|
-
}
|
|
1991
|
-
if (/Expecting token of type --> OPEN <-- but found --> '[\s\S]+' <--/.test(
|
|
1992
|
-
l.message
|
|
1993
|
-
)) {
|
|
1994
|
-
if (l.token.endOffset === void 0 || Number.isNaN(l.token.endOffset))
|
|
1995
|
-
break;
|
|
1996
|
-
e.__embeddedXmlFragmentRecoverIndex?.splice(
|
|
1997
|
-
0,
|
|
1998
|
-
e.__embeddedXmlFragmentRecoverIndex.length,
|
|
1999
|
-
l.token.startOffset,
|
|
2000
|
-
l.token.endOffset
|
|
2001
|
-
), s = !0;
|
|
2002
|
-
break;
|
|
2003
|
-
}
|
|
2004
|
-
throw si(l);
|
|
2005
|
-
}
|
|
2006
|
-
s && Di(o);
|
|
2007
|
-
}
|
|
2008
|
-
return ae(o);
|
|
2009
|
-
},
|
|
2010
|
-
astFormat: "xml",
|
|
2011
|
-
locStart(t) {
|
|
2012
|
-
return t.location?.startOffset ?? 0;
|
|
2013
|
-
},
|
|
2014
|
-
locEnd(t) {
|
|
2015
|
-
return t.location?.endOffset ?? Number.NaN;
|
|
2016
|
-
}
|
|
2017
|
-
};
|
|
2018
|
-
function Di(t) {
|
|
2019
|
-
const e = t.children;
|
|
2020
|
-
for (const n in e) {
|
|
2021
|
-
const i = e[n] ?? [];
|
|
2022
|
-
for (let r = i.length - 1; r >= 0; --r) {
|
|
2023
|
-
const o = i[r];
|
|
2024
|
-
if (le(o)) {
|
|
2025
|
-
if (Object.keys(o.children).length === 0) {
|
|
2026
|
-
i.splice(r, 1), i.length === 0 && delete e[n];
|
|
2027
|
-
continue;
|
|
2028
|
-
}
|
|
2029
|
-
Di(o);
|
|
2030
|
-
}
|
|
2031
|
-
}
|
|
2032
|
-
}
|
|
2033
|
-
}
|
|
2034
|
-
function le(t) {
|
|
2035
|
-
return "name" in t && "children" in t && "location" in t;
|
|
2036
|
-
}
|
|
2037
|
-
const Io = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2038
|
-
__proto__: null,
|
|
2039
|
-
embedder: Mo,
|
|
2040
|
-
language: Ee,
|
|
2041
|
-
options: ko,
|
|
2042
|
-
parser: Go
|
|
2043
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: oi, group: ie, indent: ai, softline: li } = A, xo = async (t, e, n, i, { commentOrTag: r, embeddedOverrideOptions: o }) => {
|
|
2044
|
-
const s = {
|
|
2045
|
-
...i,
|
|
2046
|
-
...o
|
|
2047
|
-
}, { node: l } = n, { createPlaceholder: p, placeholderRegex: f } = N(), d = l.quasis.map(
|
|
2048
|
-
(m, h, { length: _ }) => h === _ - 1 ? m.value.cooked : m.value.cooked + p(h)
|
|
2049
|
-
).join(""), u = d.match(/^\s+/)?.[0] ?? "", c = d.match(/\s+$/)?.[0] ?? "", y = d.slice(
|
|
2050
|
-
u.length,
|
|
2051
|
-
-c.length || void 0
|
|
2052
|
-
), b = L(n, e), D = await t(y, {
|
|
2053
|
-
...s,
|
|
2054
|
-
parser: "yaml"
|
|
2055
|
-
}), a = M(D, f, b);
|
|
2056
|
-
if (s.preserveEmbeddedExteriorWhitespaces?.includes(r))
|
|
2057
|
-
return ie([
|
|
2058
|
-
"`",
|
|
2059
|
-
u,
|
|
2060
|
-
s.noEmbeddedMultiLineIndentation?.includes(r) ? [ie(a)] : ai([ie(a)]),
|
|
2061
|
-
c,
|
|
2062
|
-
"`"
|
|
2063
|
-
]);
|
|
2064
|
-
const g = u.length ? oi : li, E = c.length ? oi : li;
|
|
2065
|
-
return ie([
|
|
2066
|
-
"`",
|
|
2067
|
-
s.noEmbeddedMultiLineIndentation?.includes(r) ? [g, ie(a)] : ai([g, ie(a)]),
|
|
2068
|
-
E,
|
|
2069
|
-
"`"
|
|
2070
|
-
]);
|
|
2071
|
-
}, qe = "embeddedYaml", Po = ["yaml", "yml"], qo = T(qe), ci = S(qe), di = v(qe), jo = {
|
|
2072
|
-
[qo]: {
|
|
2073
|
-
category: "Embed",
|
|
2074
|
-
type: "string",
|
|
2075
|
-
array: !0,
|
|
2076
|
-
default: [{ value: [...Po] }],
|
|
2077
|
-
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded YAML language.",
|
|
2078
|
-
deprecated: `Please use \`${ci}\` or \`${di}\`.`
|
|
2079
|
-
},
|
|
2080
|
-
[ci]: {
|
|
2081
|
-
category: "Embed",
|
|
2082
|
-
type: "string",
|
|
2083
|
-
array: !0,
|
|
2084
|
-
default: [{ value: [$] }],
|
|
2085
|
-
description: "Block comments that make their subsequent template literals be identified as embedded YAML language."
|
|
2086
|
-
},
|
|
2087
|
-
[di]: {
|
|
2088
|
-
category: "Embed",
|
|
2089
|
-
type: "string",
|
|
2090
|
-
array: !0,
|
|
2091
|
-
default: [{ value: [$] }],
|
|
2092
|
-
description: "Tags that make their subsequent template literals be identified as embedded YAML language."
|
|
2093
|
-
}
|
|
2094
|
-
}, Ro = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2095
|
-
__proto__: null,
|
|
2096
|
-
embedder: xo,
|
|
2097
|
-
language: qe,
|
|
2098
|
-
options: jo
|
|
2099
|
-
}, Symbol.toStringTag, { value: "Module" })), _e = [], $i = {}, Ti = {}, vi = {}, Bo = /* @__PURE__ */ Object.assign({
|
|
2100
|
-
"./css/index.ts": nr,
|
|
2101
|
-
"./es/index.ts": cr,
|
|
2102
|
-
"./glsl/index.ts": mr,
|
|
2103
|
-
"./graphql/index.ts": _r,
|
|
2104
|
-
"./html/index.ts": Mr,
|
|
2105
|
-
"./ini/index.ts": Gr,
|
|
2106
|
-
"./java/index.ts": jr,
|
|
2107
|
-
"./json/index.ts": zr,
|
|
2108
|
-
"./jsonata/index.ts": Vr,
|
|
2109
|
-
"./latex/index.ts": ts,
|
|
2110
|
-
"./markdown/index.ts": gs,
|
|
2111
|
-
"./nginx/index.ts": bs,
|
|
2112
|
-
"./noop/index.ts": Ds,
|
|
2113
|
-
"./pegjs/index.ts": Ss,
|
|
2114
|
-
"./php/index.ts": Os,
|
|
2115
|
-
"./prisma/index.ts": qs,
|
|
2116
|
-
"./properties/index.ts": Us,
|
|
2117
|
-
"./pug/index.ts": Js,
|
|
2118
|
-
"./ruby/index.ts": Zs,
|
|
2119
|
-
"./sh/index.ts": ro,
|
|
2120
|
-
"./sql/index.ts": mo,
|
|
2121
|
-
"./toml/index.ts": _o,
|
|
2122
|
-
"./ts/index.ts": So,
|
|
2123
|
-
"./xml/index.ts": Io,
|
|
2124
|
-
"./yaml/index.ts": Ro
|
|
2125
|
-
});
|
|
2126
|
-
for (const { language: t, parser: e, embedder: n, options: i } of Object.values(Bo))
|
|
2127
|
-
Hi(_e, t, me), e && ($i[t] = e), n && (Ti[t] = n), Object.assign(vi, i);
|
|
2128
|
-
const wo = "noEmbeddedIdentificationByComment", Uo = "noEmbeddedIdentificationByTag", Co = "preserveEmbeddedExteriorWhitespaces", Wo = "noEmbeddedMultiLineIndentation", Fo = "embeddedOverrides", bl = {
|
|
2129
|
-
...vi,
|
|
2130
|
-
/**
|
|
2131
|
-
* @deprecated Please use `embedded<Language>Comments` or `embedded<Language>Tags` to configure each embedded language, and you won't need this option anymore.
|
|
2132
|
-
*/
|
|
2133
|
-
[wo]: {
|
|
2134
|
-
category: "Embed",
|
|
2135
|
-
type: "string",
|
|
2136
|
-
array: !0,
|
|
2137
|
-
default: [{ value: [] }],
|
|
2138
|
-
description: "Turns off `` /* comment */ `...` `` comment-based embedded language identification for the specified identifiers.",
|
|
2139
|
-
deprecated: "Please use `embedded<Language>Comments` or `embedded<Language>Tags` to configure each embedded language, and you won't need this option anymore."
|
|
2140
|
-
},
|
|
2141
|
-
/**
|
|
2142
|
-
* @deprecated Please use `embedded<Language>Comments` or `embedded<Language>Tags` to configure each embedded language, and you won't need this option anymore.
|
|
2143
|
-
*/
|
|
2144
|
-
[Uo]: {
|
|
2145
|
-
category: "Embed",
|
|
2146
|
-
type: "string",
|
|
2147
|
-
array: !0,
|
|
2148
|
-
default: [{ value: [] }],
|
|
2149
|
-
description: "Turns off `` tag`...` `` tag-based embedded language identification for the specified identifiers.",
|
|
2150
|
-
deprecated: "Please use `embedded<Language>Comments` or `embedded<Language>Tags` to configure each embedded language, and you won't need this option anymore."
|
|
2151
|
-
},
|
|
2152
|
-
[Co]: {
|
|
2153
|
-
category: "Embed",
|
|
2154
|
-
type: "string",
|
|
2155
|
-
array: !0,
|
|
2156
|
-
default: [{ value: [] }],
|
|
2157
|
-
description: "Preserves leading and trailing whitespaces in the formatting results for the specified comments or tags."
|
|
2158
|
-
},
|
|
2159
|
-
[Wo]: {
|
|
2160
|
-
category: "Embed",
|
|
2161
|
-
type: "string",
|
|
2162
|
-
array: !0,
|
|
2163
|
-
default: [{ value: [] }],
|
|
2164
|
-
description: "Turns off auto indentation in the formatting results for the specified comments or tags when they are formatted to span multi lines."
|
|
2165
|
-
},
|
|
2166
|
-
[Fo]: {
|
|
2167
|
-
category: "Embed",
|
|
2168
|
-
type: "string",
|
|
2169
|
-
array: !1,
|
|
2170
|
-
default: void 0,
|
|
2171
|
-
description: "Option overrides for the specified comments or tags. It should either be a stringified JSON or an absolute filepath to the option overrides file."
|
|
2172
|
-
}
|
|
2173
|
-
}, zo = {
|
|
2174
|
-
// parsers from internal
|
|
2175
|
-
...Oi.parsers,
|
|
2176
|
-
...Gi.parsers,
|
|
2177
|
-
...Ii.parsers,
|
|
2178
|
-
...Pi.parsers,
|
|
2179
|
-
...xi.parsers,
|
|
2180
|
-
// parsers from this plugin
|
|
2181
|
-
...$i
|
|
2182
|
-
}, { getOwnPropertyNames: Jo, getOwnPropertySymbols: Xo } = Object, { hasOwnProperty: Ho } = Object.prototype;
|
|
2183
|
-
function Be(t, e) {
|
|
2184
|
-
return function(i, r, o) {
|
|
2185
|
-
return t(i, r, o) && e(i, r, o);
|
|
2186
|
-
};
|
|
2187
|
-
}
|
|
2188
|
-
function be(t) {
|
|
2189
|
-
return function(n, i, r) {
|
|
2190
|
-
if (!n || !i || typeof n != "object" || typeof i != "object")
|
|
2191
|
-
return t(n, i, r);
|
|
2192
|
-
const { cache: o } = r, s = o.get(n), l = o.get(i);
|
|
2193
|
-
if (s && l)
|
|
2194
|
-
return s === i && l === n;
|
|
2195
|
-
o.set(n, i), o.set(i, n);
|
|
2196
|
-
const p = t(n, i, r);
|
|
2197
|
-
return o.delete(n), o.delete(i), p;
|
|
2198
|
-
};
|
|
2199
|
-
}
|
|
2200
|
-
function Qo(t) {
|
|
2201
|
-
return t?.[Symbol.toStringTag];
|
|
2202
|
-
}
|
|
2203
|
-
function ui(t) {
|
|
2204
|
-
return Jo(t).concat(Xo(t));
|
|
2205
|
-
}
|
|
2206
|
-
const Vo = (
|
|
2207
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
2208
|
-
Object.hasOwn || ((t, e) => Ho.call(t, e))
|
|
2209
|
-
);
|
|
2210
|
-
function x(t, e) {
|
|
2211
|
-
return t === e || !t && !e && t !== t && e !== e;
|
|
2212
|
-
}
|
|
2213
|
-
const Yo = "__v", Ko = "__o", Zo = "_owner", { getOwnPropertyDescriptor: pi, keys: gi } = Object;
|
|
2214
|
-
function ea(t, e) {
|
|
2215
|
-
return t.byteLength === e.byteLength && De(new Uint8Array(t), new Uint8Array(e));
|
|
2216
|
-
}
|
|
2217
|
-
function ta(t, e, n) {
|
|
2218
|
-
let i = t.length;
|
|
2219
|
-
if (e.length !== i)
|
|
2220
|
-
return !1;
|
|
2221
|
-
for (; i-- > 0; )
|
|
2222
|
-
if (!n.equals(t[i], e[i], i, i, t, e, n))
|
|
2223
|
-
return !1;
|
|
2224
|
-
return !0;
|
|
2225
|
-
}
|
|
2226
|
-
function na(t, e) {
|
|
2227
|
-
return t.byteLength === e.byteLength && De(new Uint8Array(t.buffer, t.byteOffset, t.byteLength), new Uint8Array(e.buffer, e.byteOffset, e.byteLength));
|
|
2228
|
-
}
|
|
2229
|
-
function ia(t, e) {
|
|
2230
|
-
return x(t.getTime(), e.getTime());
|
|
2231
|
-
}
|
|
2232
|
-
function ra(t, e) {
|
|
2233
|
-
return t.name === e.name && t.message === e.message && t.cause === e.cause && t.stack === e.stack;
|
|
2234
|
-
}
|
|
2235
|
-
function sa(t, e) {
|
|
2236
|
-
return t === e;
|
|
2237
|
-
}
|
|
2238
|
-
function mi(t, e, n) {
|
|
2239
|
-
const i = t.size;
|
|
2240
|
-
if (i !== e.size)
|
|
2241
|
-
return !1;
|
|
2242
|
-
if (!i)
|
|
2243
|
-
return !0;
|
|
2244
|
-
const r = new Array(i), o = t.entries();
|
|
2245
|
-
let s, l, p = 0;
|
|
2246
|
-
for (; (s = o.next()) && !s.done; ) {
|
|
2247
|
-
const f = e.entries();
|
|
2248
|
-
let d = !1, u = 0;
|
|
2249
|
-
for (; (l = f.next()) && !l.done; ) {
|
|
2250
|
-
if (r[u]) {
|
|
2251
|
-
u++;
|
|
2252
|
-
continue;
|
|
2253
|
-
}
|
|
2254
|
-
const c = s.value, y = l.value;
|
|
2255
|
-
if (n.equals(c[0], y[0], p, u, t, e, n) && n.equals(c[1], y[1], c[0], y[0], t, e, n)) {
|
|
2256
|
-
d = r[u] = !0;
|
|
2257
|
-
break;
|
|
2258
|
-
}
|
|
2259
|
-
u++;
|
|
2260
|
-
}
|
|
2261
|
-
if (!d)
|
|
2262
|
-
return !1;
|
|
2263
|
-
p++;
|
|
2264
|
-
}
|
|
2265
|
-
return !0;
|
|
2266
|
-
}
|
|
2267
|
-
const oa = x;
|
|
2268
|
-
function aa(t, e, n) {
|
|
2269
|
-
const i = gi(t);
|
|
2270
|
-
let r = i.length;
|
|
2271
|
-
if (gi(e).length !== r)
|
|
2272
|
-
return !1;
|
|
2273
|
-
for (; r-- > 0; )
|
|
2274
|
-
if (!Ai(t, e, n, i[r]))
|
|
2275
|
-
return !1;
|
|
2276
|
-
return !0;
|
|
2277
|
-
}
|
|
2278
|
-
function oe(t, e, n) {
|
|
2279
|
-
const i = ui(t);
|
|
2280
|
-
let r = i.length;
|
|
2281
|
-
if (ui(e).length !== r)
|
|
2282
|
-
return !1;
|
|
2283
|
-
let o, s, l;
|
|
2284
|
-
for (; r-- > 0; )
|
|
2285
|
-
if (o = i[r], !Ai(t, e, n, o) || (s = pi(t, o), l = pi(e, o), (s || l) && (!s || !l || s.configurable !== l.configurable || s.enumerable !== l.enumerable || s.writable !== l.writable)))
|
|
2286
|
-
return !1;
|
|
2287
|
-
return !0;
|
|
2288
|
-
}
|
|
2289
|
-
function la(t, e) {
|
|
2290
|
-
return x(t.valueOf(), e.valueOf());
|
|
2291
|
-
}
|
|
2292
|
-
function ca(t, e) {
|
|
2293
|
-
return t.source === e.source && t.flags === e.flags;
|
|
2294
|
-
}
|
|
2295
|
-
function hi(t, e, n) {
|
|
2296
|
-
const i = t.size;
|
|
2297
|
-
if (i !== e.size)
|
|
2298
|
-
return !1;
|
|
2299
|
-
if (!i)
|
|
2300
|
-
return !0;
|
|
2301
|
-
const r = new Array(i), o = t.values();
|
|
2302
|
-
let s, l;
|
|
2303
|
-
for (; (s = o.next()) && !s.done; ) {
|
|
2304
|
-
const p = e.values();
|
|
2305
|
-
let f = !1, d = 0;
|
|
2306
|
-
for (; (l = p.next()) && !l.done; ) {
|
|
2307
|
-
if (!r[d] && n.equals(s.value, l.value, s.value, l.value, t, e, n)) {
|
|
2308
|
-
f = r[d] = !0;
|
|
2309
|
-
break;
|
|
2310
|
-
}
|
|
2311
|
-
d++;
|
|
2312
|
-
}
|
|
2313
|
-
if (!f)
|
|
2314
|
-
return !1;
|
|
2315
|
-
}
|
|
2316
|
-
return !0;
|
|
2317
|
-
}
|
|
2318
|
-
function De(t, e) {
|
|
2319
|
-
let n = t.byteLength;
|
|
2320
|
-
if (e.byteLength !== n || t.byteOffset !== e.byteOffset)
|
|
2321
|
-
return !1;
|
|
2322
|
-
for (; n-- > 0; )
|
|
2323
|
-
if (t[n] !== e[n])
|
|
2324
|
-
return !1;
|
|
2325
|
-
return !0;
|
|
2326
|
-
}
|
|
2327
|
-
function da(t, e) {
|
|
2328
|
-
return t.hostname === e.hostname && t.pathname === e.pathname && t.protocol === e.protocol && t.port === e.port && t.hash === e.hash && t.username === e.username && t.password === e.password;
|
|
2329
|
-
}
|
|
2330
|
-
function Ai(t, e, n, i) {
|
|
2331
|
-
return (i === Zo || i === Ko || i === Yo) && (t.$$typeof || e.$$typeof) ? !0 : Vo(e, i) && n.equals(t[i], e[i], i, i, t, e, n);
|
|
2332
|
-
}
|
|
2333
|
-
const ua = "[object ArrayBuffer]", pa = "[object Arguments]", ga = "[object Boolean]", ma = "[object DataView]", ha = "[object Date]", fa = "[object Error]", Ea = "[object Map]", ba = "[object Number]", _a = "[object Object]", ya = "[object RegExp]", Da = "[object Set]", $a = "[object String]", Ta = {
|
|
2334
|
-
"[object Int8Array]": !0,
|
|
2335
|
-
"[object Uint8Array]": !0,
|
|
2336
|
-
"[object Uint8ClampedArray]": !0,
|
|
2337
|
-
"[object Int16Array]": !0,
|
|
2338
|
-
"[object Uint16Array]": !0,
|
|
2339
|
-
"[object Int32Array]": !0,
|
|
2340
|
-
"[object Uint32Array]": !0,
|
|
2341
|
-
"[object Float16Array]": !0,
|
|
2342
|
-
"[object Float32Array]": !0,
|
|
2343
|
-
"[object Float64Array]": !0,
|
|
2344
|
-
"[object BigInt64Array]": !0,
|
|
2345
|
-
"[object BigUint64Array]": !0
|
|
2346
|
-
}, va = "[object URL]", Aa = Object.prototype.toString;
|
|
2347
|
-
function Sa({ areArrayBuffersEqual: t, areArraysEqual: e, areDataViewsEqual: n, areDatesEqual: i, areErrorsEqual: r, areFunctionsEqual: o, areMapsEqual: s, areNumbersEqual: l, areObjectsEqual: p, arePrimitiveWrappersEqual: f, areRegExpsEqual: d, areSetsEqual: u, areTypedArraysEqual: c, areUrlsEqual: y, unknownTagComparators: b }) {
|
|
2348
|
-
return function(a, g, E) {
|
|
2349
|
-
if (a === g)
|
|
2350
|
-
return !0;
|
|
2351
|
-
if (a == null || g == null)
|
|
2352
|
-
return !1;
|
|
2353
|
-
const m = typeof a;
|
|
2354
|
-
if (m !== typeof g)
|
|
2355
|
-
return !1;
|
|
2356
|
-
if (m !== "object")
|
|
2357
|
-
return m === "number" ? l(a, g, E) : m === "function" ? o(a, g, E) : !1;
|
|
2358
|
-
const h = a.constructor;
|
|
2359
|
-
if (h !== g.constructor)
|
|
2360
|
-
return !1;
|
|
2361
|
-
if (h === Object)
|
|
2362
|
-
return p(a, g, E);
|
|
2363
|
-
if (Array.isArray(a))
|
|
2364
|
-
return e(a, g, E);
|
|
2365
|
-
if (h === Date)
|
|
2366
|
-
return i(a, g, E);
|
|
2367
|
-
if (h === RegExp)
|
|
2368
|
-
return d(a, g, E);
|
|
2369
|
-
if (h === Map)
|
|
2370
|
-
return s(a, g, E);
|
|
2371
|
-
if (h === Set)
|
|
2372
|
-
return u(a, g, E);
|
|
2373
|
-
const _ = Aa.call(a);
|
|
2374
|
-
if (_ === ha)
|
|
2375
|
-
return i(a, g, E);
|
|
2376
|
-
if (_ === ya)
|
|
2377
|
-
return d(a, g, E);
|
|
2378
|
-
if (_ === Ea)
|
|
2379
|
-
return s(a, g, E);
|
|
2380
|
-
if (_ === Da)
|
|
2381
|
-
return u(a, g, E);
|
|
2382
|
-
if (_ === _a)
|
|
2383
|
-
return typeof a.then != "function" && typeof g.then != "function" && p(a, g, E);
|
|
2384
|
-
if (_ === va)
|
|
2385
|
-
return y(a, g, E);
|
|
2386
|
-
if (_ === fa)
|
|
2387
|
-
return r(a, g, E);
|
|
2388
|
-
if (_ === pa)
|
|
2389
|
-
return p(a, g, E);
|
|
2390
|
-
if (Ta[_])
|
|
2391
|
-
return c(a, g, E);
|
|
2392
|
-
if (_ === ua)
|
|
2393
|
-
return t(a, g, E);
|
|
2394
|
-
if (_ === ma)
|
|
2395
|
-
return n(a, g, E);
|
|
2396
|
-
if (_ === ga || _ === ba || _ === $a)
|
|
2397
|
-
return f(a, g, E);
|
|
2398
|
-
if (b) {
|
|
2399
|
-
let k = b[_];
|
|
2400
|
-
if (!k) {
|
|
2401
|
-
const O = Qo(a);
|
|
2402
|
-
O && (k = b[O]);
|
|
2403
|
-
}
|
|
2404
|
-
if (k)
|
|
2405
|
-
return k(a, g, E);
|
|
2406
|
-
}
|
|
2407
|
-
return !1;
|
|
2408
|
-
};
|
|
2409
|
-
}
|
|
2410
|
-
function Ma({ circular: t, createCustomConfig: e, strict: n }) {
|
|
2411
|
-
let i = {
|
|
2412
|
-
areArrayBuffersEqual: ea,
|
|
2413
|
-
areArraysEqual: n ? oe : ta,
|
|
2414
|
-
areDataViewsEqual: na,
|
|
2415
|
-
areDatesEqual: ia,
|
|
2416
|
-
areErrorsEqual: ra,
|
|
2417
|
-
areFunctionsEqual: sa,
|
|
2418
|
-
areMapsEqual: n ? Be(mi, oe) : mi,
|
|
2419
|
-
areNumbersEqual: oa,
|
|
2420
|
-
areObjectsEqual: n ? oe : aa,
|
|
2421
|
-
arePrimitiveWrappersEqual: la,
|
|
2422
|
-
areRegExpsEqual: ca,
|
|
2423
|
-
areSetsEqual: n ? Be(hi, oe) : hi,
|
|
2424
|
-
areTypedArraysEqual: n ? Be(De, oe) : De,
|
|
2425
|
-
areUrlsEqual: da,
|
|
2426
|
-
unknownTagComparators: void 0
|
|
2427
|
-
};
|
|
2428
|
-
if (e && (i = Object.assign({}, i, e(i))), t) {
|
|
2429
|
-
const r = be(i.areArraysEqual), o = be(i.areMapsEqual), s = be(i.areObjectsEqual), l = be(i.areSetsEqual);
|
|
2430
|
-
i = Object.assign({}, i, {
|
|
2431
|
-
areArraysEqual: r,
|
|
2432
|
-
areMapsEqual: o,
|
|
2433
|
-
areObjectsEqual: s,
|
|
2434
|
-
areSetsEqual: l
|
|
2435
|
-
});
|
|
2436
|
-
}
|
|
2437
|
-
return i;
|
|
2438
|
-
}
|
|
2439
|
-
function La(t) {
|
|
2440
|
-
return function(e, n, i, r, o, s, l) {
|
|
2441
|
-
return t(e, n, l);
|
|
2442
|
-
};
|
|
2443
|
-
}
|
|
2444
|
-
function Na({ circular: t, comparator: e, createState: n, equals: i, strict: r }) {
|
|
2445
|
-
if (n)
|
|
2446
|
-
return function(l, p) {
|
|
2447
|
-
const { cache: f = t ? /* @__PURE__ */ new WeakMap() : void 0, meta: d } = n();
|
|
2448
|
-
return e(l, p, {
|
|
2449
|
-
cache: f,
|
|
2450
|
-
equals: i,
|
|
2451
|
-
meta: d,
|
|
2452
|
-
strict: r
|
|
2453
|
-
});
|
|
2454
|
-
};
|
|
2455
|
-
if (t)
|
|
2456
|
-
return function(l, p) {
|
|
2457
|
-
return e(l, p, {
|
|
2458
|
-
cache: /* @__PURE__ */ new WeakMap(),
|
|
2459
|
-
equals: i,
|
|
2460
|
-
meta: void 0,
|
|
2461
|
-
strict: r
|
|
2462
|
-
});
|
|
2463
|
-
};
|
|
2464
|
-
const o = {
|
|
2465
|
-
cache: void 0,
|
|
2466
|
-
equals: i,
|
|
2467
|
-
meta: void 0,
|
|
2468
|
-
strict: r
|
|
2469
|
-
};
|
|
2470
|
-
return function(l, p) {
|
|
2471
|
-
return e(l, p, o);
|
|
2472
|
-
};
|
|
2473
|
-
}
|
|
2474
|
-
const ka = I();
|
|
2475
|
-
I({ strict: !0 });
|
|
2476
|
-
I({ circular: !0 });
|
|
2477
|
-
I({
|
|
2478
|
-
circular: !0,
|
|
2479
|
-
strict: !0
|
|
2480
|
-
});
|
|
2481
|
-
const Oa = I({
|
|
2482
|
-
createInternalComparator: () => x
|
|
2483
|
-
});
|
|
2484
|
-
I({
|
|
2485
|
-
strict: !0,
|
|
2486
|
-
createInternalComparator: () => x
|
|
2487
|
-
});
|
|
2488
|
-
I({
|
|
2489
|
-
circular: !0,
|
|
2490
|
-
createInternalComparator: () => x
|
|
505
|
+
function _t() {
|
|
506
|
+
let e = x(), t = x();
|
|
507
|
+
return {
|
|
508
|
+
createPlaceholder: (n) => `'0${e}${n}${t}'`,
|
|
509
|
+
placeholderRegex: RegExp(`["']?0${e}(\\d+)${t}['"]?`, "ig")
|
|
510
|
+
};
|
|
511
|
+
}
|
|
512
|
+
//#endregion
|
|
513
|
+
//#region src/embedded/json/language.ts
|
|
514
|
+
var F = "embeddedJson", vt = ["json", "jsonl"], yt = [
|
|
515
|
+
"json",
|
|
516
|
+
"json5",
|
|
517
|
+
"jsonc",
|
|
518
|
+
"json-stringify"
|
|
519
|
+
], bt = C(F), xt = w(F), St = T(F), Ct = E(F), wt = {
|
|
520
|
+
[bt]: {
|
|
521
|
+
category: "Embed",
|
|
522
|
+
type: "string",
|
|
523
|
+
array: !0,
|
|
524
|
+
default: [{ value: [...vt] }],
|
|
525
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded JSON language.",
|
|
526
|
+
deprecated: `Please use \`${xt}\` or \`${St}\`.`
|
|
527
|
+
},
|
|
528
|
+
[xt]: {
|
|
529
|
+
category: "Embed",
|
|
530
|
+
type: "string",
|
|
531
|
+
array: !0,
|
|
532
|
+
default: [{ value: [D] }],
|
|
533
|
+
description: "Block comments that make their subsequent template literals be identified as embedded JSON language."
|
|
534
|
+
},
|
|
535
|
+
[St]: {
|
|
536
|
+
category: "Embed",
|
|
537
|
+
type: "string",
|
|
538
|
+
array: !0,
|
|
539
|
+
default: [{ value: [D] }],
|
|
540
|
+
description: "Tags that make their subsequent template literals be identified as embedded JSON language."
|
|
541
|
+
},
|
|
542
|
+
[Ct]: {
|
|
543
|
+
category: "Embed",
|
|
544
|
+
type: "choice",
|
|
545
|
+
default: "json",
|
|
546
|
+
description: "The parser used to parse the embedded JSON language.",
|
|
547
|
+
choices: yt.map((e) => ({
|
|
548
|
+
value: e,
|
|
549
|
+
description: `Use the "${e}" parser.`
|
|
550
|
+
}))
|
|
551
|
+
}
|
|
552
|
+
}, Tt = /* @__PURE__ */ p({
|
|
553
|
+
embedder: () => gt,
|
|
554
|
+
language: () => F,
|
|
555
|
+
options: () => wt
|
|
556
|
+
}), Et = async (e, t, n, r, { commentOrTag: i, embeddedOverrideOptions: a }) => {
|
|
557
|
+
let o = {
|
|
558
|
+
...r,
|
|
559
|
+
...a
|
|
560
|
+
}, { node: s } = n, { createPlaceholder: c, placeholderRegex: l } = S("$p"), { trimmedText: u, leadingWhitespaces: d, trailingWhitespaces: f } = _(s, c), p = y(n, t);
|
|
561
|
+
return v(b(await e(u, {
|
|
562
|
+
...o,
|
|
563
|
+
parser: "JSONata"
|
|
564
|
+
}), l, p), o, i, d, f);
|
|
565
|
+
}, I = "embeddedJsonata", Dt = ["jsonata"], Ot = C(I), kt = w(I), At = T(I), jt = {
|
|
566
|
+
[Ot]: {
|
|
567
|
+
category: "Embed",
|
|
568
|
+
type: "string",
|
|
569
|
+
array: !0,
|
|
570
|
+
default: [{ value: [...Dt] }],
|
|
571
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded JSONata language. This option requires the `@stedi/prettier-plugin-jsonata` plugin.",
|
|
572
|
+
deprecated: `Please use \`${kt}\` or \`${At}\`.`
|
|
573
|
+
},
|
|
574
|
+
[kt]: {
|
|
575
|
+
category: "Embed",
|
|
576
|
+
type: "string",
|
|
577
|
+
array: !0,
|
|
578
|
+
default: [{ value: [D] }],
|
|
579
|
+
description: "Block comments that make their subsequent template literals be identified as embedded JSONata language. This option requires the `@stedi/prettier-plugin-jsonata` plugin."
|
|
580
|
+
},
|
|
581
|
+
[At]: {
|
|
582
|
+
category: "Embed",
|
|
583
|
+
type: "string",
|
|
584
|
+
array: !0,
|
|
585
|
+
default: [{ value: [D] }],
|
|
586
|
+
description: "Tags that make their subsequent template literals be identified as embedded JSONata language. This option requires the `@stedi/prettier-plugin-jsonata` plugin."
|
|
587
|
+
}
|
|
588
|
+
}, Mt = /* @__PURE__ */ p({
|
|
589
|
+
embedder: () => Et,
|
|
590
|
+
language: () => I,
|
|
591
|
+
options: () => jt
|
|
592
|
+
}), Nt = async (e, t, n, r, { commentOrTag: i, embeddedOverrideOptions: a }) => {
|
|
593
|
+
let o = {
|
|
594
|
+
...r,
|
|
595
|
+
...a
|
|
596
|
+
}, { node: s } = n, { createPlaceholder: c, placeholderRegex: l } = S(), { trimmedText: u, leadingWhitespaces: d, trailingWhitespaces: f } = _(s, c), p = y(n, t);
|
|
597
|
+
return v(b(await e(u, {
|
|
598
|
+
...o,
|
|
599
|
+
parser: "latex-parser"
|
|
600
|
+
}), l, p), o, i, d, f);
|
|
601
|
+
}, L = "embeddedLatex", Pt = [
|
|
602
|
+
"latex",
|
|
603
|
+
"tex",
|
|
604
|
+
"aux",
|
|
605
|
+
"cls",
|
|
606
|
+
"bbl",
|
|
607
|
+
"bib",
|
|
608
|
+
"toc",
|
|
609
|
+
"sty"
|
|
610
|
+
], Ft = C(L), It = w(L), Lt = T(L), Rt = {
|
|
611
|
+
[Ft]: {
|
|
612
|
+
category: "Embed",
|
|
613
|
+
type: "string",
|
|
614
|
+
array: !0,
|
|
615
|
+
default: [{ value: [...Pt] }],
|
|
616
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded LaTeX language. This option requires the `prettier-plugin-latex` plugin.",
|
|
617
|
+
deprecated: `Please use \`${It}\` or \`${Lt}\`.`
|
|
618
|
+
},
|
|
619
|
+
[It]: {
|
|
620
|
+
category: "Embed",
|
|
621
|
+
type: "string",
|
|
622
|
+
array: !0,
|
|
623
|
+
default: [{ value: [D] }],
|
|
624
|
+
description: "Block comments that make their subsequent template literals be identified as embedded LaTeX language. This option requires the `prettier-plugin-latex` plugin."
|
|
625
|
+
},
|
|
626
|
+
[Lt]: {
|
|
627
|
+
category: "Embed",
|
|
628
|
+
type: "string",
|
|
629
|
+
array: !0,
|
|
630
|
+
default: [{ value: [D] }],
|
|
631
|
+
description: "Tags that make their subsequent template literals be identified as embedded LaTeX language. This option requires the `prettier-plugin-latex` plugin."
|
|
632
|
+
}
|
|
633
|
+
}, zt = /* @__PURE__ */ p({
|
|
634
|
+
embedder: () => Nt,
|
|
635
|
+
language: () => L,
|
|
636
|
+
options: () => Rt
|
|
2491
637
|
});
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
}
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
}
|
|
2567
|
-
function
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
}
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
}
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
}
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
638
|
+
//#endregion
|
|
639
|
+
//#region node_modules/.pnpm/dedent@1.7.2/node_modules/dedent/dist/dedent.mjs
|
|
640
|
+
function Bt(e, t) {
|
|
641
|
+
var n = Object.keys(e);
|
|
642
|
+
if (Object.getOwnPropertySymbols) {
|
|
643
|
+
var r = Object.getOwnPropertySymbols(e);
|
|
644
|
+
t && (r = r.filter(function(t) {
|
|
645
|
+
return Object.getOwnPropertyDescriptor(e, t).enumerable;
|
|
646
|
+
})), n.push.apply(n, r);
|
|
647
|
+
}
|
|
648
|
+
return n;
|
|
649
|
+
}
|
|
650
|
+
function Vt(e) {
|
|
651
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
652
|
+
var n = arguments[t] == null ? {} : arguments[t];
|
|
653
|
+
t % 2 ? Bt(Object(n), !0).forEach(function(t) {
|
|
654
|
+
Ht(e, t, n[t]);
|
|
655
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Bt(Object(n)).forEach(function(t) {
|
|
656
|
+
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
657
|
+
});
|
|
658
|
+
}
|
|
659
|
+
return e;
|
|
660
|
+
}
|
|
661
|
+
function Ht(e, t, n) {
|
|
662
|
+
return t = Ut(t), t in e ? Object.defineProperty(e, t, {
|
|
663
|
+
value: n,
|
|
664
|
+
enumerable: !0,
|
|
665
|
+
configurable: !0,
|
|
666
|
+
writable: !0
|
|
667
|
+
}) : e[t] = n, e;
|
|
668
|
+
}
|
|
669
|
+
function Ut(e) {
|
|
670
|
+
var t = Wt(e, "string");
|
|
671
|
+
return typeof t == "symbol" ? t : String(t);
|
|
672
|
+
}
|
|
673
|
+
function Wt(e, t) {
|
|
674
|
+
if (typeof e != "object" || !e) return e;
|
|
675
|
+
var n = e[Symbol.toPrimitive];
|
|
676
|
+
if (n !== void 0) {
|
|
677
|
+
var r = n.call(e, t || "default");
|
|
678
|
+
if (typeof r != "object") return r;
|
|
679
|
+
throw TypeError("@@toPrimitive must return a primitive value.");
|
|
680
|
+
}
|
|
681
|
+
return (t === "string" ? String : Number)(e);
|
|
682
|
+
}
|
|
683
|
+
var Gt = Kt({});
|
|
684
|
+
function Kt(e) {
|
|
685
|
+
return t.withOptions = (t) => Kt(Vt(Vt({}, e), t)), t;
|
|
686
|
+
function t(t, ...n) {
|
|
687
|
+
let r = typeof t == "string" ? [t] : t.raw, { alignValues: i = !1, escapeSpecialCharacters: a = Array.isArray(t), trimWhitespace: o = !0 } = e, s = "";
|
|
688
|
+
for (let e = 0; e < r.length; e++) {
|
|
689
|
+
let t = r[e];
|
|
690
|
+
if (a && (t = t.replace(/\\\n[ \t]*/g, "").replace(/\\`/g, "`").replace(/\\\$/g, "$").replace(/\\\{/g, "{")), s += t, e < n.length) {
|
|
691
|
+
let t = i ? qt(n[e], s) : n[e];
|
|
692
|
+
s += t;
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
let c = s.split("\n"), l = null;
|
|
696
|
+
for (let e of c) {
|
|
697
|
+
let t = e.match(/^(\s+)\S+/);
|
|
698
|
+
if (t) {
|
|
699
|
+
let e = t[1].length;
|
|
700
|
+
l = l ? Math.min(l, e) : e;
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
if (l !== null) {
|
|
704
|
+
let e = l;
|
|
705
|
+
s = c.map((t) => t[0] === " " || t[0] === " " ? t.slice(e) : t).join("\n");
|
|
706
|
+
}
|
|
707
|
+
return o && (s = s.trim()), a && (s = s.replace(/\\n/g, "\n").replace(/\\t/g, " ").replace(/\\r/g, "\r").replace(/\\v/g, "\v").replace(/\\b/g, "\b").replace(/\\f/g, "\f").replace(/\\0/g, "\0").replace(/\\x([\da-fA-F]{2})/g, (e, t) => String.fromCharCode(parseInt(t, 16))).replace(/\\u\{([\da-fA-F]{1,6})\}/g, (e, t) => String.fromCodePoint(parseInt(t, 16))).replace(/\\u([\da-fA-F]{4})/g, (e, t) => String.fromCharCode(parseInt(t, 16)))), typeof Bun < "u" && (s = s.replace(/\\u(?:\{([\da-fA-F]{1,6})\}|([\da-fA-F]{4}))/g, (e, t, n) => {
|
|
708
|
+
let r = t ?? n ?? "";
|
|
709
|
+
return String.fromCodePoint(parseInt(r, 16));
|
|
710
|
+
})), s;
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
function qt(e, t) {
|
|
714
|
+
if (typeof e != "string" || !e.includes("\n")) return e;
|
|
715
|
+
let n = t.slice(t.lastIndexOf("\n") + 1).match(/^(\s+)/);
|
|
716
|
+
if (n) {
|
|
717
|
+
let t = n[1];
|
|
718
|
+
return e.replace(/\n/g, `\n${t}`);
|
|
719
|
+
}
|
|
720
|
+
return e;
|
|
721
|
+
}
|
|
722
|
+
//#endregion
|
|
723
|
+
//#region src/embedded/markdown/embedder.ts
|
|
724
|
+
var { line: Jt, group: R, indent: Yt, softline: Xt, dedentToRoot: Zt, literalline: Qt } = e, $t = async (e, t, n, r, { commentOrTag: i, embeddedOverrideOptions: a }) => {
|
|
725
|
+
let o = {
|
|
726
|
+
...r,
|
|
727
|
+
...a
|
|
728
|
+
}, { node: s } = n, { createPlaceholder: c, placeholderRegex: l } = S(), { trimmedText: u, leadingWhitespaces: d, trailingWhitespaces: f } = _(s, c), p = y(n, t), m = b(await e(Gt(u), {
|
|
729
|
+
...o,
|
|
730
|
+
parser: o.embeddedMarkdownParser ?? "markdown",
|
|
731
|
+
__inJsTemplate: !0
|
|
732
|
+
}), l, p, "hardline");
|
|
733
|
+
if (o.preserveEmbeddedExteriorWhitespaces?.includes(i)) return R([
|
|
734
|
+
"`",
|
|
735
|
+
d,
|
|
736
|
+
o.noEmbeddedMultiLineIndentation?.includes(i) ? Zt(R(m)) : Yt([R(m)]),
|
|
737
|
+
f,
|
|
738
|
+
"`"
|
|
739
|
+
]);
|
|
740
|
+
let h = d.length ? Jt : Xt, ee = f.length ? Jt : Xt;
|
|
741
|
+
return o.noEmbeddedMultiLineIndentation?.includes(i) ? [
|
|
742
|
+
"`",
|
|
743
|
+
Qt,
|
|
744
|
+
Zt(m),
|
|
745
|
+
Xt,
|
|
746
|
+
"`"
|
|
747
|
+
] : R([
|
|
748
|
+
"`",
|
|
749
|
+
Yt([h, R(m)]),
|
|
750
|
+
ee,
|
|
751
|
+
"`"
|
|
752
|
+
]);
|
|
753
|
+
}, z = "embeddedMarkdown", en = ["md", "markdown"], tn = [
|
|
754
|
+
"markdown",
|
|
755
|
+
"mdx",
|
|
756
|
+
"remark"
|
|
757
|
+
], nn = C(z), rn = w(z), an = T(z), on = E(z), sn = {
|
|
758
|
+
[nn]: {
|
|
759
|
+
category: "Embed",
|
|
760
|
+
type: "string",
|
|
761
|
+
array: !0,
|
|
762
|
+
default: [{ value: [...en] }],
|
|
763
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Markdown language.",
|
|
764
|
+
deprecated: `Please use \`${rn}\` or \`${an}\`.`
|
|
765
|
+
},
|
|
766
|
+
[rn]: {
|
|
767
|
+
category: "Embed",
|
|
768
|
+
type: "string",
|
|
769
|
+
array: !0,
|
|
770
|
+
default: [{ value: [D] }],
|
|
771
|
+
description: "Block comments that make their subsequent template literals be identified as embedded Markdown language."
|
|
772
|
+
},
|
|
773
|
+
[an]: {
|
|
774
|
+
category: "Embed",
|
|
775
|
+
type: "string",
|
|
776
|
+
array: !0,
|
|
777
|
+
default: [{ value: [D] }],
|
|
778
|
+
description: "Tags that make their subsequent template literals be identified as embedded Markdown language."
|
|
779
|
+
},
|
|
780
|
+
[on]: {
|
|
781
|
+
category: "Embed",
|
|
782
|
+
type: "choice",
|
|
783
|
+
default: "markdown",
|
|
784
|
+
description: "The parser used to parse the embedded Markdown language.",
|
|
785
|
+
choices: tn.map((e) => ({
|
|
786
|
+
value: e,
|
|
787
|
+
description: `Use the "${e}" parser.`
|
|
788
|
+
}))
|
|
789
|
+
}
|
|
790
|
+
}, cn = /* @__PURE__ */ p({
|
|
791
|
+
embedder: () => $t,
|
|
792
|
+
language: () => z,
|
|
793
|
+
options: () => sn
|
|
794
|
+
}), ln = async (e, t, n, r, { commentOrTag: i, embeddedOverrideOptions: a }) => {
|
|
795
|
+
let o = {
|
|
796
|
+
...r,
|
|
797
|
+
...a
|
|
798
|
+
}, { node: s } = n, { createPlaceholder: c, placeholderRegex: l } = S(), { trimmedText: u, leadingWhitespaces: d, trailingWhitespaces: f } = _(s, c), p = y(n, t);
|
|
799
|
+
return v(b(await e(u, {
|
|
800
|
+
...o,
|
|
801
|
+
parser: "nginx"
|
|
802
|
+
}), l, p), o, i, d, f);
|
|
803
|
+
}, B = "embeddedNginx", un = ["nginx"], dn = C(B), fn = w(B), pn = T(B), mn = {
|
|
804
|
+
[dn]: {
|
|
805
|
+
category: "Embed",
|
|
806
|
+
type: "string",
|
|
807
|
+
array: !0,
|
|
808
|
+
default: [{ value: [...un] }],
|
|
809
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded NGINX language. This option requires the `prettier-plugin-nginx` plugin.",
|
|
810
|
+
deprecated: `Please use \`${fn}\` or \`${pn}\`.`
|
|
811
|
+
},
|
|
812
|
+
[fn]: {
|
|
813
|
+
category: "Embed",
|
|
814
|
+
type: "string",
|
|
815
|
+
array: !0,
|
|
816
|
+
default: [{ value: [D] }],
|
|
817
|
+
description: "Block comments that make their subsequent template literals be identified as embedded NGINX language. This option requires the `prettier-plugin-nginx` plugin."
|
|
818
|
+
},
|
|
819
|
+
[pn]: {
|
|
820
|
+
category: "Embed",
|
|
821
|
+
type: "string",
|
|
822
|
+
array: !0,
|
|
823
|
+
default: [{ value: [D] }],
|
|
824
|
+
description: "Tags that make their subsequent template literals be identified as embedded NGINX language. This option requires the `prettier-plugin-nginx` plugin."
|
|
825
|
+
}
|
|
826
|
+
}, hn = /* @__PURE__ */ p({
|
|
827
|
+
embedder: () => ln,
|
|
828
|
+
language: () => B,
|
|
829
|
+
options: () => mn
|
|
830
|
+
}), V = "embeddedNoop", gn = C(V), _n = w(V), vn = T(V), yn = {
|
|
831
|
+
[gn]: {
|
|
832
|
+
category: "Embed",
|
|
833
|
+
type: "string",
|
|
834
|
+
array: !0,
|
|
835
|
+
default: [{ value: [] }],
|
|
836
|
+
description: "Tag or comment identifiers that prevent their subsequent template literals from being identified as embedded languages and thus from being formatted.",
|
|
837
|
+
deprecated: `Please use \`${_n}\` or \`${vn}\`.`
|
|
838
|
+
},
|
|
839
|
+
[_n]: {
|
|
840
|
+
category: "Embed",
|
|
841
|
+
type: "string",
|
|
842
|
+
array: !0,
|
|
843
|
+
default: [{ value: [D] }],
|
|
844
|
+
description: "Block comments that prevent their subsequent template literals from being identified as embedded languages and thus from being formatted."
|
|
845
|
+
},
|
|
846
|
+
[vn]: {
|
|
847
|
+
category: "Embed",
|
|
848
|
+
type: "string",
|
|
849
|
+
array: !0,
|
|
850
|
+
default: [{ value: [D] }],
|
|
851
|
+
description: "Tags that prevent their subsequent template literals from being identified as embedded languages and thus from being formatted."
|
|
852
|
+
}
|
|
853
|
+
}, bn = /* @__PURE__ */ p({
|
|
854
|
+
language: () => V,
|
|
855
|
+
options: () => yn
|
|
856
|
+
}), xn = async (e, t, n, r, { commentOrTag: i, embeddedOverrideOptions: a }) => {
|
|
857
|
+
let o = {
|
|
858
|
+
...r,
|
|
859
|
+
...a
|
|
860
|
+
}, { node: s } = n, { createPlaceholder: c, placeholderRegex: l } = S(), { trimmedText: u, leadingWhitespaces: d, trailingWhitespaces: f } = _(s, c), p = y(n, t);
|
|
861
|
+
return v(b(await e(u, {
|
|
862
|
+
...o,
|
|
863
|
+
parser: "pegjs-parser"
|
|
864
|
+
}), l, p), o, i, d, f);
|
|
865
|
+
}, H = "embeddedPegjs", Sn = [
|
|
866
|
+
"pegjs",
|
|
867
|
+
"peggy",
|
|
868
|
+
"peg"
|
|
869
|
+
], Cn = C(H), wn = w(H), Tn = T(H), En = {
|
|
870
|
+
[Cn]: {
|
|
871
|
+
category: "Embed",
|
|
872
|
+
type: "string",
|
|
873
|
+
array: !0,
|
|
874
|
+
default: [{ value: [...Sn] }],
|
|
875
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Pegjs language. This option requires the `prettier-plugin-pegjs` plugin.",
|
|
876
|
+
deprecated: `Please use \`${wn}\` or \`${Tn}\`.`
|
|
877
|
+
},
|
|
878
|
+
[wn]: {
|
|
879
|
+
category: "Embed",
|
|
880
|
+
type: "string",
|
|
881
|
+
array: !0,
|
|
882
|
+
default: [{ value: [D] }],
|
|
883
|
+
description: "Block comments that make their subsequent template literals be identified as embedded Pegjs language. This option requires the `prettier-plugin-pegjs` plugin."
|
|
884
|
+
},
|
|
885
|
+
[Tn]: {
|
|
886
|
+
category: "Embed",
|
|
887
|
+
type: "string",
|
|
888
|
+
array: !0,
|
|
889
|
+
default: [{ value: [D] }],
|
|
890
|
+
description: "Tags that make their subsequent template literals be identified as embedded Pegjs language. This option requires the `prettier-plugin-pegjs` plugin."
|
|
891
|
+
}
|
|
892
|
+
}, Dn = /* @__PURE__ */ p({
|
|
893
|
+
embedder: () => xn,
|
|
894
|
+
language: () => H,
|
|
895
|
+
options: () => En
|
|
896
|
+
}), On = async (e, t, n, r, { commentOrTag: i, embeddedOverrideOptions: a }) => {
|
|
897
|
+
let o = {
|
|
898
|
+
...r,
|
|
899
|
+
...a
|
|
900
|
+
}, { node: s } = n, { createPlaceholder: c, placeholderRegex: l } = S("$p"), { trimmedText: u, leadingWhitespaces: d, trailingWhitespaces: f } = _(s, c), p = y(n, t);
|
|
901
|
+
return v(b(await e(u, {
|
|
902
|
+
...o,
|
|
903
|
+
parser: "php"
|
|
904
|
+
}), l, p), o, i, d, f);
|
|
905
|
+
}, U = "embeddedPhp", kn = ["php", "php5"], An = C(U), jn = w(U), Mn = T(U), Nn = {
|
|
906
|
+
[An]: {
|
|
907
|
+
category: "Embed",
|
|
908
|
+
type: "string",
|
|
909
|
+
array: !0,
|
|
910
|
+
default: [{ value: [...kn] }],
|
|
911
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded PHP language. This option requires the `@prettier/plugin-php` plugin.",
|
|
912
|
+
deprecated: `Please use \`${jn}\` or \`${Mn}\`.`
|
|
913
|
+
},
|
|
914
|
+
[jn]: {
|
|
915
|
+
category: "Embed",
|
|
916
|
+
type: "string",
|
|
917
|
+
array: !0,
|
|
918
|
+
default: [{ value: [D] }],
|
|
919
|
+
description: "Block comments that make their subsequent template literals be identified as embedded PHP language. This option requires the `@prettier/plugin-php` plugin."
|
|
920
|
+
},
|
|
921
|
+
[Mn]: {
|
|
922
|
+
category: "Embed",
|
|
923
|
+
type: "string",
|
|
924
|
+
array: !0,
|
|
925
|
+
default: [{ value: [D] }],
|
|
926
|
+
description: "Tags that make their subsequent template literals be identified as embedded PHP language. This option requires the `@prettier/plugin-php` plugin."
|
|
927
|
+
}
|
|
928
|
+
}, Pn = /* @__PURE__ */ p({
|
|
929
|
+
embedder: () => On,
|
|
930
|
+
language: () => U,
|
|
931
|
+
options: () => Nn
|
|
932
|
+
}), Fn = async (e, t, n, r, { commentOrTag: i, embeddedOverrideOptions: a }) => {
|
|
933
|
+
let o = {
|
|
934
|
+
...r,
|
|
935
|
+
...a
|
|
936
|
+
}, { node: s } = n, { createPlaceholder: c, placeholderRegex: l } = S(), { trimmedText: u, leadingWhitespaces: d, trailingWhitespaces: f } = _(s, c), p = y(n, t);
|
|
937
|
+
return v(b(await e(u, {
|
|
938
|
+
...o,
|
|
939
|
+
parser: "prisma-parse"
|
|
940
|
+
}), l, p, "hardline"), o, i, d, f);
|
|
941
|
+
}, W = "embeddedPrisma", In = ["prisma"], Ln = C(W), Rn = w(W), zn = T(W), Bn = {
|
|
942
|
+
[Ln]: {
|
|
943
|
+
category: "Embed",
|
|
944
|
+
type: "string",
|
|
945
|
+
array: !0,
|
|
946
|
+
default: [{ value: [...In] }],
|
|
947
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Prisma language. This option requires the `prettier-plugin-prisma` plugin.",
|
|
948
|
+
deprecated: `Please use \`${Rn}\` or \`${zn}\`.`
|
|
949
|
+
},
|
|
950
|
+
[Rn]: {
|
|
951
|
+
category: "Embed",
|
|
952
|
+
type: "string",
|
|
953
|
+
array: !0,
|
|
954
|
+
default: [{ value: [D] }],
|
|
955
|
+
description: "Block comments that make their subsequent template literals be identified as embedded Prisma language. This option requires the `prettier-plugin-prisma` plugin."
|
|
956
|
+
},
|
|
957
|
+
[zn]: {
|
|
958
|
+
category: "Embed",
|
|
959
|
+
type: "string",
|
|
960
|
+
array: !0,
|
|
961
|
+
default: [{ value: [D] }],
|
|
962
|
+
description: "Tags that make their subsequent template literals be identified as embedded Prisma language. This option requires the `prettier-plugin-prisma` plugin."
|
|
963
|
+
}
|
|
964
|
+
}, Vn = /* @__PURE__ */ p({
|
|
965
|
+
embedder: () => Fn,
|
|
966
|
+
language: () => W,
|
|
967
|
+
options: () => Bn
|
|
968
|
+
}), Hn = async (e, t, n, r, { commentOrTag: i, embeddedOverrideOptions: a }) => {
|
|
969
|
+
let o = {
|
|
970
|
+
...r,
|
|
971
|
+
...a
|
|
972
|
+
}, { node: s } = n, { createPlaceholder: c, placeholderRegex: l } = S(), { trimmedText: u, leadingWhitespaces: d, trailingWhitespaces: f } = _(s, c), p = y(n, t);
|
|
973
|
+
return v(b(await e(u, {
|
|
974
|
+
...o,
|
|
975
|
+
parser: "dot-properties"
|
|
976
|
+
}), l, p), o, i, d, f);
|
|
977
|
+
}, G = "embeddedProperties", Un = ["properties"], Wn = C(G), Gn = w(G), Kn = T(G), qn = {
|
|
978
|
+
[Wn]: {
|
|
979
|
+
category: "Embed",
|
|
980
|
+
type: "string",
|
|
981
|
+
array: !0,
|
|
982
|
+
default: [{ value: [...Un] }],
|
|
983
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Properties language. This option requires the `prettier-plugin-properties` plugin.",
|
|
984
|
+
deprecated: `Please use \`${Gn}\` or \`${Kn}\`.`
|
|
985
|
+
},
|
|
986
|
+
[Gn]: {
|
|
987
|
+
category: "Embed",
|
|
988
|
+
type: "string",
|
|
989
|
+
array: !0,
|
|
990
|
+
default: [{ value: [D] }],
|
|
991
|
+
description: "Block comments that make their subsequent template literals be identified as embedded Properties language. This option requires the `prettier-plugin-properties` plugin."
|
|
992
|
+
},
|
|
993
|
+
[Kn]: {
|
|
994
|
+
category: "Embed",
|
|
995
|
+
type: "string",
|
|
996
|
+
array: !0,
|
|
997
|
+
default: [{ value: [D] }],
|
|
998
|
+
description: "Tags that make their subsequent template literals be identified as embedded Properties language. This option requires the `prettier-plugin-properties` plugin."
|
|
999
|
+
}
|
|
1000
|
+
}, Jn = /* @__PURE__ */ p({
|
|
1001
|
+
embedder: () => Hn,
|
|
1002
|
+
language: () => G,
|
|
1003
|
+
options: () => qn
|
|
1004
|
+
}), Yn = async (e, t, n, r, { commentOrTag: i, embeddedOverrideOptions: a }) => {
|
|
1005
|
+
let o = {
|
|
1006
|
+
...r,
|
|
1007
|
+
...a
|
|
1008
|
+
}, { node: s } = n, { createPlaceholder: c, placeholderRegex: l } = S(), { trimmedText: u, leadingWhitespaces: d, trailingWhitespaces: f } = _(s, c), p = y(n, t);
|
|
1009
|
+
return v(b(await e(u, {
|
|
1010
|
+
...o,
|
|
1011
|
+
parser: "pug"
|
|
1012
|
+
}), l, p, "hardline"), o, i, d, f);
|
|
1013
|
+
}, K = "embeddedPug", Xn = ["pug", "jade"], Zn = C(K), Qn = w(K), $n = T(K), er = {
|
|
1014
|
+
[Zn]: {
|
|
1015
|
+
category: "Embed",
|
|
1016
|
+
type: "string",
|
|
1017
|
+
array: !0,
|
|
1018
|
+
default: [{ value: [...Xn] }],
|
|
1019
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Pug language. This option requires the `@prettier/plugin-pug` plugin.",
|
|
1020
|
+
deprecated: `Please use \`${Qn}\` or \`${$n}\`.`
|
|
1021
|
+
},
|
|
1022
|
+
[Qn]: {
|
|
1023
|
+
category: "Embed",
|
|
1024
|
+
type: "string",
|
|
1025
|
+
array: !0,
|
|
1026
|
+
default: [{ value: [D] }],
|
|
1027
|
+
description: "Block comments that make their subsequent template literals be identified as embedded Pug language. This option requires the `@prettier/plugin-pug` plugin."
|
|
1028
|
+
},
|
|
1029
|
+
[$n]: {
|
|
1030
|
+
category: "Embed",
|
|
1031
|
+
type: "string",
|
|
1032
|
+
array: !0,
|
|
1033
|
+
default: [{ value: [D] }],
|
|
1034
|
+
description: "Tags that make their subsequent template literals be identified as embedded Pug language. This option requires the `@prettier/plugin-pug` plugin."
|
|
1035
|
+
}
|
|
1036
|
+
}, tr = /* @__PURE__ */ p({
|
|
1037
|
+
embedder: () => Yn,
|
|
1038
|
+
language: () => K,
|
|
1039
|
+
options: () => er
|
|
1040
|
+
}), nr = async (e, t, n, r, { commentOrTag: i, embeddedOverrideOptions: a }) => {
|
|
1041
|
+
let o = {
|
|
1042
|
+
...r,
|
|
1043
|
+
...a
|
|
1044
|
+
}, { node: s } = n, { createPlaceholder: c, placeholderRegex: l } = S(), { trimmedText: u, leadingWhitespaces: d, trailingWhitespaces: f } = _(s, c), p = y(n, t);
|
|
1045
|
+
return v(b(await e(u, {
|
|
1046
|
+
...o,
|
|
1047
|
+
parser: o.embeddedRubyParser ?? "ruby"
|
|
1048
|
+
}), l, p), o, i, d, f);
|
|
1049
|
+
}, q = "embeddedRuby", rr = ["ruby"], ir = [
|
|
1050
|
+
"ruby",
|
|
1051
|
+
"rbs",
|
|
1052
|
+
"haml"
|
|
1053
|
+
], ar = C(q), or = w(q), sr = T(q), cr = E(q), lr = {
|
|
1054
|
+
[ar]: {
|
|
1055
|
+
category: "Embed",
|
|
1056
|
+
type: "string",
|
|
1057
|
+
array: !0,
|
|
1058
|
+
default: [{ value: [...rr] }],
|
|
1059
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Ruby language. This option requires the `@prettier/plugin-ruby` plugin.",
|
|
1060
|
+
deprecated: `Please use \`${or}\` or \`${sr}\`.`
|
|
1061
|
+
},
|
|
1062
|
+
[or]: {
|
|
1063
|
+
category: "Embed",
|
|
1064
|
+
type: "string",
|
|
1065
|
+
array: !0,
|
|
1066
|
+
default: [{ value: [D] }],
|
|
1067
|
+
description: "Block comments that make their subsequent template literals be identified as embedded Ruby language. This option requires the `@prettier/plugin-ruby` plugin."
|
|
1068
|
+
},
|
|
1069
|
+
[sr]: {
|
|
1070
|
+
category: "Embed",
|
|
1071
|
+
type: "string",
|
|
1072
|
+
array: !0,
|
|
1073
|
+
default: [{ value: [D] }],
|
|
1074
|
+
description: "Tags that make their subsequent template literals be identified as embedded Ruby language. This option requires the `@prettier/plugin-ruby` plugin."
|
|
1075
|
+
},
|
|
1076
|
+
[cr]: {
|
|
1077
|
+
category: "Embed",
|
|
1078
|
+
type: "choice",
|
|
1079
|
+
default: "ruby",
|
|
1080
|
+
description: "The parser used to parse the embedded Ruby language. This option requires the `@prettier/plugin-ruby` plugin.",
|
|
1081
|
+
choices: ir.map((e) => ({
|
|
1082
|
+
value: e,
|
|
1083
|
+
description: `Use the "${e}" parser.`
|
|
1084
|
+
}))
|
|
1085
|
+
}
|
|
1086
|
+
}, ur = /* @__PURE__ */ p({
|
|
1087
|
+
embedder: () => nr,
|
|
1088
|
+
language: () => q,
|
|
1089
|
+
options: () => lr
|
|
1090
|
+
}), dr = async (e, t, n, r, { commentOrTag: i, embeddedOverrideOptions: a }) => {
|
|
1091
|
+
let o = {
|
|
1092
|
+
...r,
|
|
1093
|
+
...a
|
|
1094
|
+
}, { node: s } = n, { createPlaceholder: c, placeholderRegex: l } = S(), { trimmedText: u, leadingWhitespaces: d, trailingWhitespaces: f } = _(s, c), p = y(n, t);
|
|
1095
|
+
return v(b(await e(u, {
|
|
1096
|
+
...o,
|
|
1097
|
+
parser: "sh"
|
|
1098
|
+
}), l, p, "hardline"), o, i, d, f);
|
|
1099
|
+
}, J = "embeddedSh", fr = ["sh"], pr = C(J), mr = w(J), hr = T(J), gr = {
|
|
1100
|
+
[pr]: {
|
|
1101
|
+
category: "Embed",
|
|
1102
|
+
type: "string",
|
|
1103
|
+
array: !0,
|
|
1104
|
+
default: [{ value: [...fr] }],
|
|
1105
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Shell language. This option requires the `prettier-plugin-sh` plugin.",
|
|
1106
|
+
deprecated: `Please use \`${mr}\` or \`${hr}\`.`
|
|
1107
|
+
},
|
|
1108
|
+
[mr]: {
|
|
1109
|
+
category: "Embed",
|
|
1110
|
+
type: "string",
|
|
1111
|
+
array: !0,
|
|
1112
|
+
default: [{ value: [D] }],
|
|
1113
|
+
description: "Block comments that make their subsequent template literals be identified as embedded Shell language. This option requires the `prettier-plugin-sh` plugin."
|
|
1114
|
+
},
|
|
1115
|
+
[hr]: {
|
|
1116
|
+
category: "Embed",
|
|
1117
|
+
type: "string",
|
|
1118
|
+
array: !0,
|
|
1119
|
+
default: [{ value: [D] }],
|
|
1120
|
+
description: "Tags that make their subsequent template literals be identified as embedded Shell language. This option requires the `prettier-plugin-sh` plugin."
|
|
1121
|
+
}
|
|
1122
|
+
}, _r = /* @__PURE__ */ p({
|
|
1123
|
+
embedder: () => dr,
|
|
1124
|
+
language: () => J,
|
|
1125
|
+
options: () => gr
|
|
1126
|
+
}), vr = async (e, t, n, r, { commentOrTag: i, embeddedOverrideOptions: a }) => {
|
|
1127
|
+
let o = {
|
|
1128
|
+
...r,
|
|
1129
|
+
...a
|
|
1130
|
+
}, s = o.embeddedSqlPlugin ?? "prettier-plugin-sql", { node: c } = n, { createPlaceholder: l, placeholderRegex: u } = S(), { trimmedText: d, leadingWhitespaces: f, trailingWhitespaces: p } = _(c, l), m = y(n, t, o, !1), h;
|
|
1131
|
+
if (s === "prettier-plugin-sql-cst") h = b(await e(d, {
|
|
1132
|
+
...o,
|
|
1133
|
+
parser: o.embeddedSqlParser ?? "sqlite"
|
|
1134
|
+
}), u, m);
|
|
1135
|
+
else {
|
|
1136
|
+
let t = new Set(c.quasis.slice(0, -1).flatMap((e, t) => /\n[\t ]*$/.test(e.value.raw) ? [t] : []));
|
|
1137
|
+
h = b(await e(Gt(d), {
|
|
1138
|
+
...o,
|
|
1139
|
+
parser: "sql"
|
|
1140
|
+
}), u, m, "hardline", t, o.tabWidth ?? 2);
|
|
1141
|
+
}
|
|
1142
|
+
return v(h, o, i, f, p);
|
|
1143
|
+
}, Y = "embeddedSql", yr = ["sql"], br = ["prettier-plugin-sql", "prettier-plugin-sql-cst"], xr = [
|
|
1144
|
+
"sqlite",
|
|
1145
|
+
"bigquery",
|
|
1146
|
+
"mysql",
|
|
1147
|
+
"mariadb",
|
|
1148
|
+
"postgresql"
|
|
1149
|
+
], Sr = C(Y), Cr = w(Y), wr = T(Y), Tr = pe(Y), Er = E(Y), Dr = {
|
|
1150
|
+
[Sr]: {
|
|
1151
|
+
category: "Embed",
|
|
1152
|
+
type: "string",
|
|
1153
|
+
array: !0,
|
|
1154
|
+
default: [{ value: [...yr] }],
|
|
1155
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded SQL language. This option requires the `prettier-plugin-sql` plugin or the `prettier-plugin-sql-cst` plugin.",
|
|
1156
|
+
deprecated: `Please use \`${Cr}\` or \`${wr}\`.`
|
|
1157
|
+
},
|
|
1158
|
+
[Cr]: {
|
|
1159
|
+
category: "Embed",
|
|
1160
|
+
type: "string",
|
|
1161
|
+
array: !0,
|
|
1162
|
+
default: [{ value: [D] }],
|
|
1163
|
+
description: "Block comments that make their subsequent template literals be identified as embedded SQL language. This option requires the `prettier-plugin-sql` plugin or the `prettier-plugin-sql-cst` plugin."
|
|
1164
|
+
},
|
|
1165
|
+
[wr]: {
|
|
1166
|
+
category: "Embed",
|
|
1167
|
+
type: "string",
|
|
1168
|
+
array: !0,
|
|
1169
|
+
default: [{ value: [D] }],
|
|
1170
|
+
description: "Tags that make their subsequent template literals be identified as embedded SQL language. This option requires the `prettier-plugin-sql` plugin or the `prettier-plugin-sql-cst` plugin."
|
|
1171
|
+
},
|
|
1172
|
+
[Tr]: {
|
|
1173
|
+
category: "Embed",
|
|
1174
|
+
type: "choice",
|
|
1175
|
+
default: "prettier-plugin-sql",
|
|
1176
|
+
description: "The plugin used to format the embedded SQL language. This option requires the `prettier-plugin-sql` plugin or the `prettier-plugin-sql-cst` plugin.",
|
|
1177
|
+
choices: br.map((e) => ({
|
|
1178
|
+
value: e,
|
|
1179
|
+
description: `Use the "${e}" plugin.`
|
|
1180
|
+
}))
|
|
1181
|
+
},
|
|
1182
|
+
[Er]: {
|
|
1183
|
+
category: "Embed",
|
|
1184
|
+
type: "choice",
|
|
1185
|
+
default: "sqlite",
|
|
1186
|
+
description: "Specify the embedded SQL language parser. This option is only needed with the `prettier-plugin-sql-cst` plugin.",
|
|
1187
|
+
choices: xr.map((e) => ({
|
|
1188
|
+
value: e,
|
|
1189
|
+
description: `Use the "${e}" parser.`
|
|
1190
|
+
}))
|
|
1191
|
+
}
|
|
1192
|
+
}, Or = /* @__PURE__ */ p({
|
|
1193
|
+
embedder: () => vr,
|
|
1194
|
+
language: () => Y,
|
|
1195
|
+
options: () => Dr
|
|
1196
|
+
}), kr = async (e, t, n, r, { commentOrTag: i, embeddedOverrideOptions: a }) => {
|
|
1197
|
+
let o = {
|
|
1198
|
+
...r,
|
|
1199
|
+
...a
|
|
1200
|
+
}, { node: s } = n, { createPlaceholder: c, placeholderRegex: l } = S(), { trimmedText: u, leadingWhitespaces: d, trailingWhitespaces: f } = _(s, c), p = y(n, t);
|
|
1201
|
+
return v(b(await e(u, {
|
|
1202
|
+
...o,
|
|
1203
|
+
parser: "toml"
|
|
1204
|
+
}), l, p, "hardline"), o, i, d, f);
|
|
1205
|
+
}, X = "embeddedToml", Ar = ["toml"], jr = C(X), Mr = w(X), Nr = T(X), Pr = {
|
|
1206
|
+
[jr]: {
|
|
1207
|
+
category: "Embed",
|
|
1208
|
+
type: "string",
|
|
1209
|
+
array: !0,
|
|
1210
|
+
default: [{ value: [...Ar] }],
|
|
1211
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded TOML language. This option requires the `prettier-plugin-toml` plugin.",
|
|
1212
|
+
deprecated: `Please use \`${Mr}\` or \`${Nr}\`.`
|
|
1213
|
+
},
|
|
1214
|
+
[Mr]: {
|
|
1215
|
+
category: "Embed",
|
|
1216
|
+
type: "string",
|
|
1217
|
+
array: !0,
|
|
1218
|
+
default: [{ value: [D] }],
|
|
1219
|
+
description: "Block comments that make their subsequent template literals be identified as embedded TOML language. This option requires the `prettier-plugin-toml` plugin."
|
|
1220
|
+
},
|
|
1221
|
+
[Nr]: {
|
|
1222
|
+
category: "Embed",
|
|
1223
|
+
type: "string",
|
|
1224
|
+
array: !0,
|
|
1225
|
+
default: [{ value: [D] }],
|
|
1226
|
+
description: "Tags that make their subsequent template literals be identified as embedded TOML language. This option requires the `prettier-plugin-toml` plugin."
|
|
1227
|
+
}
|
|
1228
|
+
}, Fr = /* @__PURE__ */ p({
|
|
1229
|
+
embedder: () => kr,
|
|
1230
|
+
language: () => X,
|
|
1231
|
+
options: () => Pr
|
|
1232
|
+
}), Ir = async (e, t, n, r, { commentOrTag: i, embeddedOverrideOptions: a }) => {
|
|
1233
|
+
let o = {
|
|
1234
|
+
...r,
|
|
1235
|
+
...a
|
|
1236
|
+
}, { node: s } = n, { createPlaceholder: c, placeholderRegex: l } = S(), { trimmedText: u, leadingWhitespaces: d, trailingWhitespaces: f } = _(s, c), p = y(n, t);
|
|
1237
|
+
return v(b(await e(u, {
|
|
1238
|
+
...o,
|
|
1239
|
+
parser: o.embeddedTsParser ?? "typescript",
|
|
1240
|
+
filepath: void 0
|
|
1241
|
+
}), l, p), o, i, d, f);
|
|
1242
|
+
}, Z = "embeddedTs", Lr = [
|
|
1243
|
+
"ts",
|
|
1244
|
+
"tsx",
|
|
1245
|
+
"cts",
|
|
1246
|
+
"mts",
|
|
1247
|
+
"typescript"
|
|
1248
|
+
], Rr = ["typescript", "babel-ts"], zr = C(Z), Br = w(Z), Vr = T(Z), Hr = E(Z), Ur = {
|
|
1249
|
+
[zr]: {
|
|
1250
|
+
category: "Embed",
|
|
1251
|
+
type: "string",
|
|
1252
|
+
array: !0,
|
|
1253
|
+
default: [{ value: [...Lr] }],
|
|
1254
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded TypeScript language.",
|
|
1255
|
+
deprecated: `Please use \`${Br}\` or \`${Vr}\`.`
|
|
1256
|
+
},
|
|
1257
|
+
[Br]: {
|
|
1258
|
+
category: "Embed",
|
|
1259
|
+
type: "string",
|
|
1260
|
+
array: !0,
|
|
1261
|
+
default: [{ value: [D] }],
|
|
1262
|
+
description: "Block comments that make their subsequent template literals be identified as embedded TypeScript language."
|
|
1263
|
+
},
|
|
1264
|
+
[Vr]: {
|
|
1265
|
+
category: "Embed",
|
|
1266
|
+
type: "string",
|
|
1267
|
+
array: !0,
|
|
1268
|
+
default: [{ value: [D] }],
|
|
1269
|
+
description: "Tags that make their subsequent template literals be identified as embedded TypeScript language."
|
|
1270
|
+
},
|
|
1271
|
+
[Hr]: {
|
|
1272
|
+
category: "Embed",
|
|
1273
|
+
type: "choice",
|
|
1274
|
+
default: "typescript",
|
|
1275
|
+
description: "The parser used to parse the embedded TypeScript language.",
|
|
1276
|
+
choices: Rr.map((e) => ({
|
|
1277
|
+
value: e,
|
|
1278
|
+
description: `Use the "${e}" parser.`
|
|
1279
|
+
}))
|
|
1280
|
+
}
|
|
1281
|
+
}, Wr = /* @__PURE__ */ p({
|
|
1282
|
+
embedder: () => Ir,
|
|
1283
|
+
language: () => Z,
|
|
1284
|
+
options: () => Ur
|
|
1285
|
+
}), Q = "embeddedXml", { softline: Gr } = e, Kr = async (e, t, n, r, { commentOrTag: i, embeddedOverrideOptions: a }) => {
|
|
1286
|
+
let o = {
|
|
1287
|
+
...r,
|
|
1288
|
+
...a
|
|
1289
|
+
}, { node: s } = n, { createPlaceholder: c, placeholderRegex: l } = S(), { trimmedText: u, leadingWhitespaces: d, trailingWhitespaces: f } = _(s, c), p = y(n, t), m = [], h = 0;
|
|
1290
|
+
for (; h !== void 0;) {
|
|
1291
|
+
let t = u.slice(h);
|
|
1292
|
+
if (t.length === 0) break;
|
|
1293
|
+
h > 0 && o.xmlWhitespaceSensitivity !== "strict" && m.push(Gr), o.__embeddedXmlFragmentRecoverIndex?.splice(0, o.__embeddedXmlFragmentRecoverIndex.length);
|
|
1294
|
+
let n = await e(t, {
|
|
1295
|
+
...o,
|
|
1296
|
+
parser: Q
|
|
1297
|
+
}), [r, i] = o.__embeddedXmlFragmentRecoverIndex ?? [];
|
|
1298
|
+
r === void 0 ? h = void 0 : i === void 0 ? h += r : (n = t.slice(r, i + 1), h += i + 1), m.push(n);
|
|
1299
|
+
}
|
|
1300
|
+
return v(b(m, l, p), o, i, d, f, o.xmlWhitespaceSensitivity === "strict");
|
|
1301
|
+
}, qr = [
|
|
1302
|
+
"xml",
|
|
1303
|
+
"opml",
|
|
1304
|
+
"rss",
|
|
1305
|
+
"svg"
|
|
1306
|
+
], Jr = C(Q), Yr = w(Q), Xr = T(Q), Zr = {
|
|
1307
|
+
[Jr]: {
|
|
1308
|
+
category: "Embed",
|
|
1309
|
+
type: "string",
|
|
1310
|
+
array: !0,
|
|
1311
|
+
default: [{ value: [...qr] }],
|
|
1312
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded XML language. This option requires the `@prettier/plugin-xml` plugin.",
|
|
1313
|
+
deprecated: `Please use \`${Yr}\` or \`${Xr}\`.`
|
|
1314
|
+
},
|
|
1315
|
+
[Yr]: {
|
|
1316
|
+
category: "Embed",
|
|
1317
|
+
type: "string",
|
|
1318
|
+
array: !0,
|
|
1319
|
+
default: [{ value: [D] }],
|
|
1320
|
+
description: "Block comments that make their subsequent template literals be identified as embedded XML language. This option requires the `@prettier/plugin-xml` plugin."
|
|
1321
|
+
},
|
|
1322
|
+
[Xr]: {
|
|
1323
|
+
category: "Embed",
|
|
1324
|
+
type: "string",
|
|
1325
|
+
array: !0,
|
|
1326
|
+
default: [{ value: [D] }],
|
|
1327
|
+
description: "Tags that make their subsequent template literals be identified as embedded XML language. This option requires the `@prettier/plugin-xml` plugin."
|
|
1328
|
+
},
|
|
1329
|
+
__embeddedXmlFragmentRecoverIndex: {
|
|
1330
|
+
category: "Embed",
|
|
1331
|
+
type: "int",
|
|
1332
|
+
array: !0,
|
|
1333
|
+
default: [{ value: [] }],
|
|
1334
|
+
description: "This option is read only and is used internally as a workaround to support xml fragments"
|
|
1335
|
+
}
|
|
2846
1336
|
};
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
}
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
}
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
)
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
})
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
}
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
}
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
1337
|
+
//#endregion
|
|
1338
|
+
//#region src/embedded/xml/parser.ts
|
|
1339
|
+
function Qr(e, t) {
|
|
1340
|
+
if (t && Number.isFinite(t.line) && Number.isFinite(t.column)) return e.split("\n").slice(0, t.line - 1).reduce((e, t) => e + t.length + 1, 0) + t.column - 1;
|
|
1341
|
+
}
|
|
1342
|
+
async function $(e, t, n) {
|
|
1343
|
+
try {
|
|
1344
|
+
return await n.parse(e, t);
|
|
1345
|
+
} catch (r) {
|
|
1346
|
+
if (!(r instanceof Error)) throw r;
|
|
1347
|
+
let { loc: i } = r, a = Qr(e, i?.start), o = Qr(e, i?.end), s = t, c = (...e) => s.__embeddedXmlFragmentRecoverIndex?.splice(0, s.__embeddedXmlFragmentRecoverIndex.length, ...e), l = "Expecting token of type --> OPEN <-- but found --> ";
|
|
1348
|
+
if (r.message.startsWith(`${l}'' <--`)) {
|
|
1349
|
+
let r = await n.parse(`${e}<prettier-embed-fragment />`, t);
|
|
1350
|
+
return r.children ? delete r.children.element : r.element = null, r.location = {
|
|
1351
|
+
...r.location,
|
|
1352
|
+
endOffset: e.length - 1
|
|
1353
|
+
}, r;
|
|
1354
|
+
}
|
|
1355
|
+
if (a !== void 0 && a > 0 && (r.message.startsWith("Expecting token of type --> EOF <--") || r.message.startsWith("Redundant input, expecting EOF but found: "))) return c(a), $(e.slice(0, a), t, n);
|
|
1356
|
+
if (a !== void 0 && o !== void 0 && r.message.startsWith(l)) return c(a, o), $("", t, n);
|
|
1357
|
+
throw r;
|
|
1358
|
+
}
|
|
1359
|
+
}
|
|
1360
|
+
function $r(e) {
|
|
1361
|
+
if (typeof e == "object" && e && "parsers" in e) return e.parsers?.xml;
|
|
1362
|
+
}
|
|
1363
|
+
function ei(e) {
|
|
1364
|
+
let t = $r(typeof e == "object" && e && "default" in e ? e.default : e);
|
|
1365
|
+
if (!t) throw Error("The XML plugin must provide the \"xml\" parser.");
|
|
1366
|
+
return t;
|
|
1367
|
+
}
|
|
1368
|
+
async function ti(e, t = () => import("@prettier/plugin-xml"), a = import.meta.url) {
|
|
1369
|
+
try {
|
|
1370
|
+
return ei(await t());
|
|
1371
|
+
} catch (t) {
|
|
1372
|
+
for (let t of [a, e ? r.resolve(e) : `${process.cwd()}/package.json`]) try {
|
|
1373
|
+
let e = n(t).resolve("@prettier/plugin-xml");
|
|
1374
|
+
return ei(await import(i(e).href));
|
|
1375
|
+
} catch {}
|
|
1376
|
+
throw Error("Formatting embedded XML requires the consumer to install and load \"@prettier/plugin-xml\".", { cause: t });
|
|
1377
|
+
}
|
|
1378
|
+
}
|
|
1379
|
+
async function ni(e, t, n = ti) {
|
|
1380
|
+
for (let n = (t.plugins?.length ?? 0) - 1; n >= 0; n--) {
|
|
1381
|
+
let r = $r(t.plugins[n]);
|
|
1382
|
+
if (r) return $(e, t, r);
|
|
1383
|
+
}
|
|
1384
|
+
return $(e, t, await n(t.filepath));
|
|
1385
|
+
}
|
|
1386
|
+
var ri = {
|
|
1387
|
+
parse: ni,
|
|
1388
|
+
astFormat: "xml",
|
|
1389
|
+
locStart(e) {
|
|
1390
|
+
return e.location?.startOffset ?? 0;
|
|
1391
|
+
},
|
|
1392
|
+
locEnd(e) {
|
|
1393
|
+
return e.location?.endOffset ?? NaN;
|
|
1394
|
+
}
|
|
1395
|
+
}, ii = /* @__PURE__ */ p({
|
|
1396
|
+
embedder: () => Kr,
|
|
1397
|
+
language: () => Q,
|
|
1398
|
+
loadXmlParser: () => ti,
|
|
1399
|
+
options: () => Zr,
|
|
1400
|
+
parseWithXmlPlugin: () => $,
|
|
1401
|
+
parseXml: () => ni,
|
|
1402
|
+
parser: () => ri
|
|
1403
|
+
}), ai = async (e, t, n, r, { commentOrTag: i, embeddedOverrideOptions: a }) => {
|
|
1404
|
+
let o = {
|
|
1405
|
+
...r,
|
|
1406
|
+
...a
|
|
1407
|
+
}, { node: s } = n, { createPlaceholder: c, placeholderRegex: l } = S(), { trimmedText: u, leadingWhitespaces: d, trailingWhitespaces: f } = _(s, c), p = d.slice(d.lastIndexOf("\n") + 1), m = y(n, t);
|
|
1408
|
+
return v(b(await e(p ? u.replace(RegExp(`(\\r?\\n)${fe(p)}`, "g"), "$1") : u, {
|
|
1409
|
+
...o,
|
|
1410
|
+
parser: "yaml"
|
|
1411
|
+
}), l, m), o, i, d, f);
|
|
1412
|
+
}, oi = "embeddedYaml", si = ["yaml", "yml"], ci = C(oi), li = w(oi), ui = T(oi), di = {
|
|
1413
|
+
[ci]: {
|
|
1414
|
+
category: "Embed",
|
|
1415
|
+
type: "string",
|
|
1416
|
+
array: !0,
|
|
1417
|
+
default: [{ value: [...si] }],
|
|
1418
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded YAML language.",
|
|
1419
|
+
deprecated: `Please use \`${li}\` or \`${ui}\`.`
|
|
1420
|
+
},
|
|
1421
|
+
[li]: {
|
|
1422
|
+
category: "Embed",
|
|
1423
|
+
type: "string",
|
|
1424
|
+
array: !0,
|
|
1425
|
+
default: [{ value: [D] }],
|
|
1426
|
+
description: "Block comments that make their subsequent template literals be identified as embedded YAML language."
|
|
1427
|
+
},
|
|
1428
|
+
[ui]: {
|
|
1429
|
+
category: "Embed",
|
|
1430
|
+
type: "string",
|
|
1431
|
+
array: !0,
|
|
1432
|
+
default: [{ value: [D] }],
|
|
1433
|
+
description: "Tags that make their subsequent template literals be identified as embedded YAML language."
|
|
1434
|
+
}
|
|
1435
|
+
}, fi = /* @__PURE__ */ p({
|
|
1436
|
+
embedder: () => ai,
|
|
1437
|
+
language: () => oi,
|
|
1438
|
+
options: () => di
|
|
1439
|
+
}), pi = [], mi = {}, hi = {}, gi = {}, _i = /* #__PURE__ */ Object.assign({
|
|
1440
|
+
"./css/index.ts": Se,
|
|
1441
|
+
"./es/index.ts": je,
|
|
1442
|
+
"./glsl/index.ts": Re,
|
|
1443
|
+
"./graphql/index.ts": Ge,
|
|
1444
|
+
"./html/index.ts": tt,
|
|
1445
|
+
"./ini/index.ts": ct,
|
|
1446
|
+
"./java/index.ts": ht,
|
|
1447
|
+
"./json/index.ts": Tt,
|
|
1448
|
+
"./jsonata/index.ts": Mt,
|
|
1449
|
+
"./latex/index.ts": zt,
|
|
1450
|
+
"./markdown/index.ts": cn,
|
|
1451
|
+
"./nginx/index.ts": hn,
|
|
1452
|
+
"./noop/index.ts": bn,
|
|
1453
|
+
"./pegjs/index.ts": Dn,
|
|
1454
|
+
"./php/index.ts": Pn,
|
|
1455
|
+
"./prisma/index.ts": Vn,
|
|
1456
|
+
"./properties/index.ts": Jn,
|
|
1457
|
+
"./pug/index.ts": tr,
|
|
1458
|
+
"./ruby/index.ts": ur,
|
|
1459
|
+
"./sh/index.ts": _r,
|
|
1460
|
+
"./sql/index.ts": Or,
|
|
1461
|
+
"./toml/index.ts": Fr,
|
|
1462
|
+
"./ts/index.ts": Wr,
|
|
1463
|
+
"./xml/index.ts": ii,
|
|
1464
|
+
"./yaml/index.ts": fi
|
|
1465
|
+
});
|
|
1466
|
+
for (let { language: e, parser: t, embedder: n, options: r } of Object.values(_i)) de(pi, e, V), t && (mi[e] = t), n && (hi[e] = n), Object.assign(gi, r);
|
|
1467
|
+
//#endregion
|
|
1468
|
+
//#region src/options.ts
|
|
1469
|
+
var vi = "noEmbeddedIdentificationByComment", yi = "noEmbeddedIdentificationByTag", bi = "preserveEmbeddedExteriorWhitespaces", xi = "noEmbeddedMultiLineIndentation", Si = "embeddedOverrides", Ci = {
|
|
1470
|
+
...gi,
|
|
1471
|
+
[vi]: {
|
|
1472
|
+
category: "Embed",
|
|
1473
|
+
type: "string",
|
|
1474
|
+
array: !0,
|
|
1475
|
+
default: [{ value: [] }],
|
|
1476
|
+
description: "Turns off `` /* comment */ `...` `` comment-based embedded language identification for the specified identifiers.",
|
|
1477
|
+
deprecated: "Please use `embedded<Language>Comments` or `embedded<Language>Tags` to configure each embedded language, and you won't need this option anymore."
|
|
1478
|
+
},
|
|
1479
|
+
[yi]: {
|
|
1480
|
+
category: "Embed",
|
|
1481
|
+
type: "string",
|
|
1482
|
+
array: !0,
|
|
1483
|
+
default: [{ value: [] }],
|
|
1484
|
+
description: "Turns off `` tag`...` `` tag-based embedded language identification for the specified identifiers.",
|
|
1485
|
+
deprecated: "Please use `embedded<Language>Comments` or `embedded<Language>Tags` to configure each embedded language, and you won't need this option anymore."
|
|
1486
|
+
},
|
|
1487
|
+
[bi]: {
|
|
1488
|
+
category: "Embed",
|
|
1489
|
+
type: "string",
|
|
1490
|
+
array: !0,
|
|
1491
|
+
default: [{ value: [] }],
|
|
1492
|
+
description: "Preserves leading and trailing whitespaces in the formatting results for the specified comments or tags."
|
|
1493
|
+
},
|
|
1494
|
+
[xi]: {
|
|
1495
|
+
category: "Embed",
|
|
1496
|
+
type: "string",
|
|
1497
|
+
array: !0,
|
|
1498
|
+
default: [{ value: [] }],
|
|
1499
|
+
description: "Turns off auto indentation in the formatting results for the specified comments or tags when they are formatted to span multi lines."
|
|
1500
|
+
},
|
|
1501
|
+
[Si]: {
|
|
1502
|
+
category: "Embed",
|
|
1503
|
+
type: "string",
|
|
1504
|
+
array: !1,
|
|
1505
|
+
default: void 0,
|
|
1506
|
+
description: "Option overrides for the specified comments or tags. It should either be a stringified JSON or an absolute filepath to the option overrides file."
|
|
1507
|
+
}
|
|
1508
|
+
}, wi = {
|
|
1509
|
+
...a.parsers,
|
|
1510
|
+
...o.parsers,
|
|
1511
|
+
...s.parsers,
|
|
1512
|
+
...l.parsers,
|
|
1513
|
+
...c.parsers,
|
|
1514
|
+
...mi
|
|
1515
|
+
}, Ti = /("(?:\\?[^])*?")|(\/\/.*)|(\/\*[^]*?\*\/)/g, Ei = /("(?:\\?[^])*?")|(,\s*)(?=]|})/g, Di = { parse: (e) => {
|
|
1516
|
+
e = String(e);
|
|
1517
|
+
try {
|
|
1518
|
+
return JSON.parse(e);
|
|
1519
|
+
} catch {
|
|
1520
|
+
return JSON.parse(e.replace(Ti, "$1").replace(Ei, "$1"));
|
|
1521
|
+
}
|
|
1522
|
+
} }, { label: Oi } = e;
|
|
1523
|
+
async function ki(e) {
|
|
1524
|
+
try {
|
|
1525
|
+
let { readFile: t } = await import("node:fs/promises"), n = await t(e, { encoding: "utf-8" });
|
|
1526
|
+
return Di.parse(n);
|
|
1527
|
+
} catch {}
|
|
1528
|
+
}
|
|
1529
|
+
var Ai = /* @__PURE__ */ new URL("./import-module-worker.js", import.meta.url);
|
|
1530
|
+
async function ji(e) {
|
|
1531
|
+
let { Worker: t } = await import("node:worker_threads");
|
|
1532
|
+
return new Promise((n) => {
|
|
1533
|
+
let r = new t(Ai, { workerData: { absolutePath: e } });
|
|
1534
|
+
r.once("message", (e) => {
|
|
1535
|
+
r.terminate(), e.error && console.error(e.error), n(e.overrides);
|
|
1536
|
+
}), r.once("error", (e) => {
|
|
1537
|
+
console.error(e), n(void 0);
|
|
1538
|
+
}), r.once("exit", () => {
|
|
1539
|
+
n(void 0);
|
|
1540
|
+
});
|
|
1541
|
+
});
|
|
1542
|
+
}
|
|
1543
|
+
async function Mi(e, t) {
|
|
1544
|
+
let { isAbsolute: n, dirname: r, resolve: i } = await import("node:path");
|
|
1545
|
+
if (n(e)) return e;
|
|
1546
|
+
let a = await d(t);
|
|
1547
|
+
return i(typeof a == "string" ? r(a) : process.env.PWD ?? process.cwd(), e);
|
|
1548
|
+
}
|
|
1549
|
+
var Ni = async (e, t) => {
|
|
1550
|
+
let n;
|
|
1551
|
+
try {
|
|
1552
|
+
n = (await import("node:path")).extname(e);
|
|
1553
|
+
} catch {
|
|
1554
|
+
try {
|
|
1555
|
+
return Di.parse(e);
|
|
1556
|
+
} catch {
|
|
1557
|
+
console.error("Failed to parse embeddedOverrides as a json object");
|
|
1558
|
+
return;
|
|
1559
|
+
}
|
|
1560
|
+
}
|
|
1561
|
+
let r = Mi(e, t);
|
|
1562
|
+
if (n === ".json" || n === ".jsonc") {
|
|
1563
|
+
let e = await r, t = await ki(e);
|
|
1564
|
+
if (t !== void 0) return t;
|
|
1565
|
+
console.error(`Failed to parse the json file: ${e}`);
|
|
1566
|
+
} else if (n === ".mjs" || n === ".cjs" || n === ".js") {
|
|
1567
|
+
let e = await r, t = await ji(e);
|
|
1568
|
+
if (t !== void 0) return t;
|
|
1569
|
+
console.error(`Failed to parse the js module file: ${e}`);
|
|
1570
|
+
} else if (n === ".mts" || n === ".cts" || n === ".ts") {
|
|
1571
|
+
let e = await r, t = await ji(e);
|
|
1572
|
+
if (t !== void 0) return t;
|
|
1573
|
+
console.error(`Failed to parse the ts module file: ${e}`);
|
|
1574
|
+
} else {
|
|
1575
|
+
if (n === "") {
|
|
1576
|
+
let e = await ki(await r);
|
|
1577
|
+
if (e !== void 0) return e;
|
|
1578
|
+
}
|
|
1579
|
+
try {
|
|
1580
|
+
return Di.parse(e);
|
|
1581
|
+
} catch {
|
|
1582
|
+
console.error("Failed to parse embeddedOverrides as a json object");
|
|
1583
|
+
}
|
|
1584
|
+
}
|
|
1585
|
+
}, Pi = /* @__PURE__ */ new WeakMap();
|
|
1586
|
+
async function Fi(e, { commentOrTag: t, kind: n }) {
|
|
1587
|
+
if (e.embeddedOverrides === void 0) return;
|
|
1588
|
+
let r = Pi.get(e);
|
|
1589
|
+
r === void 0 && (r = Ni(e.embeddedOverrides, e.filepath), Pi.set(e, r));
|
|
1590
|
+
let i = await r;
|
|
1591
|
+
if (i !== void 0) for (let { [`${n}s`]: e, identifiers: r, options: a } of i) {
|
|
1592
|
+
let n = e ?? [];
|
|
1593
|
+
if (n.length === 0 && r?.includes(t) || n.includes(t)) return a;
|
|
1594
|
+
}
|
|
1595
|
+
}
|
|
1596
|
+
function* Ii(e) {
|
|
1597
|
+
yield e, e.type === "CallExpression" && (yield* Ii(e.callee));
|
|
1598
|
+
}
|
|
1599
|
+
function Li(e) {
|
|
1600
|
+
if (e.type === "Identifier") return e.name;
|
|
1601
|
+
if (e.type === "ThisExpression") return "this";
|
|
1602
|
+
if (e.type === "MemberExpression") {
|
|
1603
|
+
let t = Li(e.object);
|
|
1604
|
+
if (t === void 0) return;
|
|
1605
|
+
let n = "optional" in e && e.optional;
|
|
1606
|
+
return !e.computed && e.property.type === "Identifier" ? `${t}${n ? "?." : "."}${e.property.name}` : e.property.type === "Literal" ? `${t}${n ? "?." : ""}[${JSON.stringify(e.property.value)}]` : e.property.type === "Identifier" ? `${t}${n ? "?." : ""}[${e.property.name}]` : void 0;
|
|
1607
|
+
}
|
|
1608
|
+
if (e.type === "CallExpression") {
|
|
1609
|
+
let t = Li(e.callee);
|
|
1610
|
+
return t === void 0 ? void 0 : `${t}()`;
|
|
1611
|
+
}
|
|
1612
|
+
if (e.type === "ChainExpression") return Li(e.expression);
|
|
1613
|
+
}
|
|
1614
|
+
function Ri(e, t) {
|
|
1615
|
+
let n = /^\/(.*)\/([dgimsuvy]*)$/.exec(t);
|
|
1616
|
+
if (!n) return !1;
|
|
1617
|
+
try {
|
|
1618
|
+
let t = Li(e);
|
|
1619
|
+
return t !== void 0 && new RegExp(n[1], n[2]).test(t);
|
|
1620
|
+
} catch {
|
|
1621
|
+
return !1;
|
|
1622
|
+
}
|
|
1623
|
+
}
|
|
1624
|
+
var zi = (() => {
|
|
1625
|
+
let e = /* @__PURE__ */ new Set([
|
|
1626
|
+
"start",
|
|
1627
|
+
"end",
|
|
1628
|
+
"loc",
|
|
1629
|
+
"range",
|
|
1630
|
+
"filename",
|
|
1631
|
+
"typeAnnotation",
|
|
1632
|
+
"decorators"
|
|
1633
|
+
]);
|
|
1634
|
+
return (t, n, r) => {
|
|
1635
|
+
if (/^\/.*\/[dgimsuvy]*$/.test(n)) return Ri(t, n);
|
|
1636
|
+
let i;
|
|
1637
|
+
try {
|
|
1638
|
+
let e = r(`${n}\`\``);
|
|
1639
|
+
if (e instanceof Promise) throw TypeError("Async parse function hasn't been supported yet.");
|
|
1640
|
+
i = e;
|
|
1641
|
+
} catch {
|
|
1642
|
+
return !1;
|
|
1643
|
+
}
|
|
1644
|
+
if (i.type === "File" && (i = i.program), i.type !== "Program" || i.body[0]?.type !== "ExpressionStatement") return !1;
|
|
1645
|
+
let a = i.body[0]?.expression;
|
|
1646
|
+
if (a?.type !== "TaggedTemplateExpression") return !1;
|
|
1647
|
+
for (let n of Ii(t)) if (qi(n, a.tag, e)) return !0;
|
|
1648
|
+
return !1;
|
|
1649
|
+
};
|
|
3031
1650
|
})();
|
|
3032
|
-
function
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
}
|
|
3053
|
-
function
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
}
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
}
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
}
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
}
|
|
3155
|
-
if (l)
|
|
3156
|
-
return we(
|
|
3157
|
-
n,
|
|
3158
|
-
s,
|
|
3159
|
-
i,
|
|
3160
|
-
"comment",
|
|
3161
|
-
e
|
|
3162
|
-
);
|
|
3163
|
-
}
|
|
3164
|
-
return Ue?.(t, e) ?? null;
|
|
3165
|
-
}
|
|
3166
|
-
const r = ol(t);
|
|
3167
|
-
if (typeof r == "string") {
|
|
3168
|
-
const o = Ei(e, r);
|
|
3169
|
-
for (const s of _e) {
|
|
3170
|
-
let l = !1;
|
|
3171
|
-
for (const p of o(s))
|
|
3172
|
-
if (r === p) {
|
|
3173
|
-
l = !0;
|
|
3174
|
-
break;
|
|
3175
|
-
}
|
|
3176
|
-
if (l)
|
|
3177
|
-
return we(n, s, r, "tag", e);
|
|
3178
|
-
}
|
|
3179
|
-
return Ue?.(t, e) ?? null;
|
|
3180
|
-
}
|
|
3181
|
-
if (r !== void 0) {
|
|
3182
|
-
const o = (l) => zo[e.parser].parse(
|
|
3183
|
-
l,
|
|
3184
|
-
e
|
|
3185
|
-
), s = Ei(e);
|
|
3186
|
-
for (const l of _e) {
|
|
3187
|
-
let p;
|
|
3188
|
-
for (const f of s(l))
|
|
3189
|
-
if (rl(r, f, o)) {
|
|
3190
|
-
p = f;
|
|
3191
|
-
break;
|
|
3192
|
-
}
|
|
3193
|
-
if (p !== void 0)
|
|
3194
|
-
return we(
|
|
3195
|
-
n,
|
|
3196
|
-
l,
|
|
3197
|
-
p,
|
|
3198
|
-
"tag",
|
|
3199
|
-
e
|
|
3200
|
-
);
|
|
3201
|
-
}
|
|
3202
|
-
}
|
|
3203
|
-
return Ue?.(t, e) ?? null;
|
|
3204
|
-
}, _l = {
|
|
3205
|
-
estree: {
|
|
3206
|
-
...Ni,
|
|
3207
|
-
embed: cl
|
|
3208
|
-
}
|
|
3209
|
-
};
|
|
3210
|
-
export {
|
|
3211
|
-
bl as options,
|
|
3212
|
-
zo as parsers,
|
|
3213
|
-
_l as printers
|
|
3214
|
-
};
|
|
1651
|
+
function Bi({ node: e, parent: t }) {
|
|
1652
|
+
let n = e.comments ?? t?.comments;
|
|
1653
|
+
if (!n) return;
|
|
1654
|
+
let r = n[n.length - 1];
|
|
1655
|
+
if (![
|
|
1656
|
+
"MultiLine",
|
|
1657
|
+
"Block",
|
|
1658
|
+
"CommentBlock"
|
|
1659
|
+
].includes(r.type) || !r.leading) return;
|
|
1660
|
+
let i = r.value;
|
|
1661
|
+
if (i.length > 1 && i.startsWith(" ") && i.endsWith(" ")) return i.slice(1, -1);
|
|
1662
|
+
}
|
|
1663
|
+
function Vi({ parent: e }) {
|
|
1664
|
+
if (e?.type === "TaggedTemplateExpression") return e.tag.type === "Identifier" ? e.tag.name : e.tag;
|
|
1665
|
+
}
|
|
1666
|
+
function Hi(e, t) {
|
|
1667
|
+
return e.noEmbeddedIdentificationByComment?.includes(t) ?? !1 ? function* (e) {} : function* (t) {
|
|
1668
|
+
let n = e[w(t)] ?? ["9ff2b366e8ca4c97b9aed1a29b5b94ed"];
|
|
1669
|
+
n[0] === "9ff2b366e8ca4c97b9aed1a29b5b94ed" ? yield* e[C(t)] ?? [] : yield* n;
|
|
1670
|
+
};
|
|
1671
|
+
}
|
|
1672
|
+
function Ui(e, t) {
|
|
1673
|
+
return typeof t == "string" ? e.noEmbeddedIdentificationByTag?.includes(t) ?? !1 ? function* (e) {} : function* (t) {
|
|
1674
|
+
let n = e[T(t)] ?? ["9ff2b366e8ca4c97b9aed1a29b5b94ed"];
|
|
1675
|
+
n[0] === "9ff2b366e8ca4c97b9aed1a29b5b94ed" ? yield* e[C(t)] ?? [] : yield* n;
|
|
1676
|
+
} : function* (t) {
|
|
1677
|
+
let n = e[T(t)] ?? ["9ff2b366e8ca4c97b9aed1a29b5b94ed"];
|
|
1678
|
+
if (n[0] === "9ff2b366e8ca4c97b9aed1a29b5b94ed") {
|
|
1679
|
+
let { noEmbeddedIdentificationByTag: n } = e;
|
|
1680
|
+
for (let r of e[C(t)] ?? []) n?.includes(r) || (yield r);
|
|
1681
|
+
} else yield* n;
|
|
1682
|
+
};
|
|
1683
|
+
}
|
|
1684
|
+
function Wi(e, t, n, r, i) {
|
|
1685
|
+
let a = hi[t];
|
|
1686
|
+
if (!a) return null;
|
|
1687
|
+
if (e.quasis.length === 1 && e.quasis[0]?.value.raw.trim() === "") return "``";
|
|
1688
|
+
let o = Fi(i, {
|
|
1689
|
+
commentOrTag: n,
|
|
1690
|
+
kind: r
|
|
1691
|
+
});
|
|
1692
|
+
return async (...e) => {
|
|
1693
|
+
try {
|
|
1694
|
+
let t = await a(...e, {
|
|
1695
|
+
commentOrTag: n,
|
|
1696
|
+
kind: r,
|
|
1697
|
+
embeddedOverrideOptions: await o
|
|
1698
|
+
});
|
|
1699
|
+
return Oi({
|
|
1700
|
+
embed: !0,
|
|
1701
|
+
...t.label
|
|
1702
|
+
}, t);
|
|
1703
|
+
} catch (e) {
|
|
1704
|
+
throw console.error(e), e;
|
|
1705
|
+
}
|
|
1706
|
+
};
|
|
1707
|
+
}
|
|
1708
|
+
function Gi(e, t, n) {
|
|
1709
|
+
return Object.is(e, t) ? !0 : e === null || t === null ? !1 : Array.isArray(e) ? Ki(e, t, n) : typeof e == "object" && qi(e, t, n);
|
|
1710
|
+
}
|
|
1711
|
+
function Ki(e, t, n) {
|
|
1712
|
+
let r = e.length;
|
|
1713
|
+
if (r !== t.length) return !1;
|
|
1714
|
+
for (let i = 0; i < r; i++) if (!Gi(e[i], t[i], n)) return !1;
|
|
1715
|
+
return !0;
|
|
1716
|
+
}
|
|
1717
|
+
function qi(e, t, n) {
|
|
1718
|
+
for (let r of Object.keys(e)) if (!n?.has(r) && !(Object.hasOwn(t, r) && Gi(e[r], t[r], n))) return !1;
|
|
1719
|
+
return !0;
|
|
1720
|
+
}
|
|
1721
|
+
//#endregion
|
|
1722
|
+
//#region src/printers.ts
|
|
1723
|
+
var { estree: Ji } = u, { embed: Yi } = Ji, Xi = (e, t) => {
|
|
1724
|
+
let { node: n } = e;
|
|
1725
|
+
if (n.type !== "TemplateLiteral" || n.quasis.some(({ value: { cooked: e } }) => e === null)) return null;
|
|
1726
|
+
let r = Bi(e);
|
|
1727
|
+
if (typeof r == "string") {
|
|
1728
|
+
let i = Hi(t, r);
|
|
1729
|
+
for (let e of pi) {
|
|
1730
|
+
let a = !1;
|
|
1731
|
+
for (let t of i(e)) if (r === t) {
|
|
1732
|
+
a = !0;
|
|
1733
|
+
break;
|
|
1734
|
+
}
|
|
1735
|
+
if (a) return Wi(n, e, r, "comment", t);
|
|
1736
|
+
}
|
|
1737
|
+
return Yi?.(e, t) ?? null;
|
|
1738
|
+
}
|
|
1739
|
+
let i = Vi(e);
|
|
1740
|
+
if (typeof i == "string") {
|
|
1741
|
+
let r = Ui(t, i);
|
|
1742
|
+
for (let e of pi) {
|
|
1743
|
+
let a;
|
|
1744
|
+
for (let t of r(e)) if (i === t || Ri({
|
|
1745
|
+
type: "Identifier",
|
|
1746
|
+
name: i
|
|
1747
|
+
}, t)) {
|
|
1748
|
+
a = t;
|
|
1749
|
+
break;
|
|
1750
|
+
}
|
|
1751
|
+
if (a !== void 0) return Wi(n, e, a, "tag", t);
|
|
1752
|
+
}
|
|
1753
|
+
return Yi?.(e, t) ?? null;
|
|
1754
|
+
}
|
|
1755
|
+
if (i !== void 0) {
|
|
1756
|
+
let e = (e) => wi[t.parser].parse(e, t), r = Ui(t);
|
|
1757
|
+
for (let a of pi) {
|
|
1758
|
+
let o;
|
|
1759
|
+
for (let t of r(a)) if (zi(i, t, e)) {
|
|
1760
|
+
o = t;
|
|
1761
|
+
break;
|
|
1762
|
+
}
|
|
1763
|
+
if (o !== void 0) return Wi(n, a, o, "tag", t);
|
|
1764
|
+
}
|
|
1765
|
+
}
|
|
1766
|
+
return Yi?.(e, t) ?? null;
|
|
1767
|
+
}, Zi = { estree: {
|
|
1768
|
+
...Ji,
|
|
1769
|
+
embed: Xi
|
|
1770
|
+
} };
|
|
1771
|
+
//#endregion
|
|
1772
|
+
export { Ci as options, wi as parsers, Zi as printers };
|