eddyter 1.3.63 → 1.3.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +24 -24
- package/README.md +493 -493
- package/dist/ImageResizer-CbtUYHip.js +199 -0
- package/dist/api/auth.d.ts +4 -2
- package/dist/assets/style.css +1 -1
- package/dist/{babel-B9hn44Wo.js → babel-CCPWkrf4.js} +1302 -726
- package/dist/components/LockedFeature/LockedFeature.d.ts +23 -0
- package/dist/components/LockedFeature/index.d.ts +2 -0
- package/dist/components/UnifiedColorPicker/UnifiedColorPicker.d.ts +14 -0
- package/dist/components/VideoView/index.d.ts +13 -0
- package/dist/constants.d.ts +3 -1
- package/dist/editorConfig.d.ts +2 -3
- package/dist/{estree-CocPn_Md.js → estree-CxUPh9wa.js} +917 -529
- package/dist/{html-CxCicOef.js → html-CmniStvG.js} +589 -350
- package/dist/{html2pdf.bundle-Bc2h6DHT.js → html2pdf.bundle-C1B1lr_T.js} +3796 -2777
- package/dist/{html2pdf.bundle.min-BvakEXhX.js → html2pdf.bundle.min-kPviTsNx.js} +5223 -3407
- package/dist/index-BL8HWCRw.js +816 -0
- package/dist/index-BpsoOKOs.js +274 -0
- package/dist/{index-C2a6-XFM.js → index-DHKx5grA.js} +4 -4
- package/dist/{index-DoJIKSPF.js → index-FZVNbwSO.js} +12356 -11290
- package/dist/index.js +3 -3
- package/dist/{markdown-BUjgWFLu.js → markdown-B0mEGGfQ.js} +1015 -578
- package/dist/nodes/UploadingVideoNode.d.ts +30 -0
- package/dist/nodes/VideoNode.d.ts +47 -0
- package/dist/plugins/CustomHorizontalRulePlugin/HorizontalRuleCustomizationDialog.d.ts +2 -1
- package/dist/plugins/FloatingTextFormatToolbarPlugin/index.d.ts +1 -1
- package/dist/plugins/VideoPlugin.d.ts +17 -0
- package/dist/{postcss-CGIcwj_g.js → postcss-B0bxXf7u.js} +1065 -615
- package/dist/{standalone-C0qguT38.js → standalone-DmuJV5rn.js} +596 -350
- package/dist/types.d.ts +4 -6
- package/dist/{typescript-BM7wk6k-.js → typescript-DZlC_9M8.js} +1805 -1113
- package/dist/ui/Icons.d.ts +2 -1
- package/dist/utils/uploadManager.d.ts +17 -0
- package/package.json +151 -151
- package/dist/index-B0VTEqfr.js +0 -985
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
var es = Object.defineProperty, Xr = (e) => {
|
|
2
2
|
throw TypeError(e);
|
|
3
3
|
}, Zt = (e, t) => {
|
|
4
|
-
for (var n in t)
|
|
4
|
+
for (var n in t)
|
|
5
|
+
es(e, n, { get: t[n], enumerable: !0 });
|
|
5
6
|
}, $r = (e, t, n) => t.has(e) || Xr("Cannot " + n), Je = (e, t, n) => ($r(e, t, "read from private field"), t.get(e)), ts = (e, t, n) => t.has(e) ? Xr("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), ns = (e, t, n, r) => ($r(e, t, "write to private field"), t.set(e, n), n), Rr = {};
|
|
6
7
|
Zt(Rr, { languages: () => AD, options: () => ED, printers: () => FD });
|
|
7
8
|
var rs = [{ name: "JavaScript", type: "programming", extensions: [".js", "._js", ".bones", ".cjs", ".es", ".es6", ".gs", ".jake", ".javascript", ".jsb", ".jscad", ".jsfl", ".jslib", ".jsm", ".jspre", ".jss", ".mjs", ".njs", ".pac", ".sjs", ".ssjs", ".xsjs", ".xsjslib", ".start.frag", ".end.frag", ".wxs"], tmScope: "source.js", aceMode: "javascript", aliases: ["js", "node"], codemirrorMode: "javascript", codemirrorMimeType: "text/javascript", interpreters: ["chakra", "d8", "gjs", "js", "node", "nodejs", "qjs", "rhino", "v8", "v8-shell", "zx"], filenames: ["Jakefile", "start.frag", "end.frag"], parsers: ["babel", "acorn", "espree", "meriyah", "babel-flow", "babel-ts", "flow", "typescript"], vscodeLanguageIds: ["javascript", "mongo"], linguistLanguageId: 183 }, { name: "Flow", type: "programming", extensions: [".js.flow"], tmScope: "source.js", aceMode: "javascript", aliases: [], codemirrorMode: "javascript", codemirrorMimeType: "text/javascript", interpreters: ["chakra", "d8", "gjs", "js", "node", "nodejs", "qjs", "rhino", "v8", "v8-shell"], filenames: [], parsers: ["flow", "babel-flow"], vscodeLanguageIds: ["javascript"], linguistLanguageId: 183 }, { name: "JSX", type: "programming", extensions: [".jsx"], tmScope: "source.js.jsx", aceMode: "javascript", aliases: void 0, codemirrorMode: "jsx", codemirrorMimeType: "text/jsx", interpreters: void 0, filenames: void 0, parsers: ["babel", "babel-flow", "babel-ts", "flow", "typescript", "espree", "meriyah"], vscodeLanguageIds: ["javascriptreact"], group: "JavaScript", linguistLanguageId: 183 }, { name: "TypeScript", type: "programming", extensions: [".ts", ".cts", ".mts"], tmScope: "source.ts", aceMode: "typescript", aliases: ["ts"], codemirrorMode: "javascript", codemirrorMimeType: "application/typescript", interpreters: ["bun", "deno", "ts-node", "tsx"], parsers: ["typescript", "babel-ts"], vscodeLanguageIds: ["typescript"], linguistLanguageId: 378 }, { name: "TSX", type: "programming", extensions: [".tsx"], tmScope: "source.tsx", aceMode: "javascript", codemirrorMode: "jsx", codemirrorMimeType: "text/jsx", group: "TypeScript", parsers: ["typescript", "babel-ts"], vscodeLanguageIds: ["typescriptreact"], linguistLanguageId: 94901924 }], Wr = {};
|
|
8
9
|
Zt(Wr, { canAttachComment: () => di, embed: () => tp, experimentalFeatures: () => iD, getCommentChildNodes: () => mi, getVisitorKeys: () => Hr, handleComments: () => mu, insertPragma: () => mp, isBlockComment: () => ye, isGap: () => fi, massageAstNode: () => co, print: () => oD, printComment: () => No, willPrintOwnComments: () => vu });
|
|
9
10
|
var us = (e, t, n, r) => {
|
|
10
|
-
if (!(e && t == null))
|
|
11
|
+
if (!(e && t == null))
|
|
12
|
+
return t.replaceAll ? t.replaceAll(n, r) : n.global ? t.replace(n, r) : t.split(n).join(r);
|
|
11
13
|
}, H = us, as = (e, t, n) => {
|
|
12
|
-
if (!(e && t == null))
|
|
14
|
+
if (!(e && t == null))
|
|
15
|
+
return Array.isArray(t) || typeof t == "string" ? t[n < 0 ? t.length + n : n] : t.at(n);
|
|
13
16
|
}, X = as;
|
|
14
17
|
function ss(e) {
|
|
15
18
|
return e !== null && typeof e == "object";
|
|
@@ -19,19 +22,25 @@ function* is(e, t) {
|
|
|
19
22
|
let { getVisitorKeys: n, filter: r = () => !0 } = t, u = (a) => os(a) && r(a);
|
|
20
23
|
for (let a of n(e)) {
|
|
21
24
|
let s = e[a];
|
|
22
|
-
if (Array.isArray(s))
|
|
23
|
-
|
|
25
|
+
if (Array.isArray(s))
|
|
26
|
+
for (let o of s)
|
|
27
|
+
u(o) && (yield o);
|
|
28
|
+
else
|
|
29
|
+
u(s) && (yield s);
|
|
24
30
|
}
|
|
25
31
|
}
|
|
26
32
|
function* ps(e, t) {
|
|
27
33
|
let n = [e];
|
|
28
34
|
for (let r = 0; r < n.length; r++) {
|
|
29
35
|
let u = n[r];
|
|
30
|
-
for (let a of is(u, t))
|
|
36
|
+
for (let a of is(u, t))
|
|
37
|
+
yield a, n.push(a);
|
|
31
38
|
}
|
|
32
39
|
}
|
|
33
40
|
function ls(e, { getVisitorKeys: t, predicate: n }) {
|
|
34
|
-
for (let r of ps(e, { getVisitorKeys: t }))
|
|
41
|
+
for (let r of ps(e, { getVisitorKeys: t }))
|
|
42
|
+
if (n(r))
|
|
43
|
+
return !0;
|
|
35
44
|
return !1;
|
|
36
45
|
}
|
|
37
46
|
var cs = () => /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
|
|
@@ -43,8 +52,10 @@ function ys(e) {
|
|
|
43
52
|
}
|
|
44
53
|
var ds = (e) => !(Ds(e) || ys(e)), ms = /[^\x20-\x7F]/u;
|
|
45
54
|
function fs(e) {
|
|
46
|
-
if (!e)
|
|
47
|
-
|
|
55
|
+
if (!e)
|
|
56
|
+
return 0;
|
|
57
|
+
if (!ms.test(e))
|
|
58
|
+
return e.length;
|
|
48
59
|
e = e.replace(cs(), " ");
|
|
49
60
|
let t = 0;
|
|
50
61
|
for (let n of e) {
|
|
@@ -57,13 +68,16 @@ var lt = fs;
|
|
|
57
68
|
function Jn(e) {
|
|
58
69
|
return (t, n, r) => {
|
|
59
70
|
let u = !!(r != null && r.backwards);
|
|
60
|
-
if (n === !1)
|
|
71
|
+
if (n === !1)
|
|
72
|
+
return !1;
|
|
61
73
|
let { length: a } = t, s = n;
|
|
62
74
|
for (; s >= 0 && s < a; ) {
|
|
63
75
|
let o = t.charAt(s);
|
|
64
76
|
if (e instanceof RegExp) {
|
|
65
|
-
if (!e.test(o))
|
|
66
|
-
|
|
77
|
+
if (!e.test(o))
|
|
78
|
+
return s;
|
|
79
|
+
} else if (!e.includes(o))
|
|
80
|
+
return s;
|
|
67
81
|
u ? s-- : s++;
|
|
68
82
|
}
|
|
69
83
|
return s === -1 || s === a ? s : !1;
|
|
@@ -72,18 +86,23 @@ function Jn(e) {
|
|
|
72
86
|
var ct = Jn(" "), Es = Jn(",; "), Fs = Jn(/[^\n\r]/u);
|
|
73
87
|
function As(e, t, n) {
|
|
74
88
|
let r = !!(n != null && n.backwards);
|
|
75
|
-
if (t === !1)
|
|
89
|
+
if (t === !1)
|
|
90
|
+
return !1;
|
|
76
91
|
let u = e.charAt(t);
|
|
77
92
|
if (r) {
|
|
78
93
|
if (e.charAt(t - 1) === "\r" && u === `
|
|
79
|
-
`)
|
|
94
|
+
`)
|
|
95
|
+
return t - 2;
|
|
80
96
|
if (u === `
|
|
81
|
-
` || u === "\r" || u === "\u2028" || u === "\u2029")
|
|
97
|
+
` || u === "\r" || u === "\u2028" || u === "\u2029")
|
|
98
|
+
return t - 1;
|
|
82
99
|
} else {
|
|
83
100
|
if (u === "\r" && e.charAt(t + 1) === `
|
|
84
|
-
`)
|
|
101
|
+
`)
|
|
102
|
+
return t + 2;
|
|
85
103
|
if (u === `
|
|
86
|
-
` || u === "\r" || u === "\u2028" || u === "\u2029")
|
|
104
|
+
` || u === "\r" || u === "\u2028" || u === "\u2029")
|
|
105
|
+
return t + 1;
|
|
87
106
|
}
|
|
88
107
|
return t;
|
|
89
108
|
}
|
|
@@ -94,9 +113,12 @@ function gs(e, t, n = {}) {
|
|
|
94
113
|
}
|
|
95
114
|
var pe = gs;
|
|
96
115
|
function xs(e, t) {
|
|
97
|
-
if (t === !1)
|
|
116
|
+
if (t === !1)
|
|
117
|
+
return !1;
|
|
98
118
|
if (e.charAt(t) === "/" && e.charAt(t + 1) === "*") {
|
|
99
|
-
for (let n = t + 2; n < e.length; ++n)
|
|
119
|
+
for (let n = t + 2; n < e.length; ++n)
|
|
120
|
+
if (e.charAt(n) === "*" && e.charAt(n + 1) === "/")
|
|
121
|
+
return n + 2;
|
|
100
122
|
}
|
|
101
123
|
return t;
|
|
102
124
|
}
|
|
@@ -107,7 +129,8 @@ function hs(e, t) {
|
|
|
107
129
|
var _n = hs;
|
|
108
130
|
function Cs(e, t) {
|
|
109
131
|
let n = null, r = t;
|
|
110
|
-
for (; r !== n; )
|
|
132
|
+
for (; r !== n; )
|
|
133
|
+
n = r, r = Es(e, r), r = qn(e, r), r = ct(e, r);
|
|
111
134
|
return r = _n(e, r), r = Dt(e, r), r !== !1 && pe(e, r);
|
|
112
135
|
}
|
|
113
136
|
var Xn = Cs;
|
|
@@ -118,7 +141,8 @@ var J = Ts, Ur = new Proxy(() => {
|
|
|
118
141
|
}, { get: () => Ur }), $n = Ur, qt = "'", mr = '"';
|
|
119
142
|
function Ss(e, t) {
|
|
120
143
|
let n = t === !0 || t === qt ? qt : mr, r = n === qt ? mr : qt, u = 0, a = 0;
|
|
121
|
-
for (let s of e)
|
|
144
|
+
for (let s of e)
|
|
145
|
+
s === n ? u++ : s === r && a++;
|
|
122
146
|
return u > a ? r : n;
|
|
123
147
|
}
|
|
124
148
|
var Gr = Ss;
|
|
@@ -162,7 +186,8 @@ function bt(e) {
|
|
|
162
186
|
return Ct = bt.prototype = e ?? /* @__PURE__ */ Object.create(null), new bt();
|
|
163
187
|
}
|
|
164
188
|
var ws = 10;
|
|
165
|
-
for (let e = 0; e <= ws; e++)
|
|
189
|
+
for (let e = 0; e <= ws; e++)
|
|
190
|
+
bt();
|
|
166
191
|
function Is(e) {
|
|
167
192
|
return bt(e);
|
|
168
193
|
}
|
|
@@ -170,7 +195,8 @@ function Ns(e, t = "type") {
|
|
|
170
195
|
Is(e);
|
|
171
196
|
function n(r) {
|
|
172
197
|
let u = r[t], a = e[u];
|
|
173
|
-
if (!Array.isArray(a))
|
|
198
|
+
if (!Array.isArray(a))
|
|
199
|
+
throw Object.assign(new Error(`Missing visitor keys for '${u}'.`), { node: r });
|
|
174
200
|
return a;
|
|
175
201
|
}
|
|
176
202
|
return n;
|
|
@@ -190,8 +216,10 @@ function Xs(e, t) {
|
|
|
190
216
|
let n = t.split(".");
|
|
191
217
|
for (let r = n.length - 1; r >= 0; r--) {
|
|
192
218
|
let u = n[r];
|
|
193
|
-
if (r === 0)
|
|
194
|
-
|
|
219
|
+
if (r === 0)
|
|
220
|
+
return e.type === "Identifier" && e.name === u;
|
|
221
|
+
if (e.type !== "MemberExpression" || e.optional || e.computed || e.property.type !== "Identifier" || e.property.name !== u)
|
|
222
|
+
return !1;
|
|
195
223
|
e = e.object;
|
|
196
224
|
}
|
|
197
225
|
}
|
|
@@ -213,14 +241,22 @@ function Us(e) {
|
|
|
213
241
|
return e.expressions ? e.expressions[0] : e.left ?? e.test ?? e.callee ?? e.object ?? e.tag ?? e.argument ?? e.expression;
|
|
214
242
|
}
|
|
215
243
|
function Yr(e) {
|
|
216
|
-
if (e.expressions)
|
|
217
|
-
|
|
218
|
-
if (e.
|
|
219
|
-
|
|
220
|
-
if (e.
|
|
221
|
-
|
|
222
|
-
if (e.
|
|
223
|
-
|
|
244
|
+
if (e.expressions)
|
|
245
|
+
return ["expressions", 0];
|
|
246
|
+
if (e.left)
|
|
247
|
+
return ["left"];
|
|
248
|
+
if (e.test)
|
|
249
|
+
return ["test"];
|
|
250
|
+
if (e.object)
|
|
251
|
+
return ["object"];
|
|
252
|
+
if (e.callee)
|
|
253
|
+
return ["callee"];
|
|
254
|
+
if (e.tag)
|
|
255
|
+
return ["tag"];
|
|
256
|
+
if (e.argument)
|
|
257
|
+
return ["argument"];
|
|
258
|
+
if (e.expression)
|
|
259
|
+
return ["expression"];
|
|
224
260
|
throw new Error("Unexpected node has no left side.");
|
|
225
261
|
}
|
|
226
262
|
var Gs = _(["ExportDefaultDeclaration", "DeclareExportDeclaration", "ExportNamedDeclaration", "ExportAllDeclaration", "DeclareExportAllDeclaration"]), Q = _(["ArrayExpression"]), Ae = _(["ObjectExpression"]);
|
|
@@ -275,12 +311,16 @@ function to(e) {
|
|
|
275
311
|
return Rs(e, eo);
|
|
276
312
|
}
|
|
277
313
|
function nn(e, t) {
|
|
278
|
-
if (e?.type !== "CallExpression" || e.optional)
|
|
314
|
+
if (e?.type !== "CallExpression" || e.optional)
|
|
315
|
+
return !1;
|
|
279
316
|
let n = de(e);
|
|
280
317
|
if (n.length === 1) {
|
|
281
|
-
if (ln(e) && nn(t))
|
|
282
|
-
|
|
283
|
-
|
|
318
|
+
if (ln(e) && nn(t))
|
|
319
|
+
return kt(n[0]);
|
|
320
|
+
if (Zs(e.callee))
|
|
321
|
+
return ln(n[0]);
|
|
322
|
+
} else if ((n.length === 2 || n.length === 3) && (n[0].type === "TemplateLiteral" || Y(n[0])) && to(e.callee))
|
|
323
|
+
return n[2] && !be(n[2]) ? !1 : (n.length === 2 ? kt(n[1]) : zs(n[1]) && Z(n[1]).length <= 1) || ln(n[1]);
|
|
284
324
|
return !1;
|
|
285
325
|
}
|
|
286
326
|
var nu = (e) => (t) => (t?.type === "ChainExpression" && (t = t.expression), e(t)), L = nu(_(["CallExpression", "OptionalCallExpression"])), R = nu(_(["MemberExpression", "OptionalMemberExpression"]));
|
|
@@ -291,16 +331,19 @@ function ru(e, t) {
|
|
|
291
331
|
let n = 0;
|
|
292
332
|
for (let r in e) {
|
|
293
333
|
let u = e[r];
|
|
294
|
-
if (u && typeof u == "object" && typeof u.type == "string" && (n++, n += ru(u, t - n)), n > t)
|
|
334
|
+
if (u && typeof u == "object" && typeof u.type == "string" && (n++, n += ru(u, t - n)), n > t)
|
|
335
|
+
return n;
|
|
295
336
|
}
|
|
296
337
|
return n;
|
|
297
338
|
}
|
|
298
339
|
var no = 0.25;
|
|
299
340
|
function Gn(e, t) {
|
|
300
341
|
let { printWidth: n } = t;
|
|
301
|
-
if (h(e))
|
|
342
|
+
if (h(e))
|
|
343
|
+
return !1;
|
|
302
344
|
let r = n * no;
|
|
303
|
-
if (e.type === "ThisExpression" || e.type === "Identifier" && e.name.length <= r || Zr(e) && !h(e.argument))
|
|
345
|
+
if (e.type === "ThisExpression" || e.type === "Identifier" && e.name.length <= r || Zr(e) && !h(e.argument))
|
|
346
|
+
return !0;
|
|
304
347
|
let u = e.type === "Literal" && "regex" in e && e.regex.pattern || e.type === "RegExpLiteral" && e.pattern;
|
|
305
348
|
return u ? u.length <= r : Y(e) ? yt(se(e), t).length <= r : e.type === "TemplateLiteral" ? e.expressions.length === 0 && e.quasis[0].value.raw.length <= r && !e.quasis[0].value.raw.includes(`
|
|
306
349
|
`) : e.type === "UnaryExpression" ? Gn(e.argument, { printWidth: n }) : e.type === "CallExpression" && e.arguments.length === 0 && e.callee.type === "Identifier" ? e.callee.name.length <= r - 2 : Wn(e);
|
|
@@ -316,18 +359,24 @@ function uu(e, t) {
|
|
|
316
359
|
return (e.type === "TemplateLiteral" && Er(e) || e.type === "TaggedTemplateExpression" && Er(e.quasi)) && !pe(t, q(e), { backwards: !0 });
|
|
317
360
|
}
|
|
318
361
|
function au(e) {
|
|
319
|
-
if (!h(e))
|
|
362
|
+
if (!h(e))
|
|
363
|
+
return !1;
|
|
320
364
|
let t = X(!1, Ke(e, T.Dangling), -1);
|
|
321
365
|
return t && !ye(t);
|
|
322
366
|
}
|
|
323
367
|
function ro(e) {
|
|
324
|
-
if (e.length <= 1)
|
|
368
|
+
if (e.length <= 1)
|
|
369
|
+
return !1;
|
|
325
370
|
let t = 0;
|
|
326
|
-
for (let n of e)
|
|
327
|
-
if (
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
371
|
+
for (let n of e)
|
|
372
|
+
if (kt(n)) {
|
|
373
|
+
if (t += 1, t > 1)
|
|
374
|
+
return !0;
|
|
375
|
+
} else if (L(n)) {
|
|
376
|
+
for (let r of de(n))
|
|
377
|
+
if (kt(r))
|
|
378
|
+
return !0;
|
|
379
|
+
}
|
|
331
380
|
return !1;
|
|
332
381
|
}
|
|
333
382
|
function su(e) {
|
|
@@ -336,15 +385,22 @@ function su(e) {
|
|
|
336
385
|
}
|
|
337
386
|
var uo = /* @__PURE__ */ new Set(["!", "-", "+", "~"]);
|
|
338
387
|
function Ee(e, t = 2) {
|
|
339
|
-
if (t <= 0)
|
|
340
|
-
|
|
388
|
+
if (t <= 0)
|
|
389
|
+
return !1;
|
|
390
|
+
if (e.type === "ChainExpression" || e.type === "TSNonNullExpression")
|
|
391
|
+
return Ee(e.expression, t);
|
|
341
392
|
let n = (r) => Ee(r, t - 1);
|
|
342
|
-
if (eu(e))
|
|
343
|
-
|
|
344
|
-
if (e
|
|
393
|
+
if (eu(e))
|
|
394
|
+
return lt(e.pattern ?? e.regex.pattern) <= 5;
|
|
395
|
+
if (Wn(e) || Hs(e) || e.type === "ArgumentPlaceholder")
|
|
396
|
+
return !0;
|
|
397
|
+
if (e.type === "TemplateLiteral")
|
|
398
|
+
return e.quasis.every((r) => !r.value.raw.includes(`
|
|
345
399
|
`)) && e.expressions.every(n);
|
|
346
|
-
if (Ae(e))
|
|
347
|
-
|
|
400
|
+
if (Ae(e))
|
|
401
|
+
return e.properties.every((r) => !r.computed && (r.shorthand || r.value && n(r.value)));
|
|
402
|
+
if (Q(e))
|
|
403
|
+
return e.elements.every((r) => r === null || n(r));
|
|
348
404
|
if (dt(e)) {
|
|
349
405
|
if (e.type === "ImportExpression" || Ee(e.callee, t)) {
|
|
350
406
|
let r = de(e);
|
|
@@ -408,13 +464,15 @@ function oo(e) {
|
|
|
408
464
|
}
|
|
409
465
|
function io(e) {
|
|
410
466
|
var t;
|
|
411
|
-
if (e.rest)
|
|
467
|
+
if (e.rest)
|
|
468
|
+
return !0;
|
|
412
469
|
let n = Z(e);
|
|
413
470
|
return ((t = X(!1, n, -1)) == null ? void 0 : t.type) === "RestElement";
|
|
414
471
|
}
|
|
415
472
|
var cn = /* @__PURE__ */ new WeakMap();
|
|
416
473
|
function Z(e) {
|
|
417
|
-
if (cn.has(e))
|
|
474
|
+
if (cn.has(e))
|
|
475
|
+
return cn.get(e);
|
|
418
476
|
let t = [];
|
|
419
477
|
return e.this && t.push(e.this), Array.isArray(e.parameters) ? t.push(...e.parameters) : Array.isArray(e.params) && t.push(...e.params), e.rest && t.push(e.rest), cn.set(e, t), t;
|
|
420
478
|
}
|
|
@@ -424,24 +482,30 @@ function po(e, t) {
|
|
|
424
482
|
}
|
|
425
483
|
var Dn = /* @__PURE__ */ new WeakMap();
|
|
426
484
|
function de(e) {
|
|
427
|
-
if (Dn.has(e))
|
|
428
|
-
|
|
485
|
+
if (Dn.has(e))
|
|
486
|
+
return Dn.get(e);
|
|
487
|
+
if (e.type === "ChainExpression")
|
|
488
|
+
return de(e.expression);
|
|
429
489
|
let t = e.arguments;
|
|
430
490
|
return (e.type === "ImportExpression" || e.type === "TSImportType") && (t = [e.type === "ImportExpression" ? e.source : e.argument], e.options && t.push(e.options)), Dn.set(e, t), t;
|
|
431
491
|
}
|
|
432
492
|
function Kt(e, t) {
|
|
433
493
|
let { node: n } = e;
|
|
434
|
-
if (n.type === "ChainExpression")
|
|
494
|
+
if (n.type === "ChainExpression")
|
|
495
|
+
return e.call(() => Kt(e, t), "expression");
|
|
435
496
|
n.type === "ImportExpression" || n.type === "TSImportType" ? (e.call((r) => t(r, 0), n.type === "ImportExpression" ? "source" : "argument"), n.options && e.call((r) => t(r, 1), "options")) : e.each(t, "arguments");
|
|
436
497
|
}
|
|
437
498
|
function Ar(e, t) {
|
|
438
499
|
let n = [];
|
|
439
500
|
if (e.type === "ChainExpression" && (e = e.expression, n.push("expression")), e.type === "ImportExpression" || e.type === "TSImportType") {
|
|
440
|
-
if (t === 0 || t === (e.options ? -2 : -1))
|
|
441
|
-
|
|
501
|
+
if (t === 0 || t === (e.options ? -2 : -1))
|
|
502
|
+
return [...n, e.type === "ImportExpression" ? "source" : "argument"];
|
|
503
|
+
if (e.options && (t === 1 || t === -1))
|
|
504
|
+
return [...n, "options"];
|
|
442
505
|
throw new RangeError("Invalid argument index");
|
|
443
506
|
}
|
|
444
|
-
if (t < 0 && (t = e.arguments.length + t), t < 0 || t >= e.arguments.length)
|
|
507
|
+
if (t < 0 && (t = e.arguments.length + t), t < 0 || t >= e.arguments.length)
|
|
508
|
+
throw new RangeError("Invalid argument index");
|
|
445
509
|
return [...n, "arguments", t];
|
|
446
510
|
}
|
|
447
511
|
function Ht(e) {
|
|
@@ -451,15 +515,18 @@ function rn(e) {
|
|
|
451
515
|
return e?.prettierIgnore || h(e, T.PrettierIgnore);
|
|
452
516
|
}
|
|
453
517
|
var T = { Leading: 2, Trailing: 4, Dangling: 8, Block: 16, Line: 32, PrettierIgnore: 64, First: 128, Last: 256 }, ou = (e, t) => {
|
|
454
|
-
if (typeof e == "function" && (t = e, e = 0), e || t)
|
|
518
|
+
if (typeof e == "function" && (t = e, e = 0), e || t)
|
|
519
|
+
return (n, r, u) => !(e & T.Leading && !n.leading || e & T.Trailing && !n.trailing || e & T.Dangling && (n.leading || n.trailing) || e & T.Block && !ye(n) || e & T.Line && !Nt(n) || e & T.First && r !== 0 || e & T.Last && r !== u.length - 1 || e & T.PrettierIgnore && !Ht(n) || t && !t(n));
|
|
455
520
|
};
|
|
456
521
|
function h(e, t, n) {
|
|
457
|
-
if (!J(e?.comments))
|
|
522
|
+
if (!J(e?.comments))
|
|
523
|
+
return !1;
|
|
458
524
|
let r = ou(t, n);
|
|
459
525
|
return r ? e.comments.some(r) : !0;
|
|
460
526
|
}
|
|
461
527
|
function Ke(e, t, n) {
|
|
462
|
-
if (!Array.isArray(e?.comments))
|
|
528
|
+
if (!Array.isArray(e?.comments))
|
|
529
|
+
return [];
|
|
463
530
|
let r = ou(t, n);
|
|
464
531
|
return r ? e.comments.filter(r) : e.comments;
|
|
465
532
|
}
|
|
@@ -471,48 +538,60 @@ function je(e) {
|
|
|
471
538
|
return e && (e.type === "ObjectProperty" || e.type === "Property" && !tn(e));
|
|
472
539
|
}
|
|
473
540
|
var Ce = _(["TSAsExpression", "TSSatisfiesExpression", "AsExpression", "AsConstExpression", "SatisfiesExpression"]), $e = _(["TSUnionType", "UnionTypeAnnotation"]), Kn = _(["TSIntersectionType", "IntersectionTypeAnnotation"]), Re = _(["TSConditionalType", "ConditionalTypeAnnotation"]), lo = /* @__PURE__ */ new Set(["range", "raw", "comments", "leadingComments", "trailingComments", "innerComments", "extra", "start", "end", "loc", "flags", "errors", "tokens"]), ot = (e) => {
|
|
474
|
-
for (let t of e.quasis)
|
|
541
|
+
for (let t of e.quasis)
|
|
542
|
+
delete t.value;
|
|
475
543
|
};
|
|
476
544
|
function iu(e, t) {
|
|
477
545
|
var n;
|
|
478
|
-
if (e.type === "Program" && delete t.sourceType, (e.type === "BigIntLiteral" || e.type === "BigIntLiteralTypeAnnotation") && e.value && (t.value = e.value.toLowerCase()), (e.type === "BigIntLiteral" || e.type === "Literal") && e.bigint && (t.bigint = e.bigint.toLowerCase()), e.type === "EmptyStatement" || e.type === "JSXText" || e.type === "JSXExpressionContainer" && (e.expression.type === "Literal" || e.expression.type === "StringLiteral") && e.expression.value === " ")
|
|
546
|
+
if (e.type === "Program" && delete t.sourceType, (e.type === "BigIntLiteral" || e.type === "BigIntLiteralTypeAnnotation") && e.value && (t.value = e.value.toLowerCase()), (e.type === "BigIntLiteral" || e.type === "Literal") && e.bigint && (t.bigint = e.bigint.toLowerCase()), e.type === "EmptyStatement" || e.type === "JSXText" || e.type === "JSXExpressionContainer" && (e.expression.type === "Literal" || e.expression.type === "StringLiteral") && e.expression.value === " ")
|
|
547
|
+
return null;
|
|
479
548
|
if ((e.type === "Property" || e.type === "ObjectProperty" || e.type === "MethodDefinition" || e.type === "ClassProperty" || e.type === "ClassMethod" || e.type === "PropertyDefinition" || e.type === "TSDeclareMethod" || e.type === "TSPropertySignature" || e.type === "ObjectTypeProperty" || e.type === "ImportAttribute") && e.key && !e.computed) {
|
|
480
549
|
let { key: u } = e;
|
|
481
550
|
Y(u) || be(u) ? t.key = String(u.value) : u.type === "Identifier" && (t.key = u.name);
|
|
482
551
|
}
|
|
483
|
-
if (e.type === "JSXElement" && e.openingElement.name.name === "style" && e.openingElement.attributes.some((u) => u.type === "JSXAttribute" && u.name.name === "jsx"))
|
|
552
|
+
if (e.type === "JSXElement" && e.openingElement.name.name === "style" && e.openingElement.attributes.some((u) => u.type === "JSXAttribute" && u.name.name === "jsx"))
|
|
553
|
+
for (let { type: u, expression: a } of t.children)
|
|
554
|
+
u === "JSXExpressionContainer" && a.type === "TemplateLiteral" && ot(a);
|
|
484
555
|
e.type === "JSXAttribute" && e.name.name === "css" && e.value.type === "JSXExpressionContainer" && e.value.expression.type === "TemplateLiteral" && ot(t.value.expression), e.type === "JSXAttribute" && ((n = e.value) == null ? void 0 : n.type) === "Literal" && /["']|"|'/u.test(e.value.value) && (t.value.value = H(!1, e.value.value, /["']|"|'/gu, '"'));
|
|
485
556
|
let r = e.expression || e.callee;
|
|
486
557
|
if (e.type === "Decorator" && r.type === "CallExpression" && r.callee.name === "Component" && r.arguments.length === 1) {
|
|
487
558
|
let u = e.expression.arguments[0].properties;
|
|
488
|
-
for (let [a, s] of t.expression.arguments[0].properties.entries())
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
559
|
+
for (let [a, s] of t.expression.arguments[0].properties.entries())
|
|
560
|
+
switch (u[a].key.name) {
|
|
561
|
+
case "styles":
|
|
562
|
+
Q(s.value) && ot(s.value.elements[0]);
|
|
563
|
+
break;
|
|
564
|
+
case "template":
|
|
565
|
+
s.value.type === "TemplateLiteral" && ot(s.value);
|
|
566
|
+
break;
|
|
567
|
+
}
|
|
496
568
|
}
|
|
497
569
|
e.type === "TaggedTemplateExpression" && (e.tag.type === "MemberExpression" || e.tag.type === "Identifier" && (e.tag.name === "gql" || e.tag.name === "graphql" || e.tag.name === "css" || e.tag.name === "md" || e.tag.name === "markdown" || e.tag.name === "html") || e.tag.type === "CallExpression") && ot(t.quasi), e.type === "TemplateLiteral" && ot(t), e.type === "ChainExpression" && e.expression.type === "TSNonNullExpression" && (t.type = "TSNonNullExpression", t.expression.type = "ChainExpression");
|
|
498
570
|
}
|
|
499
571
|
iu.ignoredProperties = lo;
|
|
500
572
|
var co = iu, Qe = "string", Pe = "array", ft = "cursor", Ye = "indent", Ze = "align", et = "trim", De = "group", We = "fill", Se = "if-break", tt = "indent-if-break", nt = "line-suffix", Ue = "line-suffix-boundary", ie = "line", Le = "label", Me = "break-parent", pu = /* @__PURE__ */ new Set([ft, Ye, Ze, et, De, We, Se, tt, nt, Ue, ie, Le, Me]);
|
|
501
573
|
function Do(e) {
|
|
502
|
-
if (typeof e == "string")
|
|
503
|
-
|
|
504
|
-
if (
|
|
574
|
+
if (typeof e == "string")
|
|
575
|
+
return Qe;
|
|
576
|
+
if (Array.isArray(e))
|
|
577
|
+
return Pe;
|
|
578
|
+
if (!e)
|
|
579
|
+
return;
|
|
505
580
|
let { type: t } = e;
|
|
506
|
-
if (pu.has(t))
|
|
581
|
+
if (pu.has(t))
|
|
582
|
+
return t;
|
|
507
583
|
}
|
|
508
584
|
var Ge = Do, yo = (e) => new Intl.ListFormat("en-US", { type: "disjunction" }).format(e);
|
|
509
585
|
function mo(e) {
|
|
510
586
|
let t = e === null ? "null" : typeof e;
|
|
511
|
-
if (t !== "string" && t !== "object")
|
|
587
|
+
if (t !== "string" && t !== "object")
|
|
588
|
+
return `Unexpected doc '${t}',
|
|
512
589
|
Expected it to be 'string' or 'object'.`;
|
|
513
|
-
if (Ge(e))
|
|
590
|
+
if (Ge(e))
|
|
591
|
+
throw new Error("doc is valid.");
|
|
514
592
|
let n = Object.prototype.toString.call(e);
|
|
515
|
-
if (n !== "[object Object]")
|
|
593
|
+
if (n !== "[object Object]")
|
|
594
|
+
return `Unexpected doc '${n}'.`;
|
|
516
595
|
let r = yo([...pu].map((u) => `'${u}'`));
|
|
517
596
|
return `Unexpected doc.type '${e.type}'.
|
|
518
597
|
Expected it to be ${r}.`;
|
|
@@ -533,47 +612,55 @@ function Eo(e, t, n, r) {
|
|
|
533
612
|
}
|
|
534
613
|
n && u.push(a, gr);
|
|
535
614
|
let s = Ge(a);
|
|
536
|
-
if (!s)
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
615
|
+
if (!s)
|
|
616
|
+
throw new Pt(a);
|
|
617
|
+
if (t?.(a) !== !1)
|
|
618
|
+
switch (s) {
|
|
619
|
+
case Pe:
|
|
620
|
+
case We: {
|
|
621
|
+
let o = s === Pe ? a : a.parts;
|
|
622
|
+
for (let i = o.length, l = i - 1; l >= 0; --l)
|
|
623
|
+
u.push(o[l]);
|
|
624
|
+
break;
|
|
625
|
+
}
|
|
626
|
+
case Se:
|
|
627
|
+
u.push(a.flatContents, a.breakContents);
|
|
628
|
+
break;
|
|
629
|
+
case De:
|
|
630
|
+
if (r && a.expandedStates)
|
|
631
|
+
for (let o = a.expandedStates.length, i = o - 1; i >= 0; --i)
|
|
632
|
+
u.push(a.expandedStates[i]);
|
|
633
|
+
else
|
|
634
|
+
u.push(a.contents);
|
|
635
|
+
break;
|
|
636
|
+
case Ze:
|
|
637
|
+
case Ye:
|
|
638
|
+
case tt:
|
|
639
|
+
case Le:
|
|
640
|
+
case nt:
|
|
641
|
+
u.push(a.contents);
|
|
642
|
+
break;
|
|
643
|
+
case Qe:
|
|
644
|
+
case ft:
|
|
645
|
+
case et:
|
|
646
|
+
case Ue:
|
|
647
|
+
case ie:
|
|
648
|
+
case Me:
|
|
649
|
+
break;
|
|
650
|
+
default:
|
|
651
|
+
throw new Pt(a);
|
|
543
652
|
}
|
|
544
|
-
case Se:
|
|
545
|
-
u.push(a.flatContents, a.breakContents);
|
|
546
|
-
break;
|
|
547
|
-
case De:
|
|
548
|
-
if (r && a.expandedStates) for (let o = a.expandedStates.length, i = o - 1; i >= 0; --i) u.push(a.expandedStates[i]);
|
|
549
|
-
else u.push(a.contents);
|
|
550
|
-
break;
|
|
551
|
-
case Ze:
|
|
552
|
-
case Ye:
|
|
553
|
-
case tt:
|
|
554
|
-
case Le:
|
|
555
|
-
case nt:
|
|
556
|
-
u.push(a.contents);
|
|
557
|
-
break;
|
|
558
|
-
case Qe:
|
|
559
|
-
case ft:
|
|
560
|
-
case et:
|
|
561
|
-
case Ue:
|
|
562
|
-
case ie:
|
|
563
|
-
case Me:
|
|
564
|
-
break;
|
|
565
|
-
default:
|
|
566
|
-
throw new Pt(a);
|
|
567
|
-
}
|
|
568
653
|
}
|
|
569
654
|
}
|
|
570
655
|
var Hn = Eo;
|
|
571
656
|
function Et(e, t) {
|
|
572
|
-
if (typeof e == "string")
|
|
657
|
+
if (typeof e == "string")
|
|
658
|
+
return t(e);
|
|
573
659
|
let n = /* @__PURE__ */ new Map();
|
|
574
660
|
return r(e);
|
|
575
661
|
function r(a) {
|
|
576
|
-
if (n.has(a))
|
|
662
|
+
if (n.has(a))
|
|
663
|
+
return n.get(a);
|
|
577
664
|
let s = u(a);
|
|
578
665
|
return n.set(a, s), s;
|
|
579
666
|
}
|
|
@@ -610,14 +697,16 @@ function Et(e, t) {
|
|
|
610
697
|
function lu(e, t, n) {
|
|
611
698
|
let r = n, u = !1;
|
|
612
699
|
function a(s) {
|
|
613
|
-
if (u)
|
|
700
|
+
if (u)
|
|
701
|
+
return !1;
|
|
614
702
|
let o = t(s);
|
|
615
703
|
o !== void 0 && (u = !0, r = o);
|
|
616
704
|
}
|
|
617
705
|
return Hn(e, a), r;
|
|
618
706
|
}
|
|
619
707
|
function Fo(e) {
|
|
620
|
-
if (e.type === De && e.break || e.type === ie && e.hard || e.type === Me)
|
|
708
|
+
if (e.type === De && e.break || e.type === ie && e.hard || e.type === Me)
|
|
709
|
+
return !0;
|
|
621
710
|
}
|
|
622
711
|
function ne(e) {
|
|
623
712
|
return lu(e, Fo, !1);
|
|
@@ -633,7 +722,8 @@ function Ao(e) {
|
|
|
633
722
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
634
723
|
function r(a) {
|
|
635
724
|
if (a.type === Me && xr(n), a.type === De) {
|
|
636
|
-
if (n.push(a), t.has(a))
|
|
725
|
+
if (n.push(a), t.has(a))
|
|
726
|
+
return !1;
|
|
637
727
|
t.add(a);
|
|
638
728
|
}
|
|
639
729
|
}
|
|
@@ -651,25 +741,31 @@ function Sn(e) {
|
|
|
651
741
|
function xo(e) {
|
|
652
742
|
switch (Ge(e)) {
|
|
653
743
|
case We:
|
|
654
|
-
if (e.parts.every((t) => t === ""))
|
|
744
|
+
if (e.parts.every((t) => t === ""))
|
|
745
|
+
return "";
|
|
655
746
|
break;
|
|
656
747
|
case De:
|
|
657
|
-
if (!e.contents && !e.id && !e.break && !e.expandedStates)
|
|
658
|
-
|
|
748
|
+
if (!e.contents && !e.id && !e.break && !e.expandedStates)
|
|
749
|
+
return "";
|
|
750
|
+
if (e.contents.type === De && e.contents.id === e.id && e.contents.break === e.break && e.contents.expandedStates === e.expandedStates)
|
|
751
|
+
return e.contents;
|
|
659
752
|
break;
|
|
660
753
|
case Ze:
|
|
661
754
|
case Ye:
|
|
662
755
|
case tt:
|
|
663
756
|
case nt:
|
|
664
|
-
if (!e.contents)
|
|
757
|
+
if (!e.contents)
|
|
758
|
+
return "";
|
|
665
759
|
break;
|
|
666
760
|
case Se:
|
|
667
|
-
if (!e.flatContents && !e.breakContents)
|
|
761
|
+
if (!e.flatContents && !e.breakContents)
|
|
762
|
+
return "";
|
|
668
763
|
break;
|
|
669
764
|
case Pe: {
|
|
670
765
|
let t = [];
|
|
671
766
|
for (let n of e) {
|
|
672
|
-
if (!n)
|
|
767
|
+
if (!n)
|
|
768
|
+
continue;
|
|
673
769
|
let [r, ...u] = Array.isArray(n) ? n : [n];
|
|
674
770
|
typeof r == "string" && typeof X(!1, t, -1) == "string" ? t[t.length - 1] += r : t.push(r), t.push(...u);
|
|
675
771
|
}
|
|
@@ -696,7 +792,8 @@ function He(e, t = du) {
|
|
|
696
792
|
`)) : n);
|
|
697
793
|
}
|
|
698
794
|
function ho(e) {
|
|
699
|
-
if (e.type === ie)
|
|
795
|
+
if (e.type === ie)
|
|
796
|
+
return !0;
|
|
700
797
|
}
|
|
701
798
|
function Co(e) {
|
|
702
799
|
return lu(e, ho, !1);
|
|
@@ -709,7 +806,8 @@ function To(e) {
|
|
|
709
806
|
return Hn(e, (n) => {
|
|
710
807
|
switch (Ge(n)) {
|
|
711
808
|
case Qe:
|
|
712
|
-
if (n === "")
|
|
809
|
+
if (n === "")
|
|
810
|
+
break;
|
|
713
811
|
case et:
|
|
714
812
|
case Ue:
|
|
715
813
|
case ie:
|
|
@@ -753,13 +851,15 @@ function hr(e) {
|
|
|
753
851
|
var we = { type: Ue }, ve = { type: Me }, yu = { type: ie, hard: !0 }, vo = { type: ie, hard: !0, literal: !0 }, C = { type: ie }, E = { type: ie, soft: !0 }, F = [yu, ve], du = [vo, ve], Xt = { type: ft };
|
|
754
852
|
function N(e, t) {
|
|
755
853
|
let n = [];
|
|
756
|
-
for (let r = 0; r < t.length; r++)
|
|
854
|
+
for (let r = 0; r < t.length; r++)
|
|
855
|
+
r !== 0 && n.push(e), n.push(t[r]);
|
|
757
856
|
return n;
|
|
758
857
|
}
|
|
759
858
|
function ko(e, t, n) {
|
|
760
859
|
let r = e;
|
|
761
860
|
if (t > 0) {
|
|
762
|
-
for (let u = 0; u < Math.floor(t / n); ++u)
|
|
861
|
+
for (let u = 0; u < Math.floor(t / n); ++u)
|
|
862
|
+
r = A(r);
|
|
763
863
|
r = Be(t % n, r), r = Be(Number.NEGATIVE_INFINITY, r);
|
|
764
864
|
}
|
|
765
865
|
return r;
|
|
@@ -768,7 +868,8 @@ function jt(e, t) {
|
|
|
768
868
|
return e ? { type: Le, label: e, contents: t } : t;
|
|
769
869
|
}
|
|
770
870
|
function Po(e) {
|
|
771
|
-
if (!ye(e))
|
|
871
|
+
if (!ye(e))
|
|
872
|
+
return !1;
|
|
772
873
|
let t = `*${e.value}*`.split(`
|
|
773
874
|
`);
|
|
774
875
|
return t.length > 1 && t.every((n) => n.trimStart()[0] === "*");
|
|
@@ -780,9 +881,12 @@ function wo(e) {
|
|
|
780
881
|
var Io = wo;
|
|
781
882
|
function No(e, t) {
|
|
782
883
|
let n = e.node;
|
|
783
|
-
if (Nt(n))
|
|
784
|
-
|
|
785
|
-
if (
|
|
884
|
+
if (Nt(n))
|
|
885
|
+
return t.originalText.slice(q(n), I(n)).trimEnd();
|
|
886
|
+
if (Io(n))
|
|
887
|
+
return jo(n);
|
|
888
|
+
if (ye(n))
|
|
889
|
+
return ["/*", He(n.value), "*/"];
|
|
786
890
|
throw new Error("Not a comment: " + JSON.stringify(n));
|
|
787
891
|
}
|
|
788
892
|
function jo(e) {
|
|
@@ -810,7 +914,8 @@ function W(e, t) {
|
|
|
810
914
|
}
|
|
811
915
|
function Mo(e, t) {
|
|
812
916
|
let n = null, r = t;
|
|
813
|
-
for (; r !== n; )
|
|
917
|
+
for (; r !== n; )
|
|
918
|
+
n = r, r = ct(e, r), r = qn(e, r), r = _n(e, r), r = Dt(e, r);
|
|
814
919
|
return r;
|
|
815
920
|
}
|
|
816
921
|
var Ft = Mo;
|
|
@@ -820,8 +925,10 @@ function Oo(e, t) {
|
|
|
820
925
|
}
|
|
821
926
|
var ge = Oo;
|
|
822
927
|
function Jo(e, t, n) {
|
|
823
|
-
for (let r = t; r < n; ++r)
|
|
824
|
-
|
|
928
|
+
for (let r = t; r < n; ++r)
|
|
929
|
+
if (e.charAt(r) === `
|
|
930
|
+
`)
|
|
931
|
+
return !0;
|
|
825
932
|
return !1;
|
|
826
933
|
}
|
|
827
934
|
var ce = Jo, dn = /* @__PURE__ */ new WeakMap();
|
|
@@ -849,11 +956,14 @@ function Ro({ comment: e, followingNode: t }) {
|
|
|
849
956
|
return t && fu(e) ? (ee(t, e), !0) : !1;
|
|
850
957
|
}
|
|
851
958
|
function Yn({ comment: e, precedingNode: t, enclosingNode: n, followingNode: r, text: u }) {
|
|
852
|
-
if (n?.type !== "IfStatement" || !r)
|
|
853
|
-
|
|
959
|
+
if (n?.type !== "IfStatement" || !r)
|
|
960
|
+
return !1;
|
|
961
|
+
if (ge(u, I(e)) === ")")
|
|
962
|
+
return W(t, e), !0;
|
|
854
963
|
if (t === n.consequent && r === n.alternate) {
|
|
855
964
|
let a = Ft(u, I(n.consequent));
|
|
856
|
-
if (q(e) < a || n.alternate.type === "BlockStatement")
|
|
965
|
+
if (q(e) < a || n.alternate.type === "BlockStatement")
|
|
966
|
+
return t.type === "BlockStatement" || Eu(e, u) && !ce(u, q(t), q(e)) ? (W(t, e), !0) : (le(n, e), !0);
|
|
857
967
|
}
|
|
858
968
|
return r.type === "BlockStatement" ? (rt(r, e), !0) : r.type === "IfStatement" ? (Bn(r.consequent, e), !0) : n.consequent === r ? (ee(r, e), !0) : !1;
|
|
859
969
|
}
|
|
@@ -879,11 +989,16 @@ function Go({ comment: e, precedingNode: t, enclosingNode: n }) {
|
|
|
879
989
|
var Vo = /* @__PURE__ */ new Set(["ClassDeclaration", "ClassExpression", "DeclareClass", "DeclareInterface", "InterfaceDeclaration", "TSInterfaceDeclaration"]);
|
|
880
990
|
function gu({ comment: e, precedingNode: t, enclosingNode: n, followingNode: r }) {
|
|
881
991
|
if (Vo.has(n?.type)) {
|
|
882
|
-
if (J(n.decorators) && r?.type !== "Decorator")
|
|
883
|
-
|
|
992
|
+
if (J(n.decorators) && r?.type !== "Decorator")
|
|
993
|
+
return W(X(!1, n.decorators, -1), e), !0;
|
|
994
|
+
if (n.body && r === n.body)
|
|
995
|
+
return rt(n.body, e), !0;
|
|
884
996
|
if (r) {
|
|
885
|
-
if (n.superClass && r === n.superClass && t && (t === n.id || t === n.typeParameters))
|
|
886
|
-
|
|
997
|
+
if (n.superClass && r === n.superClass && t && (t === n.id || t === n.typeParameters))
|
|
998
|
+
return W(t, e), !0;
|
|
999
|
+
for (let u of ["implements", "extends", "mixins"])
|
|
1000
|
+
if (n[u] && r === n[u][0])
|
|
1001
|
+
return t && (t === n.id || t === n.typeParameters || t === n.superClass) ? W(t, e) : le(n, e, u), !0;
|
|
887
1002
|
}
|
|
888
1003
|
}
|
|
889
1004
|
return !1;
|
|
@@ -897,7 +1012,8 @@ function zo({ comment: e, precedingNode: t, enclosingNode: n, text: r }) {
|
|
|
897
1012
|
return ge(r, I(e)) !== "(" ? !1 : t && Ho.has(n?.type) ? (W(t, e), !0) : !1;
|
|
898
1013
|
}
|
|
899
1014
|
function Qo({ comment: e, enclosingNode: t, text: n }) {
|
|
900
|
-
if (t?.type !== "ArrowFunctionExpression")
|
|
1015
|
+
if (t?.type !== "ArrowFunctionExpression")
|
|
1016
|
+
return !1;
|
|
901
1017
|
let r = Ft(n, I(e));
|
|
902
1018
|
return r !== !1 && n.slice(r, r + 2) === "=>" ? (le(t, e), !0) : !1;
|
|
903
1019
|
}
|
|
@@ -933,7 +1049,8 @@ function ri({ comment: e, enclosingNode: t }) {
|
|
|
933
1049
|
return t?.type === "ForInStatement" || t?.type === "ForOfStatement" ? (ee(t, e), !0) : !1;
|
|
934
1050
|
}
|
|
935
1051
|
function Tu({ comment: e, precedingNode: t, enclosingNode: n, text: r }) {
|
|
936
|
-
if (n?.type === "ImportSpecifier" || n?.type === "ExportSpecifier")
|
|
1052
|
+
if (n?.type === "ImportSpecifier" || n?.type === "ExportSpecifier")
|
|
1053
|
+
return ee(n, e), !0;
|
|
937
1054
|
let u = t?.type === "ImportSpecifier" && n?.type === "ImportDeclaration", a = t?.type === "ExportSpecifier" && n?.type === "ExportNamedDeclaration";
|
|
938
1055
|
return (u || a) && pe(r, I(e)) ? (W(t, e), !0) : !1;
|
|
939
1056
|
}
|
|
@@ -948,10 +1065,12 @@ function ii({ comment: e, enclosingNode: t, followingNode: n, text: r }) {
|
|
|
948
1065
|
return !n && (t?.type === "TSMethodSignature" || t?.type === "TSDeclareFunction" || t?.type === "TSAbstractMethodDefinition") && ge(r, I(e)) === ";" ? (W(t, e), !0) : !1;
|
|
949
1066
|
}
|
|
950
1067
|
function Su({ comment: e, enclosingNode: t, followingNode: n }) {
|
|
951
|
-
if (Ht(e) && t?.type === "TSMappedType" && n === t.key)
|
|
1068
|
+
if (Ht(e) && t?.type === "TSMappedType" && n === t.key)
|
|
1069
|
+
return t.prettierIgnore = !0, e.unignore = !0, !0;
|
|
952
1070
|
}
|
|
953
1071
|
function bu({ comment: e, precedingNode: t, enclosingNode: n }) {
|
|
954
|
-
if (n?.type === "TSMappedType" && !t)
|
|
1072
|
+
if (n?.type === "TSMappedType" && !t)
|
|
1073
|
+
return le(n, e), !0;
|
|
955
1074
|
}
|
|
956
1075
|
function pi({ comment: e, enclosingNode: t, followingNode: n }) {
|
|
957
1076
|
return !t || t.type !== "SwitchCase" || t.test || !n || n !== t.consequent[0] ? !1 : (n.type === "BlockStatement" && Nt(e) ? rt(n, e) : le(t, e), !0);
|
|
@@ -960,7 +1079,8 @@ function li({ comment: e, precedingNode: t, enclosingNode: n, followingNode: r }
|
|
|
960
1079
|
return $e(t) && ((n.type === "TSArrayType" || n.type === "ArrayTypeAnnotation") && !r || Kn(n)) ? (W(X(!1, t.types, -1), e), !0) : !1;
|
|
961
1080
|
}
|
|
962
1081
|
function ci({ comment: e, enclosingNode: t, precedingNode: n, followingNode: r }) {
|
|
963
|
-
if ((t?.type === "ObjectPattern" || t?.type === "ArrayPattern") && r?.type === "TSTypeAnnotation")
|
|
1082
|
+
if ((t?.type === "ObjectPattern" || t?.type === "ArrayPattern") && r?.type === "TSTypeAnnotation")
|
|
1083
|
+
return n ? W(n, e) : le(t, e), !0;
|
|
964
1084
|
}
|
|
965
1085
|
function Di({ comment: e, precedingNode: t, enclosingNode: n, followingNode: r, text: u }) {
|
|
966
1086
|
return !r && n?.type === "UnaryExpression" && (t?.type === "LogicalExpression" || t?.type === "BinaryExpression") && ce(u, q(n.argument), q(t.right)) && Eu(e, u) && !ce(u, q(t.right), q(e)) ? (W(t.right, e), !0) : !1;
|
|
@@ -971,14 +1091,16 @@ function di(e) {
|
|
|
971
1091
|
}
|
|
972
1092
|
function mi(e, t) {
|
|
973
1093
|
var n;
|
|
974
|
-
if ((t.parser === "typescript" || t.parser === "flow" || t.parser === "hermes" || t.parser === "acorn" || t.parser === "oxc" || t.parser === "oxc-ts" || t.parser === "espree" || t.parser === "meriyah" || t.parser === "__babel_estree") && e.type === "MethodDefinition" && ((n = e.value) == null ? void 0 : n.type) === "FunctionExpression" && Z(e.value).length === 0 && !e.value.returnType && !J(e.value.typeParameters) && e.value.body)
|
|
1094
|
+
if ((t.parser === "typescript" || t.parser === "flow" || t.parser === "hermes" || t.parser === "acorn" || t.parser === "oxc" || t.parser === "oxc-ts" || t.parser === "espree" || t.parser === "meriyah" || t.parser === "__babel_estree") && e.type === "MethodDefinition" && ((n = e.value) == null ? void 0 : n.type) === "FunctionExpression" && Z(e.value).length === 0 && !e.value.returnType && !J(e.value.typeParameters) && e.value.body)
|
|
1095
|
+
return [...e.decorators || [], e.key, e.value.body];
|
|
975
1096
|
}
|
|
976
1097
|
function vu(e) {
|
|
977
1098
|
let { node: t, parent: n } = e;
|
|
978
1099
|
return (K(t) || n && (n.type === "JSXSpreadAttribute" || n.type === "JSXSpreadChild" || $e(n) || (n.type === "ClassDeclaration" || n.type === "ClassExpression") && n.superClass === t)) && (!rn(t) || $e(n));
|
|
979
1100
|
}
|
|
980
1101
|
function fi(e, { parser: t }) {
|
|
981
|
-
if (t === "flow" || t === "hermes" || t === "babel-flow")
|
|
1102
|
+
if (t === "flow" || t === "hermes" || t === "babel-flow")
|
|
1103
|
+
return e = H(!1, e, /[\s(]/gu, ""), e === "" || e === "/*" || e === "/*::";
|
|
982
1104
|
}
|
|
983
1105
|
function Ei(e) {
|
|
984
1106
|
switch (e) {
|
|
@@ -992,7 +1114,7 @@ function Ei(e) {
|
|
|
992
1114
|
`;
|
|
993
1115
|
}
|
|
994
1116
|
}
|
|
995
|
-
var ae =
|
|
1117
|
+
var ae = Symbol("MODE_BREAK"), he = Symbol("MODE_FLAT"), pt = Symbol("cursor"), vn = Symbol("DOC_FILL_PRINTED_LENGTH");
|
|
996
1118
|
function ku() {
|
|
997
1119
|
return { value: "", length: 0, queue: [] };
|
|
998
1120
|
}
|
|
@@ -1004,19 +1126,20 @@ function Ai(e, t, n) {
|
|
|
1004
1126
|
}
|
|
1005
1127
|
function kn(e, t, n) {
|
|
1006
1128
|
let r = t.type === "dedent" ? e.queue.slice(0, -1) : [...e.queue, t], u = "", a = 0, s = 0, o = 0;
|
|
1007
|
-
for (let y of r)
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1129
|
+
for (let y of r)
|
|
1130
|
+
switch (y.type) {
|
|
1131
|
+
case "indent":
|
|
1132
|
+
d(), n.useTabs ? i(1) : l(n.tabWidth);
|
|
1133
|
+
break;
|
|
1134
|
+
case "stringAlign":
|
|
1135
|
+
d(), u += y.n, a += y.n.length;
|
|
1136
|
+
break;
|
|
1137
|
+
case "numberAlign":
|
|
1138
|
+
s += 1, o += y.n;
|
|
1139
|
+
break;
|
|
1140
|
+
default:
|
|
1141
|
+
throw new Error(`Unexpected type '${y.type}'`);
|
|
1142
|
+
}
|
|
1020
1143
|
return c(), { ...e, value: u, length: a, queue: r };
|
|
1021
1144
|
function i(y) {
|
|
1022
1145
|
u += " ".repeat(y), a += n.tabWidth * y;
|
|
@@ -1039,30 +1162,36 @@ function kn(e, t, n) {
|
|
|
1039
1162
|
}
|
|
1040
1163
|
function Pn(e) {
|
|
1041
1164
|
let t = 0, n = 0, r = e.length;
|
|
1042
|
-
e:
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
let
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1165
|
+
e:
|
|
1166
|
+
for (; r--; ) {
|
|
1167
|
+
let u = e[r];
|
|
1168
|
+
if (u === pt) {
|
|
1169
|
+
n++;
|
|
1170
|
+
continue;
|
|
1171
|
+
}
|
|
1172
|
+
for (let a = u.length - 1; a >= 0; a--) {
|
|
1173
|
+
let s = u[a];
|
|
1174
|
+
if (s === " " || s === " ")
|
|
1175
|
+
t++;
|
|
1176
|
+
else {
|
|
1177
|
+
e[r] = u.slice(0, a + 1);
|
|
1178
|
+
break e;
|
|
1179
|
+
}
|
|
1054
1180
|
}
|
|
1055
1181
|
}
|
|
1056
|
-
|
|
1057
|
-
|
|
1182
|
+
if (t > 0 || n > 0)
|
|
1183
|
+
for (e.length = r + 1; n-- > 0; )
|
|
1184
|
+
e.push(pt);
|
|
1058
1185
|
return t;
|
|
1059
1186
|
}
|
|
1060
1187
|
function $t(e, t, n, r, u, a) {
|
|
1061
|
-
if (n === Number.POSITIVE_INFINITY)
|
|
1188
|
+
if (n === Number.POSITIVE_INFINITY)
|
|
1189
|
+
return !0;
|
|
1062
1190
|
let s = t.length, o = [e], i = [];
|
|
1063
1191
|
for (; n >= 0; ) {
|
|
1064
1192
|
if (o.length === 0) {
|
|
1065
|
-
if (s === 0)
|
|
1193
|
+
if (s === 0)
|
|
1194
|
+
return !0;
|
|
1066
1195
|
o.push(t[--s]);
|
|
1067
1196
|
continue;
|
|
1068
1197
|
}
|
|
@@ -1074,7 +1203,8 @@ function $t(e, t, n, r, u, a) {
|
|
|
1074
1203
|
case Pe:
|
|
1075
1204
|
case We: {
|
|
1076
1205
|
let c = D === Pe ? d : d.parts, p = d[vn] ?? 0;
|
|
1077
|
-
for (let y = c.length - 1; y >= p; y--)
|
|
1206
|
+
for (let y = c.length - 1; y >= p; y--)
|
|
1207
|
+
o.push({ mode: l, doc: c[y] });
|
|
1078
1208
|
break;
|
|
1079
1209
|
}
|
|
1080
1210
|
case Ye:
|
|
@@ -1087,7 +1217,8 @@ function $t(e, t, n, r, u, a) {
|
|
|
1087
1217
|
n += Pn(i);
|
|
1088
1218
|
break;
|
|
1089
1219
|
case De: {
|
|
1090
|
-
if (a && d.break)
|
|
1220
|
+
if (a && d.break)
|
|
1221
|
+
return !1;
|
|
1091
1222
|
let c = d.break ? ae : l, p = d.expandedStates && c === ae ? X(!1, d.expandedStates, -1) : d.contents;
|
|
1092
1223
|
o.push({ mode: c, doc: p });
|
|
1093
1224
|
break;
|
|
@@ -1098,14 +1229,16 @@ function $t(e, t, n, r, u, a) {
|
|
|
1098
1229
|
break;
|
|
1099
1230
|
}
|
|
1100
1231
|
case ie:
|
|
1101
|
-
if (l === ae || d.hard)
|
|
1232
|
+
if (l === ae || d.hard)
|
|
1233
|
+
return !0;
|
|
1102
1234
|
d.soft || (i.push(" "), n--);
|
|
1103
1235
|
break;
|
|
1104
1236
|
case nt:
|
|
1105
1237
|
r = !0;
|
|
1106
1238
|
break;
|
|
1107
1239
|
case Ue:
|
|
1108
|
-
if (r)
|
|
1240
|
+
if (r)
|
|
1241
|
+
return !1;
|
|
1109
1242
|
break;
|
|
1110
1243
|
}
|
|
1111
1244
|
}
|
|
@@ -1124,10 +1257,12 @@ function Pu(e, t) {
|
|
|
1124
1257
|
break;
|
|
1125
1258
|
}
|
|
1126
1259
|
case Pe:
|
|
1127
|
-
for (let f = y.length - 1; f >= 0; f--)
|
|
1260
|
+
for (let f = y.length - 1; f >= 0; f--)
|
|
1261
|
+
s.push({ ind: c, mode: p, doc: y[f] });
|
|
1128
1262
|
break;
|
|
1129
1263
|
case ft:
|
|
1130
|
-
if (d >= 2)
|
|
1264
|
+
if (d >= 2)
|
|
1265
|
+
throw new Error("There are too many 'cursor' in doc.");
|
|
1131
1266
|
o.push(pt), d++;
|
|
1132
1267
|
break;
|
|
1133
1268
|
case Ye:
|
|
@@ -1149,23 +1284,27 @@ function Pu(e, t) {
|
|
|
1149
1284
|
case ae: {
|
|
1150
1285
|
i = !1;
|
|
1151
1286
|
let f = { ind: c, mode: he, doc: y.contents }, g = r - a, S = l.length > 0;
|
|
1152
|
-
if (!y.break && $t(f, s, g, S, n))
|
|
1287
|
+
if (!y.break && $t(f, s, g, S, n))
|
|
1288
|
+
s.push(f);
|
|
1153
1289
|
else if (y.expandedStates) {
|
|
1154
1290
|
let b = X(!1, y.expandedStates, -1);
|
|
1155
1291
|
if (y.break) {
|
|
1156
1292
|
s.push({ ind: c, mode: ae, doc: b });
|
|
1157
1293
|
break;
|
|
1158
|
-
} else
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1294
|
+
} else
|
|
1295
|
+
for (let x = 1; x < y.expandedStates.length + 1; x++)
|
|
1296
|
+
if (x >= y.expandedStates.length) {
|
|
1297
|
+
s.push({ ind: c, mode: ae, doc: b });
|
|
1298
|
+
break;
|
|
1299
|
+
} else {
|
|
1300
|
+
let j = y.expandedStates[x], v = { ind: c, mode: he, doc: j };
|
|
1301
|
+
if ($t(v, s, g, S, n)) {
|
|
1302
|
+
s.push(v);
|
|
1303
|
+
break;
|
|
1304
|
+
}
|
|
1305
|
+
}
|
|
1306
|
+
} else
|
|
1307
|
+
s.push({ ind: c, mode: ae, doc: y.contents });
|
|
1169
1308
|
break;
|
|
1170
1309
|
}
|
|
1171
1310
|
}
|
|
@@ -1173,7 +1312,8 @@ function Pu(e, t) {
|
|
|
1173
1312
|
break;
|
|
1174
1313
|
case We: {
|
|
1175
1314
|
let f = r - a, g = y[vn] ?? 0, { parts: S } = y, b = S.length - g;
|
|
1176
|
-
if (b === 0)
|
|
1315
|
+
if (b === 0)
|
|
1316
|
+
break;
|
|
1177
1317
|
let x = S[g + 0], j = S[g + 1], v = { ind: c, mode: he, doc: x }, B = { ind: c, mode: ae, doc: x }, M = $t(v, [], f, l.length > 0, n, !0);
|
|
1178
1318
|
if (b === 1) {
|
|
1179
1319
|
M ? s.push(v) : s.push(B);
|
|
@@ -1210,7 +1350,8 @@ function Pu(e, t) {
|
|
|
1210
1350
|
case ie:
|
|
1211
1351
|
switch (p) {
|
|
1212
1352
|
case he:
|
|
1213
|
-
if (y.hard)
|
|
1353
|
+
if (y.hard)
|
|
1354
|
+
i = !0;
|
|
1214
1355
|
else {
|
|
1215
1356
|
y.soft || (o.push(" "), a += 1);
|
|
1216
1357
|
break;
|
|
@@ -1237,7 +1378,8 @@ function Pu(e, t) {
|
|
|
1237
1378
|
let D = o.indexOf(pt);
|
|
1238
1379
|
if (D !== -1) {
|
|
1239
1380
|
let c = o.indexOf(pt, D + 1);
|
|
1240
|
-
if (c === -1)
|
|
1381
|
+
if (c === -1)
|
|
1382
|
+
return { formatted: o.filter((g) => g !== pt).join("") };
|
|
1241
1383
|
let p = o.slice(0, D).join(""), y = o.slice(D + 1, c).join(""), f = o.slice(c + 1).join("");
|
|
1242
1384
|
return { formatted: p + y + f, cursorNodeStart: p.length, cursorNodeText: y };
|
|
1243
1385
|
}
|
|
@@ -1245,7 +1387,8 @@ function Pu(e, t) {
|
|
|
1245
1387
|
}
|
|
1246
1388
|
function gi(e, t, n = 0) {
|
|
1247
1389
|
let r = 0;
|
|
1248
|
-
for (let u = n; u < e.length; ++u)
|
|
1390
|
+
for (let u = n; u < e.length; ++u)
|
|
1391
|
+
e[u] === " " ? r = r + t - r % t : r++;
|
|
1249
1392
|
return r;
|
|
1250
1393
|
}
|
|
1251
1394
|
var xi = gi;
|
|
@@ -1259,7 +1402,8 @@ function wu(e, t, n) {
|
|
|
1259
1402
|
let { node: r } = e;
|
|
1260
1403
|
if (r.type === "TemplateLiteral" && Bi(e)) {
|
|
1261
1404
|
let i = Si(e, t, n);
|
|
1262
|
-
if (i)
|
|
1405
|
+
if (i)
|
|
1406
|
+
return i;
|
|
1263
1407
|
}
|
|
1264
1408
|
let u = "expressions";
|
|
1265
1409
|
r.type === "TSTemplateLiteralType" && (u = "types");
|
|
@@ -1267,7 +1411,8 @@ function wu(e, t, n) {
|
|
|
1267
1411
|
a.push(we, "`");
|
|
1268
1412
|
let o = 0;
|
|
1269
1413
|
return e.each(({ index: i, node: l }) => {
|
|
1270
|
-
if (a.push(n()), l.tail)
|
|
1414
|
+
if (a.push(n()), l.tail)
|
|
1415
|
+
return;
|
|
1271
1416
|
let { tabWidth: d } = t, D = l.value.raw, c = D.includes(`
|
|
1272
1417
|
`) ? Ci(D, d) : o;
|
|
1273
1418
|
o = c;
|
|
@@ -1301,7 +1446,9 @@ function Si(e, t, n) {
|
|
|
1301
1446
|
`) && i.push({ hasLineBreak: !1, cells: [] });
|
|
1302
1447
|
}
|
|
1303
1448
|
let l = Math.max(u.length, ...i.map((c) => c.cells.length)), d = Array.from({ length: l }).fill(0), D = [{ cells: u }, ...i.filter((c) => c.cells.length > 0)];
|
|
1304
|
-
for (let { cells: c } of D.filter((p) => !p.hasLineBreak))
|
|
1449
|
+
for (let { cells: c } of D.filter((p) => !p.hasLineBreak))
|
|
1450
|
+
for (let [p, y] of c.entries())
|
|
1451
|
+
d[p] = Math.max(d[p], lt(y));
|
|
1305
1452
|
return s.push(we, "`", A([F, N(F, D.map((c) => N(" | ", c.cells.map((p, y) => c.hasLineBreak ? p : p + " ".repeat(d[y] - lt(p))))))]), F, "`"), s;
|
|
1306
1453
|
}
|
|
1307
1454
|
}
|
|
@@ -1341,11 +1488,13 @@ function Pi(e) {
|
|
|
1341
1488
|
}
|
|
1342
1489
|
async function wi(e, t, n) {
|
|
1343
1490
|
let { node: r } = n, u = r.quasis.map((d) => d.value.raw), a = 0, s = u.reduce((d, D, c) => c === 0 ? D : d + "@prettier-placeholder-" + a++ + "-id" + D, ""), o = await e(s, { parser: "scss" }), i = nr(n, t), l = Ii(o, i);
|
|
1344
|
-
if (!l)
|
|
1491
|
+
if (!l)
|
|
1492
|
+
throw new Error("Couldn't insert all the expressions");
|
|
1345
1493
|
return ["`", A([F, l]), E, "`"];
|
|
1346
1494
|
}
|
|
1347
1495
|
function Ii(e, t) {
|
|
1348
|
-
if (!J(t))
|
|
1496
|
+
if (!J(t))
|
|
1497
|
+
return e;
|
|
1349
1498
|
let n = 0, r = Et(zn(e), (u) => typeof u != "string" || !u.includes("@prettier-placeholder") ? u : u.split(/@prettier-placeholder-(\d+)-id/u).map((a, s) => s % 2 === 0 ? He(a) : (n++, t[a])));
|
|
1350
1499
|
return t.length === n ? r : null;
|
|
1351
1500
|
}
|
|
@@ -1359,7 +1508,8 @@ function Cr(e) {
|
|
|
1359
1508
|
return /^[A-Z]/u.test(e.object.name) && e.property.name === "extend";
|
|
1360
1509
|
}
|
|
1361
1510
|
function ji({ parent: e }) {
|
|
1362
|
-
if (!e || e.type !== "TaggedTemplateExpression")
|
|
1511
|
+
if (!e || e.type !== "TaggedTemplateExpression")
|
|
1512
|
+
return !1;
|
|
1363
1513
|
let t = e.tag.type === "ParenthesizedExpression" ? e.tag.expression : e.tag;
|
|
1364
1514
|
switch (t.type) {
|
|
1365
1515
|
case "MemberExpression":
|
|
@@ -1376,7 +1526,8 @@ function Li({ parent: e, grandparent: t }) {
|
|
|
1376
1526
|
return t?.type === "JSXAttribute" && e.type === "JSXExpressionContainer" && t.name.type === "JSXIdentifier" && t.name.name === "css";
|
|
1377
1527
|
}
|
|
1378
1528
|
function Mi(e) {
|
|
1379
|
-
if (Ni(e) || ji(e) || Li(e) || vi(e))
|
|
1529
|
+
if (Ni(e) || ji(e) || Li(e) || vi(e))
|
|
1530
|
+
return wi;
|
|
1380
1531
|
}
|
|
1381
1532
|
var Oi = Mi;
|
|
1382
1533
|
async function Ji(e, t, n) {
|
|
@@ -1384,7 +1535,8 @@ async function Ji(e, t, n) {
|
|
|
1384
1535
|
for (let o = 0; o < u; o++) {
|
|
1385
1536
|
let i = r.quasis[o], l = o === 0, d = o === u - 1, D = i.value.cooked, c = D.split(`
|
|
1386
1537
|
`), p = c.length, y = a[o], f = p > 2 && c[0].trim() === "" && c[1].trim() === "", g = p > 2 && c[p - 1].trim() === "" && c[p - 2].trim() === "", S = c.every((x) => /^\s*(?:#[^\n\r]*)?$/u.test(x));
|
|
1387
|
-
if (!d && /#[^\n\r]*$/u.test(c[p - 1]))
|
|
1538
|
+
if (!d && /#[^\n\r]*$/u.test(c[p - 1]))
|
|
1539
|
+
return null;
|
|
1388
1540
|
let b = null;
|
|
1389
1541
|
S ? b = qi(c) : b = await e(D, { parser: "graphql" }), b ? (b = Iu(b, !1), !l && f && s.push(""), s.push(b), !d && g && s.push("")) : !l && !d && f && s.push(""), y && s.push(y);
|
|
1390
1542
|
}
|
|
@@ -1392,14 +1544,16 @@ async function Ji(e, t, n) {
|
|
|
1392
1544
|
}
|
|
1393
1545
|
function qi(e) {
|
|
1394
1546
|
let t = [], n = !1, r = e.map((u) => u.trim());
|
|
1395
|
-
for (let [u, a] of r.entries())
|
|
1547
|
+
for (let [u, a] of r.entries())
|
|
1548
|
+
a !== "" && (r[u - 1] === "" && n ? t.push([F, a]) : t.push(a), n = !0);
|
|
1396
1549
|
return t.length === 0 ? null : N(F, t);
|
|
1397
1550
|
}
|
|
1398
1551
|
function _i({ node: e, parent: t }) {
|
|
1399
1552
|
return ju({ node: e, parent: t }, "GraphQL") || t && (t.type === "TaggedTemplateExpression" && (t.tag.type === "MemberExpression" && t.tag.object.name === "graphql" && t.tag.property.name === "experimental" || t.tag.type === "Identifier" && (t.tag.name === "gql" || t.tag.name === "graphql")) || t.type === "CallExpression" && t.callee.type === "Identifier" && t.callee.name === "graphql");
|
|
1400
1553
|
}
|
|
1401
1554
|
function Xi(e) {
|
|
1402
|
-
if (_i(e))
|
|
1555
|
+
if (_i(e))
|
|
1556
|
+
return Ji;
|
|
1403
1557
|
}
|
|
1404
1558
|
var $i = Xi, fn = 0;
|
|
1405
1559
|
async function Lu(e, t, n, r, u) {
|
|
@@ -1408,7 +1562,8 @@ async function Lu(e, t, n, r, u) {
|
|
|
1408
1562
|
let o = (S) => `PRETTIER_HTML_PLACEHOLDER_${S}_${s}_IN_JS`, i = a.quasis.map((S, b, x) => b === x.length - 1 ? S.value.cooked : S.value.cooked + o(b)).join(""), l = nr(r, n), d = new RegExp(o(String.raw`(\d+)`), "gu"), D = 0, c = await t(i, { parser: e, __onHtmlRoot(S) {
|
|
1409
1563
|
D = S.children.length;
|
|
1410
1564
|
} }), p = Et(c, (S) => {
|
|
1411
|
-
if (typeof S != "string")
|
|
1565
|
+
if (typeof S != "string")
|
|
1566
|
+
return S;
|
|
1412
1567
|
let b = [], x = S.split(d);
|
|
1413
1568
|
for (let j = 0; j < x.length; j++) {
|
|
1414
1569
|
let v = x[j];
|
|
@@ -1428,8 +1583,10 @@ function Ri(e) {
|
|
|
1428
1583
|
}
|
|
1429
1584
|
var Wi = Lu.bind(void 0, "html"), Ui = Lu.bind(void 0, "angular");
|
|
1430
1585
|
function Gi(e) {
|
|
1431
|
-
if (Ri(e))
|
|
1432
|
-
|
|
1586
|
+
if (Ri(e))
|
|
1587
|
+
return Wi;
|
|
1588
|
+
if (ki(e))
|
|
1589
|
+
return Ui;
|
|
1433
1590
|
}
|
|
1434
1591
|
var Vi = Gi;
|
|
1435
1592
|
async function Ki(e, t, n) {
|
|
@@ -1443,7 +1600,8 @@ function Hi(e) {
|
|
|
1443
1600
|
return t === null ? "" : t[1];
|
|
1444
1601
|
}
|
|
1445
1602
|
function zi(e) {
|
|
1446
|
-
if (Qi(e))
|
|
1603
|
+
if (Qi(e))
|
|
1604
|
+
return Ki;
|
|
1447
1605
|
}
|
|
1448
1606
|
function Qi({ node: e, parent: t }) {
|
|
1449
1607
|
return t?.type === "TaggedTemplateExpression" && e.quasis.length === 1 && t.tag.type === "Identifier" && (t.tag.name === "md" || t.tag.name === "markdown");
|
|
@@ -1451,12 +1609,15 @@ function Qi({ node: e, parent: t }) {
|
|
|
1451
1609
|
var Yi = zi;
|
|
1452
1610
|
function Zi(e) {
|
|
1453
1611
|
let { node: t } = e;
|
|
1454
|
-
if (t.type !== "TemplateLiteral" || ep(t))
|
|
1612
|
+
if (t.type !== "TemplateLiteral" || ep(t))
|
|
1613
|
+
return;
|
|
1455
1614
|
let n;
|
|
1456
|
-
for (let r of [Oi, $i, Vi, Yi])
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1615
|
+
for (let r of [Oi, $i, Vi, Yi])
|
|
1616
|
+
if (n = r(e), !!n)
|
|
1617
|
+
return t.quasis.length === 1 && t.quasis[0].value.raw.trim() === "" ? "``" : async (...u) => {
|
|
1618
|
+
let a = await n(...u);
|
|
1619
|
+
return a && jt({ embed: !0, ...a.label }, a);
|
|
1620
|
+
};
|
|
1460
1621
|
}
|
|
1461
1622
|
function ep({ quasis: e }) {
|
|
1462
1623
|
return e.some(({ value: { cooked: t } }) => t === null);
|
|
@@ -1475,7 +1636,8 @@ function pp(e) {
|
|
|
1475
1636
|
`;
|
|
1476
1637
|
e = H(!1, e.replace(rp, "").replace(np, ""), sp, "$1");
|
|
1477
1638
|
let n = "";
|
|
1478
|
-
for (; n !== e; )
|
|
1639
|
+
for (; n !== e; )
|
|
1640
|
+
n = e, e = H(!1, e, ap, `${t}$1 $2${t}`);
|
|
1479
1641
|
e = e.replace(Tr, "").trimEnd();
|
|
1480
1642
|
let r = /* @__PURE__ */ Object.create(null), u = H(!1, e, Sr, "").replace(Tr, "").trimEnd(), a;
|
|
1481
1643
|
for (; a = Sr.exec(e); ) {
|
|
@@ -1483,7 +1645,8 @@ function pp(e) {
|
|
|
1483
1645
|
if (typeof r[a[1]] == "string" || Array.isArray(r[a[1]])) {
|
|
1484
1646
|
let o = r[a[1]];
|
|
1485
1647
|
r[a[1]] = [...Ou, ...Array.isArray(o) ? o : [o], s];
|
|
1486
|
-
} else
|
|
1648
|
+
} else
|
|
1649
|
+
r[a[1]] = s;
|
|
1487
1650
|
}
|
|
1488
1651
|
return { comments: u, pragmas: r };
|
|
1489
1652
|
}
|
|
@@ -1491,7 +1654,8 @@ function lp({ comments: e = "", pragmas: t = {} }) {
|
|
|
1491
1654
|
let n = `
|
|
1492
1655
|
`, r = "/**", u = " *", a = " */", s = Object.keys(t), o = s.flatMap((l) => br(l, t[l])).map((l) => `${u} ${l}${n}`).join("");
|
|
1493
1656
|
if (!e) {
|
|
1494
|
-
if (s.length === 0)
|
|
1657
|
+
if (s.length === 0)
|
|
1658
|
+
return "";
|
|
1495
1659
|
if (s.length === 1 && !Array.isArray(t[s[0]])) {
|
|
1496
1660
|
let l = t[s[0]];
|
|
1497
1661
|
return `${r} ${br(s[0], l)[0]}${a}`;
|
|
@@ -1505,7 +1669,8 @@ function br(e, t) {
|
|
|
1505
1669
|
}
|
|
1506
1670
|
var cp = "format";
|
|
1507
1671
|
function Dp(e) {
|
|
1508
|
-
if (!e.startsWith("#!"))
|
|
1672
|
+
if (!e.startsWith("#!"))
|
|
1673
|
+
return "";
|
|
1509
1674
|
let t = e.indexOf(`
|
|
1510
1675
|
`);
|
|
1511
1676
|
return t === -1 ? e : e.slice(0, t);
|
|
@@ -1527,76 +1692,93 @@ function mp(e) {
|
|
|
1527
1692
|
`) + a;
|
|
1528
1693
|
}
|
|
1529
1694
|
function fp(e, t) {
|
|
1530
|
-
let { originalText: n, [
|
|
1531
|
-
for (let d of r)
|
|
1695
|
+
let { originalText: n, [Symbol.for("comments")]: r, locStart: u, locEnd: a, [Symbol.for("printedComments")]: s } = t, { node: o } = e, i = u(o), l = a(o);
|
|
1696
|
+
for (let d of r)
|
|
1697
|
+
u(d) >= i && a(d) <= l && s.add(d);
|
|
1532
1698
|
return n.slice(i, l);
|
|
1533
1699
|
}
|
|
1534
1700
|
var Ep = fp;
|
|
1535
1701
|
function In(e, t) {
|
|
1536
1702
|
var n, r, u, a, s, o, i, l, d;
|
|
1537
|
-
if (e.isRoot)
|
|
1703
|
+
if (e.isRoot)
|
|
1704
|
+
return !1;
|
|
1538
1705
|
let { node: D, key: c, parent: p } = e;
|
|
1539
|
-
if (t.__isInHtmlInterpolation && !t.bracketSpacing && xp(D) && St(e))
|
|
1540
|
-
|
|
1706
|
+
if (t.__isInHtmlInterpolation && !t.bracketSpacing && xp(D) && St(e))
|
|
1707
|
+
return !0;
|
|
1708
|
+
if (Fp(D))
|
|
1709
|
+
return !1;
|
|
1541
1710
|
if (D.type === "Identifier") {
|
|
1542
|
-
if ((n = D.extra) != null && n.parenthesized && /^PRETTIER_HTML_PLACEHOLDER_\d+_\d+_IN_JS$/u.test(D.name) || c === "left" && (D.name === "async" && !p.await || D.name === "let") && p.type === "ForOfStatement")
|
|
1711
|
+
if ((n = D.extra) != null && n.parenthesized && /^PRETTIER_HTML_PLACEHOLDER_\d+_\d+_IN_JS$/u.test(D.name) || c === "left" && (D.name === "async" && !p.await || D.name === "let") && p.type === "ForOfStatement")
|
|
1712
|
+
return !0;
|
|
1543
1713
|
if (D.name === "let") {
|
|
1544
1714
|
let y = (r = e.findAncestor((f) => f.type === "ForOfStatement")) == null ? void 0 : r.left;
|
|
1545
|
-
if (y && te(y, (f) => f === D))
|
|
1715
|
+
if (y && te(y, (f) => f === D))
|
|
1716
|
+
return !0;
|
|
1546
1717
|
}
|
|
1547
1718
|
if (c === "object" && D.name === "let" && p.type === "MemberExpression" && p.computed && !p.optional) {
|
|
1548
1719
|
let y = e.findAncestor((g) => g.type === "ExpressionStatement" || g.type === "ForStatement" || g.type === "ForInStatement"), f = y ? y.type === "ExpressionStatement" ? y.expression : y.type === "ForStatement" ? y.init : y.left : void 0;
|
|
1549
|
-
if (f && te(f, (g) => g === D))
|
|
1720
|
+
if (f && te(f, (g) => g === D))
|
|
1721
|
+
return !0;
|
|
1550
1722
|
}
|
|
1551
|
-
if (c === "expression")
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1723
|
+
if (c === "expression")
|
|
1724
|
+
switch (D.name) {
|
|
1725
|
+
case "await":
|
|
1726
|
+
case "interface":
|
|
1727
|
+
case "module":
|
|
1728
|
+
case "using":
|
|
1729
|
+
case "yield":
|
|
1730
|
+
case "let":
|
|
1731
|
+
case "component":
|
|
1732
|
+
case "hook":
|
|
1733
|
+
case "type": {
|
|
1734
|
+
let y = e.findAncestor((f) => !Ce(f));
|
|
1735
|
+
if (y !== p && y.type === "ExpressionStatement")
|
|
1736
|
+
return !0;
|
|
1737
|
+
}
|
|
1563
1738
|
}
|
|
1564
|
-
}
|
|
1565
1739
|
return !1;
|
|
1566
1740
|
}
|
|
1567
1741
|
if (D.type === "ObjectExpression" || D.type === "FunctionExpression" || D.type === "ClassExpression" || D.type === "DoExpression") {
|
|
1568
1742
|
let y = (u = e.findAncestor((f) => f.type === "ExpressionStatement")) == null ? void 0 : u.expression;
|
|
1569
|
-
if (y && te(y, (f) => f === D))
|
|
1743
|
+
if (y && te(y, (f) => f === D))
|
|
1744
|
+
return !0;
|
|
1570
1745
|
}
|
|
1571
1746
|
if (D.type === "ObjectExpression") {
|
|
1572
1747
|
let y = (a = e.findAncestor((f) => f.type === "ArrowFunctionExpression")) == null ? void 0 : a.body;
|
|
1573
|
-
if (y && y.type !== "SequenceExpression" && y.type !== "AssignmentExpression" && te(y, (f) => f === D))
|
|
1748
|
+
if (y && y.type !== "SequenceExpression" && y.type !== "AssignmentExpression" && te(y, (f) => f === D))
|
|
1749
|
+
return !0;
|
|
1574
1750
|
}
|
|
1575
1751
|
switch (p.type) {
|
|
1576
1752
|
case "ParenthesizedExpression":
|
|
1577
1753
|
return !1;
|
|
1578
1754
|
case "ClassDeclaration":
|
|
1579
1755
|
case "ClassExpression":
|
|
1580
|
-
if (c === "superClass" && (D.type === "ArrowFunctionExpression" || D.type === "AssignmentExpression" || D.type === "AwaitExpression" || D.type === "BinaryExpression" || D.type === "ConditionalExpression" || D.type === "LogicalExpression" || D.type === "NewExpression" || D.type === "ObjectExpression" || D.type === "SequenceExpression" || D.type === "TaggedTemplateExpression" || D.type === "UnaryExpression" || D.type === "UpdateExpression" || D.type === "YieldExpression" || D.type === "TSNonNullExpression" || D.type === "ClassExpression" && J(D.decorators)))
|
|
1756
|
+
if (c === "superClass" && (D.type === "ArrowFunctionExpression" || D.type === "AssignmentExpression" || D.type === "AwaitExpression" || D.type === "BinaryExpression" || D.type === "ConditionalExpression" || D.type === "LogicalExpression" || D.type === "NewExpression" || D.type === "ObjectExpression" || D.type === "SequenceExpression" || D.type === "TaggedTemplateExpression" || D.type === "UnaryExpression" || D.type === "UpdateExpression" || D.type === "YieldExpression" || D.type === "TSNonNullExpression" || D.type === "ClassExpression" && J(D.decorators)))
|
|
1757
|
+
return !0;
|
|
1581
1758
|
break;
|
|
1582
1759
|
case "ExportDefaultDeclaration":
|
|
1583
1760
|
return Ju(e, t) || D.type === "SequenceExpression";
|
|
1584
1761
|
case "Decorator":
|
|
1585
|
-
if (c === "expression" && !Cp(D))
|
|
1762
|
+
if (c === "expression" && !Cp(D))
|
|
1763
|
+
return !0;
|
|
1586
1764
|
break;
|
|
1587
1765
|
case "TypeAnnotation":
|
|
1588
|
-
if (e.match(void 0, void 0, (y, f) => f === "returnType" && y.type === "ArrowFunctionExpression") && gp(D))
|
|
1766
|
+
if (e.match(void 0, void 0, (y, f) => f === "returnType" && y.type === "ArrowFunctionExpression") && gp(D))
|
|
1767
|
+
return !0;
|
|
1589
1768
|
break;
|
|
1590
1769
|
case "BinaryExpression":
|
|
1591
|
-
if (c === "left" && (p.operator === "in" || p.operator === "instanceof") && D.type === "UnaryExpression")
|
|
1770
|
+
if (c === "left" && (p.operator === "in" || p.operator === "instanceof") && D.type === "UnaryExpression")
|
|
1771
|
+
return !0;
|
|
1592
1772
|
break;
|
|
1593
1773
|
case "VariableDeclarator":
|
|
1594
|
-
if (c === "init" && e.match(void 0, void 0, (y, f) => f === "declarations" && y.type === "VariableDeclaration", (y, f) => f === "left" && y.type === "ForInStatement"))
|
|
1774
|
+
if (c === "init" && e.match(void 0, void 0, (y, f) => f === "declarations" && y.type === "VariableDeclaration", (y, f) => f === "left" && y.type === "ForInStatement"))
|
|
1775
|
+
return !0;
|
|
1595
1776
|
break;
|
|
1596
1777
|
}
|
|
1597
1778
|
switch (D.type) {
|
|
1598
1779
|
case "UpdateExpression":
|
|
1599
|
-
if (p.type === "UnaryExpression")
|
|
1780
|
+
if (p.type === "UnaryExpression")
|
|
1781
|
+
return D.prefix && (D.operator === "++" && p.operator === "+" || D.operator === "--" && p.operator === "-");
|
|
1600
1782
|
case "UnaryExpression":
|
|
1601
1783
|
switch (p.type) {
|
|
1602
1784
|
case "UnaryExpression":
|
|
@@ -1620,10 +1802,12 @@ function In(e, t) {
|
|
|
1620
1802
|
return !1;
|
|
1621
1803
|
}
|
|
1622
1804
|
case "BinaryExpression":
|
|
1623
|
-
if (p.type === "UpdateExpression" || D.operator === "in" && Ap(e))
|
|
1805
|
+
if (p.type === "UpdateExpression" || D.operator === "in" && Ap(e))
|
|
1806
|
+
return !0;
|
|
1624
1807
|
if (D.operator === "|>" && (s = D.extra) != null && s.parenthesized) {
|
|
1625
1808
|
let y = e.grandparent;
|
|
1626
|
-
if (y.type === "BinaryExpression" && y.operator === "|>")
|
|
1809
|
+
if (y.type === "BinaryExpression" && y.operator === "|>")
|
|
1810
|
+
return !0;
|
|
1627
1811
|
}
|
|
1628
1812
|
case "TSTypeAssertion":
|
|
1629
1813
|
case "TSAsExpression":
|
|
@@ -1665,10 +1849,12 @@ function In(e, t) {
|
|
|
1665
1849
|
case "AssignmentPattern":
|
|
1666
1850
|
return c === "left" && (D.type === "TSTypeAssertion" || Ce(D));
|
|
1667
1851
|
case "LogicalExpression":
|
|
1668
|
-
if (D.type === "LogicalExpression")
|
|
1852
|
+
if (D.type === "LogicalExpression")
|
|
1853
|
+
return p.operator !== D.operator;
|
|
1669
1854
|
case "BinaryExpression": {
|
|
1670
1855
|
let { operator: y, type: f } = D;
|
|
1671
|
-
if (!y && f !== "TSTypeAssertion")
|
|
1856
|
+
if (!y && f !== "TSTypeAssertion")
|
|
1857
|
+
return !0;
|
|
1672
1858
|
let g = Vt(y), S = p.operator, b = Vt(S);
|
|
1673
1859
|
return b > g || c === "right" && b === g || b === g && !Vn(S, y) ? !0 : b < g && y === "%" ? S === "+" || S === "-" : !!oo(S);
|
|
1674
1860
|
}
|
|
@@ -1678,7 +1864,8 @@ function In(e, t) {
|
|
|
1678
1864
|
case "SequenceExpression":
|
|
1679
1865
|
return p.type !== "ForStatement";
|
|
1680
1866
|
case "YieldExpression":
|
|
1681
|
-
if (p.type === "AwaitExpression" || p.type === "TSTypeAssertion")
|
|
1867
|
+
if (p.type === "AwaitExpression" || p.type === "TSTypeAssertion")
|
|
1868
|
+
return !0;
|
|
1682
1869
|
case "AwaitExpression":
|
|
1683
1870
|
switch (p.type) {
|
|
1684
1871
|
case "TaggedTemplateExpression":
|
|
@@ -1708,22 +1895,28 @@ function In(e, t) {
|
|
|
1708
1895
|
return !1;
|
|
1709
1896
|
}
|
|
1710
1897
|
case "TSFunctionType":
|
|
1711
|
-
if (e.match((y) => y.type === "TSFunctionType", (y, f) => f === "typeAnnotation" && y.type === "TSTypeAnnotation", (y, f) => f === "returnType" && y.type === "ArrowFunctionExpression"))
|
|
1898
|
+
if (e.match((y) => y.type === "TSFunctionType", (y, f) => f === "typeAnnotation" && y.type === "TSTypeAnnotation", (y, f) => f === "returnType" && y.type === "ArrowFunctionExpression"))
|
|
1899
|
+
return !0;
|
|
1712
1900
|
case "TSConditionalType":
|
|
1713
1901
|
case "TSConstructorType":
|
|
1714
1902
|
case "ConditionalTypeAnnotation":
|
|
1715
|
-
if (c === "extendsType" && Re(D) && p.type === D.type || c === "checkType" && Re(p))
|
|
1903
|
+
if (c === "extendsType" && Re(D) && p.type === D.type || c === "checkType" && Re(p))
|
|
1904
|
+
return !0;
|
|
1716
1905
|
if (c === "extendsType" && p.type === "TSConditionalType") {
|
|
1717
1906
|
let { typeAnnotation: y } = D.returnType || D.typeAnnotation;
|
|
1718
|
-
if (y.type === "TSTypePredicate" && y.typeAnnotation && (y = y.typeAnnotation.typeAnnotation), y.type === "TSInferType" && y.typeParameter.constraint)
|
|
1907
|
+
if (y.type === "TSTypePredicate" && y.typeAnnotation && (y = y.typeAnnotation.typeAnnotation), y.type === "TSInferType" && y.typeParameter.constraint)
|
|
1908
|
+
return !0;
|
|
1719
1909
|
}
|
|
1720
1910
|
case "TSUnionType":
|
|
1721
1911
|
case "TSIntersectionType":
|
|
1722
|
-
if (($e(p) || Kn(p)) && p.types.length > 1 && (!D.types || D.types.length > 1))
|
|
1912
|
+
if (($e(p) || Kn(p)) && p.types.length > 1 && (!D.types || D.types.length > 1))
|
|
1913
|
+
return !0;
|
|
1723
1914
|
case "TSInferType":
|
|
1724
1915
|
if (D.type === "TSInferType") {
|
|
1725
|
-
if (p.type === "TSRestType")
|
|
1726
|
-
|
|
1916
|
+
if (p.type === "TSRestType")
|
|
1917
|
+
return !1;
|
|
1918
|
+
if (c === "types" && (p.type === "TSUnionType" || p.type === "TSIntersectionType") && D.typeParameter.type === "TSTypeParameter" && D.typeParameter.constraint)
|
|
1919
|
+
return !0;
|
|
1727
1920
|
}
|
|
1728
1921
|
case "TSTypeOperator":
|
|
1729
1922
|
return p.type === "TSArrayType" || p.type === "TSOptionalType" || p.type === "TSRestType" || c === "objectType" && p.type === "TSIndexedAccessType" || p.type === "TSTypeOperator" || p.type === "TSTypeAnnotation" && e.grandparent.type.startsWith("TSJSDoc");
|
|
@@ -1743,8 +1936,10 @@ function In(e, t) {
|
|
|
1743
1936
|
return p.type === "ArrayTypeAnnotation" || c === "objectType" && (p.type === "IndexedAccessType" || p.type === "OptionalIndexedAccessType");
|
|
1744
1937
|
case "ComponentTypeAnnotation":
|
|
1745
1938
|
case "FunctionTypeAnnotation": {
|
|
1746
|
-
if (D.type === "ComponentTypeAnnotation" && (D.rendersType === null || D.rendersType === void 0))
|
|
1747
|
-
|
|
1939
|
+
if (D.type === "ComponentTypeAnnotation" && (D.rendersType === null || D.rendersType === void 0))
|
|
1940
|
+
return !1;
|
|
1941
|
+
if (e.match(void 0, (f, g) => g === "typeAnnotation" && f.type === "TypeAnnotation", (f, g) => g === "returnType" && f.type === "ArrowFunctionExpression") || e.match(void 0, (f, g) => g === "typeAnnotation" && f.type === "TypePredicate", (f, g) => g === "typeAnnotation" && f.type === "TypeAnnotation", (f, g) => g === "returnType" && f.type === "ArrowFunctionExpression"))
|
|
1942
|
+
return !0;
|
|
1748
1943
|
let y = p.type === "NullableTypeAnnotation" ? e.grandparent : p;
|
|
1749
1944
|
return y.type === "UnionTypeAnnotation" || y.type === "IntersectionTypeAnnotation" || y.type === "ArrayTypeAnnotation" || c === "objectType" && (y.type === "IndexedAccessType" || y.type === "OptionalIndexedAccessType") || c === "checkType" && p.type === "ConditionalTypeAnnotation" || c === "extendsType" && p.type === "ConditionalTypeAnnotation" && ((o = D.returnType) == null ? void 0 : o.type) === "InferTypeAnnotation" && ((i = D.returnType) == null ? void 0 : i.typeParameter.bound) || y.type === "NullableTypeAnnotation" || p.type === "FunctionTypeParam" && p.name === null && Z(D).some((f) => {
|
|
1750
1945
|
var g;
|
|
@@ -1836,34 +2031,41 @@ function In(e, t) {
|
|
|
1836
2031
|
return !1;
|
|
1837
2032
|
}
|
|
1838
2033
|
case "ClassExpression":
|
|
1839
|
-
|
|
2034
|
+
switch (p.type) {
|
|
2035
|
+
case "NewExpression":
|
|
2036
|
+
return c === "callee";
|
|
2037
|
+
default:
|
|
2038
|
+
return !1;
|
|
2039
|
+
}
|
|
1840
2040
|
case "OptionalMemberExpression":
|
|
1841
2041
|
case "OptionalCallExpression":
|
|
1842
2042
|
case "CallExpression":
|
|
1843
2043
|
case "MemberExpression":
|
|
1844
|
-
if (hp(e))
|
|
2044
|
+
if (hp(e))
|
|
2045
|
+
return !0;
|
|
1845
2046
|
case "TaggedTemplateExpression":
|
|
1846
2047
|
case "TSNonNullExpression":
|
|
1847
2048
|
if (c === "callee" && (p.type === "BindExpression" || p.type === "NewExpression")) {
|
|
1848
2049
|
let y = D;
|
|
1849
|
-
for (; y; )
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
2050
|
+
for (; y; )
|
|
2051
|
+
switch (y.type) {
|
|
2052
|
+
case "CallExpression":
|
|
2053
|
+
case "OptionalCallExpression":
|
|
2054
|
+
return !0;
|
|
2055
|
+
case "MemberExpression":
|
|
2056
|
+
case "OptionalMemberExpression":
|
|
2057
|
+
case "BindExpression":
|
|
2058
|
+
y = y.object;
|
|
2059
|
+
break;
|
|
2060
|
+
case "TaggedTemplateExpression":
|
|
2061
|
+
y = y.tag;
|
|
2062
|
+
break;
|
|
2063
|
+
case "TSNonNullExpression":
|
|
2064
|
+
y = y.expression;
|
|
2065
|
+
break;
|
|
2066
|
+
default:
|
|
2067
|
+
return !1;
|
|
2068
|
+
}
|
|
1867
2069
|
}
|
|
1868
2070
|
return !1;
|
|
1869
2071
|
case "BindExpression":
|
|
@@ -1883,7 +2085,8 @@ function Ap(e) {
|
|
|
1883
2085
|
let t = 0, { node: n } = e;
|
|
1884
2086
|
for (; n; ) {
|
|
1885
2087
|
let r = e.getParentNode(t++);
|
|
1886
|
-
if (r?.type === "ForStatement" && r.init === n)
|
|
2088
|
+
if (r?.type === "ForStatement" && r.init === n)
|
|
2089
|
+
return !0;
|
|
1887
2090
|
n = r;
|
|
1888
2091
|
}
|
|
1889
2092
|
return !1;
|
|
@@ -1898,20 +2101,25 @@ function St(e) {
|
|
|
1898
2101
|
let { parent: t, key: n } = e;
|
|
1899
2102
|
switch (t.type) {
|
|
1900
2103
|
case "NGPipeExpression":
|
|
1901
|
-
if (n === "arguments" && e.isLast)
|
|
2104
|
+
if (n === "arguments" && e.isLast)
|
|
2105
|
+
return e.callParent(St);
|
|
1902
2106
|
break;
|
|
1903
2107
|
case "ObjectProperty":
|
|
1904
|
-
if (n === "value")
|
|
2108
|
+
if (n === "value")
|
|
2109
|
+
return e.callParent(() => e.key === "properties" && e.isLast);
|
|
1905
2110
|
break;
|
|
1906
2111
|
case "BinaryExpression":
|
|
1907
2112
|
case "LogicalExpression":
|
|
1908
|
-
if (n === "right")
|
|
2113
|
+
if (n === "right")
|
|
2114
|
+
return e.callParent(St);
|
|
1909
2115
|
break;
|
|
1910
2116
|
case "ConditionalExpression":
|
|
1911
|
-
if (n === "alternate")
|
|
2117
|
+
if (n === "alternate")
|
|
2118
|
+
return e.callParent(St);
|
|
1912
2119
|
break;
|
|
1913
2120
|
case "UnaryExpression":
|
|
1914
|
-
if (t.prefix)
|
|
2121
|
+
if (t.prefix)
|
|
2122
|
+
return e.callParent(St);
|
|
1915
2123
|
break;
|
|
1916
2124
|
}
|
|
1917
2125
|
return !1;
|
|
@@ -1947,7 +2155,8 @@ function Bp(e, t) {
|
|
|
1947
2155
|
if ((n = a.isBlockComment) != null && n.call(a, r)) {
|
|
1948
2156
|
let d = pe(s, i(r)) ? pe(s, o(r), { backwards: !0 }) ? F : C : " ";
|
|
1949
2157
|
u.push(d);
|
|
1950
|
-
} else
|
|
2158
|
+
} else
|
|
2159
|
+
u.push(F);
|
|
1951
2160
|
let l = Dt(s, ct(s, i(r)));
|
|
1952
2161
|
return l !== !1 && pe(s, l) && u.push(F), u;
|
|
1953
2162
|
}
|
|
@@ -1962,23 +2171,28 @@ function vp(e, t, n) {
|
|
|
1962
2171
|
}
|
|
1963
2172
|
function $(e, t, n = {}) {
|
|
1964
2173
|
let { node: r } = e;
|
|
1965
|
-
if (!J(r?.comments))
|
|
2174
|
+
if (!J(r?.comments))
|
|
2175
|
+
return "";
|
|
1966
2176
|
let { indent: u = !1, marker: a, filter: s = bp } = n, o = [];
|
|
1967
2177
|
if (e.each(({ node: l }) => {
|
|
1968
2178
|
l.leading || l.trailing || l.marker !== a || !s(l) || o.push(rr(e, t));
|
|
1969
|
-
}, "comments"), o.length === 0)
|
|
2179
|
+
}, "comments"), o.length === 0)
|
|
2180
|
+
return "";
|
|
1970
2181
|
let i = N(F, o);
|
|
1971
2182
|
return u ? A([F, i]) : i;
|
|
1972
2183
|
}
|
|
1973
2184
|
function qu(e, t) {
|
|
1974
2185
|
let n = e.node;
|
|
1975
|
-
if (!n)
|
|
1976
|
-
|
|
1977
|
-
|
|
2186
|
+
if (!n)
|
|
2187
|
+
return {};
|
|
2188
|
+
let r = t[Symbol.for("printedComments")];
|
|
2189
|
+
if ((n.comments || []).filter((o) => !r.has(o)).length === 0)
|
|
2190
|
+
return { leading: "", trailing: "" };
|
|
1978
2191
|
let u = [], a = [], s;
|
|
1979
2192
|
return e.each(() => {
|
|
1980
2193
|
let o = e.node;
|
|
1981
|
-
if (r != null && r.has(o))
|
|
2194
|
+
if (r != null && r.has(o))
|
|
2195
|
+
return;
|
|
1982
2196
|
let { leading: i, trailing: l } = o;
|
|
1983
2197
|
i ? u.push(Bp(e, t)) : l && (s = vp(e, t, s), a.push(s.doc));
|
|
1984
2198
|
}, "comments"), { leading: u, trailing: a };
|
|
@@ -1994,7 +2208,8 @@ var kp = class extends Error {
|
|
|
1994
2208
|
}
|
|
1995
2209
|
}, At = kp;
|
|
1996
2210
|
function Pp(e) {
|
|
1997
|
-
if (typeof e != "string")
|
|
2211
|
+
if (typeof e != "string")
|
|
2212
|
+
throw new TypeError("Expected a string");
|
|
1998
2213
|
return e.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
|
|
1999
2214
|
}
|
|
2000
2215
|
var fe, wp = class {
|
|
@@ -2003,12 +2218,14 @@ var fe, wp = class {
|
|
|
2003
2218
|
}
|
|
2004
2219
|
getLeadingWhitespaceCount(e) {
|
|
2005
2220
|
let t = Je(this, fe), n = 0;
|
|
2006
|
-
for (let r = 0; r < e.length && t.has(e.charAt(r)); r++)
|
|
2221
|
+
for (let r = 0; r < e.length && t.has(e.charAt(r)); r++)
|
|
2222
|
+
n++;
|
|
2007
2223
|
return n;
|
|
2008
2224
|
}
|
|
2009
2225
|
getTrailingWhitespaceCount(e) {
|
|
2010
2226
|
let t = Je(this, fe), n = 0;
|
|
2011
|
-
for (let r = e.length - 1; r >= 0 && t.has(e.charAt(r)); r--)
|
|
2227
|
+
for (let r = e.length - 1; r >= 0 && t.has(e.charAt(r)); r--)
|
|
2228
|
+
n++;
|
|
2012
2229
|
return n;
|
|
2013
2230
|
}
|
|
2014
2231
|
getLeadingWhitespace(e) {
|
|
@@ -2059,17 +2276,21 @@ var Ip = wp, Wt = new Ip(`
|
|
|
2059
2276
|
function Np(e, t, n) {
|
|
2060
2277
|
var r, u, a, s, o;
|
|
2061
2278
|
let { node: i } = e;
|
|
2062
|
-
if (i.type === "JSXElement" && Hp(i))
|
|
2279
|
+
if (i.type === "JSXElement" && Hp(i))
|
|
2280
|
+
return [n("openingElement"), n("closingElement")];
|
|
2063
2281
|
let l = i.type === "JSXElement" ? n("openingElement") : n("openingFragment"), d = i.type === "JSXElement" ? n("closingElement") : n("closingFragment");
|
|
2064
|
-
if (i.children.length === 1 && i.children[0].type === "JSXExpressionContainer" && (i.children[0].expression.type === "TemplateLiteral" || i.children[0].expression.type === "TaggedTemplateExpression"))
|
|
2282
|
+
if (i.children.length === 1 && i.children[0].type === "JSXExpressionContainer" && (i.children[0].expression.type === "TemplateLiteral" || i.children[0].expression.type === "TaggedTemplateExpression"))
|
|
2283
|
+
return [l, ...e.map(n, "children"), d];
|
|
2065
2284
|
i.children = i.children.map((k) => zp(k) ? { type: "JSXText", value: " ", raw: " " } : k);
|
|
2066
2285
|
let D = i.children.some(K), c = i.children.filter((k) => k.type === "JSXExpressionContainer").length > 1, p = i.type === "JSXElement" && i.openingElement.attributes.length > 1, y = ne(l) || D || p || c, f = e.parent.rootMarker === "mdx", g = t.singleQuote ? "{' '}" : '{" "}', S = f ? C : w([g, E], " "), b = ((u = (r = i.openingElement) == null ? void 0 : r.name) == null ? void 0 : u.name) === "fbt", x = jp(e, t, n, S, b), j = i.children.some((k) => wt(k));
|
|
2067
2286
|
for (let k = x.length - 2; k >= 0; k--) {
|
|
2068
2287
|
let O = x[k] === "" && x[k + 1] === "", G = x[k] === F && x[k + 1] === "" && x[k + 2] === F, U = (x[k] === E || x[k] === F) && x[k + 1] === "" && x[k + 2] === S, Oe = x[k] === S && x[k + 1] === "" && (x[k + 2] === E || x[k + 2] === F), P = x[k] === S && x[k + 1] === "" && x[k + 2] === S, V = x[k] === E && x[k + 1] === "" && x[k + 2] === F || x[k] === F && x[k + 1] === "" && x[k + 2] === E;
|
|
2069
2288
|
G && j || O || U || P || V ? x.splice(k, 2) : Oe && x.splice(k + 1, 2);
|
|
2070
2289
|
}
|
|
2071
|
-
for (; x.length > 0 && En(X(!1, x, -1)); )
|
|
2072
|
-
|
|
2290
|
+
for (; x.length > 0 && En(X(!1, x, -1)); )
|
|
2291
|
+
x.pop();
|
|
2292
|
+
for (; x.length > 1 && En(x[0]) && En(x[1]); )
|
|
2293
|
+
x.shift(), x.shift();
|
|
2073
2294
|
let v = [""];
|
|
2074
2295
|
for (let [k, O] of x.entries()) {
|
|
2075
2296
|
if (O === S) {
|
|
@@ -2091,7 +2312,8 @@ function Np(e, t, n) {
|
|
|
2091
2312
|
k % 2 === 0 ? v.push([v.pop(), O]) : v.push(O, ""), ne(O) && (y = !0);
|
|
2092
2313
|
}
|
|
2093
2314
|
let B = j ? Du(v) : m(v, { shouldBreak: !0 });
|
|
2094
|
-
if (((a = t.cursorNode) == null ? void 0 : a.type) === "JSXText" && i.children.includes(t.cursorNode) ? B = [Xt, B, Xt] : ((s = t.nodeBeforeCursor) == null ? void 0 : s.type) === "JSXText" && i.children.includes(t.nodeBeforeCursor) ? B = [Xt, B] : ((o = t.nodeAfterCursor) == null ? void 0 : o.type) === "JSXText" && i.children.includes(t.nodeAfterCursor) && (B = [B, Xt]), f)
|
|
2315
|
+
if (((a = t.cursorNode) == null ? void 0 : a.type) === "JSXText" && i.children.includes(t.cursorNode) ? B = [Xt, B, Xt] : ((s = t.nodeBeforeCursor) == null ? void 0 : s.type) === "JSXText" && i.children.includes(t.nodeBeforeCursor) ? B = [Xt, B] : ((o = t.nodeAfterCursor) == null ? void 0 : o.type) === "JSXText" && i.children.includes(t.nodeAfterCursor) && (B = [B, Xt]), f)
|
|
2316
|
+
return B;
|
|
2095
2317
|
let M = m([l, A([F, B]), F, d]);
|
|
2096
2318
|
return y ? M : Ve([m([l, ...x, d]), M]);
|
|
2097
2319
|
}
|
|
@@ -2110,16 +2332,20 @@ function jp(e, t, n, r, u) {
|
|
|
2110
2332
|
let c = Wt.split(D, !0);
|
|
2111
2333
|
c[0] === "" && (c.shift(), /\n/u.test(c[0]) ? i(vr(u, c[1], l, d)) : i(r), c.shift());
|
|
2112
2334
|
let p;
|
|
2113
|
-
if (X(!1, c, -1) === "" && (c.pop(), p = c.pop()), c.length === 0)
|
|
2114
|
-
|
|
2335
|
+
if (X(!1, c, -1) === "" && (c.pop(), p = c.pop()), c.length === 0)
|
|
2336
|
+
return;
|
|
2337
|
+
for (let [y, f] of c.entries())
|
|
2338
|
+
y % 2 === 1 ? i(C) : o(f);
|
|
2115
2339
|
p !== void 0 ? /\n/u.test(p) ? i(vr(u, a, l, d)) : i(r) : i(Br(u, a, l, d));
|
|
2116
|
-
} else
|
|
2340
|
+
} else
|
|
2341
|
+
/\n/u.test(D) ? D.match(/\n/gu).length > 1 && i(F) : i(r);
|
|
2117
2342
|
} else {
|
|
2118
2343
|
let D = n();
|
|
2119
2344
|
if (o(D), d && wt(d)) {
|
|
2120
2345
|
let c = Wt.trim(se(d)), [p] = Wt.split(c);
|
|
2121
2346
|
i(Br(u, p, l, d));
|
|
2122
|
-
} else
|
|
2347
|
+
} else
|
|
2348
|
+
i(F);
|
|
2123
2349
|
}
|
|
2124
2350
|
}, "children"), s;
|
|
2125
2351
|
}
|
|
@@ -2132,7 +2358,8 @@ function vr(e, t, n, r) {
|
|
|
2132
2358
|
var Lp = /* @__PURE__ */ new Set(["ArrayExpression", "JSXAttribute", "JSXElement", "JSXExpressionContainer", "JSXFragment", "ExpressionStatement", "CallExpression", "OptionalCallExpression", "ConditionalExpression", "JsExpressionRoot"]);
|
|
2133
2359
|
function Mp(e, t, n) {
|
|
2134
2360
|
let { parent: r } = e;
|
|
2135
|
-
if (Lp.has(r.type))
|
|
2361
|
+
if (Lp.has(r.type))
|
|
2362
|
+
return t;
|
|
2136
2363
|
let u = Op(e), a = ut(e, n);
|
|
2137
2364
|
return m([a ? "" : w("("), A([E, t]), E, a ? "" : w(")")], { shouldBreak: u });
|
|
2138
2365
|
}
|
|
@@ -2146,7 +2373,8 @@ function Jp(e, t, n) {
|
|
|
2146
2373
|
if (Y(r.value)) {
|
|
2147
2374
|
let s = se(r.value), o = H(!1, H(!1, s.slice(1, -1), "'", "'"), """, '"'), i = Gr(o, t.jsxSingleQuote);
|
|
2148
2375
|
o = i === '"' ? H(!1, o, '"', """) : H(!1, o, "'", "'"), a = e.call(() => Fe(e, He(i + o + i), t), "value");
|
|
2149
|
-
} else
|
|
2376
|
+
} else
|
|
2377
|
+
a = n("value");
|
|
2150
2378
|
u.push("=", a);
|
|
2151
2379
|
}
|
|
2152
2380
|
return u;
|
|
@@ -2158,9 +2386,11 @@ function qp(e, t, n) {
|
|
|
2158
2386
|
function _p(e, t, n) {
|
|
2159
2387
|
var r, u;
|
|
2160
2388
|
let { node: a } = e, s = h(a.name) || h(a.typeParameters) || h(a.typeArguments);
|
|
2161
|
-
if (a.selfClosing && a.attributes.length === 0 && !s)
|
|
2389
|
+
if (a.selfClosing && a.attributes.length === 0 && !s)
|
|
2390
|
+
return ["<", n("name"), a.typeArguments ? n("typeArguments") : n("typeParameters"), " />"];
|
|
2162
2391
|
if (((r = a.attributes) == null ? void 0 : r.length) === 1 && Y(a.attributes[0].value) && !a.attributes[0].value.value.includes(`
|
|
2163
|
-
`) && !s && !h(a.attributes[0]))
|
|
2392
|
+
`) && !s && !h(a.attributes[0]))
|
|
2393
|
+
return m(["<", n("name"), a.typeArguments ? n("typeArguments") : n("typeParameters"), " ", ...e.map(n, "attributes"), a.selfClosing ? " />" : ">"]);
|
|
2164
2394
|
let o = (u = a.attributes) == null ? void 0 : u.some((l) => Y(l.value) && l.value.value.includes(`
|
|
2165
2395
|
`)), i = t.singleAttributePerLine && a.attributes.length > 1 ? F : C;
|
|
2166
2396
|
return m(["<", n("name"), a.typeArguments ? n("typeArguments") : n("typeParameters"), A(e.map(() => [i, n()], "attributes")), ...Xp(a, t, s)], { shouldBreak: o });
|
|
@@ -2199,41 +2429,44 @@ function Vp(e, t, n) {
|
|
|
2199
2429
|
}
|
|
2200
2430
|
function Kp(e, t, n) {
|
|
2201
2431
|
let { node: r } = e;
|
|
2202
|
-
if (r.type.startsWith("JSX"))
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2432
|
+
if (r.type.startsWith("JSX"))
|
|
2433
|
+
switch (r.type) {
|
|
2434
|
+
case "JSXAttribute":
|
|
2435
|
+
return Jp(e, t, n);
|
|
2436
|
+
case "JSXIdentifier":
|
|
2437
|
+
return r.name;
|
|
2438
|
+
case "JSXNamespacedName":
|
|
2439
|
+
return N(":", [n("namespace"), n("name")]);
|
|
2440
|
+
case "JSXMemberExpression":
|
|
2441
|
+
return N(".", [n("object"), n("property")]);
|
|
2442
|
+
case "JSXSpreadAttribute":
|
|
2443
|
+
case "JSXSpreadChild":
|
|
2444
|
+
return Vp(e, t, n);
|
|
2445
|
+
case "JSXExpressionContainer":
|
|
2446
|
+
return qp(e, t, n);
|
|
2447
|
+
case "JSXFragment":
|
|
2448
|
+
case "JSXElement":
|
|
2449
|
+
return Up(e, t, n);
|
|
2450
|
+
case "JSXOpeningElement":
|
|
2451
|
+
return _p(e, t, n);
|
|
2452
|
+
case "JSXClosingElement":
|
|
2453
|
+
return Rp(e, t, n);
|
|
2454
|
+
case "JSXOpeningFragment":
|
|
2455
|
+
case "JSXClosingFragment":
|
|
2456
|
+
return Wp(e, t);
|
|
2457
|
+
case "JSXEmptyExpression":
|
|
2458
|
+
return Gp(e, t);
|
|
2459
|
+
case "JSXText":
|
|
2460
|
+
throw new Error("JSXText should be handled by JSXElement");
|
|
2461
|
+
default:
|
|
2462
|
+
throw new At(r, "JSX");
|
|
2463
|
+
}
|
|
2233
2464
|
}
|
|
2234
2465
|
function Hp(e) {
|
|
2235
|
-
if (e.children.length === 0)
|
|
2236
|
-
|
|
2466
|
+
if (e.children.length === 0)
|
|
2467
|
+
return !0;
|
|
2468
|
+
if (e.children.length > 1)
|
|
2469
|
+
return !1;
|
|
2237
2470
|
let t = e.children[0];
|
|
2238
2471
|
return t.type === "JSXText" && !wt(t);
|
|
2239
2472
|
}
|
|
@@ -2245,7 +2478,8 @@ function zp(e) {
|
|
|
2245
2478
|
}
|
|
2246
2479
|
function Qp(e) {
|
|
2247
2480
|
let { node: t, parent: n } = e;
|
|
2248
|
-
if (!K(t) || !K(n))
|
|
2481
|
+
if (!K(t) || !K(n))
|
|
2482
|
+
return !1;
|
|
2249
2483
|
let { index: r, siblings: u } = e, a;
|
|
2250
2484
|
for (let s = r; s > 0; s--) {
|
|
2251
2485
|
let o = u[s - 1];
|
|
@@ -2263,39 +2497,49 @@ var _u = Yp, Zp = 0;
|
|
|
2263
2497
|
function Xu(e, t, n) {
|
|
2264
2498
|
var r;
|
|
2265
2499
|
let { node: u, parent: a, grandparent: s, key: o } = e, i = o !== "body" && (a.type === "IfStatement" || a.type === "WhileStatement" || a.type === "SwitchStatement" || a.type === "DoWhileStatement"), l = u.operator === "|>" && ((r = e.root.extra) == null ? void 0 : r.__isUsingHackPipeline), d = jn(e, t, n, !1, i);
|
|
2266
|
-
if (i)
|
|
2267
|
-
|
|
2268
|
-
if (
|
|
2500
|
+
if (i)
|
|
2501
|
+
return d;
|
|
2502
|
+
if (l)
|
|
2503
|
+
return m(d);
|
|
2504
|
+
if (L(a) && a.callee === u || a.type === "UnaryExpression" || R(a) && !a.computed)
|
|
2505
|
+
return m([A([E, ...d]), E]);
|
|
2269
2506
|
let D = a.type === "ReturnStatement" || a.type === "ThrowStatement" || a.type === "JSXExpressionContainer" && s.type === "JSXAttribute" || u.operator !== "|" && a.type === "JsExpressionRoot" || u.type !== "NGPipeExpression" && (a.type === "NGRoot" && t.parser === "__ng_binding" || a.type === "NGMicrosyntaxExpression" && s.type === "NGMicrosyntax" && s.body.length === 1) || u === a.body && a.type === "ArrowFunctionExpression" || u !== a.body && a.type === "ForStatement" || a.type === "ConditionalExpression" && s.type !== "ReturnStatement" && s.type !== "ThrowStatement" && !L(s) || a.type === "TemplateLiteral", c = a.type === "AssignmentExpression" || a.type === "VariableDeclarator" || a.type === "ClassProperty" || a.type === "PropertyDefinition" || a.type === "TSAbstractPropertyDefinition" || a.type === "ClassPrivateProperty" || je(a), p = ke(u.left) && Vn(u.operator, u.left.operator);
|
|
2270
|
-
if (D || It(u) && !p || !It(u) && c)
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2507
|
+
if (D || It(u) && !p || !It(u) && c)
|
|
2508
|
+
return m(d);
|
|
2509
|
+
if (d.length === 0)
|
|
2510
|
+
return "";
|
|
2511
|
+
let y = K(u.right), f = d.findIndex((v) => typeof v != "string" && !Array.isArray(v) && v.type === De), g = d.slice(0, f === -1 ? 1 : f + 1), S = d.slice(g.length, y ? -1 : void 0), b = Symbol("logicalChain-" + ++Zp), x = m([...g, A(S)], { id: b });
|
|
2512
|
+
if (!y)
|
|
2513
|
+
return x;
|
|
2274
2514
|
let j = X(!1, d, -1);
|
|
2275
2515
|
return m([x, un(j, { groupId: b })]);
|
|
2276
2516
|
}
|
|
2277
2517
|
function jn(e, t, n, r, u) {
|
|
2278
2518
|
var a;
|
|
2279
2519
|
let { node: s } = e;
|
|
2280
|
-
if (!ke(s))
|
|
2520
|
+
if (!ke(s))
|
|
2521
|
+
return [m(n())];
|
|
2281
2522
|
let o = [];
|
|
2282
2523
|
Vn(s.operator, s.left.operator) ? o = e.call((g) => jn(g, t, n, !0, u), "left") : o.push(m(n("left")));
|
|
2283
2524
|
let i = It(s), l = (s.operator === "|>" || s.type === "NGPipeExpression" || el(e, t)) && !Te(t.originalText, s.right), d = !h(s.right, T.Leading, fu) && Te(t.originalText, s.right), D = s.type === "NGPipeExpression" ? "|" : s.operator, c = s.type === "NGPipeExpression" && s.arguments.length > 0 ? m(A([E, ": ", N([C, ": "], e.map(() => Be(2, m(n())), "arguments"))])) : "", p;
|
|
2284
|
-
if (i)
|
|
2525
|
+
if (i)
|
|
2526
|
+
p = [D, Te(t.originalText, s.right) ? A([C, n("right"), c]) : [" ", n("right"), c]];
|
|
2285
2527
|
else {
|
|
2286
2528
|
let g = D === "|>" && ((a = e.root.extra) != null && a.__isUsingHackPipeline) ? e.call((S) => jn(S, t, n, !0, u), "right") : n("right");
|
|
2287
2529
|
if (t.experimentalOperatorPosition === "start") {
|
|
2288
2530
|
let S = "";
|
|
2289
|
-
if (d)
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2531
|
+
if (d)
|
|
2532
|
+
switch (Ge(g)) {
|
|
2533
|
+
case Pe:
|
|
2534
|
+
S = g.splice(0, 1)[0];
|
|
2535
|
+
break;
|
|
2536
|
+
case Le:
|
|
2537
|
+
S = g.contents.splice(0, 1)[0];
|
|
2538
|
+
break;
|
|
2539
|
+
}
|
|
2297
2540
|
p = [C, S, D, " ", g, c];
|
|
2298
|
-
} else
|
|
2541
|
+
} else
|
|
2542
|
+
p = [l ? C : "", D, l ? " " : C, g, c];
|
|
2299
2543
|
}
|
|
2300
2544
|
let { parent: y } = e, f = h(s.left, T.Trailing | T.Line);
|
|
2301
2545
|
if ((f || !(u && s.type === "LogicalExpression") && y.type !== s.type && s.left.type !== s.type && s.right.type !== s.type) && (p = m(p, { shouldBreak: f })), t.experimentalOperatorPosition === "start" ? o.push(i || d ? " " : "", p) : o.push(l ? "" : " ", p), r && h(s)) {
|
|
@@ -2313,32 +2557,33 @@ function el(e, t) {
|
|
|
2313
2557
|
}
|
|
2314
2558
|
function tl(e, t, n) {
|
|
2315
2559
|
let { node: r } = e;
|
|
2316
|
-
if (r.type.startsWith("NG"))
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2560
|
+
if (r.type.startsWith("NG"))
|
|
2561
|
+
switch (r.type) {
|
|
2562
|
+
case "NGRoot":
|
|
2563
|
+
return [n("node"), h(r.node) ? " //" + Ke(r.node)[0].value.trimEnd() : ""];
|
|
2564
|
+
case "NGPipeExpression":
|
|
2565
|
+
return Xu(e, t, n);
|
|
2566
|
+
case "NGChainedExpression":
|
|
2567
|
+
return m(N([";", C], e.map(() => ul(e) ? n() : ["(", n(), ")"], "expressions")));
|
|
2568
|
+
case "NGEmptyExpression":
|
|
2569
|
+
return "";
|
|
2570
|
+
case "NGMicrosyntax":
|
|
2571
|
+
return e.map(() => [e.isFirst ? "" : Pr(e) ? " " : [";", C], n()], "body");
|
|
2572
|
+
case "NGMicrosyntaxKey":
|
|
2573
|
+
return /^[$_a-z][\w$]*(?:-[$_a-z][\w$])*$/iu.test(r.name) ? r.name : JSON.stringify(r.name);
|
|
2574
|
+
case "NGMicrosyntaxExpression":
|
|
2575
|
+
return [n("expression"), r.alias === null ? "" : [" as ", n("alias")]];
|
|
2576
|
+
case "NGMicrosyntaxKeyedExpression": {
|
|
2577
|
+
let { index: u, parent: a } = e, s = Pr(e) || nl(e) || (u === 1 && (r.key.name === "then" || r.key.name === "else" || r.key.name === "as") || u === 2 && (r.key.name === "else" && a.body[u - 1].type === "NGMicrosyntaxKeyedExpression" && a.body[u - 1].key.name === "then" || r.key.name === "track")) && a.body[0].type === "NGMicrosyntaxExpression";
|
|
2578
|
+
return [n("key"), s ? " " : ": ", n("expression")];
|
|
2579
|
+
}
|
|
2580
|
+
case "NGMicrosyntaxLet":
|
|
2581
|
+
return ["let ", n("key"), r.value === null ? "" : [" = ", n("value")]];
|
|
2582
|
+
case "NGMicrosyntaxAs":
|
|
2583
|
+
return [n("key"), " as ", n("alias")];
|
|
2584
|
+
default:
|
|
2585
|
+
throw new At(r, "Angular");
|
|
2334
2586
|
}
|
|
2335
|
-
case "NGMicrosyntaxLet":
|
|
2336
|
-
return ["let ", n("key"), r.value === null ? "" : [" = ", n("value")]];
|
|
2337
|
-
case "NGMicrosyntaxAs":
|
|
2338
|
-
return [n("key"), " as ", n("alias")];
|
|
2339
|
-
default:
|
|
2340
|
-
throw new At(r, "Angular");
|
|
2341
|
-
}
|
|
2342
2587
|
}
|
|
2343
2588
|
function Pr({ node: e, index: t }) {
|
|
2344
2589
|
return e.type === "NGMicrosyntaxKeyedExpression" && e.key.name === "of" && t === 1;
|
|
@@ -2360,7 +2605,8 @@ function al(e, t, n) {
|
|
|
2360
2605
|
}
|
|
2361
2606
|
function sl(e, t, n) {
|
|
2362
2607
|
let { node: r, parent: u } = e, { decorators: a } = r;
|
|
2363
|
-
if (!J(a) || Wu(u) || _u(e))
|
|
2608
|
+
if (!J(a) || Wu(u) || _u(e))
|
|
2609
|
+
return "";
|
|
2364
2610
|
let s = r.type === "ClassExpression" || r.type === "ClassDeclaration" || Ru(r, t);
|
|
2365
2611
|
return [e.key === "declaration" && Gs(u) ? F : s ? ve : "", N(C, e.map(n, "decorators")), C];
|
|
2366
2612
|
}
|
|
@@ -2369,7 +2615,8 @@ function Ru(e, t) {
|
|
|
2369
2615
|
}
|
|
2370
2616
|
function Wu(e) {
|
|
2371
2617
|
var t;
|
|
2372
|
-
if (e.type !== "ExportDefaultDeclaration" && e.type !== "ExportNamedDeclaration" && e.type !== "DeclareExportDeclaration")
|
|
2618
|
+
if (e.type !== "ExportDefaultDeclaration" && e.type !== "ExportNamedDeclaration" && e.type !== "DeclareExportDeclaration")
|
|
2619
|
+
return !1;
|
|
2373
2620
|
let n = (t = e.declaration) == null ? void 0 : t.decorators;
|
|
2374
2621
|
return J(n) && en(e, n[0]);
|
|
2375
2622
|
}
|
|
@@ -2378,7 +2625,8 @@ var zt = class extends Error {
|
|
|
2378
2625
|
};
|
|
2379
2626
|
function ol(e, t, n) {
|
|
2380
2627
|
let { node: r } = e, u = de(r);
|
|
2381
|
-
if (u.length === 0)
|
|
2628
|
+
if (u.length === 0)
|
|
2629
|
+
return ["(", $(e, t), ")"];
|
|
2382
2630
|
let a = u.length - 1;
|
|
2383
2631
|
if (ll(u)) {
|
|
2384
2632
|
let D = ["("];
|
|
@@ -2392,31 +2640,37 @@ function ol(e, t, n) {
|
|
|
2392
2640
|
c === a || (Ne(D, t) ? (s = !0, p = [p, ",", F, F]) : p = [p, ",", C]), o.push(p);
|
|
2393
2641
|
});
|
|
2394
2642
|
let i = !t.parser.startsWith("__ng_") && r.type !== "ImportExpression" && r.type !== "TSImportType" && Ie(t, "all") ? "," : "";
|
|
2395
|
-
if (r.type === "TSImportType" && u.length === 1 && (u[0].type === "TSLiteralType" && Y(u[0].literal) || Y(u[0])) && !h(u[0]))
|
|
2643
|
+
if (r.type === "TSImportType" && u.length === 1 && (u[0].type === "TSLiteralType" && Y(u[0].literal) || Y(u[0])) && !h(u[0]))
|
|
2644
|
+
return m(["(", ...o, w(i), ")"]);
|
|
2396
2645
|
function l() {
|
|
2397
2646
|
return m(["(", A([C, ...o]), i, C, ")"], { shouldBreak: !0 });
|
|
2398
2647
|
}
|
|
2399
|
-
if (s || e.parent.type !== "Decorator" && ro(u))
|
|
2648
|
+
if (s || e.parent.type !== "Decorator" && ro(u))
|
|
2649
|
+
return l();
|
|
2400
2650
|
if (pl(u)) {
|
|
2401
2651
|
let D = o.slice(1);
|
|
2402
|
-
if (D.some(ne))
|
|
2652
|
+
if (D.some(ne))
|
|
2653
|
+
return l();
|
|
2403
2654
|
let c;
|
|
2404
2655
|
try {
|
|
2405
2656
|
c = n(Ar(r, 0), { expandFirstArg: !0 });
|
|
2406
2657
|
} catch (p) {
|
|
2407
|
-
if (p instanceof zt)
|
|
2658
|
+
if (p instanceof zt)
|
|
2659
|
+
return l();
|
|
2408
2660
|
throw p;
|
|
2409
2661
|
}
|
|
2410
2662
|
return ne(c) ? [ve, Ve([["(", m(c, { shouldBreak: !0 }), ", ", ...D, ")"], l()])] : Ve([["(", c, ", ", ...D, ")"], ["(", m(c, { shouldBreak: !0 }), ", ", ...D, ")"], l()]);
|
|
2411
2663
|
}
|
|
2412
2664
|
if (il(u, o, t)) {
|
|
2413
2665
|
let D = o.slice(0, -1);
|
|
2414
|
-
if (D.some(ne))
|
|
2666
|
+
if (D.some(ne))
|
|
2667
|
+
return l();
|
|
2415
2668
|
let c;
|
|
2416
2669
|
try {
|
|
2417
2670
|
c = n(Ar(r, -1), { expandLastArg: !0 });
|
|
2418
2671
|
} catch (p) {
|
|
2419
|
-
if (p instanceof zt)
|
|
2672
|
+
if (p instanceof zt)
|
|
2673
|
+
return l();
|
|
2420
2674
|
throw p;
|
|
2421
2675
|
}
|
|
2422
2676
|
return ne(c) ? [ve, Ve([["(", ...D, m(c, { shouldBreak: !0 }), ")"], l()])] : Ve([["(", ...D, c, ")"], ["(", ...D, m(c, { shouldBreak: !0 }), ")"], l()]);
|
|
@@ -2432,18 +2686,21 @@ function il(e, t, n) {
|
|
|
2432
2686
|
let a = X(!1, e, -1);
|
|
2433
2687
|
if (e.length === 1) {
|
|
2434
2688
|
let o = X(!1, t, -1);
|
|
2435
|
-
if ((r = o.label) != null && r.embed && ((u = o.label) == null ? void 0 : u.hug) !== !1)
|
|
2689
|
+
if ((r = o.label) != null && r.embed && ((u = o.label) == null ? void 0 : u.hug) !== !1)
|
|
2690
|
+
return !0;
|
|
2436
2691
|
}
|
|
2437
2692
|
let s = X(!1, e, -2);
|
|
2438
2693
|
return !h(a, T.Leading) && !h(a, T.Trailing) && Bt(a) && (!s || s.type !== a.type) && (e.length !== 2 || s.type !== "ArrowFunctionExpression" || !Q(a)) && !(e.length > 1 && fa(a, n));
|
|
2439
2694
|
}
|
|
2440
2695
|
function pl(e) {
|
|
2441
|
-
if (e.length !== 2)
|
|
2696
|
+
if (e.length !== 2)
|
|
2697
|
+
return !1;
|
|
2442
2698
|
let [t, n] = e;
|
|
2443
2699
|
return t.type === "ModuleExpression" && Dl(n) ? !0 : !h(t) && (t.type === "FunctionExpression" || t.type === "ArrowFunctionExpression" && t.body.type === "BlockStatement") && n.type !== "FunctionExpression" && n.type !== "ArrowFunctionExpression" && n.type !== "ConditionalExpression" && Uu(n) && !Bt(n);
|
|
2444
2700
|
}
|
|
2445
2701
|
function Uu(e) {
|
|
2446
|
-
if (e.type === "ParenthesizedExpression")
|
|
2702
|
+
if (e.type === "ParenthesizedExpression")
|
|
2703
|
+
return Uu(e.expression);
|
|
2447
2704
|
if (Ce(e) || e.type === "TypeCastExpression") {
|
|
2448
2705
|
let { typeAnnotation: t } = e;
|
|
2449
2706
|
if (t.type === "TypeAnnotation" && (t = t.typeAnnotation), t.type === "TSArrayType" && (t = t.elementType, t.type === "TSArrayType" && (t = t.elementType)), t.type === "GenericTypeAnnotation" || t.type === "TSTypeReference") {
|
|
@@ -2465,7 +2722,8 @@ function cl(e) {
|
|
|
2465
2722
|
return e.type === "BlockStatement" && (e.body.some((t) => t.type !== "EmptyStatement") || h(e, T.Dangling));
|
|
2466
2723
|
}
|
|
2467
2724
|
function Dl(e) {
|
|
2468
|
-
if (!(e.type === "ObjectExpression" && e.properties.length === 1))
|
|
2725
|
+
if (!(e.type === "ObjectExpression" && e.properties.length === 1))
|
|
2726
|
+
return !1;
|
|
2469
2727
|
let [t] = e.properties;
|
|
2470
2728
|
return je(t) ? !t.computed && (t.key.type === "Identifier" && t.key.name === "type" || Y(t.key) && t.key.value === "type") && Y(t.value) && t.value.value === "module" : !1;
|
|
2471
2729
|
}
|
|
@@ -2480,7 +2738,8 @@ function Gu(e, t, n) {
|
|
|
2480
2738
|
return u.computed ? !u.property || be(u.property) ? [a, "[", r, "]"] : m([a, "[", A([E, r]), E, "]"]) : [a, ".", r];
|
|
2481
2739
|
}
|
|
2482
2740
|
function Vu(e, t, n) {
|
|
2483
|
-
if (e.node.type === "ChainExpression")
|
|
2741
|
+
if (e.node.type === "ChainExpression")
|
|
2742
|
+
return e.call(() => Vu(e, t, n), "expression");
|
|
2484
2743
|
let r = (e.parent.type === "ChainExpression" ? e.grandparent : e.parent).type === "ExpressionStatement", u = [];
|
|
2485
2744
|
function a(P) {
|
|
2486
2745
|
let { originalText: V } = t, ue = Ft(V, I(P));
|
|
@@ -2488,17 +2747,22 @@ function Vu(e, t, n) {
|
|
|
2488
2747
|
}
|
|
2489
2748
|
function s() {
|
|
2490
2749
|
let { node: P } = e;
|
|
2491
|
-
if (P.type === "ChainExpression")
|
|
2750
|
+
if (P.type === "ChainExpression")
|
|
2751
|
+
return e.call(s, "expression");
|
|
2492
2752
|
if (L(P) && (it(P.callee) || L(P.callee))) {
|
|
2493
2753
|
let V = a(P);
|
|
2494
2754
|
u.unshift({ node: P, hasTrailingEmptyLine: V, printed: [Fe(e, [re(e), ze(e, t, n), Qt(e, t, n)], t), V ? F : ""] }), e.call(s, "callee");
|
|
2495
|
-
} else
|
|
2755
|
+
} else
|
|
2756
|
+
it(P) ? (u.unshift({ node: P, needsParens: ut(e, t), printed: Fe(e, R(P) ? Gu(e, t, n) : da(e, t, n), t) }), e.call(s, "object")) : P.type === "TSNonNullExpression" ? (u.unshift({ node: P, printed: Fe(e, "!", t) }), e.call(s, "expression")) : u.unshift({ node: P, printed: n() });
|
|
2496
2757
|
}
|
|
2497
2758
|
let { node: o } = e;
|
|
2498
2759
|
u.unshift({ node: o, printed: [re(e), ze(e, t, n), Qt(e, t, n)] }), o.callee && e.call(s, "callee");
|
|
2499
2760
|
let i = [], l = [u[0]], d = 1;
|
|
2500
|
-
for (; d < u.length && (u[d].node.type === "TSNonNullExpression" || L(u[d].node) || R(u[d].node) && u[d].node.computed && be(u[d].node.property)); ++d)
|
|
2501
|
-
|
|
2761
|
+
for (; d < u.length && (u[d].node.type === "TSNonNullExpression" || L(u[d].node) || R(u[d].node) && u[d].node.computed && be(u[d].node.property)); ++d)
|
|
2762
|
+
l.push(u[d]);
|
|
2763
|
+
if (!L(u[0].node))
|
|
2764
|
+
for (; d + 1 < u.length && it(u[d].node) && it(u[d + 1].node); ++d)
|
|
2765
|
+
l.push(u[d]);
|
|
2502
2766
|
i.push(l), l = [];
|
|
2503
2767
|
let D = !1;
|
|
2504
2768
|
for (; d < u.length; ++d) {
|
|
@@ -2537,7 +2801,8 @@ function Vu(e, t, n) {
|
|
|
2537
2801
|
return P.length === 0 ? "" : A([F, N(F, P.map(g))]);
|
|
2538
2802
|
}
|
|
2539
2803
|
let b = i.map(g), x = b, j = f ? 3 : 2, v = i.flat(), B = v.slice(1, -1).some((P) => h(P.node, T.Leading)) || v.slice(0, -1).some((P) => h(P.node, T.Trailing)) || i[j] && h(i[j][0].node, T.Leading);
|
|
2540
|
-
if (i.length <= j && !B && !i.some((P) => X(!1, P, -1).hasTrailingEmptyLine))
|
|
2804
|
+
if (i.length <= j && !B && !i.some((P) => X(!1, P, -1).hasTrailingEmptyLine))
|
|
2805
|
+
return su(e) ? x : m(x);
|
|
2541
2806
|
let M = X(!1, i[f ? 1 : 0], -1).node, k = !L(M) && a(M), O = [g(i[0]), f ? i.slice(1, 2).map(g) : "", k ? F : "", S(i.slice(f ? 2 : 1))], G = u.map(({ node: P }) => P).filter(L);
|
|
2542
2807
|
function U() {
|
|
2543
2808
|
let P = X(!1, X(!1, i, -1), -1).node, V = X(!1, b, -1);
|
|
@@ -2554,9 +2819,11 @@ function Ku(e, t, n) {
|
|
|
2554
2819
|
let D = [];
|
|
2555
2820
|
if (Kt(e, () => {
|
|
2556
2821
|
D.push(n());
|
|
2557
|
-
}), !(l && (r = D[0].label) != null && r.embed))
|
|
2822
|
+
}), !(l && (r = D[0].label) != null && r.embed))
|
|
2823
|
+
return [a ? "new " : "", Ir(e, n), o, ze(e, t, n), "(", N(", ", D), ")"];
|
|
2558
2824
|
}
|
|
2559
|
-
if (!s && !a && it(u.callee) && !e.call((D) => ut(D, t), "callee", ...u.callee.type === "ChainExpression" ? ["expression"] : []))
|
|
2825
|
+
if (!s && !a && it(u.callee) && !e.call((D) => ut(D, t), "callee", ...u.callee.type === "ChainExpression" ? ["expression"] : []))
|
|
2826
|
+
return ml(e, t, n);
|
|
2560
2827
|
let d = [a ? "new " : "", Ir(e, n), o, ze(e, t, n), Qt(e, t, n)];
|
|
2561
2828
|
return s || L(u.callee) ? m(d) : d;
|
|
2562
2829
|
}
|
|
@@ -2566,7 +2833,8 @@ function Ir(e, t) {
|
|
|
2566
2833
|
}
|
|
2567
2834
|
function fl(e) {
|
|
2568
2835
|
let { node: t } = e;
|
|
2569
|
-
if (t.type !== "CallExpression" || t.optional || t.callee.type !== "Identifier")
|
|
2836
|
+
if (t.type !== "CallExpression" || t.optional || t.callee.type !== "Identifier")
|
|
2837
|
+
return !1;
|
|
2570
2838
|
let n = de(t);
|
|
2571
2839
|
return t.callee.name === "require" ? n.length === 1 && Y(n[0]) || n.length > 1 : t.callee.name === "define" && e.parent.type === "ExpressionStatement" ? n.length === 1 || n.length === 2 && n[0].type === "ArrayExpression" || n.length === 3 && Y(n[0]) && n[1].type === "ArrayExpression" : !1;
|
|
2572
2840
|
}
|
|
@@ -2578,7 +2846,7 @@ function Lt(e, t, n, r, u, a) {
|
|
|
2578
2846
|
case "never-break-after-operator":
|
|
2579
2847
|
return m([m(r), u, " ", o]);
|
|
2580
2848
|
case "fluid": {
|
|
2581
|
-
let i =
|
|
2849
|
+
let i = Symbol("assignment");
|
|
2582
2850
|
return m([m(r), u, m(A(C), { id: i }), we, un(o, { groupId: i })]);
|
|
2583
2851
|
}
|
|
2584
2852
|
case "break-lhs":
|
|
@@ -2602,26 +2870,33 @@ function Fl(e, t, n) {
|
|
|
2602
2870
|
}
|
|
2603
2871
|
function Al(e, t, n, r, u) {
|
|
2604
2872
|
let { node: a } = e, s = a[u];
|
|
2605
|
-
if (!s)
|
|
2873
|
+
if (!s)
|
|
2874
|
+
return "only-left";
|
|
2606
2875
|
let o = !Ut(s);
|
|
2607
|
-
if (e.match(Ut, Hu, (d) => !o || d.type !== "ExpressionStatement" && d.type !== "VariableDeclaration"))
|
|
2608
|
-
|
|
2609
|
-
if (
|
|
2876
|
+
if (e.match(Ut, Hu, (d) => !o || d.type !== "ExpressionStatement" && d.type !== "VariableDeclaration"))
|
|
2877
|
+
return o ? s.type === "ArrowFunctionExpression" && s.body.type === "ArrowFunctionExpression" ? "chain-tail-arrow-chain" : "chain-tail" : "chain";
|
|
2878
|
+
if (!o && Ut(s.right) || Te(t.originalText, s))
|
|
2879
|
+
return "break-after-operator";
|
|
2880
|
+
if (a.type === "ImportAttribute" || s.type === "CallExpression" && s.callee.name === "require" || t.parser === "json5" || t.parser === "jsonc" || t.parser === "json")
|
|
2881
|
+
return "never-break-after-operator";
|
|
2610
2882
|
let i = Co(r);
|
|
2611
|
-
if (xl(a) || Sl(a) || zu(a) && i)
|
|
2883
|
+
if (xl(a) || Sl(a) || zu(a) && i)
|
|
2884
|
+
return "break-lhs";
|
|
2612
2885
|
let l = Bl(a, r, t);
|
|
2613
2886
|
return e.call(() => gl(e, t, n, l), u) ? "break-after-operator" : hl(a) ? "break-lhs" : !i && (l || s.type === "TemplateLiteral" || s.type === "TaggedTemplateExpression" || Ks(s) || be(s) || s.type === "ClassExpression") ? "never-break-after-operator" : "fluid";
|
|
2614
2887
|
}
|
|
2615
2888
|
function gl(e, t, n, r) {
|
|
2616
2889
|
let u = e.node;
|
|
2617
|
-
if (ke(u) && !It(u))
|
|
2890
|
+
if (ke(u) && !It(u))
|
|
2891
|
+
return !0;
|
|
2618
2892
|
switch (u.type) {
|
|
2619
2893
|
case "StringLiteralTypeAnnotation":
|
|
2620
2894
|
case "SequenceExpression":
|
|
2621
2895
|
return !0;
|
|
2622
2896
|
case "TSConditionalType":
|
|
2623
2897
|
case "ConditionalTypeAnnotation":
|
|
2624
|
-
if (!t.experimentalTernaries && !Pl(u))
|
|
2898
|
+
if (!t.experimentalTernaries && !Pl(u))
|
|
2899
|
+
break;
|
|
2625
2900
|
return !0;
|
|
2626
2901
|
case "ConditionalExpression": {
|
|
2627
2902
|
if (!t.experimentalTernaries) {
|
|
@@ -2634,11 +2909,16 @@ function gl(e, t, n, r) {
|
|
|
2634
2909
|
case "ClassExpression":
|
|
2635
2910
|
return J(u.decorators);
|
|
2636
2911
|
}
|
|
2637
|
-
if (r)
|
|
2912
|
+
if (r)
|
|
2913
|
+
return !1;
|
|
2638
2914
|
let a = u, s = [];
|
|
2639
|
-
for (; ; )
|
|
2640
|
-
|
|
2641
|
-
|
|
2915
|
+
for (; ; )
|
|
2916
|
+
if (a.type === "UnaryExpression" || a.type === "AwaitExpression" || a.type === "YieldExpression" && a.argument !== null)
|
|
2917
|
+
a = a.argument, s.push("argument");
|
|
2918
|
+
else if (a.type === "TSNonNullExpression")
|
|
2919
|
+
a = a.expression, s.push("expression");
|
|
2920
|
+
else
|
|
2921
|
+
break;
|
|
2642
2922
|
return !!(Y(a) || e.call(() => Qu(e, t, n), ...s));
|
|
2643
2923
|
}
|
|
2644
2924
|
function xl(e) {
|
|
@@ -2661,19 +2941,23 @@ function hl(e) {
|
|
|
2661
2941
|
let t = Tl(e);
|
|
2662
2942
|
if (J(t)) {
|
|
2663
2943
|
let n = e.type === "TSTypeAliasDeclaration" ? "constraint" : "bound";
|
|
2664
|
-
if (t.length > 1 && t.some((r) => r[n] || r.default))
|
|
2944
|
+
if (t.length > 1 && t.some((r) => r[n] || r.default))
|
|
2945
|
+
return !0;
|
|
2665
2946
|
}
|
|
2666
2947
|
return !1;
|
|
2667
2948
|
}
|
|
2668
2949
|
var Cl = _(["TSTypeAliasDeclaration", "TypeAlias"]);
|
|
2669
2950
|
function Tl(e) {
|
|
2670
2951
|
var t;
|
|
2671
|
-
if (Cl(e))
|
|
2952
|
+
if (Cl(e))
|
|
2953
|
+
return (t = e.typeParameters) == null ? void 0 : t.params;
|
|
2672
2954
|
}
|
|
2673
2955
|
function Sl(e) {
|
|
2674
|
-
if (e.type !== "VariableDeclarator")
|
|
2956
|
+
if (e.type !== "VariableDeclarator")
|
|
2957
|
+
return !1;
|
|
2675
2958
|
let { typeAnnotation: t } = e.id;
|
|
2676
|
-
if (!t || !t.typeAnnotation)
|
|
2959
|
+
if (!t || !t.typeAnnotation)
|
|
2960
|
+
return !1;
|
|
2677
2961
|
let n = Nr(t.typeAnnotation);
|
|
2678
2962
|
return J(n) && n.length > 1 && n.some((r) => J(Nr(r)) || r.type === "TSConditionalType");
|
|
2679
2963
|
}
|
|
@@ -2684,14 +2968,17 @@ function zu(e) {
|
|
|
2684
2968
|
var bl = _(["TSTypeReference", "GenericTypeAnnotation"]);
|
|
2685
2969
|
function Nr(e) {
|
|
2686
2970
|
var t;
|
|
2687
|
-
if (bl(e))
|
|
2971
|
+
if (bl(e))
|
|
2972
|
+
return (t = e.typeArguments ?? e.typeParameters) == null ? void 0 : t.params;
|
|
2688
2973
|
}
|
|
2689
2974
|
function Qu(e, t, n, r = !1) {
|
|
2690
2975
|
var u;
|
|
2691
2976
|
let { node: a } = e, s = () => Qu(e, t, n, !0);
|
|
2692
|
-
if (a.type === "ChainExpression" || a.type === "TSNonNullExpression")
|
|
2977
|
+
if (a.type === "ChainExpression" || a.type === "TSNonNullExpression")
|
|
2978
|
+
return e.call(s, "expression");
|
|
2693
2979
|
if (L(a)) {
|
|
2694
|
-
if ((u = Ku(e, t, n).label) != null && u.memberChain)
|
|
2980
|
+
if ((u = Ku(e, t, n).label) != null && u.memberChain)
|
|
2981
|
+
return !1;
|
|
2695
2982
|
let o = de(a);
|
|
2696
2983
|
return !(o.length === 0 || o.length === 1 && Gn(o[0], t)) || vl(a, n) ? !1 : e.call(s, "callee");
|
|
2697
2984
|
}
|
|
@@ -2703,13 +2990,16 @@ function Bl(e, t, n) {
|
|
|
2703
2990
|
function vl(e, t) {
|
|
2704
2991
|
let n = kl(e);
|
|
2705
2992
|
if (J(n)) {
|
|
2706
|
-
if (n.length > 1)
|
|
2993
|
+
if (n.length > 1)
|
|
2994
|
+
return !0;
|
|
2707
2995
|
if (n.length === 1) {
|
|
2708
2996
|
let u = n[0];
|
|
2709
|
-
if ($e(u) || Kn(u) || u.type === "TSTypeLiteral" || u.type === "ObjectTypeAnnotation")
|
|
2997
|
+
if ($e(u) || Kn(u) || u.type === "TSTypeLiteral" || u.type === "ObjectTypeAnnotation")
|
|
2998
|
+
return !0;
|
|
2710
2999
|
}
|
|
2711
3000
|
let r = e.typeParameters ? "typeParameters" : "typeArguments";
|
|
2712
|
-
if (ne(t(r)))
|
|
3001
|
+
if (ne(t(r)))
|
|
3002
|
+
return !0;
|
|
2713
3003
|
}
|
|
2714
3004
|
return !1;
|
|
2715
3005
|
}
|
|
@@ -2734,22 +3024,26 @@ function Pl(e) {
|
|
|
2734
3024
|
}
|
|
2735
3025
|
function at(e, t, n, r, u) {
|
|
2736
3026
|
let a = e.node, s = Z(a), o = u ? ze(e, t, n) : "";
|
|
2737
|
-
if (s.length === 0)
|
|
3027
|
+
if (s.length === 0)
|
|
3028
|
+
return [o, "(", $(e, t, { filter: (p) => ge(t.originalText, I(p)) === ")" }), ")"];
|
|
2738
3029
|
let { parent: i } = e, l = nn(i), d = Yu(a), D = [];
|
|
2739
3030
|
if (po(e, (p, y) => {
|
|
2740
3031
|
let f = y === s.length - 1;
|
|
2741
3032
|
f && a.rest && D.push("..."), D.push(n()), !f && (D.push(","), l || d ? D.push(" ") : Ne(s[y], t) ? D.push(F, F) : D.push(C));
|
|
2742
3033
|
}), r && !Il(e)) {
|
|
2743
|
-
if (ne(o) || ne(D))
|
|
3034
|
+
if (ne(o) || ne(D))
|
|
3035
|
+
throw new zt();
|
|
2744
3036
|
return m([Sn(o), "(", Sn(D), ")"]);
|
|
2745
3037
|
}
|
|
2746
3038
|
let c = s.every((p) => !J(p.decorators));
|
|
2747
3039
|
return d && c ? [o, "(", ...D, ")"] : l ? [o, "(", ...D, ")"] : (tu(i) || Qs(i) || i.type === "TypeAlias" || i.type === "UnionTypeAnnotation" || i.type === "IntersectionTypeAnnotation" || i.type === "FunctionTypeAnnotation" && i.returnType === a) && s.length === 1 && s[0].name === null && a.this !== s[0] && s[0].typeAnnotation && a.typeParameters === null && Un(s[0].typeAnnotation) && !a.rest ? t.arrowParens === "always" || a.type === "HookTypeAnnotation" ? ["(", ...D, ")"] : D : [o, "(", A([E, ...D]), w(!io(a) && Ie(t, "all") ? "," : ""), E, ")"];
|
|
2748
3040
|
}
|
|
2749
3041
|
function Yu(e) {
|
|
2750
|
-
if (!e)
|
|
3042
|
+
if (!e)
|
|
3043
|
+
return !1;
|
|
2751
3044
|
let t = Z(e);
|
|
2752
|
-
if (t.length !== 1)
|
|
3045
|
+
if (t.length !== 1)
|
|
3046
|
+
return !1;
|
|
2753
3047
|
let [n] = t;
|
|
2754
3048
|
return !h(n) && (n.type === "ObjectPattern" || n.type === "ArrayPattern" || n.type === "Identifier" && n.typeAnnotation && (n.typeAnnotation.type === "TypeAnnotation" || n.typeAnnotation.type === "TSTypeAnnotation") && Xe(n.typeAnnotation.typeAnnotation) || n.type === "FunctionTypeParam" && Xe(n.typeAnnotation) && n !== e.rest || n.type === "AssignmentPattern" && (n.left.type === "ObjectPattern" || n.left.type === "ArrayPattern") && (n.right.type === "Identifier" || Ae(n.right) && n.right.properties.length === 0 || Q(n.right) && n.right.elements.length === 0));
|
|
2755
3049
|
}
|
|
@@ -2760,13 +3054,16 @@ function wl(e) {
|
|
|
2760
3054
|
function gt(e, t) {
|
|
2761
3055
|
var n;
|
|
2762
3056
|
let r = wl(e);
|
|
2763
|
-
if (!r)
|
|
3057
|
+
if (!r)
|
|
3058
|
+
return !1;
|
|
2764
3059
|
let u = (n = e.typeParameters) == null ? void 0 : n.params;
|
|
2765
3060
|
if (u) {
|
|
2766
|
-
if (u.length > 1)
|
|
3061
|
+
if (u.length > 1)
|
|
3062
|
+
return !1;
|
|
2767
3063
|
if (u.length === 1) {
|
|
2768
3064
|
let a = u[0];
|
|
2769
|
-
if (a.constraint || a.default)
|
|
3065
|
+
if (a.constraint || a.default)
|
|
3066
|
+
return !1;
|
|
2770
3067
|
}
|
|
2771
3068
|
}
|
|
2772
3069
|
return Z(e).length === 1 && (Xe(r) || ne(t));
|
|
@@ -2787,7 +3084,8 @@ function Nl(e) {
|
|
|
2787
3084
|
var jl = _(["VoidTypeAnnotation", "TSVoidKeyword", "NullLiteralTypeAnnotation", "TSNullKeyword"]), Ll = _(["ObjectTypeAnnotation", "TSTypeLiteral", "GenericTypeAnnotation", "TSTypeReference"]);
|
|
2788
3085
|
function Ml(e) {
|
|
2789
3086
|
let { types: t } = e;
|
|
2790
|
-
if (t.some((r) => h(r)))
|
|
3087
|
+
if (t.some((r) => h(r)))
|
|
3088
|
+
return !1;
|
|
2791
3089
|
let n = t.find((r) => Ll(r));
|
|
2792
3090
|
return n ? t.every((r) => r === n || jl(r)) : !1;
|
|
2793
3091
|
}
|
|
@@ -2808,7 +3106,8 @@ function ta(e, t, n) {
|
|
|
2808
3106
|
let r = !1;
|
|
2809
3107
|
return m(e.map(({ isFirst: u, previous: a, node: s, index: o }) => {
|
|
2810
3108
|
let i = n();
|
|
2811
|
-
if (u)
|
|
3109
|
+
if (u)
|
|
3110
|
+
return i;
|
|
2812
3111
|
let l = Xe(s), d = Xe(a);
|
|
2813
3112
|
return d && l ? [" & ", r ? A(i) : i] : !d && !l || Te(t.originalText, s) ? t.experimentalOperatorPosition === "start" ? A([C, "& ", i]) : A([" &", C, i]) : (o > 1 && (r = !0), [" & ", o > 1 ? A(i) : i]);
|
|
2814
3113
|
}, "types"));
|
|
@@ -2818,7 +3117,8 @@ function na(e, t, n) {
|
|
|
2818
3117
|
let D = n();
|
|
2819
3118
|
return s || (D = Be(2, D)), Fe(d, D, t);
|
|
2820
3119
|
}, "types");
|
|
2821
|
-
if (s)
|
|
3120
|
+
if (s)
|
|
3121
|
+
return N(" | ", o);
|
|
2822
3122
|
let i = a && !Te(t.originalText, r), l = [w([i ? C : "", "| "]), N([C, "| "], o)];
|
|
2823
3123
|
return ut(e, t) ? m([A(l), E]) : (u.type === "TupleTypeAnnotation" || u.type === "TSTupleType") && u[u.type === "TupleTypeAnnotation" && u.types ? "types" : "elementTypes"].length > 1 ? m([A([w(["(", E]), l]), E, w(")")]) : m(a ? A(l) : l);
|
|
2824
3124
|
}
|
|
@@ -2854,7 +3154,8 @@ function oa(e, t, n) {
|
|
|
2854
3154
|
var ql = /* @__PURE__ */ new WeakSet();
|
|
2855
3155
|
function z(e, t, n = "typeAnnotation") {
|
|
2856
3156
|
let { node: { [n]: r } } = e;
|
|
2857
|
-
if (!r)
|
|
3157
|
+
if (!r)
|
|
3158
|
+
return "";
|
|
2858
3159
|
let u = !1;
|
|
2859
3160
|
if (r.type === "TSTypeAnnotation" || r.type === "TypeAnnotation") {
|
|
2860
3161
|
let a = e.call(ia, n);
|
|
@@ -2916,13 +3217,16 @@ function $l(e, t, n, r) {
|
|
|
2916
3217
|
}
|
|
2917
3218
|
function ur(e, t, n) {
|
|
2918
3219
|
let { node: r } = e, u = [], a = "[", s = "]", o = r.type === "TupleTypeAnnotation" && r.types ? "types" : r.type === "TSTupleType" || r.type === "TupleTypeAnnotation" ? "elementTypes" : "elements", i = r[o];
|
|
2919
|
-
if (i.length === 0)
|
|
3220
|
+
if (i.length === 0)
|
|
3221
|
+
u.push($l(e, t, a, s));
|
|
2920
3222
|
else {
|
|
2921
|
-
let l = X(!1, i, -1), d = l?.type !== "RestElement" && !r.inexact, D = l === null, c =
|
|
3223
|
+
let l = X(!1, i, -1), d = l?.type !== "RestElement" && !r.inexact, D = l === null, c = Symbol("array"), p = !t.__inJestEach && i.length > 1 && i.every((g, S, b) => {
|
|
2922
3224
|
let x = g?.type;
|
|
2923
|
-
if (!Q(g) && !Ae(g))
|
|
3225
|
+
if (!Q(g) && !Ae(g))
|
|
3226
|
+
return !1;
|
|
2924
3227
|
let j = b[S + 1];
|
|
2925
|
-
if (j && x !== j.type)
|
|
3228
|
+
if (j && x !== j.type)
|
|
3229
|
+
return !1;
|
|
2926
3230
|
let v = Q(g) ? "elements" : "properties";
|
|
2927
3231
|
return g[v] && g[v].length > 1;
|
|
2928
3232
|
}), y = fa(r, t), f = d ? D ? "," : Ie(t) ? y ? w(",", "", { groupId: c }) : w(",") : "" : "";
|
|
@@ -2966,7 +3270,8 @@ function Hl(e, t) {
|
|
|
2966
3270
|
}
|
|
2967
3271
|
function Mt(e, t, n) {
|
|
2968
3272
|
let { node: r } = e;
|
|
2969
|
-
if (r.computed)
|
|
3273
|
+
if (r.computed)
|
|
3274
|
+
return ["[", n("key"), "]"];
|
|
2970
3275
|
let { parent: u } = e, { key: a } = r;
|
|
2971
3276
|
if (t.quoteProps === "consistent" && !Gt.has(u)) {
|
|
2972
3277
|
let s = e.siblings.some((o) => !o.computed && Y(o.key) && !Lr(o, t));
|
|
@@ -2984,7 +3289,8 @@ function Fn(e, t, n) {
|
|
|
2984
3289
|
}
|
|
2985
3290
|
var zl = ({ node: e, key: t, parent: n }) => t === "value" && e.type === "FunctionExpression" && (n.type === "ObjectMethod" || n.type === "ClassMethod" || n.type === "ClassPrivateMethod" || n.type === "MethodDefinition" || n.type === "TSAbstractMethodDefinition" || n.type === "TSDeclareMethod" || n.type === "Property" && tn(n));
|
|
2986
3291
|
function Aa(e, t, n, r) {
|
|
2987
|
-
if (zl(e))
|
|
3292
|
+
if (zl(e))
|
|
3293
|
+
return ar(e, t, n);
|
|
2988
3294
|
let { node: u } = e, a = !1;
|
|
2989
3295
|
if ((u.type === "FunctionDeclaration" || u.type === "FunctionExpression") && r != null && r.expandLastArg) {
|
|
2990
3296
|
let { parent: d } = e;
|
|
@@ -3006,7 +3312,8 @@ function Ql(e) {
|
|
|
3006
3312
|
return t.length === 1 && !e.typeParameters && !h(e, T.Dangling) && t[0].type === "Identifier" && !t[0].typeAnnotation && !h(t[0]) && !t[0].optional && !e.predicate && !e.returnType;
|
|
3007
3313
|
}
|
|
3008
3314
|
function ga(e, t) {
|
|
3009
|
-
if (t.arrowParens === "always")
|
|
3315
|
+
if (t.arrowParens === "always")
|
|
3316
|
+
return !1;
|
|
3010
3317
|
if (t.arrowParens === "avoid") {
|
|
3011
3318
|
let { node: n } = e;
|
|
3012
3319
|
return Ql(n);
|
|
@@ -3033,10 +3340,13 @@ function Zl(e, t, n) {
|
|
|
3033
3340
|
return ["throw", xa(e, t, n)];
|
|
3034
3341
|
}
|
|
3035
3342
|
function ec(e, t) {
|
|
3036
|
-
if (Te(e.originalText, t) || h(t, T.Leading, (n) => ce(e.originalText, q(n), I(n))) && !K(t))
|
|
3343
|
+
if (Te(e.originalText, t) || h(t, T.Leading, (n) => ce(e.originalText, q(n), I(n))) && !K(t))
|
|
3344
|
+
return !0;
|
|
3037
3345
|
if (Rn(t)) {
|
|
3038
3346
|
let n = t, r;
|
|
3039
|
-
for (; r = Us(n); )
|
|
3347
|
+
for (; r = Us(n); )
|
|
3348
|
+
if (n = r, Te(e.originalText, n))
|
|
3349
|
+
return !0;
|
|
3040
3350
|
}
|
|
3041
3351
|
return !1;
|
|
3042
3352
|
}
|
|
@@ -3049,23 +3359,26 @@ function nc(e, t, n, r = {}) {
|
|
|
3049
3359
|
let u = [], a, s = [], o = !1, i = !r.expandLastArg && e.node.body.type === "ArrowFunctionExpression", l;
|
|
3050
3360
|
(function S() {
|
|
3051
3361
|
let { node: b } = e, x = rc(e, t, n, r);
|
|
3052
|
-
if (u.length === 0)
|
|
3362
|
+
if (u.length === 0)
|
|
3363
|
+
u.push(x);
|
|
3053
3364
|
else {
|
|
3054
3365
|
let { leading: j, trailing: v } = qu(e, t);
|
|
3055
3366
|
u.push([j, x]), s.unshift(v);
|
|
3056
3367
|
}
|
|
3057
3368
|
i && (o || (o = b.returnType && Z(b).length > 0 || b.typeParameters || Z(b).some((j) => j.type !== "Identifier"))), !i || b.body.type !== "ArrowFunctionExpression" ? (a = n("body", r), l = b.body) : e.call(S, "body");
|
|
3058
3369
|
})();
|
|
3059
|
-
let d = !Te(t.originalText, l) && (tc(l) || uc(l, a, t) || !o && ha(l)), D = e.key === "callee" && dt(e.parent), c =
|
|
3370
|
+
let d = !Te(t.originalText, l) && (tc(l) || uc(l, a, t) || !o && ha(l)), D = e.key === "callee" && dt(e.parent), c = Symbol("arrow-chain"), p = ac(e, r, { signatureDocs: u, shouldBreak: o }), y = !1, f = !1, g = !1;
|
|
3060
3371
|
return i && (D || r.assignmentLayout) && (f = !0, g = !h(e.node, T.Leading & T.Line), y = r.assignmentLayout === "chain-tail-arrow-chain" || D && !d), a = sc(e, t, r, { bodyDoc: a, bodyComments: s, functionBody: l, shouldPutBodyOnSameLine: d }), m([m(f ? A([g ? E : "", p]) : p, { shouldBreak: y, id: c }), " =>", i ? un(a, { groupId: c }) : m(a), i && D ? w(E, "", { groupId: c }) : ""]);
|
|
3061
3372
|
}
|
|
3062
3373
|
function rc(e, t, n, r) {
|
|
3063
3374
|
let { node: u } = e, a = [];
|
|
3064
|
-
if (u.async && a.push("async "), ga(e, t))
|
|
3375
|
+
if (u.async && a.push("async "), ga(e, t))
|
|
3376
|
+
a.push(n(["params", 0]));
|
|
3065
3377
|
else {
|
|
3066
3378
|
let o = r.expandLastArg || r.expandFirstArg, i = sn(e, n);
|
|
3067
3379
|
if (o) {
|
|
3068
|
-
if (ne(i))
|
|
3380
|
+
if (ne(i))
|
|
3381
|
+
throw new zt();
|
|
3069
3382
|
i = m(Sn(i));
|
|
3070
3383
|
}
|
|
3071
3384
|
a.push(m([at(e, t, n, o, !0), i]));
|
|
@@ -3081,7 +3394,8 @@ function uc(e, t, n) {
|
|
|
3081
3394
|
return Q(e) || Ae(e) || e.type === "ArrowFunctionExpression" || e.type === "DoExpression" || e.type === "BlockStatement" || K(e) || ((r = t.label) == null ? void 0 : r.hug) !== !1 && (((u = t.label) == null ? void 0 : u.embed) || uu(e, n.originalText));
|
|
3082
3395
|
}
|
|
3083
3396
|
function ac(e, t, { signatureDocs: n, shouldBreak: r }) {
|
|
3084
|
-
if (n.length === 1)
|
|
3397
|
+
if (n.length === 1)
|
|
3398
|
+
return n[0];
|
|
3085
3399
|
let { parent: u, key: a } = e;
|
|
3086
3400
|
return a !== "callee" && dt(u) || ke(u) ? m([n[0], " =>", A([C, N([" =>", C], n.slice(1))])], { shouldBreak: r }) : a === "callee" && dt(u) || t.assignmentLayout ? m(N([" =>", C], n), { shouldBreak: r }) : m(A(N([" =>", C], n)), { shouldBreak: r });
|
|
3087
3401
|
}
|
|
@@ -3091,10 +3405,12 @@ function sc(e, t, n, { bodyDoc: r, bodyComments: u, functionBody: a, shouldPutBo
|
|
|
3091
3405
|
}
|
|
3092
3406
|
var oc = (e, t, n) => {
|
|
3093
3407
|
if (!(e && t == null)) {
|
|
3094
|
-
if (t.findLast)
|
|
3408
|
+
if (t.findLast)
|
|
3409
|
+
return t.findLast(n);
|
|
3095
3410
|
for (let r = t.length - 1; r >= 0; r--) {
|
|
3096
3411
|
let u = t[r];
|
|
3097
|
-
if (n(u, r, t))
|
|
3412
|
+
if (n(u, r, t))
|
|
3413
|
+
return u;
|
|
3098
3414
|
}
|
|
3099
3415
|
}
|
|
3100
3416
|
}, ic = oc;
|
|
@@ -3106,9 +3422,11 @@ function Mn(e, t, n, r) {
|
|
|
3106
3422
|
}
|
|
3107
3423
|
function Ca(e, t, n) {
|
|
3108
3424
|
let r = pc(e, t, n), { node: u, parent: a } = e;
|
|
3109
|
-
if (u.type === "Program" && a?.type !== "ModuleExpression")
|
|
3425
|
+
if (u.type === "Program" && a?.type !== "ModuleExpression")
|
|
3426
|
+
return r ? [r, F] : "";
|
|
3110
3427
|
let s = [];
|
|
3111
|
-
if (u.type === "StaticBlock" && s.push("static "), s.push("{"), r)
|
|
3428
|
+
if (u.type === "StaticBlock" && s.push("static "), s.push("{"), r)
|
|
3429
|
+
s.push(A([F, r]), F);
|
|
3112
3430
|
else {
|
|
3113
3431
|
let o = e.grandparent;
|
|
3114
3432
|
a.type === "ArrowFunctionExpression" || a.type === "FunctionExpression" || a.type === "FunctionDeclaration" || a.type === "ComponentDeclaration" || a.type === "HookDeclaration" || a.type === "ObjectMethod" || a.type === "ClassMethod" || a.type === "ClassPrivateMethod" || a.type === "ForStatement" || a.type === "WhileStatement" || a.type === "DoWhileStatement" || a.type === "DoExpression" || a.type === "ModuleExpression" || a.type === "CatchClause" && !o.finalizer || a.type === "TSModuleDeclaration" || u.type === "StaticBlock" || s.push(F);
|
|
@@ -3117,7 +3435,8 @@ function Ca(e, t, n) {
|
|
|
3117
3435
|
}
|
|
3118
3436
|
function pc(e, t, n) {
|
|
3119
3437
|
let { node: r } = e, u = J(r.directives), a = r.body.some((i) => i.type !== "EmptyStatement"), s = h(r, T.Dangling);
|
|
3120
|
-
if (!u && !a && !s)
|
|
3438
|
+
if (!u && !a && !s)
|
|
3439
|
+
return "";
|
|
3121
3440
|
let o = [];
|
|
3122
3441
|
return u && (o.push(Mn(e, t, n, "directives")), (a || s) && (o.push(F), Ne(X(!1, r.directives, -1), t) && o.push(F))), a && o.push(Mn(e, t, n, "body")), s && o.push($(e, t)), o;
|
|
3123
3442
|
}
|
|
@@ -3134,23 +3453,27 @@ function cc(e, t, n) {
|
|
|
3134
3453
|
}
|
|
3135
3454
|
function vt(e, t, n, r) {
|
|
3136
3455
|
let { node: u } = e;
|
|
3137
|
-
if (!u[r])
|
|
3138
|
-
|
|
3456
|
+
if (!u[r])
|
|
3457
|
+
return "";
|
|
3458
|
+
if (!Array.isArray(u[r]))
|
|
3459
|
+
return n(r);
|
|
3139
3460
|
let a = nn(e.grandparent), s = e.match((i) => !(i[r].length === 1 && Xe(i[r][0])), void 0, (i, l) => l === "typeAnnotation", (i) => i.type === "Identifier", zu);
|
|
3140
|
-
if (u[r].length === 0 || !s && (a || u[r].length === 1 && (u[r][0].type === "NullableTypeAnnotation" || Zu(u[r][0]))))
|
|
3461
|
+
if (u[r].length === 0 || !s && (a || u[r].length === 1 && (u[r][0].type === "NullableTypeAnnotation" || Zu(u[r][0]))))
|
|
3462
|
+
return ["<", N(", ", e.map(n, r)), Dc(e, t), ">"];
|
|
3141
3463
|
let o = u.type === "TSTypeParameterInstantiation" ? "" : cc(e, t, r) ? "," : Ie(t) ? w(",") : "";
|
|
3142
3464
|
return m(["<", A([E, N([",", C], e.map(n, r))]), o, E, ">"], { id: sr(u) });
|
|
3143
3465
|
}
|
|
3144
3466
|
function Dc(e, t) {
|
|
3145
3467
|
let { node: n } = e;
|
|
3146
|
-
if (!h(n, T.Dangling))
|
|
3468
|
+
if (!h(n, T.Dangling))
|
|
3469
|
+
return "";
|
|
3147
3470
|
let r = !h(n, T.Line), u = $(e, t, { indent: !r });
|
|
3148
3471
|
return r ? u : [u, F];
|
|
3149
3472
|
}
|
|
3150
3473
|
function Sa(e, t, n) {
|
|
3151
3474
|
let { node: r } = e, u = [r.const ? "const " : ""], a = r.type === "TSTypeParameter" ? n("name") : r.name;
|
|
3152
3475
|
if (r.variance && u.push(n("variance")), r.in && u.push("in "), r.out && u.push("out "), u.push(a), r.bound && (r.usesExtendsBound && u.push(" extends "), u.push(z(e, n, "bound"))), r.constraint) {
|
|
3153
|
-
let s =
|
|
3476
|
+
let s = Symbol("constraint");
|
|
3154
3477
|
u.push(" extends", m(A(C), { id: s }), we, un(n("constraint"), { groupId: s }));
|
|
3155
3478
|
}
|
|
3156
3479
|
return r.default && u.push(" = ", n("default")), m(u);
|
|
@@ -3161,13 +3484,15 @@ function Ba(e, t, n) {
|
|
|
3161
3484
|
if (r.id && s.push(" ", n("id")), s.push(n("typeParameters")), r.superClass) {
|
|
3162
3485
|
let d = [mc(e, t, n), n(r.superTypeArguments ? "superTypeArguments" : "superTypeParameters")], D = e.call((c) => ["extends ", Fe(c, d, t)], "superClass");
|
|
3163
3486
|
a ? o.push(C, m(D)) : o.push(" ", D);
|
|
3164
|
-
} else
|
|
3487
|
+
} else
|
|
3488
|
+
o.push(gn(e, t, n, "extends"));
|
|
3165
3489
|
o.push(gn(e, t, n, "mixins"), gn(e, t, n, "implements"));
|
|
3166
3490
|
let i;
|
|
3167
3491
|
if (a) {
|
|
3168
3492
|
let d;
|
|
3169
3493
|
ka(r) ? d = [...s, A(o)] : d = A([...s, o]), i = va(r), u.push(m(d, { id: i }));
|
|
3170
|
-
} else
|
|
3494
|
+
} else
|
|
3495
|
+
u.push(...s, ...o);
|
|
3171
3496
|
let l = r.body;
|
|
3172
3497
|
return a && J(l.body) ? u.push(w(F, " ", { groupId: i })) : u.push(" "), u.push(n("body")), u;
|
|
3173
3498
|
}
|
|
@@ -3183,7 +3508,8 @@ function ka(e) {
|
|
|
3183
3508
|
}
|
|
3184
3509
|
function gn(e, t, n, r) {
|
|
3185
3510
|
let { node: u } = e;
|
|
3186
|
-
if (!J(u[r]))
|
|
3511
|
+
if (!J(u[r]))
|
|
3512
|
+
return "";
|
|
3187
3513
|
let a = $(e, t, { marker: r });
|
|
3188
3514
|
return [ka(u) ? w(" ", C, { groupId: sr(u.typeParameters) }) : C, a, a && F, r, m(A([C, N([",", C], e.map(n, r))]))];
|
|
3189
3515
|
}
|
|
@@ -3210,13 +3536,17 @@ function fc(e, t, n) {
|
|
|
3210
3536
|
function Ec(e, t) {
|
|
3211
3537
|
var n;
|
|
3212
3538
|
let { type: r, name: u } = e.key;
|
|
3213
|
-
if (!e.computed && r === "Identifier" && (u === "static" || u === "get" || u === "set") && !e.value && !e.typeAnnotation)
|
|
3214
|
-
|
|
3539
|
+
if (!e.computed && r === "Identifier" && (u === "static" || u === "get" || u === "set") && !e.value && !e.typeAnnotation)
|
|
3540
|
+
return !0;
|
|
3541
|
+
if (!t || t.static || t.accessibility || t.readonly)
|
|
3542
|
+
return !1;
|
|
3215
3543
|
if (!t.computed) {
|
|
3216
3544
|
let a = (n = t.key) == null ? void 0 : n.name;
|
|
3217
|
-
if (a === "in" || a === "instanceof")
|
|
3545
|
+
if (a === "in" || a === "instanceof")
|
|
3546
|
+
return !0;
|
|
3218
3547
|
}
|
|
3219
|
-
if (ba(t) && t.variance && !t.static && !t.declare)
|
|
3548
|
+
if (ba(t) && t.variance && !t.static && !t.declare)
|
|
3549
|
+
return !0;
|
|
3220
3550
|
switch (t.type) {
|
|
3221
3551
|
case "ClassProperty":
|
|
3222
3552
|
case "PropertyDefinition":
|
|
@@ -3226,7 +3556,8 @@ function Ec(e, t) {
|
|
|
3226
3556
|
case "TSAbstractMethodDefinition":
|
|
3227
3557
|
case "ClassMethod":
|
|
3228
3558
|
case "ClassPrivateMethod": {
|
|
3229
|
-
if ((t.value ? t.value.async : t.async) || t.kind === "get" || t.kind === "set")
|
|
3559
|
+
if ((t.value ? t.value.async : t.async) || t.kind === "get" || t.kind === "set")
|
|
3560
|
+
return !1;
|
|
3230
3561
|
let a = t.value ? t.value.generator : t.generator;
|
|
3231
3562
|
return !!(t.computed || a);
|
|
3232
3563
|
}
|
|
@@ -3244,7 +3575,8 @@ function gc(e) {
|
|
|
3244
3575
|
return e.type === "MemberExpression" || e.type === "OptionalMemberExpression" || e.type === "Identifier" && e.name !== "undefined";
|
|
3245
3576
|
}
|
|
3246
3577
|
function xc(e, t) {
|
|
3247
|
-
if (t.semi || ja(e, t) || La(e, t))
|
|
3578
|
+
if (t.semi || ja(e, t) || La(e, t))
|
|
3579
|
+
return !1;
|
|
3248
3580
|
let { node: n, key: r, parent: u } = e;
|
|
3249
3581
|
return !!(n.type === "ExpressionStatement" && (r === "body" && (u.type === "Program" || u.type === "BlockStatement" || u.type === "StaticBlock" || u.type === "TSModuleBlock") || r === "consequent" && u.type === "SwitchCase") && e.call(() => Na(e, t), "expression"));
|
|
3250
3582
|
}
|
|
@@ -3260,21 +3592,26 @@ function Na(e, t) {
|
|
|
3260
3592
|
case "RegExpLiteral":
|
|
3261
3593
|
return !0;
|
|
3262
3594
|
case "ArrowFunctionExpression":
|
|
3263
|
-
if (!ga(e, t))
|
|
3595
|
+
if (!ga(e, t))
|
|
3596
|
+
return !0;
|
|
3264
3597
|
break;
|
|
3265
3598
|
case "UnaryExpression": {
|
|
3266
3599
|
let { prefix: r, operator: u } = n;
|
|
3267
|
-
if (r && (u === "+" || u === "-"))
|
|
3600
|
+
if (r && (u === "+" || u === "-"))
|
|
3601
|
+
return !0;
|
|
3268
3602
|
break;
|
|
3269
3603
|
}
|
|
3270
3604
|
case "BindExpression":
|
|
3271
|
-
if (!n.object)
|
|
3605
|
+
if (!n.object)
|
|
3606
|
+
return !0;
|
|
3272
3607
|
break;
|
|
3273
3608
|
case "Literal":
|
|
3274
|
-
if (n.regex)
|
|
3609
|
+
if (n.regex)
|
|
3610
|
+
return !0;
|
|
3275
3611
|
break;
|
|
3276
3612
|
default:
|
|
3277
|
-
if (K(n))
|
|
3613
|
+
if (K(n))
|
|
3614
|
+
return !0;
|
|
3278
3615
|
}
|
|
3279
3616
|
return ut(e, t) ? !0 : Rn(n) ? e.call(() => Na(e, t), ...Yr(n)) : !1;
|
|
3280
3617
|
}
|
|
@@ -3289,13 +3626,15 @@ function hc(e, t, n) {
|
|
|
3289
3626
|
if (La(e, t)) {
|
|
3290
3627
|
let u = Ia(e.node.expression);
|
|
3291
3628
|
(Ac(u) || gc(u)) && r.push(";");
|
|
3292
|
-
} else
|
|
3629
|
+
} else
|
|
3630
|
+
ja(e, t) || t.semi && r.push(";");
|
|
3293
3631
|
return r;
|
|
3294
3632
|
}
|
|
3295
3633
|
function Cc(e, t, n) {
|
|
3296
3634
|
if (t.__isVueBindings || t.__isVueForBindingLeft) {
|
|
3297
3635
|
let r = e.map(n, "program", "body", 0, "params");
|
|
3298
|
-
if (r.length === 1)
|
|
3636
|
+
if (r.length === 1)
|
|
3637
|
+
return r[0];
|
|
3299
3638
|
let u = N([",", C], r);
|
|
3300
3639
|
return t.__isVueForBindingLeft ? ["(", A([E, m(u)]), E, ")"] : u;
|
|
3301
3640
|
}
|
|
@@ -3322,15 +3661,18 @@ function Tc(e, t) {
|
|
|
3322
3661
|
case "DirectiveLiteral":
|
|
3323
3662
|
return Or(n.extra.raw, t);
|
|
3324
3663
|
case "Literal": {
|
|
3325
|
-
if (n.regex)
|
|
3326
|
-
|
|
3664
|
+
if (n.regex)
|
|
3665
|
+
return Mr(n.regex);
|
|
3666
|
+
if (n.bigint)
|
|
3667
|
+
return On(n.raw);
|
|
3327
3668
|
let { value: r } = n;
|
|
3328
3669
|
return typeof r == "number" ? mt(n.raw) : typeof r == "string" ? Sc(e) ? Or(n.raw, t) : He(yt(n.raw, t)) : String(r);
|
|
3329
3670
|
}
|
|
3330
3671
|
}
|
|
3331
3672
|
}
|
|
3332
3673
|
function Sc(e) {
|
|
3333
|
-
if (e.key !== "expression")
|
|
3674
|
+
if (e.key !== "expression")
|
|
3675
|
+
return;
|
|
3334
3676
|
let { parent: t } = e;
|
|
3335
3677
|
return t.type === "ExpressionStatement" && typeof t.directive == "string";
|
|
3336
3678
|
}
|
|
@@ -3342,17 +3684,20 @@ function Mr({ pattern: e, flags: t }) {
|
|
|
3342
3684
|
}
|
|
3343
3685
|
function Or(e, t) {
|
|
3344
3686
|
let n = e.slice(1, -1);
|
|
3345
|
-
if (n.includes('"') || n.includes("'"))
|
|
3687
|
+
if (n.includes('"') || n.includes("'"))
|
|
3688
|
+
return e;
|
|
3346
3689
|
let r = t.singleQuote ? "'" : '"';
|
|
3347
3690
|
return r + n + r;
|
|
3348
3691
|
}
|
|
3349
3692
|
function bc(e, t, n) {
|
|
3350
3693
|
let r = e.originalText.slice(t, n);
|
|
3351
|
-
for (let u of e[
|
|
3694
|
+
for (let u of e[Symbol.for("comments")]) {
|
|
3352
3695
|
let a = q(u);
|
|
3353
|
-
if (a > n)
|
|
3696
|
+
if (a > n)
|
|
3697
|
+
break;
|
|
3354
3698
|
let s = I(u);
|
|
3355
|
-
if (s < t)
|
|
3699
|
+
if (s < t)
|
|
3700
|
+
continue;
|
|
3356
3701
|
let o = s - a;
|
|
3357
3702
|
r = r.slice(0, a - t) + " ".repeat(o) + r.slice(s - t);
|
|
3358
3703
|
}
|
|
@@ -3383,23 +3728,29 @@ function Pc(e) {
|
|
|
3383
3728
|
}
|
|
3384
3729
|
function qa(e, t, n) {
|
|
3385
3730
|
let { node: r } = e;
|
|
3386
|
-
if (!r.source)
|
|
3731
|
+
if (!r.source)
|
|
3732
|
+
return "";
|
|
3387
3733
|
let u = [];
|
|
3388
3734
|
return Xa(r, t) && u.push(" from"), u.push(" ", n("source")), u;
|
|
3389
3735
|
}
|
|
3390
3736
|
function _a(e, t, n) {
|
|
3391
3737
|
let { node: r } = e;
|
|
3392
|
-
if (!Xa(r, t))
|
|
3738
|
+
if (!Xa(r, t))
|
|
3739
|
+
return "";
|
|
3393
3740
|
let u = [" "];
|
|
3394
3741
|
if (J(r.specifiers)) {
|
|
3395
3742
|
let a = [], s = [];
|
|
3396
3743
|
e.each(() => {
|
|
3397
3744
|
let o = e.node.type;
|
|
3398
|
-
if (o === "ExportNamespaceSpecifier" || o === "ExportDefaultSpecifier" || o === "ImportNamespaceSpecifier" || o === "ImportDefaultSpecifier")
|
|
3399
|
-
|
|
3400
|
-
else
|
|
3745
|
+
if (o === "ExportNamespaceSpecifier" || o === "ExportDefaultSpecifier" || o === "ImportNamespaceSpecifier" || o === "ImportDefaultSpecifier")
|
|
3746
|
+
a.push(n());
|
|
3747
|
+
else if (o === "ExportSpecifier" || o === "ImportSpecifier")
|
|
3748
|
+
s.push(n());
|
|
3749
|
+
else
|
|
3750
|
+
throw new At(r, "specifier");
|
|
3401
3751
|
}, "specifiers"), u.push(N(", ", a)), s.length > 0 && (a.length > 0 && u.push(", "), s.length > 1 || a.length > 0 || r.specifiers.some((o) => h(o)) ? u.push(m(["{", A([t.bracketSpacing ? C : E, N([",", C], s)]), w(Ie(t) ? "," : ""), t.bracketSpacing ? C : E, "}"])) : u.push(["{", t.bracketSpacing ? " " : "", ...s, t.bracketSpacing ? " " : "", "}"]));
|
|
3402
|
-
} else
|
|
3752
|
+
} else
|
|
3753
|
+
u.push("{}");
|
|
3403
3754
|
return u;
|
|
3404
3755
|
}
|
|
3405
3756
|
function Xa(e, t) {
|
|
@@ -3407,15 +3758,18 @@ function Xa(e, t) {
|
|
|
3407
3758
|
}
|
|
3408
3759
|
function wc(e, t) {
|
|
3409
3760
|
var n, r;
|
|
3410
|
-
if ((n = e.extra) != null && n.deprecatedAssertSyntax)
|
|
3761
|
+
if ((n = e.extra) != null && n.deprecatedAssertSyntax)
|
|
3762
|
+
return "assert";
|
|
3411
3763
|
let u = or(t, I(e.source), (r = e.attributes) != null && r[0] ? q(e.attributes[0]) : I(e)).trimStart();
|
|
3412
3764
|
return u.startsWith("assert") ? "assert" : u.startsWith("with") || J(e.attributes) ? "with" : void 0;
|
|
3413
3765
|
}
|
|
3414
3766
|
function $a(e, t, n) {
|
|
3415
3767
|
let { node: r } = e;
|
|
3416
|
-
if (!r.source)
|
|
3768
|
+
if (!r.source)
|
|
3769
|
+
return "";
|
|
3417
3770
|
let u = wc(r, t);
|
|
3418
|
-
if (!u)
|
|
3771
|
+
if (!u)
|
|
3772
|
+
return "";
|
|
3419
3773
|
let a = [` ${u} {`];
|
|
3420
3774
|
return J(r.attributes) && (t.bracketSpacing && a.push(" "), a.push(N(", ", e.map(n, "attributes"))), t.bracketSpacing && a.push(" ")), a.push("}"), a;
|
|
3421
3775
|
}
|
|
@@ -3424,9 +3778,19 @@ function Ic(e, t, n) {
|
|
|
3424
3778
|
return u === "ExportNamespaceSpecifier" || u === "ImportNamespaceSpecifier" ? d = "*" : i && (d = n(s)), l && !Nc(r) && (D = n(o)), [ir(u === "ImportSpecifier" ? r.importKind : r.exportKind, !1), d, d && D ? " as " : "", D];
|
|
3425
3779
|
}
|
|
3426
3780
|
function Nc(e) {
|
|
3427
|
-
if (e.type !== "ImportSpecifier" && e.type !== "ExportSpecifier")
|
|
3781
|
+
if (e.type !== "ImportSpecifier" && e.type !== "ExportSpecifier")
|
|
3782
|
+
return !1;
|
|
3428
3783
|
let { local: t, [e.type === "ImportSpecifier" ? "imported" : "exported"]: n } = e;
|
|
3429
|
-
|
|
3784
|
+
if (t.type !== n.type || !Ps(t, n))
|
|
3785
|
+
return !1;
|
|
3786
|
+
if (Y(t))
|
|
3787
|
+
return t.value === n.value && se(t) === se(n);
|
|
3788
|
+
switch (t.type) {
|
|
3789
|
+
case "Identifier":
|
|
3790
|
+
return t.name === n.name;
|
|
3791
|
+
default:
|
|
3792
|
+
return !1;
|
|
3793
|
+
}
|
|
3430
3794
|
}
|
|
3431
3795
|
function on(e, t, n) {
|
|
3432
3796
|
var r;
|
|
@@ -3443,14 +3807,17 @@ function on(e, t, n) {
|
|
|
3443
3807
|
if (h(a, T.Dangling)) {
|
|
3444
3808
|
let M = h(a, T.Line);
|
|
3445
3809
|
B = [$(e, t), M || pe(t.originalText, I(X(!1, Ke(a), -1))) ? F : C, "..."];
|
|
3446
|
-
} else
|
|
3810
|
+
} else
|
|
3811
|
+
B = ["..."];
|
|
3447
3812
|
b.push([...S, ...B]);
|
|
3448
3813
|
}
|
|
3449
3814
|
let x = (r = X(!1, l, -1)) == null ? void 0 : r.node, j = !(a.inexact || a.hasUnknownMembers || x && (x.type === "RestElement" || (x.type === "TSPropertySignature" || x.type === "TSCallSignatureDeclaration" || x.type === "TSMethodSignature" || x.type === "TSConstructSignatureDeclaration" || x.type === "TSIndexSignature") && h(x, T.PrettierIgnore)) || e.match(void 0, (B, M) => B.type === "TSImportType" && M === "options")), v;
|
|
3450
3815
|
if (b.length === 0) {
|
|
3451
|
-
if (!h(a, T.Dangling))
|
|
3816
|
+
if (!h(a, T.Dangling))
|
|
3817
|
+
return [f, g, z(e, n)];
|
|
3452
3818
|
v = m([f, $(e, t, { indent: !0 }), E, g, re(e), z(e, n)]);
|
|
3453
|
-
} else
|
|
3819
|
+
} else
|
|
3820
|
+
v = [c && J(a.properties) ? yc(d) : "", f, A([t.bracketSpacing ? C : E, ...b]), w(j && (y !== "," || Ie(t)) ? y : ""), t.bracketSpacing ? C : E, g, re(e), z(e, n)];
|
|
3454
3821
|
return e.match((B) => B.type === "ObjectPattern" && !J(B.decorators), xn) || Xe(a) && (e.match(void 0, (B, M) => M === "typeAnnotation", (B, M) => M === "typeAnnotation", xn) || e.match(void 0, (B, M) => B.type === "FunctionTypeParam" && M === "typeAnnotation", xn)) || !p && e.match((B) => B.type === "ObjectPattern", (B) => B.type === "AssignmentExpression" || B.type === "VariableDeclarator") ? v : m(v, { shouldBreak: p });
|
|
3455
3822
|
}
|
|
3456
3823
|
function xn(e, t) {
|
|
@@ -3462,7 +3829,8 @@ function jc(e) {
|
|
|
3462
3829
|
let r = t[n];
|
|
3463
3830
|
for (let u of ["test", "consequent", "alternate"]) {
|
|
3464
3831
|
let a = r[u];
|
|
3465
|
-
if (K(a))
|
|
3832
|
+
if (K(a))
|
|
3833
|
+
return !0;
|
|
3466
3834
|
a.type === "ConditionalExpression" && t.push(a);
|
|
3467
3835
|
}
|
|
3468
3836
|
}
|
|
@@ -3475,7 +3843,8 @@ function Lc(e, t, n) {
|
|
|
3475
3843
|
var Mc = /* @__PURE__ */ new Map([["AssignmentExpression", "right"], ["VariableDeclarator", "init"], ["ReturnStatement", "argument"], ["ThrowStatement", "argument"], ["UnaryExpression", "argument"], ["YieldExpression", "argument"], ["AwaitExpression", "argument"]]);
|
|
3476
3844
|
function Oc(e) {
|
|
3477
3845
|
let { node: t } = e;
|
|
3478
|
-
if (t.type !== "ConditionalExpression")
|
|
3846
|
+
if (t.type !== "ConditionalExpression")
|
|
3847
|
+
return !1;
|
|
3479
3848
|
let n, r = t;
|
|
3480
3849
|
for (let u = 0; !n; u++) {
|
|
3481
3850
|
let a = e.getParentNode(u);
|
|
@@ -3513,7 +3882,8 @@ function _c(e, t, n, r) {
|
|
|
3513
3882
|
var Xc = /* @__PURE__ */ new Map([["AssignmentExpression", "right"], ["VariableDeclarator", "init"], ["ReturnStatement", "argument"], ["ThrowStatement", "argument"], ["UnaryExpression", "argument"], ["YieldExpression", "argument"], ["AwaitExpression", "argument"]]);
|
|
3514
3883
|
function $c(e) {
|
|
3515
3884
|
let { node: t } = e;
|
|
3516
|
-
if (t.type !== "ConditionalExpression")
|
|
3885
|
+
if (t.type !== "ConditionalExpression")
|
|
3886
|
+
return !1;
|
|
3517
3887
|
let n, r = t;
|
|
3518
3888
|
for (let u = 0; !n; u++) {
|
|
3519
3889
|
let a = e.getParentNode(u);
|
|
@@ -3527,7 +3897,8 @@ function $c(e) {
|
|
|
3527
3897
|
}
|
|
3528
3898
|
var hn = (e) => [w("("), A([E, e]), E, w(")")];
|
|
3529
3899
|
function pr(e, t, n, r) {
|
|
3530
|
-
if (!t.experimentalTernaries)
|
|
3900
|
+
if (!t.experimentalTernaries)
|
|
3901
|
+
return Jc(e, t, n);
|
|
3531
3902
|
let { node: u } = e, a = u.type === "ConditionalExpression", s = Re(u), o = a ? "consequent" : "trueType", i = a ? "alternate" : "falseType", l = a ? ["test"] : ["checkType", "extendsType"], d = u[o], D = u[i], c = l.map((me) => u[me]), { parent: p } = e, y = p.type === u.type, f = y && l.some((me) => p[me] === u), g = y && p[i] === u, S = d.type === u.type, b = D.type === u.type, x = b || g, j = t.tabWidth > 2 || t.useTabs, v, B, M = 0;
|
|
3532
3903
|
do
|
|
3533
3904
|
B = v || u, v = e.getParentNode(M), M++;
|
|
@@ -3542,12 +3913,13 @@ function pr(e, t, n, r) {
|
|
|
3542
3913
|
}, "test"), !b && h(D, T.Dangling) && e.call((me) => {
|
|
3543
3914
|
xt.push($(me, t));
|
|
3544
3915
|
}, "alternate"), h(u, T.Dangling) && xt.push($(e, t));
|
|
3545
|
-
let Dr =
|
|
3916
|
+
let Dr = Symbol("test"), za = Symbol("consequent"), Ot = Symbol("test-and-consequent"), Qa = a ? [hn(n("test")), u.test.type === "ConditionalExpression" ? ve : ""] : [n("checkType"), " ", "extends", " ", Re(u.extendsType) || u.extendsType.type === "TSMappedType" ? n("extendsType") : m(hn(n("extendsType")))], yr = m([Qa, " ?"], { id: Dr }), Ya = n(o), Jt = A([S || U && (K(d) || y || x) ? F : C, cr, Ya]), Za = lr ? m([yr, x ? Jt : w(Jt, m(Jt, { id: za }), { groupId: Dr })], { id: Ot }) : [yr, Jt], pn = n(i), dr = xe ? w(pn, cu(hn(pn)), { groupId: Ot }) : pn, ht = [Za, xt.length > 0 ? [A([F, xt]), F] : b ? F : xe ? w(C, " ", { groupId: Ot }) : C, ":", b ? " " : j ? lr ? w(ue, w(x || xe ? " " : ue, " "), { groupId: Ot }) : w(ue, " ") : " ", b ? dr : m([A(dr), U && !xe ? E : ""]), P && !Oe ? E : "", st ? ve : ""];
|
|
3546
3917
|
return O && !st ? m(A([E, m(ht)])) : O || G ? m(A(ht)) : Oe || s && f ? m([A([E, ht]), V ? E : ""]) : p === k ? m(ht) : ht;
|
|
3547
3918
|
}
|
|
3548
3919
|
function Rc(e, t, n, r) {
|
|
3549
3920
|
let { node: u } = e;
|
|
3550
|
-
if (Wn(u))
|
|
3921
|
+
if (Wn(u))
|
|
3922
|
+
return Tc(e, t);
|
|
3551
3923
|
let a = t.semi ? ";" : "", s = [];
|
|
3552
3924
|
switch (u.type) {
|
|
3553
3925
|
case "JsExpressionRoot":
|
|
@@ -3603,7 +3975,8 @@ function Rc(e, t, n, r) {
|
|
|
3603
3975
|
if (L(o) && o.callee === u || R(o) && o.object === u) {
|
|
3604
3976
|
s = [A([E, ...s]), E];
|
|
3605
3977
|
let i = e.findAncestor((l) => l.type === "AwaitExpression" || l.type === "BlockStatement");
|
|
3606
|
-
if (i?.type !== "AwaitExpression" || !te(i.argument, (l) => l === u))
|
|
3978
|
+
if (i?.type !== "AwaitExpression" || !te(i.argument, (l) => l === u))
|
|
3979
|
+
return m(s);
|
|
3607
3980
|
}
|
|
3608
3981
|
}
|
|
3609
3982
|
return s;
|
|
@@ -3759,6 +4132,7 @@ function Rc(e, t, n, r) {
|
|
|
3759
4132
|
return "?";
|
|
3760
4133
|
case "ModuleExpression":
|
|
3761
4134
|
return ["module ", n("body")];
|
|
4135
|
+
case "InterpreterDirective":
|
|
3762
4136
|
default:
|
|
3763
4137
|
throw new At(u, "ESTree");
|
|
3764
4138
|
}
|
|
@@ -3788,7 +4162,8 @@ function Wc(e, t, n) {
|
|
|
3788
4162
|
}
|
|
3789
4163
|
function Uc(e, t, n) {
|
|
3790
4164
|
let { node: r } = e, u = r.params;
|
|
3791
|
-
if (r.rest && (u = [...u, r.rest]), u.length === 0)
|
|
4165
|
+
if (r.rest && (u = [...u, r.rest]), u.length === 0)
|
|
4166
|
+
return ["(", $(e, t, { filter: (s) => ge(t.originalText, I(s)) === ")" }), ")"];
|
|
3792
4167
|
let a = [];
|
|
3793
4168
|
return Vc(e, (s, o) => {
|
|
3794
4169
|
let i = o === u.length - 1;
|
|
@@ -3880,7 +4255,8 @@ function tD(e, t, n) {
|
|
|
3880
4255
|
}
|
|
3881
4256
|
function nD(e, t, n) {
|
|
3882
4257
|
let { node: r } = e;
|
|
3883
|
-
if (zr(r))
|
|
4258
|
+
if (zr(r))
|
|
4259
|
+
return r.type.slice(0, -14).toLowerCase();
|
|
3884
4260
|
let u = t.semi ? ";" : "";
|
|
3885
4261
|
switch (r.type) {
|
|
3886
4262
|
case "ComponentDeclaration":
|
|
@@ -4033,8 +4409,10 @@ function nD(e, t, n) {
|
|
|
4033
4409
|
function rD(e, t, n) {
|
|
4034
4410
|
var r;
|
|
4035
4411
|
let { node: u } = e;
|
|
4036
|
-
if (!u.type.startsWith("TS"))
|
|
4037
|
-
|
|
4412
|
+
if (!u.type.startsWith("TS"))
|
|
4413
|
+
return;
|
|
4414
|
+
if (Qr(u))
|
|
4415
|
+
return u.type.slice(2, -7).toLowerCase();
|
|
4038
4416
|
let a = t.semi ? ";" : "", s = [];
|
|
4039
4417
|
switch (u.type) {
|
|
4040
4418
|
case "TSThisType":
|
|
@@ -4162,15 +4540,18 @@ function rD(e, t, n) {
|
|
|
4162
4540
|
return jr(e, n, "?");
|
|
4163
4541
|
case "TSJSDocNonNullableType":
|
|
4164
4542
|
return jr(e, n, "!");
|
|
4543
|
+
case "TSParenthesizedType":
|
|
4165
4544
|
default:
|
|
4166
4545
|
throw new At(u, "TypeScript");
|
|
4167
4546
|
}
|
|
4168
4547
|
}
|
|
4169
4548
|
function uD(e, t, n, r) {
|
|
4170
|
-
if (_u(e))
|
|
4549
|
+
if (_u(e))
|
|
4550
|
+
return Ep(e, t);
|
|
4171
4551
|
for (let u of [tl, Kp, nD, rD, Rc]) {
|
|
4172
4552
|
let a = u(e, t, n, r);
|
|
4173
|
-
if (a !== void 0)
|
|
4553
|
+
if (a !== void 0)
|
|
4554
|
+
return a;
|
|
4174
4555
|
}
|
|
4175
4556
|
}
|
|
4176
4557
|
var aD = _(["ClassMethod", "ClassPrivateMethod", "ClassProperty", "ClassAccessorProperty", "AccessorProperty", "TSAbstractAccessorProperty", "PropertyDefinition", "TSAbstractPropertyDefinition", "ClassPrivateProperty", "MethodDefinition", "TSAbstractMethodDefinition", "TSDeclareMethod"]);
|
|
@@ -4178,11 +4559,14 @@ function sD(e, t, n, r) {
|
|
|
4178
4559
|
var u;
|
|
4179
4560
|
e.isRoot && ((u = t.__onHtmlBindingRoot) == null || u.call(t, e.node, t));
|
|
4180
4561
|
let a = uD(e, t, n, r);
|
|
4181
|
-
if (!a)
|
|
4562
|
+
if (!a)
|
|
4563
|
+
return "";
|
|
4182
4564
|
let { node: s } = e;
|
|
4183
|
-
if (aD(s))
|
|
4565
|
+
if (aD(s))
|
|
4566
|
+
return a;
|
|
4184
4567
|
let o = J(s.decorators), i = sl(e, t, n), l = s.type === "ClassExpression";
|
|
4185
|
-
if (o && !l)
|
|
4568
|
+
if (o && !l)
|
|
4569
|
+
return bn(a, (c) => m([i, c]));
|
|
4186
4570
|
let d = ut(e, t), D = xc(e, t);
|
|
4187
4571
|
return !i && !d && !D ? a : bn(a, (c) => [D ? ";" : "", d ? "(" : "", d && l && o ? [A([C, i, c]), C] : [i, c], d ? ")" : ""]);
|
|
4188
4572
|
}
|
|
@@ -4195,7 +4579,8 @@ function dD(e, t, n) {
|
|
|
4195
4579
|
case "JsonRoot":
|
|
4196
4580
|
return [n("node"), F];
|
|
4197
4581
|
case "ArrayExpression": {
|
|
4198
|
-
if (r.elements.length === 0)
|
|
4582
|
+
if (r.elements.length === 0)
|
|
4583
|
+
return "[]";
|
|
4199
4584
|
let u = e.map(() => e.node === null ? "null" : n(), "elements");
|
|
4200
4585
|
return ["[", A([F, N([",", F], u)]), F, "]"];
|
|
4201
4586
|
}
|
|
@@ -4234,12 +4619,15 @@ function Ha(e, t) {
|
|
|
4234
4619
|
r.type === "Identifier" ? t.key = { type: "StringLiteral", value: r.name } : r.type === "NumericLiteral" && (t.key = { type: "StringLiteral", value: String(r.value) });
|
|
4235
4620
|
return;
|
|
4236
4621
|
}
|
|
4237
|
-
if (n === "UnaryExpression" && e.operator === "+")
|
|
4622
|
+
if (n === "UnaryExpression" && e.operator === "+")
|
|
4623
|
+
return t.argument;
|
|
4238
4624
|
if (n === "ArrayExpression") {
|
|
4239
|
-
for (let [r, u] of e.elements.entries())
|
|
4625
|
+
for (let [r, u] of e.elements.entries())
|
|
4626
|
+
u === null && t.elements.splice(r, 0, { type: "NullLiteral" });
|
|
4240
4627
|
return;
|
|
4241
4628
|
}
|
|
4242
|
-
if (n === "TemplateLiteral")
|
|
4629
|
+
if (n === "TemplateLiteral")
|
|
4630
|
+
return { type: "StringLiteral", value: e.quasis[0].value.cooked };
|
|
4243
4631
|
}
|
|
4244
4632
|
Ha.ignoredProperties = mD;
|
|
4245
4633
|
var Tt = { bracketSpacing: { category: "Common", type: "boolean", default: !0, description: "Print spaces between brackets.", oppositeDescription: "Do not print spaces between brackets." }, objectWrap: { category: "Common", type: "choice", default: "preserve", description: "How to wrap object literals.", choices: [{ value: "preserve", description: "Keep as multi-line, if there is a newline between the opening brace and first property." }, { value: "collapse", description: "Fit to a single line when possible." }] }, singleQuote: { category: "Common", type: "boolean", default: !1, description: "Use single quotes instead of double quotes." }, bracketSameLine: { category: "Common", type: "boolean", default: !1, description: "Put > of opening tags on the last line instead of on a new line." }, singleAttributePerLine: { category: "Common", type: "boolean", default: !1, description: "Enforce single attribute per line in HTML, Vue and JSX." } }, _e = "JavaScript", fD = { arrowParens: { category: _e, type: "choice", default: "always", description: "Include parentheses around a sole arrow function parameter.", choices: [{ value: "always", description: "Always include parens. Example: `(x) => x`" }, { value: "avoid", description: "Omit parens when possible. Example: `x => x`" }] }, bracketSameLine: Tt.bracketSameLine, objectWrap: Tt.objectWrap, bracketSpacing: Tt.bracketSpacing, jsxBracketSameLine: { category: _e, type: "boolean", description: "Put > on the last line instead of at a new line.", deprecated: "2.4.0" }, semi: { category: _e, type: "boolean", default: !0, description: "Print semicolons.", oppositeDescription: "Do not print semicolons, except at the beginning of lines which may need them." }, experimentalOperatorPosition: { category: _e, type: "choice", default: "end", description: "Where to print operators when binary expressions wrap lines.", choices: [{ value: "start", description: "Print operators at the start of new lines." }, { value: "end", description: "Print operators at the end of previous lines." }] }, experimentalTernaries: { category: _e, type: "boolean", default: !1, description: "Use curious ternaries, with the question mark after the condition.", oppositeDescription: "Default behavior of ternaries; keep question marks on the same line as the consequent." }, singleQuote: Tt.singleQuote, jsxSingleQuote: { category: _e, type: "boolean", default: !1, description: "Use single quotes in JSX." }, quoteProps: { category: _e, type: "choice", default: "as-needed", description: "Change when properties in objects are quoted.", choices: [{ value: "as-needed", description: "Only add quotes around object properties where required." }, { value: "consistent", description: "If at least one property in an object requires quotes, quote all properties." }, { value: "preserve", description: "Respect the input use of quotes in object properties." }] }, trailingComma: { category: _e, type: "choice", default: "all", description: "Print trailing commas wherever possible when multi-line.", choices: [{ value: "all", description: "Trailing commas wherever possible (including function arguments)." }, { value: "es5", description: "Trailing commas where valid in ES5 (objects, arrays, etc.)" }, { value: "none", description: "No trailing commas." }] }, singleAttributePerLine: Tt.singleAttributePerLine }, ED = fD, FD = { estree: Wr, "estree-json": Ka }, AD = [...rs, ...pD], gD = Rr;
|