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.
Files changed (33) hide show
  1. package/README.bak +211 -0
  2. package/README.md +62 -37
  3. package/dist/embedded/css/embedded-language.d.ts +6 -0
  4. package/dist/embedded/css/embedder.d.ts +9 -0
  5. package/dist/embedded/css/index.d.ts +3 -0
  6. package/dist/embedded/css/options.d.ts +37 -0
  7. package/dist/embedded/es/options.d.ts +14 -10
  8. package/dist/embedded/glsl/embedded-language.d.ts +6 -0
  9. package/dist/embedded/glsl/embedder.d.ts +9 -0
  10. package/dist/embedded/glsl/index.d.ts +3 -0
  11. package/dist/embedded/glsl/options.d.ts +37 -0
  12. package/dist/embedded/html/options.d.ts +10 -6
  13. package/dist/embedded/index.d.ts +1 -0
  14. package/dist/embedded/markdown/embedded-language.d.ts +6 -0
  15. package/dist/embedded/markdown/embedder.d.ts +9 -0
  16. package/dist/embedded/markdown/index.d.ts +3 -0
  17. package/dist/embedded/markdown/options.d.ts +38 -0
  18. package/dist/embedded/noop/options.d.ts +6 -3
  19. package/dist/embedded/php/options.d.ts +15 -11
  20. package/dist/embedded/register.d.ts +11 -7
  21. package/dist/embedded/ruby/embedded-language.d.ts +6 -0
  22. package/dist/embedded/ruby/embedder.d.ts +9 -0
  23. package/dist/embedded/ruby/index.d.ts +3 -0
  24. package/dist/embedded/ruby/options.d.ts +60 -0
  25. package/dist/embedded/sql/options.d.ts +9 -6
  26. package/dist/embedded/ts/options.d.ts +14 -10
  27. package/dist/embedded/utils.d.ts +4 -2
  28. package/dist/embedded/xml/options.d.ts +12 -8
  29. package/dist/index.js +819 -525
  30. package/dist/options.d.ts +55 -12
  31. package/package.json +18 -11
  32. package/dist/prettier-plugin-embed-wide-dark.svg +0 -309
  33. package/dist/prettier-plugin-embed-wide-light.svg +0 -309
package/dist/index.js CHANGED
@@ -1,70 +1,70 @@
1
- import Me from "prettier/parser-babel";
2
- import je from "prettier/parser-espree";
3
- import Be from "prettier/parser-flow";
4
- import Fe from "prettier/parser-typescript";
5
- import Ne from "prettier/parser-meriyah";
6
- import { utils as Y, builders as M } from "prettier/doc";
7
- import { parse as ke } from "@xml-tools/parser";
8
- import { printers as Re } from "prettier/plugins/estree.mjs";
9
- const Ie = "embeddedEs";
10
- function Ce(e) {
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 ve = { exports: {} };
13
+ var Ge = { exports: {} };
14
14
  (function(e) {
15
15
  var n = (() => {
16
- var s = Object.defineProperty, t = Object.getOwnPropertyDescriptor, i = Object.getOwnPropertyNames, a = Object.getOwnPropertySymbols, h = Object.prototype.hasOwnProperty, p = Object.prototype.propertyIsEnumerable, c = (u, l, d) => l in u ? s(u, l, { enumerable: !0, configurable: !0, writable: !0, value: d }) : u[l] = d, x = (u, l) => {
17
- for (var d in l || (l = {}))
18
- h.call(l, d) && c(u, d, l[d]);
19
- if (a)
20
- for (var d of a(l))
21
- p.call(l, d) && c(u, d, l[d]);
22
- return u;
23
- }, g = (u, l) => {
24
- for (var d in l)
25
- s(u, d, { get: l[d], enumerable: !0 });
26
- }, D = (u, l, d, y) => {
27
- if (l && typeof l == "object" || typeof l == "function")
28
- for (let m of i(l))
29
- !h.call(u, m) && m !== d && s(u, m, { get: () => l[m], enumerable: !(y = t(l, m)) || y.enumerable });
30
- return u;
31
- }, L = (u) => D(s({}, "__esModule", { value: !0 }), u), r = (u, l, d) => (c(u, typeof l != "symbol" ? l + "" : l, d), d), E = {};
32
- g(E, {
33
- DEFAULT_OPTIONS: () => T,
34
- DEFAULT_UUID_LENGTH: () => w,
35
- default: () => v
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 I = "5.0.3", w = 6, T = {
37
+ var b = "5.0.3", v = 6, L = {
38
38
  dictionary: "alphanum",
39
39
  shuffle: !0,
40
40
  debug: !1,
41
- length: w,
41
+ length: v,
42
42
  counter: 0
43
- }, b = class {
44
- constructor(l = {}) {
45
- r(this, "counter"), r(this, "debug"), r(this, "dict"), r(this, "version"), r(this, "dictIndex", 0), r(this, "dictRange", []), r(this, "lowerBound", 0), r(this, "upperBound", 0), r(this, "dictLength", 0), r(this, "uuidLength"), r(this, "_digit_first_ascii", 48), r(this, "_digit_last_ascii", 58), r(this, "_alpha_lower_first_ascii", 97), r(this, "_alpha_lower_last_ascii", 123), r(this, "_hex_last_ascii", 103), r(this, "_alpha_upper_first_ascii", 65), r(this, "_alpha_upper_last_ascii", 91), r(this, "_number_dict_ranges", {
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
- }), r(this, "_alpha_dict_ranges", {
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
- }), r(this, "_alpha_lower_dict_ranges", {
50
+ }), i(this, "_alpha_lower_dict_ranges", {
51
51
  lowerCase: [this._alpha_lower_first_ascii, this._alpha_lower_last_ascii]
52
- }), r(this, "_alpha_upper_dict_ranges", {
52
+ }), i(this, "_alpha_upper_dict_ranges", {
53
53
  upperCase: [this._alpha_upper_first_ascii, this._alpha_upper_last_ascii]
54
- }), r(this, "_alphanum_dict_ranges", {
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
- }), r(this, "_alphanum_lower_dict_ranges", {
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
- }), r(this, "_alphanum_upper_dict_ranges", {
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
- }), r(this, "_hex_dict_ranges", {
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
- }), r(this, "_dict_ranges", {
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
- }), r(this, "log", (...o) => {
77
- const _ = [...o];
78
- if (_[0] = `[short-unique-id] ${o[0]}`, this.debug === !0 && typeof console < "u" && console !== null)
79
- return console.log(..._);
80
- }), r(this, "setDictionary", (o, _) => {
81
- let f;
82
- if (o && Array.isArray(o) && o.length > 1)
83
- f = o;
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
- f = [];
86
- let S;
87
- this.dictIndex = S = 0;
88
- const q = `_${o}_dict_ranges`, O = this._dict_ranges[q];
89
- Object.keys(O).forEach((P) => {
90
- const z = P;
91
- for (this.dictRange = O[z], this.lowerBound = this.dictRange[0], this.upperBound = this.dictRange[1], this.dictIndex = S = this.lowerBound; this.lowerBound <= this.upperBound ? S < this.upperBound : S > this.upperBound; this.dictIndex = this.lowerBound <= this.upperBound ? S += 1 : S -= 1)
92
- f.push(String.fromCharCode(this.dictIndex));
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
- _ && (f = f.sort(() => Math.random() - 0.5)), this.dict = f, this.dictLength = this.dict.length, this.setCounter(0);
96
- }), r(this, "seq", () => this.sequentialUUID()), r(this, "sequentialUUID", () => {
97
- let o, _, f = "";
98
- o = this.counter;
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
- _ = o % this.dictLength, o = Math.trunc(o / this.dictLength), f += this.dict[_];
101
- while (o !== 0);
102
- return this.counter += 1, f;
103
- }), r(this, "rnd", (o = this.uuidLength || w) => this.randomUUID(o)), r(this, "randomUUID", (o = this.uuidLength || w) => {
104
- let _, f, S;
105
- if (o === null || typeof o > "u" || o < 1)
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 (_ = "", S = 0; S < o; S += 1)
108
- f = parseInt(
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, _ += this.dict[f];
112
- return _;
113
- }), r(this, "fmt", (o, _) => this.formattedUUID(o, _)), r(this, "formattedUUID", (o, _) => {
114
- const f = {
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 o.replace(
119
+ return l.replace(
120
120
  /\$[rs]\d{0,}|\$t0|\$t[1-9]\d{1,}/g,
121
- (q) => {
122
- const O = q.slice(0, 2), P = parseInt(q.slice(2), 10);
123
- return O === "$s" ? f[O]().padStart(P, "0") : O === "$t" && _ ? f[O](P, _) : f[O](P);
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
- }), r(this, "availableUUIDs", (o = this.uuidLength) => parseFloat(
127
- Math.pow([...new Set(this.dict)].length, o).toFixed(0)
128
- )), r(this, "approxMaxBeforeCollision", (o = this.availableUUIDs(this.uuidLength)) => parseFloat(
129
- Math.sqrt(Math.PI / 2 * o).toFixed(20)
130
- )), r(this, "collisionProbability", (o = this.availableUUIDs(this.uuidLength), _ = this.uuidLength) => parseFloat(
131
- (this.approxMaxBeforeCollision(o) / this.availableUUIDs(_)).toFixed(20)
132
- )), r(this, "uniqueness", (o = this.availableUUIDs(this.uuidLength)) => {
133
- const _ = parseFloat(
134
- (1 - this.approxMaxBeforeCollision(o) / o).toFixed(20)
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 _ > 1 ? 1 : _ < 0 ? 0 : _;
137
- }), r(this, "getVersion", () => this.version), r(this, "stamp", (o, _) => {
138
- const f = Math.floor(+(_ || /* @__PURE__ */ new Date()) / 1e3).toString(16);
139
- if (typeof o == "number" && o === 0)
140
- return f;
141
- if (typeof o != "number" || o < 10)
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 S = o - 9, q = Math.round(Math.random() * (S > 15 ? 15 : S)), O = this.randomUUID(S);
150
- return `${O.substring(0, q)}${f}${O.substring(q)}${q.toString(16)}`;
151
- }), r(this, "parseStamp", (o, _) => {
152
- if (_ && !/t0|t[1-9]\d{1,}/.test(_))
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 f = _ ? _.replace(
154
+ const w = x ? x.replace(
155
155
  /\$[rs]\d{0,}|\$t0|\$t[1-9]\d{1,}/g,
156
- (q) => {
157
- const O = {
158
- $r: (W) => [...Array(W)].map(() => "r").join(""),
159
- $s: (W) => [...Array(W)].map(() => "s").join(""),
160
- $t: (W) => [...Array(W)].map(() => "t").join("")
161
- }, P = q.slice(0, 2), z = parseInt(q.slice(2), 10);
162
- return O[P](z);
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
- (q, O, P) => o.substring(O.length, O.length + P.length)
167
- ) : o;
168
- if (f.length === 8)
169
- return new Date(parseInt(f, 16) * 1e3);
170
- if (f.length < 10)
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 S = parseInt(f.substring(f.length - 1), 16);
173
- return new Date(parseInt(f.substring(S, S + 8), 16) * 1e3);
174
- }), r(this, "setCounter", (o) => {
175
- this.counter = o;
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 d = x(x({}, T), l);
178
- this.counter = 0, this.debug = !1, this.dict = [], this.version = I;
177
+ const c = f(f({}, L), a);
178
+ this.counter = 0, this.debug = !1, this.dict = [], this.version = b;
179
179
  const {
180
- dictionary: y,
181
- shuffle: m,
182
- length: $,
183
- counter: U
184
- } = d;
185
- return this.uuidLength = $, this.setDictionary(y, m), this.setCounter(U), this.debug = d.debug, this.log(this.dict), this.log(
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
- r(b, "default", b);
191
- var v = b;
192
- return L(E);
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
- })(ve);
196
- var Ae = ve.exports;
197
- const We = /* @__PURE__ */ Ce(Ae), { group: Ge, indent: Xe, softline: ee, lineSuffixBoundary: ze } = M, { mapDoc: He } = Y;
198
- function Ve(e, n) {
199
- var i;
200
- const { node: s } = e;
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 (i = s == null ? void 0 : s.comments) != null && i.length && (t = Ge([Xe([ee, t]), ee])), ["${", t, ze, "}"];
202
+ return (s = r == null ? void 0 : r.comments) != null && s.length && (t = gt([mt([le, t]), le])), ["${", t, _t, "}"];
203
203
  }
204
- function C(e, n) {
204
+ function M(e, n) {
205
205
  return e.map(
206
- (s) => Ve(s, n),
206
+ (r) => bt(r, n),
207
207
  "expressions"
208
208
  );
209
209
  }
210
- function X(e, n, s) {
211
- return He(e, (i) => {
212
- if (typeof i != "string")
213
- return i;
214
- const a = [], h = i.split(n);
215
- for (let p = 0; p < h.length; p++) {
216
- let c = h[p];
217
- if (p % 2 == 0) {
218
- if (!c)
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
- c = c.replaceAll(/([\\`]|\${)/g, "\\$1"), a.push(c);
220
+ d = d.replaceAll(/([\\`]|\${)/g, "\\$1"), o.push(d);
221
221
  } else {
222
- const x = Number(c);
223
- a.push(s[x]);
222
+ const f = Number(d);
223
+ o.push(r[f]);
224
224
  }
225
225
  }
226
- return a;
226
+ return o;
227
227
  });
228
228
  }
229
- function Q(e, n, s) {
229
+ function Q(e, n, r) {
230
230
  var t;
231
231
  if (!(((t = n.plugins) == null ? void 0 : t.some(
232
- (i) => {
233
- var a;
234
- return ((a = i.name) == null ? void 0 : a.includes(e)) ?? !1;
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 "${s}", because plugin "${e}" is not loaded.`
238
+ `Cannot format embedded language identified by "${r}", because plugin "${e}" is not loaded.`
239
239
  );
240
240
  }
241
- function Ye(e, n, s) {
242
- if (n === s) {
241
+ function yt(e, n, r) {
242
+ if (n === r) {
243
243
  e.unshift(n);
244
244
  return;
245
245
  }
246
- let t = 0, i = e.length;
247
- for (; t < i; ) {
248
- const a = t + i >>> 1;
249
- if (e[a] === s) {
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[a] < n ? t = a + 1 : i = a;
253
+ e[o] < n ? t = o + 1 : s = o;
254
254
  }
255
255
  e.splice(t, 0, n);
256
256
  }
257
- const { randomUUID: te } = new We({
257
+ const { randomUUID: ce } = new ht({
258
258
  length: 16,
259
259
  dictionary: "alphanum_lower"
260
260
  });
261
- function A(e = "p", n = "") {
262
- const s = te(), t = te(), i = ne(e), a = ne(n), h = (c) => `${e}${s}${c}${t}${n}`, p = new RegExp(
263
- `${i}${s}(\\d+)${t}${a}`,
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: p
268
+ placeholderRegex: g
269
269
  };
270
270
  }
271
- function ne(e) {
271
+ function ue(e) {
272
272
  return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
273
273
  }
274
- const { line: se, group: j, indent: ie, softline: re } = M, Qe = async (e, n, s, t, i) => {
275
- var a, h, p, c, x;
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: g } = s, { createPlaceholder: D, placeholderRegex: L } = A(), r = g.quasis.map(
278
- (l, d, { length: y }) => d === y - 1 ? l.value.cooked : l.value.cooked + D(d)
279
- ).join(""), E = ((a = r.match(/^\s+/)) == null ? void 0 : a[0]) ?? "", I = ((h = r.match(/\s+$/)) == null ? void 0 : h[0]) ?? "", w = C(s, n), T = await e(r, {
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
- }), b = X(
282
- T,
330
+ }), m = q(
283
331
  L,
284
- w
332
+ S,
333
+ v
285
334
  );
286
- if ((p = t.preserveEmbeddedExteriorWhitespaces) != null && p.includes(i))
287
- return j([
335
+ if ((g = t.preserveEmbeddedExteriorWhitespaces) != null && g.includes(s))
336
+ return F([
288
337
  "`",
289
- E,
290
- (c = t.noEmbeddedMultiLineIndentation) != null && c.includes(i) ? [j(b)] : ie([j(b)]),
291
- I,
338
+ _,
339
+ (d = t.noEmbeddedMultiLineIndentation) != null && d.includes(s) ? [F(m)] : _e([F(m)]),
340
+ b,
292
341
  "`"
293
342
  ]);
294
- const v = E.length ? se : re, u = I.length ? se : re;
295
- return j([
343
+ const y = _.length ? me : fe, p = b.length ? me : fe;
344
+ return F([
296
345
  "`",
297
- (x = t.noEmbeddedMultiLineIndentation) != null && x.includes(i) ? [v, j(b)] : ie([v, j(b)]),
298
- u,
346
+ (f = t.noEmbeddedMultiLineIndentation) != null && f.includes(s) ? [y, F(m)] : _e([y, F(m)]),
347
+ p,
299
348
  "`"
300
349
  ]);
301
- } catch (g) {
302
- throw console.error(g), g;
350
+ } catch (u) {
351
+ throw console.error(u), u;
303
352
  }
304
- }, Je = [
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
- ], Ke = "embeddedEsParser", Ze = {
313
- [Ie]: {
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: [...Je] }],
318
- description: "Specify embedded ES languages."
367
+ default: [{ value: [...Lt] }],
368
+ description: "Specify embedded ES language identifiers."
319
369
  },
320
- [Ke]: {
370
+ [Tt]: {
321
371
  category: "Global",
322
372
  type: "string",
323
373
  array: !1,
324
374
  default: "babel",
325
- description: "Specify the parser for the embedded ES languages."
375
+ description: "Specify the embedded ES language parser."
326
376
  }
327
- }, et = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
377
+ }, Ut = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
328
378
  __proto__: null,
329
- embeddedLanguage: Ie,
330
- embedder: Qe,
331
- options: Ze
332
- }, Symbol.toStringTag, { value: "Module" })), $e = "embeddedHtml", { line: oe, group: B, indent: ae, softline: le } = M, { mapDoc: tt } = Y, nt = async (e, n, s, t, i) => {
333
- var a, h, p, c, x;
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
- const { node: g } = s, { createPlaceholder: D, placeholderRegex: L } = A(), r = g.quasis.map(
336
- (l, d, { length: y }) => d === y - 1 ? l.value.cooked : l.value.cooked + D(d)
337
- ).join(""), E = ((a = r.match(/^\s+/)) == null ? void 0 : a[0]) ?? "", I = ((h = r.match(/\s+$/)) == null ? void 0 : h[0]) ?? "", w = C(s, n), T = await e(r, {
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
- }), b = tt(T, (l) => {
340
- if (typeof l != "string")
341
- return l;
342
- const d = [], y = l.split(L);
343
- for (let m = 0; m < y.length; m++) {
344
- let $ = y[m];
345
- if (m % 2 == 0) {
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
- $ = $.replaceAll(/([\\`]|\${)/g, "\\$1"), t.__embeddedInHtml && ($ = $.replaceAll(/<\/(?=script\b)/gi, "<\\/")), d.push($);
468
+ D = D.replaceAll(/([\\`]|\${)/g, "\\$1"), t.__embeddedInHtml && (D = D.replaceAll(/<\/(?=script\b)/gi, "<\\/")), c.push(D);
349
469
  } else {
350
- const U = Number($);
351
- d.push(w[U]);
470
+ const O = Number(D);
471
+ c.push(v[O]);
352
472
  }
353
473
  }
354
- return d;
474
+ return c;
355
475
  });
356
476
  if (t.htmlWhitespaceSensitivity === "strict" || // TODO: is css mode should be included here?
357
- t.htmlWhitespaceSensitivity === "css" || (p = t.preserveEmbeddedExteriorWhitespaces) != null && p.includes(i))
358
- return B([
477
+ t.htmlWhitespaceSensitivity === "css" || (g = t.preserveEmbeddedExteriorWhitespaces) != null && g.includes(s))
478
+ return C([
359
479
  "`",
360
- E,
361
- (c = t.noEmbeddedMultiLineIndentation) != null && c.includes(i) ? [B(b)] : ae([B(b)]),
362
- I,
480
+ _,
481
+ (d = t.noEmbeddedMultiLineIndentation) != null && d.includes(s) ? [C(m)] : xe([C(m)]),
482
+ b,
363
483
  "`"
364
484
  ]);
365
- const v = E.length ? oe : le, u = I.length ? oe : le;
366
- return B([
485
+ const y = _.length ? Ee : $e, p = b.length ? Ee : $e;
486
+ return C([
367
487
  "`",
368
- (x = t.noEmbeddedMultiLineIndentation) != null && x.includes(i) ? [v, B(b)] : ae([v, B(b)]),
369
- u,
488
+ (f = t.noEmbeddedMultiLineIndentation) != null && f.includes(s) ? [y, C(m)] : xe([y, C(m)]),
489
+ p,
370
490
  "`"
371
491
  ]);
372
- } catch (g) {
373
- throw console.error(g), g;
492
+ } catch (u) {
493
+ throw console.error(u), u;
374
494
  }
375
- }, st = [
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
- ], it = {
389
- [$e]: {
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: [...st] }],
394
- description: "Specify embedded HTML languages."
569
+ default: [{ value: [...Gt] }],
570
+ description: "Specify embedded Markdown language identifiers."
395
571
  }
396
- }, rt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
572
+ }, Ht = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
397
573
  __proto__: null,
398
- embeddedLanguage: $e,
399
- embedder: nt,
400
- options: it
401
- }, Symbol.toStringTag, { value: "Module" })), J = "embeddedNoop", ot = {
402
- [J]: {
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 languages that will not be formatted."
583
+ description: "Specify embedded language identifiers that will not be formatted."
408
584
  }
409
- }, at = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
585
+ }, Qt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
410
586
  __proto__: null,
411
- embeddedLanguage: J,
412
- options: ot
413
- }, Symbol.toStringTag, { value: "Module" })), De = "embeddedPhp", { line: ce, group: F, indent: de, softline: ue } = M, lt = async (e, n, s, t, i) => {
414
- var a, h, p, c, x;
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, i);
417
- const { node: g } = s, { createPlaceholder: D, placeholderRegex: L } = A("$p"), r = g.quasis.map(
418
- (d, y, { length: m }) => y === m - 1 ? d.value.cooked : d.value.cooked + D(y)
419
- ).join(""), E = ((a = r.match(/^\s+/)) == null ? void 0 : a[0]) ?? "", I = ((h = r.match(/\s+$/)) == null ? void 0 : h[0]) ?? "", w = r.slice(
420
- E.length,
421
- -I.length || void 0
422
- ), T = C(s, n), b = await e(w, {
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
- }), v = X(
425
- b,
426
- L,
427
- T
600
+ }), y = q(
601
+ m,
602
+ S,
603
+ L
428
604
  );
429
- if ((p = t.preserveEmbeddedExteriorWhitespaces) != null && p.includes(i))
430
- return F([
605
+ if ((g = t.preserveEmbeddedExteriorWhitespaces) != null && g.includes(s))
606
+ return G([
431
607
  "`",
432
- E,
433
- (c = t.noEmbeddedMultiLineIndentation) != null && c.includes(i) ? [F(v)] : de([F(v)]),
434
- I,
608
+ _,
609
+ (d = t.noEmbeddedMultiLineIndentation) != null && d.includes(s) ? [G(y)] : Se([G(y)]),
610
+ b,
435
611
  "`"
436
612
  ]);
437
- const u = E.length ? ce : ue, l = I.length ? ce : ue;
438
- return F([
613
+ const p = _.length ? Le : Te, a = b.length ? Le : Te;
614
+ return G([
439
615
  "`",
440
- (x = t.noEmbeddedMultiLineIndentation) != null && x.includes(i) ? [u, F(v)] : de([u, F(v)]),
441
- l,
616
+ (f = t.noEmbeddedMultiLineIndentation) != null && f.includes(s) ? [p, G(y)] : Se([p, G(y)]),
617
+ a,
442
618
  "`"
443
619
  ]);
444
- } catch (g) {
445
- throw console.error(g), g;
620
+ } catch (u) {
621
+ throw console.error(u), u;
446
622
  }
447
- }, ct = ["php", "php5", "phtml", "ctp"], dt = {
448
- [De]: {
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: [...ct] }],
453
- description: "Specify embedded PHP languages. This requires @prettier/plugin-php"
628
+ default: [{ value: [...Kt] }],
629
+ description: 'Specify embedded PHP language identifiers. This requires "@prettier/plugin-php".'
454
630
  }
455
- }, ut = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
631
+ }, tn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
456
632
  __proto__: null,
457
- embeddedLanguage: De,
458
- embedder: lt,
459
- options: dt
460
- }, Symbol.toStringTag, { value: "Module" })), we = "embeddedSql", K = [
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
- ], Se = [
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
- ], ht = {
487
- [we]: {
773
+ ], hn = R(Qe), gn = {
774
+ [hn]: {
488
775
  category: "Global",
489
776
  type: "string",
490
777
  array: !0,
491
- default: [{ value: [...K] }],
492
- description: "Specify embedded SQL languages. This requires prettier-plugin-sql"
778
+ default: [{ value: [...ae] }],
779
+ description: 'Specify embedded SQL language identifiers. This requires "prettier-plugin-sql".'
493
780
  }
494
- }, { hardline: pt, group: N, line: he, softline: pe, indent: _e } = M, { mapDoc: _t } = Y, gt = async (e, n, s, t, i, a) => {
495
- var h, p, c, x, g;
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, i);
498
- const { node: D } = s, { createPlaceholder: L, placeholderRegex: r } = A(), E = D.quasis.map(
499
- (y, m, { length: $ }) => m === $ - 1 ? y.value.cooked : y.value.cooked + L(m)
500
- ).join(""), I = ((h = E.match(/^\s+/)) == null ? void 0 : h[0]) ?? "", w = ((p = E.match(/\s+$/)) == null ? void 0 : p[0]) ?? "", T = C(s, n), b = ft(
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
- i,
503
- a
789
+ s,
790
+ o
504
791
  );
505
- if (typeof b > "u")
506
- throw new SyntaxError(`Unrecognized language: ${i}`);
507
- const v = await e(E, {
792
+ if (typeof m > "u")
793
+ throw new SyntaxError(`Unrecognized identifier: ${s}`);
794
+ const y = await e(_, {
508
795
  parser: "sql",
509
- ...b
510
- }), u = _t(v, (y) => {
511
- if (typeof y != "string")
512
- return y;
513
- const m = [], $ = y.split(r);
514
- for (let U = 0; U < $.length; U++) {
515
- let o = $[U];
516
- if (U % 2 == 0) {
517
- if (!o)
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
- o = o.replaceAll(/([\\`]|\${)/g, "\\$1"), o.split(/(\n)/).forEach(
520
- (_) => _ === `
521
- ` ? m.push(pt) : m.push(_)
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 _ = Number(o);
525
- m.push(T[_]);
811
+ const x = Number(l);
812
+ E.push(L[x]);
526
813
  }
527
814
  }
528
- return m;
815
+ return E;
529
816
  });
530
- if ((c = t.preserveEmbeddedExteriorWhitespaces) != null && c.includes(i))
531
- return N([
817
+ if ((d = t.preserveEmbeddedExteriorWhitespaces) != null && d.includes(s))
818
+ return X([
532
819
  "`",
533
- I,
534
- (x = t.noEmbeddedMultiLineIndentation) != null && x.includes(i) ? [N(u)] : _e([N(u)]),
535
- w,
820
+ b,
821
+ (f = t.noEmbeddedMultiLineIndentation) != null && f.includes(s) ? [X(p)] : Me([X(p)]),
822
+ v,
536
823
  "`"
537
824
  ]);
538
- const l = I.length ? he : pe, d = w.length ? he : pe;
539
- return N([
825
+ const a = b.length ? ke : Re, c = v.length ? ke : Re;
826
+ return X([
540
827
  "`",
541
- (g = t.noEmbeddedMultiLineIndentation) != null && g.includes(i) ? [l, N(u)] : _e([l, N(u)]),
542
- d,
828
+ (u = t.noEmbeddedMultiLineIndentation) != null && u.includes(s) ? [a, X(p)] : Me([a, X(p)]),
829
+ c,
543
830
  "`"
544
831
  ]);
545
- } catch (D) {
546
- throw console.error(D), D;
832
+ } catch ($) {
833
+ throw console.error($), $;
547
834
  }
548
- }, mt = {
549
- "sql-formatter": (e) => K.includes(e),
550
- "node-sql-parser": (e) => Se.includes(e)
835
+ }, bn = {
836
+ "sql-formatter": (e) => ae.includes(e),
837
+ "node-sql-parser": (e) => Je.includes(e)
551
838
  };
552
- function ge(e, n) {
553
- for (const s of n)
554
- if (mt[s](e))
555
- switch (s) {
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: s,
845
+ formatter: r,
559
846
  language: e
560
847
  };
561
848
  case "node-sql-parser":
562
849
  return {
563
- formatter: s,
850
+ formatter: r,
564
851
  database: e
565
852
  };
566
853
  }
567
854
  }
568
- function H(e, n, s) {
569
- let t = ge(e, s);
855
+ function ne(e, n, r) {
856
+ let t = je(e, r);
570
857
  if (t)
571
858
  return t;
572
- const i = n.indexOf(e);
573
- for (let a = i - 1; a >= 0; --a)
574
- if (t = ge(
575
- n[a],
576
- s
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 ft(e, n, s) {
867
+ function yn(e, n, r) {
581
868
  switch (e.formatter ?? "sql-formatter") {
582
869
  case "sql-formatter":
583
- return H(
870
+ return ne(
584
871
  n,
585
- s,
872
+ r,
586
873
  ["sql-formatter", "node-sql-parser"]
587
874
  );
588
875
  case "node-sql-parser":
589
- return H(
876
+ return ne(
590
877
  n,
591
- s,
878
+ r,
592
879
  ["node-sql-parser", "sql-formatter"]
593
880
  );
594
881
  default:
595
- return H(
882
+ return ne(
596
883
  n,
597
- s,
884
+ r,
598
885
  ["sql-formatter", "node-sql-parser"]
599
886
  );
600
887
  }
601
888
  }
602
- const bt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
889
+ const In = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
603
890
  __proto__: null,
604
- NODE_SQL_PARSER_DATABASES: Se,
605
- SQL_FORMATTER_LANGUAGES: K,
606
- embeddedLanguage: we,
607
- embedder: gt,
608
- options: ht
609
- }, Symbol.toStringTag, { value: "Module" })), Oe = "embeddedTs", { line: me, group: k, indent: fe, softline: be } = M, yt = async (e, n, s, t, i) => {
610
- var a, h, p, c, x;
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: g } = s, { createPlaceholder: D, placeholderRegex: L } = A(), r = g.quasis.map(
613
- (l, d, { length: y }) => d === y - 1 ? l.value.cooked : l.value.cooked + D(d)
614
- ).join(""), E = ((a = r.match(/^\s+/)) == null ? void 0 : a[0]) ?? "", I = ((h = r.match(/\s+$/)) == null ? void 0 : h[0]) ?? "", w = C(s, n), T = await e(r, {
615
- parser: t.embeddedTsParser ?? "typescript"
616
- }), b = X(
617
- T,
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
- w
908
+ S,
909
+ v
620
910
  );
621
- if ((p = t.preserveEmbeddedExteriorWhitespaces) != null && p.includes(i))
622
- return k([
911
+ if ((g = t.preserveEmbeddedExteriorWhitespaces) != null && g.includes(s))
912
+ return H([
623
913
  "`",
624
- E,
625
- (c = t.noEmbeddedMultiLineIndentation) != null && c.includes(i) ? [k(b)] : fe([k(b)]),
626
- I,
914
+ _,
915
+ (d = t.noEmbeddedMultiLineIndentation) != null && d.includes(s) ? [H(m)] : qe([H(m)]),
916
+ b,
627
917
  "`"
628
918
  ]);
629
- const v = E.length ? me : be, u = I.length ? me : be;
630
- return k([
919
+ const y = _.length ? Ne : Be, p = b.length ? Ne : Be;
920
+ return H([
631
921
  "`",
632
- (x = t.noEmbeddedMultiLineIndentation) != null && x.includes(i) ? [v, k(b)] : fe([v, k(b)]),
633
- u,
922
+ (f = t.noEmbeddedMultiLineIndentation) != null && f.includes(s) ? [y, H(m)] : qe([y, H(m)]),
923
+ p,
634
924
  "`"
635
925
  ]);
636
- } catch (g) {
637
- throw console.error(g), g;
926
+ } catch (u) {
927
+ throw console.error(u), u;
638
928
  }
639
- }, xt = ["ts", "cts", "mts", "typescript"], Et = "embeddedTsParser", It = {
640
- [Oe]: {
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: [...xt] }],
645
- description: "Specify embedded TS languages."
934
+ default: [{ value: [...xn] }],
935
+ description: "Specify embedded TS language parsers."
646
936
  },
647
- [Et]: {
937
+ [$n]: {
648
938
  category: "Global",
649
939
  type: "string",
650
940
  array: !1,
651
941
  default: "typescript",
652
- description: "Specify the parser for the embedded TS languages."
942
+ description: "Specify the embedded TS language parser."
653
943
  }
654
- }, vt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
944
+ }, Dn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
655
945
  __proto__: null,
656
- embeddedLanguage: Oe,
657
- embedder: yt,
658
- options: It
659
- }, Symbol.toStringTag, { value: "Module" })), Z = "embeddedXml";
660
- function $t(e) {
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
- }, s = new SyntaxError(
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(s, n), s;
968
+ return Object.assign(r, n), r;
679
969
  }
680
- function ye(e) {
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
- }, s = new SyntaxError(
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(s, n), s;
988
+ return Object.assign(r, n), r;
699
989
  }
700
- const Dt = {
990
+ const Sn = {
701
991
  parse(e, n) {
702
- var a, h;
703
- const { lexErrors: s, parseErrors: t, cst: i } = ke(e);
704
- if (s.length > 0) {
705
- const p = s[0];
706
- throw $t(p);
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 p = !1;
710
- for (const c of t) {
999
+ let g = !1;
1000
+ for (const d of t) {
711
1001
  if (!["MismatchedTokenException", "NotAllInputParsedException"].includes(
712
- c.name
1002
+ d.name
713
1003
  ))
714
- throw ye(c);
715
- if (c.message === "Expecting token of type --> OPEN <-- but found --> '' <--") {
716
- p = !0;
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
- c.message
721
- ) || /Redundant input, expecting EOF but found: /.test(c.message)) {
722
- (a = n.__embeddedXmlFragmentRecoverIndex) == null || a.splice(
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
- c.token.startOffset
1015
+ d.token.startOffset
726
1016
  );
727
1017
  break;
728
1018
  }
729
1019
  if (/Expecting token of type --> OPEN <-- but found --> '.+' <--/.test(
730
- c.message
1020
+ d.message
731
1021
  )) {
732
- if (c.token.endOffset === void 0 || Number.isNaN(c.token.endOffset))
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
- c.token.startOffset,
738
- c.token.endOffset
739
- ), p = !0;
1027
+ d.token.startOffset,
1028
+ d.token.endOffset
1029
+ ), g = !0;
740
1030
  break;
741
1031
  }
742
- throw ye(c);
1032
+ throw Fe(d);
743
1033
  }
744
- p && Te(i);
1034
+ g && Ze(s);
745
1035
  }
746
- return i;
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 Te(e) {
1046
+ function Ze(e) {
757
1047
  const n = e.children;
758
- for (const s in n) {
759
- const t = n[s] ?? [];
760
- for (let i = t.length - 1; i >= 0; --i) {
761
- const a = t[i];
762
- if (wt(a)) {
763
- if (Object.keys(a.children).length === 0) {
764
- t.splice(i, 1), t.length === 0 && delete n[s];
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
- Te(a);
1057
+ Ze(o);
768
1058
  }
769
1059
  }
770
1060
  }
771
1061
  }
772
- function wt(e) {
1062
+ function Tn(e) {
773
1063
  return "name" in e && "children" in e && "location" in e;
774
1064
  }
775
- const { line: xe, group: R, indent: Ee, softline: V } = M, St = async (e, n, s, t, i) => {
776
- var a, h, p, c, x, g;
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, i);
779
- const { node: D } = s, { createPlaceholder: L, placeholderRegex: r } = A(), E = D.quasis.map(
780
- (m, $, { length: U }) => $ === U - 1 ? m.value.cooked : m.value.cooked + L($)
781
- ).join(""), I = ((a = E.match(/^\s+/)) == null ? void 0 : a[0]) ?? "", w = ((h = E.match(/\s+$/)) == null ? void 0 : h[0]) ?? "", T = E.slice(
782
- I.length,
783
- -w.length || void 0
784
- ), b = C(s, n), v = [];
785
- let u = 0;
786
- for (; u !== void 0; ) {
787
- const m = T.slice(u);
788
- if (m.length === 0)
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
- u > 0 && t.xmlWhitespaceSensitivity !== "strict" && v.push(V), (p = t.__embeddedXmlFragmentRecoverIndex) == null || p.splice(
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 $ = await e(m, {
795
- parser: Z
1084
+ let D = await e(E, {
1085
+ parser: de
796
1086
  });
797
- const [U, o] = t.__embeddedXmlFragmentRecoverIndex ?? [];
798
- U === void 0 ? u = void 0 : o === void 0 ? u += U : ($ = m.slice(U, o + 1), u += o + 1), v.push($);
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 l = X(
801
- v,
802
- r,
803
- b
1090
+ const a = q(
1091
+ y,
1092
+ i,
1093
+ m
804
1094
  );
805
- if (t.xmlWhitespaceSensitivity === "strict" || (c = t.preserveEmbeddedExteriorWhitespaces) != null && c.includes(i))
806
- return R([
1095
+ if (t.xmlWhitespaceSensitivity === "strict" || (d = t.preserveEmbeddedExteriorWhitespaces) != null && d.includes(s))
1096
+ return V([
807
1097
  "`",
808
- I,
809
- (x = t.noEmbeddedMultiLineIndentation) != null && x.includes(i) ? [R(l)] : Ee([R(l)]),
810
- w,
1098
+ b,
1099
+ (f = t.noEmbeddedMultiLineIndentation) != null && f.includes(s) ? [V(a)] : Ce([V(a)]),
1100
+ v,
811
1101
  "`"
812
1102
  ]);
813
- const d = I.length ? xe : V, y = w.length ? xe : V;
814
- return R([
1103
+ const c = b.length ? Ae : se, I = v.length ? Ae : se;
1104
+ return V([
815
1105
  "`",
816
- (g = t.noEmbeddedMultiLineIndentation) != null && g.includes(i) ? [d, R(l)] : Ee([d, R(l)]),
817
- y,
1106
+ (u = t.noEmbeddedMultiLineIndentation) != null && u.includes(s) ? [c, V(a)] : Ce([c, V(a)]),
1107
+ I,
818
1108
  "`"
819
1109
  ]);
820
- } catch (D) {
821
- throw console.error(D), D;
1110
+ } catch ($) {
1111
+ throw console.error($), $;
822
1112
  }
823
- }, Ot = [
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
- ], Tt = {
882
- [Z]: {
1170
+ ], Pn = R(de), kn = {
1171
+ [Pn]: {
883
1172
  category: "Global",
884
1173
  type: "string",
885
1174
  array: !0,
886
- default: [{ value: [...Ot] }],
887
- description: "Specify embedded XML languages. This requires @prettier/plugin-xml"
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
- }, Ut = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1186
+ }, Rn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
898
1187
  __proto__: null,
899
- embeddedLanguage: Z,
900
- embedder: St,
901
- options: Tt,
902
- parser: Dt
903
- }, Symbol.toStringTag, { value: "Module" })), Ue = [], Le = {}, qe = {}, Pe = {}, Lt = /* @__PURE__ */ Object.assign({
904
- "./es/index.ts": et,
905
- "./html/index.ts": rt,
906
- "./noop/index.ts": at,
907
- "./php/index.ts": ut,
908
- "./sql/index.ts": bt,
909
- "./ts/index.ts": vt,
910
- "./xml/index.ts": Ut
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(Lt).forEach(
913
- ({ embeddedLanguage: e, parser: n, embedder: s, options: t }) => {
914
- Ye(Ue, e, J), n && (Le[e] = n), s && (qe[e] = s), Object.assign(Pe, t);
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 Vt = {
1210
+ const Kn = {
918
1211
  // parsers from internal
919
- ...Me.parsers,
920
- ...je.parsers,
921
- ...Be.parsers,
922
- ...Fe.parsers,
923
- ...Ne.parsers,
1212
+ ...rt.parsers,
1213
+ ...it.parsers,
1214
+ ...ot.parsers,
1215
+ ...at.parsers,
1216
+ ...dt.parsers,
924
1217
  // parsers from this plugin
925
- ...Le
926
- }, { estree: G } = Re, qt = function(e, n) {
1218
+ ...tt
1219
+ }, { estree: J } = ct, jn = function(e, n) {
927
1220
  var t;
928
- const { node: s } = e;
929
- if (s.type !== "TemplateLiteral" || s.quasis.some(({ value: { cooked: i } }) => i === null))
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 i of Ue) {
932
- const a = n[i];
933
- if (!a)
1224
+ for (const s of et) {
1225
+ const o = n[R(s)];
1226
+ if (!o)
934
1227
  continue;
935
- const h = Pt(
1228
+ const h = Nn(
936
1229
  e,
937
- a,
1230
+ o,
938
1231
  n.noEmbeddedIdentificationByComment ?? []
939
- ) ?? Mt(
1232
+ ) ?? qn(
940
1233
  e,
941
- a,
1234
+ o,
942
1235
  n.noEmbeddedIdentificationByTag ?? []
943
1236
  );
944
1237
  if (h === void 0)
945
1238
  continue;
946
- const p = qe[i];
947
- if (!p)
1239
+ const g = nt[s];
1240
+ if (!g)
948
1241
  return null;
949
- const c = e.node;
950
- return c.quasis.length === 1 && c.quasis[0].value.raw.trim() === "" ? "``" : async (...x) => {
951
- const g = await p(...x, h, a);
952
- return M.label(
953
- { embed: !0, ...g.label },
954
- g
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 = G.embed) == null ? void 0 : t.call(G, e, n)) ?? null;
1251
+ return ((t = J.embed) == null ? void 0 : t.call(J, e, n)) ?? null;
959
1252
  };
960
- function Pt({ node: e, parent: n }, s, t) {
961
- if (s.length === 0 || e.type !== "TemplateLiteral")
1253
+ function Nn({ node: e, parent: n }, r, t) {
1254
+ if (r.length === 0 || e.type !== "TemplateLiteral")
962
1255
  return;
963
- const i = e.comments ?? (n == null ? void 0 : n.comments);
964
- if (!i)
1256
+ const s = e.comments ?? (n == null ? void 0 : n.comments);
1257
+ if (!s)
965
1258
  return;
966
- const a = i[i.length - 1];
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(a.type) || !a.leading)) {
975
- for (const h of s)
976
- if (` ${h} ` === a.value && !t.includes(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 Mt({ node: e, parent: n }, s, t) {
981
- if (s.length !== 0 && !(e.type !== "TemplateLiteral" || (n == null ? void 0 : n.type) !== "TaggedTemplateExpression" || n.tag.type !== "Identifier")) {
982
- for (const i of s)
983
- if (n.tag.name === i && !t.includes(i))
984
- return i;
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 Yt = {
1280
+ const Zn = {
988
1281
  estree: {
989
- ...G,
990
- embed: qt
1282
+ ...J,
1283
+ embed: jn
991
1284
  }
992
- }, jt = "noEmbeddedIdentificationByComment", Bt = "noEmbeddedIdentificationByTag", Ft = "preserveEmbeddedExteriorWhitespaces", Nt = "noEmbeddedMultiLineIndentation", Qt = {
993
- ...Pe,
994
- [jt]: {
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
- [Bt]: {
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
- [Ft]: {
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
- [Nt]: {
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
- qe as embeddedEmbedders,
1025
- Ue as embeddedLanguages,
1026
- Pe as embeddedOptions,
1027
- Le as embeddedParsers,
1028
- Qt as options,
1029
- Vt as parsers,
1030
- Yt as printers
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
  };