prettier-plugin-embed 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.bak +211 -0
- package/README.md +61 -36
- 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 +12 -8
- 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 +12 -8
- package/dist/embedded/utils.d.ts +4 -2
- package/dist/embedded/xml/options.d.ts +12 -8
- package/dist/index.js +814 -524
- package/dist/options.d.ts +53 -10
- package/package.json +17 -10
- 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,162 +146,211 @@ 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",
|
|
306
355
|
"es",
|
|
307
356
|
"es6",
|
|
@@ -309,70 +358,140 @@ const { line: se, group: j, indent: ie, softline: re } = M, Qe = async (e, n, s,
|
|
|
309
358
|
"cjs",
|
|
310
359
|
"pac",
|
|
311
360
|
"javascript"
|
|
312
|
-
],
|
|
313
|
-
[
|
|
361
|
+
], St = R(ie), Tt = It(ie), Ot = {
|
|
362
|
+
[St]: {
|
|
314
363
|
category: "Global",
|
|
315
364
|
type: "string",
|
|
316
365
|
array: !0,
|
|
317
|
-
default: [{ value: [...
|
|
318
|
-
description: "Specify embedded ES
|
|
366
|
+
default: [{ value: [...Lt] }],
|
|
367
|
+
description: "Specify embedded ES language identifiers."
|
|
319
368
|
},
|
|
320
|
-
[
|
|
369
|
+
[Tt]: {
|
|
321
370
|
category: "Global",
|
|
322
371
|
type: "string",
|
|
323
372
|
array: !1,
|
|
324
373
|
default: "babel",
|
|
325
|
-
description: "Specify the
|
|
374
|
+
description: "Specify the embedded ES language parser."
|
|
326
375
|
}
|
|
327
|
-
},
|
|
376
|
+
}, Ut = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
328
377
|
__proto__: null,
|
|
329
|
-
embeddedLanguage:
|
|
330
|
-
embedder:
|
|
331
|
-
options:
|
|
332
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
333
|
-
var
|
|
378
|
+
embeddedLanguage: ie,
|
|
379
|
+
embedder: Dt,
|
|
380
|
+
options: Ot
|
|
381
|
+
}, Symbol.toStringTag, { value: "Module" })), ze = "embeddedGlsl", { line: be, group: A, indent: ye, softline: Ie } = k, Pt = async (e, n, r, t, s) => {
|
|
382
|
+
var o, h, g, d, f;
|
|
334
383
|
try {
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
384
|
+
Q("prettier-plugin-glsl", t, s);
|
|
385
|
+
const { node: u } = r, { createPlaceholder: $, placeholderRegex: S } = j(), i = u.quasis.map(
|
|
386
|
+
(c, I, { length: E }) => I === E - 1 ? c.value.cooked : c.value.cooked + $(I)
|
|
387
|
+
).join(""), _ = ((o = i.match(/^\s+/)) == null ? void 0 : o[0]) ?? "", b = ((h = i.match(/\s+$/)) == null ? void 0 : h[0]) ?? "", v = i.slice(
|
|
388
|
+
_.length,
|
|
389
|
+
-b.length || void 0
|
|
390
|
+
), L = M(r, n), m = await e(v, {
|
|
391
|
+
parser: "glsl-parser"
|
|
392
|
+
}), y = q(
|
|
393
|
+
m,
|
|
394
|
+
S,
|
|
395
|
+
L
|
|
396
|
+
);
|
|
397
|
+
if ((g = t.preserveEmbeddedExteriorWhitespaces) != null && g.includes(s))
|
|
398
|
+
return A([
|
|
399
|
+
"`",
|
|
400
|
+
_,
|
|
401
|
+
(d = t.noEmbeddedMultiLineIndentation) != null && d.includes(s) ? [A(y)] : ye([A(y)]),
|
|
402
|
+
b,
|
|
403
|
+
"`"
|
|
404
|
+
]);
|
|
405
|
+
const p = _.length ? be : Ie, a = b.length ? be : Ie;
|
|
406
|
+
return A([
|
|
407
|
+
"`",
|
|
408
|
+
(f = t.noEmbeddedMultiLineIndentation) != null && f.includes(s) ? [p, A(y)] : ye([p, A(y)]),
|
|
409
|
+
a,
|
|
410
|
+
"`"
|
|
411
|
+
]);
|
|
412
|
+
} catch (u) {
|
|
413
|
+
throw console.error(u), u;
|
|
414
|
+
}
|
|
415
|
+
}, kt = [
|
|
416
|
+
"glsl",
|
|
417
|
+
"fp",
|
|
418
|
+
"frag",
|
|
419
|
+
"frg",
|
|
420
|
+
"fs",
|
|
421
|
+
"fsh",
|
|
422
|
+
"fshader",
|
|
423
|
+
"geo",
|
|
424
|
+
"geom",
|
|
425
|
+
"glslf",
|
|
426
|
+
"glslv",
|
|
427
|
+
"gs",
|
|
428
|
+
"gshader",
|
|
429
|
+
"rchit",
|
|
430
|
+
"rmiss",
|
|
431
|
+
"shader",
|
|
432
|
+
"tesc",
|
|
433
|
+
"tese",
|
|
434
|
+
"vert",
|
|
435
|
+
"vrx",
|
|
436
|
+
"vsh",
|
|
437
|
+
"vshader"
|
|
438
|
+
], Rt = R(ze), Mt = {
|
|
439
|
+
[Rt]: {
|
|
440
|
+
category: "Global",
|
|
441
|
+
type: "string",
|
|
442
|
+
array: !0,
|
|
443
|
+
default: [{ value: [...kt] }],
|
|
444
|
+
description: 'Specify embedded GLSL language identifiers. This requires "prettier-plugin-glsl".'
|
|
445
|
+
}
|
|
446
|
+
}, jt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
447
|
+
__proto__: null,
|
|
448
|
+
embeddedLanguage: ze,
|
|
449
|
+
embedder: Pt,
|
|
450
|
+
options: Mt
|
|
451
|
+
}, 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) => {
|
|
452
|
+
var o, h, g, d, f;
|
|
453
|
+
try {
|
|
454
|
+
const { node: u } = r, { createPlaceholder: $, placeholderRegex: S } = j(), i = u.quasis.map(
|
|
455
|
+
(a, c, { length: I }) => c === I - 1 ? a.value.cooked : a.value.cooked + $(c)
|
|
456
|
+
).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
457
|
parser: "html"
|
|
339
|
-
}),
|
|
340
|
-
if (typeof
|
|
341
|
-
return
|
|
342
|
-
const
|
|
343
|
-
for (let
|
|
344
|
-
let
|
|
345
|
-
if (
|
|
346
|
-
if (
|
|
458
|
+
}), m = Nt(L, (a) => {
|
|
459
|
+
if (typeof a != "string")
|
|
460
|
+
return a;
|
|
461
|
+
const c = [], I = a.split(S);
|
|
462
|
+
for (let E = 0; E < I.length; E++) {
|
|
463
|
+
let D = I[E];
|
|
464
|
+
if (E % 2 == 0) {
|
|
465
|
+
if (!D)
|
|
347
466
|
continue;
|
|
348
|
-
|
|
467
|
+
D = D.replaceAll(/([\\`]|\${)/g, "\\$1"), t.__embeddedInHtml && (D = D.replaceAll(/<\/(?=script\b)/gi, "<\\/")), c.push(D);
|
|
349
468
|
} else {
|
|
350
|
-
const
|
|
351
|
-
|
|
469
|
+
const O = Number(D);
|
|
470
|
+
c.push(v[O]);
|
|
352
471
|
}
|
|
353
472
|
}
|
|
354
|
-
return
|
|
473
|
+
return c;
|
|
355
474
|
});
|
|
356
475
|
if (t.htmlWhitespaceSensitivity === "strict" || // TODO: is css mode should be included here?
|
|
357
|
-
t.htmlWhitespaceSensitivity === "css" || (
|
|
358
|
-
return
|
|
476
|
+
t.htmlWhitespaceSensitivity === "css" || (g = t.preserveEmbeddedExteriorWhitespaces) != null && g.includes(s))
|
|
477
|
+
return C([
|
|
359
478
|
"`",
|
|
360
|
-
|
|
361
|
-
(
|
|
362
|
-
|
|
479
|
+
_,
|
|
480
|
+
(d = t.noEmbeddedMultiLineIndentation) != null && d.includes(s) ? [C(m)] : xe([C(m)]),
|
|
481
|
+
b,
|
|
363
482
|
"`"
|
|
364
483
|
]);
|
|
365
|
-
const
|
|
366
|
-
return
|
|
484
|
+
const y = _.length ? Ee : $e, p = b.length ? Ee : $e;
|
|
485
|
+
return C([
|
|
367
486
|
"`",
|
|
368
|
-
(
|
|
369
|
-
|
|
487
|
+
(f = t.noEmbeddedMultiLineIndentation) != null && f.includes(s) ? [y, C(m)] : xe([y, C(m)]),
|
|
488
|
+
p,
|
|
370
489
|
"`"
|
|
371
490
|
]);
|
|
372
|
-
} catch (
|
|
373
|
-
throw console.error(
|
|
491
|
+
} catch (u) {
|
|
492
|
+
throw console.error(u), u;
|
|
374
493
|
}
|
|
375
|
-
},
|
|
494
|
+
}, Bt = [
|
|
376
495
|
"html",
|
|
377
496
|
"htm",
|
|
378
497
|
"shtml",
|
|
@@ -385,79 +504,246 @@ const { line: se, group: j, indent: ie, softline: re } = M, Qe = async (e, n, s,
|
|
|
385
504
|
"jshtm",
|
|
386
505
|
"volt",
|
|
387
506
|
"rhtml"
|
|
388
|
-
],
|
|
389
|
-
[
|
|
507
|
+
], Ft = R(Xe), At = {
|
|
508
|
+
[Ft]: {
|
|
509
|
+
category: "Global",
|
|
510
|
+
type: "string",
|
|
511
|
+
array: !0,
|
|
512
|
+
default: [{ value: [...Bt] }],
|
|
513
|
+
description: "Specify embedded HTML language identifiers."
|
|
514
|
+
}
|
|
515
|
+
}, Ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
516
|
+
__proto__: null,
|
|
517
|
+
embeddedLanguage: Xe,
|
|
518
|
+
embedder: qt,
|
|
519
|
+
options: At
|
|
520
|
+
}, Symbol.toStringTag, { value: "Module" })), He = "embeddedMarkdown", { line: ve, group: W, indent: we, softline: De } = k, Wt = async (e, n, r, t, s) => {
|
|
521
|
+
var o, h, g, d, f;
|
|
522
|
+
try {
|
|
523
|
+
const { node: u } = r, { createPlaceholder: $, placeholderRegex: S } = j(), i = u.quasis.map(
|
|
524
|
+
(a, c, { length: I }) => c === I - 1 ? a.value.cooked : a.value.cooked + $(c)
|
|
525
|
+
).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, {
|
|
526
|
+
parser: "markdown",
|
|
527
|
+
__inJsTemplate: !0
|
|
528
|
+
}), m = q(
|
|
529
|
+
L,
|
|
530
|
+
S,
|
|
531
|
+
v
|
|
532
|
+
);
|
|
533
|
+
if ((g = t.preserveEmbeddedExteriorWhitespaces) != null && g.includes(s))
|
|
534
|
+
return W([
|
|
535
|
+
"`",
|
|
536
|
+
_,
|
|
537
|
+
(d = t.noEmbeddedMultiLineIndentation) != null && d.includes(s) ? [W(m)] : we([W(m)]),
|
|
538
|
+
b,
|
|
539
|
+
"`"
|
|
540
|
+
]);
|
|
541
|
+
const y = _.length ? ve : De, p = b.length ? ve : De;
|
|
542
|
+
return W([
|
|
543
|
+
"`",
|
|
544
|
+
(f = t.noEmbeddedMultiLineIndentation) != null && f.includes(s) ? [y, W(m)] : we([y, W(m)]),
|
|
545
|
+
p,
|
|
546
|
+
"`"
|
|
547
|
+
]);
|
|
548
|
+
} catch (u) {
|
|
549
|
+
throw console.error(u), u;
|
|
550
|
+
}
|
|
551
|
+
}, Gt = [
|
|
552
|
+
"md",
|
|
553
|
+
"livemd",
|
|
554
|
+
"markdown",
|
|
555
|
+
"mdown",
|
|
556
|
+
"mdwn",
|
|
557
|
+
"mkd",
|
|
558
|
+
"mkdn",
|
|
559
|
+
"mkdown",
|
|
560
|
+
"ronn",
|
|
561
|
+
"scd",
|
|
562
|
+
"workbook"
|
|
563
|
+
], zt = R(He), Xt = {
|
|
564
|
+
[zt]: {
|
|
390
565
|
category: "Global",
|
|
391
566
|
type: "string",
|
|
392
567
|
array: !0,
|
|
393
|
-
default: [{ value: [...
|
|
394
|
-
description: "Specify embedded
|
|
568
|
+
default: [{ value: [...Gt] }],
|
|
569
|
+
description: "Specify embedded Markdown language identifiers."
|
|
395
570
|
}
|
|
396
|
-
},
|
|
571
|
+
}, Ht = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
397
572
|
__proto__: null,
|
|
398
|
-
embeddedLanguage:
|
|
399
|
-
embedder:
|
|
400
|
-
options:
|
|
401
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
402
|
-
[
|
|
573
|
+
embeddedLanguage: He,
|
|
574
|
+
embedder: Wt,
|
|
575
|
+
options: Xt
|
|
576
|
+
}, Symbol.toStringTag, { value: "Module" })), oe = "embeddedNoop", Vt = R(oe), Yt = {
|
|
577
|
+
[Vt]: {
|
|
403
578
|
category: "Global",
|
|
404
579
|
type: "string",
|
|
405
580
|
array: !0,
|
|
406
581
|
default: [{ value: [] }],
|
|
407
|
-
description: "Specify embedded
|
|
582
|
+
description: "Specify embedded language identifiers that will not be formatted."
|
|
408
583
|
}
|
|
409
|
-
},
|
|
584
|
+
}, Qt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
410
585
|
__proto__: null,
|
|
411
|
-
embeddedLanguage:
|
|
412
|
-
options:
|
|
413
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
414
|
-
var
|
|
586
|
+
embeddedLanguage: oe,
|
|
587
|
+
options: Yt
|
|
588
|
+
}, Symbol.toStringTag, { value: "Module" })), Ve = "embeddedPhp", { line: Le, group: G, indent: Se, softline: Te } = k, Jt = async (e, n, r, t, s) => {
|
|
589
|
+
var o, h, g, d, f;
|
|
415
590
|
try {
|
|
416
|
-
Q("@prettier/plugin-php", t,
|
|
417
|
-
const { node:
|
|
418
|
-
(
|
|
419
|
-
).join(""),
|
|
420
|
-
|
|
421
|
-
-
|
|
422
|
-
),
|
|
591
|
+
Q("@prettier/plugin-php", t, s);
|
|
592
|
+
const { node: u } = r, { createPlaceholder: $, placeholderRegex: S } = j("$p"), i = u.quasis.map(
|
|
593
|
+
(c, I, { length: E }) => I === E - 1 ? c.value.cooked : c.value.cooked + $(I)
|
|
594
|
+
).join(""), _ = ((o = i.match(/^\s+/)) == null ? void 0 : o[0]) ?? "", b = ((h = i.match(/\s+$/)) == null ? void 0 : h[0]) ?? "", v = i.slice(
|
|
595
|
+
_.length,
|
|
596
|
+
-b.length || void 0
|
|
597
|
+
), L = M(r, n), m = await e(v, {
|
|
423
598
|
parser: "php"
|
|
424
|
-
}),
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
599
|
+
}), y = q(
|
|
600
|
+
m,
|
|
601
|
+
S,
|
|
602
|
+
L
|
|
428
603
|
);
|
|
429
|
-
if ((
|
|
430
|
-
return
|
|
604
|
+
if ((g = t.preserveEmbeddedExteriorWhitespaces) != null && g.includes(s))
|
|
605
|
+
return G([
|
|
431
606
|
"`",
|
|
432
|
-
|
|
433
|
-
(
|
|
434
|
-
|
|
607
|
+
_,
|
|
608
|
+
(d = t.noEmbeddedMultiLineIndentation) != null && d.includes(s) ? [G(y)] : Se([G(y)]),
|
|
609
|
+
b,
|
|
435
610
|
"`"
|
|
436
611
|
]);
|
|
437
|
-
const
|
|
438
|
-
return
|
|
612
|
+
const p = _.length ? Le : Te, a = b.length ? Le : Te;
|
|
613
|
+
return G([
|
|
439
614
|
"`",
|
|
440
|
-
(
|
|
441
|
-
|
|
615
|
+
(f = t.noEmbeddedMultiLineIndentation) != null && f.includes(s) ? [p, G(y)] : Se([p, G(y)]),
|
|
616
|
+
a,
|
|
442
617
|
"`"
|
|
443
618
|
]);
|
|
444
|
-
} catch (
|
|
445
|
-
throw console.error(
|
|
619
|
+
} catch (u) {
|
|
620
|
+
throw console.error(u), u;
|
|
446
621
|
}
|
|
447
|
-
},
|
|
448
|
-
[
|
|
622
|
+
}, Kt = ["php", "php5", "phtml", "ctp"], Zt = R(Ve), en = {
|
|
623
|
+
[Zt]: {
|
|
449
624
|
category: "Global",
|
|
450
625
|
type: "string",
|
|
451
626
|
array: !0,
|
|
452
|
-
default: [{ value: [...
|
|
453
|
-
description:
|
|
627
|
+
default: [{ value: [...Kt] }],
|
|
628
|
+
description: 'Specify embedded PHP language identifiers. This requires "@prettier/plugin-php".'
|
|
454
629
|
}
|
|
455
|
-
},
|
|
630
|
+
}, tn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
456
631
|
__proto__: null,
|
|
457
|
-
embeddedLanguage:
|
|
458
|
-
embedder:
|
|
459
|
-
options:
|
|
460
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
632
|
+
embeddedLanguage: Ve,
|
|
633
|
+
embedder: Jt,
|
|
634
|
+
options: en
|
|
635
|
+
}, Symbol.toStringTag, { value: "Module" })), Ye = "embeddedRuby", K = [
|
|
636
|
+
"ruby",
|
|
637
|
+
"arb",
|
|
638
|
+
"axlsx",
|
|
639
|
+
"builder",
|
|
640
|
+
"eye",
|
|
641
|
+
"fcgi",
|
|
642
|
+
"gemfile",
|
|
643
|
+
"gemspec",
|
|
644
|
+
"god",
|
|
645
|
+
"jb",
|
|
646
|
+
"jbuilder",
|
|
647
|
+
"mspec",
|
|
648
|
+
"opal",
|
|
649
|
+
"pluginspec",
|
|
650
|
+
"podspec",
|
|
651
|
+
"rabl",
|
|
652
|
+
"rake",
|
|
653
|
+
"rb",
|
|
654
|
+
"rbi",
|
|
655
|
+
"rbuild",
|
|
656
|
+
"rbw",
|
|
657
|
+
"rbx",
|
|
658
|
+
"ru",
|
|
659
|
+
"thor",
|
|
660
|
+
"watchr"
|
|
661
|
+
], Z = ["rbs"], ee = ["haml"], nn = [
|
|
662
|
+
...K,
|
|
663
|
+
...Z,
|
|
664
|
+
...ee
|
|
665
|
+
], sn = "embeddedRubyParser", rn = R(Ye), on = {
|
|
666
|
+
[rn]: {
|
|
667
|
+
category: "Global",
|
|
668
|
+
type: "string",
|
|
669
|
+
array: !0,
|
|
670
|
+
default: [{ value: [...nn] }],
|
|
671
|
+
description: 'Specify embedded Ruby language identifiers. This requires "@prettier/plugin-ruby".'
|
|
672
|
+
},
|
|
673
|
+
[sn]: {
|
|
674
|
+
category: "Global",
|
|
675
|
+
type: "string",
|
|
676
|
+
array: !1,
|
|
677
|
+
default: void 0,
|
|
678
|
+
description: "Specify the embedded Ruby language parser."
|
|
679
|
+
}
|
|
680
|
+
}, { line: Oe, group: z, indent: Ue, softline: Pe } = k, an = async (e, n, r, t, s, o) => {
|
|
681
|
+
var h, g, d, f, u;
|
|
682
|
+
try {
|
|
683
|
+
Q("@prettier/plugin-ruby", t, s);
|
|
684
|
+
const { node: $ } = r, { createPlaceholder: S, placeholderRegex: i } = j(), _ = $.quasis.map(
|
|
685
|
+
(E, D, { length: O }) => D === O - 1 ? E.value.cooked : E.value.cooked + S(D)
|
|
686
|
+
).join(""), b = ((h = _.match(/^\s+/)) == null ? void 0 : h[0]) ?? "", v = ((g = _.match(/\s+$/)) == null ? void 0 : g[0]) ?? "", L = _.slice(
|
|
687
|
+
b.length,
|
|
688
|
+
-v.length || void 0
|
|
689
|
+
), m = M(r, n), y = dn(t, s, o), p = await e(L, {
|
|
690
|
+
parser: y
|
|
691
|
+
}), a = q(
|
|
692
|
+
p,
|
|
693
|
+
i,
|
|
694
|
+
m
|
|
695
|
+
);
|
|
696
|
+
if ((d = t.preserveEmbeddedExteriorWhitespaces) != null && d.includes(s))
|
|
697
|
+
return z([
|
|
698
|
+
"`",
|
|
699
|
+
b,
|
|
700
|
+
(f = t.noEmbeddedMultiLineIndentation) != null && f.includes(s) ? [z(a)] : Ue([z(a)]),
|
|
701
|
+
v,
|
|
702
|
+
"`"
|
|
703
|
+
]);
|
|
704
|
+
const c = b.length ? Oe : Pe, I = v.length ? Oe : Pe;
|
|
705
|
+
return z([
|
|
706
|
+
"`",
|
|
707
|
+
(u = t.noEmbeddedMultiLineIndentation) != null && u.includes(s) ? [c, z(a)] : Ue([c, z(a)]),
|
|
708
|
+
I,
|
|
709
|
+
"`"
|
|
710
|
+
]);
|
|
711
|
+
} catch ($) {
|
|
712
|
+
throw console.error($), $;
|
|
713
|
+
}
|
|
714
|
+
};
|
|
715
|
+
function dn(e, n, r) {
|
|
716
|
+
if (typeof e.embeddedRubyParser == "string")
|
|
717
|
+
return e.embeddedRubyParser;
|
|
718
|
+
const t = r.indexOf(n);
|
|
719
|
+
for (let s = t; s >= 0; --s) {
|
|
720
|
+
if (ln(n))
|
|
721
|
+
return K[0];
|
|
722
|
+
if (cn(n))
|
|
723
|
+
return Z[0];
|
|
724
|
+
if (un(n))
|
|
725
|
+
return ee[0];
|
|
726
|
+
}
|
|
727
|
+
throw new SyntaxError(`Unrecognized ruby identifier: ${n}`);
|
|
728
|
+
}
|
|
729
|
+
function ln(e) {
|
|
730
|
+
return K.includes(e);
|
|
731
|
+
}
|
|
732
|
+
function cn(e) {
|
|
733
|
+
return Z.includes(e);
|
|
734
|
+
}
|
|
735
|
+
function un(e) {
|
|
736
|
+
return ee.includes(e);
|
|
737
|
+
}
|
|
738
|
+
const pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
739
|
+
__proto__: null,
|
|
740
|
+
HAML_PARSER_IDENTIFIERS: ee,
|
|
741
|
+
RBS_PARSER_IDENTIFIERS: Z,
|
|
742
|
+
RUBY_PARSER_IDENTIFIERS: K,
|
|
743
|
+
embeddedLanguage: Ye,
|
|
744
|
+
embedder: an,
|
|
745
|
+
options: on
|
|
746
|
+
}, Symbol.toStringTag, { value: "Module" })), Qe = "embeddedSql", ae = [
|
|
461
747
|
"sql",
|
|
462
748
|
"bigquery",
|
|
463
749
|
"hive",
|
|
@@ -474,7 +760,7 @@ const { line: se, group: j, indent: ie, softline: re } = M, Qe = async (e, n, s,
|
|
|
474
760
|
"transactsql",
|
|
475
761
|
"tsql",
|
|
476
762
|
"trino"
|
|
477
|
-
],
|
|
763
|
+
], Je = [
|
|
478
764
|
"bigquery",
|
|
479
765
|
"db2",
|
|
480
766
|
"hive",
|
|
@@ -483,181 +769,181 @@ const { line: se, group: j, indent: ie, softline: re } = M, Qe = async (e, n, s,
|
|
|
483
769
|
"postgresql",
|
|
484
770
|
"transactsql",
|
|
485
771
|
"flinksql"
|
|
486
|
-
],
|
|
487
|
-
[
|
|
772
|
+
], hn = R(Qe), gn = {
|
|
773
|
+
[hn]: {
|
|
488
774
|
category: "Global",
|
|
489
775
|
type: "string",
|
|
490
776
|
array: !0,
|
|
491
|
-
default: [{ value: [...
|
|
492
|
-
description:
|
|
777
|
+
default: [{ value: [...ae] }],
|
|
778
|
+
description: 'Specify embedded SQL language identifiers. This requires "prettier-plugin-sql".'
|
|
493
779
|
}
|
|
494
|
-
}, { hardline:
|
|
495
|
-
var h,
|
|
780
|
+
}, { hardline: mn, group: X, line: ke, softline: Re, indent: Me } = k, { mapDoc: _n } = re, fn = async (e, n, r, t, s, o) => {
|
|
781
|
+
var h, g, d, f, u;
|
|
496
782
|
try {
|
|
497
|
-
Q("prettier-plugin-sql", t,
|
|
498
|
-
const { node:
|
|
499
|
-
(
|
|
500
|
-
).join(""),
|
|
783
|
+
Q("prettier-plugin-sql", t, s);
|
|
784
|
+
const { node: $ } = r, { createPlaceholder: S, placeholderRegex: i } = j(), _ = $.quasis.map(
|
|
785
|
+
(I, E, { length: D }) => E === D - 1 ? I.value.cooked : I.value.cooked + S(E)
|
|
786
|
+
).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
787
|
t,
|
|
502
|
-
|
|
503
|
-
|
|
788
|
+
s,
|
|
789
|
+
o
|
|
504
790
|
);
|
|
505
|
-
if (typeof
|
|
506
|
-
throw new SyntaxError(`Unrecognized
|
|
507
|
-
const
|
|
791
|
+
if (typeof m > "u")
|
|
792
|
+
throw new SyntaxError(`Unrecognized identifier: ${s}`);
|
|
793
|
+
const y = await e(_, {
|
|
508
794
|
parser: "sql",
|
|
509
|
-
...
|
|
510
|
-
}),
|
|
511
|
-
if (typeof
|
|
512
|
-
return
|
|
513
|
-
const
|
|
514
|
-
for (let
|
|
515
|
-
let
|
|
516
|
-
if (
|
|
517
|
-
if (!
|
|
795
|
+
...m
|
|
796
|
+
}), p = _n(y, (I) => {
|
|
797
|
+
if (typeof I != "string")
|
|
798
|
+
return I;
|
|
799
|
+
const E = [], D = I.split(i);
|
|
800
|
+
for (let O = 0; O < D.length; O++) {
|
|
801
|
+
let l = D[O];
|
|
802
|
+
if (O % 2 == 0) {
|
|
803
|
+
if (!l)
|
|
518
804
|
continue;
|
|
519
|
-
|
|
520
|
-
(
|
|
521
|
-
` ?
|
|
805
|
+
l = l.replaceAll(/([\\`]|\${)/g, "\\$1"), l.split(/(\n)/).forEach(
|
|
806
|
+
(x) => x === `
|
|
807
|
+
` ? E.push(mn) : E.push(x)
|
|
522
808
|
);
|
|
523
809
|
} else {
|
|
524
|
-
const
|
|
525
|
-
|
|
810
|
+
const x = Number(l);
|
|
811
|
+
E.push(L[x]);
|
|
526
812
|
}
|
|
527
813
|
}
|
|
528
|
-
return
|
|
814
|
+
return E;
|
|
529
815
|
});
|
|
530
|
-
if ((
|
|
531
|
-
return
|
|
816
|
+
if ((d = t.preserveEmbeddedExteriorWhitespaces) != null && d.includes(s))
|
|
817
|
+
return X([
|
|
532
818
|
"`",
|
|
533
|
-
|
|
534
|
-
(
|
|
535
|
-
|
|
819
|
+
b,
|
|
820
|
+
(f = t.noEmbeddedMultiLineIndentation) != null && f.includes(s) ? [X(p)] : Me([X(p)]),
|
|
821
|
+
v,
|
|
536
822
|
"`"
|
|
537
823
|
]);
|
|
538
|
-
const
|
|
539
|
-
return
|
|
824
|
+
const a = b.length ? ke : Re, c = v.length ? ke : Re;
|
|
825
|
+
return X([
|
|
540
826
|
"`",
|
|
541
|
-
(
|
|
542
|
-
|
|
827
|
+
(u = t.noEmbeddedMultiLineIndentation) != null && u.includes(s) ? [a, X(p)] : Me([a, X(p)]),
|
|
828
|
+
c,
|
|
543
829
|
"`"
|
|
544
830
|
]);
|
|
545
|
-
} catch (
|
|
546
|
-
throw console.error(
|
|
831
|
+
} catch ($) {
|
|
832
|
+
throw console.error($), $;
|
|
547
833
|
}
|
|
548
|
-
},
|
|
549
|
-
"sql-formatter": (e) =>
|
|
550
|
-
"node-sql-parser": (e) =>
|
|
834
|
+
}, bn = {
|
|
835
|
+
"sql-formatter": (e) => ae.includes(e),
|
|
836
|
+
"node-sql-parser": (e) => Je.includes(e)
|
|
551
837
|
};
|
|
552
|
-
function
|
|
553
|
-
for (const
|
|
554
|
-
if (
|
|
555
|
-
switch (
|
|
838
|
+
function je(e, n) {
|
|
839
|
+
for (const r of n)
|
|
840
|
+
if (bn[r](e))
|
|
841
|
+
switch (r) {
|
|
556
842
|
case "sql-formatter":
|
|
557
843
|
return {
|
|
558
|
-
formatter:
|
|
844
|
+
formatter: r,
|
|
559
845
|
language: e
|
|
560
846
|
};
|
|
561
847
|
case "node-sql-parser":
|
|
562
848
|
return {
|
|
563
|
-
formatter:
|
|
849
|
+
formatter: r,
|
|
564
850
|
database: e
|
|
565
851
|
};
|
|
566
852
|
}
|
|
567
853
|
}
|
|
568
|
-
function
|
|
569
|
-
let t =
|
|
854
|
+
function ne(e, n, r) {
|
|
855
|
+
let t = je(e, r);
|
|
570
856
|
if (t)
|
|
571
857
|
return t;
|
|
572
|
-
const
|
|
573
|
-
for (let
|
|
574
|
-
if (t =
|
|
575
|
-
n[
|
|
576
|
-
|
|
858
|
+
const s = n.indexOf(e);
|
|
859
|
+
for (let o = s - 1; o >= 0; --o)
|
|
860
|
+
if (t = je(
|
|
861
|
+
n[o],
|
|
862
|
+
r
|
|
577
863
|
), t)
|
|
578
864
|
return t;
|
|
579
865
|
}
|
|
580
|
-
function
|
|
866
|
+
function yn(e, n, r) {
|
|
581
867
|
switch (e.formatter ?? "sql-formatter") {
|
|
582
868
|
case "sql-formatter":
|
|
583
|
-
return
|
|
869
|
+
return ne(
|
|
584
870
|
n,
|
|
585
|
-
|
|
871
|
+
r,
|
|
586
872
|
["sql-formatter", "node-sql-parser"]
|
|
587
873
|
);
|
|
588
874
|
case "node-sql-parser":
|
|
589
|
-
return
|
|
875
|
+
return ne(
|
|
590
876
|
n,
|
|
591
|
-
|
|
877
|
+
r,
|
|
592
878
|
["node-sql-parser", "sql-formatter"]
|
|
593
879
|
);
|
|
594
880
|
default:
|
|
595
|
-
return
|
|
881
|
+
return ne(
|
|
596
882
|
n,
|
|
597
|
-
|
|
883
|
+
r,
|
|
598
884
|
["sql-formatter", "node-sql-parser"]
|
|
599
885
|
);
|
|
600
886
|
}
|
|
601
887
|
}
|
|
602
|
-
const
|
|
888
|
+
const In = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
603
889
|
__proto__: null,
|
|
604
|
-
NODE_SQL_PARSER_DATABASES:
|
|
605
|
-
SQL_FORMATTER_LANGUAGES:
|
|
606
|
-
embeddedLanguage:
|
|
607
|
-
embedder:
|
|
608
|
-
options:
|
|
609
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
610
|
-
var
|
|
890
|
+
NODE_SQL_PARSER_DATABASES: Je,
|
|
891
|
+
SQL_FORMATTER_LANGUAGES: ae,
|
|
892
|
+
embeddedLanguage: Qe,
|
|
893
|
+
embedder: fn,
|
|
894
|
+
options: gn
|
|
895
|
+
}, Symbol.toStringTag, { value: "Module" })), Ke = "embeddedTs", { line: Ne, group: H, indent: qe, softline: Be } = k, En = async (e, n, r, t, s) => {
|
|
896
|
+
var o, h, g, d, f;
|
|
611
897
|
try {
|
|
612
|
-
const { node:
|
|
613
|
-
(
|
|
614
|
-
).join(""),
|
|
898
|
+
const { node: u } = r, { createPlaceholder: $, placeholderRegex: S } = j(), i = u.quasis.map(
|
|
899
|
+
(a, c, { length: I }) => c === I - 1 ? a.value.cooked : a.value.cooked + $(c)
|
|
900
|
+
).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, {
|
|
615
901
|
parser: t.embeddedTsParser ?? "typescript"
|
|
616
|
-
}),
|
|
617
|
-
T,
|
|
902
|
+
}), m = q(
|
|
618
903
|
L,
|
|
619
|
-
|
|
904
|
+
S,
|
|
905
|
+
v
|
|
620
906
|
);
|
|
621
|
-
if ((
|
|
622
|
-
return
|
|
907
|
+
if ((g = t.preserveEmbeddedExteriorWhitespaces) != null && g.includes(s))
|
|
908
|
+
return H([
|
|
623
909
|
"`",
|
|
624
|
-
|
|
625
|
-
(
|
|
626
|
-
|
|
910
|
+
_,
|
|
911
|
+
(d = t.noEmbeddedMultiLineIndentation) != null && d.includes(s) ? [H(m)] : qe([H(m)]),
|
|
912
|
+
b,
|
|
627
913
|
"`"
|
|
628
914
|
]);
|
|
629
|
-
const
|
|
630
|
-
return
|
|
915
|
+
const y = _.length ? Ne : Be, p = b.length ? Ne : Be;
|
|
916
|
+
return H([
|
|
631
917
|
"`",
|
|
632
|
-
(
|
|
633
|
-
|
|
918
|
+
(f = t.noEmbeddedMultiLineIndentation) != null && f.includes(s) ? [y, H(m)] : qe([y, H(m)]),
|
|
919
|
+
p,
|
|
634
920
|
"`"
|
|
635
921
|
]);
|
|
636
|
-
} catch (
|
|
637
|
-
throw console.error(
|
|
922
|
+
} catch (u) {
|
|
923
|
+
throw console.error(u), u;
|
|
638
924
|
}
|
|
639
|
-
},
|
|
640
|
-
[
|
|
925
|
+
}, xn = ["ts", "cts", "mts", "typescript"], $n = "embeddedTsParser", vn = R(Ke), wn = {
|
|
926
|
+
[vn]: {
|
|
641
927
|
category: "Global",
|
|
642
928
|
type: "string",
|
|
643
929
|
array: !0,
|
|
644
|
-
default: [{ value: [...
|
|
645
|
-
description: "Specify embedded TS
|
|
930
|
+
default: [{ value: [...xn] }],
|
|
931
|
+
description: "Specify embedded TS language parsers."
|
|
646
932
|
},
|
|
647
|
-
[
|
|
933
|
+
[$n]: {
|
|
648
934
|
category: "Global",
|
|
649
935
|
type: "string",
|
|
650
936
|
array: !1,
|
|
651
937
|
default: "typescript",
|
|
652
|
-
description: "Specify the
|
|
938
|
+
description: "Specify the embedded TS language parser."
|
|
653
939
|
}
|
|
654
|
-
},
|
|
940
|
+
}, Dn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
655
941
|
__proto__: null,
|
|
656
|
-
embeddedLanguage:
|
|
657
|
-
embedder:
|
|
658
|
-
options:
|
|
659
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
660
|
-
function
|
|
942
|
+
embeddedLanguage: Ke,
|
|
943
|
+
embedder: En,
|
|
944
|
+
options: wn
|
|
945
|
+
}, Symbol.toStringTag, { value: "Module" })), de = "embeddedXml";
|
|
946
|
+
function Ln(e) {
|
|
661
947
|
const n = {
|
|
662
948
|
loc: {
|
|
663
949
|
start: {
|
|
@@ -669,15 +955,15 @@ function $t(e) {
|
|
|
669
955
|
column: e.column + e.length
|
|
670
956
|
}
|
|
671
957
|
}
|
|
672
|
-
},
|
|
958
|
+
}, r = new SyntaxError(
|
|
673
959
|
`${e.message} (${n.loc.start.line}:${n.loc.start.column})`,
|
|
674
960
|
{
|
|
675
961
|
cause: e
|
|
676
962
|
}
|
|
677
963
|
);
|
|
678
|
-
return Object.assign(
|
|
964
|
+
return Object.assign(r, n), r;
|
|
679
965
|
}
|
|
680
|
-
function
|
|
966
|
+
function Fe(e) {
|
|
681
967
|
const n = {
|
|
682
968
|
loc: {
|
|
683
969
|
start: {
|
|
@@ -689,61 +975,61 @@ function ye(e) {
|
|
|
689
975
|
column: e.token.endColumn ?? NaN
|
|
690
976
|
}
|
|
691
977
|
}
|
|
692
|
-
},
|
|
978
|
+
}, r = new SyntaxError(
|
|
693
979
|
`${e.message} (${n.loc.start.line}:${n.loc.start.column})`,
|
|
694
980
|
{
|
|
695
981
|
cause: e
|
|
696
982
|
}
|
|
697
983
|
);
|
|
698
|
-
return Object.assign(
|
|
984
|
+
return Object.assign(r, n), r;
|
|
699
985
|
}
|
|
700
|
-
const
|
|
986
|
+
const Sn = {
|
|
701
987
|
parse(e, n) {
|
|
702
|
-
var
|
|
703
|
-
const { lexErrors:
|
|
704
|
-
if (
|
|
705
|
-
const
|
|
706
|
-
throw
|
|
988
|
+
var o, h;
|
|
989
|
+
const { lexErrors: r, parseErrors: t, cst: s } = lt(e);
|
|
990
|
+
if (r.length > 0) {
|
|
991
|
+
const g = r[0];
|
|
992
|
+
throw Ln(g);
|
|
707
993
|
}
|
|
708
994
|
if (t.length > 0) {
|
|
709
|
-
let
|
|
710
|
-
for (const
|
|
995
|
+
let g = !1;
|
|
996
|
+
for (const d of t) {
|
|
711
997
|
if (!["MismatchedTokenException", "NotAllInputParsedException"].includes(
|
|
712
|
-
|
|
998
|
+
d.name
|
|
713
999
|
))
|
|
714
|
-
throw
|
|
715
|
-
if (
|
|
716
|
-
|
|
1000
|
+
throw Fe(d);
|
|
1001
|
+
if (d.message === "Expecting token of type --> OPEN <-- but found --> '' <--") {
|
|
1002
|
+
g = !0;
|
|
717
1003
|
continue;
|
|
718
1004
|
}
|
|
719
1005
|
if (/Expecting token of type --> EOF <-- but found --> '.+' <--/.test(
|
|
720
|
-
|
|
721
|
-
) || /Redundant input, expecting EOF but found: /.test(
|
|
722
|
-
(
|
|
1006
|
+
d.message
|
|
1007
|
+
) || /Redundant input, expecting EOF but found: /.test(d.message)) {
|
|
1008
|
+
(o = n.__embeddedXmlFragmentRecoverIndex) == null || o.splice(
|
|
723
1009
|
0,
|
|
724
1010
|
n.__embeddedXmlFragmentRecoverIndex.length,
|
|
725
|
-
|
|
1011
|
+
d.token.startOffset
|
|
726
1012
|
);
|
|
727
1013
|
break;
|
|
728
1014
|
}
|
|
729
1015
|
if (/Expecting token of type --> OPEN <-- but found --> '.+' <--/.test(
|
|
730
|
-
|
|
1016
|
+
d.message
|
|
731
1017
|
)) {
|
|
732
|
-
if (
|
|
1018
|
+
if (d.token.endOffset === void 0 || Number.isNaN(d.token.endOffset))
|
|
733
1019
|
break;
|
|
734
1020
|
(h = n.__embeddedXmlFragmentRecoverIndex) == null || h.splice(
|
|
735
1021
|
0,
|
|
736
1022
|
n.__embeddedXmlFragmentRecoverIndex.length,
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
),
|
|
1023
|
+
d.token.startOffset,
|
|
1024
|
+
d.token.endOffset
|
|
1025
|
+
), g = !0;
|
|
740
1026
|
break;
|
|
741
1027
|
}
|
|
742
|
-
throw
|
|
1028
|
+
throw Fe(d);
|
|
743
1029
|
}
|
|
744
|
-
|
|
1030
|
+
g && Ze(s);
|
|
745
1031
|
}
|
|
746
|
-
return
|
|
1032
|
+
return s;
|
|
747
1033
|
},
|
|
748
1034
|
astFormat: "xml",
|
|
749
1035
|
locStart(e) {
|
|
@@ -753,74 +1039,74 @@ const Dt = {
|
|
|
753
1039
|
return e.location.endOffset ?? NaN;
|
|
754
1040
|
}
|
|
755
1041
|
};
|
|
756
|
-
function
|
|
1042
|
+
function Ze(e) {
|
|
757
1043
|
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(
|
|
1044
|
+
for (const r in n) {
|
|
1045
|
+
const t = n[r] ?? [];
|
|
1046
|
+
for (let s = t.length - 1; s >= 0; --s) {
|
|
1047
|
+
const o = t[s];
|
|
1048
|
+
if (Tn(o)) {
|
|
1049
|
+
if (Object.keys(o.children).length === 0) {
|
|
1050
|
+
t.splice(s, 1), t.length === 0 && delete n[r];
|
|
765
1051
|
continue;
|
|
766
1052
|
}
|
|
767
|
-
|
|
1053
|
+
Ze(o);
|
|
768
1054
|
}
|
|
769
1055
|
}
|
|
770
1056
|
}
|
|
771
1057
|
}
|
|
772
|
-
function
|
|
1058
|
+
function Tn(e) {
|
|
773
1059
|
return "name" in e && "children" in e && "location" in e;
|
|
774
1060
|
}
|
|
775
|
-
const { line:
|
|
776
|
-
var
|
|
1061
|
+
const { line: Ae, group: V, indent: Ce, softline: se } = k, On = async (e, n, r, t, s) => {
|
|
1062
|
+
var o, h, g, d, f, u;
|
|
777
1063
|
try {
|
|
778
|
-
Q("@prettier/plugin-xml", t,
|
|
779
|
-
const { node:
|
|
780
|
-
(
|
|
781
|
-
).join(""),
|
|
782
|
-
|
|
783
|
-
-
|
|
784
|
-
),
|
|
785
|
-
let
|
|
786
|
-
for (;
|
|
787
|
-
const
|
|
788
|
-
if (
|
|
1064
|
+
Q("@prettier/plugin-xml", t, s);
|
|
1065
|
+
const { node: $ } = r, { createPlaceholder: S, placeholderRegex: i } = j(), _ = $.quasis.map(
|
|
1066
|
+
(E, D, { length: O }) => D === O - 1 ? E.value.cooked : E.value.cooked + S(D)
|
|
1067
|
+
).join(""), b = ((o = _.match(/^\s+/)) == null ? void 0 : o[0]) ?? "", v = ((h = _.match(/\s+$/)) == null ? void 0 : h[0]) ?? "", L = _.slice(
|
|
1068
|
+
b.length,
|
|
1069
|
+
-v.length || void 0
|
|
1070
|
+
), m = M(r, n), y = [];
|
|
1071
|
+
let p = 0;
|
|
1072
|
+
for (; p !== void 0; ) {
|
|
1073
|
+
const E = L.slice(p);
|
|
1074
|
+
if (E.length === 0)
|
|
789
1075
|
break;
|
|
790
|
-
|
|
1076
|
+
p > 0 && t.xmlWhitespaceSensitivity !== "strict" && y.push(se), (g = t.__embeddedXmlFragmentRecoverIndex) == null || g.splice(
|
|
791
1077
|
0,
|
|
792
1078
|
t.__embeddedXmlFragmentRecoverIndex.length
|
|
793
1079
|
);
|
|
794
|
-
let
|
|
795
|
-
parser:
|
|
1080
|
+
let D = await e(E, {
|
|
1081
|
+
parser: de
|
|
796
1082
|
});
|
|
797
|
-
const [
|
|
798
|
-
|
|
1083
|
+
const [O, l] = t.__embeddedXmlFragmentRecoverIndex ?? [];
|
|
1084
|
+
O === void 0 ? p = void 0 : l === void 0 ? p += O : (D = E.slice(O, l + 1), p += l + 1), y.push(D);
|
|
799
1085
|
}
|
|
800
|
-
const
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
1086
|
+
const a = q(
|
|
1087
|
+
y,
|
|
1088
|
+
i,
|
|
1089
|
+
m
|
|
804
1090
|
);
|
|
805
|
-
if (t.xmlWhitespaceSensitivity === "strict" || (
|
|
806
|
-
return
|
|
1091
|
+
if (t.xmlWhitespaceSensitivity === "strict" || (d = t.preserveEmbeddedExteriorWhitespaces) != null && d.includes(s))
|
|
1092
|
+
return V([
|
|
807
1093
|
"`",
|
|
808
|
-
|
|
809
|
-
(
|
|
810
|
-
|
|
1094
|
+
b,
|
|
1095
|
+
(f = t.noEmbeddedMultiLineIndentation) != null && f.includes(s) ? [V(a)] : Ce([V(a)]),
|
|
1096
|
+
v,
|
|
811
1097
|
"`"
|
|
812
1098
|
]);
|
|
813
|
-
const
|
|
814
|
-
return
|
|
1099
|
+
const c = b.length ? Ae : se, I = v.length ? Ae : se;
|
|
1100
|
+
return V([
|
|
815
1101
|
"`",
|
|
816
|
-
(
|
|
817
|
-
|
|
1102
|
+
(u = t.noEmbeddedMultiLineIndentation) != null && u.includes(s) ? [c, V(a)] : Ce([c, V(a)]),
|
|
1103
|
+
I,
|
|
818
1104
|
"`"
|
|
819
1105
|
]);
|
|
820
|
-
} catch (
|
|
821
|
-
throw console.error(
|
|
1106
|
+
} catch ($) {
|
|
1107
|
+
throw console.error($), $;
|
|
822
1108
|
}
|
|
823
|
-
},
|
|
1109
|
+
}, Un = [
|
|
824
1110
|
"xml",
|
|
825
1111
|
"xsd",
|
|
826
1112
|
"ascx",
|
|
@@ -844,7 +1130,6 @@ const { line: xe, group: R, indent: Ee, softline: V } = M, St = async (e, n, s,
|
|
|
844
1130
|
"jmx",
|
|
845
1131
|
"launch",
|
|
846
1132
|
"menu",
|
|
847
|
-
"mxml",
|
|
848
1133
|
"nuspec",
|
|
849
1134
|
"opml",
|
|
850
1135
|
"owl",
|
|
@@ -878,13 +1163,13 @@ const { line: xe, group: R, indent: Ee, softline: V } = M, St = async (e, n, s,
|
|
|
878
1163
|
"xpdl",
|
|
879
1164
|
"xul",
|
|
880
1165
|
"xoml"
|
|
881
|
-
],
|
|
882
|
-
[
|
|
1166
|
+
], Pn = R(de), kn = {
|
|
1167
|
+
[Pn]: {
|
|
883
1168
|
category: "Global",
|
|
884
1169
|
type: "string",
|
|
885
1170
|
array: !0,
|
|
886
|
-
default: [{ value: [...
|
|
887
|
-
description:
|
|
1171
|
+
default: [{ value: [...Un] }],
|
|
1172
|
+
description: 'Specify embedded XML language identifiers. This requires "@prettier/plugin-xml".'
|
|
888
1173
|
},
|
|
889
1174
|
/** @internal */
|
|
890
1175
|
__embeddedXmlFragmentRecoverIndex: {
|
|
@@ -894,76 +1179,80 @@ const { line: xe, group: R, indent: Ee, softline: V } = M, St = async (e, n, s,
|
|
|
894
1179
|
default: [{ value: [] }],
|
|
895
1180
|
description: "This option is read only and used as a workaround to support xml fragments"
|
|
896
1181
|
}
|
|
897
|
-
},
|
|
1182
|
+
}, Rn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
898
1183
|
__proto__: null,
|
|
899
|
-
embeddedLanguage:
|
|
900
|
-
embedder:
|
|
901
|
-
options:
|
|
902
|
-
parser:
|
|
903
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
904
|
-
"./
|
|
905
|
-
"./
|
|
906
|
-
"./
|
|
907
|
-
"./
|
|
908
|
-
"./
|
|
909
|
-
"./
|
|
910
|
-
"./
|
|
1184
|
+
embeddedLanguage: de,
|
|
1185
|
+
embedder: On,
|
|
1186
|
+
options: kn,
|
|
1187
|
+
parser: Sn
|
|
1188
|
+
}, Symbol.toStringTag, { value: "Module" })), et = [], tt = {}, nt = {}, st = {}, Mn = /* @__PURE__ */ Object.assign({
|
|
1189
|
+
"./css/index.ts": wt,
|
|
1190
|
+
"./es/index.ts": Ut,
|
|
1191
|
+
"./glsl/index.ts": jt,
|
|
1192
|
+
"./html/index.ts": Ct,
|
|
1193
|
+
"./markdown/index.ts": Ht,
|
|
1194
|
+
"./noop/index.ts": Qt,
|
|
1195
|
+
"./php/index.ts": tn,
|
|
1196
|
+
"./ruby/index.ts": pn,
|
|
1197
|
+
"./sql/index.ts": In,
|
|
1198
|
+
"./ts/index.ts": Dn,
|
|
1199
|
+
"./xml/index.ts": Rn
|
|
911
1200
|
});
|
|
912
|
-
Object.values(
|
|
913
|
-
({ embeddedLanguage: e, parser: n, embedder:
|
|
914
|
-
|
|
1201
|
+
Object.values(Mn).forEach(
|
|
1202
|
+
({ embeddedLanguage: e, parser: n, embedder: r, options: t }) => {
|
|
1203
|
+
yt(et, e, oe), n && (tt[e] = n), r && (nt[e] = r), Object.assign(st, t);
|
|
915
1204
|
}
|
|
916
1205
|
);
|
|
917
|
-
const
|
|
1206
|
+
const Kn = {
|
|
918
1207
|
// parsers from internal
|
|
919
|
-
...
|
|
920
|
-
...
|
|
921
|
-
...
|
|
922
|
-
...
|
|
923
|
-
...
|
|
1208
|
+
...rt.parsers,
|
|
1209
|
+
...it.parsers,
|
|
1210
|
+
...ot.parsers,
|
|
1211
|
+
...at.parsers,
|
|
1212
|
+
...dt.parsers,
|
|
924
1213
|
// parsers from this plugin
|
|
925
|
-
...
|
|
926
|
-
}, { estree:
|
|
1214
|
+
...tt
|
|
1215
|
+
}, { estree: J } = ct, jn = function(e, n) {
|
|
927
1216
|
var t;
|
|
928
|
-
const { node:
|
|
929
|
-
if (
|
|
1217
|
+
const { node: r } = e;
|
|
1218
|
+
if (r.type !== "TemplateLiteral" || r.quasis.some(({ value: { cooked: s } }) => s === null))
|
|
930
1219
|
return null;
|
|
931
|
-
for (const
|
|
932
|
-
const
|
|
933
|
-
if (!
|
|
1220
|
+
for (const s of et) {
|
|
1221
|
+
const o = n[R(s)];
|
|
1222
|
+
if (!o)
|
|
934
1223
|
continue;
|
|
935
|
-
const h =
|
|
1224
|
+
const h = Nn(
|
|
936
1225
|
e,
|
|
937
|
-
|
|
1226
|
+
o,
|
|
938
1227
|
n.noEmbeddedIdentificationByComment ?? []
|
|
939
|
-
) ??
|
|
1228
|
+
) ?? qn(
|
|
940
1229
|
e,
|
|
941
|
-
|
|
1230
|
+
o,
|
|
942
1231
|
n.noEmbeddedIdentificationByTag ?? []
|
|
943
1232
|
);
|
|
944
1233
|
if (h === void 0)
|
|
945
1234
|
continue;
|
|
946
|
-
const
|
|
947
|
-
if (!
|
|
1235
|
+
const g = nt[s];
|
|
1236
|
+
if (!g)
|
|
948
1237
|
return null;
|
|
949
|
-
const
|
|
950
|
-
return
|
|
951
|
-
const
|
|
952
|
-
return
|
|
953
|
-
{ embed: !0, ...
|
|
954
|
-
|
|
1238
|
+
const d = e.node;
|
|
1239
|
+
return d.quasis.length === 1 && d.quasis[0].value.raw.trim() === "" ? "``" : async (...f) => {
|
|
1240
|
+
const u = await g(...f, h, o);
|
|
1241
|
+
return k.label(
|
|
1242
|
+
{ embed: !0, ...u.label },
|
|
1243
|
+
u
|
|
955
1244
|
);
|
|
956
1245
|
};
|
|
957
1246
|
}
|
|
958
|
-
return ((t =
|
|
1247
|
+
return ((t = J.embed) == null ? void 0 : t.call(J, e, n)) ?? null;
|
|
959
1248
|
};
|
|
960
|
-
function
|
|
961
|
-
if (
|
|
1249
|
+
function Nn({ node: e, parent: n }, r, t) {
|
|
1250
|
+
if (r.length === 0 || e.type !== "TemplateLiteral")
|
|
962
1251
|
return;
|
|
963
|
-
const
|
|
964
|
-
if (!
|
|
1252
|
+
const s = e.comments ?? (n == null ? void 0 : n.comments);
|
|
1253
|
+
if (!s)
|
|
965
1254
|
return;
|
|
966
|
-
const
|
|
1255
|
+
const o = s[s.length - 1];
|
|
967
1256
|
if (!(![
|
|
968
1257
|
"MultiLine",
|
|
969
1258
|
// meriyah
|
|
@@ -971,48 +1260,48 @@ function Pt({ node: e, parent: n }, s, t) {
|
|
|
971
1260
|
// typescript, acorn, espree, flow
|
|
972
1261
|
"CommentBlock"
|
|
973
1262
|
// babel, babel-flow, babel-ts
|
|
974
|
-
].includes(
|
|
975
|
-
for (const h of
|
|
976
|
-
if (` ${h} ` ===
|
|
1263
|
+
].includes(o.type) || !o.leading)) {
|
|
1264
|
+
for (const h of r)
|
|
1265
|
+
if (` ${h} ` === o.value && !t.includes(h))
|
|
977
1266
|
return h;
|
|
978
1267
|
}
|
|
979
1268
|
}
|
|
980
|
-
function
|
|
981
|
-
if (
|
|
982
|
-
for (const
|
|
983
|
-
if (n.tag.name ===
|
|
984
|
-
return
|
|
1269
|
+
function qn({ node: e, parent: n }, r, t) {
|
|
1270
|
+
if (r.length !== 0 && !(e.type !== "TemplateLiteral" || (n == null ? void 0 : n.type) !== "TaggedTemplateExpression" || n.tag.type !== "Identifier")) {
|
|
1271
|
+
for (const s of r)
|
|
1272
|
+
if (n.tag.name === s && !t.includes(s))
|
|
1273
|
+
return s;
|
|
985
1274
|
}
|
|
986
1275
|
}
|
|
987
|
-
const
|
|
1276
|
+
const Zn = {
|
|
988
1277
|
estree: {
|
|
989
|
-
...
|
|
990
|
-
embed:
|
|
1278
|
+
...J,
|
|
1279
|
+
embed: jn
|
|
991
1280
|
}
|
|
992
|
-
},
|
|
993
|
-
...
|
|
994
|
-
[
|
|
1281
|
+
}, Bn = "noEmbeddedIdentificationByComment", Fn = "noEmbeddedIdentificationByTag", An = "preserveEmbeddedExteriorWhitespaces", Cn = "noEmbeddedMultiLineIndentation", es = {
|
|
1282
|
+
...st,
|
|
1283
|
+
[Bn]: {
|
|
995
1284
|
category: "Global",
|
|
996
1285
|
type: "string",
|
|
997
1286
|
array: !0,
|
|
998
1287
|
default: [{ value: [] }],
|
|
999
1288
|
description: 'This option turns off "/* identifier */ `...`" comment-based language identification for the specified identifiers.'
|
|
1000
1289
|
},
|
|
1001
|
-
[
|
|
1290
|
+
[Fn]: {
|
|
1002
1291
|
category: "Global",
|
|
1003
1292
|
type: "string",
|
|
1004
1293
|
array: !0,
|
|
1005
1294
|
default: [{ value: [] }],
|
|
1006
1295
|
description: 'This option turns off "identifier`...`" tag-based language identification for the specified identifiers.'
|
|
1007
1296
|
},
|
|
1008
|
-
[
|
|
1297
|
+
[An]: {
|
|
1009
1298
|
category: "Config",
|
|
1010
1299
|
type: "string",
|
|
1011
1300
|
array: !0,
|
|
1012
1301
|
default: [{ value: [] }],
|
|
1013
1302
|
description: "This option preserves leading and trailing whitespaces in the formatting results for the specified identifiers."
|
|
1014
1303
|
},
|
|
1015
|
-
[
|
|
1304
|
+
[Cn]: {
|
|
1016
1305
|
category: "Global",
|
|
1017
1306
|
type: "string",
|
|
1018
1307
|
array: !0,
|
|
@@ -1021,11 +1310,12 @@ const Yt = {
|
|
|
1021
1310
|
}
|
|
1022
1311
|
};
|
|
1023
1312
|
export {
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1313
|
+
nt as embeddedEmbedders,
|
|
1314
|
+
et as embeddedLanguages,
|
|
1315
|
+
st as embeddedOptions,
|
|
1316
|
+
tt as embeddedParsers,
|
|
1317
|
+
R as makeIdentifiersName,
|
|
1318
|
+
es as options,
|
|
1319
|
+
Kn as parsers,
|
|
1320
|
+
Zn as printers
|
|
1031
1321
|
};
|