eddyter 1.3.61 → 1.3.63
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/dist/babel-B9hn44Wo.js +7168 -0
- package/dist/estree-CocPn_Md.js +4251 -0
- package/dist/html-CxCicOef.js +2638 -0
- package/dist/{html2pdf.bundle-BP8K5ERw.js → html2pdf.bundle-Bc2h6DHT.js} +1 -1
- package/dist/{html2pdf.bundle.min-BrDn1HSi.js → html2pdf.bundle.min-BvakEXhX.js} +1 -1
- package/dist/{index-CnBHpreC.js → index-B0VTEqfr.js} +1 -1
- package/dist/{index-DnHnFalw.js → index-C2a6-XFM.js} +1 -1
- package/dist/{index-CFq39nnT.js → index-DoJIKSPF.js} +370 -373
- package/dist/index.js +1 -1
- package/dist/markdown-BUjgWFLu.js +3150 -0
- package/dist/postcss-CGIcwj_g.js +4717 -0
- package/dist/standalone-C0qguT38.js +2211 -0
- package/dist/typescript-BM7wk6k-.js +12922 -0
- package/package.json +1 -1
- package/dist/babel-19rkKi7e.js +0 -7157
- package/dist/estree-DmlwiAu4.js +0 -4453
- package/dist/html-DtcgJGeD.js +0 -2760
- package/dist/markdown-C2JcxpgA.js +0 -3163
- package/dist/postcss-Banlrd6S.js +0 -4703
- package/dist/standalone-JqHlnZSs.js +0 -2429
- package/dist/typescript-D_phonMq.js +0 -12929
- /package/dist/assets/{index.css → style.css} +0 -0
|
@@ -0,0 +1,4717 @@
|
|
|
1
|
+
var Kr = Object.create, wt = Object.defineProperty, Xr = Object.getOwnPropertyDescriptor, Yr = Object.getOwnPropertyNames, es = Object.getPrototypeOf, ts = Object.prototype.hasOwnProperty, E = (e, s) => () => (s || e((s = { exports: {} }).exports, s), s.exports), Qt = (e, s) => {
|
|
2
|
+
for (var n in s) wt(e, n, { get: s[n], enumerable: !0 });
|
|
3
|
+
}, rs = (e, s, n, o) => {
|
|
4
|
+
if (s && typeof s == "object" || typeof s == "function") for (let c of Yr(s)) !ts.call(e, c) && c !== n && wt(e, c, { get: () => s[c], enumerable: !(o = Xr(s, c)) || o.enumerable });
|
|
5
|
+
return e;
|
|
6
|
+
}, we = (e, s, n) => (n = e != null ? Kr(es(e)) : {}, rs(wt(n, "default", { value: e, enumerable: !0 }), e)), ss = E((e, s) => {
|
|
7
|
+
var n = String, o = function() {
|
|
8
|
+
return { isColorSupported: !1, reset: n, bold: n, dim: n, italic: n, underline: n, inverse: n, hidden: n, strikethrough: n, black: n, red: n, green: n, yellow: n, blue: n, magenta: n, cyan: n, white: n, gray: n, bgBlack: n, bgRed: n, bgGreen: n, bgYellow: n, bgBlue: n, bgMagenta: n, bgCyan: n, bgWhite: n, blackBright: n, redBright: n, greenBright: n, yellowBright: n, blueBright: n, magentaBright: n, cyanBright: n, whiteBright: n, bgBlackBright: n, bgRedBright: n, bgGreenBright: n, bgYellowBright: n, bgBlueBright: n, bgMagentaBright: n, bgCyanBright: n, bgWhiteBright: n };
|
|
9
|
+
};
|
|
10
|
+
s.exports = o(), s.exports.createColors = o;
|
|
11
|
+
}), Zt = E(() => {
|
|
12
|
+
}), bt = E((e, s) => {
|
|
13
|
+
var n = ss(), o = Zt(), c = class Kt extends Error {
|
|
14
|
+
constructor(f, u, m, p, r, t) {
|
|
15
|
+
super(f), this.name = "CssSyntaxError", this.reason = f, r && (this.file = r), p && (this.source = p), t && (this.plugin = t), typeof u < "u" && typeof m < "u" && (typeof u == "number" ? (this.line = u, this.column = m) : (this.line = u.line, this.column = u.column, this.endLine = m.line, this.endColumn = m.column)), this.setMessage(), Error.captureStackTrace && Error.captureStackTrace(this, Kt);
|
|
16
|
+
}
|
|
17
|
+
setMessage() {
|
|
18
|
+
this.message = this.plugin ? this.plugin + ": " : "", this.message += this.file ? this.file : "<css input>", typeof this.line < "u" && (this.message += ":" + this.line + ":" + this.column), this.message += ": " + this.reason;
|
|
19
|
+
}
|
|
20
|
+
showSourceCode(f) {
|
|
21
|
+
if (!this.source) return "";
|
|
22
|
+
let u = this.source;
|
|
23
|
+
f == null && (f = n.isColorSupported);
|
|
24
|
+
let m = (l) => l, p = (l) => l, r = (l) => l;
|
|
25
|
+
if (f) {
|
|
26
|
+
let { bold: l, gray: b, red: y } = n.createColors(!0);
|
|
27
|
+
p = (v) => l(y(v)), m = (v) => b(v), o && (r = (v) => o(v));
|
|
28
|
+
}
|
|
29
|
+
let t = u.split(/\r?\n/), h = Math.max(this.line - 3, 0), a = Math.min(this.line + 2, t.length), d = String(a).length;
|
|
30
|
+
return t.slice(h, a).map((l, b) => {
|
|
31
|
+
let y = h + 1 + b, v = " " + (" " + y).slice(-d) + " | ";
|
|
32
|
+
if (y === this.line) {
|
|
33
|
+
if (l.length > 160) {
|
|
34
|
+
let k = 20, w = Math.max(0, this.column - k), x = Math.max(this.column + k, this.endColumn + k), O = l.slice(w, x), T = m(v.replace(/\d/g, " ")) + l.slice(0, Math.min(this.column - 1, k - 1)).replace(/[^\t]/g, " ");
|
|
35
|
+
return p(">") + m(v) + r(O) + `
|
|
36
|
+
` + T + p("^");
|
|
37
|
+
}
|
|
38
|
+
let g = m(v.replace(/\d/g, " ")) + l.slice(0, this.column - 1).replace(/[^\t]/g, " ");
|
|
39
|
+
return p(">") + m(v) + r(l) + `
|
|
40
|
+
` + g + p("^");
|
|
41
|
+
}
|
|
42
|
+
return " " + m(v) + r(l);
|
|
43
|
+
}).join(`
|
|
44
|
+
`);
|
|
45
|
+
}
|
|
46
|
+
toString() {
|
|
47
|
+
let f = this.showSourceCode();
|
|
48
|
+
return f && (f = `
|
|
49
|
+
|
|
50
|
+
` + f + `
|
|
51
|
+
`), this.name + ": " + this.message + f;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
s.exports = c, c.default = c;
|
|
55
|
+
}), xt = E((e, s) => {
|
|
56
|
+
var n = { after: `
|
|
57
|
+
`, beforeClose: `
|
|
58
|
+
`, beforeComment: `
|
|
59
|
+
`, beforeDecl: `
|
|
60
|
+
`, beforeOpen: " ", beforeRule: `
|
|
61
|
+
`, colon: ": ", commentLeft: " ", commentRight: " ", emptyBody: "", indent: " ", semicolon: !1 };
|
|
62
|
+
function o(i) {
|
|
63
|
+
return i[0].toUpperCase() + i.slice(1);
|
|
64
|
+
}
|
|
65
|
+
var c = class {
|
|
66
|
+
constructor(i) {
|
|
67
|
+
this.builder = i;
|
|
68
|
+
}
|
|
69
|
+
atrule(i, f) {
|
|
70
|
+
let u = "@" + i.name, m = i.params ? this.rawValue(i, "params") : "";
|
|
71
|
+
if (typeof i.raws.afterName < "u" ? u += i.raws.afterName : m && (u += " "), i.nodes) this.block(i, u + m);
|
|
72
|
+
else {
|
|
73
|
+
let p = (i.raws.between || "") + (f ? ";" : "");
|
|
74
|
+
this.builder(u + m + p, i);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
beforeAfter(i, f) {
|
|
78
|
+
let u;
|
|
79
|
+
i.type === "decl" ? u = this.raw(i, null, "beforeDecl") : i.type === "comment" ? u = this.raw(i, null, "beforeComment") : f === "before" ? u = this.raw(i, null, "beforeRule") : u = this.raw(i, null, "beforeClose");
|
|
80
|
+
let m = i.parent, p = 0;
|
|
81
|
+
for (; m && m.type !== "root"; ) p += 1, m = m.parent;
|
|
82
|
+
if (u.includes(`
|
|
83
|
+
`)) {
|
|
84
|
+
let r = this.raw(i, null, "indent");
|
|
85
|
+
if (r.length) for (let t = 0; t < p; t++) u += r;
|
|
86
|
+
}
|
|
87
|
+
return u;
|
|
88
|
+
}
|
|
89
|
+
block(i, f) {
|
|
90
|
+
let u = this.raw(i, "between", "beforeOpen");
|
|
91
|
+
this.builder(f + u + "{", i, "start");
|
|
92
|
+
let m;
|
|
93
|
+
i.nodes && i.nodes.length ? (this.body(i), m = this.raw(i, "after")) : m = this.raw(i, "after", "emptyBody"), m && this.builder(m), this.builder("}", i, "end");
|
|
94
|
+
}
|
|
95
|
+
body(i) {
|
|
96
|
+
let f = i.nodes.length - 1;
|
|
97
|
+
for (; f > 0 && i.nodes[f].type === "comment"; ) f -= 1;
|
|
98
|
+
let u = this.raw(i, "semicolon");
|
|
99
|
+
for (let m = 0; m < i.nodes.length; m++) {
|
|
100
|
+
let p = i.nodes[m], r = this.raw(p, "before");
|
|
101
|
+
r && this.builder(r), this.stringify(p, f !== m || u);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
comment(i) {
|
|
105
|
+
let f = this.raw(i, "left", "commentLeft"), u = this.raw(i, "right", "commentRight");
|
|
106
|
+
this.builder("/*" + f + i.text + u + "*/", i);
|
|
107
|
+
}
|
|
108
|
+
decl(i, f) {
|
|
109
|
+
let u = this.raw(i, "between", "colon"), m = i.prop + u + this.rawValue(i, "value");
|
|
110
|
+
i.important && (m += i.raws.important || " !important"), f && (m += ";"), this.builder(m, i);
|
|
111
|
+
}
|
|
112
|
+
document(i) {
|
|
113
|
+
this.body(i);
|
|
114
|
+
}
|
|
115
|
+
raw(i, f, u) {
|
|
116
|
+
let m;
|
|
117
|
+
if (u || (u = f), f && (m = i.raws[f], typeof m < "u")) return m;
|
|
118
|
+
let p = i.parent;
|
|
119
|
+
if (u === "before" && (!p || p.type === "root" && p.first === i || p && p.type === "document")) return "";
|
|
120
|
+
if (!p) return n[u];
|
|
121
|
+
let r = i.root();
|
|
122
|
+
if (r.rawCache || (r.rawCache = {}), typeof r.rawCache[u] < "u") return r.rawCache[u];
|
|
123
|
+
if (u === "before" || u === "after") return this.beforeAfter(i, u);
|
|
124
|
+
{
|
|
125
|
+
let t = "raw" + o(u);
|
|
126
|
+
this[t] ? m = this[t](r, i) : r.walk((h) => {
|
|
127
|
+
if (m = h.raws[f], typeof m < "u") return !1;
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
return typeof m > "u" && (m = n[u]), r.rawCache[u] = m, m;
|
|
131
|
+
}
|
|
132
|
+
rawBeforeClose(i) {
|
|
133
|
+
let f;
|
|
134
|
+
return i.walk((u) => {
|
|
135
|
+
if (u.nodes && u.nodes.length > 0 && typeof u.raws.after < "u") return f = u.raws.after, f.includes(`
|
|
136
|
+
`) && (f = f.replace(/[^\n]+$/, "")), !1;
|
|
137
|
+
}), f && (f = f.replace(/\S/g, "")), f;
|
|
138
|
+
}
|
|
139
|
+
rawBeforeComment(i, f) {
|
|
140
|
+
let u;
|
|
141
|
+
return i.walkComments((m) => {
|
|
142
|
+
if (typeof m.raws.before < "u") return u = m.raws.before, u.includes(`
|
|
143
|
+
`) && (u = u.replace(/[^\n]+$/, "")), !1;
|
|
144
|
+
}), typeof u > "u" ? u = this.raw(f, null, "beforeDecl") : u && (u = u.replace(/\S/g, "")), u;
|
|
145
|
+
}
|
|
146
|
+
rawBeforeDecl(i, f) {
|
|
147
|
+
let u;
|
|
148
|
+
return i.walkDecls((m) => {
|
|
149
|
+
if (typeof m.raws.before < "u") return u = m.raws.before, u.includes(`
|
|
150
|
+
`) && (u = u.replace(/[^\n]+$/, "")), !1;
|
|
151
|
+
}), typeof u > "u" ? u = this.raw(f, null, "beforeRule") : u && (u = u.replace(/\S/g, "")), u;
|
|
152
|
+
}
|
|
153
|
+
rawBeforeOpen(i) {
|
|
154
|
+
let f;
|
|
155
|
+
return i.walk((u) => {
|
|
156
|
+
if (u.type !== "decl" && (f = u.raws.between, typeof f < "u")) return !1;
|
|
157
|
+
}), f;
|
|
158
|
+
}
|
|
159
|
+
rawBeforeRule(i) {
|
|
160
|
+
let f;
|
|
161
|
+
return i.walk((u) => {
|
|
162
|
+
if (u.nodes && (u.parent !== i || i.first !== u) && typeof u.raws.before < "u") return f = u.raws.before, f.includes(`
|
|
163
|
+
`) && (f = f.replace(/[^\n]+$/, "")), !1;
|
|
164
|
+
}), f && (f = f.replace(/\S/g, "")), f;
|
|
165
|
+
}
|
|
166
|
+
rawColon(i) {
|
|
167
|
+
let f;
|
|
168
|
+
return i.walkDecls((u) => {
|
|
169
|
+
if (typeof u.raws.between < "u") return f = u.raws.between.replace(/[^\s:]/g, ""), !1;
|
|
170
|
+
}), f;
|
|
171
|
+
}
|
|
172
|
+
rawEmptyBody(i) {
|
|
173
|
+
let f;
|
|
174
|
+
return i.walk((u) => {
|
|
175
|
+
if (u.nodes && u.nodes.length === 0 && (f = u.raws.after, typeof f < "u")) return !1;
|
|
176
|
+
}), f;
|
|
177
|
+
}
|
|
178
|
+
rawIndent(i) {
|
|
179
|
+
if (i.raws.indent) return i.raws.indent;
|
|
180
|
+
let f;
|
|
181
|
+
return i.walk((u) => {
|
|
182
|
+
let m = u.parent;
|
|
183
|
+
if (m && m !== i && m.parent && m.parent === i && typeof u.raws.before < "u") {
|
|
184
|
+
let p = u.raws.before.split(`
|
|
185
|
+
`);
|
|
186
|
+
return f = p[p.length - 1], f = f.replace(/\S/g, ""), !1;
|
|
187
|
+
}
|
|
188
|
+
}), f;
|
|
189
|
+
}
|
|
190
|
+
rawSemicolon(i) {
|
|
191
|
+
let f;
|
|
192
|
+
return i.walk((u) => {
|
|
193
|
+
if (u.nodes && u.nodes.length && u.last.type === "decl" && (f = u.raws.semicolon, typeof f < "u")) return !1;
|
|
194
|
+
}), f;
|
|
195
|
+
}
|
|
196
|
+
rawValue(i, f) {
|
|
197
|
+
let u = i[f], m = i.raws[f];
|
|
198
|
+
return m && m.value === u ? m.raw : u;
|
|
199
|
+
}
|
|
200
|
+
root(i) {
|
|
201
|
+
this.body(i), i.raws.after && this.builder(i.raws.after);
|
|
202
|
+
}
|
|
203
|
+
rule(i) {
|
|
204
|
+
this.block(i, this.rawValue(i, "selector")), i.raws.ownSemicolon && this.builder(i.raws.ownSemicolon, i, "end");
|
|
205
|
+
}
|
|
206
|
+
stringify(i, f) {
|
|
207
|
+
if (!this[i.type]) throw new Error("Unknown AST node type " + i.type + ". Maybe you need to change PostCSS stringifier.");
|
|
208
|
+
this[i.type](i, f);
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
s.exports = c, c.default = c;
|
|
212
|
+
}), Ye = E((e, s) => {
|
|
213
|
+
var n = xt();
|
|
214
|
+
function o(c, i) {
|
|
215
|
+
new n(i).stringify(c);
|
|
216
|
+
}
|
|
217
|
+
s.exports = o, o.default = o;
|
|
218
|
+
}), kt = E((e, s) => {
|
|
219
|
+
s.exports.isClean = /* @__PURE__ */ Symbol("isClean"), s.exports.my = /* @__PURE__ */ Symbol("my");
|
|
220
|
+
}), et = E((e, s) => {
|
|
221
|
+
var n = bt(), o = xt(), c = Ye(), { isClean: i, my: f } = kt();
|
|
222
|
+
function u(r, t) {
|
|
223
|
+
let h = new r.constructor();
|
|
224
|
+
for (let a in r) {
|
|
225
|
+
if (!Object.prototype.hasOwnProperty.call(r, a) || a === "proxyCache") continue;
|
|
226
|
+
let d = r[a], l = typeof d;
|
|
227
|
+
a === "parent" && l === "object" ? t && (h[a] = t) : a === "source" ? h[a] = d : Array.isArray(d) ? h[a] = d.map((b) => u(b, h)) : (l === "object" && d !== null && (d = u(d)), h[a] = d);
|
|
228
|
+
}
|
|
229
|
+
return h;
|
|
230
|
+
}
|
|
231
|
+
function m(r, t) {
|
|
232
|
+
if (t && typeof t.offset < "u") return t.offset;
|
|
233
|
+
let h = 1, a = 1, d = 0;
|
|
234
|
+
for (let l = 0; l < r.length; l++) {
|
|
235
|
+
if (a === t.line && h === t.column) {
|
|
236
|
+
d = l;
|
|
237
|
+
break;
|
|
238
|
+
}
|
|
239
|
+
r[l] === `
|
|
240
|
+
` ? (h = 1, a += 1) : h += 1;
|
|
241
|
+
}
|
|
242
|
+
return d;
|
|
243
|
+
}
|
|
244
|
+
var p = class {
|
|
245
|
+
get proxyOf() {
|
|
246
|
+
return this;
|
|
247
|
+
}
|
|
248
|
+
constructor(r = {}) {
|
|
249
|
+
this.raws = {}, this[i] = !1, this[f] = !0;
|
|
250
|
+
for (let t in r) if (t === "nodes") {
|
|
251
|
+
this.nodes = [];
|
|
252
|
+
for (let h of r[t]) typeof h.clone == "function" ? this.append(h.clone()) : this.append(h);
|
|
253
|
+
} else this[t] = r[t];
|
|
254
|
+
}
|
|
255
|
+
addToError(r) {
|
|
256
|
+
if (r.postcssNode = this, r.stack && this.source && /\n\s{4}at /.test(r.stack)) {
|
|
257
|
+
let t = this.source;
|
|
258
|
+
r.stack = r.stack.replace(/\n\s{4}at /, `$&${t.input.from}:${t.start.line}:${t.start.column}$&`);
|
|
259
|
+
}
|
|
260
|
+
return r;
|
|
261
|
+
}
|
|
262
|
+
after(r) {
|
|
263
|
+
return this.parent.insertAfter(this, r), this;
|
|
264
|
+
}
|
|
265
|
+
assign(r = {}) {
|
|
266
|
+
for (let t in r) this[t] = r[t];
|
|
267
|
+
return this;
|
|
268
|
+
}
|
|
269
|
+
before(r) {
|
|
270
|
+
return this.parent.insertBefore(this, r), this;
|
|
271
|
+
}
|
|
272
|
+
cleanRaws(r) {
|
|
273
|
+
delete this.raws.before, delete this.raws.after, r || delete this.raws.between;
|
|
274
|
+
}
|
|
275
|
+
clone(r = {}) {
|
|
276
|
+
let t = u(this);
|
|
277
|
+
for (let h in r) t[h] = r[h];
|
|
278
|
+
return t;
|
|
279
|
+
}
|
|
280
|
+
cloneAfter(r = {}) {
|
|
281
|
+
let t = this.clone(r);
|
|
282
|
+
return this.parent.insertAfter(this, t), t;
|
|
283
|
+
}
|
|
284
|
+
cloneBefore(r = {}) {
|
|
285
|
+
let t = this.clone(r);
|
|
286
|
+
return this.parent.insertBefore(this, t), t;
|
|
287
|
+
}
|
|
288
|
+
error(r, t = {}) {
|
|
289
|
+
if (this.source) {
|
|
290
|
+
let { end: h, start: a } = this.rangeBy(t);
|
|
291
|
+
return this.source.input.error(r, { column: a.column, line: a.line }, { column: h.column, line: h.line }, t);
|
|
292
|
+
}
|
|
293
|
+
return new n(r);
|
|
294
|
+
}
|
|
295
|
+
getProxyProcessor() {
|
|
296
|
+
return { get(r, t) {
|
|
297
|
+
return t === "proxyOf" ? r : t === "root" ? () => r.root().toProxy() : r[t];
|
|
298
|
+
}, set(r, t, h) {
|
|
299
|
+
return r[t] === h || (r[t] = h, (t === "prop" || t === "value" || t === "name" || t === "params" || t === "important" || t === "text") && r.markDirty()), !0;
|
|
300
|
+
} };
|
|
301
|
+
}
|
|
302
|
+
markClean() {
|
|
303
|
+
this[i] = !0;
|
|
304
|
+
}
|
|
305
|
+
markDirty() {
|
|
306
|
+
if (this[i]) {
|
|
307
|
+
this[i] = !1;
|
|
308
|
+
let r = this;
|
|
309
|
+
for (; r = r.parent; ) r[i] = !1;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
next() {
|
|
313
|
+
if (!this.parent) return;
|
|
314
|
+
let r = this.parent.index(this);
|
|
315
|
+
return this.parent.nodes[r + 1];
|
|
316
|
+
}
|
|
317
|
+
positionBy(r = {}) {
|
|
318
|
+
let t = this.source.start;
|
|
319
|
+
if (r.index) t = this.positionInside(r.index);
|
|
320
|
+
else if (r.word) {
|
|
321
|
+
let h = "document" in this.source.input ? this.source.input.document : this.source.input.css, a = h.slice(m(h, this.source.start), m(h, this.source.end)).indexOf(r.word);
|
|
322
|
+
a !== -1 && (t = this.positionInside(a));
|
|
323
|
+
}
|
|
324
|
+
return t;
|
|
325
|
+
}
|
|
326
|
+
positionInside(r) {
|
|
327
|
+
let t = this.source.start.column, h = this.source.start.line, a = "document" in this.source.input ? this.source.input.document : this.source.input.css, d = m(a, this.source.start), l = d + r;
|
|
328
|
+
for (let b = d; b < l; b++) a[b] === `
|
|
329
|
+
` ? (t = 1, h += 1) : t += 1;
|
|
330
|
+
return { column: t, line: h, offset: l };
|
|
331
|
+
}
|
|
332
|
+
prev() {
|
|
333
|
+
if (!this.parent) return;
|
|
334
|
+
let r = this.parent.index(this);
|
|
335
|
+
return this.parent.nodes[r - 1];
|
|
336
|
+
}
|
|
337
|
+
rangeBy(r = {}) {
|
|
338
|
+
let t = "document" in this.source.input ? this.source.input.document : this.source.input.css, h = { column: this.source.start.column, line: this.source.start.line, offset: m(t, this.source.start) }, a = this.source.end ? { column: this.source.end.column + 1, line: this.source.end.line, offset: typeof this.source.end.offset == "number" ? this.source.end.offset : m(t, this.source.end) + 1 } : { column: h.column + 1, line: h.line, offset: h.offset + 1 };
|
|
339
|
+
if (r.word) {
|
|
340
|
+
let d = t.slice(m(t, this.source.start), m(t, this.source.end)).indexOf(r.word);
|
|
341
|
+
d !== -1 && (h = this.positionInside(d), a = this.positionInside(d + r.word.length));
|
|
342
|
+
} else r.start ? h = { column: r.start.column, line: r.start.line, offset: m(t, r.start) } : r.index && (h = this.positionInside(r.index)), r.end ? a = { column: r.end.column, line: r.end.line, offset: m(t, r.end) } : typeof r.endIndex == "number" ? a = this.positionInside(r.endIndex) : r.index && (a = this.positionInside(r.index + 1));
|
|
343
|
+
return (a.line < h.line || a.line === h.line && a.column <= h.column) && (a = { column: h.column + 1, line: h.line, offset: h.offset + 1 }), { end: a, start: h };
|
|
344
|
+
}
|
|
345
|
+
raw(r, t) {
|
|
346
|
+
return new o().raw(this, r, t);
|
|
347
|
+
}
|
|
348
|
+
remove() {
|
|
349
|
+
return this.parent && this.parent.removeChild(this), this.parent = void 0, this;
|
|
350
|
+
}
|
|
351
|
+
replaceWith(...r) {
|
|
352
|
+
if (this.parent) {
|
|
353
|
+
let t = this, h = !1;
|
|
354
|
+
for (let a of r) a === this ? h = !0 : h ? (this.parent.insertAfter(t, a), t = a) : this.parent.insertBefore(t, a);
|
|
355
|
+
h || this.remove();
|
|
356
|
+
}
|
|
357
|
+
return this;
|
|
358
|
+
}
|
|
359
|
+
root() {
|
|
360
|
+
let r = this;
|
|
361
|
+
for (; r.parent && r.parent.type !== "document"; ) r = r.parent;
|
|
362
|
+
return r;
|
|
363
|
+
}
|
|
364
|
+
toJSON(r, t) {
|
|
365
|
+
let h = {}, a = t == null;
|
|
366
|
+
t = t || /* @__PURE__ */ new Map();
|
|
367
|
+
let d = 0;
|
|
368
|
+
for (let l in this) {
|
|
369
|
+
if (!Object.prototype.hasOwnProperty.call(this, l) || l === "parent" || l === "proxyCache") continue;
|
|
370
|
+
let b = this[l];
|
|
371
|
+
if (Array.isArray(b)) h[l] = b.map((y) => typeof y == "object" && y.toJSON ? y.toJSON(null, t) : y);
|
|
372
|
+
else if (typeof b == "object" && b.toJSON) h[l] = b.toJSON(null, t);
|
|
373
|
+
else if (l === "source") {
|
|
374
|
+
if (b == null) continue;
|
|
375
|
+
let y = t.get(b.input);
|
|
376
|
+
y == null && (y = d, t.set(b.input, d), d++), h[l] = { end: b.end, inputId: y, start: b.start };
|
|
377
|
+
} else h[l] = b;
|
|
378
|
+
}
|
|
379
|
+
return a && (h.inputs = [...t.keys()].map((l) => l.toJSON())), h;
|
|
380
|
+
}
|
|
381
|
+
toProxy() {
|
|
382
|
+
return this.proxyCache || (this.proxyCache = new Proxy(this, this.getProxyProcessor())), this.proxyCache;
|
|
383
|
+
}
|
|
384
|
+
toString(r = c) {
|
|
385
|
+
r.stringify && (r = r.stringify);
|
|
386
|
+
let t = "";
|
|
387
|
+
return r(this, (h) => {
|
|
388
|
+
t += h;
|
|
389
|
+
}), t;
|
|
390
|
+
}
|
|
391
|
+
warn(r, t, h = {}) {
|
|
392
|
+
let a = { node: this };
|
|
393
|
+
for (let d in h) a[d] = h[d];
|
|
394
|
+
return r.warn(t, a);
|
|
395
|
+
}
|
|
396
|
+
};
|
|
397
|
+
s.exports = p, p.default = p;
|
|
398
|
+
}), Re = E((e, s) => {
|
|
399
|
+
var n = et(), o = class extends n {
|
|
400
|
+
constructor(c) {
|
|
401
|
+
super(c), this.type = "comment";
|
|
402
|
+
}
|
|
403
|
+
};
|
|
404
|
+
s.exports = o, o.default = o;
|
|
405
|
+
}), tt = E((e, s) => {
|
|
406
|
+
var n = et(), o = class extends n {
|
|
407
|
+
get variable() {
|
|
408
|
+
return this.prop.startsWith("--") || this.prop[0] === "$";
|
|
409
|
+
}
|
|
410
|
+
constructor(c) {
|
|
411
|
+
c && typeof c.value < "u" && typeof c.value != "string" && (c = { ...c, value: String(c.value) }), super(c), this.type = "decl";
|
|
412
|
+
}
|
|
413
|
+
};
|
|
414
|
+
s.exports = o, o.default = o;
|
|
415
|
+
}), ue = E((e, s) => {
|
|
416
|
+
var n = Re(), o = tt(), c = et(), { isClean: i, my: f } = kt(), u, m, p, r;
|
|
417
|
+
function t(d) {
|
|
418
|
+
return d.map((l) => (l.nodes && (l.nodes = t(l.nodes)), delete l.source, l));
|
|
419
|
+
}
|
|
420
|
+
function h(d) {
|
|
421
|
+
if (d[i] = !1, d.proxyOf.nodes) for (let l of d.proxyOf.nodes) h(l);
|
|
422
|
+
}
|
|
423
|
+
var a = class Xt extends c {
|
|
424
|
+
get first() {
|
|
425
|
+
if (this.proxyOf.nodes) return this.proxyOf.nodes[0];
|
|
426
|
+
}
|
|
427
|
+
get last() {
|
|
428
|
+
if (this.proxyOf.nodes) return this.proxyOf.nodes[this.proxyOf.nodes.length - 1];
|
|
429
|
+
}
|
|
430
|
+
append(...l) {
|
|
431
|
+
for (let b of l) {
|
|
432
|
+
let y = this.normalize(b, this.last);
|
|
433
|
+
for (let v of y) this.proxyOf.nodes.push(v);
|
|
434
|
+
}
|
|
435
|
+
return this.markDirty(), this;
|
|
436
|
+
}
|
|
437
|
+
cleanRaws(l) {
|
|
438
|
+
if (super.cleanRaws(l), this.nodes) for (let b of this.nodes) b.cleanRaws(l);
|
|
439
|
+
}
|
|
440
|
+
each(l) {
|
|
441
|
+
if (!this.proxyOf.nodes) return;
|
|
442
|
+
let b = this.getIterator(), y, v;
|
|
443
|
+
for (; this.indexes[b] < this.proxyOf.nodes.length && (y = this.indexes[b], v = l(this.proxyOf.nodes[y], y), v !== !1); ) this.indexes[b] += 1;
|
|
444
|
+
return delete this.indexes[b], v;
|
|
445
|
+
}
|
|
446
|
+
every(l) {
|
|
447
|
+
return this.nodes.every(l);
|
|
448
|
+
}
|
|
449
|
+
getIterator() {
|
|
450
|
+
this.lastEach || (this.lastEach = 0), this.indexes || (this.indexes = {}), this.lastEach += 1;
|
|
451
|
+
let l = this.lastEach;
|
|
452
|
+
return this.indexes[l] = 0, l;
|
|
453
|
+
}
|
|
454
|
+
getProxyProcessor() {
|
|
455
|
+
return { get(l, b) {
|
|
456
|
+
return b === "proxyOf" ? l : l[b] ? b === "each" || typeof b == "string" && b.startsWith("walk") ? (...y) => l[b](...y.map((v) => typeof v == "function" ? (g, k) => v(g.toProxy(), k) : v)) : b === "every" || b === "some" ? (y) => l[b]((v, ...g) => y(v.toProxy(), ...g)) : b === "root" ? () => l.root().toProxy() : b === "nodes" ? l.nodes.map((y) => y.toProxy()) : b === "first" || b === "last" ? l[b].toProxy() : l[b] : l[b];
|
|
457
|
+
}, set(l, b, y) {
|
|
458
|
+
return l[b] === y || (l[b] = y, (b === "name" || b === "params" || b === "selector") && l.markDirty()), !0;
|
|
459
|
+
} };
|
|
460
|
+
}
|
|
461
|
+
index(l) {
|
|
462
|
+
return typeof l == "number" ? l : (l.proxyOf && (l = l.proxyOf), this.proxyOf.nodes.indexOf(l));
|
|
463
|
+
}
|
|
464
|
+
insertAfter(l, b) {
|
|
465
|
+
let y = this.index(l), v = this.normalize(b, this.proxyOf.nodes[y]).reverse();
|
|
466
|
+
y = this.index(l);
|
|
467
|
+
for (let k of v) this.proxyOf.nodes.splice(y + 1, 0, k);
|
|
468
|
+
let g;
|
|
469
|
+
for (let k in this.indexes) g = this.indexes[k], y < g && (this.indexes[k] = g + v.length);
|
|
470
|
+
return this.markDirty(), this;
|
|
471
|
+
}
|
|
472
|
+
insertBefore(l, b) {
|
|
473
|
+
let y = this.index(l), v = y === 0 ? "prepend" : !1, g = this.normalize(b, this.proxyOf.nodes[y], v).reverse();
|
|
474
|
+
y = this.index(l);
|
|
475
|
+
for (let w of g) this.proxyOf.nodes.splice(y, 0, w);
|
|
476
|
+
let k;
|
|
477
|
+
for (let w in this.indexes) k = this.indexes[w], y <= k && (this.indexes[w] = k + g.length);
|
|
478
|
+
return this.markDirty(), this;
|
|
479
|
+
}
|
|
480
|
+
normalize(l, b) {
|
|
481
|
+
if (typeof l == "string") l = t(m(l).nodes);
|
|
482
|
+
else if (typeof l > "u") l = [];
|
|
483
|
+
else if (Array.isArray(l)) {
|
|
484
|
+
l = l.slice(0);
|
|
485
|
+
for (let y of l) y.parent && y.parent.removeChild(y, "ignore");
|
|
486
|
+
} else if (l.type === "root" && this.type !== "document") {
|
|
487
|
+
l = l.nodes.slice(0);
|
|
488
|
+
for (let y of l) y.parent && y.parent.removeChild(y, "ignore");
|
|
489
|
+
} else if (l.type) l = [l];
|
|
490
|
+
else if (l.prop) {
|
|
491
|
+
if (typeof l.value > "u") throw new Error("Value field is missed in node creation");
|
|
492
|
+
typeof l.value != "string" && (l.value = String(l.value)), l = [new o(l)];
|
|
493
|
+
} else if (l.selector || l.selectors) l = [new r(l)];
|
|
494
|
+
else if (l.name) l = [new u(l)];
|
|
495
|
+
else if (l.text) l = [new n(l)];
|
|
496
|
+
else throw new Error("Unknown node type in node creation");
|
|
497
|
+
return l.map((y) => (y[f] || Xt.rebuild(y), y = y.proxyOf, y.parent && y.parent.removeChild(y), y[i] && h(y), y.raws || (y.raws = {}), typeof y.raws.before > "u" && b && typeof b.raws.before < "u" && (y.raws.before = b.raws.before.replace(/\S/g, "")), y.parent = this.proxyOf, y));
|
|
498
|
+
}
|
|
499
|
+
prepend(...l) {
|
|
500
|
+
l = l.reverse();
|
|
501
|
+
for (let b of l) {
|
|
502
|
+
let y = this.normalize(b, this.first, "prepend").reverse();
|
|
503
|
+
for (let v of y) this.proxyOf.nodes.unshift(v);
|
|
504
|
+
for (let v in this.indexes) this.indexes[v] = this.indexes[v] + y.length;
|
|
505
|
+
}
|
|
506
|
+
return this.markDirty(), this;
|
|
507
|
+
}
|
|
508
|
+
push(l) {
|
|
509
|
+
return l.parent = this, this.proxyOf.nodes.push(l), this;
|
|
510
|
+
}
|
|
511
|
+
removeAll() {
|
|
512
|
+
for (let l of this.proxyOf.nodes) l.parent = void 0;
|
|
513
|
+
return this.proxyOf.nodes = [], this.markDirty(), this;
|
|
514
|
+
}
|
|
515
|
+
removeChild(l) {
|
|
516
|
+
l = this.index(l), this.proxyOf.nodes[l].parent = void 0, this.proxyOf.nodes.splice(l, 1);
|
|
517
|
+
let b;
|
|
518
|
+
for (let y in this.indexes) b = this.indexes[y], b >= l && (this.indexes[y] = b - 1);
|
|
519
|
+
return this.markDirty(), this;
|
|
520
|
+
}
|
|
521
|
+
replaceValues(l, b, y) {
|
|
522
|
+
return y || (y = b, b = {}), this.walkDecls((v) => {
|
|
523
|
+
b.props && !b.props.includes(v.prop) || b.fast && !v.value.includes(b.fast) || (v.value = v.value.replace(l, y));
|
|
524
|
+
}), this.markDirty(), this;
|
|
525
|
+
}
|
|
526
|
+
some(l) {
|
|
527
|
+
return this.nodes.some(l);
|
|
528
|
+
}
|
|
529
|
+
walk(l) {
|
|
530
|
+
return this.each((b, y) => {
|
|
531
|
+
let v;
|
|
532
|
+
try {
|
|
533
|
+
v = l(b, y);
|
|
534
|
+
} catch (g) {
|
|
535
|
+
throw b.addToError(g);
|
|
536
|
+
}
|
|
537
|
+
return v !== !1 && b.walk && (v = b.walk(l)), v;
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
walkAtRules(l, b) {
|
|
541
|
+
return b ? l instanceof RegExp ? this.walk((y, v) => {
|
|
542
|
+
if (y.type === "atrule" && l.test(y.name)) return b(y, v);
|
|
543
|
+
}) : this.walk((y, v) => {
|
|
544
|
+
if (y.type === "atrule" && y.name === l) return b(y, v);
|
|
545
|
+
}) : (b = l, this.walk((y, v) => {
|
|
546
|
+
if (y.type === "atrule") return b(y, v);
|
|
547
|
+
}));
|
|
548
|
+
}
|
|
549
|
+
walkComments(l) {
|
|
550
|
+
return this.walk((b, y) => {
|
|
551
|
+
if (b.type === "comment") return l(b, y);
|
|
552
|
+
});
|
|
553
|
+
}
|
|
554
|
+
walkDecls(l, b) {
|
|
555
|
+
return b ? l instanceof RegExp ? this.walk((y, v) => {
|
|
556
|
+
if (y.type === "decl" && l.test(y.prop)) return b(y, v);
|
|
557
|
+
}) : this.walk((y, v) => {
|
|
558
|
+
if (y.type === "decl" && y.prop === l) return b(y, v);
|
|
559
|
+
}) : (b = l, this.walk((y, v) => {
|
|
560
|
+
if (y.type === "decl") return b(y, v);
|
|
561
|
+
}));
|
|
562
|
+
}
|
|
563
|
+
walkRules(l, b) {
|
|
564
|
+
return b ? l instanceof RegExp ? this.walk((y, v) => {
|
|
565
|
+
if (y.type === "rule" && l.test(y.selector)) return b(y, v);
|
|
566
|
+
}) : this.walk((y, v) => {
|
|
567
|
+
if (y.type === "rule" && y.selector === l) return b(y, v);
|
|
568
|
+
}) : (b = l, this.walk((y, v) => {
|
|
569
|
+
if (y.type === "rule") return b(y, v);
|
|
570
|
+
}));
|
|
571
|
+
}
|
|
572
|
+
};
|
|
573
|
+
a.registerParse = (d) => {
|
|
574
|
+
m = d;
|
|
575
|
+
}, a.registerRule = (d) => {
|
|
576
|
+
r = d;
|
|
577
|
+
}, a.registerAtRule = (d) => {
|
|
578
|
+
u = d;
|
|
579
|
+
}, a.registerRoot = (d) => {
|
|
580
|
+
p = d;
|
|
581
|
+
}, s.exports = a, a.default = a, a.rebuild = (d) => {
|
|
582
|
+
d.type === "atrule" ? Object.setPrototypeOf(d, u.prototype) : d.type === "rule" ? Object.setPrototypeOf(d, r.prototype) : d.type === "decl" ? Object.setPrototypeOf(d, o.prototype) : d.type === "comment" ? Object.setPrototypeOf(d, n.prototype) : d.type === "root" && Object.setPrototypeOf(d, p.prototype), d[f] = !0, d.nodes && d.nodes.forEach((l) => {
|
|
583
|
+
a.rebuild(l);
|
|
584
|
+
});
|
|
585
|
+
};
|
|
586
|
+
}), ns = E((e, s) => {
|
|
587
|
+
var n = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", o = (i, f = 21) => (u = f) => {
|
|
588
|
+
let m = "", p = u | 0;
|
|
589
|
+
for (; p--; ) m += i[Math.random() * i.length | 0];
|
|
590
|
+
return m;
|
|
591
|
+
}, c = (i = 21) => {
|
|
592
|
+
let f = "", u = i | 0;
|
|
593
|
+
for (; u--; ) f += n[Math.random() * 64 | 0];
|
|
594
|
+
return f;
|
|
595
|
+
};
|
|
596
|
+
s.exports = { nanoid: c, customAlphabet: o };
|
|
597
|
+
}), os = E(() => {
|
|
598
|
+
}), Yt = E((e, s) => {
|
|
599
|
+
s.exports = class {
|
|
600
|
+
};
|
|
601
|
+
}), Ne = E((e, s) => {
|
|
602
|
+
var { nanoid: n } = ns(), { isAbsolute: o, resolve: c } = {}, { SourceMapConsumer: i, SourceMapGenerator: f } = os(), { fileURLToPath: u, pathToFileURL: m } = {}, p = bt(), r = Yt(), t = Zt(), h = /* @__PURE__ */ Symbol("lineToIndexCache"), a = !!(i && f), d = !!(c && o);
|
|
603
|
+
function l(y) {
|
|
604
|
+
if (y[h]) return y[h];
|
|
605
|
+
let v = y.css.split(`
|
|
606
|
+
`), g = new Array(v.length), k = 0;
|
|
607
|
+
for (let w = 0, x = v.length; w < x; w++) g[w] = k, k += v[w].length + 1;
|
|
608
|
+
return y[h] = g, g;
|
|
609
|
+
}
|
|
610
|
+
var b = class {
|
|
611
|
+
get from() {
|
|
612
|
+
return this.file || this.id;
|
|
613
|
+
}
|
|
614
|
+
constructor(y, v = {}) {
|
|
615
|
+
if (y === null || typeof y > "u" || typeof y == "object" && !y.toString) throw new Error(`PostCSS received ${y} instead of CSS string`);
|
|
616
|
+
if (this.css = y.toString(), this.css[0] === "\uFEFF" || this.css[0] === "" ? (this.hasBOM = !0, this.css = this.css.slice(1)) : this.hasBOM = !1, this.document = this.css, v.document && (this.document = v.document.toString()), v.from && (!d || /^\w+:\/\//.test(v.from) || o(v.from) ? this.file = v.from : this.file = c(v.from)), d && a) {
|
|
617
|
+
let g = new r(this.css, v);
|
|
618
|
+
if (g.text) {
|
|
619
|
+
this.map = g;
|
|
620
|
+
let k = g.consumer().file;
|
|
621
|
+
!this.file && k && (this.file = this.mapResolve(k));
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
this.file || (this.id = "<input css " + n(6) + ">"), this.map && (this.map.file = this.from);
|
|
625
|
+
}
|
|
626
|
+
error(y, v, g, k = {}) {
|
|
627
|
+
let w, x, O, T, _;
|
|
628
|
+
if (v && typeof v == "object") {
|
|
629
|
+
let I = v, N = g;
|
|
630
|
+
if (typeof I.offset == "number") {
|
|
631
|
+
T = I.offset;
|
|
632
|
+
let R = this.fromOffset(T);
|
|
633
|
+
v = R.line, g = R.col;
|
|
634
|
+
} else v = I.line, g = I.column, T = this.fromLineAndColumn(v, g);
|
|
635
|
+
if (typeof N.offset == "number") {
|
|
636
|
+
O = N.offset;
|
|
637
|
+
let R = this.fromOffset(O);
|
|
638
|
+
x = R.line, w = R.col;
|
|
639
|
+
} else x = N.line, w = N.column, O = this.fromLineAndColumn(N.line, N.column);
|
|
640
|
+
} else if (g) T = this.fromLineAndColumn(v, g);
|
|
641
|
+
else {
|
|
642
|
+
T = v;
|
|
643
|
+
let I = this.fromOffset(T);
|
|
644
|
+
v = I.line, g = I.col;
|
|
645
|
+
}
|
|
646
|
+
let A = this.origin(v, g, x, w);
|
|
647
|
+
return A ? _ = new p(y, A.endLine === void 0 ? A.line : { column: A.column, line: A.line }, A.endLine === void 0 ? A.column : { column: A.endColumn, line: A.endLine }, A.source, A.file, k.plugin) : _ = new p(y, x === void 0 ? v : { column: g, line: v }, x === void 0 ? g : { column: w, line: x }, this.css, this.file, k.plugin), _.input = { column: g, endColumn: w, endLine: x, endOffset: O, line: v, offset: T, source: this.css }, this.file && (m && (_.input.url = m(this.file).toString()), _.input.file = this.file), _;
|
|
648
|
+
}
|
|
649
|
+
fromLineAndColumn(y, v) {
|
|
650
|
+
return l(this)[y - 1] + v - 1;
|
|
651
|
+
}
|
|
652
|
+
fromOffset(y) {
|
|
653
|
+
let v = l(this), g = v[v.length - 1], k = 0;
|
|
654
|
+
if (y >= g) k = v.length - 1;
|
|
655
|
+
else {
|
|
656
|
+
let w = v.length - 2, x;
|
|
657
|
+
for (; k < w; ) if (x = k + (w - k >> 1), y < v[x]) w = x - 1;
|
|
658
|
+
else if (y >= v[x + 1]) k = x + 1;
|
|
659
|
+
else {
|
|
660
|
+
k = x;
|
|
661
|
+
break;
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
return { col: y - v[k] + 1, line: k + 1 };
|
|
665
|
+
}
|
|
666
|
+
mapResolve(y) {
|
|
667
|
+
return /^\w+:\/\//.test(y) ? y : c(this.map.consumer().sourceRoot || this.map.root || ".", y);
|
|
668
|
+
}
|
|
669
|
+
origin(y, v, g, k) {
|
|
670
|
+
if (!this.map) return !1;
|
|
671
|
+
let w = this.map.consumer(), x = w.originalPositionFor({ column: v, line: y });
|
|
672
|
+
if (!x.source) return !1;
|
|
673
|
+
let O;
|
|
674
|
+
typeof g == "number" && (O = w.originalPositionFor({ column: k, line: g }));
|
|
675
|
+
let T;
|
|
676
|
+
o(x.source) ? T = m(x.source) : T = new URL(x.source, this.map.consumer().sourceRoot || m(this.map.mapFile));
|
|
677
|
+
let _ = { column: x.column, endColumn: O && O.column, endLine: O && O.line, line: x.line, url: T.toString() };
|
|
678
|
+
if (T.protocol === "file:") if (u) _.file = u(T);
|
|
679
|
+
else throw new Error("file: protocol is not available in this PostCSS build");
|
|
680
|
+
let A = w.sourceContentFor(x.source);
|
|
681
|
+
return A && (_.source = A), _;
|
|
682
|
+
}
|
|
683
|
+
toJSON() {
|
|
684
|
+
let y = {};
|
|
685
|
+
for (let v of ["hasBOM", "css", "file", "id"]) this[v] != null && (y[v] = this[v]);
|
|
686
|
+
return this.map && (y.map = { ...this.map }, y.map.consumerCache && (y.map.consumerCache = void 0)), y;
|
|
687
|
+
}
|
|
688
|
+
};
|
|
689
|
+
s.exports = b, b.default = b, t && t.registerInput && t.registerInput(b);
|
|
690
|
+
}), Ot = E((e, s) => {
|
|
691
|
+
var n = ue(), o = class extends n {
|
|
692
|
+
constructor(c) {
|
|
693
|
+
super(c), this.type = "atrule";
|
|
694
|
+
}
|
|
695
|
+
append(...c) {
|
|
696
|
+
return this.proxyOf.nodes || (this.nodes = []), super.append(...c);
|
|
697
|
+
}
|
|
698
|
+
prepend(...c) {
|
|
699
|
+
return this.proxyOf.nodes || (this.nodes = []), super.prepend(...c);
|
|
700
|
+
}
|
|
701
|
+
};
|
|
702
|
+
s.exports = o, o.default = o, n.registerAtRule(o);
|
|
703
|
+
}), Le = E((e, s) => {
|
|
704
|
+
var n = ue(), o, c, i = class extends n {
|
|
705
|
+
constructor(f) {
|
|
706
|
+
super(f), this.type = "root", this.nodes || (this.nodes = []);
|
|
707
|
+
}
|
|
708
|
+
normalize(f, u, m) {
|
|
709
|
+
let p = super.normalize(f);
|
|
710
|
+
if (u) {
|
|
711
|
+
if (m === "prepend") this.nodes.length > 1 ? u.raws.before = this.nodes[1].raws.before : delete u.raws.before;
|
|
712
|
+
else if (this.first !== u) for (let r of p) r.raws.before = u.raws.before;
|
|
713
|
+
}
|
|
714
|
+
return p;
|
|
715
|
+
}
|
|
716
|
+
removeChild(f, u) {
|
|
717
|
+
let m = this.index(f);
|
|
718
|
+
return !u && m === 0 && this.nodes.length > 1 && (this.nodes[1].raws.before = this.nodes[m].raws.before), super.removeChild(f);
|
|
719
|
+
}
|
|
720
|
+
toResult(f = {}) {
|
|
721
|
+
return new o(new c(), this, f).stringify();
|
|
722
|
+
}
|
|
723
|
+
};
|
|
724
|
+
i.registerLazyResult = (f) => {
|
|
725
|
+
o = f;
|
|
726
|
+
}, i.registerProcessor = (f) => {
|
|
727
|
+
c = f;
|
|
728
|
+
}, s.exports = i, i.default = i, n.registerRoot(i);
|
|
729
|
+
}), er = E((e, s) => {
|
|
730
|
+
var n = { comma(o) {
|
|
731
|
+
return n.split(o, [","], !0);
|
|
732
|
+
}, space(o) {
|
|
733
|
+
let c = [" ", `
|
|
734
|
+
`, " "];
|
|
735
|
+
return n.split(o, c);
|
|
736
|
+
}, split(o, c, i) {
|
|
737
|
+
let f = [], u = "", m = !1, p = 0, r = !1, t = "", h = !1;
|
|
738
|
+
for (let a of o) h ? h = !1 : a === "\\" ? h = !0 : r ? a === t && (r = !1) : a === '"' || a === "'" ? (r = !0, t = a) : a === "(" ? p += 1 : a === ")" ? p > 0 && (p -= 1) : p === 0 && c.includes(a) && (m = !0), m ? (u !== "" && f.push(u.trim()), u = "", m = !1) : u += a;
|
|
739
|
+
return (i || u !== "") && f.push(u.trim()), f;
|
|
740
|
+
} };
|
|
741
|
+
s.exports = n, n.default = n;
|
|
742
|
+
}), Tt = E((e, s) => {
|
|
743
|
+
var n = ue(), o = er(), c = class extends n {
|
|
744
|
+
get selectors() {
|
|
745
|
+
return o.comma(this.selector);
|
|
746
|
+
}
|
|
747
|
+
set selectors(i) {
|
|
748
|
+
let f = this.selector ? this.selector.match(/,\s*/) : null, u = f ? f[0] : "," + this.raw("between", "beforeOpen");
|
|
749
|
+
this.selector = i.join(u);
|
|
750
|
+
}
|
|
751
|
+
constructor(i) {
|
|
752
|
+
super(i), this.type = "rule", this.nodes || (this.nodes = []);
|
|
753
|
+
}
|
|
754
|
+
};
|
|
755
|
+
s.exports = c, c.default = c, n.registerRule(c);
|
|
756
|
+
}), Ct = E((e, s) => {
|
|
757
|
+
var n = /[\t\n\f\r "#'()/;[\\\]{}]/g, o = /[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g, c = /.[\r\n"'(/\\]/, i = /[\da-f]/i;
|
|
758
|
+
s.exports = function(f, u = {}) {
|
|
759
|
+
let m = f.css.valueOf(), p = u.ignoreErrors, r, t, h, a, d, l, b, y, v, g, k = m.length, w = 0, x = [], O = [];
|
|
760
|
+
function T() {
|
|
761
|
+
return w;
|
|
762
|
+
}
|
|
763
|
+
function _(R) {
|
|
764
|
+
throw f.error("Unclosed " + R, w);
|
|
765
|
+
}
|
|
766
|
+
function A() {
|
|
767
|
+
return O.length === 0 && w >= k;
|
|
768
|
+
}
|
|
769
|
+
function I(R) {
|
|
770
|
+
if (O.length) return O.pop();
|
|
771
|
+
if (w >= k) return;
|
|
772
|
+
let $ = R ? R.ignoreUnclosed : !1;
|
|
773
|
+
switch (r = m.charCodeAt(w), r) {
|
|
774
|
+
case 10:
|
|
775
|
+
case 32:
|
|
776
|
+
case 9:
|
|
777
|
+
case 13:
|
|
778
|
+
case 12: {
|
|
779
|
+
a = w;
|
|
780
|
+
do
|
|
781
|
+
a += 1, r = m.charCodeAt(a);
|
|
782
|
+
while (r === 32 || r === 10 || r === 9 || r === 13 || r === 12);
|
|
783
|
+
l = ["space", m.slice(w, a)], w = a - 1;
|
|
784
|
+
break;
|
|
785
|
+
}
|
|
786
|
+
case 91:
|
|
787
|
+
case 93:
|
|
788
|
+
case 123:
|
|
789
|
+
case 125:
|
|
790
|
+
case 58:
|
|
791
|
+
case 59:
|
|
792
|
+
case 41: {
|
|
793
|
+
let M = String.fromCharCode(r);
|
|
794
|
+
l = [M, M, w];
|
|
795
|
+
break;
|
|
796
|
+
}
|
|
797
|
+
case 40: {
|
|
798
|
+
if (g = x.length ? x.pop()[1] : "", v = m.charCodeAt(w + 1), g === "url" && v !== 39 && v !== 34 && v !== 32 && v !== 10 && v !== 9 && v !== 12 && v !== 13) {
|
|
799
|
+
a = w;
|
|
800
|
+
do {
|
|
801
|
+
if (b = !1, a = m.indexOf(")", a + 1), a === -1) if (p || $) {
|
|
802
|
+
a = w;
|
|
803
|
+
break;
|
|
804
|
+
} else _("bracket");
|
|
805
|
+
for (y = a; m.charCodeAt(y - 1) === 92; ) y -= 1, b = !b;
|
|
806
|
+
} while (b);
|
|
807
|
+
l = ["brackets", m.slice(w, a + 1), w, a], w = a;
|
|
808
|
+
} else a = m.indexOf(")", w + 1), t = m.slice(w, a + 1), a === -1 || c.test(t) ? l = ["(", "(", w] : (l = ["brackets", t, w, a], w = a);
|
|
809
|
+
break;
|
|
810
|
+
}
|
|
811
|
+
case 39:
|
|
812
|
+
case 34: {
|
|
813
|
+
d = r === 39 ? "'" : '"', a = w;
|
|
814
|
+
do {
|
|
815
|
+
if (b = !1, a = m.indexOf(d, a + 1), a === -1) if (p || $) {
|
|
816
|
+
a = w + 1;
|
|
817
|
+
break;
|
|
818
|
+
} else _("string");
|
|
819
|
+
for (y = a; m.charCodeAt(y - 1) === 92; ) y -= 1, b = !b;
|
|
820
|
+
} while (b);
|
|
821
|
+
l = ["string", m.slice(w, a + 1), w, a], w = a;
|
|
822
|
+
break;
|
|
823
|
+
}
|
|
824
|
+
case 64: {
|
|
825
|
+
n.lastIndex = w + 1, n.test(m), n.lastIndex === 0 ? a = m.length - 1 : a = n.lastIndex - 2, l = ["at-word", m.slice(w, a + 1), w, a], w = a;
|
|
826
|
+
break;
|
|
827
|
+
}
|
|
828
|
+
case 92: {
|
|
829
|
+
for (a = w, h = !0; m.charCodeAt(a + 1) === 92; ) a += 1, h = !h;
|
|
830
|
+
if (r = m.charCodeAt(a + 1), h && r !== 47 && r !== 32 && r !== 10 && r !== 9 && r !== 13 && r !== 12 && (a += 1, i.test(m.charAt(a)))) {
|
|
831
|
+
for (; i.test(m.charAt(a + 1)); ) a += 1;
|
|
832
|
+
m.charCodeAt(a + 1) === 32 && (a += 1);
|
|
833
|
+
}
|
|
834
|
+
l = ["word", m.slice(w, a + 1), w, a], w = a;
|
|
835
|
+
break;
|
|
836
|
+
}
|
|
837
|
+
default: {
|
|
838
|
+
r === 47 && m.charCodeAt(w + 1) === 42 ? (a = m.indexOf("*/", w + 2) + 1, a === 0 && (p || $ ? a = m.length : _("comment")), l = ["comment", m.slice(w, a + 1), w, a], w = a) : (o.lastIndex = w + 1, o.test(m), o.lastIndex === 0 ? a = m.length - 1 : a = o.lastIndex - 2, l = ["word", m.slice(w, a + 1), w, a], x.push(l), w = a);
|
|
839
|
+
break;
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
return w++, l;
|
|
843
|
+
}
|
|
844
|
+
function N(R) {
|
|
845
|
+
O.push(R);
|
|
846
|
+
}
|
|
847
|
+
return { back: N, endOfFile: A, nextToken: I, position: T };
|
|
848
|
+
};
|
|
849
|
+
}), St = E((e, s) => {
|
|
850
|
+
var n = Ot(), o = Re(), c = tt(), i = Le(), f = Tt(), u = Ct(), m = { empty: !0, space: !0 };
|
|
851
|
+
function p(t) {
|
|
852
|
+
for (let h = t.length - 1; h >= 0; h--) {
|
|
853
|
+
let a = t[h], d = a[3] || a[2];
|
|
854
|
+
if (d) return d;
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
var r = class {
|
|
858
|
+
constructor(t) {
|
|
859
|
+
this.input = t, this.root = new i(), this.current = this.root, this.spaces = "", this.semicolon = !1, this.createTokenizer(), this.root.source = { input: t, start: { column: 1, line: 1, offset: 0 } };
|
|
860
|
+
}
|
|
861
|
+
atrule(t) {
|
|
862
|
+
let h = new n();
|
|
863
|
+
h.name = t[1].slice(1), h.name === "" && this.unnamedAtrule(h, t), this.init(h, t[2]);
|
|
864
|
+
let a, d, l, b = !1, y = !1, v = [], g = [];
|
|
865
|
+
for (; !this.tokenizer.endOfFile(); ) {
|
|
866
|
+
if (t = this.tokenizer.nextToken(), a = t[0], a === "(" || a === "[" ? g.push(a === "(" ? ")" : "]") : a === "{" && g.length > 0 ? g.push("}") : a === g[g.length - 1] && g.pop(), g.length === 0) if (a === ";") {
|
|
867
|
+
h.source.end = this.getPosition(t[2]), h.source.end.offset++, this.semicolon = !0;
|
|
868
|
+
break;
|
|
869
|
+
} else if (a === "{") {
|
|
870
|
+
y = !0;
|
|
871
|
+
break;
|
|
872
|
+
} else if (a === "}") {
|
|
873
|
+
if (v.length > 0) {
|
|
874
|
+
for (l = v.length - 1, d = v[l]; d && d[0] === "space"; ) d = v[--l];
|
|
875
|
+
d && (h.source.end = this.getPosition(d[3] || d[2]), h.source.end.offset++);
|
|
876
|
+
}
|
|
877
|
+
this.end(t);
|
|
878
|
+
break;
|
|
879
|
+
} else v.push(t);
|
|
880
|
+
else v.push(t);
|
|
881
|
+
if (this.tokenizer.endOfFile()) {
|
|
882
|
+
b = !0;
|
|
883
|
+
break;
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
h.raws.between = this.spacesAndCommentsFromEnd(v), v.length ? (h.raws.afterName = this.spacesAndCommentsFromStart(v), this.raw(h, "params", v), b && (t = v[v.length - 1], h.source.end = this.getPosition(t[3] || t[2]), h.source.end.offset++, this.spaces = h.raws.between, h.raws.between = "")) : (h.raws.afterName = "", h.params = ""), y && (h.nodes = [], this.current = h);
|
|
887
|
+
}
|
|
888
|
+
checkMissedSemicolon(t) {
|
|
889
|
+
let h = this.colon(t);
|
|
890
|
+
if (h === !1) return;
|
|
891
|
+
let a = 0, d;
|
|
892
|
+
for (let l = h - 1; l >= 0 && (d = t[l], !(d[0] !== "space" && (a += 1, a === 2))); l--) ;
|
|
893
|
+
throw this.input.error("Missed semicolon", d[0] === "word" ? d[3] + 1 : d[2]);
|
|
894
|
+
}
|
|
895
|
+
colon(t) {
|
|
896
|
+
let h = 0, a, d, l;
|
|
897
|
+
for (let [b, y] of t.entries()) {
|
|
898
|
+
if (d = y, l = d[0], l === "(" && (h += 1), l === ")" && (h -= 1), h === 0 && l === ":") if (!a) this.doubleColon(d);
|
|
899
|
+
else {
|
|
900
|
+
if (a[0] === "word" && a[1] === "progid") continue;
|
|
901
|
+
return b;
|
|
902
|
+
}
|
|
903
|
+
a = d;
|
|
904
|
+
}
|
|
905
|
+
return !1;
|
|
906
|
+
}
|
|
907
|
+
comment(t) {
|
|
908
|
+
let h = new o();
|
|
909
|
+
this.init(h, t[2]), h.source.end = this.getPosition(t[3] || t[2]), h.source.end.offset++;
|
|
910
|
+
let a = t[1].slice(2, -2);
|
|
911
|
+
if (/^\s*$/.test(a)) h.text = "", h.raws.left = a, h.raws.right = "";
|
|
912
|
+
else {
|
|
913
|
+
let d = a.match(/^(\s*)([^]*\S)(\s*)$/);
|
|
914
|
+
h.text = d[2], h.raws.left = d[1], h.raws.right = d[3];
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
createTokenizer() {
|
|
918
|
+
this.tokenizer = u(this.input);
|
|
919
|
+
}
|
|
920
|
+
decl(t, h) {
|
|
921
|
+
let a = new c();
|
|
922
|
+
this.init(a, t[0][2]);
|
|
923
|
+
let d = t[t.length - 1];
|
|
924
|
+
for (d[0] === ";" && (this.semicolon = !0, t.pop()), a.source.end = this.getPosition(d[3] || d[2] || p(t)), a.source.end.offset++; t[0][0] !== "word"; ) t.length === 1 && this.unknownWord(t), a.raws.before += t.shift()[1];
|
|
925
|
+
for (a.source.start = this.getPosition(t[0][2]), a.prop = ""; t.length; ) {
|
|
926
|
+
let v = t[0][0];
|
|
927
|
+
if (v === ":" || v === "space" || v === "comment") break;
|
|
928
|
+
a.prop += t.shift()[1];
|
|
929
|
+
}
|
|
930
|
+
a.raws.between = "";
|
|
931
|
+
let l;
|
|
932
|
+
for (; t.length; ) if (l = t.shift(), l[0] === ":") {
|
|
933
|
+
a.raws.between += l[1];
|
|
934
|
+
break;
|
|
935
|
+
} else l[0] === "word" && /\w/.test(l[1]) && this.unknownWord([l]), a.raws.between += l[1];
|
|
936
|
+
(a.prop[0] === "_" || a.prop[0] === "*") && (a.raws.before += a.prop[0], a.prop = a.prop.slice(1));
|
|
937
|
+
let b = [], y;
|
|
938
|
+
for (; t.length && (y = t[0][0], !(y !== "space" && y !== "comment")); ) b.push(t.shift());
|
|
939
|
+
this.precheckMissedSemicolon(t);
|
|
940
|
+
for (let v = t.length - 1; v >= 0; v--) {
|
|
941
|
+
if (l = t[v], l[1].toLowerCase() === "!important") {
|
|
942
|
+
a.important = !0;
|
|
943
|
+
let g = this.stringFrom(t, v);
|
|
944
|
+
g = this.spacesFromEnd(t) + g, g !== " !important" && (a.raws.important = g);
|
|
945
|
+
break;
|
|
946
|
+
} else if (l[1].toLowerCase() === "important") {
|
|
947
|
+
let g = t.slice(0), k = "";
|
|
948
|
+
for (let w = v; w > 0; w--) {
|
|
949
|
+
let x = g[w][0];
|
|
950
|
+
if (k.trim().startsWith("!") && x !== "space") break;
|
|
951
|
+
k = g.pop()[1] + k;
|
|
952
|
+
}
|
|
953
|
+
k.trim().startsWith("!") && (a.important = !0, a.raws.important = k, t = g);
|
|
954
|
+
}
|
|
955
|
+
if (l[0] !== "space" && l[0] !== "comment") break;
|
|
956
|
+
}
|
|
957
|
+
t.some((v) => v[0] !== "space" && v[0] !== "comment") && (a.raws.between += b.map((v) => v[1]).join(""), b = []), this.raw(a, "value", b.concat(t), h), a.value.includes(":") && !h && this.checkMissedSemicolon(t);
|
|
958
|
+
}
|
|
959
|
+
doubleColon(t) {
|
|
960
|
+
throw this.input.error("Double colon", { offset: t[2] }, { offset: t[2] + t[1].length });
|
|
961
|
+
}
|
|
962
|
+
emptyRule(t) {
|
|
963
|
+
let h = new f();
|
|
964
|
+
this.init(h, t[2]), h.selector = "", h.raws.between = "", this.current = h;
|
|
965
|
+
}
|
|
966
|
+
end(t) {
|
|
967
|
+
this.current.nodes && this.current.nodes.length && (this.current.raws.semicolon = this.semicolon), this.semicolon = !1, this.current.raws.after = (this.current.raws.after || "") + this.spaces, this.spaces = "", this.current.parent ? (this.current.source.end = this.getPosition(t[2]), this.current.source.end.offset++, this.current = this.current.parent) : this.unexpectedClose(t);
|
|
968
|
+
}
|
|
969
|
+
endFile() {
|
|
970
|
+
this.current.parent && this.unclosedBlock(), this.current.nodes && this.current.nodes.length && (this.current.raws.semicolon = this.semicolon), this.current.raws.after = (this.current.raws.after || "") + this.spaces, this.root.source.end = this.getPosition(this.tokenizer.position());
|
|
971
|
+
}
|
|
972
|
+
freeSemicolon(t) {
|
|
973
|
+
if (this.spaces += t[1], this.current.nodes) {
|
|
974
|
+
let h = this.current.nodes[this.current.nodes.length - 1];
|
|
975
|
+
h && h.type === "rule" && !h.raws.ownSemicolon && (h.raws.ownSemicolon = this.spaces, this.spaces = "", h.source.end = this.getPosition(t[2]), h.source.end.offset += h.raws.ownSemicolon.length);
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
getPosition(t) {
|
|
979
|
+
let h = this.input.fromOffset(t);
|
|
980
|
+
return { column: h.col, line: h.line, offset: t };
|
|
981
|
+
}
|
|
982
|
+
init(t, h) {
|
|
983
|
+
this.current.push(t), t.source = { input: this.input, start: this.getPosition(h) }, t.raws.before = this.spaces, this.spaces = "", t.type !== "comment" && (this.semicolon = !1);
|
|
984
|
+
}
|
|
985
|
+
other(t) {
|
|
986
|
+
let h = !1, a = null, d = !1, l = null, b = [], y = t[1].startsWith("--"), v = [], g = t;
|
|
987
|
+
for (; g; ) {
|
|
988
|
+
if (a = g[0], v.push(g), a === "(" || a === "[") l || (l = g), b.push(a === "(" ? ")" : "]");
|
|
989
|
+
else if (y && d && a === "{") l || (l = g), b.push("}");
|
|
990
|
+
else if (b.length === 0) if (a === ";") if (d) {
|
|
991
|
+
this.decl(v, y);
|
|
992
|
+
return;
|
|
993
|
+
} else break;
|
|
994
|
+
else if (a === "{") {
|
|
995
|
+
this.rule(v);
|
|
996
|
+
return;
|
|
997
|
+
} else if (a === "}") {
|
|
998
|
+
this.tokenizer.back(v.pop()), h = !0;
|
|
999
|
+
break;
|
|
1000
|
+
} else a === ":" && (d = !0);
|
|
1001
|
+
else a === b[b.length - 1] && (b.pop(), b.length === 0 && (l = null));
|
|
1002
|
+
g = this.tokenizer.nextToken();
|
|
1003
|
+
}
|
|
1004
|
+
if (this.tokenizer.endOfFile() && (h = !0), b.length > 0 && this.unclosedBracket(l), h && d) {
|
|
1005
|
+
if (!y) for (; v.length && (g = v[v.length - 1][0], !(g !== "space" && g !== "comment")); ) this.tokenizer.back(v.pop());
|
|
1006
|
+
this.decl(v, y);
|
|
1007
|
+
} else this.unknownWord(v);
|
|
1008
|
+
}
|
|
1009
|
+
parse() {
|
|
1010
|
+
let t;
|
|
1011
|
+
for (; !this.tokenizer.endOfFile(); ) switch (t = this.tokenizer.nextToken(), t[0]) {
|
|
1012
|
+
case "space":
|
|
1013
|
+
this.spaces += t[1];
|
|
1014
|
+
break;
|
|
1015
|
+
case ";":
|
|
1016
|
+
this.freeSemicolon(t);
|
|
1017
|
+
break;
|
|
1018
|
+
case "}":
|
|
1019
|
+
this.end(t);
|
|
1020
|
+
break;
|
|
1021
|
+
case "comment":
|
|
1022
|
+
this.comment(t);
|
|
1023
|
+
break;
|
|
1024
|
+
case "at-word":
|
|
1025
|
+
this.atrule(t);
|
|
1026
|
+
break;
|
|
1027
|
+
case "{":
|
|
1028
|
+
this.emptyRule(t);
|
|
1029
|
+
break;
|
|
1030
|
+
default:
|
|
1031
|
+
this.other(t);
|
|
1032
|
+
break;
|
|
1033
|
+
}
|
|
1034
|
+
this.endFile();
|
|
1035
|
+
}
|
|
1036
|
+
precheckMissedSemicolon() {
|
|
1037
|
+
}
|
|
1038
|
+
raw(t, h, a, d) {
|
|
1039
|
+
let l, b, y = a.length, v = "", g = !0, k, w;
|
|
1040
|
+
for (let x = 0; x < y; x += 1) l = a[x], b = l[0], b === "space" && x === y - 1 && !d ? g = !1 : b === "comment" ? (w = a[x - 1] ? a[x - 1][0] : "empty", k = a[x + 1] ? a[x + 1][0] : "empty", !m[w] && !m[k] ? v.slice(-1) === "," ? g = !1 : v += l[1] : g = !1) : v += l[1];
|
|
1041
|
+
if (!g) {
|
|
1042
|
+
let x = a.reduce((O, T) => O + T[1], "");
|
|
1043
|
+
t.raws[h] = { raw: x, value: v };
|
|
1044
|
+
}
|
|
1045
|
+
t[h] = v;
|
|
1046
|
+
}
|
|
1047
|
+
rule(t) {
|
|
1048
|
+
t.pop();
|
|
1049
|
+
let h = new f();
|
|
1050
|
+
this.init(h, t[0][2]), h.raws.between = this.spacesAndCommentsFromEnd(t), this.raw(h, "selector", t), this.current = h;
|
|
1051
|
+
}
|
|
1052
|
+
spacesAndCommentsFromEnd(t) {
|
|
1053
|
+
let h, a = "";
|
|
1054
|
+
for (; t.length && (h = t[t.length - 1][0], !(h !== "space" && h !== "comment")); ) a = t.pop()[1] + a;
|
|
1055
|
+
return a;
|
|
1056
|
+
}
|
|
1057
|
+
spacesAndCommentsFromStart(t) {
|
|
1058
|
+
let h, a = "";
|
|
1059
|
+
for (; t.length && (h = t[0][0], !(h !== "space" && h !== "comment")); ) a += t.shift()[1];
|
|
1060
|
+
return a;
|
|
1061
|
+
}
|
|
1062
|
+
spacesFromEnd(t) {
|
|
1063
|
+
let h, a = "";
|
|
1064
|
+
for (; t.length && (h = t[t.length - 1][0], h === "space"); ) a = t.pop()[1] + a;
|
|
1065
|
+
return a;
|
|
1066
|
+
}
|
|
1067
|
+
stringFrom(t, h) {
|
|
1068
|
+
let a = "";
|
|
1069
|
+
for (let d = h; d < t.length; d++) a += t[d][1];
|
|
1070
|
+
return t.splice(h, t.length - h), a;
|
|
1071
|
+
}
|
|
1072
|
+
unclosedBlock() {
|
|
1073
|
+
let t = this.current.source.start;
|
|
1074
|
+
throw this.input.error("Unclosed block", t.line, t.column);
|
|
1075
|
+
}
|
|
1076
|
+
unclosedBracket(t) {
|
|
1077
|
+
throw this.input.error("Unclosed bracket", { offset: t[2] }, { offset: t[2] + 1 });
|
|
1078
|
+
}
|
|
1079
|
+
unexpectedClose(t) {
|
|
1080
|
+
throw this.input.error("Unexpected }", { offset: t[2] }, { offset: t[2] + 1 });
|
|
1081
|
+
}
|
|
1082
|
+
unknownWord(t) {
|
|
1083
|
+
throw this.input.error("Unknown word " + t[0][1], { offset: t[0][2] }, { offset: t[0][2] + t[0][1].length });
|
|
1084
|
+
}
|
|
1085
|
+
unnamedAtrule(t, h) {
|
|
1086
|
+
throw this.input.error("At-rule without name", { offset: h[2] }, { offset: h[2] + h[1].length });
|
|
1087
|
+
}
|
|
1088
|
+
};
|
|
1089
|
+
s.exports = r;
|
|
1090
|
+
}), rt = E((e, s) => {
|
|
1091
|
+
var n = ue(), o = Ne(), c = St();
|
|
1092
|
+
function i(f, u) {
|
|
1093
|
+
let m = new o(f, u), p = new c(m);
|
|
1094
|
+
try {
|
|
1095
|
+
p.parse();
|
|
1096
|
+
} catch (r) {
|
|
1097
|
+
throw r;
|
|
1098
|
+
}
|
|
1099
|
+
return p.root;
|
|
1100
|
+
}
|
|
1101
|
+
s.exports = i, i.default = i, n.registerParse(i);
|
|
1102
|
+
}), is = E((e, s) => {
|
|
1103
|
+
var n = Ct(), o = Ne();
|
|
1104
|
+
s.exports = { isInlineComment(c) {
|
|
1105
|
+
if (c[0] === "word" && c[1].slice(0, 2) === "//") {
|
|
1106
|
+
let i = c, f = [], u, m;
|
|
1107
|
+
for (; c; ) {
|
|
1108
|
+
if (/\r?\n/.test(c[1])) {
|
|
1109
|
+
if (/['"].*\r?\n/.test(c[1])) {
|
|
1110
|
+
f.push(c[1].substring(0, c[1].indexOf(`
|
|
1111
|
+
`))), m = c[1].substring(c[1].indexOf(`
|
|
1112
|
+
`));
|
|
1113
|
+
let r = this.input.css.valueOf().substring(this.tokenizer.position());
|
|
1114
|
+
m += r, u = c[3] + r.length - m.length;
|
|
1115
|
+
} else this.tokenizer.back(c);
|
|
1116
|
+
break;
|
|
1117
|
+
}
|
|
1118
|
+
f.push(c[1]), u = c[2], c = this.tokenizer.nextToken({ ignoreUnclosed: !0 });
|
|
1119
|
+
}
|
|
1120
|
+
let p = ["comment", f.join(""), i[2], u];
|
|
1121
|
+
return this.inlineComment(p), m && (this.input = new o(m), this.tokenizer = n(this.input)), !0;
|
|
1122
|
+
} else if (c[1] === "/") {
|
|
1123
|
+
let i = this.tokenizer.nextToken({ ignoreUnclosed: !0 });
|
|
1124
|
+
if (i[0] === "comment" && /^\/\*/.test(i[1])) return i[0] = "word", i[1] = i[1].slice(1), c[1] = "//", this.tokenizer.back(i), s.exports.isInlineComment.bind(this)(c);
|
|
1125
|
+
}
|
|
1126
|
+
return !1;
|
|
1127
|
+
} };
|
|
1128
|
+
}), as = E((e, s) => {
|
|
1129
|
+
s.exports = { interpolation(n) {
|
|
1130
|
+
let o = [n, this.tokenizer.nextToken()], c = ["word", "}"];
|
|
1131
|
+
if (o[0][1].length > 1 || o[1][0] !== "{") return this.tokenizer.back(o[1]), !1;
|
|
1132
|
+
for (n = this.tokenizer.nextToken(); n && c.includes(n[0]); ) o.push(n), n = this.tokenizer.nextToken();
|
|
1133
|
+
let i = o.map((p) => p[1]), [f] = o, u = o.pop(), m = ["word", i.join(""), f[2], u[2]];
|
|
1134
|
+
return this.tokenizer.back(n), this.tokenizer.back(m), !0;
|
|
1135
|
+
} };
|
|
1136
|
+
}), us = E((e, s) => {
|
|
1137
|
+
var n = /^#[0-9a-fA-F]{6}$|^#[0-9a-fA-F]{3}$/, o = /\.[0-9]/, c = (i) => {
|
|
1138
|
+
let [, f] = i, [u] = f;
|
|
1139
|
+
return (u === "." || u === "#") && n.test(f) === !1 && o.test(f) === !1;
|
|
1140
|
+
};
|
|
1141
|
+
s.exports = { isMixinToken: c };
|
|
1142
|
+
}), ls = E((e, s) => {
|
|
1143
|
+
var n = Ct(), o = /^url\((.+)\)/;
|
|
1144
|
+
s.exports = (c) => {
|
|
1145
|
+
let { name: i, params: f = "" } = c;
|
|
1146
|
+
if (i === "import" && f.length) {
|
|
1147
|
+
c.import = !0;
|
|
1148
|
+
let u = n({ css: f });
|
|
1149
|
+
for (c.filename = f.replace(o, "$1"); !u.endOfFile(); ) {
|
|
1150
|
+
let [m, p] = u.nextToken();
|
|
1151
|
+
if (m === "word" && p === "url") return;
|
|
1152
|
+
if (m === "brackets") {
|
|
1153
|
+
c.options = p, c.filename = f.replace(p, "").trim();
|
|
1154
|
+
break;
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
};
|
|
1159
|
+
}), cs = E((e, s) => {
|
|
1160
|
+
var n = /:$/, o = /^:(\s+)?/;
|
|
1161
|
+
s.exports = (c) => {
|
|
1162
|
+
let { name: i, params: f = "" } = c;
|
|
1163
|
+
if (c.name.slice(-1) === ":") {
|
|
1164
|
+
if (n.test(i)) {
|
|
1165
|
+
let [u] = i.match(n);
|
|
1166
|
+
c.name = i.replace(u, ""), c.raws.afterName = u + (c.raws.afterName || ""), c.variable = !0, c.value = c.params;
|
|
1167
|
+
}
|
|
1168
|
+
if (o.test(f)) {
|
|
1169
|
+
let [u] = f.match(o);
|
|
1170
|
+
c.value = f.replace(u, ""), c.raws.afterName = (c.raws.afterName || "") + u, c.variable = !0;
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
};
|
|
1174
|
+
}), ps = E((e, s) => {
|
|
1175
|
+
var n = Re(), o = St(), { isInlineComment: c } = is(), { interpolation: i } = as(), { isMixinToken: f } = us(), u = ls(), m = cs(), p = /(!\s*important)$/i;
|
|
1176
|
+
s.exports = class extends o {
|
|
1177
|
+
constructor(...r) {
|
|
1178
|
+
super(...r), this.lastNode = null;
|
|
1179
|
+
}
|
|
1180
|
+
atrule(r) {
|
|
1181
|
+
i.bind(this)(r) || (super.atrule(r), u(this.lastNode), m(this.lastNode));
|
|
1182
|
+
}
|
|
1183
|
+
decl(...r) {
|
|
1184
|
+
super.decl(...r), /extend\(.+\)/i.test(this.lastNode.value) && (this.lastNode.extend = !0);
|
|
1185
|
+
}
|
|
1186
|
+
each(r) {
|
|
1187
|
+
r[0][1] = ` ${r[0][1]}`;
|
|
1188
|
+
let t = r.findIndex((l) => l[0] === "("), h = r.reverse().find((l) => l[0] === ")"), a = r.reverse().indexOf(h), d = r.splice(t, a).map((l) => l[1]).join("");
|
|
1189
|
+
for (let l of r.reverse()) this.tokenizer.back(l);
|
|
1190
|
+
this.atrule(this.tokenizer.nextToken()), this.lastNode.function = !0, this.lastNode.params = d;
|
|
1191
|
+
}
|
|
1192
|
+
init(r, t, h) {
|
|
1193
|
+
super.init(r, t, h), this.lastNode = r;
|
|
1194
|
+
}
|
|
1195
|
+
inlineComment(r) {
|
|
1196
|
+
let t = new n(), h = r[1].slice(2);
|
|
1197
|
+
if (this.init(t, r[2]), t.source.end = this.getPosition(r[3] || r[2]), t.inline = !0, t.raws.begin = "//", /^\s*$/.test(h)) t.text = "", t.raws.left = h, t.raws.right = "";
|
|
1198
|
+
else {
|
|
1199
|
+
let a = h.match(/^(\s*)([^]*[^\s])(\s*)$/);
|
|
1200
|
+
[, t.raws.left, t.text, t.raws.right] = a;
|
|
1201
|
+
}
|
|
1202
|
+
}
|
|
1203
|
+
mixin(r) {
|
|
1204
|
+
let [t] = r, h = t[1].slice(0, 1), a = r.findIndex((v) => v[0] === "brackets"), d = r.findIndex((v) => v[0] === "("), l = "";
|
|
1205
|
+
if ((a < 0 || a > 3) && d > 0) {
|
|
1206
|
+
let v = r.reduce((I, N, R) => N[0] === ")" ? R : I), g = r.slice(d, v + d).map((I) => I[1]).join(""), [k] = r.slice(d), w = [k[2], k[3]], [x] = r.slice(v, v + 1), O = [x[2], x[3]], T = ["brackets", g].concat(w, O), _ = r.slice(0, d), A = r.slice(v + 1);
|
|
1207
|
+
r = _, r.push(T), r = r.concat(A);
|
|
1208
|
+
}
|
|
1209
|
+
let b = [];
|
|
1210
|
+
for (let v of r) if ((v[1] === "!" || b.length) && b.push(v), v[1] === "important") break;
|
|
1211
|
+
if (b.length) {
|
|
1212
|
+
let [v] = b, g = r.indexOf(v), k = b[b.length - 1], w = [v[2], v[3]], x = [k[4], k[5]], O = ["word", b.map((T) => T[1]).join("")].concat(w, x);
|
|
1213
|
+
r.splice(g, b.length, O);
|
|
1214
|
+
}
|
|
1215
|
+
let y = r.findIndex((v) => p.test(v[1]));
|
|
1216
|
+
y > 0 && ([, l] = r[y], r.splice(y, 1));
|
|
1217
|
+
for (let v of r.reverse()) this.tokenizer.back(v);
|
|
1218
|
+
this.atrule(this.tokenizer.nextToken()), this.lastNode.mixin = !0, this.lastNode.raws.identifier = h, l && (this.lastNode.important = !0, this.lastNode.raws.important = l);
|
|
1219
|
+
}
|
|
1220
|
+
other(r) {
|
|
1221
|
+
c.bind(this)(r) || super.other(r);
|
|
1222
|
+
}
|
|
1223
|
+
rule(r) {
|
|
1224
|
+
let t = r[r.length - 1], h = r[r.length - 2];
|
|
1225
|
+
if (h[0] === "at-word" && t[0] === "{" && (this.tokenizer.back(t), i.bind(this)(h))) {
|
|
1226
|
+
let a = this.tokenizer.nextToken();
|
|
1227
|
+
r = r.slice(0, r.length - 2).concat([a]);
|
|
1228
|
+
for (let d of r.reverse()) this.tokenizer.back(d);
|
|
1229
|
+
return;
|
|
1230
|
+
}
|
|
1231
|
+
super.rule(r), /:extend\(.+\)/i.test(this.lastNode.selector) && (this.lastNode.extend = !0);
|
|
1232
|
+
}
|
|
1233
|
+
unknownWord(r) {
|
|
1234
|
+
let [t] = r;
|
|
1235
|
+
if (r[0][1] === "each" && r[1][0] === "(") {
|
|
1236
|
+
this.each(r);
|
|
1237
|
+
return;
|
|
1238
|
+
}
|
|
1239
|
+
if (f(t)) {
|
|
1240
|
+
this.mixin(r);
|
|
1241
|
+
return;
|
|
1242
|
+
}
|
|
1243
|
+
super.unknownWord(r);
|
|
1244
|
+
}
|
|
1245
|
+
};
|
|
1246
|
+
}), fs = E((e, s) => {
|
|
1247
|
+
var n = xt();
|
|
1248
|
+
s.exports = class extends n {
|
|
1249
|
+
atrule(o, c) {
|
|
1250
|
+
if (!o.mixin && !o.variable && !o.function) {
|
|
1251
|
+
super.atrule(o, c);
|
|
1252
|
+
return;
|
|
1253
|
+
}
|
|
1254
|
+
let i = `${o.function ? "" : o.raws.identifier || "@"}${o.name}`, f = o.params ? this.rawValue(o, "params") : "", u = o.raws.important || "";
|
|
1255
|
+
if (o.variable && (f = o.value), typeof o.raws.afterName < "u" ? i += o.raws.afterName : f && (i += " "), o.nodes) this.block(o, i + f + u);
|
|
1256
|
+
else {
|
|
1257
|
+
let m = (o.raws.between || "") + u + (c ? ";" : "");
|
|
1258
|
+
this.builder(i + f + m, o);
|
|
1259
|
+
}
|
|
1260
|
+
}
|
|
1261
|
+
comment(o) {
|
|
1262
|
+
if (o.inline) {
|
|
1263
|
+
let c = this.raw(o, "left", "commentLeft"), i = this.raw(o, "right", "commentRight");
|
|
1264
|
+
this.builder(`//${c}${o.text}${i}`, o);
|
|
1265
|
+
} else super.comment(o);
|
|
1266
|
+
}
|
|
1267
|
+
};
|
|
1268
|
+
}), hs = E((e, s) => {
|
|
1269
|
+
var n = Ne(), o = ps(), c = fs();
|
|
1270
|
+
s.exports = { parse(i, f) {
|
|
1271
|
+
let u = new n(i, f), m = new o(u);
|
|
1272
|
+
return m.parse(), m.root.walk((p) => {
|
|
1273
|
+
let r = u.css.lastIndexOf(p.source.input.css);
|
|
1274
|
+
if (r === 0) return;
|
|
1275
|
+
if (r + p.source.input.css.length !== u.css.length) throw new Error("Invalid state detected in postcss-less");
|
|
1276
|
+
let t = r + p.source.start.offset, h = u.fromOffset(r + p.source.start.offset);
|
|
1277
|
+
if (p.source.start = { offset: t, line: h.line, column: h.col }, p.source.end) {
|
|
1278
|
+
let a = r + p.source.end.offset, d = u.fromOffset(r + p.source.end.offset);
|
|
1279
|
+
p.source.end = { offset: a, line: d.line, column: d.col };
|
|
1280
|
+
}
|
|
1281
|
+
}), m.root;
|
|
1282
|
+
}, stringify(i, f) {
|
|
1283
|
+
new c(f).stringify(i);
|
|
1284
|
+
}, nodeToString(i) {
|
|
1285
|
+
let f = "";
|
|
1286
|
+
return s.exports.stringify(i, (u) => {
|
|
1287
|
+
f += u;
|
|
1288
|
+
}), f;
|
|
1289
|
+
} };
|
|
1290
|
+
}), _t = E((e, s) => {
|
|
1291
|
+
var n = ue(), o, c, i = class extends n {
|
|
1292
|
+
constructor(f) {
|
|
1293
|
+
super({ type: "document", ...f }), this.nodes || (this.nodes = []);
|
|
1294
|
+
}
|
|
1295
|
+
toResult(f = {}) {
|
|
1296
|
+
return new o(new c(), this, f).stringify();
|
|
1297
|
+
}
|
|
1298
|
+
};
|
|
1299
|
+
i.registerLazyResult = (f) => {
|
|
1300
|
+
o = f;
|
|
1301
|
+
}, i.registerProcessor = (f) => {
|
|
1302
|
+
c = f;
|
|
1303
|
+
}, s.exports = i, i.default = i;
|
|
1304
|
+
}), ds = E((e, s) => {
|
|
1305
|
+
var n = Ot(), o = Re(), c = tt(), i = Ne(), f = Yt(), u = Le(), m = Tt();
|
|
1306
|
+
function p(r, t) {
|
|
1307
|
+
if (Array.isArray(r)) return r.map((d) => p(d));
|
|
1308
|
+
let { inputs: h, ...a } = r;
|
|
1309
|
+
if (h) {
|
|
1310
|
+
t = [];
|
|
1311
|
+
for (let d of h) {
|
|
1312
|
+
let l = { ...d, __proto__: i.prototype };
|
|
1313
|
+
l.map && (l.map = { ...l.map, __proto__: f.prototype }), t.push(l);
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
|
+
if (a.nodes && (a.nodes = r.nodes.map((d) => p(d, t))), a.source) {
|
|
1317
|
+
let { inputId: d, ...l } = a.source;
|
|
1318
|
+
a.source = l, d != null && (a.source.input = t[d]);
|
|
1319
|
+
}
|
|
1320
|
+
if (a.type === "root") return new u(a);
|
|
1321
|
+
if (a.type === "decl") return new c(a);
|
|
1322
|
+
if (a.type === "rule") return new m(a);
|
|
1323
|
+
if (a.type === "comment") return new o(a);
|
|
1324
|
+
if (a.type === "atrule") return new n(a);
|
|
1325
|
+
throw new Error("Unknown node type: " + r.type);
|
|
1326
|
+
}
|
|
1327
|
+
s.exports = p, p.default = p;
|
|
1328
|
+
}), tr = E((e, s) => {
|
|
1329
|
+
s.exports = class {
|
|
1330
|
+
generate() {
|
|
1331
|
+
}
|
|
1332
|
+
};
|
|
1333
|
+
}), rr = E((e, s) => {
|
|
1334
|
+
var n = class {
|
|
1335
|
+
constructor(o, c = {}) {
|
|
1336
|
+
if (this.type = "warning", this.text = o, c.node && c.node.source) {
|
|
1337
|
+
let i = c.node.rangeBy(c);
|
|
1338
|
+
this.line = i.start.line, this.column = i.start.column, this.endLine = i.end.line, this.endColumn = i.end.column;
|
|
1339
|
+
}
|
|
1340
|
+
for (let i in c) this[i] = c[i];
|
|
1341
|
+
}
|
|
1342
|
+
toString() {
|
|
1343
|
+
return this.node ? this.node.error(this.text, { index: this.index, plugin: this.plugin, word: this.word }).message : this.plugin ? this.plugin + ": " + this.text : this.text;
|
|
1344
|
+
}
|
|
1345
|
+
};
|
|
1346
|
+
s.exports = n, n.default = n;
|
|
1347
|
+
}), Et = E((e, s) => {
|
|
1348
|
+
var n = rr(), o = class {
|
|
1349
|
+
get content() {
|
|
1350
|
+
return this.css;
|
|
1351
|
+
}
|
|
1352
|
+
constructor(c, i, f) {
|
|
1353
|
+
this.processor = c, this.messages = [], this.root = i, this.opts = f, this.css = "", this.map = void 0;
|
|
1354
|
+
}
|
|
1355
|
+
toString() {
|
|
1356
|
+
return this.css;
|
|
1357
|
+
}
|
|
1358
|
+
warn(c, i = {}) {
|
|
1359
|
+
i.plugin || this.lastPlugin && this.lastPlugin.postcssPlugin && (i.plugin = this.lastPlugin.postcssPlugin);
|
|
1360
|
+
let f = new n(c, i);
|
|
1361
|
+
return this.messages.push(f), f;
|
|
1362
|
+
}
|
|
1363
|
+
warnings() {
|
|
1364
|
+
return this.messages.filter((c) => c.type === "warning");
|
|
1365
|
+
}
|
|
1366
|
+
};
|
|
1367
|
+
s.exports = o, o.default = o;
|
|
1368
|
+
}), sr = E((e, s) => {
|
|
1369
|
+
var n = {};
|
|
1370
|
+
s.exports = function(o) {
|
|
1371
|
+
n[o] || (n[o] = !0, typeof console < "u" && console.warn && console.warn(o));
|
|
1372
|
+
};
|
|
1373
|
+
}), nr = E((e, s) => {
|
|
1374
|
+
var n = ue(), o = _t(), c = tr(), i = rt(), f = Et(), u = Le(), m = Ye(), { isClean: p, my: r } = kt();
|
|
1375
|
+
sr();
|
|
1376
|
+
var t = { atrule: "AtRule", comment: "Comment", decl: "Declaration", document: "Document", root: "Root", rule: "Rule" }, h = { AtRule: !0, AtRuleExit: !0, Comment: !0, CommentExit: !0, Declaration: !0, DeclarationExit: !0, Document: !0, DocumentExit: !0, Once: !0, OnceExit: !0, postcssPlugin: !0, prepare: !0, Root: !0, RootExit: !0, Rule: !0, RuleExit: !0 }, a = { Once: !0, postcssPlugin: !0, prepare: !0 }, d = 0;
|
|
1377
|
+
function l(w) {
|
|
1378
|
+
return typeof w == "object" && typeof w.then == "function";
|
|
1379
|
+
}
|
|
1380
|
+
function b(w) {
|
|
1381
|
+
let x = !1, O = t[w.type];
|
|
1382
|
+
return w.type === "decl" ? x = w.prop.toLowerCase() : w.type === "atrule" && (x = w.name.toLowerCase()), x && w.append ? [O, O + "-" + x, d, O + "Exit", O + "Exit-" + x] : x ? [O, O + "-" + x, O + "Exit", O + "Exit-" + x] : w.append ? [O, d, O + "Exit"] : [O, O + "Exit"];
|
|
1383
|
+
}
|
|
1384
|
+
function y(w) {
|
|
1385
|
+
let x;
|
|
1386
|
+
return w.type === "document" ? x = ["Document", d, "DocumentExit"] : w.type === "root" ? x = ["Root", d, "RootExit"] : x = b(w), { eventIndex: 0, events: x, iterator: 0, node: w, visitorIndex: 0, visitors: [] };
|
|
1387
|
+
}
|
|
1388
|
+
function v(w) {
|
|
1389
|
+
return w[p] = !1, w.nodes && w.nodes.forEach((x) => v(x)), w;
|
|
1390
|
+
}
|
|
1391
|
+
var g = {}, k = class or {
|
|
1392
|
+
get content() {
|
|
1393
|
+
return this.stringify().content;
|
|
1394
|
+
}
|
|
1395
|
+
get css() {
|
|
1396
|
+
return this.stringify().css;
|
|
1397
|
+
}
|
|
1398
|
+
get map() {
|
|
1399
|
+
return this.stringify().map;
|
|
1400
|
+
}
|
|
1401
|
+
get messages() {
|
|
1402
|
+
return this.sync().messages;
|
|
1403
|
+
}
|
|
1404
|
+
get opts() {
|
|
1405
|
+
return this.result.opts;
|
|
1406
|
+
}
|
|
1407
|
+
get processor() {
|
|
1408
|
+
return this.result.processor;
|
|
1409
|
+
}
|
|
1410
|
+
get root() {
|
|
1411
|
+
return this.sync().root;
|
|
1412
|
+
}
|
|
1413
|
+
get [Symbol.toStringTag]() {
|
|
1414
|
+
return "LazyResult";
|
|
1415
|
+
}
|
|
1416
|
+
constructor(x, O, T) {
|
|
1417
|
+
this.stringified = !1, this.processed = !1;
|
|
1418
|
+
let _;
|
|
1419
|
+
if (typeof O == "object" && O !== null && (O.type === "root" || O.type === "document")) _ = v(O);
|
|
1420
|
+
else if (O instanceof or || O instanceof f) _ = v(O.root), O.map && (typeof T.map > "u" && (T.map = {}), T.map.inline || (T.map.inline = !1), T.map.prev = O.map);
|
|
1421
|
+
else {
|
|
1422
|
+
let A = i;
|
|
1423
|
+
T.syntax && (A = T.syntax.parse), T.parser && (A = T.parser), A.parse && (A = A.parse);
|
|
1424
|
+
try {
|
|
1425
|
+
_ = A(O, T);
|
|
1426
|
+
} catch (I) {
|
|
1427
|
+
this.processed = !0, this.error = I;
|
|
1428
|
+
}
|
|
1429
|
+
_ && !_[r] && n.rebuild(_);
|
|
1430
|
+
}
|
|
1431
|
+
this.result = new f(x, _, T), this.helpers = { ...g, postcss: g, result: this.result }, this.plugins = this.processor.plugins.map((A) => typeof A == "object" && A.prepare ? { ...A, ...A.prepare(this.result) } : A);
|
|
1432
|
+
}
|
|
1433
|
+
async() {
|
|
1434
|
+
return this.error ? Promise.reject(this.error) : this.processed ? Promise.resolve(this.result) : (this.processing || (this.processing = this.runAsync()), this.processing);
|
|
1435
|
+
}
|
|
1436
|
+
catch(x) {
|
|
1437
|
+
return this.async().catch(x);
|
|
1438
|
+
}
|
|
1439
|
+
finally(x) {
|
|
1440
|
+
return this.async().then(x, x);
|
|
1441
|
+
}
|
|
1442
|
+
getAsyncError() {
|
|
1443
|
+
throw new Error("Use process(css).then(cb) to work with async plugins");
|
|
1444
|
+
}
|
|
1445
|
+
handleError(x, O) {
|
|
1446
|
+
let T = this.result.lastPlugin;
|
|
1447
|
+
try {
|
|
1448
|
+
O && O.addToError(x), this.error = x, x.name === "CssSyntaxError" && !x.plugin ? (x.plugin = T.postcssPlugin, x.setMessage()) : T.postcssVersion;
|
|
1449
|
+
} catch (_) {
|
|
1450
|
+
console && console.error && console.error(_);
|
|
1451
|
+
}
|
|
1452
|
+
return x;
|
|
1453
|
+
}
|
|
1454
|
+
prepareVisitors() {
|
|
1455
|
+
this.listeners = {};
|
|
1456
|
+
let x = (O, T, _) => {
|
|
1457
|
+
this.listeners[T] || (this.listeners[T] = []), this.listeners[T].push([O, _]);
|
|
1458
|
+
};
|
|
1459
|
+
for (let O of this.plugins) if (typeof O == "object") for (let T in O) {
|
|
1460
|
+
if (!h[T] && /^[A-Z]/.test(T)) throw new Error(`Unknown event ${T} in ${O.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);
|
|
1461
|
+
if (!a[T]) if (typeof O[T] == "object") for (let _ in O[T]) _ === "*" ? x(O, T, O[T][_]) : x(O, T + "-" + _.toLowerCase(), O[T][_]);
|
|
1462
|
+
else typeof O[T] == "function" && x(O, T, O[T]);
|
|
1463
|
+
}
|
|
1464
|
+
this.hasListener = Object.keys(this.listeners).length > 0;
|
|
1465
|
+
}
|
|
1466
|
+
async runAsync() {
|
|
1467
|
+
this.plugin = 0;
|
|
1468
|
+
for (let x = 0; x < this.plugins.length; x++) {
|
|
1469
|
+
let O = this.plugins[x], T = this.runOnRoot(O);
|
|
1470
|
+
if (l(T)) try {
|
|
1471
|
+
await T;
|
|
1472
|
+
} catch (_) {
|
|
1473
|
+
throw this.handleError(_);
|
|
1474
|
+
}
|
|
1475
|
+
}
|
|
1476
|
+
if (this.prepareVisitors(), this.hasListener) {
|
|
1477
|
+
let x = this.result.root;
|
|
1478
|
+
for (; !x[p]; ) {
|
|
1479
|
+
x[p] = !0;
|
|
1480
|
+
let O = [y(x)];
|
|
1481
|
+
for (; O.length > 0; ) {
|
|
1482
|
+
let T = this.visitTick(O);
|
|
1483
|
+
if (l(T)) try {
|
|
1484
|
+
await T;
|
|
1485
|
+
} catch (_) {
|
|
1486
|
+
let A = O[O.length - 1].node;
|
|
1487
|
+
throw this.handleError(_, A);
|
|
1488
|
+
}
|
|
1489
|
+
}
|
|
1490
|
+
}
|
|
1491
|
+
if (this.listeners.OnceExit) for (let [O, T] of this.listeners.OnceExit) {
|
|
1492
|
+
this.result.lastPlugin = O;
|
|
1493
|
+
try {
|
|
1494
|
+
if (x.type === "document") {
|
|
1495
|
+
let _ = x.nodes.map((A) => T(A, this.helpers));
|
|
1496
|
+
await Promise.all(_);
|
|
1497
|
+
} else await T(x, this.helpers);
|
|
1498
|
+
} catch (_) {
|
|
1499
|
+
throw this.handleError(_);
|
|
1500
|
+
}
|
|
1501
|
+
}
|
|
1502
|
+
}
|
|
1503
|
+
return this.processed = !0, this.stringify();
|
|
1504
|
+
}
|
|
1505
|
+
runOnRoot(x) {
|
|
1506
|
+
this.result.lastPlugin = x;
|
|
1507
|
+
try {
|
|
1508
|
+
if (typeof x == "object" && x.Once) {
|
|
1509
|
+
if (this.result.root.type === "document") {
|
|
1510
|
+
let O = this.result.root.nodes.map((T) => x.Once(T, this.helpers));
|
|
1511
|
+
return l(O[0]) ? Promise.all(O) : O;
|
|
1512
|
+
}
|
|
1513
|
+
return x.Once(this.result.root, this.helpers);
|
|
1514
|
+
} else if (typeof x == "function") return x(this.result.root, this.result);
|
|
1515
|
+
} catch (O) {
|
|
1516
|
+
throw this.handleError(O);
|
|
1517
|
+
}
|
|
1518
|
+
}
|
|
1519
|
+
stringify() {
|
|
1520
|
+
if (this.error) throw this.error;
|
|
1521
|
+
if (this.stringified) return this.result;
|
|
1522
|
+
this.stringified = !0, this.sync();
|
|
1523
|
+
let x = this.result.opts, O = m;
|
|
1524
|
+
x.syntax && (O = x.syntax.stringify), x.stringifier && (O = x.stringifier), O.stringify && (O = O.stringify);
|
|
1525
|
+
let T = new c(O, this.result.root, this.result.opts).generate();
|
|
1526
|
+
return this.result.css = T[0], this.result.map = T[1], this.result;
|
|
1527
|
+
}
|
|
1528
|
+
sync() {
|
|
1529
|
+
if (this.error) throw this.error;
|
|
1530
|
+
if (this.processed) return this.result;
|
|
1531
|
+
if (this.processed = !0, this.processing) throw this.getAsyncError();
|
|
1532
|
+
for (let x of this.plugins) {
|
|
1533
|
+
let O = this.runOnRoot(x);
|
|
1534
|
+
if (l(O)) throw this.getAsyncError();
|
|
1535
|
+
}
|
|
1536
|
+
if (this.prepareVisitors(), this.hasListener) {
|
|
1537
|
+
let x = this.result.root;
|
|
1538
|
+
for (; !x[p]; ) x[p] = !0, this.walkSync(x);
|
|
1539
|
+
if (this.listeners.OnceExit) if (x.type === "document") for (let O of x.nodes) this.visitSync(this.listeners.OnceExit, O);
|
|
1540
|
+
else this.visitSync(this.listeners.OnceExit, x);
|
|
1541
|
+
}
|
|
1542
|
+
return this.result;
|
|
1543
|
+
}
|
|
1544
|
+
then(x, O) {
|
|
1545
|
+
return this.async().then(x, O);
|
|
1546
|
+
}
|
|
1547
|
+
toString() {
|
|
1548
|
+
return this.css;
|
|
1549
|
+
}
|
|
1550
|
+
visitSync(x, O) {
|
|
1551
|
+
for (let [T, _] of x) {
|
|
1552
|
+
this.result.lastPlugin = T;
|
|
1553
|
+
let A;
|
|
1554
|
+
try {
|
|
1555
|
+
A = _(O, this.helpers);
|
|
1556
|
+
} catch (I) {
|
|
1557
|
+
throw this.handleError(I, O.proxyOf);
|
|
1558
|
+
}
|
|
1559
|
+
if (O.type !== "root" && O.type !== "document" && !O.parent) return !0;
|
|
1560
|
+
if (l(A)) throw this.getAsyncError();
|
|
1561
|
+
}
|
|
1562
|
+
}
|
|
1563
|
+
visitTick(x) {
|
|
1564
|
+
let O = x[x.length - 1], { node: T, visitors: _ } = O;
|
|
1565
|
+
if (T.type !== "root" && T.type !== "document" && !T.parent) {
|
|
1566
|
+
x.pop();
|
|
1567
|
+
return;
|
|
1568
|
+
}
|
|
1569
|
+
if (_.length > 0 && O.visitorIndex < _.length) {
|
|
1570
|
+
let [I, N] = _[O.visitorIndex];
|
|
1571
|
+
O.visitorIndex += 1, O.visitorIndex === _.length && (O.visitors = [], O.visitorIndex = 0), this.result.lastPlugin = I;
|
|
1572
|
+
try {
|
|
1573
|
+
return N(T.toProxy(), this.helpers);
|
|
1574
|
+
} catch (R) {
|
|
1575
|
+
throw this.handleError(R, T);
|
|
1576
|
+
}
|
|
1577
|
+
}
|
|
1578
|
+
if (O.iterator !== 0) {
|
|
1579
|
+
let I = O.iterator, N;
|
|
1580
|
+
for (; N = T.nodes[T.indexes[I]]; ) if (T.indexes[I] += 1, !N[p]) {
|
|
1581
|
+
N[p] = !0, x.push(y(N));
|
|
1582
|
+
return;
|
|
1583
|
+
}
|
|
1584
|
+
O.iterator = 0, delete T.indexes[I];
|
|
1585
|
+
}
|
|
1586
|
+
let A = O.events;
|
|
1587
|
+
for (; O.eventIndex < A.length; ) {
|
|
1588
|
+
let I = A[O.eventIndex];
|
|
1589
|
+
if (O.eventIndex += 1, I === d) {
|
|
1590
|
+
T.nodes && T.nodes.length && (T[p] = !0, O.iterator = T.getIterator());
|
|
1591
|
+
return;
|
|
1592
|
+
} else if (this.listeners[I]) {
|
|
1593
|
+
O.visitors = this.listeners[I];
|
|
1594
|
+
return;
|
|
1595
|
+
}
|
|
1596
|
+
}
|
|
1597
|
+
x.pop();
|
|
1598
|
+
}
|
|
1599
|
+
walkSync(x) {
|
|
1600
|
+
x[p] = !0;
|
|
1601
|
+
let O = b(x);
|
|
1602
|
+
for (let T of O) if (T === d) x.nodes && x.each((_) => {
|
|
1603
|
+
_[p] || this.walkSync(_);
|
|
1604
|
+
});
|
|
1605
|
+
else {
|
|
1606
|
+
let _ = this.listeners[T];
|
|
1607
|
+
if (_ && this.visitSync(_, x.toProxy())) return;
|
|
1608
|
+
}
|
|
1609
|
+
}
|
|
1610
|
+
warnings() {
|
|
1611
|
+
return this.sync().warnings();
|
|
1612
|
+
}
|
|
1613
|
+
};
|
|
1614
|
+
k.registerPostcss = (w) => {
|
|
1615
|
+
g = w;
|
|
1616
|
+
}, s.exports = k, k.default = k, u.registerLazyResult(k), o.registerLazyResult(k);
|
|
1617
|
+
}), ms = E((e, s) => {
|
|
1618
|
+
var n = tr(), o = rt(), c = Et(), i = Ye();
|
|
1619
|
+
sr();
|
|
1620
|
+
var f = class {
|
|
1621
|
+
get content() {
|
|
1622
|
+
return this.result.css;
|
|
1623
|
+
}
|
|
1624
|
+
get css() {
|
|
1625
|
+
return this.result.css;
|
|
1626
|
+
}
|
|
1627
|
+
get map() {
|
|
1628
|
+
return this.result.map;
|
|
1629
|
+
}
|
|
1630
|
+
get messages() {
|
|
1631
|
+
return [];
|
|
1632
|
+
}
|
|
1633
|
+
get opts() {
|
|
1634
|
+
return this.result.opts;
|
|
1635
|
+
}
|
|
1636
|
+
get processor() {
|
|
1637
|
+
return this.result.processor;
|
|
1638
|
+
}
|
|
1639
|
+
get root() {
|
|
1640
|
+
if (this._root) return this._root;
|
|
1641
|
+
let u, m = o;
|
|
1642
|
+
try {
|
|
1643
|
+
u = m(this._css, this._opts);
|
|
1644
|
+
} catch (p) {
|
|
1645
|
+
this.error = p;
|
|
1646
|
+
}
|
|
1647
|
+
if (this.error) throw this.error;
|
|
1648
|
+
return this._root = u, u;
|
|
1649
|
+
}
|
|
1650
|
+
get [Symbol.toStringTag]() {
|
|
1651
|
+
return "NoWorkResult";
|
|
1652
|
+
}
|
|
1653
|
+
constructor(u, m, p) {
|
|
1654
|
+
m = m.toString(), this.stringified = !1, this._processor = u, this._css = m, this._opts = p, this._map = void 0;
|
|
1655
|
+
let r, t = i;
|
|
1656
|
+
this.result = new c(this._processor, r, this._opts), this.result.css = m;
|
|
1657
|
+
let h = this;
|
|
1658
|
+
Object.defineProperty(this.result, "root", { get() {
|
|
1659
|
+
return h.root;
|
|
1660
|
+
} });
|
|
1661
|
+
let a = new n(t, r, this._opts, m);
|
|
1662
|
+
if (a.isMap()) {
|
|
1663
|
+
let [d, l] = a.generate();
|
|
1664
|
+
d && (this.result.css = d), l && (this.result.map = l);
|
|
1665
|
+
} else a.clearAnnotation(), this.result.css = a.css;
|
|
1666
|
+
}
|
|
1667
|
+
async() {
|
|
1668
|
+
return this.error ? Promise.reject(this.error) : Promise.resolve(this.result);
|
|
1669
|
+
}
|
|
1670
|
+
catch(u) {
|
|
1671
|
+
return this.async().catch(u);
|
|
1672
|
+
}
|
|
1673
|
+
finally(u) {
|
|
1674
|
+
return this.async().then(u, u);
|
|
1675
|
+
}
|
|
1676
|
+
sync() {
|
|
1677
|
+
if (this.error) throw this.error;
|
|
1678
|
+
return this.result;
|
|
1679
|
+
}
|
|
1680
|
+
then(u, m) {
|
|
1681
|
+
return this.async().then(u, m);
|
|
1682
|
+
}
|
|
1683
|
+
toString() {
|
|
1684
|
+
return this._css;
|
|
1685
|
+
}
|
|
1686
|
+
warnings() {
|
|
1687
|
+
return [];
|
|
1688
|
+
}
|
|
1689
|
+
};
|
|
1690
|
+
s.exports = f, f.default = f;
|
|
1691
|
+
}), vs = E((e, s) => {
|
|
1692
|
+
var n = _t(), o = nr(), c = ms(), i = Le(), f = class {
|
|
1693
|
+
constructor(u = []) {
|
|
1694
|
+
this.version = "8.5.6", this.plugins = this.normalize(u);
|
|
1695
|
+
}
|
|
1696
|
+
normalize(u) {
|
|
1697
|
+
let m = [];
|
|
1698
|
+
for (let p of u) if (p.postcss === !0 ? p = p() : p.postcss && (p = p.postcss), typeof p == "object" && Array.isArray(p.plugins)) m = m.concat(p.plugins);
|
|
1699
|
+
else if (typeof p == "object" && p.postcssPlugin) m.push(p);
|
|
1700
|
+
else if (typeof p == "function") m.push(p);
|
|
1701
|
+
else if (!(typeof p == "object" && (p.parse || p.stringify))) throw new Error(p + " is not a PostCSS plugin");
|
|
1702
|
+
return m;
|
|
1703
|
+
}
|
|
1704
|
+
process(u, m = {}) {
|
|
1705
|
+
return !this.plugins.length && !m.parser && !m.stringifier && !m.syntax ? new c(this, u, m) : new o(this, u, m);
|
|
1706
|
+
}
|
|
1707
|
+
use(u) {
|
|
1708
|
+
return this.plugins = this.plugins.concat(this.normalize([u])), this;
|
|
1709
|
+
}
|
|
1710
|
+
};
|
|
1711
|
+
s.exports = f, f.default = f, i.registerProcessor(f), n.registerProcessor(f);
|
|
1712
|
+
}), At = E((e, s) => {
|
|
1713
|
+
var n = Ot(), o = Re(), c = ue(), i = bt(), f = tt(), u = _t(), m = ds(), p = Ne(), r = nr(), t = er(), h = et(), a = rt(), d = vs(), l = Et(), b = Le(), y = Tt(), v = Ye(), g = rr();
|
|
1714
|
+
function k(...w) {
|
|
1715
|
+
return w.length === 1 && Array.isArray(w[0]) && (w = w[0]), new d(w);
|
|
1716
|
+
}
|
|
1717
|
+
k.plugin = function(w, x) {
|
|
1718
|
+
let O = !1;
|
|
1719
|
+
function T(...A) {
|
|
1720
|
+
console && console.warn && !O && (O = !0, console.warn(w + `: postcss.plugin was deprecated. Migration guide:
|
|
1721
|
+
https://evilmartians.com/chronicles/postcss-8-plugin-migration`));
|
|
1722
|
+
let I = x(...A);
|
|
1723
|
+
return I.postcssPlugin = w, I.postcssVersion = new d().version, I;
|
|
1724
|
+
}
|
|
1725
|
+
let _;
|
|
1726
|
+
return Object.defineProperty(T, "postcss", { get() {
|
|
1727
|
+
return _ || (_ = T()), _;
|
|
1728
|
+
} }), T.process = function(A, I, N) {
|
|
1729
|
+
return k([T(N)]).process(A, I);
|
|
1730
|
+
}, T;
|
|
1731
|
+
}, k.stringify = v, k.parse = a, k.fromJSON = m, k.list = t, k.comment = (w) => new o(w), k.atRule = (w) => new n(w), k.decl = (w) => new f(w), k.rule = (w) => new y(w), k.root = (w) => new b(w), k.document = (w) => new u(w), k.CssSyntaxError = i, k.Declaration = f, k.Container = c, k.Processor = d, k.Document = u, k.Comment = o, k.Warning = g, k.AtRule = n, k.Result = l, k.Input = p, k.Rule = y, k.Root = b, k.Node = h, r.registerPostcss(k), s.exports = k, k.default = k;
|
|
1732
|
+
}), ys = E((e, s) => {
|
|
1733
|
+
var { Container: n } = At(), o = class extends n {
|
|
1734
|
+
constructor(c) {
|
|
1735
|
+
super(c), this.type = "decl", this.isNested = !0, this.nodes || (this.nodes = []);
|
|
1736
|
+
}
|
|
1737
|
+
};
|
|
1738
|
+
s.exports = o;
|
|
1739
|
+
}), gs = E((e, s) => {
|
|
1740
|
+
var n = /[\t\n\f\r "#'()/;[\\\]{}]/g, o = /[,\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g, c = /.[\r\n"'(/\\]/, i = /[\da-f]/i, f = /[\n\f\r]/g;
|
|
1741
|
+
s.exports = function(u, m = {}) {
|
|
1742
|
+
let p = u.css.valueOf(), r = m.ignoreErrors, t, h, a, d, l, b, y, v, g, k = p.length, w = 0, x = [], O = [], T;
|
|
1743
|
+
function _() {
|
|
1744
|
+
return w;
|
|
1745
|
+
}
|
|
1746
|
+
function A(M) {
|
|
1747
|
+
throw u.error("Unclosed " + M, w);
|
|
1748
|
+
}
|
|
1749
|
+
function I() {
|
|
1750
|
+
return O.length === 0 && w >= k;
|
|
1751
|
+
}
|
|
1752
|
+
function N() {
|
|
1753
|
+
let M = 1, P = !1, D = !1;
|
|
1754
|
+
for (; M > 0; ) h += 1, p.length <= h && A("interpolation"), t = p.charCodeAt(h), v = p.charCodeAt(h + 1), P ? !D && t === P ? (P = !1, D = !1) : t === 92 ? D = !D : D && (D = !1) : t === 39 || t === 34 ? P = t : t === 125 ? M -= 1 : t === 35 && v === 123 && (M += 1);
|
|
1755
|
+
}
|
|
1756
|
+
function R(M) {
|
|
1757
|
+
if (O.length) return O.pop();
|
|
1758
|
+
if (w >= k) return;
|
|
1759
|
+
let P = M ? M.ignoreUnclosed : !1;
|
|
1760
|
+
switch (t = p.charCodeAt(w), t) {
|
|
1761
|
+
case 10:
|
|
1762
|
+
case 32:
|
|
1763
|
+
case 9:
|
|
1764
|
+
case 13:
|
|
1765
|
+
case 12: {
|
|
1766
|
+
h = w;
|
|
1767
|
+
do
|
|
1768
|
+
h += 1, t = p.charCodeAt(h);
|
|
1769
|
+
while (t === 32 || t === 10 || t === 9 || t === 13 || t === 12);
|
|
1770
|
+
g = ["space", p.slice(w, h)], w = h - 1;
|
|
1771
|
+
break;
|
|
1772
|
+
}
|
|
1773
|
+
case 91:
|
|
1774
|
+
case 93:
|
|
1775
|
+
case 123:
|
|
1776
|
+
case 125:
|
|
1777
|
+
case 58:
|
|
1778
|
+
case 59:
|
|
1779
|
+
case 41: {
|
|
1780
|
+
let D = String.fromCharCode(t);
|
|
1781
|
+
g = [D, D, w];
|
|
1782
|
+
break;
|
|
1783
|
+
}
|
|
1784
|
+
case 44: {
|
|
1785
|
+
g = ["word", ",", w, w + 1];
|
|
1786
|
+
break;
|
|
1787
|
+
}
|
|
1788
|
+
case 40: {
|
|
1789
|
+
if (y = x.length ? x.pop()[1] : "", v = p.charCodeAt(w + 1), y === "url" && v !== 39 && v !== 34) {
|
|
1790
|
+
for (T = 1, b = !1, h = w + 1; h <= p.length - 1; ) {
|
|
1791
|
+
if (v = p.charCodeAt(h), v === 92) b = !b;
|
|
1792
|
+
else if (v === 40) T += 1;
|
|
1793
|
+
else if (v === 41 && (T -= 1, T === 0)) break;
|
|
1794
|
+
h += 1;
|
|
1795
|
+
}
|
|
1796
|
+
d = p.slice(w, h + 1), g = ["brackets", d, w, h], w = h;
|
|
1797
|
+
} else h = p.indexOf(")", w + 1), d = p.slice(w, h + 1), h === -1 || c.test(d) ? g = ["(", "(", w] : (g = ["brackets", d, w, h], w = h);
|
|
1798
|
+
break;
|
|
1799
|
+
}
|
|
1800
|
+
case 39:
|
|
1801
|
+
case 34: {
|
|
1802
|
+
for (a = t, h = w, b = !1; h < k && (h++, h === k && A("string"), t = p.charCodeAt(h), v = p.charCodeAt(h + 1), !(!b && t === a)); ) t === 92 ? b = !b : b ? b = !1 : t === 35 && v === 123 && N();
|
|
1803
|
+
g = ["string", p.slice(w, h + 1), w, h], w = h;
|
|
1804
|
+
break;
|
|
1805
|
+
}
|
|
1806
|
+
case 64: {
|
|
1807
|
+
n.lastIndex = w + 1, n.test(p), n.lastIndex === 0 ? h = p.length - 1 : h = n.lastIndex - 2, g = ["at-word", p.slice(w, h + 1), w, h], w = h;
|
|
1808
|
+
break;
|
|
1809
|
+
}
|
|
1810
|
+
case 92: {
|
|
1811
|
+
for (h = w, l = !0; p.charCodeAt(h + 1) === 92; ) h += 1, l = !l;
|
|
1812
|
+
if (t = p.charCodeAt(h + 1), l && t !== 47 && t !== 32 && t !== 10 && t !== 9 && t !== 13 && t !== 12 && (h += 1, i.test(p.charAt(h)))) {
|
|
1813
|
+
for (; i.test(p.charAt(h + 1)); ) h += 1;
|
|
1814
|
+
p.charCodeAt(h + 1) === 32 && (h += 1);
|
|
1815
|
+
}
|
|
1816
|
+
g = ["word", p.slice(w, h + 1), w, h], w = h;
|
|
1817
|
+
break;
|
|
1818
|
+
}
|
|
1819
|
+
default:
|
|
1820
|
+
v = p.charCodeAt(w + 1), t === 35 && v === 123 ? (h = w, N(), d = p.slice(w, h + 1), g = ["word", d, w, h], w = h) : t === 47 && v === 42 ? (h = p.indexOf("*/", w + 2) + 1, h === 0 && (r || P ? h = p.length : A("comment")), g = ["comment", p.slice(w, h + 1), w, h], w = h) : t === 47 && v === 47 ? (f.lastIndex = w + 1, f.test(p), f.lastIndex === 0 ? h = p.length - 1 : h = f.lastIndex - 2, d = p.slice(w, h + 1), g = ["comment", d, w, h, "inline"], w = h) : (o.lastIndex = w + 1, o.test(p), o.lastIndex === 0 ? h = p.length - 1 : h = o.lastIndex - 2, g = ["word", p.slice(w, h + 1), w, h], x.push(g), w = h);
|
|
1821
|
+
break;
|
|
1822
|
+
}
|
|
1823
|
+
return w++, g;
|
|
1824
|
+
}
|
|
1825
|
+
function $(M) {
|
|
1826
|
+
O.push(M);
|
|
1827
|
+
}
|
|
1828
|
+
return { back: $, endOfFile: I, nextToken: R, position: _ };
|
|
1829
|
+
};
|
|
1830
|
+
}), ws = E((e, s) => {
|
|
1831
|
+
var { Comment: n } = At(), o = St(), c = ys(), i = gs(), f = class extends o {
|
|
1832
|
+
atrule(u) {
|
|
1833
|
+
let m = u[1], p = u;
|
|
1834
|
+
for (; !this.tokenizer.endOfFile(); ) {
|
|
1835
|
+
let r = this.tokenizer.nextToken();
|
|
1836
|
+
if (r[0] === "word" && r[2] === p[3] + 1) m += r[1], p = r;
|
|
1837
|
+
else {
|
|
1838
|
+
this.tokenizer.back(r);
|
|
1839
|
+
break;
|
|
1840
|
+
}
|
|
1841
|
+
}
|
|
1842
|
+
super.atrule(["at-word", m, u[2], p[3]]);
|
|
1843
|
+
}
|
|
1844
|
+
comment(u) {
|
|
1845
|
+
if (u[4] === "inline") {
|
|
1846
|
+
let m = new n();
|
|
1847
|
+
this.init(m, u[2]), m.raws.inline = !0;
|
|
1848
|
+
let p = this.input.fromOffset(u[3]);
|
|
1849
|
+
m.source.end = { column: p.col, line: p.line, offset: u[3] + 1 };
|
|
1850
|
+
let r = u[1].slice(2);
|
|
1851
|
+
if (/^\s*$/.test(r)) m.text = "", m.raws.left = r, m.raws.right = "";
|
|
1852
|
+
else {
|
|
1853
|
+
let t = r.match(/^(\s*)([^]*\S)(\s*)$/), h = t[2].replace(/(\*\/|\/\*)/g, "*//*");
|
|
1854
|
+
m.text = h, m.raws.left = t[1], m.raws.right = t[3], m.raws.text = t[2];
|
|
1855
|
+
}
|
|
1856
|
+
} else super.comment(u);
|
|
1857
|
+
}
|
|
1858
|
+
createTokenizer() {
|
|
1859
|
+
this.tokenizer = i(this.input);
|
|
1860
|
+
}
|
|
1861
|
+
raw(u, m, p, r) {
|
|
1862
|
+
if (super.raw(u, m, p, r), u.raws[m]) {
|
|
1863
|
+
let t = u.raws[m].raw;
|
|
1864
|
+
u.raws[m].raw = p.reduce((h, a) => {
|
|
1865
|
+
if (a[0] === "comment" && a[4] === "inline") {
|
|
1866
|
+
let d = a[1].slice(2).replace(/(\*\/|\/\*)/g, "*//*");
|
|
1867
|
+
return h + "/*" + d + "*/";
|
|
1868
|
+
} else return h + a[1];
|
|
1869
|
+
}, ""), t !== u.raws[m].raw && (u.raws[m].scss = t);
|
|
1870
|
+
}
|
|
1871
|
+
}
|
|
1872
|
+
rule(u) {
|
|
1873
|
+
let m = !1, p = 0, r = "";
|
|
1874
|
+
for (let t of u) if (m) t[0] !== "comment" && t[0] !== "{" && (r += t[1]);
|
|
1875
|
+
else {
|
|
1876
|
+
if (t[0] === "space" && t[1].includes(`
|
|
1877
|
+
`)) break;
|
|
1878
|
+
t[0] === "(" ? p += 1 : t[0] === ")" ? p -= 1 : p === 0 && t[0] === ":" && (m = !0);
|
|
1879
|
+
}
|
|
1880
|
+
if (!m || r.trim() === "" || /^[#:A-Za-z-]/.test(r)) super.rule(u);
|
|
1881
|
+
else {
|
|
1882
|
+
u.pop();
|
|
1883
|
+
let t = new c();
|
|
1884
|
+
this.init(t, u[0][2]);
|
|
1885
|
+
let h;
|
|
1886
|
+
for (let d = u.length - 1; d >= 0; d--) if (u[d][0] !== "space") {
|
|
1887
|
+
h = u[d];
|
|
1888
|
+
break;
|
|
1889
|
+
}
|
|
1890
|
+
if (h[3]) {
|
|
1891
|
+
let d = this.input.fromOffset(h[3]);
|
|
1892
|
+
t.source.end = { column: d.col, line: d.line, offset: h[3] + 1 };
|
|
1893
|
+
} else {
|
|
1894
|
+
let d = this.input.fromOffset(h[2]);
|
|
1895
|
+
t.source.end = { column: d.col, line: d.line, offset: h[2] + 1 };
|
|
1896
|
+
}
|
|
1897
|
+
for (; u[0][0] !== "word"; ) t.raws.before += u.shift()[1];
|
|
1898
|
+
if (u[0][2]) {
|
|
1899
|
+
let d = this.input.fromOffset(u[0][2]);
|
|
1900
|
+
t.source.start = { column: d.col, line: d.line, offset: u[0][2] };
|
|
1901
|
+
}
|
|
1902
|
+
for (t.prop = ""; u.length; ) {
|
|
1903
|
+
let d = u[0][0];
|
|
1904
|
+
if (d === ":" || d === "space" || d === "comment") break;
|
|
1905
|
+
t.prop += u.shift()[1];
|
|
1906
|
+
}
|
|
1907
|
+
t.raws.between = "";
|
|
1908
|
+
let a;
|
|
1909
|
+
for (; u.length; ) if (a = u.shift(), a[0] === ":") {
|
|
1910
|
+
t.raws.between += a[1];
|
|
1911
|
+
break;
|
|
1912
|
+
} else t.raws.between += a[1];
|
|
1913
|
+
(t.prop[0] === "_" || t.prop[0] === "*") && (t.raws.before += t.prop[0], t.prop = t.prop.slice(1)), t.raws.between += this.spacesAndCommentsFromStart(u), this.precheckMissedSemicolon(u);
|
|
1914
|
+
for (let d = u.length - 1; d > 0; d--) {
|
|
1915
|
+
if (a = u[d], a[1] === "!important") {
|
|
1916
|
+
t.important = !0;
|
|
1917
|
+
let l = this.stringFrom(u, d);
|
|
1918
|
+
l = this.spacesFromEnd(u) + l, l !== " !important" && (t.raws.important = l);
|
|
1919
|
+
break;
|
|
1920
|
+
} else if (a[1] === "important") {
|
|
1921
|
+
let l = u.slice(0), b = "";
|
|
1922
|
+
for (let y = d; y > 0; y--) {
|
|
1923
|
+
let v = l[y][0];
|
|
1924
|
+
if (b.trim().indexOf("!") === 0 && v !== "space") break;
|
|
1925
|
+
b = l.pop()[1] + b;
|
|
1926
|
+
}
|
|
1927
|
+
b.trim().indexOf("!") === 0 && (t.important = !0, t.raws.important = b, u = l);
|
|
1928
|
+
}
|
|
1929
|
+
if (a[0] !== "space" && a[0] !== "comment") break;
|
|
1930
|
+
}
|
|
1931
|
+
this.raw(t, "value", u), t.value.includes(":") && this.checkMissedSemicolon(u), this.current = t;
|
|
1932
|
+
}
|
|
1933
|
+
}
|
|
1934
|
+
};
|
|
1935
|
+
s.exports = f;
|
|
1936
|
+
}), bs = E((e, s) => {
|
|
1937
|
+
var { Input: n } = At(), o = ws();
|
|
1938
|
+
s.exports = function(c, i) {
|
|
1939
|
+
let f = new n(c, i), u = new o(f);
|
|
1940
|
+
return u.parse(), u.root;
|
|
1941
|
+
};
|
|
1942
|
+
}), ir = E((e) => {
|
|
1943
|
+
Object.defineProperty(e, "__esModule", { value: !0 });
|
|
1944
|
+
function s(n) {
|
|
1945
|
+
this.after = n.after, this.before = n.before, this.type = n.type, this.value = n.value, this.sourceIndex = n.sourceIndex;
|
|
1946
|
+
}
|
|
1947
|
+
e.default = s;
|
|
1948
|
+
}), ar = E((e) => {
|
|
1949
|
+
Object.defineProperty(e, "__esModule", { value: !0 });
|
|
1950
|
+
var s = ir(), n = o(s);
|
|
1951
|
+
function o(i) {
|
|
1952
|
+
return i && i.__esModule ? i : { default: i };
|
|
1953
|
+
}
|
|
1954
|
+
function c(i) {
|
|
1955
|
+
var f = this;
|
|
1956
|
+
this.constructor(i), this.nodes = i.nodes, this.after === void 0 && (this.after = this.nodes.length > 0 ? this.nodes[this.nodes.length - 1].after : ""), this.before === void 0 && (this.before = this.nodes.length > 0 ? this.nodes[0].before : ""), this.sourceIndex === void 0 && (this.sourceIndex = this.before.length), this.nodes.forEach(function(u) {
|
|
1957
|
+
u.parent = f;
|
|
1958
|
+
});
|
|
1959
|
+
}
|
|
1960
|
+
c.prototype = Object.create(n.default.prototype), c.constructor = n.default, c.prototype.walk = function(i, f) {
|
|
1961
|
+
for (var u = typeof i == "string" || i instanceof RegExp, m = u ? f : i, p = typeof i == "string" ? new RegExp(i) : i, r = 0; r < this.nodes.length; r++) {
|
|
1962
|
+
var t = this.nodes[r], h = u ? p.test(t.type) : !0;
|
|
1963
|
+
if (h && m && m(t, r, this.nodes) === !1 || t.nodes && t.walk(i, f) === !1) return !1;
|
|
1964
|
+
}
|
|
1965
|
+
return !0;
|
|
1966
|
+
}, c.prototype.each = function() {
|
|
1967
|
+
for (var i = arguments.length <= 0 || arguments[0] === void 0 ? function() {
|
|
1968
|
+
} : arguments[0], f = 0; f < this.nodes.length; f++) {
|
|
1969
|
+
var u = this.nodes[f];
|
|
1970
|
+
if (i(u, f, this.nodes) === !1) return !1;
|
|
1971
|
+
}
|
|
1972
|
+
return !0;
|
|
1973
|
+
}, e.default = c;
|
|
1974
|
+
}), xs = E((e) => {
|
|
1975
|
+
Object.defineProperty(e, "__esModule", { value: !0 }), e.parseMediaFeature = f, e.parseMediaQuery = u, e.parseMediaList = m;
|
|
1976
|
+
var s = ir(), n = i(s), o = ar(), c = i(o);
|
|
1977
|
+
function i(p) {
|
|
1978
|
+
return p && p.__esModule ? p : { default: p };
|
|
1979
|
+
}
|
|
1980
|
+
function f(p) {
|
|
1981
|
+
var r = arguments.length <= 1 || arguments[1] === void 0 ? 0 : arguments[1], t = [{ mode: "normal", character: null }], h = [], a = 0, d = "", l = null, b = null, y = r, v = p;
|
|
1982
|
+
p[0] === "(" && p[p.length - 1] === ")" && (v = p.substring(1, p.length - 1), y++);
|
|
1983
|
+
for (var g = 0; g < v.length; g++) {
|
|
1984
|
+
var k = v[g];
|
|
1985
|
+
if ((k === "'" || k === '"') && (t[a].isCalculationEnabled === !0 ? (t.push({ mode: "string", isCalculationEnabled: !1, character: k }), a++) : t[a].mode === "string" && t[a].character === k && v[g - 1] !== "\\" && (t.pop(), a--)), k === "{" ? (t.push({ mode: "interpolation", isCalculationEnabled: !0 }), a++) : k === "}" && (t.pop(), a--), t[a].mode === "normal" && k === ":") {
|
|
1986
|
+
var w = v.substring(g + 1);
|
|
1987
|
+
b = { type: "value", before: /^(\s*)/.exec(w)[1], after: /(\s*)$/.exec(w)[1], value: w.trim() }, b.sourceIndex = b.before.length + g + 1 + y, l = { type: "colon", sourceIndex: g + y, after: b.before, value: ":" };
|
|
1988
|
+
break;
|
|
1989
|
+
}
|
|
1990
|
+
d += k;
|
|
1991
|
+
}
|
|
1992
|
+
return d = { type: "media-feature", before: /^(\s*)/.exec(d)[1], after: /(\s*)$/.exec(d)[1], value: d.trim() }, d.sourceIndex = d.before.length + y, h.push(d), l !== null && (l.before = d.after, h.push(l)), b !== null && h.push(b), h;
|
|
1993
|
+
}
|
|
1994
|
+
function u(p) {
|
|
1995
|
+
var r = arguments.length <= 1 || arguments[1] === void 0 ? 0 : arguments[1], t = [], h = 0, a = !1, d = void 0;
|
|
1996
|
+
function l() {
|
|
1997
|
+
return { before: "", after: "", value: "" };
|
|
1998
|
+
}
|
|
1999
|
+
d = l();
|
|
2000
|
+
for (var b = 0; b < p.length; b++) {
|
|
2001
|
+
var y = p[b];
|
|
2002
|
+
a ? (d.value += y, (y === "{" || y === "(") && h++, (y === ")" || y === "}") && h--) : y.search(/\s/) !== -1 ? d.before += y : (y === "(" && (d.type = "media-feature-expression", h++), d.value = y, d.sourceIndex = r + b, a = !0), a && h === 0 && (y === ")" || b === p.length - 1 || p[b + 1].search(/\s/) !== -1) && (["not", "only", "and"].indexOf(d.value) !== -1 && (d.type = "keyword"), d.type === "media-feature-expression" && (d.nodes = f(d.value, d.sourceIndex)), t.push(Array.isArray(d.nodes) ? new c.default(d) : new n.default(d)), d = l(), a = !1);
|
|
2003
|
+
}
|
|
2004
|
+
for (var v = 0; v < t.length; v++) if (d = t[v], v > 0 && (t[v - 1].after = d.before), d.type === void 0) {
|
|
2005
|
+
if (v > 0) {
|
|
2006
|
+
if (t[v - 1].type === "media-feature-expression") {
|
|
2007
|
+
d.type = "keyword";
|
|
2008
|
+
continue;
|
|
2009
|
+
}
|
|
2010
|
+
if (t[v - 1].value === "not" || t[v - 1].value === "only") {
|
|
2011
|
+
d.type = "media-type";
|
|
2012
|
+
continue;
|
|
2013
|
+
}
|
|
2014
|
+
if (t[v - 1].value === "and") {
|
|
2015
|
+
d.type = "media-feature-expression";
|
|
2016
|
+
continue;
|
|
2017
|
+
}
|
|
2018
|
+
t[v - 1].type === "media-type" && (t[v + 1] ? d.type = t[v + 1].type === "media-feature-expression" ? "keyword" : "media-feature-expression" : d.type = "media-feature-expression");
|
|
2019
|
+
}
|
|
2020
|
+
if (v === 0) {
|
|
2021
|
+
if (!t[v + 1]) {
|
|
2022
|
+
d.type = "media-type";
|
|
2023
|
+
continue;
|
|
2024
|
+
}
|
|
2025
|
+
if (t[v + 1] && (t[v + 1].type === "media-feature-expression" || t[v + 1].type === "keyword")) {
|
|
2026
|
+
d.type = "media-type";
|
|
2027
|
+
continue;
|
|
2028
|
+
}
|
|
2029
|
+
if (t[v + 2]) {
|
|
2030
|
+
if (t[v + 2].type === "media-feature-expression") {
|
|
2031
|
+
d.type = "media-type", t[v + 1].type = "keyword";
|
|
2032
|
+
continue;
|
|
2033
|
+
}
|
|
2034
|
+
if (t[v + 2].type === "keyword") {
|
|
2035
|
+
d.type = "keyword", t[v + 1].type = "media-type";
|
|
2036
|
+
continue;
|
|
2037
|
+
}
|
|
2038
|
+
}
|
|
2039
|
+
if (t[v + 3] && t[v + 3].type === "media-feature-expression") {
|
|
2040
|
+
d.type = "keyword", t[v + 1].type = "media-type", t[v + 2].type = "keyword";
|
|
2041
|
+
continue;
|
|
2042
|
+
}
|
|
2043
|
+
}
|
|
2044
|
+
}
|
|
2045
|
+
return t;
|
|
2046
|
+
}
|
|
2047
|
+
function m(p) {
|
|
2048
|
+
var r = [], t = 0, h = 0, a = /^(\s*)url\s*\(/.exec(p);
|
|
2049
|
+
if (a !== null) {
|
|
2050
|
+
for (var d = a[0].length, l = 1; l > 0; ) {
|
|
2051
|
+
var b = p[d];
|
|
2052
|
+
b === "(" && l++, b === ")" && l--, d++;
|
|
2053
|
+
}
|
|
2054
|
+
r.unshift(new n.default({ type: "url", value: p.substring(0, d).trim(), sourceIndex: a[1].length, before: a[1], after: /^(\s*)/.exec(p.substring(d))[1] })), t = d;
|
|
2055
|
+
}
|
|
2056
|
+
for (var y = t; y < p.length; y++) {
|
|
2057
|
+
var v = p[y];
|
|
2058
|
+
if (v === "(" && h++, v === ")" && h--, h === 0 && v === ",") {
|
|
2059
|
+
var g = p.substring(t, y), k = /^(\s*)/.exec(g)[1];
|
|
2060
|
+
r.push(new c.default({ type: "media-query", value: g.trim(), sourceIndex: t + k.length, nodes: u(g, t), before: k, after: /(\s*)$/.exec(g)[1] })), t = y + 1;
|
|
2061
|
+
}
|
|
2062
|
+
}
|
|
2063
|
+
var w = p.substring(t), x = /^(\s*)/.exec(w)[1];
|
|
2064
|
+
return r.push(new c.default({ type: "media-query", value: w.trim(), sourceIndex: t + x.length, nodes: u(w, t), before: x, after: /(\s*)$/.exec(w)[1] })), r;
|
|
2065
|
+
}
|
|
2066
|
+
}), ks = E((e) => {
|
|
2067
|
+
Object.defineProperty(e, "__esModule", { value: !0 }), e.default = i;
|
|
2068
|
+
var s = ar(), n = c(s), o = xs();
|
|
2069
|
+
function c(f) {
|
|
2070
|
+
return f && f.__esModule ? f : { default: f };
|
|
2071
|
+
}
|
|
2072
|
+
function i(f) {
|
|
2073
|
+
return new n.default({ nodes: (0, o.parseMediaList)(f), type: "media-query-list", value: f.trim() });
|
|
2074
|
+
}
|
|
2075
|
+
}), ur = E((e, s) => {
|
|
2076
|
+
s.exports = function(n, o) {
|
|
2077
|
+
if (o = typeof o == "number" ? o : 1 / 0, !o) return Array.isArray(n) ? n.map(function(i) {
|
|
2078
|
+
return i;
|
|
2079
|
+
}) : n;
|
|
2080
|
+
return c(n, 1);
|
|
2081
|
+
function c(i, f) {
|
|
2082
|
+
return i.reduce(function(u, m) {
|
|
2083
|
+
return Array.isArray(m) && f < o ? u.concat(c(m, f + 1)) : u.concat(m);
|
|
2084
|
+
}, []);
|
|
2085
|
+
}
|
|
2086
|
+
};
|
|
2087
|
+
}), lr = E((e, s) => {
|
|
2088
|
+
s.exports = function(n, o) {
|
|
2089
|
+
for (var c = -1, i = []; (c = n.indexOf(o, c + 1)) !== -1; ) i.push(c);
|
|
2090
|
+
return i;
|
|
2091
|
+
};
|
|
2092
|
+
}), cr = E((e, s) => {
|
|
2093
|
+
function n(i, f) {
|
|
2094
|
+
for (var u = 1, m = i.length, p = i[0], r = i[0], t = 1; t < m; ++t) if (r = p, p = i[t], f(p, r)) {
|
|
2095
|
+
if (t === u) {
|
|
2096
|
+
u++;
|
|
2097
|
+
continue;
|
|
2098
|
+
}
|
|
2099
|
+
i[u++] = p;
|
|
2100
|
+
}
|
|
2101
|
+
return i.length = u, i;
|
|
2102
|
+
}
|
|
2103
|
+
function o(i) {
|
|
2104
|
+
for (var f = 1, u = i.length, m = i[0], p = i[0], r = 1; r < u; ++r, p = m) if (p = m, m = i[r], m !== p) {
|
|
2105
|
+
if (r === f) {
|
|
2106
|
+
f++;
|
|
2107
|
+
continue;
|
|
2108
|
+
}
|
|
2109
|
+
i[f++] = m;
|
|
2110
|
+
}
|
|
2111
|
+
return i.length = f, i;
|
|
2112
|
+
}
|
|
2113
|
+
function c(i, f, u) {
|
|
2114
|
+
return i.length === 0 ? i : f ? (u || i.sort(f), n(i, f)) : (u || i.sort(), o(i));
|
|
2115
|
+
}
|
|
2116
|
+
s.exports = c;
|
|
2117
|
+
}), be = E((e, s) => {
|
|
2118
|
+
e.__esModule = !0;
|
|
2119
|
+
var n = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(f) {
|
|
2120
|
+
return typeof f;
|
|
2121
|
+
} : function(f) {
|
|
2122
|
+
return f && typeof Symbol == "function" && f.constructor === Symbol && f !== Symbol.prototype ? "symbol" : typeof f;
|
|
2123
|
+
};
|
|
2124
|
+
function o(f, u) {
|
|
2125
|
+
if (!(f instanceof u)) throw new TypeError("Cannot call a class as a function");
|
|
2126
|
+
}
|
|
2127
|
+
var c = function f(u, m) {
|
|
2128
|
+
if ((typeof u > "u" ? "undefined" : n(u)) !== "object") return u;
|
|
2129
|
+
var p = new u.constructor();
|
|
2130
|
+
for (var r in u) if (u.hasOwnProperty(r)) {
|
|
2131
|
+
var t = u[r], h = typeof t > "u" ? "undefined" : n(t);
|
|
2132
|
+
r === "parent" && h === "object" ? m && (p[r] = m) : t instanceof Array ? p[r] = t.map(function(a) {
|
|
2133
|
+
return f(a, p);
|
|
2134
|
+
}) : p[r] = f(t, p);
|
|
2135
|
+
}
|
|
2136
|
+
return p;
|
|
2137
|
+
}, i = (function() {
|
|
2138
|
+
function f() {
|
|
2139
|
+
var u = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2140
|
+
o(this, f);
|
|
2141
|
+
for (var m in u) this[m] = u[m];
|
|
2142
|
+
var p = u.spaces;
|
|
2143
|
+
p = p === void 0 ? {} : p;
|
|
2144
|
+
var r = p.before, t = r === void 0 ? "" : r, h = p.after, a = h === void 0 ? "" : h;
|
|
2145
|
+
this.spaces = { before: t, after: a };
|
|
2146
|
+
}
|
|
2147
|
+
return f.prototype.remove = function() {
|
|
2148
|
+
return this.parent && this.parent.removeChild(this), this.parent = void 0, this;
|
|
2149
|
+
}, f.prototype.replaceWith = function() {
|
|
2150
|
+
if (this.parent) {
|
|
2151
|
+
for (var u in arguments) this.parent.insertBefore(this, arguments[u]);
|
|
2152
|
+
this.remove();
|
|
2153
|
+
}
|
|
2154
|
+
return this;
|
|
2155
|
+
}, f.prototype.next = function() {
|
|
2156
|
+
return this.parent.at(this.parent.index(this) + 1);
|
|
2157
|
+
}, f.prototype.prev = function() {
|
|
2158
|
+
return this.parent.at(this.parent.index(this) - 1);
|
|
2159
|
+
}, f.prototype.clone = function() {
|
|
2160
|
+
var u = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, m = c(this);
|
|
2161
|
+
for (var p in u) m[p] = u[p];
|
|
2162
|
+
return m;
|
|
2163
|
+
}, f.prototype.toString = function() {
|
|
2164
|
+
return [this.spaces.before, String(this.value), this.spaces.after].join("");
|
|
2165
|
+
}, f;
|
|
2166
|
+
})();
|
|
2167
|
+
e.default = i, s.exports = e.default;
|
|
2168
|
+
}), J = E((e) => {
|
|
2169
|
+
e.__esModule = !0, e.TAG = "tag", e.STRING = "string", e.SELECTOR = "selector", e.ROOT = "root", e.PSEUDO = "pseudo", e.NESTING = "nesting", e.ID = "id", e.COMMENT = "comment", e.COMBINATOR = "combinator", e.CLASS = "class", e.ATTRIBUTE = "attribute", e.UNIVERSAL = "universal";
|
|
2170
|
+
}), jt = E((e, s) => {
|
|
2171
|
+
e.__esModule = !0;
|
|
2172
|
+
var n = /* @__PURE__ */ (function() {
|
|
2173
|
+
function a(d, l) {
|
|
2174
|
+
for (var b = 0; b < l.length; b++) {
|
|
2175
|
+
var y = l[b];
|
|
2176
|
+
y.enumerable = y.enumerable || !1, y.configurable = !0, "value" in y && (y.writable = !0), Object.defineProperty(d, y.key, y);
|
|
2177
|
+
}
|
|
2178
|
+
}
|
|
2179
|
+
return function(d, l, b) {
|
|
2180
|
+
return l && a(d.prototype, l), b && a(d, b), d;
|
|
2181
|
+
};
|
|
2182
|
+
})(), o = be(), c = m(o), i = J(), f = u(i);
|
|
2183
|
+
function u(a) {
|
|
2184
|
+
if (a && a.__esModule) return a;
|
|
2185
|
+
var d = {};
|
|
2186
|
+
if (a != null) for (var l in a) Object.prototype.hasOwnProperty.call(a, l) && (d[l] = a[l]);
|
|
2187
|
+
return d.default = a, d;
|
|
2188
|
+
}
|
|
2189
|
+
function m(a) {
|
|
2190
|
+
return a && a.__esModule ? a : { default: a };
|
|
2191
|
+
}
|
|
2192
|
+
function p(a, d) {
|
|
2193
|
+
if (!(a instanceof d)) throw new TypeError("Cannot call a class as a function");
|
|
2194
|
+
}
|
|
2195
|
+
function r(a, d) {
|
|
2196
|
+
if (!a) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
2197
|
+
return d && (typeof d == "object" || typeof d == "function") ? d : a;
|
|
2198
|
+
}
|
|
2199
|
+
function t(a, d) {
|
|
2200
|
+
if (typeof d != "function" && d !== null) throw new TypeError("Super expression must either be null or a function, not " + typeof d);
|
|
2201
|
+
a.prototype = Object.create(d && d.prototype, { constructor: { value: a, enumerable: !1, writable: !0, configurable: !0 } }), d && (Object.setPrototypeOf ? Object.setPrototypeOf(a, d) : a.__proto__ = d);
|
|
2202
|
+
}
|
|
2203
|
+
var h = (function(a) {
|
|
2204
|
+
t(d, a);
|
|
2205
|
+
function d(l) {
|
|
2206
|
+
p(this, d);
|
|
2207
|
+
var b = r(this, a.call(this, l));
|
|
2208
|
+
return b.nodes || (b.nodes = []), b;
|
|
2209
|
+
}
|
|
2210
|
+
return d.prototype.append = function(l) {
|
|
2211
|
+
return l.parent = this, this.nodes.push(l), this;
|
|
2212
|
+
}, d.prototype.prepend = function(l) {
|
|
2213
|
+
return l.parent = this, this.nodes.unshift(l), this;
|
|
2214
|
+
}, d.prototype.at = function(l) {
|
|
2215
|
+
return this.nodes[l];
|
|
2216
|
+
}, d.prototype.index = function(l) {
|
|
2217
|
+
return typeof l == "number" ? l : this.nodes.indexOf(l);
|
|
2218
|
+
}, d.prototype.removeChild = function(l) {
|
|
2219
|
+
l = this.index(l), this.at(l).parent = void 0, this.nodes.splice(l, 1);
|
|
2220
|
+
var b = void 0;
|
|
2221
|
+
for (var y in this.indexes) b = this.indexes[y], b >= l && (this.indexes[y] = b - 1);
|
|
2222
|
+
return this;
|
|
2223
|
+
}, d.prototype.removeAll = function() {
|
|
2224
|
+
for (var y = this.nodes, l = Array.isArray(y), b = 0, y = l ? y : y[Symbol.iterator](); ; ) {
|
|
2225
|
+
var v;
|
|
2226
|
+
if (l) {
|
|
2227
|
+
if (b >= y.length) break;
|
|
2228
|
+
v = y[b++];
|
|
2229
|
+
} else {
|
|
2230
|
+
if (b = y.next(), b.done) break;
|
|
2231
|
+
v = b.value;
|
|
2232
|
+
}
|
|
2233
|
+
var g = v;
|
|
2234
|
+
g.parent = void 0;
|
|
2235
|
+
}
|
|
2236
|
+
return this.nodes = [], this;
|
|
2237
|
+
}, d.prototype.empty = function() {
|
|
2238
|
+
return this.removeAll();
|
|
2239
|
+
}, d.prototype.insertAfter = function(l, b) {
|
|
2240
|
+
var y = this.index(l);
|
|
2241
|
+
this.nodes.splice(y + 1, 0, b);
|
|
2242
|
+
var v = void 0;
|
|
2243
|
+
for (var g in this.indexes) v = this.indexes[g], y <= v && (this.indexes[g] = v + this.nodes.length);
|
|
2244
|
+
return this;
|
|
2245
|
+
}, d.prototype.insertBefore = function(l, b) {
|
|
2246
|
+
var y = this.index(l);
|
|
2247
|
+
this.nodes.splice(y, 0, b);
|
|
2248
|
+
var v = void 0;
|
|
2249
|
+
for (var g in this.indexes) v = this.indexes[g], y <= v && (this.indexes[g] = v + this.nodes.length);
|
|
2250
|
+
return this;
|
|
2251
|
+
}, d.prototype.each = function(l) {
|
|
2252
|
+
this.lastEach || (this.lastEach = 0), this.indexes || (this.indexes = {}), this.lastEach++;
|
|
2253
|
+
var b = this.lastEach;
|
|
2254
|
+
if (this.indexes[b] = 0, !!this.length) {
|
|
2255
|
+
for (var y = void 0, v = void 0; this.indexes[b] < this.length && (y = this.indexes[b], v = l(this.at(y), y), v !== !1); ) this.indexes[b] += 1;
|
|
2256
|
+
if (delete this.indexes[b], v === !1) return !1;
|
|
2257
|
+
}
|
|
2258
|
+
}, d.prototype.walk = function(l) {
|
|
2259
|
+
return this.each(function(b, y) {
|
|
2260
|
+
var v = l(b, y);
|
|
2261
|
+
if (v !== !1 && b.length && (v = b.walk(l)), v === !1) return !1;
|
|
2262
|
+
});
|
|
2263
|
+
}, d.prototype.walkAttributes = function(l) {
|
|
2264
|
+
var b = this;
|
|
2265
|
+
return this.walk(function(y) {
|
|
2266
|
+
if (y.type === f.ATTRIBUTE) return l.call(b, y);
|
|
2267
|
+
});
|
|
2268
|
+
}, d.prototype.walkClasses = function(l) {
|
|
2269
|
+
var b = this;
|
|
2270
|
+
return this.walk(function(y) {
|
|
2271
|
+
if (y.type === f.CLASS) return l.call(b, y);
|
|
2272
|
+
});
|
|
2273
|
+
}, d.prototype.walkCombinators = function(l) {
|
|
2274
|
+
var b = this;
|
|
2275
|
+
return this.walk(function(y) {
|
|
2276
|
+
if (y.type === f.COMBINATOR) return l.call(b, y);
|
|
2277
|
+
});
|
|
2278
|
+
}, d.prototype.walkComments = function(l) {
|
|
2279
|
+
var b = this;
|
|
2280
|
+
return this.walk(function(y) {
|
|
2281
|
+
if (y.type === f.COMMENT) return l.call(b, y);
|
|
2282
|
+
});
|
|
2283
|
+
}, d.prototype.walkIds = function(l) {
|
|
2284
|
+
var b = this;
|
|
2285
|
+
return this.walk(function(y) {
|
|
2286
|
+
if (y.type === f.ID) return l.call(b, y);
|
|
2287
|
+
});
|
|
2288
|
+
}, d.prototype.walkNesting = function(l) {
|
|
2289
|
+
var b = this;
|
|
2290
|
+
return this.walk(function(y) {
|
|
2291
|
+
if (y.type === f.NESTING) return l.call(b, y);
|
|
2292
|
+
});
|
|
2293
|
+
}, d.prototype.walkPseudos = function(l) {
|
|
2294
|
+
var b = this;
|
|
2295
|
+
return this.walk(function(y) {
|
|
2296
|
+
if (y.type === f.PSEUDO) return l.call(b, y);
|
|
2297
|
+
});
|
|
2298
|
+
}, d.prototype.walkTags = function(l) {
|
|
2299
|
+
var b = this;
|
|
2300
|
+
return this.walk(function(y) {
|
|
2301
|
+
if (y.type === f.TAG) return l.call(b, y);
|
|
2302
|
+
});
|
|
2303
|
+
}, d.prototype.walkUniversals = function(l) {
|
|
2304
|
+
var b = this;
|
|
2305
|
+
return this.walk(function(y) {
|
|
2306
|
+
if (y.type === f.UNIVERSAL) return l.call(b, y);
|
|
2307
|
+
});
|
|
2308
|
+
}, d.prototype.split = function(l) {
|
|
2309
|
+
var b = this, y = [];
|
|
2310
|
+
return this.reduce(function(v, g, k) {
|
|
2311
|
+
var w = l.call(b, g);
|
|
2312
|
+
return y.push(g), w ? (v.push(y), y = []) : k === b.length - 1 && v.push(y), v;
|
|
2313
|
+
}, []);
|
|
2314
|
+
}, d.prototype.map = function(l) {
|
|
2315
|
+
return this.nodes.map(l);
|
|
2316
|
+
}, d.prototype.reduce = function(l, b) {
|
|
2317
|
+
return this.nodes.reduce(l, b);
|
|
2318
|
+
}, d.prototype.every = function(l) {
|
|
2319
|
+
return this.nodes.every(l);
|
|
2320
|
+
}, d.prototype.some = function(l) {
|
|
2321
|
+
return this.nodes.some(l);
|
|
2322
|
+
}, d.prototype.filter = function(l) {
|
|
2323
|
+
return this.nodes.filter(l);
|
|
2324
|
+
}, d.prototype.sort = function(l) {
|
|
2325
|
+
return this.nodes.sort(l);
|
|
2326
|
+
}, d.prototype.toString = function() {
|
|
2327
|
+
return this.map(String).join("");
|
|
2328
|
+
}, n(d, [{ key: "first", get: function() {
|
|
2329
|
+
return this.at(0);
|
|
2330
|
+
} }, { key: "last", get: function() {
|
|
2331
|
+
return this.at(this.length - 1);
|
|
2332
|
+
} }, { key: "length", get: function() {
|
|
2333
|
+
return this.nodes.length;
|
|
2334
|
+
} }]), d;
|
|
2335
|
+
})(c.default);
|
|
2336
|
+
e.default = h, s.exports = e.default;
|
|
2337
|
+
}), Os = E((e, s) => {
|
|
2338
|
+
e.__esModule = !0;
|
|
2339
|
+
var n = jt(), o = i(n), c = J();
|
|
2340
|
+
function i(r) {
|
|
2341
|
+
return r && r.__esModule ? r : { default: r };
|
|
2342
|
+
}
|
|
2343
|
+
function f(r, t) {
|
|
2344
|
+
if (!(r instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
2345
|
+
}
|
|
2346
|
+
function u(r, t) {
|
|
2347
|
+
if (!r) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
2348
|
+
return t && (typeof t == "object" || typeof t == "function") ? t : r;
|
|
2349
|
+
}
|
|
2350
|
+
function m(r, t) {
|
|
2351
|
+
if (typeof t != "function" && t !== null) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
|
|
2352
|
+
r.prototype = Object.create(t && t.prototype, { constructor: { value: r, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(r, t) : r.__proto__ = t);
|
|
2353
|
+
}
|
|
2354
|
+
var p = (function(r) {
|
|
2355
|
+
m(t, r);
|
|
2356
|
+
function t(h) {
|
|
2357
|
+
f(this, t);
|
|
2358
|
+
var a = u(this, r.call(this, h));
|
|
2359
|
+
return a.type = c.ROOT, a;
|
|
2360
|
+
}
|
|
2361
|
+
return t.prototype.toString = function() {
|
|
2362
|
+
var h = this.reduce(function(a, d) {
|
|
2363
|
+
var l = String(d);
|
|
2364
|
+
return l ? a + l + "," : "";
|
|
2365
|
+
}, "").slice(0, -1);
|
|
2366
|
+
return this.trailingComma ? h + "," : h;
|
|
2367
|
+
}, t;
|
|
2368
|
+
})(o.default);
|
|
2369
|
+
e.default = p, s.exports = e.default;
|
|
2370
|
+
}), Ts = E((e, s) => {
|
|
2371
|
+
e.__esModule = !0;
|
|
2372
|
+
var n = jt(), o = i(n), c = J();
|
|
2373
|
+
function i(r) {
|
|
2374
|
+
return r && r.__esModule ? r : { default: r };
|
|
2375
|
+
}
|
|
2376
|
+
function f(r, t) {
|
|
2377
|
+
if (!(r instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
2378
|
+
}
|
|
2379
|
+
function u(r, t) {
|
|
2380
|
+
if (!r) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
2381
|
+
return t && (typeof t == "object" || typeof t == "function") ? t : r;
|
|
2382
|
+
}
|
|
2383
|
+
function m(r, t) {
|
|
2384
|
+
if (typeof t != "function" && t !== null) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
|
|
2385
|
+
r.prototype = Object.create(t && t.prototype, { constructor: { value: r, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(r, t) : r.__proto__ = t);
|
|
2386
|
+
}
|
|
2387
|
+
var p = (function(r) {
|
|
2388
|
+
m(t, r);
|
|
2389
|
+
function t(h) {
|
|
2390
|
+
f(this, t);
|
|
2391
|
+
var a = u(this, r.call(this, h));
|
|
2392
|
+
return a.type = c.SELECTOR, a;
|
|
2393
|
+
}
|
|
2394
|
+
return t;
|
|
2395
|
+
})(o.default);
|
|
2396
|
+
e.default = p, s.exports = e.default;
|
|
2397
|
+
}), We = E((e, s) => {
|
|
2398
|
+
e.__esModule = !0;
|
|
2399
|
+
var n = /* @__PURE__ */ (function() {
|
|
2400
|
+
function r(t, h) {
|
|
2401
|
+
for (var a = 0; a < h.length; a++) {
|
|
2402
|
+
var d = h[a];
|
|
2403
|
+
d.enumerable = d.enumerable || !1, d.configurable = !0, "value" in d && (d.writable = !0), Object.defineProperty(t, d.key, d);
|
|
2404
|
+
}
|
|
2405
|
+
}
|
|
2406
|
+
return function(t, h, a) {
|
|
2407
|
+
return h && r(t.prototype, h), a && r(t, a), t;
|
|
2408
|
+
};
|
|
2409
|
+
})(), o = be(), c = i(o);
|
|
2410
|
+
function i(r) {
|
|
2411
|
+
return r && r.__esModule ? r : { default: r };
|
|
2412
|
+
}
|
|
2413
|
+
function f(r, t) {
|
|
2414
|
+
if (!(r instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
2415
|
+
}
|
|
2416
|
+
function u(r, t) {
|
|
2417
|
+
if (!r) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
2418
|
+
return t && (typeof t == "object" || typeof t == "function") ? t : r;
|
|
2419
|
+
}
|
|
2420
|
+
function m(r, t) {
|
|
2421
|
+
if (typeof t != "function" && t !== null) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
|
|
2422
|
+
r.prototype = Object.create(t && t.prototype, { constructor: { value: r, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(r, t) : r.__proto__ = t);
|
|
2423
|
+
}
|
|
2424
|
+
var p = (function(r) {
|
|
2425
|
+
m(t, r);
|
|
2426
|
+
function t() {
|
|
2427
|
+
return f(this, t), u(this, r.apply(this, arguments));
|
|
2428
|
+
}
|
|
2429
|
+
return t.prototype.toString = function() {
|
|
2430
|
+
return [this.spaces.before, this.ns, String(this.value), this.spaces.after].join("");
|
|
2431
|
+
}, n(t, [{ key: "ns", get: function() {
|
|
2432
|
+
var h = this.namespace;
|
|
2433
|
+
return h ? (typeof h == "string" ? h : "") + "|" : "";
|
|
2434
|
+
} }]), t;
|
|
2435
|
+
})(c.default);
|
|
2436
|
+
e.default = p, s.exports = e.default;
|
|
2437
|
+
}), Cs = E((e, s) => {
|
|
2438
|
+
e.__esModule = !0;
|
|
2439
|
+
var n = We(), o = i(n), c = J();
|
|
2440
|
+
function i(r) {
|
|
2441
|
+
return r && r.__esModule ? r : { default: r };
|
|
2442
|
+
}
|
|
2443
|
+
function f(r, t) {
|
|
2444
|
+
if (!(r instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
2445
|
+
}
|
|
2446
|
+
function u(r, t) {
|
|
2447
|
+
if (!r) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
2448
|
+
return t && (typeof t == "object" || typeof t == "function") ? t : r;
|
|
2449
|
+
}
|
|
2450
|
+
function m(r, t) {
|
|
2451
|
+
if (typeof t != "function" && t !== null) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
|
|
2452
|
+
r.prototype = Object.create(t && t.prototype, { constructor: { value: r, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(r, t) : r.__proto__ = t);
|
|
2453
|
+
}
|
|
2454
|
+
var p = (function(r) {
|
|
2455
|
+
m(t, r);
|
|
2456
|
+
function t(h) {
|
|
2457
|
+
f(this, t);
|
|
2458
|
+
var a = u(this, r.call(this, h));
|
|
2459
|
+
return a.type = c.CLASS, a;
|
|
2460
|
+
}
|
|
2461
|
+
return t.prototype.toString = function() {
|
|
2462
|
+
return [this.spaces.before, this.ns, "." + this.value, this.spaces.after].join("");
|
|
2463
|
+
}, t;
|
|
2464
|
+
})(o.default);
|
|
2465
|
+
e.default = p, s.exports = e.default;
|
|
2466
|
+
}), Ss = E((e, s) => {
|
|
2467
|
+
e.__esModule = !0;
|
|
2468
|
+
var n = be(), o = i(n), c = J();
|
|
2469
|
+
function i(r) {
|
|
2470
|
+
return r && r.__esModule ? r : { default: r };
|
|
2471
|
+
}
|
|
2472
|
+
function f(r, t) {
|
|
2473
|
+
if (!(r instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
2474
|
+
}
|
|
2475
|
+
function u(r, t) {
|
|
2476
|
+
if (!r) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
2477
|
+
return t && (typeof t == "object" || typeof t == "function") ? t : r;
|
|
2478
|
+
}
|
|
2479
|
+
function m(r, t) {
|
|
2480
|
+
if (typeof t != "function" && t !== null) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
|
|
2481
|
+
r.prototype = Object.create(t && t.prototype, { constructor: { value: r, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(r, t) : r.__proto__ = t);
|
|
2482
|
+
}
|
|
2483
|
+
var p = (function(r) {
|
|
2484
|
+
m(t, r);
|
|
2485
|
+
function t(h) {
|
|
2486
|
+
f(this, t);
|
|
2487
|
+
var a = u(this, r.call(this, h));
|
|
2488
|
+
return a.type = c.COMMENT, a;
|
|
2489
|
+
}
|
|
2490
|
+
return t;
|
|
2491
|
+
})(o.default);
|
|
2492
|
+
e.default = p, s.exports = e.default;
|
|
2493
|
+
}), _s = E((e, s) => {
|
|
2494
|
+
e.__esModule = !0;
|
|
2495
|
+
var n = We(), o = i(n), c = J();
|
|
2496
|
+
function i(r) {
|
|
2497
|
+
return r && r.__esModule ? r : { default: r };
|
|
2498
|
+
}
|
|
2499
|
+
function f(r, t) {
|
|
2500
|
+
if (!(r instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
2501
|
+
}
|
|
2502
|
+
function u(r, t) {
|
|
2503
|
+
if (!r) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
2504
|
+
return t && (typeof t == "object" || typeof t == "function") ? t : r;
|
|
2505
|
+
}
|
|
2506
|
+
function m(r, t) {
|
|
2507
|
+
if (typeof t != "function" && t !== null) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
|
|
2508
|
+
r.prototype = Object.create(t && t.prototype, { constructor: { value: r, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(r, t) : r.__proto__ = t);
|
|
2509
|
+
}
|
|
2510
|
+
var p = (function(r) {
|
|
2511
|
+
m(t, r);
|
|
2512
|
+
function t(h) {
|
|
2513
|
+
f(this, t);
|
|
2514
|
+
var a = u(this, r.call(this, h));
|
|
2515
|
+
return a.type = c.ID, a;
|
|
2516
|
+
}
|
|
2517
|
+
return t.prototype.toString = function() {
|
|
2518
|
+
return [this.spaces.before, this.ns, "#" + this.value, this.spaces.after].join("");
|
|
2519
|
+
}, t;
|
|
2520
|
+
})(o.default);
|
|
2521
|
+
e.default = p, s.exports = e.default;
|
|
2522
|
+
}), Es = E((e, s) => {
|
|
2523
|
+
e.__esModule = !0;
|
|
2524
|
+
var n = We(), o = i(n), c = J();
|
|
2525
|
+
function i(r) {
|
|
2526
|
+
return r && r.__esModule ? r : { default: r };
|
|
2527
|
+
}
|
|
2528
|
+
function f(r, t) {
|
|
2529
|
+
if (!(r instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
2530
|
+
}
|
|
2531
|
+
function u(r, t) {
|
|
2532
|
+
if (!r) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
2533
|
+
return t && (typeof t == "object" || typeof t == "function") ? t : r;
|
|
2534
|
+
}
|
|
2535
|
+
function m(r, t) {
|
|
2536
|
+
if (typeof t != "function" && t !== null) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
|
|
2537
|
+
r.prototype = Object.create(t && t.prototype, { constructor: { value: r, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(r, t) : r.__proto__ = t);
|
|
2538
|
+
}
|
|
2539
|
+
var p = (function(r) {
|
|
2540
|
+
m(t, r);
|
|
2541
|
+
function t(h) {
|
|
2542
|
+
f(this, t);
|
|
2543
|
+
var a = u(this, r.call(this, h));
|
|
2544
|
+
return a.type = c.TAG, a;
|
|
2545
|
+
}
|
|
2546
|
+
return t;
|
|
2547
|
+
})(o.default);
|
|
2548
|
+
e.default = p, s.exports = e.default;
|
|
2549
|
+
}), As = E((e, s) => {
|
|
2550
|
+
e.__esModule = !0;
|
|
2551
|
+
var n = be(), o = i(n), c = J();
|
|
2552
|
+
function i(r) {
|
|
2553
|
+
return r && r.__esModule ? r : { default: r };
|
|
2554
|
+
}
|
|
2555
|
+
function f(r, t) {
|
|
2556
|
+
if (!(r instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
2557
|
+
}
|
|
2558
|
+
function u(r, t) {
|
|
2559
|
+
if (!r) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
2560
|
+
return t && (typeof t == "object" || typeof t == "function") ? t : r;
|
|
2561
|
+
}
|
|
2562
|
+
function m(r, t) {
|
|
2563
|
+
if (typeof t != "function" && t !== null) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
|
|
2564
|
+
r.prototype = Object.create(t && t.prototype, { constructor: { value: r, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(r, t) : r.__proto__ = t);
|
|
2565
|
+
}
|
|
2566
|
+
var p = (function(r) {
|
|
2567
|
+
m(t, r);
|
|
2568
|
+
function t(h) {
|
|
2569
|
+
f(this, t);
|
|
2570
|
+
var a = u(this, r.call(this, h));
|
|
2571
|
+
return a.type = c.STRING, a;
|
|
2572
|
+
}
|
|
2573
|
+
return t;
|
|
2574
|
+
})(o.default);
|
|
2575
|
+
e.default = p, s.exports = e.default;
|
|
2576
|
+
}), js = E((e, s) => {
|
|
2577
|
+
e.__esModule = !0;
|
|
2578
|
+
var n = jt(), o = i(n), c = J();
|
|
2579
|
+
function i(r) {
|
|
2580
|
+
return r && r.__esModule ? r : { default: r };
|
|
2581
|
+
}
|
|
2582
|
+
function f(r, t) {
|
|
2583
|
+
if (!(r instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
2584
|
+
}
|
|
2585
|
+
function u(r, t) {
|
|
2586
|
+
if (!r) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
2587
|
+
return t && (typeof t == "object" || typeof t == "function") ? t : r;
|
|
2588
|
+
}
|
|
2589
|
+
function m(r, t) {
|
|
2590
|
+
if (typeof t != "function" && t !== null) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
|
|
2591
|
+
r.prototype = Object.create(t && t.prototype, { constructor: { value: r, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(r, t) : r.__proto__ = t);
|
|
2592
|
+
}
|
|
2593
|
+
var p = (function(r) {
|
|
2594
|
+
m(t, r);
|
|
2595
|
+
function t(h) {
|
|
2596
|
+
f(this, t);
|
|
2597
|
+
var a = u(this, r.call(this, h));
|
|
2598
|
+
return a.type = c.PSEUDO, a;
|
|
2599
|
+
}
|
|
2600
|
+
return t.prototype.toString = function() {
|
|
2601
|
+
var h = this.length ? "(" + this.map(String).join(",") + ")" : "";
|
|
2602
|
+
return [this.spaces.before, String(this.value), h, this.spaces.after].join("");
|
|
2603
|
+
}, t;
|
|
2604
|
+
})(o.default);
|
|
2605
|
+
e.default = p, s.exports = e.default;
|
|
2606
|
+
}), Is = E((e, s) => {
|
|
2607
|
+
e.__esModule = !0;
|
|
2608
|
+
var n = We(), o = i(n), c = J();
|
|
2609
|
+
function i(r) {
|
|
2610
|
+
return r && r.__esModule ? r : { default: r };
|
|
2611
|
+
}
|
|
2612
|
+
function f(r, t) {
|
|
2613
|
+
if (!(r instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
2614
|
+
}
|
|
2615
|
+
function u(r, t) {
|
|
2616
|
+
if (!r) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
2617
|
+
return t && (typeof t == "object" || typeof t == "function") ? t : r;
|
|
2618
|
+
}
|
|
2619
|
+
function m(r, t) {
|
|
2620
|
+
if (typeof t != "function" && t !== null) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
|
|
2621
|
+
r.prototype = Object.create(t && t.prototype, { constructor: { value: r, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(r, t) : r.__proto__ = t);
|
|
2622
|
+
}
|
|
2623
|
+
var p = (function(r) {
|
|
2624
|
+
m(t, r);
|
|
2625
|
+
function t(h) {
|
|
2626
|
+
f(this, t);
|
|
2627
|
+
var a = u(this, r.call(this, h));
|
|
2628
|
+
return a.type = c.ATTRIBUTE, a.raws = {}, a;
|
|
2629
|
+
}
|
|
2630
|
+
return t.prototype.toString = function() {
|
|
2631
|
+
var h = [this.spaces.before, "[", this.ns, this.attribute];
|
|
2632
|
+
return this.operator && h.push(this.operator), this.value && h.push(this.value), this.raws.insensitive ? h.push(this.raws.insensitive) : this.insensitive && h.push(" i"), h.push("]"), h.concat(this.spaces.after).join("");
|
|
2633
|
+
}, t;
|
|
2634
|
+
})(o.default);
|
|
2635
|
+
e.default = p, s.exports = e.default;
|
|
2636
|
+
}), Ps = E((e, s) => {
|
|
2637
|
+
e.__esModule = !0;
|
|
2638
|
+
var n = We(), o = i(n), c = J();
|
|
2639
|
+
function i(r) {
|
|
2640
|
+
return r && r.__esModule ? r : { default: r };
|
|
2641
|
+
}
|
|
2642
|
+
function f(r, t) {
|
|
2643
|
+
if (!(r instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
2644
|
+
}
|
|
2645
|
+
function u(r, t) {
|
|
2646
|
+
if (!r) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
2647
|
+
return t && (typeof t == "object" || typeof t == "function") ? t : r;
|
|
2648
|
+
}
|
|
2649
|
+
function m(r, t) {
|
|
2650
|
+
if (typeof t != "function" && t !== null) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
|
|
2651
|
+
r.prototype = Object.create(t && t.prototype, { constructor: { value: r, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(r, t) : r.__proto__ = t);
|
|
2652
|
+
}
|
|
2653
|
+
var p = (function(r) {
|
|
2654
|
+
m(t, r);
|
|
2655
|
+
function t(h) {
|
|
2656
|
+
f(this, t);
|
|
2657
|
+
var a = u(this, r.call(this, h));
|
|
2658
|
+
return a.type = c.UNIVERSAL, a.value = "*", a;
|
|
2659
|
+
}
|
|
2660
|
+
return t;
|
|
2661
|
+
})(o.default);
|
|
2662
|
+
e.default = p, s.exports = e.default;
|
|
2663
|
+
}), Ms = E((e, s) => {
|
|
2664
|
+
e.__esModule = !0;
|
|
2665
|
+
var n = be(), o = i(n), c = J();
|
|
2666
|
+
function i(r) {
|
|
2667
|
+
return r && r.__esModule ? r : { default: r };
|
|
2668
|
+
}
|
|
2669
|
+
function f(r, t) {
|
|
2670
|
+
if (!(r instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
2671
|
+
}
|
|
2672
|
+
function u(r, t) {
|
|
2673
|
+
if (!r) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
2674
|
+
return t && (typeof t == "object" || typeof t == "function") ? t : r;
|
|
2675
|
+
}
|
|
2676
|
+
function m(r, t) {
|
|
2677
|
+
if (typeof t != "function" && t !== null) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
|
|
2678
|
+
r.prototype = Object.create(t && t.prototype, { constructor: { value: r, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(r, t) : r.__proto__ = t);
|
|
2679
|
+
}
|
|
2680
|
+
var p = (function(r) {
|
|
2681
|
+
m(t, r);
|
|
2682
|
+
function t(h) {
|
|
2683
|
+
f(this, t);
|
|
2684
|
+
var a = u(this, r.call(this, h));
|
|
2685
|
+
return a.type = c.COMBINATOR, a;
|
|
2686
|
+
}
|
|
2687
|
+
return t;
|
|
2688
|
+
})(o.default);
|
|
2689
|
+
e.default = p, s.exports = e.default;
|
|
2690
|
+
}), $s = E((e, s) => {
|
|
2691
|
+
e.__esModule = !0;
|
|
2692
|
+
var n = be(), o = i(n), c = J();
|
|
2693
|
+
function i(r) {
|
|
2694
|
+
return r && r.__esModule ? r : { default: r };
|
|
2695
|
+
}
|
|
2696
|
+
function f(r, t) {
|
|
2697
|
+
if (!(r instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
2698
|
+
}
|
|
2699
|
+
function u(r, t) {
|
|
2700
|
+
if (!r) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
2701
|
+
return t && (typeof t == "object" || typeof t == "function") ? t : r;
|
|
2702
|
+
}
|
|
2703
|
+
function m(r, t) {
|
|
2704
|
+
if (typeof t != "function" && t !== null) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
|
|
2705
|
+
r.prototype = Object.create(t && t.prototype, { constructor: { value: r, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(r, t) : r.__proto__ = t);
|
|
2706
|
+
}
|
|
2707
|
+
var p = (function(r) {
|
|
2708
|
+
m(t, r);
|
|
2709
|
+
function t(h) {
|
|
2710
|
+
f(this, t);
|
|
2711
|
+
var a = u(this, r.call(this, h));
|
|
2712
|
+
return a.type = c.NESTING, a.value = "&", a;
|
|
2713
|
+
}
|
|
2714
|
+
return t;
|
|
2715
|
+
})(o.default);
|
|
2716
|
+
e.default = p, s.exports = e.default;
|
|
2717
|
+
}), Rs = E((e, s) => {
|
|
2718
|
+
e.__esModule = !0, e.default = n;
|
|
2719
|
+
function n(o) {
|
|
2720
|
+
return o.sort(function(c, i) {
|
|
2721
|
+
return c - i;
|
|
2722
|
+
});
|
|
2723
|
+
}
|
|
2724
|
+
s.exports = e.default;
|
|
2725
|
+
}), Ns = E((e, s) => {
|
|
2726
|
+
e.__esModule = !0, e.default = I;
|
|
2727
|
+
var n = 39, o = 34, c = 92, i = 47, f = 10, u = 32, m = 12, p = 9, r = 13, t = 43, h = 62, a = 126, d = 124, l = 44, b = 40, y = 41, v = 91, g = 93, k = 59, w = 42, x = 58, O = 38, T = 64, _ = /[ \n\t\r\{\(\)'"\\;/]/g, A = /[ \n\t\r\(\)\*:;@!&'"\+\|~>,\[\]\\]|\/(?=\*)/g;
|
|
2728
|
+
function I(N) {
|
|
2729
|
+
for (var R = [], $ = N.css.valueOf(), M = void 0, P = void 0, D = void 0, ke = void 0, le = void 0, ce = void 0, pe = void 0, fe = void 0, he = void 0, z = void 0, Oe = void 0, lt = $.length, j = -1, C = 1, S = 0, L = function(W, q) {
|
|
2730
|
+
if (N.safe) $ += q, P = $.length - 1;
|
|
2731
|
+
else throw N.error("Unclosed " + W, C, S - j, S);
|
|
2732
|
+
}; S < lt; ) {
|
|
2733
|
+
switch (M = $.charCodeAt(S), M === f && (j = S, C += 1), M) {
|
|
2734
|
+
case f:
|
|
2735
|
+
case u:
|
|
2736
|
+
case p:
|
|
2737
|
+
case r:
|
|
2738
|
+
case m:
|
|
2739
|
+
P = S;
|
|
2740
|
+
do
|
|
2741
|
+
P += 1, M = $.charCodeAt(P), M === f && (j = P, C += 1);
|
|
2742
|
+
while (M === u || M === f || M === p || M === r || M === m);
|
|
2743
|
+
R.push(["space", $.slice(S, P), C, S - j, S]), S = P - 1;
|
|
2744
|
+
break;
|
|
2745
|
+
case t:
|
|
2746
|
+
case h:
|
|
2747
|
+
case a:
|
|
2748
|
+
case d:
|
|
2749
|
+
P = S;
|
|
2750
|
+
do
|
|
2751
|
+
P += 1, M = $.charCodeAt(P);
|
|
2752
|
+
while (M === t || M === h || M === a || M === d);
|
|
2753
|
+
R.push(["combinator", $.slice(S, P), C, S - j, S]), S = P - 1;
|
|
2754
|
+
break;
|
|
2755
|
+
case w:
|
|
2756
|
+
R.push(["*", "*", C, S - j, S]);
|
|
2757
|
+
break;
|
|
2758
|
+
case O:
|
|
2759
|
+
R.push(["&", "&", C, S - j, S]);
|
|
2760
|
+
break;
|
|
2761
|
+
case l:
|
|
2762
|
+
R.push([",", ",", C, S - j, S]);
|
|
2763
|
+
break;
|
|
2764
|
+
case v:
|
|
2765
|
+
R.push(["[", "[", C, S - j, S]);
|
|
2766
|
+
break;
|
|
2767
|
+
case g:
|
|
2768
|
+
R.push(["]", "]", C, S - j, S]);
|
|
2769
|
+
break;
|
|
2770
|
+
case x:
|
|
2771
|
+
R.push([":", ":", C, S - j, S]);
|
|
2772
|
+
break;
|
|
2773
|
+
case k:
|
|
2774
|
+
R.push([";", ";", C, S - j, S]);
|
|
2775
|
+
break;
|
|
2776
|
+
case b:
|
|
2777
|
+
R.push(["(", "(", C, S - j, S]);
|
|
2778
|
+
break;
|
|
2779
|
+
case y:
|
|
2780
|
+
R.push([")", ")", C, S - j, S]);
|
|
2781
|
+
break;
|
|
2782
|
+
case n:
|
|
2783
|
+
case o:
|
|
2784
|
+
D = M === n ? "'" : '"', P = S;
|
|
2785
|
+
do
|
|
2786
|
+
for (z = !1, P = $.indexOf(D, P + 1), P === -1 && L("quote", D), Oe = P; $.charCodeAt(Oe - 1) === c; ) Oe -= 1, z = !z;
|
|
2787
|
+
while (z);
|
|
2788
|
+
R.push(["string", $.slice(S, P + 1), C, S - j, C, P - j, S]), S = P;
|
|
2789
|
+
break;
|
|
2790
|
+
case T:
|
|
2791
|
+
_.lastIndex = S + 1, _.test($), _.lastIndex === 0 ? P = $.length - 1 : P = _.lastIndex - 2, R.push(["at-word", $.slice(S, P + 1), C, S - j, C, P - j, S]), S = P;
|
|
2792
|
+
break;
|
|
2793
|
+
case c:
|
|
2794
|
+
for (P = S, pe = !0; $.charCodeAt(P + 1) === c; ) P += 1, pe = !pe;
|
|
2795
|
+
M = $.charCodeAt(P + 1), pe && M !== i && M !== u && M !== f && M !== p && M !== r && M !== m && (P += 1), R.push(["word", $.slice(S, P + 1), C, S - j, C, P - j, S]), S = P;
|
|
2796
|
+
break;
|
|
2797
|
+
default:
|
|
2798
|
+
M === i && $.charCodeAt(S + 1) === w ? (P = $.indexOf("*/", S + 2) + 1, P === 0 && L("comment", "*/"), ce = $.slice(S, P + 1), ke = ce.split(`
|
|
2799
|
+
`), le = ke.length - 1, le > 0 ? (fe = C + le, he = P - ke[le].length) : (fe = C, he = j), R.push(["comment", ce, C, S - j, fe, P - he, S]), j = he, C = fe, S = P) : (A.lastIndex = S + 1, A.test($), A.lastIndex === 0 ? P = $.length - 1 : P = A.lastIndex - 2, R.push(["word", $.slice(S, P + 1), C, S - j, C, P - j, S]), S = P);
|
|
2800
|
+
break;
|
|
2801
|
+
}
|
|
2802
|
+
S++;
|
|
2803
|
+
}
|
|
2804
|
+
return R;
|
|
2805
|
+
}
|
|
2806
|
+
s.exports = e.default;
|
|
2807
|
+
}), Ls = E((e, s) => {
|
|
2808
|
+
e.__esModule = !0;
|
|
2809
|
+
var n = /* @__PURE__ */ (function() {
|
|
2810
|
+
function j(C, S) {
|
|
2811
|
+
for (var L = 0; L < S.length; L++) {
|
|
2812
|
+
var W = S[L];
|
|
2813
|
+
W.enumerable = W.enumerable || !1, W.configurable = !0, "value" in W && (W.writable = !0), Object.defineProperty(C, W.key, W);
|
|
2814
|
+
}
|
|
2815
|
+
}
|
|
2816
|
+
return function(C, S, L) {
|
|
2817
|
+
return S && j(C.prototype, S), L && j(C, L), C;
|
|
2818
|
+
};
|
|
2819
|
+
})(), o = ur(), c = z(o), i = lr(), f = z(i), u = cr(), m = z(u), p = Os(), r = z(p), t = Ts(), h = z(t), a = Cs(), d = z(a), l = Ss(), b = z(l), y = _s(), v = z(y), g = Es(), k = z(g), w = As(), x = z(w), O = js(), T = z(O), _ = Is(), A = z(_), I = Ps(), N = z(I), R = Ms(), $ = z(R), M = $s(), P = z(M), D = Rs(), ke = z(D), le = Ns(), ce = z(le), pe = J(), fe = he(pe);
|
|
2820
|
+
function he(j) {
|
|
2821
|
+
if (j && j.__esModule) return j;
|
|
2822
|
+
var C = {};
|
|
2823
|
+
if (j != null) for (var S in j) Object.prototype.hasOwnProperty.call(j, S) && (C[S] = j[S]);
|
|
2824
|
+
return C.default = j, C;
|
|
2825
|
+
}
|
|
2826
|
+
function z(j) {
|
|
2827
|
+
return j && j.__esModule ? j : { default: j };
|
|
2828
|
+
}
|
|
2829
|
+
function Oe(j, C) {
|
|
2830
|
+
if (!(j instanceof C)) throw new TypeError("Cannot call a class as a function");
|
|
2831
|
+
}
|
|
2832
|
+
var lt = (function() {
|
|
2833
|
+
function j(C) {
|
|
2834
|
+
Oe(this, j), this.input = C, this.lossy = C.options.lossless === !1, this.position = 0, this.root = new r.default();
|
|
2835
|
+
var S = new h.default();
|
|
2836
|
+
return this.root.append(S), this.current = S, this.lossy ? this.tokens = (0, ce.default)({ safe: C.safe, css: C.css.trim() }) : this.tokens = (0, ce.default)(C), this.loop();
|
|
2837
|
+
}
|
|
2838
|
+
return j.prototype.attribute = function() {
|
|
2839
|
+
var C = "", S = void 0, L = this.currToken;
|
|
2840
|
+
for (this.position++; this.position < this.tokens.length && this.currToken[0] !== "]"; ) C += this.tokens[this.position][1], this.position++;
|
|
2841
|
+
this.position === this.tokens.length && !~C.indexOf("]") && this.error("Expected a closing square bracket.");
|
|
2842
|
+
var W = C.split(/((?:[*~^$|]?=))([^]*)/), q = W[0].split(/(\|)/g), X = { operator: W[1], value: W[2], source: { start: { line: L[2], column: L[3] }, end: { line: this.currToken[2], column: this.currToken[3] } }, sourceIndex: L[4] };
|
|
2843
|
+
if (q.length > 1 ? (q[0] === "" && (q[0] = !0), X.attribute = this.parseValue(q[2]), X.namespace = this.parseNamespace(q[0])) : X.attribute = this.parseValue(W[0]), S = new A.default(X), W[2]) {
|
|
2844
|
+
var te = W[2].split(/(\s+i\s*?)$/), re = te[0].trim();
|
|
2845
|
+
S.value = this.lossy ? re : te[0], te[1] && (S.insensitive = !0, this.lossy || (S.raws.insensitive = te[1])), S.quoted = re[0] === "'" || re[0] === '"', S.raws.unquoted = S.quoted ? re.slice(1, -1) : re;
|
|
2846
|
+
}
|
|
2847
|
+
this.newNode(S), this.position++;
|
|
2848
|
+
}, j.prototype.combinator = function() {
|
|
2849
|
+
if (this.currToken[1] === "|") return this.namespace();
|
|
2850
|
+
for (var C = new $.default({ value: "", source: { start: { line: this.currToken[2], column: this.currToken[3] }, end: { line: this.currToken[2], column: this.currToken[3] } }, sourceIndex: this.currToken[4] }); this.position < this.tokens.length && this.currToken && (this.currToken[0] === "space" || this.currToken[0] === "combinator"); ) this.nextToken && this.nextToken[0] === "combinator" ? (C.spaces.before = this.parseSpace(this.currToken[1]), C.source.start.line = this.nextToken[2], C.source.start.column = this.nextToken[3], C.source.end.column = this.nextToken[3], C.source.end.line = this.nextToken[2], C.sourceIndex = this.nextToken[4]) : this.prevToken && this.prevToken[0] === "combinator" ? C.spaces.after = this.parseSpace(this.currToken[1]) : this.currToken[0] === "combinator" ? C.value = this.currToken[1] : this.currToken[0] === "space" && (C.value = this.parseSpace(this.currToken[1], " ")), this.position++;
|
|
2851
|
+
return this.newNode(C);
|
|
2852
|
+
}, j.prototype.comma = function() {
|
|
2853
|
+
if (this.position === this.tokens.length - 1) {
|
|
2854
|
+
this.root.trailingComma = !0, this.position++;
|
|
2855
|
+
return;
|
|
2856
|
+
}
|
|
2857
|
+
var C = new h.default();
|
|
2858
|
+
this.current.parent.append(C), this.current = C, this.position++;
|
|
2859
|
+
}, j.prototype.comment = function() {
|
|
2860
|
+
var C = new b.default({ value: this.currToken[1], source: { start: { line: this.currToken[2], column: this.currToken[3] }, end: { line: this.currToken[4], column: this.currToken[5] } }, sourceIndex: this.currToken[6] });
|
|
2861
|
+
this.newNode(C), this.position++;
|
|
2862
|
+
}, j.prototype.error = function(C) {
|
|
2863
|
+
throw new this.input.error(C);
|
|
2864
|
+
}, j.prototype.missingBackslash = function() {
|
|
2865
|
+
return this.error("Expected a backslash preceding the semicolon.");
|
|
2866
|
+
}, j.prototype.missingParenthesis = function() {
|
|
2867
|
+
return this.error("Expected opening parenthesis.");
|
|
2868
|
+
}, j.prototype.missingSquareBracket = function() {
|
|
2869
|
+
return this.error("Expected opening square bracket.");
|
|
2870
|
+
}, j.prototype.namespace = function() {
|
|
2871
|
+
var C = this.prevToken && this.prevToken[1] || !0;
|
|
2872
|
+
if (this.nextToken[0] === "word") return this.position++, this.word(C);
|
|
2873
|
+
if (this.nextToken[0] === "*") return this.position++, this.universal(C);
|
|
2874
|
+
}, j.prototype.nesting = function() {
|
|
2875
|
+
this.newNode(new P.default({ value: this.currToken[1], source: { start: { line: this.currToken[2], column: this.currToken[3] }, end: { line: this.currToken[2], column: this.currToken[3] } }, sourceIndex: this.currToken[4] })), this.position++;
|
|
2876
|
+
}, j.prototype.parentheses = function() {
|
|
2877
|
+
var C = this.current.last;
|
|
2878
|
+
if (C && C.type === fe.PSEUDO) {
|
|
2879
|
+
var S = new h.default(), L = this.current;
|
|
2880
|
+
C.append(S), this.current = S;
|
|
2881
|
+
var W = 1;
|
|
2882
|
+
for (this.position++; this.position < this.tokens.length && W; ) this.currToken[0] === "(" && W++, this.currToken[0] === ")" && W--, W ? this.parse() : (S.parent.source.end.line = this.currToken[2], S.parent.source.end.column = this.currToken[3], this.position++);
|
|
2883
|
+
W && this.error("Expected closing parenthesis."), this.current = L;
|
|
2884
|
+
} else {
|
|
2885
|
+
var q = 1;
|
|
2886
|
+
for (this.position++, C.value += "("; this.position < this.tokens.length && q; ) this.currToken[0] === "(" && q++, this.currToken[0] === ")" && q--, C.value += this.parseParenthesisToken(this.currToken), this.position++;
|
|
2887
|
+
q && this.error("Expected closing parenthesis.");
|
|
2888
|
+
}
|
|
2889
|
+
}, j.prototype.pseudo = function() {
|
|
2890
|
+
for (var C = this, S = "", L = this.currToken; this.currToken && this.currToken[0] === ":"; ) S += this.currToken[1], this.position++;
|
|
2891
|
+
if (!this.currToken) return this.error("Expected pseudo-class or pseudo-element");
|
|
2892
|
+
if (this.currToken[0] === "word") {
|
|
2893
|
+
var W = void 0;
|
|
2894
|
+
this.splitWord(!1, function(q, X) {
|
|
2895
|
+
S += q, W = new T.default({ value: S, source: { start: { line: L[2], column: L[3] }, end: { line: C.currToken[4], column: C.currToken[5] } }, sourceIndex: L[4] }), C.newNode(W), X > 1 && C.nextToken && C.nextToken[0] === "(" && C.error("Misplaced parenthesis.");
|
|
2896
|
+
});
|
|
2897
|
+
} else this.error('Unexpected "' + this.currToken[0] + '" found.');
|
|
2898
|
+
}, j.prototype.space = function() {
|
|
2899
|
+
var C = this.currToken;
|
|
2900
|
+
this.position === 0 || this.prevToken[0] === "," || this.prevToken[0] === "(" ? (this.spaces = this.parseSpace(C[1]), this.position++) : this.position === this.tokens.length - 1 || this.nextToken[0] === "," || this.nextToken[0] === ")" ? (this.current.last.spaces.after = this.parseSpace(C[1]), this.position++) : this.combinator();
|
|
2901
|
+
}, j.prototype.string = function() {
|
|
2902
|
+
var C = this.currToken;
|
|
2903
|
+
this.newNode(new x.default({ value: this.currToken[1], source: { start: { line: C[2], column: C[3] }, end: { line: C[4], column: C[5] } }, sourceIndex: C[6] })), this.position++;
|
|
2904
|
+
}, j.prototype.universal = function(C) {
|
|
2905
|
+
var S = this.nextToken;
|
|
2906
|
+
if (S && S[1] === "|") return this.position++, this.namespace();
|
|
2907
|
+
this.newNode(new N.default({ value: this.currToken[1], source: { start: { line: this.currToken[2], column: this.currToken[3] }, end: { line: this.currToken[2], column: this.currToken[3] } }, sourceIndex: this.currToken[4] }), C), this.position++;
|
|
2908
|
+
}, j.prototype.splitWord = function(C, S) {
|
|
2909
|
+
for (var L = this, W = this.nextToken, q = this.currToken[1]; W && W[0] === "word"; ) {
|
|
2910
|
+
this.position++;
|
|
2911
|
+
var X = this.currToken[1];
|
|
2912
|
+
if (q += X, X.lastIndexOf("\\") === X.length - 1) {
|
|
2913
|
+
var te = this.nextToken;
|
|
2914
|
+
te && te[0] === "space" && (q += this.parseSpace(te[1], " "), this.position++);
|
|
2915
|
+
}
|
|
2916
|
+
W = this.nextToken;
|
|
2917
|
+
}
|
|
2918
|
+
var re = (0, f.default)(q, "."), qe = (0, f.default)(q, "#"), Bt = (0, f.default)(q, "#{");
|
|
2919
|
+
Bt.length && (qe = qe.filter(function(se) {
|
|
2920
|
+
return !~Bt.indexOf(se);
|
|
2921
|
+
}));
|
|
2922
|
+
var de = (0, ke.default)((0, m.default)((0, c.default)([[0], re, qe])));
|
|
2923
|
+
de.forEach(function(se, Te) {
|
|
2924
|
+
var Be = de[Te + 1] || q.length, Fe = q.slice(se, Be);
|
|
2925
|
+
if (Te === 0 && S) return S.call(L, Fe, de.length);
|
|
2926
|
+
var De = void 0;
|
|
2927
|
+
~re.indexOf(se) ? De = new d.default({ value: Fe.slice(1), source: { start: { line: L.currToken[2], column: L.currToken[3] + se }, end: { line: L.currToken[4], column: L.currToken[3] + (Be - 1) } }, sourceIndex: L.currToken[6] + de[Te] }) : ~qe.indexOf(se) ? De = new v.default({ value: Fe.slice(1), source: { start: { line: L.currToken[2], column: L.currToken[3] + se }, end: { line: L.currToken[4], column: L.currToken[3] + (Be - 1) } }, sourceIndex: L.currToken[6] + de[Te] }) : De = new k.default({ value: Fe, source: { start: { line: L.currToken[2], column: L.currToken[3] + se }, end: { line: L.currToken[4], column: L.currToken[3] + (Be - 1) } }, sourceIndex: L.currToken[6] + de[Te] }), L.newNode(De, C);
|
|
2928
|
+
}), this.position++;
|
|
2929
|
+
}, j.prototype.word = function(C) {
|
|
2930
|
+
var S = this.nextToken;
|
|
2931
|
+
return S && S[1] === "|" ? (this.position++, this.namespace()) : this.splitWord(C);
|
|
2932
|
+
}, j.prototype.loop = function() {
|
|
2933
|
+
for (; this.position < this.tokens.length; ) this.parse(!0);
|
|
2934
|
+
return this.root;
|
|
2935
|
+
}, j.prototype.parse = function(C) {
|
|
2936
|
+
switch (this.currToken[0]) {
|
|
2937
|
+
case "space":
|
|
2938
|
+
this.space();
|
|
2939
|
+
break;
|
|
2940
|
+
case "comment":
|
|
2941
|
+
this.comment();
|
|
2942
|
+
break;
|
|
2943
|
+
case "(":
|
|
2944
|
+
this.parentheses();
|
|
2945
|
+
break;
|
|
2946
|
+
case ")":
|
|
2947
|
+
C && this.missingParenthesis();
|
|
2948
|
+
break;
|
|
2949
|
+
case "[":
|
|
2950
|
+
this.attribute();
|
|
2951
|
+
break;
|
|
2952
|
+
case "]":
|
|
2953
|
+
this.missingSquareBracket();
|
|
2954
|
+
break;
|
|
2955
|
+
case "at-word":
|
|
2956
|
+
case "word":
|
|
2957
|
+
this.word();
|
|
2958
|
+
break;
|
|
2959
|
+
case ":":
|
|
2960
|
+
this.pseudo();
|
|
2961
|
+
break;
|
|
2962
|
+
case ";":
|
|
2963
|
+
this.missingBackslash();
|
|
2964
|
+
break;
|
|
2965
|
+
case ",":
|
|
2966
|
+
this.comma();
|
|
2967
|
+
break;
|
|
2968
|
+
case "*":
|
|
2969
|
+
this.universal();
|
|
2970
|
+
break;
|
|
2971
|
+
case "&":
|
|
2972
|
+
this.nesting();
|
|
2973
|
+
break;
|
|
2974
|
+
case "combinator":
|
|
2975
|
+
this.combinator();
|
|
2976
|
+
break;
|
|
2977
|
+
case "string":
|
|
2978
|
+
this.string();
|
|
2979
|
+
break;
|
|
2980
|
+
}
|
|
2981
|
+
}, j.prototype.parseNamespace = function(C) {
|
|
2982
|
+
if (this.lossy && typeof C == "string") {
|
|
2983
|
+
var S = C.trim();
|
|
2984
|
+
return S.length ? S : !0;
|
|
2985
|
+
}
|
|
2986
|
+
return C;
|
|
2987
|
+
}, j.prototype.parseSpace = function(C, S) {
|
|
2988
|
+
return this.lossy ? S || "" : C;
|
|
2989
|
+
}, j.prototype.parseValue = function(C) {
|
|
2990
|
+
return this.lossy && C && typeof C == "string" ? C.trim() : C;
|
|
2991
|
+
}, j.prototype.parseParenthesisToken = function(C) {
|
|
2992
|
+
return this.lossy ? C[0] === "space" ? this.parseSpace(C[1], " ") : this.parseValue(C[1]) : C[1];
|
|
2993
|
+
}, j.prototype.newNode = function(C, S) {
|
|
2994
|
+
return S && (C.namespace = this.parseNamespace(S)), this.spaces && (C.spaces.before = this.spaces, this.spaces = ""), this.current.append(C);
|
|
2995
|
+
}, n(j, [{ key: "currToken", get: function() {
|
|
2996
|
+
return this.tokens[this.position];
|
|
2997
|
+
} }, { key: "nextToken", get: function() {
|
|
2998
|
+
return this.tokens[this.position + 1];
|
|
2999
|
+
} }, { key: "prevToken", get: function() {
|
|
3000
|
+
return this.tokens[this.position - 1];
|
|
3001
|
+
} }]), j;
|
|
3002
|
+
})();
|
|
3003
|
+
e.default = lt, s.exports = e.default;
|
|
3004
|
+
}), Ws = E((e, s) => {
|
|
3005
|
+
e.__esModule = !0;
|
|
3006
|
+
var n = /* @__PURE__ */ (function() {
|
|
3007
|
+
function m(p, r) {
|
|
3008
|
+
for (var t = 0; t < r.length; t++) {
|
|
3009
|
+
var h = r[t];
|
|
3010
|
+
h.enumerable = h.enumerable || !1, h.configurable = !0, "value" in h && (h.writable = !0), Object.defineProperty(p, h.key, h);
|
|
3011
|
+
}
|
|
3012
|
+
}
|
|
3013
|
+
return function(p, r, t) {
|
|
3014
|
+
return r && m(p.prototype, r), t && m(p, t), p;
|
|
3015
|
+
};
|
|
3016
|
+
})(), o = Ls(), c = i(o);
|
|
3017
|
+
function i(m) {
|
|
3018
|
+
return m && m.__esModule ? m : { default: m };
|
|
3019
|
+
}
|
|
3020
|
+
function f(m, p) {
|
|
3021
|
+
if (!(m instanceof p)) throw new TypeError("Cannot call a class as a function");
|
|
3022
|
+
}
|
|
3023
|
+
var u = (function() {
|
|
3024
|
+
function m(p) {
|
|
3025
|
+
return f(this, m), this.func = p || function() {
|
|
3026
|
+
}, this;
|
|
3027
|
+
}
|
|
3028
|
+
return m.prototype.process = function(p) {
|
|
3029
|
+
var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, t = new c.default({ css: p, error: function(h) {
|
|
3030
|
+
throw new Error(h);
|
|
3031
|
+
}, options: r });
|
|
3032
|
+
return this.res = t, this.func(t), this;
|
|
3033
|
+
}, n(m, [{ key: "result", get: function() {
|
|
3034
|
+
return String(this.res);
|
|
3035
|
+
} }]), m;
|
|
3036
|
+
})();
|
|
3037
|
+
e.default = u, s.exports = e.default;
|
|
3038
|
+
}), ee = E((e, s) => {
|
|
3039
|
+
var n = function(o, c) {
|
|
3040
|
+
let i = new o.constructor();
|
|
3041
|
+
for (let f in o) {
|
|
3042
|
+
if (!o.hasOwnProperty(f)) continue;
|
|
3043
|
+
let u = o[f], m = typeof u;
|
|
3044
|
+
f === "parent" && m === "object" ? c && (i[f] = c) : f === "source" ? i[f] = u : u instanceof Array ? i[f] = u.map((p) => n(p, i)) : f !== "before" && f !== "after" && f !== "between" && f !== "semicolon" && (m === "object" && u !== null && (u = n(u)), i[f] = u);
|
|
3045
|
+
}
|
|
3046
|
+
return i;
|
|
3047
|
+
};
|
|
3048
|
+
s.exports = class {
|
|
3049
|
+
constructor(o) {
|
|
3050
|
+
o = o || {}, this.raws = { before: "", after: "" };
|
|
3051
|
+
for (let c in o) this[c] = o[c];
|
|
3052
|
+
}
|
|
3053
|
+
remove() {
|
|
3054
|
+
return this.parent && this.parent.removeChild(this), this.parent = void 0, this;
|
|
3055
|
+
}
|
|
3056
|
+
toString() {
|
|
3057
|
+
return [this.raws.before, String(this.value), this.raws.after].join("");
|
|
3058
|
+
}
|
|
3059
|
+
clone(o) {
|
|
3060
|
+
o = o || {};
|
|
3061
|
+
let c = n(this);
|
|
3062
|
+
for (let i in o) c[i] = o[i];
|
|
3063
|
+
return c;
|
|
3064
|
+
}
|
|
3065
|
+
cloneBefore(o) {
|
|
3066
|
+
o = o || {};
|
|
3067
|
+
let c = this.clone(o);
|
|
3068
|
+
return this.parent.insertBefore(this, c), c;
|
|
3069
|
+
}
|
|
3070
|
+
cloneAfter(o) {
|
|
3071
|
+
o = o || {};
|
|
3072
|
+
let c = this.clone(o);
|
|
3073
|
+
return this.parent.insertAfter(this, c), c;
|
|
3074
|
+
}
|
|
3075
|
+
replaceWith() {
|
|
3076
|
+
let o = Array.prototype.slice.call(arguments);
|
|
3077
|
+
if (this.parent) {
|
|
3078
|
+
for (let c of o) this.parent.insertBefore(this, c);
|
|
3079
|
+
this.remove();
|
|
3080
|
+
}
|
|
3081
|
+
return this;
|
|
3082
|
+
}
|
|
3083
|
+
moveTo(o) {
|
|
3084
|
+
return this.cleanRaws(this.root() === o.root()), this.remove(), o.append(this), this;
|
|
3085
|
+
}
|
|
3086
|
+
moveBefore(o) {
|
|
3087
|
+
return this.cleanRaws(this.root() === o.root()), this.remove(), o.parent.insertBefore(o, this), this;
|
|
3088
|
+
}
|
|
3089
|
+
moveAfter(o) {
|
|
3090
|
+
return this.cleanRaws(this.root() === o.root()), this.remove(), o.parent.insertAfter(o, this), this;
|
|
3091
|
+
}
|
|
3092
|
+
next() {
|
|
3093
|
+
let o = this.parent.index(this);
|
|
3094
|
+
return this.parent.nodes[o + 1];
|
|
3095
|
+
}
|
|
3096
|
+
prev() {
|
|
3097
|
+
let o = this.parent.index(this);
|
|
3098
|
+
return this.parent.nodes[o - 1];
|
|
3099
|
+
}
|
|
3100
|
+
toJSON() {
|
|
3101
|
+
let o = {};
|
|
3102
|
+
for (let c in this) {
|
|
3103
|
+
if (!this.hasOwnProperty(c) || c === "parent") continue;
|
|
3104
|
+
let i = this[c];
|
|
3105
|
+
i instanceof Array ? o[c] = i.map((f) => typeof f == "object" && f.toJSON ? f.toJSON() : f) : typeof i == "object" && i.toJSON ? o[c] = i.toJSON() : o[c] = i;
|
|
3106
|
+
}
|
|
3107
|
+
return o;
|
|
3108
|
+
}
|
|
3109
|
+
root() {
|
|
3110
|
+
let o = this;
|
|
3111
|
+
for (; o.parent; ) o = o.parent;
|
|
3112
|
+
return o;
|
|
3113
|
+
}
|
|
3114
|
+
cleanRaws(o) {
|
|
3115
|
+
delete this.raws.before, delete this.raws.after, o || delete this.raws.between;
|
|
3116
|
+
}
|
|
3117
|
+
positionInside(o) {
|
|
3118
|
+
let c = this.toString(), i = this.source.start.column, f = this.source.start.line;
|
|
3119
|
+
for (let u = 0; u < o; u++) c[u] === `
|
|
3120
|
+
` ? (i = 1, f += 1) : i += 1;
|
|
3121
|
+
return { line: f, column: i };
|
|
3122
|
+
}
|
|
3123
|
+
positionBy(o) {
|
|
3124
|
+
let c = this.source.start;
|
|
3125
|
+
if (Object(o).index) c = this.positionInside(o.index);
|
|
3126
|
+
else if (Object(o).word) {
|
|
3127
|
+
let i = this.toString().indexOf(o.word);
|
|
3128
|
+
i !== -1 && (c = this.positionInside(i));
|
|
3129
|
+
}
|
|
3130
|
+
return c;
|
|
3131
|
+
}
|
|
3132
|
+
};
|
|
3133
|
+
}), Q = E((e, s) => {
|
|
3134
|
+
var n = ee(), o = class extends n {
|
|
3135
|
+
constructor(c) {
|
|
3136
|
+
super(c), this.nodes || (this.nodes = []);
|
|
3137
|
+
}
|
|
3138
|
+
push(c) {
|
|
3139
|
+
return c.parent = this, this.nodes.push(c), this;
|
|
3140
|
+
}
|
|
3141
|
+
each(c) {
|
|
3142
|
+
this.lastEach || (this.lastEach = 0), this.indexes || (this.indexes = {}), this.lastEach += 1;
|
|
3143
|
+
let i = this.lastEach, f, u;
|
|
3144
|
+
if (this.indexes[i] = 0, !!this.nodes) {
|
|
3145
|
+
for (; this.indexes[i] < this.nodes.length && (f = this.indexes[i], u = c(this.nodes[f], f), u !== !1); ) this.indexes[i] += 1;
|
|
3146
|
+
return delete this.indexes[i], u;
|
|
3147
|
+
}
|
|
3148
|
+
}
|
|
3149
|
+
walk(c) {
|
|
3150
|
+
return this.each((i, f) => {
|
|
3151
|
+
let u = c(i, f);
|
|
3152
|
+
return u !== !1 && i.walk && (u = i.walk(c)), u;
|
|
3153
|
+
});
|
|
3154
|
+
}
|
|
3155
|
+
walkType(c, i) {
|
|
3156
|
+
if (!c || !i) throw new Error("Parameters {type} and {callback} are required.");
|
|
3157
|
+
let f = typeof c == "function";
|
|
3158
|
+
return this.walk((u, m) => {
|
|
3159
|
+
if (f && u instanceof c || !f && u.type === c) return i.call(this, u, m);
|
|
3160
|
+
});
|
|
3161
|
+
}
|
|
3162
|
+
append(c) {
|
|
3163
|
+
return c.parent = this, this.nodes.push(c), this;
|
|
3164
|
+
}
|
|
3165
|
+
prepend(c) {
|
|
3166
|
+
return c.parent = this, this.nodes.unshift(c), this;
|
|
3167
|
+
}
|
|
3168
|
+
cleanRaws(c) {
|
|
3169
|
+
if (super.cleanRaws(c), this.nodes) for (let i of this.nodes) i.cleanRaws(c);
|
|
3170
|
+
}
|
|
3171
|
+
insertAfter(c, i) {
|
|
3172
|
+
let f = this.index(c), u;
|
|
3173
|
+
this.nodes.splice(f + 1, 0, i);
|
|
3174
|
+
for (let m in this.indexes) u = this.indexes[m], f <= u && (this.indexes[m] = u + this.nodes.length);
|
|
3175
|
+
return this;
|
|
3176
|
+
}
|
|
3177
|
+
insertBefore(c, i) {
|
|
3178
|
+
let f = this.index(c), u;
|
|
3179
|
+
this.nodes.splice(f, 0, i);
|
|
3180
|
+
for (let m in this.indexes) u = this.indexes[m], f <= u && (this.indexes[m] = u + this.nodes.length);
|
|
3181
|
+
return this;
|
|
3182
|
+
}
|
|
3183
|
+
removeChild(c) {
|
|
3184
|
+
c = this.index(c), this.nodes[c].parent = void 0, this.nodes.splice(c, 1);
|
|
3185
|
+
let i;
|
|
3186
|
+
for (let f in this.indexes) i = this.indexes[f], i >= c && (this.indexes[f] = i - 1);
|
|
3187
|
+
return this;
|
|
3188
|
+
}
|
|
3189
|
+
removeAll() {
|
|
3190
|
+
for (let c of this.nodes) c.parent = void 0;
|
|
3191
|
+
return this.nodes = [], this;
|
|
3192
|
+
}
|
|
3193
|
+
every(c) {
|
|
3194
|
+
return this.nodes.every(c);
|
|
3195
|
+
}
|
|
3196
|
+
some(c) {
|
|
3197
|
+
return this.nodes.some(c);
|
|
3198
|
+
}
|
|
3199
|
+
index(c) {
|
|
3200
|
+
return typeof c == "number" ? c : this.nodes.indexOf(c);
|
|
3201
|
+
}
|
|
3202
|
+
get first() {
|
|
3203
|
+
if (this.nodes) return this.nodes[0];
|
|
3204
|
+
}
|
|
3205
|
+
get last() {
|
|
3206
|
+
if (this.nodes) return this.nodes[this.nodes.length - 1];
|
|
3207
|
+
}
|
|
3208
|
+
toString() {
|
|
3209
|
+
let c = this.nodes.map(String).join("");
|
|
3210
|
+
return this.value && (c = this.value + c), this.raws.before && (c = this.raws.before + c), this.raws.after && (c += this.raws.after), c;
|
|
3211
|
+
}
|
|
3212
|
+
};
|
|
3213
|
+
o.registerWalker = (c) => {
|
|
3214
|
+
let i = "walk" + c.name;
|
|
3215
|
+
i.lastIndexOf("s") !== i.length - 1 && (i += "s"), !o.prototype[i] && (o.prototype[i] = function(f) {
|
|
3216
|
+
return this.walkType(c, f);
|
|
3217
|
+
});
|
|
3218
|
+
}, s.exports = o;
|
|
3219
|
+
}), zs = E((e, s) => {
|
|
3220
|
+
var n = Q();
|
|
3221
|
+
s.exports = class extends n {
|
|
3222
|
+
constructor(o) {
|
|
3223
|
+
super(o), this.type = "root";
|
|
3224
|
+
}
|
|
3225
|
+
};
|
|
3226
|
+
}), qs = E((e, s) => {
|
|
3227
|
+
var n = Q();
|
|
3228
|
+
s.exports = class extends n {
|
|
3229
|
+
constructor(o) {
|
|
3230
|
+
super(o), this.type = "value", this.unbalanced = 0;
|
|
3231
|
+
}
|
|
3232
|
+
};
|
|
3233
|
+
}), Bs = E((e, s) => {
|
|
3234
|
+
var n = Q(), o = class extends n {
|
|
3235
|
+
constructor(c) {
|
|
3236
|
+
super(c), this.type = "atword";
|
|
3237
|
+
}
|
|
3238
|
+
toString() {
|
|
3239
|
+
return this.quoted && this.raws.quote, [this.raws.before, "@", String.prototype.toString.call(this.value), this.raws.after].join("");
|
|
3240
|
+
}
|
|
3241
|
+
};
|
|
3242
|
+
n.registerWalker(o), s.exports = o;
|
|
3243
|
+
}), Fs = E((e, s) => {
|
|
3244
|
+
var n = Q(), o = ee(), c = class extends o {
|
|
3245
|
+
constructor(i) {
|
|
3246
|
+
super(i), this.type = "colon";
|
|
3247
|
+
}
|
|
3248
|
+
};
|
|
3249
|
+
n.registerWalker(c), s.exports = c;
|
|
3250
|
+
}), Ds = E((e, s) => {
|
|
3251
|
+
var n = Q(), o = ee(), c = class extends o {
|
|
3252
|
+
constructor(i) {
|
|
3253
|
+
super(i), this.type = "comma";
|
|
3254
|
+
}
|
|
3255
|
+
};
|
|
3256
|
+
n.registerWalker(c), s.exports = c;
|
|
3257
|
+
}), Us = E((e, s) => {
|
|
3258
|
+
var n = Q(), o = ee(), c = class extends o {
|
|
3259
|
+
constructor(i) {
|
|
3260
|
+
super(i), this.type = "comment", this.inline = Object(i).inline || !1;
|
|
3261
|
+
}
|
|
3262
|
+
toString() {
|
|
3263
|
+
return [this.raws.before, this.inline ? "//" : "/*", String(this.value), this.inline ? "" : "*/", this.raws.after].join("");
|
|
3264
|
+
}
|
|
3265
|
+
};
|
|
3266
|
+
n.registerWalker(c), s.exports = c;
|
|
3267
|
+
}), Vs = E((e, s) => {
|
|
3268
|
+
var n = Q(), o = class extends n {
|
|
3269
|
+
constructor(c) {
|
|
3270
|
+
super(c), this.type = "func", this.unbalanced = -1;
|
|
3271
|
+
}
|
|
3272
|
+
};
|
|
3273
|
+
n.registerWalker(o), s.exports = o;
|
|
3274
|
+
}), Gs = E((e, s) => {
|
|
3275
|
+
var n = Q(), o = ee(), c = class extends o {
|
|
3276
|
+
constructor(i) {
|
|
3277
|
+
super(i), this.type = "number", this.unit = Object(i).unit || "";
|
|
3278
|
+
}
|
|
3279
|
+
toString() {
|
|
3280
|
+
return [this.raws.before, String(this.value), this.unit, this.raws.after].join("");
|
|
3281
|
+
}
|
|
3282
|
+
};
|
|
3283
|
+
n.registerWalker(c), s.exports = c;
|
|
3284
|
+
}), Js = E((e, s) => {
|
|
3285
|
+
var n = Q(), o = ee(), c = class extends o {
|
|
3286
|
+
constructor(i) {
|
|
3287
|
+
super(i), this.type = "operator";
|
|
3288
|
+
}
|
|
3289
|
+
};
|
|
3290
|
+
n.registerWalker(c), s.exports = c;
|
|
3291
|
+
}), Hs = E((e, s) => {
|
|
3292
|
+
var n = Q(), o = ee(), c = class extends o {
|
|
3293
|
+
constructor(i) {
|
|
3294
|
+
super(i), this.type = "paren", this.parenType = "";
|
|
3295
|
+
}
|
|
3296
|
+
};
|
|
3297
|
+
n.registerWalker(c), s.exports = c;
|
|
3298
|
+
}), Qs = E((e, s) => {
|
|
3299
|
+
var n = Q(), o = ee(), c = class extends o {
|
|
3300
|
+
constructor(i) {
|
|
3301
|
+
super(i), this.type = "string";
|
|
3302
|
+
}
|
|
3303
|
+
toString() {
|
|
3304
|
+
let i = this.quoted ? this.raws.quote : "";
|
|
3305
|
+
return [this.raws.before, i, this.value + "", i, this.raws.after].join("");
|
|
3306
|
+
}
|
|
3307
|
+
};
|
|
3308
|
+
n.registerWalker(c), s.exports = c;
|
|
3309
|
+
}), Zs = E((e, s) => {
|
|
3310
|
+
var n = Q(), o = ee(), c = class extends o {
|
|
3311
|
+
constructor(i) {
|
|
3312
|
+
super(i), this.type = "word";
|
|
3313
|
+
}
|
|
3314
|
+
};
|
|
3315
|
+
n.registerWalker(c), s.exports = c;
|
|
3316
|
+
}), Ks = E((e, s) => {
|
|
3317
|
+
var n = Q(), o = ee(), c = class extends o {
|
|
3318
|
+
constructor(i) {
|
|
3319
|
+
super(i), this.type = "unicode-range";
|
|
3320
|
+
}
|
|
3321
|
+
};
|
|
3322
|
+
n.registerWalker(c), s.exports = c;
|
|
3323
|
+
}), Xs = E((e, s) => {
|
|
3324
|
+
var n = class extends Error {
|
|
3325
|
+
constructor(o) {
|
|
3326
|
+
super(o), this.name = this.constructor.name, this.message = o || "An error ocurred while tokzenizing.", typeof Error.captureStackTrace == "function" ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error(o).stack;
|
|
3327
|
+
}
|
|
3328
|
+
};
|
|
3329
|
+
s.exports = n;
|
|
3330
|
+
}), Ys = E((e, s) => {
|
|
3331
|
+
var n = /[ \n\t\r\{\(\)'"\\;,/]/g, o = /[ \n\t\r\(\)\{\}\*:;@!&'"\+\|~>,\[\]\\]|\/(?=\*)/g, c = /[ \n\t\r\(\)\{\}\*:;@!&'"\-\+\|~>,\[\]\\]|\//g, i = /^[a-z0-9]/i, f = /^[a-f0-9?\-]/i, u = Xs();
|
|
3332
|
+
s.exports = function(m, p) {
|
|
3333
|
+
p = p || {};
|
|
3334
|
+
let r = [], t = m.valueOf(), h = t.length, a = -1, d = 1, l = 0, b = 0, y = null, v, g, k, w, x, O, T, _, A, I, N;
|
|
3335
|
+
function R($) {
|
|
3336
|
+
let M = `Unclosed ${$} at line: ${d}, column: ${l - a}, token: ${l}`;
|
|
3337
|
+
throw new u(M);
|
|
3338
|
+
}
|
|
3339
|
+
for (; l < h; ) {
|
|
3340
|
+
switch (v = t.charCodeAt(l), v === 10 && (a = l, d += 1), v) {
|
|
3341
|
+
case 10:
|
|
3342
|
+
case 32:
|
|
3343
|
+
case 9:
|
|
3344
|
+
case 13:
|
|
3345
|
+
case 12:
|
|
3346
|
+
g = l;
|
|
3347
|
+
do
|
|
3348
|
+
g += 1, v = t.charCodeAt(g), v === 10 && (a = g, d += 1);
|
|
3349
|
+
while (v === 32 || v === 10 || v === 9 || v === 13 || v === 12);
|
|
3350
|
+
r.push(["space", t.slice(l, g), d, l - a, d, g - a, l]), l = g - 1;
|
|
3351
|
+
break;
|
|
3352
|
+
case 58:
|
|
3353
|
+
g = l + 1, r.push(["colon", t.slice(l, g), d, l - a, d, g - a, l]), l = g - 1;
|
|
3354
|
+
break;
|
|
3355
|
+
case 44:
|
|
3356
|
+
g = l + 1, r.push(["comma", t.slice(l, g), d, l - a, d, g - a, l]), l = g - 1;
|
|
3357
|
+
break;
|
|
3358
|
+
case 123:
|
|
3359
|
+
r.push(["{", "{", d, l - a, d, g - a, l]);
|
|
3360
|
+
break;
|
|
3361
|
+
case 125:
|
|
3362
|
+
r.push(["}", "}", d, l - a, d, g - a, l]);
|
|
3363
|
+
break;
|
|
3364
|
+
case 40:
|
|
3365
|
+
b++, y = !y && b === 1 && r.length > 0 && r[r.length - 1][0] === "word" && r[r.length - 1][1] === "url", r.push(["(", "(", d, l - a, d, g - a, l]);
|
|
3366
|
+
break;
|
|
3367
|
+
case 41:
|
|
3368
|
+
b--, y = y && b > 0, r.push([")", ")", d, l - a, d, g - a, l]);
|
|
3369
|
+
break;
|
|
3370
|
+
case 39:
|
|
3371
|
+
case 34:
|
|
3372
|
+
k = v === 39 ? "'" : '"', g = l;
|
|
3373
|
+
do
|
|
3374
|
+
for (A = !1, g = t.indexOf(k, g + 1), g === -1 && R("quote"), I = g; t.charCodeAt(I - 1) === 92; ) I -= 1, A = !A;
|
|
3375
|
+
while (A);
|
|
3376
|
+
r.push(["string", t.slice(l, g + 1), d, l - a, d, g - a, l]), l = g;
|
|
3377
|
+
break;
|
|
3378
|
+
case 64:
|
|
3379
|
+
n.lastIndex = l + 1, n.test(t), n.lastIndex === 0 ? g = t.length - 1 : g = n.lastIndex - 2, r.push(["atword", t.slice(l, g + 1), d, l - a, d, g - a, l]), l = g;
|
|
3380
|
+
break;
|
|
3381
|
+
case 92:
|
|
3382
|
+
g = l, v = t.charCodeAt(g + 1), r.push(["word", t.slice(l, g + 1), d, l - a, d, g - a, l]), l = g;
|
|
3383
|
+
break;
|
|
3384
|
+
case 43:
|
|
3385
|
+
case 45:
|
|
3386
|
+
case 42:
|
|
3387
|
+
if (g = l + 1, N = t.slice(l + 1, g + 1), t.slice(l - 1, l), v === 45 && N.charCodeAt(0) === 45) {
|
|
3388
|
+
g++, r.push(["word", t.slice(l, g), d, l - a, d, g - a, l]), l = g - 1;
|
|
3389
|
+
break;
|
|
3390
|
+
}
|
|
3391
|
+
r.push(["operator", t.slice(l, g), d, l - a, d, g - a, l]), l = g - 1;
|
|
3392
|
+
break;
|
|
3393
|
+
default:
|
|
3394
|
+
if (v === 47 && (t.charCodeAt(l + 1) === 42 || p.loose && !y && t.charCodeAt(l + 1) === 47)) {
|
|
3395
|
+
if (t.charCodeAt(l + 1) === 42) g = t.indexOf("*/", l + 2) + 1, g === 0 && R("comment");
|
|
3396
|
+
else {
|
|
3397
|
+
let $ = t.indexOf(`
|
|
3398
|
+
`, l + 2);
|
|
3399
|
+
g = $ !== -1 ? $ - 1 : h;
|
|
3400
|
+
}
|
|
3401
|
+
O = t.slice(l, g + 1), w = O.split(`
|
|
3402
|
+
`), x = w.length - 1, x > 0 ? (T = d + x, _ = g - w[x].length) : (T = d, _ = a), r.push(["comment", O, d, l - a, T, g - _, l]), a = _, d = T, l = g;
|
|
3403
|
+
} else if (v === 35 && !i.test(t.slice(l + 1, l + 2))) g = l + 1, r.push(["#", t.slice(l, g), d, l - a, d, g - a, l]), l = g - 1;
|
|
3404
|
+
else if ((v === 117 || v === 85) && t.charCodeAt(l + 1) === 43) {
|
|
3405
|
+
g = l + 2;
|
|
3406
|
+
do
|
|
3407
|
+
g += 1, v = t.charCodeAt(g);
|
|
3408
|
+
while (g < h && f.test(t.slice(g, g + 1)));
|
|
3409
|
+
r.push(["unicoderange", t.slice(l, g), d, l - a, d, g - a, l]), l = g - 1;
|
|
3410
|
+
} else if (v === 47) g = l + 1, r.push(["operator", t.slice(l, g), d, l - a, d, g - a, l]), l = g - 1;
|
|
3411
|
+
else {
|
|
3412
|
+
let $ = o;
|
|
3413
|
+
if (v >= 48 && v <= 57 && ($ = c), $.lastIndex = l + 1, $.test(t), $.lastIndex === 0 ? g = t.length - 1 : g = $.lastIndex - 2, $ === c || v === 46) {
|
|
3414
|
+
let M = t.charCodeAt(g), P = t.charCodeAt(g + 1), D = t.charCodeAt(g + 2);
|
|
3415
|
+
(M === 101 || M === 69) && (P === 45 || P === 43) && D >= 48 && D <= 57 && (c.lastIndex = g + 2, c.test(t), c.lastIndex === 0 ? g = t.length - 1 : g = c.lastIndex - 2);
|
|
3416
|
+
}
|
|
3417
|
+
r.push(["word", t.slice(l, g + 1), d, l - a, d, g - a, l]), l = g;
|
|
3418
|
+
}
|
|
3419
|
+
break;
|
|
3420
|
+
}
|
|
3421
|
+
l++;
|
|
3422
|
+
}
|
|
3423
|
+
return r;
|
|
3424
|
+
};
|
|
3425
|
+
}), en = E((e, s) => {
|
|
3426
|
+
var n = class extends Error {
|
|
3427
|
+
constructor(o) {
|
|
3428
|
+
super(o), this.name = this.constructor.name, this.message = o || "An error ocurred while parsing.", typeof Error.captureStackTrace == "function" ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error(o).stack;
|
|
3429
|
+
}
|
|
3430
|
+
};
|
|
3431
|
+
s.exports = n;
|
|
3432
|
+
}), tn = E((e, s) => {
|
|
3433
|
+
var n = zs(), o = qs(), c = Bs(), i = Fs(), f = Ds(), u = Us(), m = Vs(), p = Gs(), r = Js(), t = Hs(), h = Qs(), a = Zs(), d = Ks(), l = Ys(), b = ur(), y = lr(), v = cr(), g = en();
|
|
3434
|
+
function k(w) {
|
|
3435
|
+
return w.sort((x, O) => x - O);
|
|
3436
|
+
}
|
|
3437
|
+
s.exports = class {
|
|
3438
|
+
constructor(w, x) {
|
|
3439
|
+
let O = { loose: !1 };
|
|
3440
|
+
this.cache = [], this.input = w, this.options = Object.assign({}, O, x), this.position = 0, this.unbalanced = 0, this.root = new n();
|
|
3441
|
+
let T = new o();
|
|
3442
|
+
this.root.append(T), this.current = T, this.tokens = l(w, this.options);
|
|
3443
|
+
}
|
|
3444
|
+
parse() {
|
|
3445
|
+
return this.loop();
|
|
3446
|
+
}
|
|
3447
|
+
colon() {
|
|
3448
|
+
let w = this.currToken;
|
|
3449
|
+
this.newNode(new i({ value: w[1], source: { start: { line: w[2], column: w[3] }, end: { line: w[4], column: w[5] } }, sourceIndex: w[6] })), this.position++;
|
|
3450
|
+
}
|
|
3451
|
+
comma() {
|
|
3452
|
+
let w = this.currToken;
|
|
3453
|
+
this.newNode(new f({ value: w[1], source: { start: { line: w[2], column: w[3] }, end: { line: w[4], column: w[5] } }, sourceIndex: w[6] })), this.position++;
|
|
3454
|
+
}
|
|
3455
|
+
comment() {
|
|
3456
|
+
let w = !1, x = this.currToken[1].replace(/\/\*|\*\//g, ""), O;
|
|
3457
|
+
this.options.loose && x.startsWith("//") && (x = x.substring(2), w = !0), O = new u({ value: x, inline: w, source: { start: { line: this.currToken[2], column: this.currToken[3] }, end: { line: this.currToken[4], column: this.currToken[5] } }, sourceIndex: this.currToken[6] }), this.newNode(O), this.position++;
|
|
3458
|
+
}
|
|
3459
|
+
error(w, x) {
|
|
3460
|
+
throw new g(w + ` at line: ${x[2]}, column ${x[3]}`);
|
|
3461
|
+
}
|
|
3462
|
+
loop() {
|
|
3463
|
+
for (; this.position < this.tokens.length; ) this.parseTokens();
|
|
3464
|
+
return !this.current.last && this.spaces ? this.current.raws.before += this.spaces : this.spaces && (this.current.last.raws.after += this.spaces), this.spaces = "", this.root;
|
|
3465
|
+
}
|
|
3466
|
+
operator() {
|
|
3467
|
+
let w = this.currToken[1], x;
|
|
3468
|
+
if (w === "+" || w === "-") {
|
|
3469
|
+
if (this.options.loose || this.position > 0 && (this.current.type === "func" && this.current.value === "calc" ? this.prevToken[0] !== "space" && this.prevToken[0] !== "(" ? this.error("Syntax Error", this.currToken) : this.nextToken[0] !== "space" && this.nextToken[0] !== "word" ? this.error("Syntax Error", this.currToken) : this.nextToken[0] === "word" && this.current.last.type !== "operator" && this.current.last.value !== "(" && this.error("Syntax Error", this.currToken) : (this.nextToken[0] === "space" || this.nextToken[0] === "operator" || this.prevToken[0] === "operator") && this.error("Syntax Error", this.currToken)), this.options.loose) {
|
|
3470
|
+
if ((!this.current.nodes.length || this.current.last && this.current.last.type === "operator") && this.nextToken[0] === "word") return this.word();
|
|
3471
|
+
} else if (this.nextToken[0] === "word") return this.word();
|
|
3472
|
+
}
|
|
3473
|
+
return x = new r({ value: this.currToken[1], source: { start: { line: this.currToken[2], column: this.currToken[3] }, end: { line: this.currToken[2], column: this.currToken[3] } }, sourceIndex: this.currToken[4] }), this.position++, this.newNode(x);
|
|
3474
|
+
}
|
|
3475
|
+
parseTokens() {
|
|
3476
|
+
switch (this.currToken[0]) {
|
|
3477
|
+
case "space":
|
|
3478
|
+
this.space();
|
|
3479
|
+
break;
|
|
3480
|
+
case "colon":
|
|
3481
|
+
this.colon();
|
|
3482
|
+
break;
|
|
3483
|
+
case "comma":
|
|
3484
|
+
this.comma();
|
|
3485
|
+
break;
|
|
3486
|
+
case "comment":
|
|
3487
|
+
this.comment();
|
|
3488
|
+
break;
|
|
3489
|
+
case "(":
|
|
3490
|
+
this.parenOpen();
|
|
3491
|
+
break;
|
|
3492
|
+
case ")":
|
|
3493
|
+
this.parenClose();
|
|
3494
|
+
break;
|
|
3495
|
+
case "atword":
|
|
3496
|
+
case "word":
|
|
3497
|
+
this.word();
|
|
3498
|
+
break;
|
|
3499
|
+
case "operator":
|
|
3500
|
+
this.operator();
|
|
3501
|
+
break;
|
|
3502
|
+
case "string":
|
|
3503
|
+
this.string();
|
|
3504
|
+
break;
|
|
3505
|
+
case "unicoderange":
|
|
3506
|
+
this.unicodeRange();
|
|
3507
|
+
break;
|
|
3508
|
+
default:
|
|
3509
|
+
this.word();
|
|
3510
|
+
break;
|
|
3511
|
+
}
|
|
3512
|
+
}
|
|
3513
|
+
parenOpen() {
|
|
3514
|
+
let w = 1, x = this.position + 1, O = this.currToken, T;
|
|
3515
|
+
for (; x < this.tokens.length && w; ) {
|
|
3516
|
+
let _ = this.tokens[x];
|
|
3517
|
+
_[0] === "(" && w++, _[0] === ")" && w--, x++;
|
|
3518
|
+
}
|
|
3519
|
+
if (w && this.error("Expected closing parenthesis", O), T = this.current.last, T && T.type === "func" && T.unbalanced < 0 && (T.unbalanced = 0, this.current = T), this.current.unbalanced++, this.newNode(new t({ value: O[1], source: { start: { line: O[2], column: O[3] }, end: { line: O[4], column: O[5] } }, sourceIndex: O[6] })), this.position++, this.current.type === "func" && this.current.unbalanced && this.current.value === "url" && this.currToken[0] !== "string" && this.currToken[0] !== ")" && !this.options.loose) {
|
|
3520
|
+
let _ = this.nextToken, A = this.currToken[1], I = { line: this.currToken[2], column: this.currToken[3] };
|
|
3521
|
+
for (; _ && _[0] !== ")" && this.current.unbalanced; ) this.position++, A += this.currToken[1], _ = this.nextToken;
|
|
3522
|
+
this.position !== this.tokens.length - 1 && (this.position++, this.newNode(new a({ value: A, source: { start: I, end: { line: this.currToken[4], column: this.currToken[5] } }, sourceIndex: this.currToken[6] })));
|
|
3523
|
+
}
|
|
3524
|
+
}
|
|
3525
|
+
parenClose() {
|
|
3526
|
+
let w = this.currToken;
|
|
3527
|
+
this.newNode(new t({ value: w[1], source: { start: { line: w[2], column: w[3] }, end: { line: w[4], column: w[5] } }, sourceIndex: w[6] })), this.position++, !(this.position >= this.tokens.length - 1 && !this.current.unbalanced) && (this.current.unbalanced--, this.current.unbalanced < 0 && this.error("Expected opening parenthesis", w), !this.current.unbalanced && this.cache.length && (this.current = this.cache.pop()));
|
|
3528
|
+
}
|
|
3529
|
+
space() {
|
|
3530
|
+
let w = this.currToken;
|
|
3531
|
+
this.position === this.tokens.length - 1 || this.nextToken[0] === "," || this.nextToken[0] === ")" ? (this.current.last.raws.after += w[1], this.position++) : (this.spaces = w[1], this.position++);
|
|
3532
|
+
}
|
|
3533
|
+
unicodeRange() {
|
|
3534
|
+
let w = this.currToken;
|
|
3535
|
+
this.newNode(new d({ value: w[1], source: { start: { line: w[2], column: w[3] }, end: { line: w[4], column: w[5] } }, sourceIndex: w[6] })), this.position++;
|
|
3536
|
+
}
|
|
3537
|
+
splitWord() {
|
|
3538
|
+
let w = this.nextToken, x = this.currToken[1], O = /^[\+\-]?((\d+(\.\d*)?)|(\.\d+))([eE][\+\-]?\d+)?/, T = /^(?!\#([a-z0-9]+))[\#\{\}]/gi, _, A;
|
|
3539
|
+
if (!T.test(x)) for (; w && w[0] === "word"; ) {
|
|
3540
|
+
this.position++;
|
|
3541
|
+
let I = this.currToken[1];
|
|
3542
|
+
x += I, w = this.nextToken;
|
|
3543
|
+
}
|
|
3544
|
+
_ = y(x, "@"), A = k(v(b([[0], _]))), A.forEach((I, N) => {
|
|
3545
|
+
let R = A[N + 1] || x.length, $ = x.slice(I, R), M;
|
|
3546
|
+
if (~_.indexOf(I)) M = new c({ value: $.slice(1), source: { start: { line: this.currToken[2], column: this.currToken[3] + I }, end: { line: this.currToken[4], column: this.currToken[3] + (R - 1) } }, sourceIndex: this.currToken[6] + A[N] });
|
|
3547
|
+
else if (O.test(this.currToken[1])) {
|
|
3548
|
+
let P = $.replace(O, "");
|
|
3549
|
+
M = new p({ value: $.replace(P, ""), source: { start: { line: this.currToken[2], column: this.currToken[3] + I }, end: { line: this.currToken[4], column: this.currToken[3] + (R - 1) } }, sourceIndex: this.currToken[6] + A[N], unit: P });
|
|
3550
|
+
} else M = new (w && w[0] === "(" ? m : a)({ value: $, source: { start: { line: this.currToken[2], column: this.currToken[3] + I }, end: { line: this.currToken[4], column: this.currToken[3] + (R - 1) } }, sourceIndex: this.currToken[6] + A[N] }), M.type === "word" ? (M.isHex = /^#(.+)/.test($), M.isColor = /^#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test($)) : this.cache.push(this.current);
|
|
3551
|
+
this.newNode(M);
|
|
3552
|
+
}), this.position++;
|
|
3553
|
+
}
|
|
3554
|
+
string() {
|
|
3555
|
+
let w = this.currToken, x = this.currToken[1], O = /^(\"|\')/, T = O.test(x), _ = "", A;
|
|
3556
|
+
T && (_ = x.match(O)[0], x = x.slice(1, x.length - 1)), A = new h({ value: x, source: { start: { line: w[2], column: w[3] }, end: { line: w[4], column: w[5] } }, sourceIndex: w[6], quoted: T }), A.raws.quote = _, this.newNode(A), this.position++;
|
|
3557
|
+
}
|
|
3558
|
+
word() {
|
|
3559
|
+
return this.splitWord();
|
|
3560
|
+
}
|
|
3561
|
+
newNode(w) {
|
|
3562
|
+
return this.spaces && (w.raws.before += this.spaces, this.spaces = ""), this.current.append(w);
|
|
3563
|
+
}
|
|
3564
|
+
get currToken() {
|
|
3565
|
+
return this.tokens[this.position];
|
|
3566
|
+
}
|
|
3567
|
+
get nextToken() {
|
|
3568
|
+
return this.tokens[this.position + 1];
|
|
3569
|
+
}
|
|
3570
|
+
get prevToken() {
|
|
3571
|
+
return this.tokens[this.position - 1];
|
|
3572
|
+
}
|
|
3573
|
+
};
|
|
3574
|
+
}), pr = {};
|
|
3575
|
+
Qt(pr, { languages: () => pi, options: () => di, parsers: () => Dr, printers: () => Hi });
|
|
3576
|
+
var rn = (e, s, n, o) => {
|
|
3577
|
+
if (!(e && s == null)) return s.replaceAll ? s.replaceAll(n, o) : n.global ? s.replace(n, o) : s.split(n).join(o);
|
|
3578
|
+
}, F = rn, fr = "string", hr = "array", dr = "cursor", st = "indent", It = "align", mr = "trim", nt = "group", ot = "fill", it = "if-break", vr = "indent-if-break", Pt = "line-suffix", yr = "line-suffix-boundary", xe = "line", gr = "label", Mt = "break-parent", wr = /* @__PURE__ */ new Set([dr, st, It, mr, nt, ot, it, vr, Pt, yr, xe, gr, Mt]), sn = (e, s, n) => {
|
|
3579
|
+
if (!(e && s == null)) return Array.isArray(s) || typeof s == "string" ? s[n < 0 ? s.length + n : n] : s.at(n);
|
|
3580
|
+
}, ge = sn;
|
|
3581
|
+
function nn(e) {
|
|
3582
|
+
if (typeof e == "string") return fr;
|
|
3583
|
+
if (Array.isArray(e)) return hr;
|
|
3584
|
+
if (!e) return;
|
|
3585
|
+
let { type: s } = e;
|
|
3586
|
+
if (wr.has(s)) return s;
|
|
3587
|
+
}
|
|
3588
|
+
var Ie = nn, on = (e) => new Intl.ListFormat("en-US", { type: "disjunction" }).format(e);
|
|
3589
|
+
function an(e) {
|
|
3590
|
+
let s = e === null ? "null" : typeof e;
|
|
3591
|
+
if (s !== "string" && s !== "object") return `Unexpected doc '${s}',
|
|
3592
|
+
Expected it to be 'string' or 'object'.`;
|
|
3593
|
+
if (Ie(e)) throw new Error("doc is valid.");
|
|
3594
|
+
let n = Object.prototype.toString.call(e);
|
|
3595
|
+
if (n !== "[object Object]") return `Unexpected doc '${n}'.`;
|
|
3596
|
+
let o = on([...wr].map((c) => `'${c}'`));
|
|
3597
|
+
return `Unexpected doc.type '${e.type}'.
|
|
3598
|
+
Expected it to be ${o}.`;
|
|
3599
|
+
}
|
|
3600
|
+
var un = class extends Error {
|
|
3601
|
+
name = "InvalidDocError";
|
|
3602
|
+
constructor(e) {
|
|
3603
|
+
super(an(e)), this.doc = e;
|
|
3604
|
+
}
|
|
3605
|
+
}, ln = un;
|
|
3606
|
+
function cn(e, s) {
|
|
3607
|
+
if (typeof e == "string") return s(e);
|
|
3608
|
+
let n = /* @__PURE__ */ new Map();
|
|
3609
|
+
return o(e);
|
|
3610
|
+
function o(i) {
|
|
3611
|
+
if (n.has(i)) return n.get(i);
|
|
3612
|
+
let f = c(i);
|
|
3613
|
+
return n.set(i, f), f;
|
|
3614
|
+
}
|
|
3615
|
+
function c(i) {
|
|
3616
|
+
switch (Ie(i)) {
|
|
3617
|
+
case hr:
|
|
3618
|
+
return s(i.map(o));
|
|
3619
|
+
case ot:
|
|
3620
|
+
return s({ ...i, parts: i.parts.map(o) });
|
|
3621
|
+
case it:
|
|
3622
|
+
return s({ ...i, breakContents: o(i.breakContents), flatContents: o(i.flatContents) });
|
|
3623
|
+
case nt: {
|
|
3624
|
+
let { expandedStates: f, contents: u } = i;
|
|
3625
|
+
return f ? (f = f.map(o), u = f[0]) : u = o(u), s({ ...i, contents: u, expandedStates: f });
|
|
3626
|
+
}
|
|
3627
|
+
case It:
|
|
3628
|
+
case st:
|
|
3629
|
+
case vr:
|
|
3630
|
+
case gr:
|
|
3631
|
+
case Pt:
|
|
3632
|
+
return s({ ...i, contents: o(i.contents) });
|
|
3633
|
+
case fr:
|
|
3634
|
+
case dr:
|
|
3635
|
+
case mr:
|
|
3636
|
+
case yr:
|
|
3637
|
+
case xe:
|
|
3638
|
+
case Mt:
|
|
3639
|
+
return s(i);
|
|
3640
|
+
default:
|
|
3641
|
+
throw new ln(i);
|
|
3642
|
+
}
|
|
3643
|
+
}
|
|
3644
|
+
}
|
|
3645
|
+
function pn(e) {
|
|
3646
|
+
return e.type === xe && !e.hard ? e.soft ? "" : " " : e.type === it ? e.flatContents : e;
|
|
3647
|
+
}
|
|
3648
|
+
function fn(e) {
|
|
3649
|
+
return cn(e, pn);
|
|
3650
|
+
}
|
|
3651
|
+
var hn = () => {
|
|
3652
|
+
}, dn = hn;
|
|
3653
|
+
function H(e) {
|
|
3654
|
+
return { type: st, contents: e };
|
|
3655
|
+
}
|
|
3656
|
+
function br(e, s) {
|
|
3657
|
+
return { type: It, contents: s, n: e };
|
|
3658
|
+
}
|
|
3659
|
+
function K(e, s = {}) {
|
|
3660
|
+
return dn(s.expandedStates), { type: nt, id: s.id, contents: e, break: !!s.shouldBreak, expandedStates: s.expandedStates };
|
|
3661
|
+
}
|
|
3662
|
+
function mn(e) {
|
|
3663
|
+
return br({ type: "root" }, e);
|
|
3664
|
+
}
|
|
3665
|
+
function $e(e) {
|
|
3666
|
+
return br(-1, e);
|
|
3667
|
+
}
|
|
3668
|
+
function He(e) {
|
|
3669
|
+
return { type: ot, parts: e };
|
|
3670
|
+
}
|
|
3671
|
+
function xr(e, s = "", n = {}) {
|
|
3672
|
+
return { type: it, breakContents: e, flatContents: s, groupId: n.groupId };
|
|
3673
|
+
}
|
|
3674
|
+
function vn(e) {
|
|
3675
|
+
return { type: Pt, contents: e };
|
|
3676
|
+
}
|
|
3677
|
+
var $t = { type: Mt }, yn = { type: xe, hard: !0 }, U = { type: xe }, Z = { type: xe, soft: !0 }, B = [yn, $t];
|
|
3678
|
+
function oe(e, s) {
|
|
3679
|
+
let n = [];
|
|
3680
|
+
for (let o = 0; o < s.length; o++) o !== 0 && n.push(e), n.push(s[o]);
|
|
3681
|
+
return n;
|
|
3682
|
+
}
|
|
3683
|
+
function gn(e) {
|
|
3684
|
+
return Array.isArray(e) && e.length > 0;
|
|
3685
|
+
}
|
|
3686
|
+
var at = gn, kr = new Proxy(() => {
|
|
3687
|
+
}, { get: () => kr }), wn = kr, Ue = "'", Ft = '"';
|
|
3688
|
+
function bn(e, s) {
|
|
3689
|
+
let n = s === !0 || s === Ue ? Ue : Ft, o = n === Ue ? Ft : Ue, c = 0, i = 0;
|
|
3690
|
+
for (let f of e) f === n ? c++ : f === o && i++;
|
|
3691
|
+
return c > i ? o : n;
|
|
3692
|
+
}
|
|
3693
|
+
var xn = bn;
|
|
3694
|
+
function kn(e, s, n) {
|
|
3695
|
+
let o = s === '"' ? "'" : '"', c = F(!1, e, /\\(.)|(["'])/gsu, (i, f, u) => f === o ? f : u === s ? "\\" + u : u || (n && /^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(f) ? f : "\\" + f));
|
|
3696
|
+
return s + c + s;
|
|
3697
|
+
}
|
|
3698
|
+
var On = kn;
|
|
3699
|
+
function Tn(e, s) {
|
|
3700
|
+
wn.ok(/^(?<quote>["']).*\k<quote>$/su.test(e));
|
|
3701
|
+
let n = e.slice(1, -1), o = s.parser === "json" || s.parser === "jsonc" || s.parser === "json5" && s.quoteProps === "preserve" && !s.singleQuote ? '"' : s.__isInHtmlAttribute ? "'" : xn(n, s.singleQuote);
|
|
3702
|
+
return e.charAt(0) === o ? e : On(n, o, !1);
|
|
3703
|
+
}
|
|
3704
|
+
var Or = Tn, Cn = class extends Error {
|
|
3705
|
+
name = "UnexpectedNodeError";
|
|
3706
|
+
constructor(e, s, n = "type") {
|
|
3707
|
+
super(`Unexpected ${s} node ${n}: ${JSON.stringify(e[n])}.`), this.node = e;
|
|
3708
|
+
}
|
|
3709
|
+
}, Sn = Cn;
|
|
3710
|
+
function _n(e) {
|
|
3711
|
+
return e?.type === "front-matter";
|
|
3712
|
+
}
|
|
3713
|
+
var Xe = _n, En = /* @__PURE__ */ new Set(["raw", "raws", "sourceIndex", "source", "before", "after", "trailingComma", "spaces"]);
|
|
3714
|
+
function Tr(e, s, n) {
|
|
3715
|
+
if (Xe(e) && e.language === "yaml" && delete s.value, e.type === "css-comment" && n.type === "css-root" && n.nodes.length > 0 && ((n.nodes[0] === e || Xe(n.nodes[0]) && n.nodes[1] === e) && (delete s.text, /^\*\s*@(?:format|prettier)\s*$/u.test(e.text)) || n.type === "css-root" && ge(!1, n.nodes, -1) === e)) return null;
|
|
3716
|
+
if (e.type === "value-root" && delete s.text, (e.type === "media-query" || e.type === "media-query-list" || e.type === "media-feature-expression") && delete s.value, e.type === "css-rule" && delete s.params, (e.type === "media-feature" || e.type === "media-keyword" || e.type === "media-type" || e.type === "media-unknown" || e.type === "media-url" || e.type === "media-value" || e.type === "selector-attribute" || e.type === "selector-string" || e.type === "selector-class" || e.type === "selector-combinator" || e.type === "value-string") && e.value && (s.value = An(e.value)), e.type === "selector-combinator" && (s.value = F(!1, s.value, /\s+/gu, " ")), e.type === "media-feature" && (s.value = F(!1, s.value, " ", "")), (e.type === "value-word" && (e.isColor && e.isHex || ["initial", "inherit", "unset", "revert"].includes(e.value.toLowerCase())) || e.type === "media-feature" || e.type === "selector-root-invalid" || e.type === "selector-pseudo") && (s.value = s.value.toLowerCase()), e.type === "css-decl" && (s.prop = e.prop.toLowerCase()), (e.type === "css-atrule" || e.type === "css-import") && (s.name = e.name.toLowerCase()), e.type === "value-number" && (s.unit = e.unit.toLowerCase()), e.type === "value-unknown" && (s.value = F(!1, s.value, /;$/gu, "")), e.type === "selector-attribute" && (s.attribute = e.attribute.trim(), e.namespace && typeof e.namespace == "string" && (s.namespace = e.namespace.trim() || !0), e.value && (s.value = F(!1, s.value.trim(), /^["']|["']$/gu, ""), delete s.quoted)), (e.type === "media-value" || e.type === "media-type" || e.type === "value-number" || e.type === "selector-root-invalid" || e.type === "selector-class" || e.type === "selector-combinator" || e.type === "selector-tag") && e.value && (s.value = F(!1, s.value, /([\d+.e-]+)([a-z]*)/giu, (o, c, i) => {
|
|
3717
|
+
let f = Number(c);
|
|
3718
|
+
return Number.isNaN(f) ? o : f + i.toLowerCase();
|
|
3719
|
+
})), e.type === "selector-tag") {
|
|
3720
|
+
let o = s.value.toLowerCase();
|
|
3721
|
+
["from", "to"].includes(o) && (s.value = o);
|
|
3722
|
+
}
|
|
3723
|
+
if (e.type === "css-atrule" && e.name.toLowerCase() === "supports" && delete s.value, e.type === "selector-unknown" && delete s.value, e.type === "value-comma_group") {
|
|
3724
|
+
let o = e.groups.findIndex((c) => c.type === "value-number" && c.unit === "...");
|
|
3725
|
+
o !== -1 && (s.groups[o].unit = "", s.groups.splice(o + 1, 0, { type: "value-word", value: "...", isColor: !1, isHex: !1 }));
|
|
3726
|
+
}
|
|
3727
|
+
if (e.type === "value-comma_group" && e.groups.some((o) => o.type === "value-atword" && o.value.endsWith("[") || o.type === "value-word" && o.value.startsWith("]"))) return { type: "value-atword", value: e.groups.map((o) => o.value).join(""), group: { open: null, close: null, groups: [], type: "value-paren_group" } };
|
|
3728
|
+
}
|
|
3729
|
+
Tr.ignoredProperties = En;
|
|
3730
|
+
function An(e) {
|
|
3731
|
+
return F(!1, F(!1, e, "'", '"'), /\\([^\da-f])/giu, "$1");
|
|
3732
|
+
}
|
|
3733
|
+
var jn = Tr;
|
|
3734
|
+
async function In(e, s) {
|
|
3735
|
+
if (e.language === "yaml") {
|
|
3736
|
+
let n = e.value.trim(), o = n ? await s(n, { parser: "yaml" }) : "";
|
|
3737
|
+
return mn([e.startDelimiter, e.explicitLanguage, B, o, o ? B : "", e.endDelimiter]);
|
|
3738
|
+
}
|
|
3739
|
+
}
|
|
3740
|
+
var Pn = In;
|
|
3741
|
+
function Cr(e) {
|
|
3742
|
+
let { node: s } = e;
|
|
3743
|
+
if (s.type === "front-matter") return async (n) => {
|
|
3744
|
+
let o = await Pn(s, n);
|
|
3745
|
+
return o ? [o, B] : void 0;
|
|
3746
|
+
};
|
|
3747
|
+
}
|
|
3748
|
+
Cr.getVisitorKeys = (e) => e.type === "css-root" ? ["frontMatter"] : [];
|
|
3749
|
+
var Mn = Cr, Ce = null;
|
|
3750
|
+
function Pe(e) {
|
|
3751
|
+
if (Ce !== null && typeof Ce.property) {
|
|
3752
|
+
let s = Ce;
|
|
3753
|
+
return Ce = Pe.prototype = null, s;
|
|
3754
|
+
}
|
|
3755
|
+
return Ce = Pe.prototype = e ?? /* @__PURE__ */ Object.create(null), new Pe();
|
|
3756
|
+
}
|
|
3757
|
+
var $n = 10;
|
|
3758
|
+
for (let e = 0; e <= $n; e++) Pe();
|
|
3759
|
+
function Rn(e) {
|
|
3760
|
+
return Pe(e);
|
|
3761
|
+
}
|
|
3762
|
+
function Nn(e, s = "type") {
|
|
3763
|
+
Rn(e);
|
|
3764
|
+
function n(o) {
|
|
3765
|
+
let c = o[s], i = e[c];
|
|
3766
|
+
if (!Array.isArray(i)) throw Object.assign(new Error(`Missing visitor keys for '${c}'.`), { node: o });
|
|
3767
|
+
return i;
|
|
3768
|
+
}
|
|
3769
|
+
return n;
|
|
3770
|
+
}
|
|
3771
|
+
var Ln = Nn, Wn = { "front-matter": [], "css-root": ["frontMatter", "nodes"], "css-comment": [], "css-rule": ["selector", "nodes"], "css-decl": ["value", "selector", "nodes"], "css-atrule": ["selector", "params", "value", "nodes"], "media-query-list": ["nodes"], "media-query": ["nodes"], "media-type": [], "media-feature-expression": ["nodes"], "media-feature": [], "media-colon": [], "media-value": [], "media-keyword": [], "media-url": [], "media-unknown": [], "selector-root": ["nodes"], "selector-selector": ["nodes"], "selector-comment": [], "selector-string": [], "selector-tag": [], "selector-id": [], "selector-class": [], "selector-attribute": [], "selector-combinator": ["nodes"], "selector-universal": [], "selector-pseudo": ["nodes"], "selector-nesting": [], "selector-unknown": [], "value-value": ["group"], "value-root": ["group"], "value-comment": [], "value-comma_group": ["groups"], "value-paren_group": ["open", "groups", "close"], "value-func": ["group"], "value-paren": [], "value-number": [], "value-operator": [], "value-word": [], "value-colon": [], "value-comma": [], "value-string": [], "value-atword": [], "value-unicode-range": [], "value-unknown": [] }, zn = Wn, qn = Ln(zn), Bn = qn;
|
|
3772
|
+
function Fn(e, s) {
|
|
3773
|
+
let n = 0;
|
|
3774
|
+
for (let o = 0; o < e.line - 1; ++o) n = s.indexOf(`
|
|
3775
|
+
`, n) + 1;
|
|
3776
|
+
return n + e.column;
|
|
3777
|
+
}
|
|
3778
|
+
var Sr = Fn;
|
|
3779
|
+
function Rt(e) {
|
|
3780
|
+
return (s, n, o) => {
|
|
3781
|
+
let c = !!(o != null && o.backwards);
|
|
3782
|
+
if (n === !1) return !1;
|
|
3783
|
+
let { length: i } = s, f = n;
|
|
3784
|
+
for (; f >= 0 && f < i; ) {
|
|
3785
|
+
let u = s.charAt(f);
|
|
3786
|
+
if (e instanceof RegExp) {
|
|
3787
|
+
if (!e.test(u)) return f;
|
|
3788
|
+
} else if (!e.includes(u)) return f;
|
|
3789
|
+
c ? f-- : f++;
|
|
3790
|
+
}
|
|
3791
|
+
return f === -1 || f === i ? f : !1;
|
|
3792
|
+
};
|
|
3793
|
+
}
|
|
3794
|
+
var _r = Rt(" "), Dn = Rt(",; "), Er = Rt(/[^\n\r]/u);
|
|
3795
|
+
function Ar(e, s) {
|
|
3796
|
+
let { value: n } = e;
|
|
3797
|
+
return n === "-" || n === "--" || n.charAt(0) !== "-" ? s : s - (n.charAt(1) === "-" ? 2 : 1);
|
|
3798
|
+
}
|
|
3799
|
+
function jr(e, s) {
|
|
3800
|
+
var n, o, c;
|
|
3801
|
+
if (typeof ((o = (n = e.source) == null ? void 0 : n.start) == null ? void 0 : o.offset) == "number") return e.source.start.offset;
|
|
3802
|
+
if (typeof e.sourceIndex == "number") return e.type === "value-word" ? Ar(e, e.sourceIndex) : e.sourceIndex;
|
|
3803
|
+
if ((c = e.source) != null && c.start) return Sr(e.source.start, s);
|
|
3804
|
+
throw Object.assign(new Error("Can not locate node."), { node: e });
|
|
3805
|
+
}
|
|
3806
|
+
function Nt(e, s) {
|
|
3807
|
+
var n, o;
|
|
3808
|
+
if (e.type === "css-comment" && e.inline) return Er(s, e.source.startOffset);
|
|
3809
|
+
if (typeof ((o = (n = e.source) == null ? void 0 : n.end) == null ? void 0 : o.offset) == "number") return e.source.end.offset;
|
|
3810
|
+
if (e.source) {
|
|
3811
|
+
if (e.source.end) {
|
|
3812
|
+
let c = Sr(e.source.end, s);
|
|
3813
|
+
return e.type === "value-word" ? Ar(e, c) : c;
|
|
3814
|
+
}
|
|
3815
|
+
if (at(e.nodes)) return Nt(ge(!1, e.nodes, -1), s);
|
|
3816
|
+
}
|
|
3817
|
+
return null;
|
|
3818
|
+
}
|
|
3819
|
+
function Ir(e, s) {
|
|
3820
|
+
e.source && (e.source.startOffset = jr(e, s), e.source.endOffset = Nt(e, s));
|
|
3821
|
+
for (let n in e) {
|
|
3822
|
+
let o = e[n];
|
|
3823
|
+
n === "source" || !o || typeof o != "object" || (o.type === "value-root" || o.type === "value-unknown" ? Pr(o, Un(e), o.text || o.value) : Ir(o, s));
|
|
3824
|
+
}
|
|
3825
|
+
}
|
|
3826
|
+
function Pr(e, s, n) {
|
|
3827
|
+
e.source && (e.source.startOffset = jr(e, n) + s, e.source.endOffset = Nt(e, n) + s);
|
|
3828
|
+
for (let o in e) {
|
|
3829
|
+
let c = e[o];
|
|
3830
|
+
o === "source" || !c || typeof c != "object" || Pr(c, s, n);
|
|
3831
|
+
}
|
|
3832
|
+
}
|
|
3833
|
+
function Un(e) {
|
|
3834
|
+
var s;
|
|
3835
|
+
let n = e.source.startOffset;
|
|
3836
|
+
return typeof e.prop == "string" && (n += e.prop.length), e.type === "css-atrule" && typeof e.name == "string" && (n += 1 + e.name.length + e.raws.afterName.match(/^\s*:?\s*/u)[0].length), e.type !== "css-atrule" && typeof ((s = e.raws) == null ? void 0 : s.between) == "string" && (n += e.raws.between.length), n;
|
|
3837
|
+
}
|
|
3838
|
+
function Vn(e) {
|
|
3839
|
+
let s = "initial", n = "initial", o, c = !1, i = [];
|
|
3840
|
+
for (let f = 0; f < e.length; f++) {
|
|
3841
|
+
let u = e[f];
|
|
3842
|
+
switch (s) {
|
|
3843
|
+
case "initial":
|
|
3844
|
+
if (u === "'") {
|
|
3845
|
+
s = "single-quotes";
|
|
3846
|
+
continue;
|
|
3847
|
+
}
|
|
3848
|
+
if (u === '"') {
|
|
3849
|
+
s = "double-quotes";
|
|
3850
|
+
continue;
|
|
3851
|
+
}
|
|
3852
|
+
if ((u === "u" || u === "U") && e.slice(f, f + 4).toLowerCase() === "url(") {
|
|
3853
|
+
s = "url", f += 3;
|
|
3854
|
+
continue;
|
|
3855
|
+
}
|
|
3856
|
+
if (u === "*" && e[f - 1] === "/") {
|
|
3857
|
+
s = "comment-block";
|
|
3858
|
+
continue;
|
|
3859
|
+
}
|
|
3860
|
+
if (u === "/" && e[f - 1] === "/") {
|
|
3861
|
+
s = "comment-inline", o = f - 1;
|
|
3862
|
+
continue;
|
|
3863
|
+
}
|
|
3864
|
+
continue;
|
|
3865
|
+
case "single-quotes":
|
|
3866
|
+
if (u === "'" && e[f - 1] !== "\\" && (s = n, n = "initial"), u === `
|
|
3867
|
+
` || u === "\r") return e;
|
|
3868
|
+
continue;
|
|
3869
|
+
case "double-quotes":
|
|
3870
|
+
if (u === '"' && e[f - 1] !== "\\" && (s = n, n = "initial"), u === `
|
|
3871
|
+
` || u === "\r") return e;
|
|
3872
|
+
continue;
|
|
3873
|
+
case "url":
|
|
3874
|
+
if (u === ")" && (s = "initial"), u === `
|
|
3875
|
+
` || u === "\r") return e;
|
|
3876
|
+
if (u === "'") {
|
|
3877
|
+
s = "single-quotes", n = "url";
|
|
3878
|
+
continue;
|
|
3879
|
+
}
|
|
3880
|
+
if (u === '"') {
|
|
3881
|
+
s = "double-quotes", n = "url";
|
|
3882
|
+
continue;
|
|
3883
|
+
}
|
|
3884
|
+
continue;
|
|
3885
|
+
case "comment-block":
|
|
3886
|
+
u === "/" && e[f - 1] === "*" && (s = "initial");
|
|
3887
|
+
continue;
|
|
3888
|
+
case "comment-inline":
|
|
3889
|
+
(u === '"' || u === "'" || u === "*") && (c = !0), (u === `
|
|
3890
|
+
` || u === "\r") && (c && i.push([o, f]), s = "initial", c = !1);
|
|
3891
|
+
continue;
|
|
3892
|
+
}
|
|
3893
|
+
}
|
|
3894
|
+
for (let [f, u] of i) e = e.slice(0, f) + F(!1, e.slice(f, u), /["'*]/gu, " ") + e.slice(u);
|
|
3895
|
+
return e;
|
|
3896
|
+
}
|
|
3897
|
+
function V(e) {
|
|
3898
|
+
var s;
|
|
3899
|
+
return (s = e.source) == null ? void 0 : s.startOffset;
|
|
3900
|
+
}
|
|
3901
|
+
function G(e) {
|
|
3902
|
+
var s;
|
|
3903
|
+
return (s = e.source) == null ? void 0 : s.endOffset;
|
|
3904
|
+
}
|
|
3905
|
+
var Gn = /\*\/$/, Jn = /^\/\*\*?/, Mr = /^\s*(\/\*\*?(.|\r?\n)*?\*\/)/, Hn = /(^|\s+)\/\/([^\n\r]*)/g, Dt = /^(\r?\n)+/, Qn = /(?:^|\r?\n) *(@[^\n\r]*?) *\r?\n *(?![^\n\r@]*\/\/[^]*)([^\s@][^\n\r@]+?) *\r?\n/g, Ut = /(?:^|\r?\n) *@(\S+) *([^\n\r]*)/g, Zn = /(\r?\n|^) *\* ?/g, $r = [];
|
|
3906
|
+
function Kn(e) {
|
|
3907
|
+
let s = e.match(Mr);
|
|
3908
|
+
return s ? s[0].trimStart() : "";
|
|
3909
|
+
}
|
|
3910
|
+
function Xn(e) {
|
|
3911
|
+
let s = e.match(Mr), n = s?.[0];
|
|
3912
|
+
return n == null ? e : e.slice(n.length);
|
|
3913
|
+
}
|
|
3914
|
+
function Yn(e) {
|
|
3915
|
+
let s = `
|
|
3916
|
+
`;
|
|
3917
|
+
e = F(!1, e.replace(Jn, "").replace(Gn, ""), Zn, "$1");
|
|
3918
|
+
let n = "";
|
|
3919
|
+
for (; n !== e; ) n = e, e = F(!1, e, Qn, `${s}$1 $2${s}`);
|
|
3920
|
+
e = e.replace(Dt, "").trimEnd();
|
|
3921
|
+
let o = /* @__PURE__ */ Object.create(null), c = F(!1, e, Ut, "").replace(Dt, "").trimEnd(), i;
|
|
3922
|
+
for (; i = Ut.exec(e); ) {
|
|
3923
|
+
let f = F(!1, i[2], Hn, "");
|
|
3924
|
+
if (typeof o[i[1]] == "string" || Array.isArray(o[i[1]])) {
|
|
3925
|
+
let u = o[i[1]];
|
|
3926
|
+
o[i[1]] = [...$r, ...Array.isArray(u) ? u : [u], f];
|
|
3927
|
+
} else o[i[1]] = f;
|
|
3928
|
+
}
|
|
3929
|
+
return { comments: c, pragmas: o };
|
|
3930
|
+
}
|
|
3931
|
+
function eo({ comments: e = "", pragmas: s = {} }) {
|
|
3932
|
+
let n = `
|
|
3933
|
+
`, o = "/**", c = " *", i = " */", f = Object.keys(s), u = f.flatMap((p) => Vt(p, s[p])).map((p) => `${c} ${p}${n}`).join("");
|
|
3934
|
+
if (!e) {
|
|
3935
|
+
if (f.length === 0) return "";
|
|
3936
|
+
if (f.length === 1 && !Array.isArray(s[f[0]])) {
|
|
3937
|
+
let p = s[f[0]];
|
|
3938
|
+
return `${o} ${Vt(f[0], p)[0]}${i}`;
|
|
3939
|
+
}
|
|
3940
|
+
}
|
|
3941
|
+
let m = e.split(n).map((p) => `${c} ${p}`).join(n) + n;
|
|
3942
|
+
return o + n + (e ? m : "") + (e && f.length > 0 ? c + n : "") + u + i;
|
|
3943
|
+
}
|
|
3944
|
+
function Vt(e, s) {
|
|
3945
|
+
return [...$r, ...Array.isArray(s) ? s : [s]].map((n) => `@${e} ${n}`.trim());
|
|
3946
|
+
}
|
|
3947
|
+
var to = ["noformat", "noprettier"], ro = ["format", "prettier"], so = "format";
|
|
3948
|
+
function no(e) {
|
|
3949
|
+
if (!e.startsWith("#!")) return "";
|
|
3950
|
+
let s = e.indexOf(`
|
|
3951
|
+
`);
|
|
3952
|
+
return s === -1 ? e : e.slice(0, s);
|
|
3953
|
+
}
|
|
3954
|
+
var oo = no;
|
|
3955
|
+
function Lt(e) {
|
|
3956
|
+
let s = oo(e);
|
|
3957
|
+
s && (e = e.slice(s.length + 1));
|
|
3958
|
+
let n = Kn(e), { pragmas: o, comments: c } = Yn(n);
|
|
3959
|
+
return { shebang: s, text: e, pragmas: o, comments: c };
|
|
3960
|
+
}
|
|
3961
|
+
function io(e) {
|
|
3962
|
+
let { pragmas: s } = Lt(e);
|
|
3963
|
+
return ro.some((n) => Object.prototype.hasOwnProperty.call(s, n));
|
|
3964
|
+
}
|
|
3965
|
+
function ao(e) {
|
|
3966
|
+
let { pragmas: s } = Lt(e);
|
|
3967
|
+
return to.some((n) => Object.prototype.hasOwnProperty.call(s, n));
|
|
3968
|
+
}
|
|
3969
|
+
function uo(e) {
|
|
3970
|
+
let { shebang: s, text: n, pragmas: o, comments: c } = Lt(e), i = Xn(n), f = eo({ pragmas: { [so]: "", ...o }, comments: c.trimStart() });
|
|
3971
|
+
return (s ? `${s}
|
|
3972
|
+
` : "") + f + (i.startsWith(`
|
|
3973
|
+
`) ? `
|
|
3974
|
+
` : `
|
|
3975
|
+
|
|
3976
|
+
`) + i;
|
|
3977
|
+
}
|
|
3978
|
+
var Se = 3;
|
|
3979
|
+
function lo(e) {
|
|
3980
|
+
let s = e.slice(0, Se);
|
|
3981
|
+
if (s !== "---" && s !== "+++") return;
|
|
3982
|
+
let n = e.indexOf(`
|
|
3983
|
+
`, Se);
|
|
3984
|
+
if (n === -1) return;
|
|
3985
|
+
let o = e.slice(Se, n).trim(), c = e.indexOf(`
|
|
3986
|
+
${s}`, n), i = o;
|
|
3987
|
+
if (i || (i = s === "+++" ? "toml" : "yaml"), c === -1 && s === "---" && i === "yaml" && (c = e.indexOf(`
|
|
3988
|
+
...`, n)), c === -1) return;
|
|
3989
|
+
let f = c + 1 + Se, u = e.charAt(f + 1);
|
|
3990
|
+
if (!/\s?/u.test(u)) return;
|
|
3991
|
+
let m = e.slice(0, f);
|
|
3992
|
+
return { type: "front-matter", language: i, explicitLanguage: o, value: e.slice(n + 1, c), startDelimiter: s, endDelimiter: m.slice(-Se), raw: m };
|
|
3993
|
+
}
|
|
3994
|
+
function co(e) {
|
|
3995
|
+
let s = lo(e);
|
|
3996
|
+
if (!s) return { content: e };
|
|
3997
|
+
let { raw: n } = s;
|
|
3998
|
+
return { frontMatter: s, content: F(!1, n, /[^\n]/gu, " ") + e.slice(n.length) };
|
|
3999
|
+
}
|
|
4000
|
+
var ut = co;
|
|
4001
|
+
function po(e) {
|
|
4002
|
+
return io(ut(e).content);
|
|
4003
|
+
}
|
|
4004
|
+
function fo(e) {
|
|
4005
|
+
return ao(ut(e).content);
|
|
4006
|
+
}
|
|
4007
|
+
function ho(e) {
|
|
4008
|
+
let { frontMatter: s, content: n } = ut(e);
|
|
4009
|
+
return (s ? s.raw + `
|
|
4010
|
+
|
|
4011
|
+
` : "") + uo(n);
|
|
4012
|
+
}
|
|
4013
|
+
var mo = /* @__PURE__ */ new Set(["red", "green", "blue", "alpha", "a", "rgb", "hue", "h", "saturation", "s", "lightness", "l", "whiteness", "w", "blackness", "b", "tint", "shade", "blend", "blenda", "contrast", "hsl", "hsla", "hwb", "hwba"]);
|
|
4014
|
+
function vo(e) {
|
|
4015
|
+
var s, n;
|
|
4016
|
+
return (n = (s = e.findAncestor((o) => o.type === "css-decl")) == null ? void 0 : s.prop) == null ? void 0 : n.toLowerCase();
|
|
4017
|
+
}
|
|
4018
|
+
var yo = /* @__PURE__ */ new Set(["initial", "inherit", "unset", "revert"]);
|
|
4019
|
+
function go(e) {
|
|
4020
|
+
return yo.has(e.toLowerCase());
|
|
4021
|
+
}
|
|
4022
|
+
function wo(e, s) {
|
|
4023
|
+
var n;
|
|
4024
|
+
let o = e.findAncestor((c) => c.type === "css-atrule");
|
|
4025
|
+
return ((n = o?.name) == null ? void 0 : n.toLowerCase().endsWith("keyframes")) && ["from", "to"].includes(s.toLowerCase());
|
|
4026
|
+
}
|
|
4027
|
+
function _e(e) {
|
|
4028
|
+
return e.includes("$") || e.includes("@") || e.includes("#") || e.startsWith("%") || e.startsWith("--") || e.startsWith(":--") || e.includes("(") && e.includes(")") ? e : e.toLowerCase();
|
|
4029
|
+
}
|
|
4030
|
+
function Qe(e, s) {
|
|
4031
|
+
var n;
|
|
4032
|
+
let o = e.findAncestor((c) => c.type === "value-func");
|
|
4033
|
+
return ((n = o?.value) == null ? void 0 : n.toLowerCase()) === s;
|
|
4034
|
+
}
|
|
4035
|
+
function bo(e) {
|
|
4036
|
+
var s;
|
|
4037
|
+
let n = e.findAncestor((c) => c.type === "css-rule"), o = (s = n?.raws) == null ? void 0 : s.selector;
|
|
4038
|
+
return o && (o.startsWith(":import") || o.startsWith(":export"));
|
|
4039
|
+
}
|
|
4040
|
+
function Me(e, s) {
|
|
4041
|
+
let n = Array.isArray(s) ? s : [s], o = e.findAncestor((c) => c.type === "css-atrule");
|
|
4042
|
+
return o && n.includes(o.name.toLowerCase());
|
|
4043
|
+
}
|
|
4044
|
+
function xo(e) {
|
|
4045
|
+
var s;
|
|
4046
|
+
let { node: n } = e;
|
|
4047
|
+
return n.groups[0].value === "url" && n.groups.length === 2 && ((s = e.findAncestor((o) => o.type === "css-atrule")) == null ? void 0 : s.name) === "import";
|
|
4048
|
+
}
|
|
4049
|
+
function ko(e) {
|
|
4050
|
+
return e.type === "value-func" && e.value.toLowerCase() === "url";
|
|
4051
|
+
}
|
|
4052
|
+
function Oo(e) {
|
|
4053
|
+
return e.type === "value-func" && e.value.toLowerCase() === "var";
|
|
4054
|
+
}
|
|
4055
|
+
function To(e) {
|
|
4056
|
+
let { selector: s } = e;
|
|
4057
|
+
return s ? typeof s == "string" && /^@.+:.*$/u.test(s) || s.value && /^@.+:.*$/u.test(s.value) : !1;
|
|
4058
|
+
}
|
|
4059
|
+
function Co(e) {
|
|
4060
|
+
return e.type === "value-word" && ["from", "through", "end"].includes(e.value);
|
|
4061
|
+
}
|
|
4062
|
+
function So(e) {
|
|
4063
|
+
return e.type === "value-word" && ["and", "or", "not"].includes(e.value);
|
|
4064
|
+
}
|
|
4065
|
+
function _o(e) {
|
|
4066
|
+
return e.type === "value-word" && e.value === "in";
|
|
4067
|
+
}
|
|
4068
|
+
function mt(e) {
|
|
4069
|
+
return e.type === "value-operator" && e.value === "*";
|
|
4070
|
+
}
|
|
4071
|
+
function Ze(e) {
|
|
4072
|
+
return e.type === "value-operator" && e.value === "/";
|
|
4073
|
+
}
|
|
4074
|
+
function ne(e) {
|
|
4075
|
+
return e.type === "value-operator" && e.value === "+";
|
|
4076
|
+
}
|
|
4077
|
+
function ye(e) {
|
|
4078
|
+
return e.type === "value-operator" && e.value === "-";
|
|
4079
|
+
}
|
|
4080
|
+
function Eo(e) {
|
|
4081
|
+
return e.type === "value-operator" && e.value === "%";
|
|
4082
|
+
}
|
|
4083
|
+
function ct(e) {
|
|
4084
|
+
return mt(e) || Ze(e) || ne(e) || ye(e) || Eo(e);
|
|
4085
|
+
}
|
|
4086
|
+
function Ao(e) {
|
|
4087
|
+
return e.type === "value-word" && ["==", "!="].includes(e.value);
|
|
4088
|
+
}
|
|
4089
|
+
function jo(e) {
|
|
4090
|
+
return e.type === "value-word" && ["<", ">", "<=", ">="].includes(e.value);
|
|
4091
|
+
}
|
|
4092
|
+
function vt(e, s) {
|
|
4093
|
+
return s.parser === "scss" && e.type === "css-atrule" && ["if", "else", "for", "each", "while"].includes(e.name);
|
|
4094
|
+
}
|
|
4095
|
+
function Gt(e) {
|
|
4096
|
+
var s;
|
|
4097
|
+
return ((s = e.raws) == null ? void 0 : s.params) && /^\(\s*\)$/u.test(e.raws.params);
|
|
4098
|
+
}
|
|
4099
|
+
function pt(e) {
|
|
4100
|
+
return e.name.startsWith("prettier-placeholder");
|
|
4101
|
+
}
|
|
4102
|
+
function Io(e) {
|
|
4103
|
+
return e.prop.startsWith("@prettier-placeholder");
|
|
4104
|
+
}
|
|
4105
|
+
function Po(e, s) {
|
|
4106
|
+
return e.value === "$$" && e.type === "value-func" && s?.type === "value-word" && !s.raws.before;
|
|
4107
|
+
}
|
|
4108
|
+
function Mo(e) {
|
|
4109
|
+
var s, n;
|
|
4110
|
+
return ((s = e.value) == null ? void 0 : s.type) === "value-root" && ((n = e.value.group) == null ? void 0 : n.type) === "value-value" && e.prop.toLowerCase() === "composes";
|
|
4111
|
+
}
|
|
4112
|
+
function $o(e) {
|
|
4113
|
+
var s, n, o;
|
|
4114
|
+
return ((o = (n = (s = e.value) == null ? void 0 : s.group) == null ? void 0 : n.group) == null ? void 0 : o.type) === "value-paren_group" && e.value.group.group.open !== null && e.value.group.group.close !== null;
|
|
4115
|
+
}
|
|
4116
|
+
function me(e) {
|
|
4117
|
+
var s;
|
|
4118
|
+
return ((s = e.raws) == null ? void 0 : s.before) === "";
|
|
4119
|
+
}
|
|
4120
|
+
function Wt(e) {
|
|
4121
|
+
var s, n;
|
|
4122
|
+
return e.type === "value-comma_group" && ((n = (s = e.groups) == null ? void 0 : s[1]) == null ? void 0 : n.type) === "value-colon";
|
|
4123
|
+
}
|
|
4124
|
+
function ft(e) {
|
|
4125
|
+
var s;
|
|
4126
|
+
return e.type === "value-paren_group" && ((s = e.groups) == null ? void 0 : s[0]) && Wt(e.groups[0]);
|
|
4127
|
+
}
|
|
4128
|
+
function Rr(e, s) {
|
|
4129
|
+
var n;
|
|
4130
|
+
if (s.parser !== "scss") return !1;
|
|
4131
|
+
let { node: o } = e;
|
|
4132
|
+
if (o.groups.length === 0) return !1;
|
|
4133
|
+
let c = e.grandparent;
|
|
4134
|
+
if (!ft(o) && !(c && ft(c))) return !1;
|
|
4135
|
+
let i = e.findAncestor((f) => f.type === "css-decl");
|
|
4136
|
+
return !!((n = i?.prop) != null && n.startsWith("$") || ft(c) || c.type === "value-func");
|
|
4137
|
+
}
|
|
4138
|
+
function Ee(e) {
|
|
4139
|
+
return e.type === "value-comment" && e.inline;
|
|
4140
|
+
}
|
|
4141
|
+
function ht(e) {
|
|
4142
|
+
return e.type === "value-word" && e.value === "#";
|
|
4143
|
+
}
|
|
4144
|
+
function Jt(e) {
|
|
4145
|
+
return e.type === "value-word" && e.value === "{";
|
|
4146
|
+
}
|
|
4147
|
+
function dt(e) {
|
|
4148
|
+
return e.type === "value-word" && e.value === "}";
|
|
4149
|
+
}
|
|
4150
|
+
function Ve(e) {
|
|
4151
|
+
return ["value-word", "value-atword"].includes(e.type);
|
|
4152
|
+
}
|
|
4153
|
+
function Ke(e) {
|
|
4154
|
+
return e?.type === "value-colon";
|
|
4155
|
+
}
|
|
4156
|
+
function Ro(e, s) {
|
|
4157
|
+
if (!Wt(s)) return !1;
|
|
4158
|
+
let { groups: n } = s, o = n.indexOf(e);
|
|
4159
|
+
return o === -1 ? !1 : Ke(n[o + 1]);
|
|
4160
|
+
}
|
|
4161
|
+
function No(e) {
|
|
4162
|
+
return e.value && ["not", "and", "or"].includes(e.value.toLowerCase());
|
|
4163
|
+
}
|
|
4164
|
+
function Lo(e) {
|
|
4165
|
+
return e.type !== "value-func" ? !1 : mo.has(e.value.toLowerCase());
|
|
4166
|
+
}
|
|
4167
|
+
function Ae(e) {
|
|
4168
|
+
return /\/\//u.test(e.split(/[\n\r]/u).pop());
|
|
4169
|
+
}
|
|
4170
|
+
function Ge(e) {
|
|
4171
|
+
return e?.type === "value-atword" && e.value.startsWith("prettier-placeholder-");
|
|
4172
|
+
}
|
|
4173
|
+
function Wo(e, s) {
|
|
4174
|
+
var n, o;
|
|
4175
|
+
if (((n = e.open) == null ? void 0 : n.value) !== "(" || ((o = e.close) == null ? void 0 : o.value) !== ")" || e.groups.some((c) => c.type !== "value-comma_group")) return !1;
|
|
4176
|
+
if (s.type === "value-comma_group") {
|
|
4177
|
+
let c = s.groups.indexOf(e) - 1, i = s.groups[c];
|
|
4178
|
+
if (i?.type === "value-word" && i.value === "with") return !0;
|
|
4179
|
+
}
|
|
4180
|
+
return !1;
|
|
4181
|
+
}
|
|
4182
|
+
function Je(e) {
|
|
4183
|
+
var s, n;
|
|
4184
|
+
return e.type === "value-paren_group" && ((s = e.open) == null ? void 0 : s.value) === "(" && ((n = e.close) == null ? void 0 : n.value) === ")";
|
|
4185
|
+
}
|
|
4186
|
+
function zo(e, s, n) {
|
|
4187
|
+
var o;
|
|
4188
|
+
let { node: c } = e, i = e.parent, f = e.grandparent, u = vo(e), m = u && i.type === "value-value" && (u === "grid" || u.startsWith("grid-template")), p = e.findAncestor((y) => y.type === "css-atrule"), r = p && vt(p, s), t = c.groups.some((y) => Ee(y)), h = e.map(n, "groups"), a = [""], d = Qe(e, "url"), l = !1, b = !1;
|
|
4189
|
+
for (let y = 0; y < c.groups.length; ++y) {
|
|
4190
|
+
let v = c.groups[y - 1], g = c.groups[y], k = c.groups[y + 1], w = c.groups[y + 2];
|
|
4191
|
+
if (Ee(g) && !k) {
|
|
4192
|
+
a.push([a.pop(), vn([" ", h[y]])]);
|
|
4193
|
+
continue;
|
|
4194
|
+
}
|
|
4195
|
+
if (a.push([a.pop(), h[y]]), d) {
|
|
4196
|
+
(k && ne(k) || ne(g)) && a.push([a.pop(), " "]);
|
|
4197
|
+
continue;
|
|
4198
|
+
}
|
|
4199
|
+
if (Ke(k) && g.type === "value-word" && a.length > 2 && c.groups.slice(0, y).every((I) => I.type === "value-comment") && !Ee(v) && (a[a.length - 2] = $e(ge(!1, a, -2))), Me(e, "forward") && g.type === "value-word" && g.value && v !== void 0 && v.type === "value-word" && v.value === "as" && k.type === "value-operator" && k.value === "*" || Me(e, "utility") && g.type === "value-word" && k && k.type === "value-operator" && k.value === "*" || !k || g.type === "value-word" && Ge(k) && G(g) === V(k)) continue;
|
|
4200
|
+
if (g.type === "value-string" && g.quoted) {
|
|
4201
|
+
let I = g.value.lastIndexOf("#{"), N = g.value.lastIndexOf("}");
|
|
4202
|
+
I !== -1 && N !== -1 ? l = I > N : I !== -1 ? l = !0 : N !== -1 && (l = !1);
|
|
4203
|
+
}
|
|
4204
|
+
if (l || Ke(g) || Ke(k) || g.type === "value-atword" && (g.value === "" || g.value.endsWith("[")) || k.type === "value-word" && k.value.startsWith("]") || g.value === "~" || g.type !== "value-string" && g.value && g.value.includes("\\") && k && k.type !== "value-comment" || v != null && v.value && v.value.indexOf("\\") === v.value.length - 1 && g.type === "value-operator" && g.value === "/" || g.value === "\\" || Po(g, k) || ht(g) || Jt(g) || dt(k) || Jt(k) && me(k) || dt(g) && me(k) || g.value === "--" && ht(k)) continue;
|
|
4205
|
+
let x = ct(g), O = ct(k);
|
|
4206
|
+
if ((x && ht(k) || O && dt(g)) && me(k) || !v && Ze(g) || Qe(e, "calc") && (ne(g) || ne(k) || ye(g) || ye(k)) && me(k)) continue;
|
|
4207
|
+
let T = (ne(g) || ye(g)) && y === 0 && (k.type === "value-number" || k.isHex) && f && Lo(f) && !me(k), _ = w?.type === "value-func" || w && Ve(w) || g.type === "value-func" || Ve(g), A = k.type === "value-func" || Ve(k) || v?.type === "value-func" || v && Ve(v);
|
|
4208
|
+
if (s.parser === "scss" && x && g.value === "-" && k.type === "value-func" && G(g) !== V(k)) {
|
|
4209
|
+
a.push([a.pop(), " "]);
|
|
4210
|
+
continue;
|
|
4211
|
+
}
|
|
4212
|
+
if (!(!(mt(k) || mt(g)) && !Qe(e, "calc") && !T && (Ze(k) && !_ || Ze(g) && !A || ne(k) && !_ || ne(g) && !A || ye(k) || ye(g)) && (me(k) || x && (!v || v && ct(v)))) && !((s.parser === "scss" || s.parser === "less") && x && g.value === "-" && Je(k) && G(g) === V(k.open) && k.open.value === "(")) {
|
|
4213
|
+
if (Ee(g)) {
|
|
4214
|
+
if (i.type === "value-paren_group") {
|
|
4215
|
+
a.push($e(B), "");
|
|
4216
|
+
continue;
|
|
4217
|
+
}
|
|
4218
|
+
a.push(B, "");
|
|
4219
|
+
continue;
|
|
4220
|
+
}
|
|
4221
|
+
if (r && (Ao(k) || jo(k) || So(k) || _o(g) || Co(g))) {
|
|
4222
|
+
a.push([a.pop(), " "]);
|
|
4223
|
+
continue;
|
|
4224
|
+
}
|
|
4225
|
+
if (p && p.name.toLowerCase() === "namespace") {
|
|
4226
|
+
a.push([a.pop(), " "]);
|
|
4227
|
+
continue;
|
|
4228
|
+
}
|
|
4229
|
+
if (m) {
|
|
4230
|
+
g.source && k.source && g.source.start.line !== k.source.start.line ? (a.push(B, ""), b = !0) : a.push([a.pop(), " "]);
|
|
4231
|
+
continue;
|
|
4232
|
+
}
|
|
4233
|
+
if (O) {
|
|
4234
|
+
a.push([a.pop(), " "]);
|
|
4235
|
+
continue;
|
|
4236
|
+
}
|
|
4237
|
+
if (k?.value !== "..." && !(Ge(g) && Ge(k) && G(g) === V(k))) {
|
|
4238
|
+
if (Ge(g) && Je(k) && G(g) === V(k.open)) {
|
|
4239
|
+
a.push(Z, "");
|
|
4240
|
+
continue;
|
|
4241
|
+
}
|
|
4242
|
+
if (g.value === "with" && Je(k)) {
|
|
4243
|
+
a = [[He(a), " "]];
|
|
4244
|
+
continue;
|
|
4245
|
+
}
|
|
4246
|
+
(o = g.value) != null && o.endsWith("#") && k.value === "{" && Je(k.group) || Ee(k) && !w || a.push(U, "");
|
|
4247
|
+
}
|
|
4248
|
+
}
|
|
4249
|
+
}
|
|
4250
|
+
return t && a.push([a.pop(), $t]), b && a.unshift("", B), r ? K(H(a)) : xo(e) ? K(He(a)) : K(H(He(a)));
|
|
4251
|
+
}
|
|
4252
|
+
var qo = zo;
|
|
4253
|
+
function Bo(e) {
|
|
4254
|
+
return e.length === 1 ? e : e.toLowerCase().replace(/^([+-]?[\d.]+e)(?:\+|(-))?0*(?=\d)/u, "$1$2").replace(/^([+-]?[\d.]+)e[+-]?0+$/u, "$1").replace(/^([+-])?\./u, "$10.").replace(/(\.\d+?)0+(?=e|$)/u, "$1").replace(/\.(?=e|$)/u, "");
|
|
4255
|
+
}
|
|
4256
|
+
var Fo = Bo, yt = /* @__PURE__ */ new Map([["em", "em"], ["rem", "rem"], ["ex", "ex"], ["rex", "rex"], ["cap", "cap"], ["rcap", "rcap"], ["ch", "ch"], ["rch", "rch"], ["ic", "ic"], ["ric", "ric"], ["lh", "lh"], ["rlh", "rlh"], ["vw", "vw"], ["svw", "svw"], ["lvw", "lvw"], ["dvw", "dvw"], ["vh", "vh"], ["svh", "svh"], ["lvh", "lvh"], ["dvh", "dvh"], ["vi", "vi"], ["svi", "svi"], ["lvi", "lvi"], ["dvi", "dvi"], ["vb", "vb"], ["svb", "svb"], ["lvb", "lvb"], ["dvb", "dvb"], ["vmin", "vmin"], ["svmin", "svmin"], ["lvmin", "lvmin"], ["dvmin", "dvmin"], ["vmax", "vmax"], ["svmax", "svmax"], ["lvmax", "lvmax"], ["dvmax", "dvmax"], ["cm", "cm"], ["mm", "mm"], ["q", "Q"], ["in", "in"], ["pt", "pt"], ["pc", "pc"], ["px", "px"], ["deg", "deg"], ["grad", "grad"], ["rad", "rad"], ["turn", "turn"], ["s", "s"], ["ms", "ms"], ["hz", "Hz"], ["khz", "kHz"], ["dpi", "dpi"], ["dpcm", "dpcm"], ["dppx", "dppx"], ["x", "x"], ["cqw", "cqw"], ["cqh", "cqh"], ["cqi", "cqi"], ["cqb", "cqb"], ["cqmin", "cqmin"], ["cqmax", "cqmax"], ["fr", "fr"]]);
|
|
4257
|
+
function Nr(e) {
|
|
4258
|
+
let s = e.toLowerCase();
|
|
4259
|
+
return yt.has(s) ? yt.get(s) : e;
|
|
4260
|
+
}
|
|
4261
|
+
var Lr = /(["'])(?:(?!\1)[^\\]|\\.)*\1/gsu, Do = /(?:\d*\.\d+|\d+\.?)(?:e[+-]?\d+)?/giu, Uo = /[a-z]+/giu, Vo = /[$@]?[_a-z\u0080-\uFFFF][\w\u0080-\uFFFF-]*/giu, Go = new RegExp(Lr.source + `|(${Vo.source})?(${Do.source})(${Uo.source})?`, "giu");
|
|
4262
|
+
function Y(e, s) {
|
|
4263
|
+
return F(!1, e, Lr, (n) => Or(n, s));
|
|
4264
|
+
}
|
|
4265
|
+
function Jo(e, s) {
|
|
4266
|
+
let n = s.singleQuote ? "'" : '"';
|
|
4267
|
+
return e.includes('"') || e.includes("'") ? e : n + e + n;
|
|
4268
|
+
}
|
|
4269
|
+
function ve(e) {
|
|
4270
|
+
return F(!1, e, Go, (s, n, o, c, i) => !o && c && (i ?? (i = ""), i = i.toLowerCase(), !i || i === "n" || yt.has(i)) ? Wr(c) + (i ? Nr(i) : "") : s);
|
|
4271
|
+
}
|
|
4272
|
+
function Wr(e) {
|
|
4273
|
+
return Fo(e).replace(/\.0(?=$|e)/u, "");
|
|
4274
|
+
}
|
|
4275
|
+
function Ho(e) {
|
|
4276
|
+
return e.trailingComma === "es5" || e.trailingComma === "all";
|
|
4277
|
+
}
|
|
4278
|
+
function Qo(e, s, n) {
|
|
4279
|
+
let o = !!(n != null && n.backwards);
|
|
4280
|
+
if (s === !1) return !1;
|
|
4281
|
+
let c = e.charAt(s);
|
|
4282
|
+
if (o) {
|
|
4283
|
+
if (e.charAt(s - 1) === "\r" && c === `
|
|
4284
|
+
`) return s - 2;
|
|
4285
|
+
if (c === `
|
|
4286
|
+
` || c === "\r" || c === "\u2028" || c === "\u2029") return s - 1;
|
|
4287
|
+
} else {
|
|
4288
|
+
if (c === "\r" && e.charAt(s + 1) === `
|
|
4289
|
+
`) return s + 2;
|
|
4290
|
+
if (c === `
|
|
4291
|
+
` || c === "\r" || c === "\u2028" || c === "\u2029") return s + 1;
|
|
4292
|
+
}
|
|
4293
|
+
return s;
|
|
4294
|
+
}
|
|
4295
|
+
var zr = Qo;
|
|
4296
|
+
function Zo(e, s, n = {}) {
|
|
4297
|
+
let o = _r(e, n.backwards ? s - 1 : s, n), c = zr(e, o, n);
|
|
4298
|
+
return o !== c;
|
|
4299
|
+
}
|
|
4300
|
+
var qr = Zo;
|
|
4301
|
+
function Ko(e, s) {
|
|
4302
|
+
if (s === !1) return !1;
|
|
4303
|
+
if (e.charAt(s) === "/" && e.charAt(s + 1) === "*") {
|
|
4304
|
+
for (let n = s + 2; n < e.length; ++n) if (e.charAt(n) === "*" && e.charAt(n + 1) === "/") return n + 2;
|
|
4305
|
+
}
|
|
4306
|
+
return s;
|
|
4307
|
+
}
|
|
4308
|
+
var Xo = Ko;
|
|
4309
|
+
function Yo(e, s) {
|
|
4310
|
+
return s === !1 ? !1 : e.charAt(s) === "/" && e.charAt(s + 1) === "/" ? Er(e, s) : s;
|
|
4311
|
+
}
|
|
4312
|
+
var ei = Yo;
|
|
4313
|
+
function ti(e, s) {
|
|
4314
|
+
let n = null, o = s;
|
|
4315
|
+
for (; o !== n; ) n = o, o = Dn(e, o), o = Xo(e, o), o = _r(e, o);
|
|
4316
|
+
return o = ei(e, o), o = zr(e, o), o !== !1 && qr(e, o);
|
|
4317
|
+
}
|
|
4318
|
+
var Br = ti;
|
|
4319
|
+
function ri({ node: e, parent: s }, n) {
|
|
4320
|
+
return !!(e.source && n.originalText.slice(V(e), V(s.close)).trimEnd().endsWith(","));
|
|
4321
|
+
}
|
|
4322
|
+
function si(e, s) {
|
|
4323
|
+
return Oo(e.grandparent) && ri(e, s) ? "," : e.node.type !== "value-comment" && !(e.node.type === "value-comma_group" && e.node.groups.every((n) => n.type === "value-comment")) && Ho(s) && e.callParent(() => Rr(e, s)) ? xr(",") : "";
|
|
4324
|
+
}
|
|
4325
|
+
function ni(e, s, n) {
|
|
4326
|
+
let { node: o, parent: c } = e, i = e.map(({ node: a }) => typeof a == "string" ? a : n(), "groups");
|
|
4327
|
+
if (c && ko(c) && (o.groups.length === 1 || o.groups.length > 0 && o.groups[0].type === "value-comma_group" && o.groups[0].groups.length > 0 && o.groups[0].groups[0].type === "value-word" && o.groups[0].groups[0].value.startsWith("data:"))) return [o.open ? n("open") : "", oe(",", i), o.close ? n("close") : ""];
|
|
4328
|
+
if (!o.open) {
|
|
4329
|
+
let a = Fr(e), d = ii(oe(",", i), 2), l = oe(a ? B : U, d);
|
|
4330
|
+
return H(a ? [B, l] : K([oi(e) ? Z : "", He(l)]));
|
|
4331
|
+
}
|
|
4332
|
+
let f = e.map(({ node: a, isLast: d, index: l }) => {
|
|
4333
|
+
var b;
|
|
4334
|
+
let y = i[l];
|
|
4335
|
+
Wt(a) && a.type === "value-comma_group" && a.groups && a.groups[0].type !== "value-paren_group" && ((b = a.groups[2]) == null ? void 0 : b.type) === "value-paren_group" && Ie(y) === nt && Ie(y.contents) === st && Ie(y.contents.contents) === ot && (y = K($e(y)));
|
|
4336
|
+
let v = [y, d ? si(e, s) : ","];
|
|
4337
|
+
if (!d && a.type === "value-comma_group" && at(a.groups)) {
|
|
4338
|
+
let g = ge(!1, a.groups, -1);
|
|
4339
|
+
!g.source && g.close && (g = g.close), g.source && Br(s.originalText, G(g)) && v.push(B);
|
|
4340
|
+
}
|
|
4341
|
+
return v;
|
|
4342
|
+
}, "groups"), u = Ro(o, c), m = Wo(o, c), p = Rr(e, s), r = m || p && !u, t = m || u, h = K([o.open ? n("open") : "", H([Z, oe(U, f)]), Z, o.close ? n("close") : ""], { shouldBreak: r });
|
|
4343
|
+
return t ? $e(h) : h;
|
|
4344
|
+
}
|
|
4345
|
+
function Fr(e) {
|
|
4346
|
+
return e.match((s) => s.type === "value-paren_group" && !s.open && s.groups.some((n) => n.type === "value-comma_group"), (s, n) => n === "group" && s.type === "value-value", (s, n) => n === "group" && s.type === "value-root", (s, n) => n === "value" && (s.type === "css-decl" && !s.prop.startsWith("--") || s.type === "css-atrule" && s.variable));
|
|
4347
|
+
}
|
|
4348
|
+
function oi(e) {
|
|
4349
|
+
return e.match((s) => s.type === "value-paren_group" && !s.open, (s, n) => n === "group" && s.type === "value-value", (s, n) => n === "group" && s.type === "value-root", (s, n) => n === "value" && s.type === "css-decl");
|
|
4350
|
+
}
|
|
4351
|
+
function ii(e, s) {
|
|
4352
|
+
let n = [];
|
|
4353
|
+
for (let o = 0; o < e.length; o += s) n.push(e.slice(o, o + s));
|
|
4354
|
+
return n;
|
|
4355
|
+
}
|
|
4356
|
+
function ai(e, s, n) {
|
|
4357
|
+
let o = [];
|
|
4358
|
+
return e.each(() => {
|
|
4359
|
+
let { node: c, previous: i } = e;
|
|
4360
|
+
if (i?.type === "css-comment" && i.text.trim() === "prettier-ignore" ? o.push(s.originalText.slice(V(c), G(c))) : o.push(n()), e.isLast) return;
|
|
4361
|
+
let { next: f } = e;
|
|
4362
|
+
f.type === "css-comment" && !qr(s.originalText, V(f), { backwards: !0 }) && !Xe(c) || f.type === "css-atrule" && f.name === "else" && c.type !== "css-comment" ? o.push(" ") : (o.push(s.__isHTMLStyleAttribute ? U : B), Br(s.originalText, G(c)) && !Xe(c) && o.push(B));
|
|
4363
|
+
}, "nodes"), o;
|
|
4364
|
+
}
|
|
4365
|
+
var je = ai;
|
|
4366
|
+
function ui(e, s, n) {
|
|
4367
|
+
var o, c, i, f, u, m;
|
|
4368
|
+
let { node: p } = e;
|
|
4369
|
+
switch (p.type) {
|
|
4370
|
+
case "front-matter":
|
|
4371
|
+
return [p.raw, B];
|
|
4372
|
+
case "css-root": {
|
|
4373
|
+
let r = je(e, s, n), t = p.raws.after.trim();
|
|
4374
|
+
return t.startsWith(";") && (t = t.slice(1).trim()), [p.frontMatter ? [n("frontMatter"), B] : "", r, t ? ` ${t}` : "", p.nodes.length > 0 ? B : ""];
|
|
4375
|
+
}
|
|
4376
|
+
case "css-comment": {
|
|
4377
|
+
let r = p.inline || p.raws.inline, t = s.originalText.slice(V(p), G(p));
|
|
4378
|
+
return r ? t.trimEnd() : t;
|
|
4379
|
+
}
|
|
4380
|
+
case "css-rule":
|
|
4381
|
+
return [n("selector"), p.important ? " !important" : "", p.nodes ? [((o = p.selector) == null ? void 0 : o.type) === "selector-unknown" && Ae(p.selector.value) ? U : p.selector ? " " : "", "{", p.nodes.length > 0 ? H([B, je(e, s, n)]) : "", B, "}", To(p) ? ";" : ""] : ";"];
|
|
4382
|
+
case "css-decl": {
|
|
4383
|
+
let r = e.parent, { between: t } = p.raws, h = t.trim(), a = h === ":", d = typeof p.value == "string" && /^ *$/u.test(p.value), l = typeof p.value == "string" ? p.value : n("value");
|
|
4384
|
+
return l = Mo(p) ? fn(l) : l, !a && Ae(h) && !((i = (c = p.value) == null ? void 0 : c.group) != null && i.group && e.call(() => Fr(e), "value", "group", "group")) && (l = H([B, $e(l)])), [F(!1, p.raws.before, /[\s;]/gu, ""), r.type === "css-atrule" && r.variable || bo(e) ? p.prop : _e(p.prop), h.startsWith("//") ? " " : "", h, p.extend || d ? "" : " ", s.parser === "less" && p.extend && p.selector ? ["extend(", n("selector"), ")"] : "", l, p.raws.important ? p.raws.important.replace(/\s*!\s*important/iu, " !important") : p.important ? " !important" : "", p.raws.scssDefault ? p.raws.scssDefault.replace(/\s*!default/iu, " !default") : p.scssDefault ? " !default" : "", p.raws.scssGlobal ? p.raws.scssGlobal.replace(/\s*!global/iu, " !global") : p.scssGlobal ? " !global" : "", p.nodes ? [" {", H([Z, je(e, s, n)]), Z, "}"] : Io(p) && !r.raws.semicolon && s.originalText[G(p) - 1] !== ";" ? "" : s.__isHTMLStyleAttribute && e.isLast ? xr(";") : ";"];
|
|
4385
|
+
}
|
|
4386
|
+
case "css-atrule": {
|
|
4387
|
+
let r = e.parent, t = pt(p) && !r.raws.semicolon && s.originalText[G(p) - 1] !== ";";
|
|
4388
|
+
if (s.parser === "less") {
|
|
4389
|
+
if (p.mixin) return [n("selector"), p.important ? " !important" : "", t ? "" : ";"];
|
|
4390
|
+
if (p.function) return [p.name, typeof p.params == "string" ? p.params : n("params"), t ? "" : ";"];
|
|
4391
|
+
if (p.variable) return ["@", p.name, ": ", p.value ? n("value") : "", p.raws.between.trim() ? p.raws.between.trim() + " " : "", p.nodes ? ["{", H([p.nodes.length > 0 ? Z : "", je(e, s, n)]), Z, "}"] : "", t ? "" : ";"];
|
|
4392
|
+
}
|
|
4393
|
+
let h = p.name === "import" && ((f = p.params) == null ? void 0 : f.type) === "value-unknown" && p.params.value.endsWith(";");
|
|
4394
|
+
return ["@", Gt(p) || p.name.endsWith(":") || pt(p) ? p.name : _e(p.name), p.params ? [Gt(p) ? "" : pt(p) ? p.raws.afterName === "" ? "" : p.name.endsWith(":") ? " " : /^\s*\n\s*\n/u.test(p.raws.afterName) ? [B, B] : /^\s*\n/u.test(p.raws.afterName) ? B : " " : " ", typeof p.params == "string" ? p.params : n("params")] : "", p.selector ? H([" ", n("selector")]) : "", p.value ? K([" ", n("value"), vt(p, s) ? $o(p) ? " " : U : ""]) : p.name === "else" ? " " : "", p.nodes ? [vt(p, s) ? "" : p.selector && !p.selector.nodes && typeof p.selector.value == "string" && Ae(p.selector.value) || !p.selector && typeof p.params == "string" && Ae(p.params) ? U : " ", "{", H([p.nodes.length > 0 ? Z : "", je(e, s, n)]), Z, "}"] : t || h ? "" : ";"];
|
|
4395
|
+
}
|
|
4396
|
+
case "media-query-list": {
|
|
4397
|
+
let r = [];
|
|
4398
|
+
return e.each(({ node: t }) => {
|
|
4399
|
+
t.type === "media-query" && t.value === "" || r.push(n());
|
|
4400
|
+
}, "nodes"), K(H(oe(U, r)));
|
|
4401
|
+
}
|
|
4402
|
+
case "media-query":
|
|
4403
|
+
return [oe(" ", e.map(n, "nodes")), e.isLast ? "" : ","];
|
|
4404
|
+
case "media-type":
|
|
4405
|
+
return ve(Y(p.value, s));
|
|
4406
|
+
case "media-feature-expression":
|
|
4407
|
+
return p.nodes ? ["(", ...e.map(n, "nodes"), ")"] : p.value;
|
|
4408
|
+
case "media-feature":
|
|
4409
|
+
return _e(Y(F(!1, p.value, / +/gu, " "), s));
|
|
4410
|
+
case "media-colon":
|
|
4411
|
+
return [p.value, " "];
|
|
4412
|
+
case "media-value":
|
|
4413
|
+
return ve(Y(p.value, s));
|
|
4414
|
+
case "media-keyword":
|
|
4415
|
+
return Y(p.value, s);
|
|
4416
|
+
case "media-url":
|
|
4417
|
+
return Y(F(!1, F(!1, p.value, /^url\(\s+/giu, "url("), /\s+\)$/gu, ")"), s);
|
|
4418
|
+
case "media-unknown":
|
|
4419
|
+
return p.value;
|
|
4420
|
+
case "selector-root":
|
|
4421
|
+
return K([Me(e, "custom-selector") ? [e.findAncestor((r) => r.type === "css-atrule").customSelector, U] : "", oe([",", Me(e, ["extend", "custom-selector", "nest"]) ? U : B], e.map(n, "nodes"))]);
|
|
4422
|
+
case "selector-selector": {
|
|
4423
|
+
let r = p.nodes.length > 2;
|
|
4424
|
+
return K((r ? H : (t) => t)(e.map(n, "nodes")));
|
|
4425
|
+
}
|
|
4426
|
+
case "selector-comment":
|
|
4427
|
+
return p.value;
|
|
4428
|
+
case "selector-string":
|
|
4429
|
+
return Y(p.value, s);
|
|
4430
|
+
case "selector-tag":
|
|
4431
|
+
return [p.namespace ? [p.namespace === !0 ? "" : p.namespace.trim(), "|"] : "", ((u = e.previous) == null ? void 0 : u.type) === "selector-nesting" ? p.value : ve(wo(e, p.value) ? p.value.toLowerCase() : p.value)];
|
|
4432
|
+
case "selector-id":
|
|
4433
|
+
return ["#", p.value];
|
|
4434
|
+
case "selector-class":
|
|
4435
|
+
return [".", ve(Y(p.value, s))];
|
|
4436
|
+
case "selector-attribute":
|
|
4437
|
+
return ["[", p.namespace ? [p.namespace === !0 ? "" : p.namespace.trim(), "|"] : "", p.attribute.trim(), p.operator ?? "", p.value ? Jo(Y(p.value.trim(), s), s) : "", p.insensitive ? " i" : "", "]"];
|
|
4438
|
+
case "selector-combinator": {
|
|
4439
|
+
if (p.value === "+" || p.value === ">" || p.value === "~" || p.value === ">>>") {
|
|
4440
|
+
let h = e.parent;
|
|
4441
|
+
return [h.type === "selector-selector" && h.nodes[0] === p ? "" : U, p.value, e.isLast ? "" : " "];
|
|
4442
|
+
}
|
|
4443
|
+
let r = p.value.trim().startsWith("(") ? U : "", t = ve(Y(p.value.trim(), s)) || U;
|
|
4444
|
+
return [r, t];
|
|
4445
|
+
}
|
|
4446
|
+
case "selector-universal":
|
|
4447
|
+
return [p.namespace ? [p.namespace === !0 ? "" : p.namespace.trim(), "|"] : "", p.value];
|
|
4448
|
+
case "selector-pseudo":
|
|
4449
|
+
return [_e(p.value), at(p.nodes) ? K(["(", H([Z, oe([",", U], e.map(n, "nodes"))]), Z, ")"]) : ""];
|
|
4450
|
+
case "selector-nesting":
|
|
4451
|
+
return p.value;
|
|
4452
|
+
case "selector-unknown": {
|
|
4453
|
+
let r = e.findAncestor((a) => a.type === "css-rule");
|
|
4454
|
+
if (r != null && r.isSCSSNesterProperty) return ve(Y(_e(p.value), s));
|
|
4455
|
+
let t = e.parent;
|
|
4456
|
+
if ((m = t.raws) != null && m.selector) {
|
|
4457
|
+
let a = V(t), d = a + t.raws.selector.length;
|
|
4458
|
+
return s.originalText.slice(a, d).trim();
|
|
4459
|
+
}
|
|
4460
|
+
let h = e.grandparent;
|
|
4461
|
+
if (t.type === "value-paren_group" && h?.type === "value-func" && h.value === "selector") {
|
|
4462
|
+
let a = G(t.open) + 1, d = V(t.close), l = s.originalText.slice(a, d).trim();
|
|
4463
|
+
return Ae(l) ? [$t, l] : l;
|
|
4464
|
+
}
|
|
4465
|
+
return p.value;
|
|
4466
|
+
}
|
|
4467
|
+
case "value-value":
|
|
4468
|
+
case "value-root":
|
|
4469
|
+
return n("group");
|
|
4470
|
+
case "value-comment":
|
|
4471
|
+
return s.originalText.slice(V(p), G(p));
|
|
4472
|
+
case "value-comma_group":
|
|
4473
|
+
return qo(e, s, n);
|
|
4474
|
+
case "value-paren_group":
|
|
4475
|
+
return ni(e, s, n);
|
|
4476
|
+
case "value-func":
|
|
4477
|
+
return [p.value, Me(e, "supports") && No(p) ? " " : "", n("group")];
|
|
4478
|
+
case "value-paren":
|
|
4479
|
+
return p.value;
|
|
4480
|
+
case "value-number":
|
|
4481
|
+
return [Wr(p.value), Nr(p.unit)];
|
|
4482
|
+
case "value-operator":
|
|
4483
|
+
return p.value;
|
|
4484
|
+
case "value-word":
|
|
4485
|
+
return p.isColor && p.isHex || go(p.value) ? p.value.toLowerCase() : p.value;
|
|
4486
|
+
case "value-colon": {
|
|
4487
|
+
let { previous: r } = e;
|
|
4488
|
+
return K([p.value, typeof r?.value == "string" && r.value.endsWith("\\") || Qe(e, "url") ? "" : U]);
|
|
4489
|
+
}
|
|
4490
|
+
case "value-string":
|
|
4491
|
+
return Or(p.raws.quote + p.value + p.raws.quote, s);
|
|
4492
|
+
case "value-atword":
|
|
4493
|
+
return ["@", p.value];
|
|
4494
|
+
case "value-unicode-range":
|
|
4495
|
+
return p.value;
|
|
4496
|
+
case "value-unknown":
|
|
4497
|
+
return p.value;
|
|
4498
|
+
default:
|
|
4499
|
+
throw new Sn(p, "PostCSS");
|
|
4500
|
+
}
|
|
4501
|
+
}
|
|
4502
|
+
var li = { print: ui, embed: Mn, insertPragma: ho, massageAstNode: jn, getVisitorKeys: Bn }, ci = li, pi = [{ name: "CSS", type: "markup", extensions: [".css", ".wxss"], tmScope: "source.css", aceMode: "css", codemirrorMode: "css", codemirrorMimeType: "text/css", parsers: ["css"], vscodeLanguageIds: ["css"], linguistLanguageId: 50 }, { name: "PostCSS", type: "markup", extensions: [".pcss", ".postcss"], tmScope: "source.postcss", aceMode: "text", group: "CSS", parsers: ["css"], vscodeLanguageIds: ["postcss"], linguistLanguageId: 262764437 }, { name: "Less", type: "markup", extensions: [".less"], tmScope: "source.css.less", aceMode: "less", aliases: ["less-css"], codemirrorMode: "css", codemirrorMimeType: "text/css", parsers: ["less"], vscodeLanguageIds: ["less"], linguistLanguageId: 198 }, { name: "SCSS", type: "markup", extensions: [".scss"], tmScope: "source.css.scss", aceMode: "scss", codemirrorMode: "css", codemirrorMimeType: "text/x-scss", parsers: ["scss"], vscodeLanguageIds: ["scss"], linguistLanguageId: 329 }], fi = { singleQuote: { category: "Common", type: "boolean", default: !1, description: "Use single quotes instead of double quotes." } }, hi = { singleQuote: fi.singleQuote }, di = hi, Dr = {};
|
|
4503
|
+
Qt(Dr, { css: () => Vi, less: () => Gi, scss: () => Ji });
|
|
4504
|
+
var mi = we(rt()), vi = we(hs()), yi = we(bs());
|
|
4505
|
+
function gi(e, s) {
|
|
4506
|
+
let n = new SyntaxError(e + " (" + s.loc.start.line + ":" + s.loc.start.column + ")");
|
|
4507
|
+
return Object.assign(n, s);
|
|
4508
|
+
}
|
|
4509
|
+
var wi = gi, bi = we(ks());
|
|
4510
|
+
function ze(e, s, n) {
|
|
4511
|
+
if (e && typeof e == "object") {
|
|
4512
|
+
delete e.parent;
|
|
4513
|
+
for (let o in e) ze(e[o], s, n), o === "type" && typeof e[o] == "string" && !e[o].startsWith(s) && (!n || !n.test(e[o])) && (e[o] = s + e[o]);
|
|
4514
|
+
}
|
|
4515
|
+
return e;
|
|
4516
|
+
}
|
|
4517
|
+
function Ur(e) {
|
|
4518
|
+
if (e && typeof e == "object") {
|
|
4519
|
+
delete e.parent;
|
|
4520
|
+
for (let s in e) Ur(e[s]);
|
|
4521
|
+
!Array.isArray(e) && e.value && !e.type && (e.type = "unknown");
|
|
4522
|
+
}
|
|
4523
|
+
return e;
|
|
4524
|
+
}
|
|
4525
|
+
var xi = bi.default.default;
|
|
4526
|
+
function ki(e) {
|
|
4527
|
+
let s;
|
|
4528
|
+
try {
|
|
4529
|
+
s = xi(e);
|
|
4530
|
+
} catch {
|
|
4531
|
+
return { type: "selector-unknown", value: e };
|
|
4532
|
+
}
|
|
4533
|
+
return ze(Ur(s), "media-");
|
|
4534
|
+
}
|
|
4535
|
+
var Oi = ki, Ti = we(Ws());
|
|
4536
|
+
function Ci(e) {
|
|
4537
|
+
if (/\/\/|\/\*/u.test(e)) return { type: "selector-unknown", value: e.trim() };
|
|
4538
|
+
let s;
|
|
4539
|
+
try {
|
|
4540
|
+
new Ti.default((n) => {
|
|
4541
|
+
s = n;
|
|
4542
|
+
}).process(e);
|
|
4543
|
+
} catch {
|
|
4544
|
+
return { type: "selector-unknown", value: e };
|
|
4545
|
+
}
|
|
4546
|
+
return ze(s, "selector-");
|
|
4547
|
+
}
|
|
4548
|
+
var ae = Ci, Si = we(tn()), _i = (e) => {
|
|
4549
|
+
for (; e.parent; ) e = e.parent;
|
|
4550
|
+
return e;
|
|
4551
|
+
}, Vr = _i;
|
|
4552
|
+
function Ei(e) {
|
|
4553
|
+
return Vr(e).text.slice(e.group.open.sourceIndex + 1, e.group.close.sourceIndex).trim();
|
|
4554
|
+
}
|
|
4555
|
+
var Ai = Ei;
|
|
4556
|
+
function ji(e) {
|
|
4557
|
+
if (at(e)) {
|
|
4558
|
+
for (let s = e.length - 1; s > 0; s--) if (e[s].type === "word" && e[s].value === "{" && e[s - 1].type === "word" && e[s - 1].value.endsWith("#")) return !0;
|
|
4559
|
+
}
|
|
4560
|
+
return !1;
|
|
4561
|
+
}
|
|
4562
|
+
var Ii = ji;
|
|
4563
|
+
function Pi(e) {
|
|
4564
|
+
return e.some((s) => s.type === "string" || s.type === "func" && !s.value.endsWith("\\"));
|
|
4565
|
+
}
|
|
4566
|
+
var Mi = Pi;
|
|
4567
|
+
function $i(e, s) {
|
|
4568
|
+
return !!(s.parser === "scss" && e?.type === "word" && e.value.startsWith("$"));
|
|
4569
|
+
}
|
|
4570
|
+
var Ri = $i, Ht = (e) => e.type === "paren" && e.value === ")";
|
|
4571
|
+
function Ni(e, s) {
|
|
4572
|
+
var n;
|
|
4573
|
+
let { nodes: o } = e, c = { open: null, close: null, groups: [], type: "paren_group" }, i = [c], f = c, u = { groups: [], type: "comma_group" }, m = [u];
|
|
4574
|
+
for (let p = 0; p < o.length; ++p) {
|
|
4575
|
+
let r = o[p];
|
|
4576
|
+
if (s.parser === "scss" && r.type === "number" && r.unit === ".." && r.value.endsWith(".") && (r.value = r.value.slice(0, -1), r.unit = "..."), r.type === "func" && r.value === "selector" && (r.group.groups = [ae(Vr(e).text.slice(r.group.open.sourceIndex + 1, r.group.close.sourceIndex))]), r.type === "func" && r.value === "url") {
|
|
4577
|
+
let t = ((n = r.group) == null ? void 0 : n.groups) ?? [], h = [];
|
|
4578
|
+
for (let a = 0; a < t.length; a++) {
|
|
4579
|
+
let d = t[a];
|
|
4580
|
+
d.type === "comma_group" ? h = [...h, ...d.groups] : h.push(d);
|
|
4581
|
+
}
|
|
4582
|
+
(Ii(h) || !Mi(h) && !Ri(h[0], s)) && (r.group.groups = [Ai(r)]);
|
|
4583
|
+
}
|
|
4584
|
+
if (r.type === "paren" && r.value === "(") c = { open: r, close: null, groups: [], type: "paren_group" }, i.push(c), u = { groups: [], type: "comma_group" }, m.push(u);
|
|
4585
|
+
else if (Ht(r)) {
|
|
4586
|
+
if (u.groups.length > 0 && c.groups.push(u), c.close = r, m.length === 1) throw new Error("Unbalanced parenthesis");
|
|
4587
|
+
m.pop(), u = ge(!1, m, -1), u.groups.push(c), i.pop(), c = ge(!1, i, -1);
|
|
4588
|
+
} else if (r.type === "comma") {
|
|
4589
|
+
if (p === o.length - 3 && o[p + 1].type === "comment" && Ht(o[p + 2])) continue;
|
|
4590
|
+
c.groups.push(u), u = { groups: [], type: "comma_group" }, m[m.length - 1] = u;
|
|
4591
|
+
} else u.groups.push(r);
|
|
4592
|
+
}
|
|
4593
|
+
return u.groups.length > 0 && c.groups.push(u), f;
|
|
4594
|
+
}
|
|
4595
|
+
function gt(e) {
|
|
4596
|
+
return e.type === "paren_group" && !e.open && !e.close && e.groups.length === 1 || e.type === "comma_group" && e.groups.length === 1 ? gt(e.groups[0]) : e.type === "paren_group" || e.type === "comma_group" ? { ...e, groups: e.groups.map(gt) } : e;
|
|
4597
|
+
}
|
|
4598
|
+
function Gr(e, s) {
|
|
4599
|
+
if (e && typeof e == "object") for (let n in e) n !== "parent" && (Gr(e[n], s), n === "nodes" && (e.group = gt(Ni(e, s)), delete e[n]));
|
|
4600
|
+
return e;
|
|
4601
|
+
}
|
|
4602
|
+
function Li(e, s) {
|
|
4603
|
+
if (s.parser === "less" && e.startsWith("~`")) return { type: "value-unknown", value: e };
|
|
4604
|
+
let n = null;
|
|
4605
|
+
try {
|
|
4606
|
+
n = new Si.default(e, { loose: !0 }).parse();
|
|
4607
|
+
} catch {
|
|
4608
|
+
return { type: "value-unknown", value: e };
|
|
4609
|
+
}
|
|
4610
|
+
n.text = e;
|
|
4611
|
+
let o = Gr(n, s);
|
|
4612
|
+
return ze(o, "value-", /^selector-/u);
|
|
4613
|
+
}
|
|
4614
|
+
var ie = Li, Wi = /* @__PURE__ */ new Set(["import", "use", "forward"]);
|
|
4615
|
+
function zi(e) {
|
|
4616
|
+
return Wi.has(e);
|
|
4617
|
+
}
|
|
4618
|
+
var qi = zi;
|
|
4619
|
+
function Bi(e, s) {
|
|
4620
|
+
return s.parser !== "scss" || !e.selector ? !1 : e.selector.replace(/\/\*.*?\*\//u, "").replace(/\/\/.*\n/u, "").trim().endsWith(":");
|
|
4621
|
+
}
|
|
4622
|
+
var Fi = Bi, Di = /(\s*)(!default).*$/u, Ui = /(\s*)(!global).*$/u;
|
|
4623
|
+
function Jr(e, s) {
|
|
4624
|
+
var n, o;
|
|
4625
|
+
if (e && typeof e == "object") {
|
|
4626
|
+
delete e.parent;
|
|
4627
|
+
for (let u in e) Jr(e[u], s);
|
|
4628
|
+
if (!e.type) return e;
|
|
4629
|
+
if (e.raws ?? (e.raws = {}), e.type === "css-decl" && typeof e.prop == "string" && e.prop.startsWith("--") && typeof e.value == "string" && e.value.startsWith("{")) {
|
|
4630
|
+
let u;
|
|
4631
|
+
if (e.value.trimEnd().endsWith("}")) {
|
|
4632
|
+
let m = s.originalText.slice(0, e.source.start.offset), p = "a".repeat(e.prop.length) + s.originalText.slice(e.source.start.offset + e.prop.length, e.source.end.offset), r = F(!1, m, /[^\n]/gu, " ") + p, t;
|
|
4633
|
+
s.parser === "scss" ? t = Zr : s.parser === "less" ? t = Qr : t = Hr;
|
|
4634
|
+
let h;
|
|
4635
|
+
try {
|
|
4636
|
+
h = t(r, { ...s });
|
|
4637
|
+
} catch {
|
|
4638
|
+
}
|
|
4639
|
+
((n = h?.nodes) == null ? void 0 : n.length) === 1 && h.nodes[0].type === "css-rule" && (u = h.nodes[0].nodes);
|
|
4640
|
+
}
|
|
4641
|
+
return u ? e.value = { type: "css-rule", nodes: u } : e.value = { type: "value-unknown", value: e.raws.value.raw }, e;
|
|
4642
|
+
}
|
|
4643
|
+
let c = "";
|
|
4644
|
+
typeof e.selector == "string" && (c = e.raws.selector ? e.raws.selector.scss ?? e.raws.selector.raw : e.selector, e.raws.between && e.raws.between.trim().length > 0 && (c += e.raws.between), e.raws.selector = c);
|
|
4645
|
+
let i = "";
|
|
4646
|
+
typeof e.value == "string" && (i = e.raws.value ? e.raws.value.scss ?? e.raws.value.raw : e.value, e.raws.value = i.trim());
|
|
4647
|
+
let f = "";
|
|
4648
|
+
if (typeof e.params == "string" && (f = e.raws.params ? e.raws.params.scss ?? e.raws.params.raw : e.params, e.raws.afterName && e.raws.afterName.trim().length > 0 && (f = e.raws.afterName + f), e.raws.between && e.raws.between.trim().length > 0 && (f = f + e.raws.between), f = f.trim(), e.raws.params = f), c.trim().length > 0) return c.startsWith("@") && c.endsWith(":") ? e : e.mixin ? (e.selector = ie(c, s), e) : (Fi(e, s) && (e.isSCSSNesterProperty = !0), e.selector = ae(c), e);
|
|
4649
|
+
if (i.trim().length > 0) {
|
|
4650
|
+
let u = i.match(Di);
|
|
4651
|
+
u && (i = i.slice(0, u.index), e.scssDefault = !0, u[0].trim() !== "!default" && (e.raws.scssDefault = u[0]));
|
|
4652
|
+
let m = i.match(Ui);
|
|
4653
|
+
if (m && (i = i.slice(0, m.index), e.scssGlobal = !0, m[0].trim() !== "!global" && (e.raws.scssGlobal = m[0])), i.startsWith("progid:")) return { type: "value-unknown", value: i };
|
|
4654
|
+
e.value = ie(i, s);
|
|
4655
|
+
}
|
|
4656
|
+
if (s.parser === "less" && e.type === "css-decl" && i.startsWith("extend(") && (e.extend || (e.extend = e.raws.between === ":"), e.extend && !e.selector && (delete e.value, e.selector = ae(i.slice(7, -1)))), e.type === "css-atrule") {
|
|
4657
|
+
if (s.parser === "less") {
|
|
4658
|
+
if (e.mixin) {
|
|
4659
|
+
let u = e.raws.identifier + e.name + e.raws.afterName + e.raws.params;
|
|
4660
|
+
return e.selector = ae(u), delete e.params, e;
|
|
4661
|
+
}
|
|
4662
|
+
if (e.function) return e;
|
|
4663
|
+
}
|
|
4664
|
+
if (s.parser === "css" && e.name === "custom-selector") {
|
|
4665
|
+
let u = e.params.match(/:--\S+\s+/u)[0].trim();
|
|
4666
|
+
return e.customSelector = u, e.selector = ae(e.params.slice(u.length).trim()), delete e.params, e;
|
|
4667
|
+
}
|
|
4668
|
+
if (s.parser === "less") {
|
|
4669
|
+
if (e.name.includes(":") && !e.params) {
|
|
4670
|
+
e.variable = !0;
|
|
4671
|
+
let u = e.name.split(":");
|
|
4672
|
+
e.name = u[0], e.value = ie(u.slice(1).join(":"), s);
|
|
4673
|
+
}
|
|
4674
|
+
if (!["page", "nest", "keyframes"].includes(e.name) && ((o = e.params) == null ? void 0 : o[0]) === ":") {
|
|
4675
|
+
e.variable = !0;
|
|
4676
|
+
let u = e.params.slice(1);
|
|
4677
|
+
u && (e.value = ie(u, s)), e.raws.afterName += ":";
|
|
4678
|
+
}
|
|
4679
|
+
if (e.variable) return delete e.params, e.value || delete e.value, e;
|
|
4680
|
+
}
|
|
4681
|
+
}
|
|
4682
|
+
if (e.type === "css-atrule" && f.length > 0) {
|
|
4683
|
+
let { name: u } = e, m = e.name.toLowerCase();
|
|
4684
|
+
return u === "warn" || u === "error" ? (e.params = { type: "media-unknown", value: f }, e) : u === "extend" || u === "nest" ? (e.selector = ae(f), delete e.params, e) : u === "at-root" ? (/^\(\s*(?:without|with)\s*:.+\)$/su.test(f) ? e.params = ie(f, s) : (e.selector = ae(f), delete e.params), e) : qi(m) ? (e.import = !0, delete e.filename, e.params = ie(f, s), e) : ["namespace", "supports", "if", "else", "for", "each", "while", "debug", "mixin", "include", "function", "return", "define-mixin", "add-mixin"].includes(u) ? (f = f.replace(/(\$\S+?)(\s+)?\.{3}/u, "$1...$2"), f = f.replace(/^(?!if)(\S+)(\s+)\(/u, "$1($2"), e.value = ie(f, s), delete e.params, e) : ["media", "custom-media"].includes(m) ? f.includes("#{") ? { type: "media-unknown", value: f } : (e.params = Oi(f), e) : (e.params = f, e);
|
|
4685
|
+
}
|
|
4686
|
+
}
|
|
4687
|
+
return e;
|
|
4688
|
+
}
|
|
4689
|
+
function zt(e, s, n) {
|
|
4690
|
+
let o = ut(s), { frontMatter: c } = o;
|
|
4691
|
+
s = o.content;
|
|
4692
|
+
let i;
|
|
4693
|
+
try {
|
|
4694
|
+
i = e(s, { map: !1 });
|
|
4695
|
+
} catch (f) {
|
|
4696
|
+
let { name: u, reason: m, line: p, column: r } = f;
|
|
4697
|
+
throw typeof p != "number" ? f : wi(`${u}: ${m}`, { loc: { start: { line: p, column: r } }, cause: f });
|
|
4698
|
+
}
|
|
4699
|
+
return n.originalText = s, i = Jr(ze(i, "css-"), n), Ir(i, s), c && (c.source = { startOffset: 0, endOffset: c.raw.length }, i.frontMatter = c), i;
|
|
4700
|
+
}
|
|
4701
|
+
function Hr(e, s = {}) {
|
|
4702
|
+
return zt(mi.default.default, e, s);
|
|
4703
|
+
}
|
|
4704
|
+
function Qr(e, s = {}) {
|
|
4705
|
+
return zt((n) => vi.default.parse(Vn(n)), e, s);
|
|
4706
|
+
}
|
|
4707
|
+
function Zr(e, s = {}) {
|
|
4708
|
+
return zt(yi.default, e, s);
|
|
4709
|
+
}
|
|
4710
|
+
var qt = { astFormat: "postcss", hasPragma: po, hasIgnorePragma: fo, locStart: V, locEnd: G }, Vi = { ...qt, parse: Hr }, Gi = { ...qt, parse: Qr }, Ji = { ...qt, parse: Zr }, Hi = { postcss: ci }, Qi = pr;
|
|
4711
|
+
export {
|
|
4712
|
+
Qi as default,
|
|
4713
|
+
pi as languages,
|
|
4714
|
+
di as options,
|
|
4715
|
+
Dr as parsers,
|
|
4716
|
+
Hi as printers
|
|
4717
|
+
};
|