prettier-plugin-embed 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.bak +211 -0
- package/README.md +62 -37
- package/dist/embedded/css/embedded-language.d.ts +6 -0
- package/dist/embedded/css/embedder.d.ts +9 -0
- package/dist/embedded/css/index.d.ts +3 -0
- package/dist/embedded/css/options.d.ts +37 -0
- package/dist/embedded/es/options.d.ts +14 -10
- package/dist/embedded/glsl/embedded-language.d.ts +6 -0
- package/dist/embedded/glsl/embedder.d.ts +9 -0
- package/dist/embedded/glsl/index.d.ts +3 -0
- package/dist/embedded/glsl/options.d.ts +37 -0
- package/dist/embedded/html/options.d.ts +10 -6
- package/dist/embedded/index.d.ts +1 -0
- package/dist/embedded/markdown/embedded-language.d.ts +6 -0
- package/dist/embedded/markdown/embedder.d.ts +9 -0
- package/dist/embedded/markdown/index.d.ts +3 -0
- package/dist/embedded/markdown/options.d.ts +38 -0
- package/dist/embedded/noop/options.d.ts +6 -3
- package/dist/embedded/php/options.d.ts +15 -11
- package/dist/embedded/register.d.ts +11 -7
- package/dist/embedded/ruby/embedded-language.d.ts +6 -0
- package/dist/embedded/ruby/embedder.d.ts +9 -0
- package/dist/embedded/ruby/index.d.ts +3 -0
- package/dist/embedded/ruby/options.d.ts +60 -0
- package/dist/embedded/sql/options.d.ts +9 -6
- package/dist/embedded/ts/options.d.ts +14 -10
- package/dist/embedded/utils.d.ts +4 -2
- package/dist/embedded/xml/options.d.ts +12 -8
- package/dist/index.js +819 -525
- package/dist/options.d.ts +55 -12
- package/package.json +18 -11
- package/dist/prettier-plugin-embed-wide-dark.svg +0 -309
- package/dist/prettier-plugin-embed-wide-light.svg +0 -309
package/dist/index.js
CHANGED
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { utils as
|
|
7
|
-
import { parse as
|
|
8
|
-
import { printers as
|
|
9
|
-
const
|
|
10
|
-
function
|
|
1
|
+
import rt from "prettier/parser-babel";
|
|
2
|
+
import it from "prettier/parser-espree";
|
|
3
|
+
import ot from "prettier/parser-flow";
|
|
4
|
+
import at from "prettier/parser-typescript";
|
|
5
|
+
import dt from "prettier/parser-meriyah";
|
|
6
|
+
import { utils as re, builders as k } from "prettier/doc";
|
|
7
|
+
import { parse as lt } from "@xml-tools/parser";
|
|
8
|
+
import { printers as ct } from "prettier/plugins/estree.mjs";
|
|
9
|
+
const We = "embeddedCss";
|
|
10
|
+
function ut(e) {
|
|
11
11
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
12
12
|
}
|
|
13
|
-
var
|
|
13
|
+
var Ge = { exports: {} };
|
|
14
14
|
(function(e) {
|
|
15
15
|
var n = (() => {
|
|
16
|
-
var
|
|
17
|
-
for (var
|
|
18
|
-
h.call(
|
|
19
|
-
if (
|
|
20
|
-
for (var
|
|
21
|
-
|
|
22
|
-
return
|
|
23
|
-
},
|
|
24
|
-
for (var
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
if (
|
|
28
|
-
for (let
|
|
29
|
-
!h.call(
|
|
30
|
-
return
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
DEFAULT_OPTIONS: () =>
|
|
34
|
-
DEFAULT_UUID_LENGTH: () =>
|
|
35
|
-
default: () =>
|
|
16
|
+
var r = Object.defineProperty, t = Object.getOwnPropertyDescriptor, s = Object.getOwnPropertyNames, o = Object.getOwnPropertySymbols, h = Object.prototype.hasOwnProperty, g = Object.prototype.propertyIsEnumerable, d = (p, a, c) => a in p ? r(p, a, { enumerable: !0, configurable: !0, writable: !0, value: c }) : p[a] = c, f = (p, a) => {
|
|
17
|
+
for (var c in a || (a = {}))
|
|
18
|
+
h.call(a, c) && d(p, c, a[c]);
|
|
19
|
+
if (o)
|
|
20
|
+
for (var c of o(a))
|
|
21
|
+
g.call(a, c) && d(p, c, a[c]);
|
|
22
|
+
return p;
|
|
23
|
+
}, u = (p, a) => {
|
|
24
|
+
for (var c in a)
|
|
25
|
+
r(p, c, { get: a[c], enumerable: !0 });
|
|
26
|
+
}, $ = (p, a, c, I) => {
|
|
27
|
+
if (a && typeof a == "object" || typeof a == "function")
|
|
28
|
+
for (let E of s(a))
|
|
29
|
+
!h.call(p, E) && E !== c && r(p, E, { get: () => a[E], enumerable: !(I = t(a, E)) || I.enumerable });
|
|
30
|
+
return p;
|
|
31
|
+
}, S = (p) => $(r({}, "__esModule", { value: !0 }), p), i = (p, a, c) => (d(p, typeof a != "symbol" ? a + "" : a, c), c), _ = {};
|
|
32
|
+
u(_, {
|
|
33
|
+
DEFAULT_OPTIONS: () => L,
|
|
34
|
+
DEFAULT_UUID_LENGTH: () => v,
|
|
35
|
+
default: () => y
|
|
36
36
|
});
|
|
37
|
-
var
|
|
37
|
+
var b = "5.0.3", v = 6, L = {
|
|
38
38
|
dictionary: "alphanum",
|
|
39
39
|
shuffle: !0,
|
|
40
40
|
debug: !1,
|
|
41
|
-
length:
|
|
41
|
+
length: v,
|
|
42
42
|
counter: 0
|
|
43
|
-
},
|
|
44
|
-
constructor(
|
|
45
|
-
|
|
43
|
+
}, m = class {
|
|
44
|
+
constructor(a = {}) {
|
|
45
|
+
i(this, "counter"), i(this, "debug"), i(this, "dict"), i(this, "version"), i(this, "dictIndex", 0), i(this, "dictRange", []), i(this, "lowerBound", 0), i(this, "upperBound", 0), i(this, "dictLength", 0), i(this, "uuidLength"), i(this, "_digit_first_ascii", 48), i(this, "_digit_last_ascii", 58), i(this, "_alpha_lower_first_ascii", 97), i(this, "_alpha_lower_last_ascii", 123), i(this, "_hex_last_ascii", 103), i(this, "_alpha_upper_first_ascii", 65), i(this, "_alpha_upper_last_ascii", 91), i(this, "_number_dict_ranges", {
|
|
46
46
|
digits: [this._digit_first_ascii, this._digit_last_ascii]
|
|
47
|
-
}),
|
|
47
|
+
}), i(this, "_alpha_dict_ranges", {
|
|
48
48
|
lowerCase: [this._alpha_lower_first_ascii, this._alpha_lower_last_ascii],
|
|
49
49
|
upperCase: [this._alpha_upper_first_ascii, this._alpha_upper_last_ascii]
|
|
50
|
-
}),
|
|
50
|
+
}), i(this, "_alpha_lower_dict_ranges", {
|
|
51
51
|
lowerCase: [this._alpha_lower_first_ascii, this._alpha_lower_last_ascii]
|
|
52
|
-
}),
|
|
52
|
+
}), i(this, "_alpha_upper_dict_ranges", {
|
|
53
53
|
upperCase: [this._alpha_upper_first_ascii, this._alpha_upper_last_ascii]
|
|
54
|
-
}),
|
|
54
|
+
}), i(this, "_alphanum_dict_ranges", {
|
|
55
55
|
digits: [this._digit_first_ascii, this._digit_last_ascii],
|
|
56
56
|
lowerCase: [this._alpha_lower_first_ascii, this._alpha_lower_last_ascii],
|
|
57
57
|
upperCase: [this._alpha_upper_first_ascii, this._alpha_upper_last_ascii]
|
|
58
|
-
}),
|
|
58
|
+
}), i(this, "_alphanum_lower_dict_ranges", {
|
|
59
59
|
digits: [this._digit_first_ascii, this._digit_last_ascii],
|
|
60
60
|
lowerCase: [this._alpha_lower_first_ascii, this._alpha_lower_last_ascii]
|
|
61
|
-
}),
|
|
61
|
+
}), i(this, "_alphanum_upper_dict_ranges", {
|
|
62
62
|
digits: [this._digit_first_ascii, this._digit_last_ascii],
|
|
63
63
|
upperCase: [this._alpha_upper_first_ascii, this._alpha_upper_last_ascii]
|
|
64
|
-
}),
|
|
64
|
+
}), i(this, "_hex_dict_ranges", {
|
|
65
65
|
decDigits: [this._digit_first_ascii, this._digit_last_ascii],
|
|
66
66
|
alphaDigits: [this._alpha_lower_first_ascii, this._hex_last_ascii]
|
|
67
|
-
}),
|
|
67
|
+
}), i(this, "_dict_ranges", {
|
|
68
68
|
_number_dict_ranges: this._number_dict_ranges,
|
|
69
69
|
_alpha_dict_ranges: this._alpha_dict_ranges,
|
|
70
70
|
_alpha_lower_dict_ranges: this._alpha_lower_dict_ranges,
|
|
@@ -73,72 +73,72 @@ var ve = { exports: {} };
|
|
|
73
73
|
_alphanum_lower_dict_ranges: this._alphanum_lower_dict_ranges,
|
|
74
74
|
_alphanum_upper_dict_ranges: this._alphanum_upper_dict_ranges,
|
|
75
75
|
_hex_dict_ranges: this._hex_dict_ranges
|
|
76
|
-
}),
|
|
77
|
-
const
|
|
78
|
-
if (
|
|
79
|
-
return console.log(...
|
|
80
|
-
}),
|
|
81
|
-
let
|
|
82
|
-
if (
|
|
83
|
-
|
|
76
|
+
}), i(this, "log", (...l) => {
|
|
77
|
+
const x = [...l];
|
|
78
|
+
if (x[0] = `[short-unique-id] ${l[0]}`, this.debug === !0 && typeof console < "u" && console !== null)
|
|
79
|
+
return console.log(...x);
|
|
80
|
+
}), i(this, "setDictionary", (l, x) => {
|
|
81
|
+
let w;
|
|
82
|
+
if (l && Array.isArray(l) && l.length > 1)
|
|
83
|
+
w = l;
|
|
84
84
|
else {
|
|
85
|
-
|
|
86
|
-
let
|
|
87
|
-
this.dictIndex =
|
|
88
|
-
const
|
|
89
|
-
Object.keys(
|
|
90
|
-
const
|
|
91
|
-
for (this.dictRange =
|
|
92
|
-
|
|
85
|
+
w = [];
|
|
86
|
+
let T;
|
|
87
|
+
this.dictIndex = T = 0;
|
|
88
|
+
const P = `_${l}_dict_ranges`, U = this._dict_ranges[P];
|
|
89
|
+
Object.keys(U).forEach((N) => {
|
|
90
|
+
const te = N;
|
|
91
|
+
for (this.dictRange = U[te], this.lowerBound = this.dictRange[0], this.upperBound = this.dictRange[1], this.dictIndex = T = this.lowerBound; this.lowerBound <= this.upperBound ? T < this.upperBound : T > this.upperBound; this.dictIndex = this.lowerBound <= this.upperBound ? T += 1 : T -= 1)
|
|
92
|
+
w.push(String.fromCharCode(this.dictIndex));
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
|
-
|
|
96
|
-
}),
|
|
97
|
-
let
|
|
98
|
-
|
|
95
|
+
x && (w = w.sort(() => Math.random() - 0.5)), this.dict = w, this.dictLength = this.dict.length, this.setCounter(0);
|
|
96
|
+
}), i(this, "seq", () => this.sequentialUUID()), i(this, "sequentialUUID", () => {
|
|
97
|
+
let l, x, w = "";
|
|
98
|
+
l = this.counter;
|
|
99
99
|
do
|
|
100
|
-
|
|
101
|
-
while (
|
|
102
|
-
return this.counter += 1,
|
|
103
|
-
}),
|
|
104
|
-
let
|
|
105
|
-
if (
|
|
100
|
+
x = l % this.dictLength, l = Math.trunc(l / this.dictLength), w += this.dict[x];
|
|
101
|
+
while (l !== 0);
|
|
102
|
+
return this.counter += 1, w;
|
|
103
|
+
}), i(this, "rnd", (l = this.uuidLength || v) => this.randomUUID(l)), i(this, "randomUUID", (l = this.uuidLength || v) => {
|
|
104
|
+
let x, w, T;
|
|
105
|
+
if (l === null || typeof l > "u" || l < 1)
|
|
106
106
|
throw new Error("Invalid UUID Length Provided");
|
|
107
|
-
for (
|
|
108
|
-
|
|
107
|
+
for (x = "", T = 0; T < l; T += 1)
|
|
108
|
+
w = parseInt(
|
|
109
109
|
(Math.random() * this.dictLength).toFixed(0),
|
|
110
110
|
10
|
|
111
|
-
) % this.dictLength,
|
|
112
|
-
return
|
|
113
|
-
}),
|
|
114
|
-
const
|
|
111
|
+
) % this.dictLength, x += this.dict[w];
|
|
112
|
+
return x;
|
|
113
|
+
}), i(this, "fmt", (l, x) => this.formattedUUID(l, x)), i(this, "formattedUUID", (l, x) => {
|
|
114
|
+
const w = {
|
|
115
115
|
$r: this.randomUUID,
|
|
116
116
|
$s: this.sequentialUUID,
|
|
117
117
|
$t: this.stamp
|
|
118
118
|
};
|
|
119
|
-
return
|
|
119
|
+
return l.replace(
|
|
120
120
|
/\$[rs]\d{0,}|\$t0|\$t[1-9]\d{1,}/g,
|
|
121
|
-
(
|
|
122
|
-
const
|
|
123
|
-
return
|
|
121
|
+
(P) => {
|
|
122
|
+
const U = P.slice(0, 2), N = parseInt(P.slice(2), 10);
|
|
123
|
+
return U === "$s" ? w[U]().padStart(N, "0") : U === "$t" && x ? w[U](N, x) : w[U](N);
|
|
124
124
|
}
|
|
125
125
|
);
|
|
126
|
-
}),
|
|
127
|
-
Math.pow([...new Set(this.dict)].length,
|
|
128
|
-
)),
|
|
129
|
-
Math.sqrt(Math.PI / 2 *
|
|
130
|
-
)),
|
|
131
|
-
(this.approxMaxBeforeCollision(
|
|
132
|
-
)),
|
|
133
|
-
const
|
|
134
|
-
(1 - this.approxMaxBeforeCollision(
|
|
126
|
+
}), i(this, "availableUUIDs", (l = this.uuidLength) => parseFloat(
|
|
127
|
+
Math.pow([...new Set(this.dict)].length, l).toFixed(0)
|
|
128
|
+
)), i(this, "approxMaxBeforeCollision", (l = this.availableUUIDs(this.uuidLength)) => parseFloat(
|
|
129
|
+
Math.sqrt(Math.PI / 2 * l).toFixed(20)
|
|
130
|
+
)), i(this, "collisionProbability", (l = this.availableUUIDs(this.uuidLength), x = this.uuidLength) => parseFloat(
|
|
131
|
+
(this.approxMaxBeforeCollision(l) / this.availableUUIDs(x)).toFixed(20)
|
|
132
|
+
)), i(this, "uniqueness", (l = this.availableUUIDs(this.uuidLength)) => {
|
|
133
|
+
const x = parseFloat(
|
|
134
|
+
(1 - this.approxMaxBeforeCollision(l) / l).toFixed(20)
|
|
135
135
|
);
|
|
136
|
-
return
|
|
137
|
-
}),
|
|
138
|
-
const
|
|
139
|
-
if (typeof
|
|
140
|
-
return
|
|
141
|
-
if (typeof
|
|
136
|
+
return x > 1 ? 1 : x < 0 ? 0 : x;
|
|
137
|
+
}), i(this, "getVersion", () => this.version), i(this, "stamp", (l, x) => {
|
|
138
|
+
const w = Math.floor(+(x || /* @__PURE__ */ new Date()) / 1e3).toString(16);
|
|
139
|
+
if (typeof l == "number" && l === 0)
|
|
140
|
+
return w;
|
|
141
|
+
if (typeof l != "number" || l < 10)
|
|
142
142
|
throw new Error(
|
|
143
143
|
[
|
|
144
144
|
"Param finalLength must be a number greater than or equal to 10,",
|
|
@@ -146,233 +146,353 @@ var ve = { exports: {} };
|
|
|
146
146
|
].join(`
|
|
147
147
|
`)
|
|
148
148
|
);
|
|
149
|
-
const
|
|
150
|
-
return `${
|
|
151
|
-
}),
|
|
152
|
-
if (
|
|
149
|
+
const T = l - 9, P = Math.round(Math.random() * (T > 15 ? 15 : T)), U = this.randomUUID(T);
|
|
150
|
+
return `${U.substring(0, P)}${w}${U.substring(P)}${P.toString(16)}`;
|
|
151
|
+
}), i(this, "parseStamp", (l, x) => {
|
|
152
|
+
if (x && !/t0|t[1-9]\d{1,}/.test(x))
|
|
153
153
|
throw new Error("Cannot extract date from a formated UUID with no timestamp in the format");
|
|
154
|
-
const
|
|
154
|
+
const w = x ? x.replace(
|
|
155
155
|
/\$[rs]\d{0,}|\$t0|\$t[1-9]\d{1,}/g,
|
|
156
|
-
(
|
|
157
|
-
const
|
|
158
|
-
$r: (
|
|
159
|
-
$s: (
|
|
160
|
-
$t: (
|
|
161
|
-
},
|
|
162
|
-
return
|
|
156
|
+
(P) => {
|
|
157
|
+
const U = {
|
|
158
|
+
$r: (Y) => [...Array(Y)].map(() => "r").join(""),
|
|
159
|
+
$s: (Y) => [...Array(Y)].map(() => "s").join(""),
|
|
160
|
+
$t: (Y) => [...Array(Y)].map(() => "t").join("")
|
|
161
|
+
}, N = P.slice(0, 2), te = parseInt(P.slice(2), 10);
|
|
162
|
+
return U[N](te);
|
|
163
163
|
}
|
|
164
164
|
).replace(
|
|
165
165
|
/^(.*?)(t{8,})(.*)$/g,
|
|
166
|
-
(
|
|
167
|
-
) :
|
|
168
|
-
if (
|
|
169
|
-
return new Date(parseInt(
|
|
170
|
-
if (
|
|
166
|
+
(P, U, N) => l.substring(U.length, U.length + N.length)
|
|
167
|
+
) : l;
|
|
168
|
+
if (w.length === 8)
|
|
169
|
+
return new Date(parseInt(w, 16) * 1e3);
|
|
170
|
+
if (w.length < 10)
|
|
171
171
|
throw new Error("Stamp length invalid");
|
|
172
|
-
const
|
|
173
|
-
return new Date(parseInt(
|
|
174
|
-
}),
|
|
175
|
-
this.counter =
|
|
172
|
+
const T = parseInt(w.substring(w.length - 1), 16);
|
|
173
|
+
return new Date(parseInt(w.substring(T, T + 8), 16) * 1e3);
|
|
174
|
+
}), i(this, "setCounter", (l) => {
|
|
175
|
+
this.counter = l;
|
|
176
176
|
});
|
|
177
|
-
const
|
|
178
|
-
this.counter = 0, this.debug = !1, this.dict = [], this.version =
|
|
177
|
+
const c = f(f({}, L), a);
|
|
178
|
+
this.counter = 0, this.debug = !1, this.dict = [], this.version = b;
|
|
179
179
|
const {
|
|
180
|
-
dictionary:
|
|
181
|
-
shuffle:
|
|
182
|
-
length:
|
|
183
|
-
counter:
|
|
184
|
-
} =
|
|
185
|
-
return this.uuidLength =
|
|
180
|
+
dictionary: I,
|
|
181
|
+
shuffle: E,
|
|
182
|
+
length: D,
|
|
183
|
+
counter: O
|
|
184
|
+
} = c;
|
|
185
|
+
return this.uuidLength = D, this.setDictionary(I, E), this.setCounter(O), this.debug = c.debug, this.log(this.dict), this.log(
|
|
186
186
|
`Generator instantiated with Dictionary Size ${this.dictLength} and counter set to ${this.counter}`
|
|
187
187
|
), this.log = this.log.bind(this), this.setDictionary = this.setDictionary.bind(this), this.setCounter = this.setCounter.bind(this), this.seq = this.seq.bind(this), this.sequentialUUID = this.sequentialUUID.bind(this), this.rnd = this.rnd.bind(this), this.randomUUID = this.randomUUID.bind(this), this.fmt = this.fmt.bind(this), this.formattedUUID = this.formattedUUID.bind(this), this.availableUUIDs = this.availableUUIDs.bind(this), this.approxMaxBeforeCollision = this.approxMaxBeforeCollision.bind(this), this.collisionProbability = this.collisionProbability.bind(this), this.uniqueness = this.uniqueness.bind(this), this.getVersion = this.getVersion.bind(this), this.stamp = this.stamp.bind(this), this.parseStamp = this.parseStamp.bind(this), this;
|
|
188
188
|
}
|
|
189
189
|
};
|
|
190
|
-
|
|
191
|
-
var
|
|
192
|
-
return
|
|
190
|
+
i(m, "default", m);
|
|
191
|
+
var y = m;
|
|
192
|
+
return S(_);
|
|
193
193
|
})();
|
|
194
194
|
e.exports = n.default, typeof window < "u" && (n = n.default);
|
|
195
|
-
})(
|
|
196
|
-
var
|
|
197
|
-
const
|
|
198
|
-
function
|
|
199
|
-
var
|
|
200
|
-
const { node:
|
|
195
|
+
})(Ge);
|
|
196
|
+
var pt = Ge.exports;
|
|
197
|
+
const ht = /* @__PURE__ */ ut(pt), { group: gt, indent: mt, softline: le, lineSuffixBoundary: _t } = k, { mapDoc: ft } = re;
|
|
198
|
+
function bt(e, n) {
|
|
199
|
+
var s;
|
|
200
|
+
const { node: r } = e;
|
|
201
201
|
let t = n();
|
|
202
|
-
return (
|
|
202
|
+
return (s = r == null ? void 0 : r.comments) != null && s.length && (t = gt([mt([le, t]), le])), ["${", t, _t, "}"];
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function M(e, n) {
|
|
205
205
|
return e.map(
|
|
206
|
-
(
|
|
206
|
+
(r) => bt(r, n),
|
|
207
207
|
"expressions"
|
|
208
208
|
);
|
|
209
209
|
}
|
|
210
|
-
function
|
|
211
|
-
return
|
|
212
|
-
if (typeof
|
|
213
|
-
return
|
|
214
|
-
const
|
|
215
|
-
for (let
|
|
216
|
-
let
|
|
217
|
-
if (
|
|
218
|
-
if (!
|
|
210
|
+
function q(e, n, r) {
|
|
211
|
+
return ft(e, (s) => {
|
|
212
|
+
if (typeof s != "string")
|
|
213
|
+
return s;
|
|
214
|
+
const o = [], h = s.split(n);
|
|
215
|
+
for (let g = 0; g < h.length; g++) {
|
|
216
|
+
let d = h[g];
|
|
217
|
+
if (g % 2 == 0) {
|
|
218
|
+
if (!d)
|
|
219
219
|
continue;
|
|
220
|
-
|
|
220
|
+
d = d.replaceAll(/([\\`]|\${)/g, "\\$1"), o.push(d);
|
|
221
221
|
} else {
|
|
222
|
-
const
|
|
223
|
-
|
|
222
|
+
const f = Number(d);
|
|
223
|
+
o.push(r[f]);
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
|
-
return
|
|
226
|
+
return o;
|
|
227
227
|
});
|
|
228
228
|
}
|
|
229
|
-
function Q(e, n,
|
|
229
|
+
function Q(e, n, r) {
|
|
230
230
|
var t;
|
|
231
231
|
if (!(((t = n.plugins) == null ? void 0 : t.some(
|
|
232
|
-
(
|
|
233
|
-
var
|
|
234
|
-
return ((
|
|
232
|
+
(s) => {
|
|
233
|
+
var o;
|
|
234
|
+
return ((o = s.name) == null ? void 0 : o.includes(e)) ?? !1;
|
|
235
235
|
}
|
|
236
236
|
)) ?? !1))
|
|
237
237
|
throw new Error(
|
|
238
|
-
`Cannot format embedded language identified by "${
|
|
238
|
+
`Cannot format embedded language identified by "${r}", because plugin "${e}" is not loaded.`
|
|
239
239
|
);
|
|
240
240
|
}
|
|
241
|
-
function
|
|
242
|
-
if (n ===
|
|
241
|
+
function yt(e, n, r) {
|
|
242
|
+
if (n === r) {
|
|
243
243
|
e.unshift(n);
|
|
244
244
|
return;
|
|
245
245
|
}
|
|
246
|
-
let t = 0,
|
|
247
|
-
for (; t <
|
|
248
|
-
const
|
|
249
|
-
if (e[
|
|
246
|
+
let t = 0, s = e.length;
|
|
247
|
+
for (; t < s; ) {
|
|
248
|
+
const o = t + s >>> 1;
|
|
249
|
+
if (e[o] === r) {
|
|
250
250
|
e.push(n);
|
|
251
251
|
return;
|
|
252
252
|
}
|
|
253
|
-
e[
|
|
253
|
+
e[o] < n ? t = o + 1 : s = o;
|
|
254
254
|
}
|
|
255
255
|
e.splice(t, 0, n);
|
|
256
256
|
}
|
|
257
|
-
const { randomUUID:
|
|
257
|
+
const { randomUUID: ce } = new ht({
|
|
258
258
|
length: 16,
|
|
259
259
|
dictionary: "alphanum_lower"
|
|
260
260
|
});
|
|
261
|
-
function
|
|
262
|
-
const
|
|
263
|
-
`${
|
|
261
|
+
function j(e = "p", n = "") {
|
|
262
|
+
const r = ce(), t = ce(), s = ue(e), o = ue(n), h = (d) => `${e}${r}${d}${t}${n}`, g = new RegExp(
|
|
263
|
+
`${s}${r}(\\d+)${t}${o}`,
|
|
264
264
|
"g"
|
|
265
265
|
);
|
|
266
266
|
return {
|
|
267
267
|
createPlaceholder: h,
|
|
268
|
-
placeholderRegex:
|
|
268
|
+
placeholderRegex: g
|
|
269
269
|
};
|
|
270
270
|
}
|
|
271
|
-
function
|
|
271
|
+
function ue(e) {
|
|
272
272
|
return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
273
273
|
}
|
|
274
|
-
|
|
275
|
-
|
|
274
|
+
function R(e) {
|
|
275
|
+
return `${e}Identifiers`;
|
|
276
|
+
}
|
|
277
|
+
function It(e) {
|
|
278
|
+
return `${e}Parser`;
|
|
279
|
+
}
|
|
280
|
+
const { line: pe, group: B, indent: he, softline: ge } = k, Et = async (e, n, r, t, s) => {
|
|
281
|
+
var o, h, g, d, f;
|
|
282
|
+
try {
|
|
283
|
+
const { node: u } = r, { createPlaceholder: $, placeholderRegex: S } = j("@p"), i = u.quasis.map(
|
|
284
|
+
(a, c, { length: I }) => c === I - 1 ? a.value.cooked : a.value.cooked + $(c)
|
|
285
|
+
).join(""), _ = ((o = i.match(/^\s+/)) == null ? void 0 : o[0]) ?? "", b = ((h = i.match(/\s+$/)) == null ? void 0 : h[0]) ?? "", v = M(r, n), L = await e(i, {
|
|
286
|
+
parser: "scss"
|
|
287
|
+
}), m = q(
|
|
288
|
+
L,
|
|
289
|
+
S,
|
|
290
|
+
v
|
|
291
|
+
);
|
|
292
|
+
if ((g = t.preserveEmbeddedExteriorWhitespaces) != null && g.includes(s))
|
|
293
|
+
return B([
|
|
294
|
+
"`",
|
|
295
|
+
_,
|
|
296
|
+
(d = t.noEmbeddedMultiLineIndentation) != null && d.includes(s) ? [B(m)] : he([B(m)]),
|
|
297
|
+
b,
|
|
298
|
+
"`"
|
|
299
|
+
]);
|
|
300
|
+
const y = _.length ? pe : ge, p = b.length ? pe : ge;
|
|
301
|
+
return B([
|
|
302
|
+
"`",
|
|
303
|
+
(f = t.noEmbeddedMultiLineIndentation) != null && f.includes(s) ? [y, B(m)] : he([y, B(m)]),
|
|
304
|
+
p,
|
|
305
|
+
"`"
|
|
306
|
+
]);
|
|
307
|
+
} catch (u) {
|
|
308
|
+
throw console.error(u), u;
|
|
309
|
+
}
|
|
310
|
+
}, xt = ["css"], $t = R(We), vt = {
|
|
311
|
+
[$t]: {
|
|
312
|
+
category: "Global",
|
|
313
|
+
type: "string",
|
|
314
|
+
array: !0,
|
|
315
|
+
default: [{ value: [...xt] }],
|
|
316
|
+
description: "Specify embedded CSS language identifiers."
|
|
317
|
+
}
|
|
318
|
+
}, wt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
319
|
+
__proto__: null,
|
|
320
|
+
embeddedLanguage: We,
|
|
321
|
+
embedder: Et,
|
|
322
|
+
options: vt
|
|
323
|
+
}, Symbol.toStringTag, { value: "Module" })), ie = "embeddedEs", { line: me, group: F, indent: _e, softline: fe } = k, Dt = async (e, n, r, t, s) => {
|
|
324
|
+
var o, h, g, d, f;
|
|
276
325
|
try {
|
|
277
|
-
const { node:
|
|
278
|
-
(
|
|
279
|
-
).join(""),
|
|
326
|
+
const { node: u } = r, { createPlaceholder: $, placeholderRegex: S } = j(), i = u.quasis.map(
|
|
327
|
+
(a, c, { length: I }) => c === I - 1 ? a.value.cooked : a.value.cooked + $(c)
|
|
328
|
+
).join(""), _ = ((o = i.match(/^\s+/)) == null ? void 0 : o[0]) ?? "", b = ((h = i.match(/\s+$/)) == null ? void 0 : h[0]) ?? "", v = M(r, n), L = await e(i, {
|
|
280
329
|
parser: t.embeddedEsParser ?? "babel"
|
|
281
|
-
}),
|
|
282
|
-
T,
|
|
330
|
+
}), m = q(
|
|
283
331
|
L,
|
|
284
|
-
|
|
332
|
+
S,
|
|
333
|
+
v
|
|
285
334
|
);
|
|
286
|
-
if ((
|
|
287
|
-
return
|
|
335
|
+
if ((g = t.preserveEmbeddedExteriorWhitespaces) != null && g.includes(s))
|
|
336
|
+
return F([
|
|
288
337
|
"`",
|
|
289
|
-
|
|
290
|
-
(
|
|
291
|
-
|
|
338
|
+
_,
|
|
339
|
+
(d = t.noEmbeddedMultiLineIndentation) != null && d.includes(s) ? [F(m)] : _e([F(m)]),
|
|
340
|
+
b,
|
|
292
341
|
"`"
|
|
293
342
|
]);
|
|
294
|
-
const
|
|
295
|
-
return
|
|
343
|
+
const y = _.length ? me : fe, p = b.length ? me : fe;
|
|
344
|
+
return F([
|
|
296
345
|
"`",
|
|
297
|
-
(
|
|
298
|
-
|
|
346
|
+
(f = t.noEmbeddedMultiLineIndentation) != null && f.includes(s) ? [y, F(m)] : _e([y, F(m)]),
|
|
347
|
+
p,
|
|
299
348
|
"`"
|
|
300
349
|
]);
|
|
301
|
-
} catch (
|
|
302
|
-
throw console.error(
|
|
350
|
+
} catch (u) {
|
|
351
|
+
throw console.error(u), u;
|
|
303
352
|
}
|
|
304
|
-
},
|
|
353
|
+
}, Lt = [
|
|
305
354
|
"js",
|
|
355
|
+
"jsx",
|
|
306
356
|
"es",
|
|
307
357
|
"es6",
|
|
308
358
|
"mjs",
|
|
309
359
|
"cjs",
|
|
310
360
|
"pac",
|
|
311
361
|
"javascript"
|
|
312
|
-
],
|
|
313
|
-
[
|
|
362
|
+
], St = R(ie), Tt = It(ie), Ot = {
|
|
363
|
+
[St]: {
|
|
314
364
|
category: "Global",
|
|
315
365
|
type: "string",
|
|
316
366
|
array: !0,
|
|
317
|
-
default: [{ value: [...
|
|
318
|
-
description: "Specify embedded ES
|
|
367
|
+
default: [{ value: [...Lt] }],
|
|
368
|
+
description: "Specify embedded ES language identifiers."
|
|
319
369
|
},
|
|
320
|
-
[
|
|
370
|
+
[Tt]: {
|
|
321
371
|
category: "Global",
|
|
322
372
|
type: "string",
|
|
323
373
|
array: !1,
|
|
324
374
|
default: "babel",
|
|
325
|
-
description: "Specify the
|
|
375
|
+
description: "Specify the embedded ES language parser."
|
|
326
376
|
}
|
|
327
|
-
},
|
|
377
|
+
}, Ut = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
328
378
|
__proto__: null,
|
|
329
|
-
embeddedLanguage:
|
|
330
|
-
embedder:
|
|
331
|
-
options:
|
|
332
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
333
|
-
var
|
|
379
|
+
embeddedLanguage: ie,
|
|
380
|
+
embedder: Dt,
|
|
381
|
+
options: Ot
|
|
382
|
+
}, Symbol.toStringTag, { value: "Module" })), ze = "embeddedGlsl", { line: be, group: A, indent: ye, softline: Ie } = k, Pt = async (e, n, r, t, s) => {
|
|
383
|
+
var o, h, g, d, f;
|
|
334
384
|
try {
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
385
|
+
Q("prettier-plugin-glsl", t, s);
|
|
386
|
+
const { node: u } = r, { createPlaceholder: $, placeholderRegex: S } = j(), i = u.quasis.map(
|
|
387
|
+
(c, I, { length: E }) => I === E - 1 ? c.value.cooked : c.value.cooked + $(I)
|
|
388
|
+
).join(""), _ = ((o = i.match(/^\s+/)) == null ? void 0 : o[0]) ?? "", b = ((h = i.match(/\s+$/)) == null ? void 0 : h[0]) ?? "", v = i.slice(
|
|
389
|
+
_.length,
|
|
390
|
+
-b.length || void 0
|
|
391
|
+
), L = M(r, n), m = await e(v, {
|
|
392
|
+
parser: "glsl-parser"
|
|
393
|
+
}), y = q(
|
|
394
|
+
m,
|
|
395
|
+
S,
|
|
396
|
+
L
|
|
397
|
+
);
|
|
398
|
+
if ((g = t.preserveEmbeddedExteriorWhitespaces) != null && g.includes(s))
|
|
399
|
+
return A([
|
|
400
|
+
"`",
|
|
401
|
+
_,
|
|
402
|
+
(d = t.noEmbeddedMultiLineIndentation) != null && d.includes(s) ? [A(y)] : ye([A(y)]),
|
|
403
|
+
b,
|
|
404
|
+
"`"
|
|
405
|
+
]);
|
|
406
|
+
const p = _.length ? be : Ie, a = b.length ? be : Ie;
|
|
407
|
+
return A([
|
|
408
|
+
"`",
|
|
409
|
+
(f = t.noEmbeddedMultiLineIndentation) != null && f.includes(s) ? [p, A(y)] : ye([p, A(y)]),
|
|
410
|
+
a,
|
|
411
|
+
"`"
|
|
412
|
+
]);
|
|
413
|
+
} catch (u) {
|
|
414
|
+
throw console.error(u), u;
|
|
415
|
+
}
|
|
416
|
+
}, kt = [
|
|
417
|
+
"glsl",
|
|
418
|
+
"fp",
|
|
419
|
+
"frag",
|
|
420
|
+
"frg",
|
|
421
|
+
"fs",
|
|
422
|
+
"fsh",
|
|
423
|
+
"fshader",
|
|
424
|
+
"geo",
|
|
425
|
+
"geom",
|
|
426
|
+
"glslf",
|
|
427
|
+
"glslv",
|
|
428
|
+
"gs",
|
|
429
|
+
"gshader",
|
|
430
|
+
"rchit",
|
|
431
|
+
"rmiss",
|
|
432
|
+
"shader",
|
|
433
|
+
"tesc",
|
|
434
|
+
"tese",
|
|
435
|
+
"vert",
|
|
436
|
+
"vrx",
|
|
437
|
+
"vsh",
|
|
438
|
+
"vshader"
|
|
439
|
+
], Rt = R(ze), Mt = {
|
|
440
|
+
[Rt]: {
|
|
441
|
+
category: "Global",
|
|
442
|
+
type: "string",
|
|
443
|
+
array: !0,
|
|
444
|
+
default: [{ value: [...kt] }],
|
|
445
|
+
description: 'Specify embedded GLSL language identifiers. This requires "prettier-plugin-glsl".'
|
|
446
|
+
}
|
|
447
|
+
}, jt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
448
|
+
__proto__: null,
|
|
449
|
+
embeddedLanguage: ze,
|
|
450
|
+
embedder: Pt,
|
|
451
|
+
options: Mt
|
|
452
|
+
}, Symbol.toStringTag, { value: "Module" })), Xe = "embeddedHtml", { line: Ee, group: C, indent: xe, softline: $e } = k, { mapDoc: Nt } = re, qt = async (e, n, r, t, s) => {
|
|
453
|
+
var o, h, g, d, f;
|
|
454
|
+
try {
|
|
455
|
+
const { node: u } = r, { createPlaceholder: $, placeholderRegex: S } = j(), i = u.quasis.map(
|
|
456
|
+
(a, c, { length: I }) => c === I - 1 ? a.value.cooked : a.value.cooked + $(c)
|
|
457
|
+
).join(""), _ = ((o = i.match(/^\s+/)) == null ? void 0 : o[0]) ?? "", b = ((h = i.match(/\s+$/)) == null ? void 0 : h[0]) ?? "", v = M(r, n), L = await e(i, {
|
|
338
458
|
parser: "html"
|
|
339
|
-
}),
|
|
340
|
-
if (typeof
|
|
341
|
-
return
|
|
342
|
-
const
|
|
343
|
-
for (let
|
|
344
|
-
let
|
|
345
|
-
if (
|
|
346
|
-
if (
|
|
459
|
+
}), m = Nt(L, (a) => {
|
|
460
|
+
if (typeof a != "string")
|
|
461
|
+
return a;
|
|
462
|
+
const c = [], I = a.split(S);
|
|
463
|
+
for (let E = 0; E < I.length; E++) {
|
|
464
|
+
let D = I[E];
|
|
465
|
+
if (E % 2 == 0) {
|
|
466
|
+
if (!D)
|
|
347
467
|
continue;
|
|
348
|
-
|
|
468
|
+
D = D.replaceAll(/([\\`]|\${)/g, "\\$1"), t.__embeddedInHtml && (D = D.replaceAll(/<\/(?=script\b)/gi, "<\\/")), c.push(D);
|
|
349
469
|
} else {
|
|
350
|
-
const
|
|
351
|
-
|
|
470
|
+
const O = Number(D);
|
|
471
|
+
c.push(v[O]);
|
|
352
472
|
}
|
|
353
473
|
}
|
|
354
|
-
return
|
|
474
|
+
return c;
|
|
355
475
|
});
|
|
356
476
|
if (t.htmlWhitespaceSensitivity === "strict" || // TODO: is css mode should be included here?
|
|
357
|
-
t.htmlWhitespaceSensitivity === "css" || (
|
|
358
|
-
return
|
|
477
|
+
t.htmlWhitespaceSensitivity === "css" || (g = t.preserveEmbeddedExteriorWhitespaces) != null && g.includes(s))
|
|
478
|
+
return C([
|
|
359
479
|
"`",
|
|
360
|
-
|
|
361
|
-
(
|
|
362
|
-
|
|
480
|
+
_,
|
|
481
|
+
(d = t.noEmbeddedMultiLineIndentation) != null && d.includes(s) ? [C(m)] : xe([C(m)]),
|
|
482
|
+
b,
|
|
363
483
|
"`"
|
|
364
484
|
]);
|
|
365
|
-
const
|
|
366
|
-
return
|
|
485
|
+
const y = _.length ? Ee : $e, p = b.length ? Ee : $e;
|
|
486
|
+
return C([
|
|
367
487
|
"`",
|
|
368
|
-
(
|
|
369
|
-
|
|
488
|
+
(f = t.noEmbeddedMultiLineIndentation) != null && f.includes(s) ? [y, C(m)] : xe([y, C(m)]),
|
|
489
|
+
p,
|
|
370
490
|
"`"
|
|
371
491
|
]);
|
|
372
|
-
} catch (
|
|
373
|
-
throw console.error(
|
|
492
|
+
} catch (u) {
|
|
493
|
+
throw console.error(u), u;
|
|
374
494
|
}
|
|
375
|
-
},
|
|
495
|
+
}, Bt = [
|
|
376
496
|
"html",
|
|
377
497
|
"htm",
|
|
378
498
|
"shtml",
|
|
@@ -385,79 +505,246 @@ const { line: se, group: j, indent: ie, softline: re } = M, Qe = async (e, n, s,
|
|
|
385
505
|
"jshtm",
|
|
386
506
|
"volt",
|
|
387
507
|
"rhtml"
|
|
388
|
-
],
|
|
389
|
-
[
|
|
508
|
+
], Ft = R(Xe), At = {
|
|
509
|
+
[Ft]: {
|
|
510
|
+
category: "Global",
|
|
511
|
+
type: "string",
|
|
512
|
+
array: !0,
|
|
513
|
+
default: [{ value: [...Bt] }],
|
|
514
|
+
description: "Specify embedded HTML language identifiers."
|
|
515
|
+
}
|
|
516
|
+
}, Ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
517
|
+
__proto__: null,
|
|
518
|
+
embeddedLanguage: Xe,
|
|
519
|
+
embedder: qt,
|
|
520
|
+
options: At
|
|
521
|
+
}, Symbol.toStringTag, { value: "Module" })), He = "embeddedMarkdown", { line: ve, group: W, indent: we, softline: De } = k, Wt = async (e, n, r, t, s) => {
|
|
522
|
+
var o, h, g, d, f;
|
|
523
|
+
try {
|
|
524
|
+
const { node: u } = r, { createPlaceholder: $, placeholderRegex: S } = j(), i = u.quasis.map(
|
|
525
|
+
(a, c, { length: I }) => c === I - 1 ? a.value.cooked : a.value.cooked + $(c)
|
|
526
|
+
).join(""), _ = ((o = i.match(/^\s+/)) == null ? void 0 : o[0]) ?? "", b = ((h = i.match(/\s+$/)) == null ? void 0 : h[0]) ?? "", v = M(r, n), L = await e(i, {
|
|
527
|
+
parser: "markdown",
|
|
528
|
+
__inJsTemplate: !0
|
|
529
|
+
}), m = q(
|
|
530
|
+
L,
|
|
531
|
+
S,
|
|
532
|
+
v
|
|
533
|
+
);
|
|
534
|
+
if ((g = t.preserveEmbeddedExteriorWhitespaces) != null && g.includes(s))
|
|
535
|
+
return W([
|
|
536
|
+
"`",
|
|
537
|
+
_,
|
|
538
|
+
(d = t.noEmbeddedMultiLineIndentation) != null && d.includes(s) ? [W(m)] : we([W(m)]),
|
|
539
|
+
b,
|
|
540
|
+
"`"
|
|
541
|
+
]);
|
|
542
|
+
const y = _.length ? ve : De, p = b.length ? ve : De;
|
|
543
|
+
return W([
|
|
544
|
+
"`",
|
|
545
|
+
(f = t.noEmbeddedMultiLineIndentation) != null && f.includes(s) ? [y, W(m)] : we([y, W(m)]),
|
|
546
|
+
p,
|
|
547
|
+
"`"
|
|
548
|
+
]);
|
|
549
|
+
} catch (u) {
|
|
550
|
+
throw console.error(u), u;
|
|
551
|
+
}
|
|
552
|
+
}, Gt = [
|
|
553
|
+
"md",
|
|
554
|
+
"livemd",
|
|
555
|
+
"markdown",
|
|
556
|
+
"mdown",
|
|
557
|
+
"mdwn",
|
|
558
|
+
"mkd",
|
|
559
|
+
"mkdn",
|
|
560
|
+
"mkdown",
|
|
561
|
+
"ronn",
|
|
562
|
+
"scd",
|
|
563
|
+
"workbook"
|
|
564
|
+
], zt = R(He), Xt = {
|
|
565
|
+
[zt]: {
|
|
390
566
|
category: "Global",
|
|
391
567
|
type: "string",
|
|
392
568
|
array: !0,
|
|
393
|
-
default: [{ value: [...
|
|
394
|
-
description: "Specify embedded
|
|
569
|
+
default: [{ value: [...Gt] }],
|
|
570
|
+
description: "Specify embedded Markdown language identifiers."
|
|
395
571
|
}
|
|
396
|
-
},
|
|
572
|
+
}, Ht = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
397
573
|
__proto__: null,
|
|
398
|
-
embeddedLanguage:
|
|
399
|
-
embedder:
|
|
400
|
-
options:
|
|
401
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
402
|
-
[
|
|
574
|
+
embeddedLanguage: He,
|
|
575
|
+
embedder: Wt,
|
|
576
|
+
options: Xt
|
|
577
|
+
}, Symbol.toStringTag, { value: "Module" })), oe = "embeddedNoop", Vt = R(oe), Yt = {
|
|
578
|
+
[Vt]: {
|
|
403
579
|
category: "Global",
|
|
404
580
|
type: "string",
|
|
405
581
|
array: !0,
|
|
406
582
|
default: [{ value: [] }],
|
|
407
|
-
description: "Specify embedded
|
|
583
|
+
description: "Specify embedded language identifiers that will not be formatted."
|
|
408
584
|
}
|
|
409
|
-
},
|
|
585
|
+
}, Qt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
410
586
|
__proto__: null,
|
|
411
|
-
embeddedLanguage:
|
|
412
|
-
options:
|
|
413
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
414
|
-
var
|
|
587
|
+
embeddedLanguage: oe,
|
|
588
|
+
options: Yt
|
|
589
|
+
}, Symbol.toStringTag, { value: "Module" })), Ve = "embeddedPhp", { line: Le, group: G, indent: Se, softline: Te } = k, Jt = async (e, n, r, t, s) => {
|
|
590
|
+
var o, h, g, d, f;
|
|
415
591
|
try {
|
|
416
|
-
Q("@prettier/plugin-php", t,
|
|
417
|
-
const { node:
|
|
418
|
-
(
|
|
419
|
-
).join(""),
|
|
420
|
-
|
|
421
|
-
-
|
|
422
|
-
),
|
|
592
|
+
Q("@prettier/plugin-php", t, s);
|
|
593
|
+
const { node: u } = r, { createPlaceholder: $, placeholderRegex: S } = j("$p"), i = u.quasis.map(
|
|
594
|
+
(c, I, { length: E }) => I === E - 1 ? c.value.cooked : c.value.cooked + $(I)
|
|
595
|
+
).join(""), _ = ((o = i.match(/^\s+/)) == null ? void 0 : o[0]) ?? "", b = ((h = i.match(/\s+$/)) == null ? void 0 : h[0]) ?? "", v = i.slice(
|
|
596
|
+
_.length,
|
|
597
|
+
-b.length || void 0
|
|
598
|
+
), L = M(r, n), m = await e(v, {
|
|
423
599
|
parser: "php"
|
|
424
|
-
}),
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
600
|
+
}), y = q(
|
|
601
|
+
m,
|
|
602
|
+
S,
|
|
603
|
+
L
|
|
428
604
|
);
|
|
429
|
-
if ((
|
|
430
|
-
return
|
|
605
|
+
if ((g = t.preserveEmbeddedExteriorWhitespaces) != null && g.includes(s))
|
|
606
|
+
return G([
|
|
431
607
|
"`",
|
|
432
|
-
|
|
433
|
-
(
|
|
434
|
-
|
|
608
|
+
_,
|
|
609
|
+
(d = t.noEmbeddedMultiLineIndentation) != null && d.includes(s) ? [G(y)] : Se([G(y)]),
|
|
610
|
+
b,
|
|
435
611
|
"`"
|
|
436
612
|
]);
|
|
437
|
-
const
|
|
438
|
-
return
|
|
613
|
+
const p = _.length ? Le : Te, a = b.length ? Le : Te;
|
|
614
|
+
return G([
|
|
439
615
|
"`",
|
|
440
|
-
(
|
|
441
|
-
|
|
616
|
+
(f = t.noEmbeddedMultiLineIndentation) != null && f.includes(s) ? [p, G(y)] : Se([p, G(y)]),
|
|
617
|
+
a,
|
|
442
618
|
"`"
|
|
443
619
|
]);
|
|
444
|
-
} catch (
|
|
445
|
-
throw console.error(
|
|
620
|
+
} catch (u) {
|
|
621
|
+
throw console.error(u), u;
|
|
446
622
|
}
|
|
447
|
-
},
|
|
448
|
-
[
|
|
623
|
+
}, Kt = ["php", "php5", "phtml", "ctp"], Zt = R(Ve), en = {
|
|
624
|
+
[Zt]: {
|
|
449
625
|
category: "Global",
|
|
450
626
|
type: "string",
|
|
451
627
|
array: !0,
|
|
452
|
-
default: [{ value: [...
|
|
453
|
-
description:
|
|
628
|
+
default: [{ value: [...Kt] }],
|
|
629
|
+
description: 'Specify embedded PHP language identifiers. This requires "@prettier/plugin-php".'
|
|
454
630
|
}
|
|
455
|
-
},
|
|
631
|
+
}, tn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
456
632
|
__proto__: null,
|
|
457
|
-
embeddedLanguage:
|
|
458
|
-
embedder:
|
|
459
|
-
options:
|
|
460
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
633
|
+
embeddedLanguage: Ve,
|
|
634
|
+
embedder: Jt,
|
|
635
|
+
options: en
|
|
636
|
+
}, Symbol.toStringTag, { value: "Module" })), Ye = "embeddedRuby", K = [
|
|
637
|
+
"ruby",
|
|
638
|
+
"arb",
|
|
639
|
+
"axlsx",
|
|
640
|
+
"builder",
|
|
641
|
+
"eye",
|
|
642
|
+
"fcgi",
|
|
643
|
+
"gemfile",
|
|
644
|
+
"gemspec",
|
|
645
|
+
"god",
|
|
646
|
+
"jb",
|
|
647
|
+
"jbuilder",
|
|
648
|
+
"mspec",
|
|
649
|
+
"opal",
|
|
650
|
+
"pluginspec",
|
|
651
|
+
"podspec",
|
|
652
|
+
"rabl",
|
|
653
|
+
"rake",
|
|
654
|
+
"rb",
|
|
655
|
+
"rbi",
|
|
656
|
+
"rbuild",
|
|
657
|
+
"rbw",
|
|
658
|
+
"rbx",
|
|
659
|
+
"ru",
|
|
660
|
+
"thor",
|
|
661
|
+
"watchr"
|
|
662
|
+
], Z = ["rbs"], ee = ["haml"], nn = [
|
|
663
|
+
...K,
|
|
664
|
+
...Z,
|
|
665
|
+
...ee
|
|
666
|
+
], sn = "embeddedRubyParser", rn = R(Ye), on = {
|
|
667
|
+
[rn]: {
|
|
668
|
+
category: "Global",
|
|
669
|
+
type: "string",
|
|
670
|
+
array: !0,
|
|
671
|
+
default: [{ value: [...nn] }],
|
|
672
|
+
description: 'Specify embedded Ruby language identifiers. This requires "@prettier/plugin-ruby".'
|
|
673
|
+
},
|
|
674
|
+
[sn]: {
|
|
675
|
+
category: "Global",
|
|
676
|
+
type: "string",
|
|
677
|
+
array: !1,
|
|
678
|
+
default: void 0,
|
|
679
|
+
description: "Specify the embedded Ruby language parser."
|
|
680
|
+
}
|
|
681
|
+
}, { line: Oe, group: z, indent: Ue, softline: Pe } = k, an = async (e, n, r, t, s, o) => {
|
|
682
|
+
var h, g, d, f, u;
|
|
683
|
+
try {
|
|
684
|
+
Q("@prettier/plugin-ruby", t, s);
|
|
685
|
+
const { node: $ } = r, { createPlaceholder: S, placeholderRegex: i } = j(), _ = $.quasis.map(
|
|
686
|
+
(E, D, { length: O }) => D === O - 1 ? E.value.cooked : E.value.cooked + S(D)
|
|
687
|
+
).join(""), b = ((h = _.match(/^\s+/)) == null ? void 0 : h[0]) ?? "", v = ((g = _.match(/\s+$/)) == null ? void 0 : g[0]) ?? "", L = _.slice(
|
|
688
|
+
b.length,
|
|
689
|
+
-v.length || void 0
|
|
690
|
+
), m = M(r, n), y = dn(t, s, o), p = await e(L, {
|
|
691
|
+
parser: y
|
|
692
|
+
}), a = q(
|
|
693
|
+
p,
|
|
694
|
+
i,
|
|
695
|
+
m
|
|
696
|
+
);
|
|
697
|
+
if ((d = t.preserveEmbeddedExteriorWhitespaces) != null && d.includes(s))
|
|
698
|
+
return z([
|
|
699
|
+
"`",
|
|
700
|
+
b,
|
|
701
|
+
(f = t.noEmbeddedMultiLineIndentation) != null && f.includes(s) ? [z(a)] : Ue([z(a)]),
|
|
702
|
+
v,
|
|
703
|
+
"`"
|
|
704
|
+
]);
|
|
705
|
+
const c = b.length ? Oe : Pe, I = v.length ? Oe : Pe;
|
|
706
|
+
return z([
|
|
707
|
+
"`",
|
|
708
|
+
(u = t.noEmbeddedMultiLineIndentation) != null && u.includes(s) ? [c, z(a)] : Ue([c, z(a)]),
|
|
709
|
+
I,
|
|
710
|
+
"`"
|
|
711
|
+
]);
|
|
712
|
+
} catch ($) {
|
|
713
|
+
throw console.error($), $;
|
|
714
|
+
}
|
|
715
|
+
};
|
|
716
|
+
function dn(e, n, r) {
|
|
717
|
+
if (typeof e.embeddedRubyParser == "string")
|
|
718
|
+
return e.embeddedRubyParser;
|
|
719
|
+
const t = r.indexOf(n);
|
|
720
|
+
for (let s = t; s >= 0; --s) {
|
|
721
|
+
if (ln(n))
|
|
722
|
+
return K[0];
|
|
723
|
+
if (cn(n))
|
|
724
|
+
return Z[0];
|
|
725
|
+
if (un(n))
|
|
726
|
+
return ee[0];
|
|
727
|
+
}
|
|
728
|
+
throw new SyntaxError(`Unrecognized ruby identifier: ${n}`);
|
|
729
|
+
}
|
|
730
|
+
function ln(e) {
|
|
731
|
+
return K.includes(e);
|
|
732
|
+
}
|
|
733
|
+
function cn(e) {
|
|
734
|
+
return Z.includes(e);
|
|
735
|
+
}
|
|
736
|
+
function un(e) {
|
|
737
|
+
return ee.includes(e);
|
|
738
|
+
}
|
|
739
|
+
const pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
740
|
+
__proto__: null,
|
|
741
|
+
HAML_PARSER_IDENTIFIERS: ee,
|
|
742
|
+
RBS_PARSER_IDENTIFIERS: Z,
|
|
743
|
+
RUBY_PARSER_IDENTIFIERS: K,
|
|
744
|
+
embeddedLanguage: Ye,
|
|
745
|
+
embedder: an,
|
|
746
|
+
options: on
|
|
747
|
+
}, Symbol.toStringTag, { value: "Module" })), Qe = "embeddedSql", ae = [
|
|
461
748
|
"sql",
|
|
462
749
|
"bigquery",
|
|
463
750
|
"hive",
|
|
@@ -474,7 +761,7 @@ const { line: se, group: j, indent: ie, softline: re } = M, Qe = async (e, n, s,
|
|
|
474
761
|
"transactsql",
|
|
475
762
|
"tsql",
|
|
476
763
|
"trino"
|
|
477
|
-
],
|
|
764
|
+
], Je = [
|
|
478
765
|
"bigquery",
|
|
479
766
|
"db2",
|
|
480
767
|
"hive",
|
|
@@ -483,181 +770,184 @@ const { line: se, group: j, indent: ie, softline: re } = M, Qe = async (e, n, s,
|
|
|
483
770
|
"postgresql",
|
|
484
771
|
"transactsql",
|
|
485
772
|
"flinksql"
|
|
486
|
-
],
|
|
487
|
-
[
|
|
773
|
+
], hn = R(Qe), gn = {
|
|
774
|
+
[hn]: {
|
|
488
775
|
category: "Global",
|
|
489
776
|
type: "string",
|
|
490
777
|
array: !0,
|
|
491
|
-
default: [{ value: [...
|
|
492
|
-
description:
|
|
778
|
+
default: [{ value: [...ae] }],
|
|
779
|
+
description: 'Specify embedded SQL language identifiers. This requires "prettier-plugin-sql".'
|
|
493
780
|
}
|
|
494
|
-
}, { hardline:
|
|
495
|
-
var h,
|
|
781
|
+
}, { hardline: mn, group: X, line: ke, softline: Re, indent: Me } = k, { mapDoc: _n } = re, fn = async (e, n, r, t, s, o) => {
|
|
782
|
+
var h, g, d, f, u;
|
|
496
783
|
try {
|
|
497
|
-
Q("prettier-plugin-sql", t,
|
|
498
|
-
const { node:
|
|
499
|
-
(
|
|
500
|
-
).join(""),
|
|
784
|
+
Q("prettier-plugin-sql", t, s);
|
|
785
|
+
const { node: $ } = r, { createPlaceholder: S, placeholderRegex: i } = j(), _ = $.quasis.map(
|
|
786
|
+
(I, E, { length: D }) => E === D - 1 ? I.value.cooked : I.value.cooked + S(E)
|
|
787
|
+
).join(""), b = ((h = _.match(/^\s+/)) == null ? void 0 : h[0]) ?? "", v = ((g = _.match(/\s+$/)) == null ? void 0 : g[0]) ?? "", L = M(r, n), m = yn(
|
|
501
788
|
t,
|
|
502
|
-
|
|
503
|
-
|
|
789
|
+
s,
|
|
790
|
+
o
|
|
504
791
|
);
|
|
505
|
-
if (typeof
|
|
506
|
-
throw new SyntaxError(`Unrecognized
|
|
507
|
-
const
|
|
792
|
+
if (typeof m > "u")
|
|
793
|
+
throw new SyntaxError(`Unrecognized identifier: ${s}`);
|
|
794
|
+
const y = await e(_, {
|
|
508
795
|
parser: "sql",
|
|
509
|
-
...
|
|
510
|
-
}),
|
|
511
|
-
if (typeof
|
|
512
|
-
return
|
|
513
|
-
const
|
|
514
|
-
for (let
|
|
515
|
-
let
|
|
516
|
-
if (
|
|
517
|
-
if (!
|
|
796
|
+
...m
|
|
797
|
+
}), p = _n(y, (I) => {
|
|
798
|
+
if (typeof I != "string")
|
|
799
|
+
return I;
|
|
800
|
+
const E = [], D = I.split(i);
|
|
801
|
+
for (let O = 0; O < D.length; O++) {
|
|
802
|
+
let l = D[O];
|
|
803
|
+
if (O % 2 == 0) {
|
|
804
|
+
if (!l)
|
|
518
805
|
continue;
|
|
519
|
-
|
|
520
|
-
(
|
|
521
|
-
` ?
|
|
806
|
+
l = l.replaceAll(/([\\`]|\${)/g, "\\$1"), l.split(/(\n)/).forEach(
|
|
807
|
+
(x) => x === `
|
|
808
|
+
` ? E.push(mn) : E.push(x)
|
|
522
809
|
);
|
|
523
810
|
} else {
|
|
524
|
-
const
|
|
525
|
-
|
|
811
|
+
const x = Number(l);
|
|
812
|
+
E.push(L[x]);
|
|
526
813
|
}
|
|
527
814
|
}
|
|
528
|
-
return
|
|
815
|
+
return E;
|
|
529
816
|
});
|
|
530
|
-
if ((
|
|
531
|
-
return
|
|
817
|
+
if ((d = t.preserveEmbeddedExteriorWhitespaces) != null && d.includes(s))
|
|
818
|
+
return X([
|
|
532
819
|
"`",
|
|
533
|
-
|
|
534
|
-
(
|
|
535
|
-
|
|
820
|
+
b,
|
|
821
|
+
(f = t.noEmbeddedMultiLineIndentation) != null && f.includes(s) ? [X(p)] : Me([X(p)]),
|
|
822
|
+
v,
|
|
536
823
|
"`"
|
|
537
824
|
]);
|
|
538
|
-
const
|
|
539
|
-
return
|
|
825
|
+
const a = b.length ? ke : Re, c = v.length ? ke : Re;
|
|
826
|
+
return X([
|
|
540
827
|
"`",
|
|
541
|
-
(
|
|
542
|
-
|
|
828
|
+
(u = t.noEmbeddedMultiLineIndentation) != null && u.includes(s) ? [a, X(p)] : Me([a, X(p)]),
|
|
829
|
+
c,
|
|
543
830
|
"`"
|
|
544
831
|
]);
|
|
545
|
-
} catch (
|
|
546
|
-
throw console.error(
|
|
832
|
+
} catch ($) {
|
|
833
|
+
throw console.error($), $;
|
|
547
834
|
}
|
|
548
|
-
},
|
|
549
|
-
"sql-formatter": (e) =>
|
|
550
|
-
"node-sql-parser": (e) =>
|
|
835
|
+
}, bn = {
|
|
836
|
+
"sql-formatter": (e) => ae.includes(e),
|
|
837
|
+
"node-sql-parser": (e) => Je.includes(e)
|
|
551
838
|
};
|
|
552
|
-
function
|
|
553
|
-
for (const
|
|
554
|
-
if (
|
|
555
|
-
switch (
|
|
839
|
+
function je(e, n) {
|
|
840
|
+
for (const r of n)
|
|
841
|
+
if (bn[r](e))
|
|
842
|
+
switch (r) {
|
|
556
843
|
case "sql-formatter":
|
|
557
844
|
return {
|
|
558
|
-
formatter:
|
|
845
|
+
formatter: r,
|
|
559
846
|
language: e
|
|
560
847
|
};
|
|
561
848
|
case "node-sql-parser":
|
|
562
849
|
return {
|
|
563
|
-
formatter:
|
|
850
|
+
formatter: r,
|
|
564
851
|
database: e
|
|
565
852
|
};
|
|
566
853
|
}
|
|
567
854
|
}
|
|
568
|
-
function
|
|
569
|
-
let t =
|
|
855
|
+
function ne(e, n, r) {
|
|
856
|
+
let t = je(e, r);
|
|
570
857
|
if (t)
|
|
571
858
|
return t;
|
|
572
|
-
const
|
|
573
|
-
for (let
|
|
574
|
-
if (t =
|
|
575
|
-
n[
|
|
576
|
-
|
|
859
|
+
const s = n.indexOf(e);
|
|
860
|
+
for (let o = s - 1; o >= 0; --o)
|
|
861
|
+
if (t = je(
|
|
862
|
+
n[o],
|
|
863
|
+
r
|
|
577
864
|
), t)
|
|
578
865
|
return t;
|
|
579
866
|
}
|
|
580
|
-
function
|
|
867
|
+
function yn(e, n, r) {
|
|
581
868
|
switch (e.formatter ?? "sql-formatter") {
|
|
582
869
|
case "sql-formatter":
|
|
583
|
-
return
|
|
870
|
+
return ne(
|
|
584
871
|
n,
|
|
585
|
-
|
|
872
|
+
r,
|
|
586
873
|
["sql-formatter", "node-sql-parser"]
|
|
587
874
|
);
|
|
588
875
|
case "node-sql-parser":
|
|
589
|
-
return
|
|
876
|
+
return ne(
|
|
590
877
|
n,
|
|
591
|
-
|
|
878
|
+
r,
|
|
592
879
|
["node-sql-parser", "sql-formatter"]
|
|
593
880
|
);
|
|
594
881
|
default:
|
|
595
|
-
return
|
|
882
|
+
return ne(
|
|
596
883
|
n,
|
|
597
|
-
|
|
884
|
+
r,
|
|
598
885
|
["sql-formatter", "node-sql-parser"]
|
|
599
886
|
);
|
|
600
887
|
}
|
|
601
888
|
}
|
|
602
|
-
const
|
|
889
|
+
const In = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
603
890
|
__proto__: null,
|
|
604
|
-
NODE_SQL_PARSER_DATABASES:
|
|
605
|
-
SQL_FORMATTER_LANGUAGES:
|
|
606
|
-
embeddedLanguage:
|
|
607
|
-
embedder:
|
|
608
|
-
options:
|
|
609
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
610
|
-
var
|
|
891
|
+
NODE_SQL_PARSER_DATABASES: Je,
|
|
892
|
+
SQL_FORMATTER_LANGUAGES: ae,
|
|
893
|
+
embeddedLanguage: Qe,
|
|
894
|
+
embedder: fn,
|
|
895
|
+
options: gn
|
|
896
|
+
}, Symbol.toStringTag, { value: "Module" })), Ke = "embeddedTs", { line: Ne, group: H, indent: qe, softline: Be } = k, En = async (e, n, r, t, s) => {
|
|
897
|
+
var o, h, g, d, f;
|
|
611
898
|
try {
|
|
612
|
-
const { node:
|
|
613
|
-
(
|
|
614
|
-
).join(""),
|
|
615
|
-
parser: t.embeddedTsParser ?? "typescript"
|
|
616
|
-
|
|
617
|
-
|
|
899
|
+
const { node: u } = r, { createPlaceholder: $, placeholderRegex: S } = j(), i = u.quasis.map(
|
|
900
|
+
(a, c, { length: I }) => c === I - 1 ? a.value.cooked : a.value.cooked + $(c)
|
|
901
|
+
).join(""), _ = ((o = i.match(/^\s+/)) == null ? void 0 : o[0]) ?? "", b = ((h = i.match(/\s+$/)) == null ? void 0 : h[0]) ?? "", v = M(r, n), L = await e(i, {
|
|
902
|
+
parser: t.embeddedTsParser ?? "typescript",
|
|
903
|
+
// set filepath to undefined to enable jsx auto detection:
|
|
904
|
+
// https://github.com/prettier/prettier/blob/427a84d24203e2d54160cde153a1e6a6390fe65a/src/language-js/parse/typescript.js#L49-L53
|
|
905
|
+
filepath: void 0
|
|
906
|
+
}), m = q(
|
|
618
907
|
L,
|
|
619
|
-
|
|
908
|
+
S,
|
|
909
|
+
v
|
|
620
910
|
);
|
|
621
|
-
if ((
|
|
622
|
-
return
|
|
911
|
+
if ((g = t.preserveEmbeddedExteriorWhitespaces) != null && g.includes(s))
|
|
912
|
+
return H([
|
|
623
913
|
"`",
|
|
624
|
-
|
|
625
|
-
(
|
|
626
|
-
|
|
914
|
+
_,
|
|
915
|
+
(d = t.noEmbeddedMultiLineIndentation) != null && d.includes(s) ? [H(m)] : qe([H(m)]),
|
|
916
|
+
b,
|
|
627
917
|
"`"
|
|
628
918
|
]);
|
|
629
|
-
const
|
|
630
|
-
return
|
|
919
|
+
const y = _.length ? Ne : Be, p = b.length ? Ne : Be;
|
|
920
|
+
return H([
|
|
631
921
|
"`",
|
|
632
|
-
(
|
|
633
|
-
|
|
922
|
+
(f = t.noEmbeddedMultiLineIndentation) != null && f.includes(s) ? [y, H(m)] : qe([y, H(m)]),
|
|
923
|
+
p,
|
|
634
924
|
"`"
|
|
635
925
|
]);
|
|
636
|
-
} catch (
|
|
637
|
-
throw console.error(
|
|
926
|
+
} catch (u) {
|
|
927
|
+
throw console.error(u), u;
|
|
638
928
|
}
|
|
639
|
-
},
|
|
640
|
-
[
|
|
929
|
+
}, xn = ["ts", "tsx", "cts", "mts", "typescript"], $n = "embeddedTsParser", vn = R(Ke), wn = {
|
|
930
|
+
[vn]: {
|
|
641
931
|
category: "Global",
|
|
642
932
|
type: "string",
|
|
643
933
|
array: !0,
|
|
644
|
-
default: [{ value: [...
|
|
645
|
-
description: "Specify embedded TS
|
|
934
|
+
default: [{ value: [...xn] }],
|
|
935
|
+
description: "Specify embedded TS language parsers."
|
|
646
936
|
},
|
|
647
|
-
[
|
|
937
|
+
[$n]: {
|
|
648
938
|
category: "Global",
|
|
649
939
|
type: "string",
|
|
650
940
|
array: !1,
|
|
651
941
|
default: "typescript",
|
|
652
|
-
description: "Specify the
|
|
942
|
+
description: "Specify the embedded TS language parser."
|
|
653
943
|
}
|
|
654
|
-
},
|
|
944
|
+
}, Dn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
655
945
|
__proto__: null,
|
|
656
|
-
embeddedLanguage:
|
|
657
|
-
embedder:
|
|
658
|
-
options:
|
|
659
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
660
|
-
function
|
|
946
|
+
embeddedLanguage: Ke,
|
|
947
|
+
embedder: En,
|
|
948
|
+
options: wn
|
|
949
|
+
}, Symbol.toStringTag, { value: "Module" })), de = "embeddedXml";
|
|
950
|
+
function Ln(e) {
|
|
661
951
|
const n = {
|
|
662
952
|
loc: {
|
|
663
953
|
start: {
|
|
@@ -669,15 +959,15 @@ function $t(e) {
|
|
|
669
959
|
column: e.column + e.length
|
|
670
960
|
}
|
|
671
961
|
}
|
|
672
|
-
},
|
|
962
|
+
}, r = new SyntaxError(
|
|
673
963
|
`${e.message} (${n.loc.start.line}:${n.loc.start.column})`,
|
|
674
964
|
{
|
|
675
965
|
cause: e
|
|
676
966
|
}
|
|
677
967
|
);
|
|
678
|
-
return Object.assign(
|
|
968
|
+
return Object.assign(r, n), r;
|
|
679
969
|
}
|
|
680
|
-
function
|
|
970
|
+
function Fe(e) {
|
|
681
971
|
const n = {
|
|
682
972
|
loc: {
|
|
683
973
|
start: {
|
|
@@ -689,61 +979,61 @@ function ye(e) {
|
|
|
689
979
|
column: e.token.endColumn ?? NaN
|
|
690
980
|
}
|
|
691
981
|
}
|
|
692
|
-
},
|
|
982
|
+
}, r = new SyntaxError(
|
|
693
983
|
`${e.message} (${n.loc.start.line}:${n.loc.start.column})`,
|
|
694
984
|
{
|
|
695
985
|
cause: e
|
|
696
986
|
}
|
|
697
987
|
);
|
|
698
|
-
return Object.assign(
|
|
988
|
+
return Object.assign(r, n), r;
|
|
699
989
|
}
|
|
700
|
-
const
|
|
990
|
+
const Sn = {
|
|
701
991
|
parse(e, n) {
|
|
702
|
-
var
|
|
703
|
-
const { lexErrors:
|
|
704
|
-
if (
|
|
705
|
-
const
|
|
706
|
-
throw
|
|
992
|
+
var o, h;
|
|
993
|
+
const { lexErrors: r, parseErrors: t, cst: s } = lt(e);
|
|
994
|
+
if (r.length > 0) {
|
|
995
|
+
const g = r[0];
|
|
996
|
+
throw Ln(g);
|
|
707
997
|
}
|
|
708
998
|
if (t.length > 0) {
|
|
709
|
-
let
|
|
710
|
-
for (const
|
|
999
|
+
let g = !1;
|
|
1000
|
+
for (const d of t) {
|
|
711
1001
|
if (!["MismatchedTokenException", "NotAllInputParsedException"].includes(
|
|
712
|
-
|
|
1002
|
+
d.name
|
|
713
1003
|
))
|
|
714
|
-
throw
|
|
715
|
-
if (
|
|
716
|
-
|
|
1004
|
+
throw Fe(d);
|
|
1005
|
+
if (d.message === "Expecting token of type --> OPEN <-- but found --> '' <--") {
|
|
1006
|
+
g = !0;
|
|
717
1007
|
continue;
|
|
718
1008
|
}
|
|
719
1009
|
if (/Expecting token of type --> EOF <-- but found --> '.+' <--/.test(
|
|
720
|
-
|
|
721
|
-
) || /Redundant input, expecting EOF but found: /.test(
|
|
722
|
-
(
|
|
1010
|
+
d.message
|
|
1011
|
+
) || /Redundant input, expecting EOF but found: /.test(d.message)) {
|
|
1012
|
+
(o = n.__embeddedXmlFragmentRecoverIndex) == null || o.splice(
|
|
723
1013
|
0,
|
|
724
1014
|
n.__embeddedXmlFragmentRecoverIndex.length,
|
|
725
|
-
|
|
1015
|
+
d.token.startOffset
|
|
726
1016
|
);
|
|
727
1017
|
break;
|
|
728
1018
|
}
|
|
729
1019
|
if (/Expecting token of type --> OPEN <-- but found --> '.+' <--/.test(
|
|
730
|
-
|
|
1020
|
+
d.message
|
|
731
1021
|
)) {
|
|
732
|
-
if (
|
|
1022
|
+
if (d.token.endOffset === void 0 || Number.isNaN(d.token.endOffset))
|
|
733
1023
|
break;
|
|
734
1024
|
(h = n.__embeddedXmlFragmentRecoverIndex) == null || h.splice(
|
|
735
1025
|
0,
|
|
736
1026
|
n.__embeddedXmlFragmentRecoverIndex.length,
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
),
|
|
1027
|
+
d.token.startOffset,
|
|
1028
|
+
d.token.endOffset
|
|
1029
|
+
), g = !0;
|
|
740
1030
|
break;
|
|
741
1031
|
}
|
|
742
|
-
throw
|
|
1032
|
+
throw Fe(d);
|
|
743
1033
|
}
|
|
744
|
-
|
|
1034
|
+
g && Ze(s);
|
|
745
1035
|
}
|
|
746
|
-
return
|
|
1036
|
+
return s;
|
|
747
1037
|
},
|
|
748
1038
|
astFormat: "xml",
|
|
749
1039
|
locStart(e) {
|
|
@@ -753,74 +1043,74 @@ const Dt = {
|
|
|
753
1043
|
return e.location.endOffset ?? NaN;
|
|
754
1044
|
}
|
|
755
1045
|
};
|
|
756
|
-
function
|
|
1046
|
+
function Ze(e) {
|
|
757
1047
|
const n = e.children;
|
|
758
|
-
for (const
|
|
759
|
-
const t = n[
|
|
760
|
-
for (let
|
|
761
|
-
const
|
|
762
|
-
if (
|
|
763
|
-
if (Object.keys(
|
|
764
|
-
t.splice(
|
|
1048
|
+
for (const r in n) {
|
|
1049
|
+
const t = n[r] ?? [];
|
|
1050
|
+
for (let s = t.length - 1; s >= 0; --s) {
|
|
1051
|
+
const o = t[s];
|
|
1052
|
+
if (Tn(o)) {
|
|
1053
|
+
if (Object.keys(o.children).length === 0) {
|
|
1054
|
+
t.splice(s, 1), t.length === 0 && delete n[r];
|
|
765
1055
|
continue;
|
|
766
1056
|
}
|
|
767
|
-
|
|
1057
|
+
Ze(o);
|
|
768
1058
|
}
|
|
769
1059
|
}
|
|
770
1060
|
}
|
|
771
1061
|
}
|
|
772
|
-
function
|
|
1062
|
+
function Tn(e) {
|
|
773
1063
|
return "name" in e && "children" in e && "location" in e;
|
|
774
1064
|
}
|
|
775
|
-
const { line:
|
|
776
|
-
var
|
|
1065
|
+
const { line: Ae, group: V, indent: Ce, softline: se } = k, On = async (e, n, r, t, s) => {
|
|
1066
|
+
var o, h, g, d, f, u;
|
|
777
1067
|
try {
|
|
778
|
-
Q("@prettier/plugin-xml", t,
|
|
779
|
-
const { node:
|
|
780
|
-
(
|
|
781
|
-
).join(""),
|
|
782
|
-
|
|
783
|
-
-
|
|
784
|
-
),
|
|
785
|
-
let
|
|
786
|
-
for (;
|
|
787
|
-
const
|
|
788
|
-
if (
|
|
1068
|
+
Q("@prettier/plugin-xml", t, s);
|
|
1069
|
+
const { node: $ } = r, { createPlaceholder: S, placeholderRegex: i } = j(), _ = $.quasis.map(
|
|
1070
|
+
(E, D, { length: O }) => D === O - 1 ? E.value.cooked : E.value.cooked + S(D)
|
|
1071
|
+
).join(""), b = ((o = _.match(/^\s+/)) == null ? void 0 : o[0]) ?? "", v = ((h = _.match(/\s+$/)) == null ? void 0 : h[0]) ?? "", L = _.slice(
|
|
1072
|
+
b.length,
|
|
1073
|
+
-v.length || void 0
|
|
1074
|
+
), m = M(r, n), y = [];
|
|
1075
|
+
let p = 0;
|
|
1076
|
+
for (; p !== void 0; ) {
|
|
1077
|
+
const E = L.slice(p);
|
|
1078
|
+
if (E.length === 0)
|
|
789
1079
|
break;
|
|
790
|
-
|
|
1080
|
+
p > 0 && t.xmlWhitespaceSensitivity !== "strict" && y.push(se), (g = t.__embeddedXmlFragmentRecoverIndex) == null || g.splice(
|
|
791
1081
|
0,
|
|
792
1082
|
t.__embeddedXmlFragmentRecoverIndex.length
|
|
793
1083
|
);
|
|
794
|
-
let
|
|
795
|
-
parser:
|
|
1084
|
+
let D = await e(E, {
|
|
1085
|
+
parser: de
|
|
796
1086
|
});
|
|
797
|
-
const [
|
|
798
|
-
|
|
1087
|
+
const [O, l] = t.__embeddedXmlFragmentRecoverIndex ?? [];
|
|
1088
|
+
O === void 0 ? p = void 0 : l === void 0 ? p += O : (D = E.slice(O, l + 1), p += l + 1), y.push(D);
|
|
799
1089
|
}
|
|
800
|
-
const
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
1090
|
+
const a = q(
|
|
1091
|
+
y,
|
|
1092
|
+
i,
|
|
1093
|
+
m
|
|
804
1094
|
);
|
|
805
|
-
if (t.xmlWhitespaceSensitivity === "strict" || (
|
|
806
|
-
return
|
|
1095
|
+
if (t.xmlWhitespaceSensitivity === "strict" || (d = t.preserveEmbeddedExteriorWhitespaces) != null && d.includes(s))
|
|
1096
|
+
return V([
|
|
807
1097
|
"`",
|
|
808
|
-
|
|
809
|
-
(
|
|
810
|
-
|
|
1098
|
+
b,
|
|
1099
|
+
(f = t.noEmbeddedMultiLineIndentation) != null && f.includes(s) ? [V(a)] : Ce([V(a)]),
|
|
1100
|
+
v,
|
|
811
1101
|
"`"
|
|
812
1102
|
]);
|
|
813
|
-
const
|
|
814
|
-
return
|
|
1103
|
+
const c = b.length ? Ae : se, I = v.length ? Ae : se;
|
|
1104
|
+
return V([
|
|
815
1105
|
"`",
|
|
816
|
-
(
|
|
817
|
-
|
|
1106
|
+
(u = t.noEmbeddedMultiLineIndentation) != null && u.includes(s) ? [c, V(a)] : Ce([c, V(a)]),
|
|
1107
|
+
I,
|
|
818
1108
|
"`"
|
|
819
1109
|
]);
|
|
820
|
-
} catch (
|
|
821
|
-
throw console.error(
|
|
1110
|
+
} catch ($) {
|
|
1111
|
+
throw console.error($), $;
|
|
822
1112
|
}
|
|
823
|
-
},
|
|
1113
|
+
}, Un = [
|
|
824
1114
|
"xml",
|
|
825
1115
|
"xsd",
|
|
826
1116
|
"ascx",
|
|
@@ -844,7 +1134,6 @@ const { line: xe, group: R, indent: Ee, softline: V } = M, St = async (e, n, s,
|
|
|
844
1134
|
"jmx",
|
|
845
1135
|
"launch",
|
|
846
1136
|
"menu",
|
|
847
|
-
"mxml",
|
|
848
1137
|
"nuspec",
|
|
849
1138
|
"opml",
|
|
850
1139
|
"owl",
|
|
@@ -878,13 +1167,13 @@ const { line: xe, group: R, indent: Ee, softline: V } = M, St = async (e, n, s,
|
|
|
878
1167
|
"xpdl",
|
|
879
1168
|
"xul",
|
|
880
1169
|
"xoml"
|
|
881
|
-
],
|
|
882
|
-
[
|
|
1170
|
+
], Pn = R(de), kn = {
|
|
1171
|
+
[Pn]: {
|
|
883
1172
|
category: "Global",
|
|
884
1173
|
type: "string",
|
|
885
1174
|
array: !0,
|
|
886
|
-
default: [{ value: [...
|
|
887
|
-
description:
|
|
1175
|
+
default: [{ value: [...Un] }],
|
|
1176
|
+
description: 'Specify embedded XML language identifiers. This requires "@prettier/plugin-xml".'
|
|
888
1177
|
},
|
|
889
1178
|
/** @internal */
|
|
890
1179
|
__embeddedXmlFragmentRecoverIndex: {
|
|
@@ -894,76 +1183,80 @@ const { line: xe, group: R, indent: Ee, softline: V } = M, St = async (e, n, s,
|
|
|
894
1183
|
default: [{ value: [] }],
|
|
895
1184
|
description: "This option is read only and used as a workaround to support xml fragments"
|
|
896
1185
|
}
|
|
897
|
-
},
|
|
1186
|
+
}, Rn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
898
1187
|
__proto__: null,
|
|
899
|
-
embeddedLanguage:
|
|
900
|
-
embedder:
|
|
901
|
-
options:
|
|
902
|
-
parser:
|
|
903
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
904
|
-
"./
|
|
905
|
-
"./
|
|
906
|
-
"./
|
|
907
|
-
"./
|
|
908
|
-
"./
|
|
909
|
-
"./
|
|
910
|
-
"./
|
|
1188
|
+
embeddedLanguage: de,
|
|
1189
|
+
embedder: On,
|
|
1190
|
+
options: kn,
|
|
1191
|
+
parser: Sn
|
|
1192
|
+
}, Symbol.toStringTag, { value: "Module" })), et = [], tt = {}, nt = {}, st = {}, Mn = /* @__PURE__ */ Object.assign({
|
|
1193
|
+
"./css/index.ts": wt,
|
|
1194
|
+
"./es/index.ts": Ut,
|
|
1195
|
+
"./glsl/index.ts": jt,
|
|
1196
|
+
"./html/index.ts": Ct,
|
|
1197
|
+
"./markdown/index.ts": Ht,
|
|
1198
|
+
"./noop/index.ts": Qt,
|
|
1199
|
+
"./php/index.ts": tn,
|
|
1200
|
+
"./ruby/index.ts": pn,
|
|
1201
|
+
"./sql/index.ts": In,
|
|
1202
|
+
"./ts/index.ts": Dn,
|
|
1203
|
+
"./xml/index.ts": Rn
|
|
911
1204
|
});
|
|
912
|
-
Object.values(
|
|
913
|
-
({ embeddedLanguage: e, parser: n, embedder:
|
|
914
|
-
|
|
1205
|
+
Object.values(Mn).forEach(
|
|
1206
|
+
({ embeddedLanguage: e, parser: n, embedder: r, options: t }) => {
|
|
1207
|
+
yt(et, e, oe), n && (tt[e] = n), r && (nt[e] = r), Object.assign(st, t);
|
|
915
1208
|
}
|
|
916
1209
|
);
|
|
917
|
-
const
|
|
1210
|
+
const Kn = {
|
|
918
1211
|
// parsers from internal
|
|
919
|
-
...
|
|
920
|
-
...
|
|
921
|
-
...
|
|
922
|
-
...
|
|
923
|
-
...
|
|
1212
|
+
...rt.parsers,
|
|
1213
|
+
...it.parsers,
|
|
1214
|
+
...ot.parsers,
|
|
1215
|
+
...at.parsers,
|
|
1216
|
+
...dt.parsers,
|
|
924
1217
|
// parsers from this plugin
|
|
925
|
-
...
|
|
926
|
-
}, { estree:
|
|
1218
|
+
...tt
|
|
1219
|
+
}, { estree: J } = ct, jn = function(e, n) {
|
|
927
1220
|
var t;
|
|
928
|
-
const { node:
|
|
929
|
-
if (
|
|
1221
|
+
const { node: r } = e;
|
|
1222
|
+
if (r.type !== "TemplateLiteral" || r.quasis.some(({ value: { cooked: s } }) => s === null))
|
|
930
1223
|
return null;
|
|
931
|
-
for (const
|
|
932
|
-
const
|
|
933
|
-
if (!
|
|
1224
|
+
for (const s of et) {
|
|
1225
|
+
const o = n[R(s)];
|
|
1226
|
+
if (!o)
|
|
934
1227
|
continue;
|
|
935
|
-
const h =
|
|
1228
|
+
const h = Nn(
|
|
936
1229
|
e,
|
|
937
|
-
|
|
1230
|
+
o,
|
|
938
1231
|
n.noEmbeddedIdentificationByComment ?? []
|
|
939
|
-
) ??
|
|
1232
|
+
) ?? qn(
|
|
940
1233
|
e,
|
|
941
|
-
|
|
1234
|
+
o,
|
|
942
1235
|
n.noEmbeddedIdentificationByTag ?? []
|
|
943
1236
|
);
|
|
944
1237
|
if (h === void 0)
|
|
945
1238
|
continue;
|
|
946
|
-
const
|
|
947
|
-
if (!
|
|
1239
|
+
const g = nt[s];
|
|
1240
|
+
if (!g)
|
|
948
1241
|
return null;
|
|
949
|
-
const
|
|
950
|
-
return
|
|
951
|
-
const
|
|
952
|
-
return
|
|
953
|
-
{ embed: !0, ...
|
|
954
|
-
|
|
1242
|
+
const d = e.node;
|
|
1243
|
+
return d.quasis.length === 1 && d.quasis[0].value.raw.trim() === "" ? "``" : async (...f) => {
|
|
1244
|
+
const u = await g(...f, h, o);
|
|
1245
|
+
return k.label(
|
|
1246
|
+
{ embed: !0, ...u.label },
|
|
1247
|
+
u
|
|
955
1248
|
);
|
|
956
1249
|
};
|
|
957
1250
|
}
|
|
958
|
-
return ((t =
|
|
1251
|
+
return ((t = J.embed) == null ? void 0 : t.call(J, e, n)) ?? null;
|
|
959
1252
|
};
|
|
960
|
-
function
|
|
961
|
-
if (
|
|
1253
|
+
function Nn({ node: e, parent: n }, r, t) {
|
|
1254
|
+
if (r.length === 0 || e.type !== "TemplateLiteral")
|
|
962
1255
|
return;
|
|
963
|
-
const
|
|
964
|
-
if (!
|
|
1256
|
+
const s = e.comments ?? (n == null ? void 0 : n.comments);
|
|
1257
|
+
if (!s)
|
|
965
1258
|
return;
|
|
966
|
-
const
|
|
1259
|
+
const o = s[s.length - 1];
|
|
967
1260
|
if (!(![
|
|
968
1261
|
"MultiLine",
|
|
969
1262
|
// meriyah
|
|
@@ -971,48 +1264,48 @@ function Pt({ node: e, parent: n }, s, t) {
|
|
|
971
1264
|
// typescript, acorn, espree, flow
|
|
972
1265
|
"CommentBlock"
|
|
973
1266
|
// babel, babel-flow, babel-ts
|
|
974
|
-
].includes(
|
|
975
|
-
for (const h of
|
|
976
|
-
if (` ${h} ` ===
|
|
1267
|
+
].includes(o.type) || !o.leading)) {
|
|
1268
|
+
for (const h of r)
|
|
1269
|
+
if (` ${h} ` === o.value && !t.includes(h))
|
|
977
1270
|
return h;
|
|
978
1271
|
}
|
|
979
1272
|
}
|
|
980
|
-
function
|
|
981
|
-
if (
|
|
982
|
-
for (const
|
|
983
|
-
if (n.tag.name ===
|
|
984
|
-
return
|
|
1273
|
+
function qn({ node: e, parent: n }, r, t) {
|
|
1274
|
+
if (r.length !== 0 && !(e.type !== "TemplateLiteral" || (n == null ? void 0 : n.type) !== "TaggedTemplateExpression" || n.tag.type !== "Identifier")) {
|
|
1275
|
+
for (const s of r)
|
|
1276
|
+
if (n.tag.name === s && !t.includes(s))
|
|
1277
|
+
return s;
|
|
985
1278
|
}
|
|
986
1279
|
}
|
|
987
|
-
const
|
|
1280
|
+
const Zn = {
|
|
988
1281
|
estree: {
|
|
989
|
-
...
|
|
990
|
-
embed:
|
|
1282
|
+
...J,
|
|
1283
|
+
embed: jn
|
|
991
1284
|
}
|
|
992
|
-
},
|
|
993
|
-
...
|
|
994
|
-
[
|
|
1285
|
+
}, Bn = "noEmbeddedIdentificationByComment", Fn = "noEmbeddedIdentificationByTag", An = "preserveEmbeddedExteriorWhitespaces", Cn = "noEmbeddedMultiLineIndentation", es = {
|
|
1286
|
+
...st,
|
|
1287
|
+
[Bn]: {
|
|
995
1288
|
category: "Global",
|
|
996
1289
|
type: "string",
|
|
997
1290
|
array: !0,
|
|
998
1291
|
default: [{ value: [] }],
|
|
999
1292
|
description: 'This option turns off "/* identifier */ `...`" comment-based language identification for the specified identifiers.'
|
|
1000
1293
|
},
|
|
1001
|
-
[
|
|
1294
|
+
[Fn]: {
|
|
1002
1295
|
category: "Global",
|
|
1003
1296
|
type: "string",
|
|
1004
1297
|
array: !0,
|
|
1005
1298
|
default: [{ value: [] }],
|
|
1006
1299
|
description: 'This option turns off "identifier`...`" tag-based language identification for the specified identifiers.'
|
|
1007
1300
|
},
|
|
1008
|
-
[
|
|
1301
|
+
[An]: {
|
|
1009
1302
|
category: "Config",
|
|
1010
1303
|
type: "string",
|
|
1011
1304
|
array: !0,
|
|
1012
1305
|
default: [{ value: [] }],
|
|
1013
1306
|
description: "This option preserves leading and trailing whitespaces in the formatting results for the specified identifiers."
|
|
1014
1307
|
},
|
|
1015
|
-
[
|
|
1308
|
+
[Cn]: {
|
|
1016
1309
|
category: "Global",
|
|
1017
1310
|
type: "string",
|
|
1018
1311
|
array: !0,
|
|
@@ -1021,11 +1314,12 @@ const Yt = {
|
|
|
1021
1314
|
}
|
|
1022
1315
|
};
|
|
1023
1316
|
export {
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1317
|
+
nt as embeddedEmbedders,
|
|
1318
|
+
et as embeddedLanguages,
|
|
1319
|
+
st as embeddedOptions,
|
|
1320
|
+
tt as embeddedParsers,
|
|
1321
|
+
R as makeIdentifiersName,
|
|
1322
|
+
es as options,
|
|
1323
|
+
Kn as parsers,
|
|
1324
|
+
Zn as printers
|
|
1031
1325
|
};
|