@vx-oss/docs-tailwind 1.0.3

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.
@@ -0,0 +1,3927 @@
1
+ import { createRequire } from "node:module";
2
+ import plugin from "tailwindcss/plugin";
3
+ //#region \0rolldown/runtime.js
4
+ var __create = Object.create;
5
+ var __defProp = Object.defineProperty;
6
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
+ var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __getProtoOf = Object.getPrototypeOf;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
13
+ key = keys[i];
14
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
15
+ get: ((k) => from[k]).bind(null, key),
16
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
+ });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
22
+ value: mod,
23
+ enumerable: true
24
+ }) : target, mod));
25
+ var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
26
+ //#endregion
27
+ //#region src/typography/styles.ts
28
+ function round(num) {
29
+ return num.toFixed(7).replace(/(\.[0-9]+?)0+$/, "$1").replace(/\.0$/, "");
30
+ }
31
+ function scaled(value) {
32
+ return `calc(${value} * var(--tw-prose-size))`;
33
+ }
34
+ function scaledPx(value) {
35
+ return scaled(`${round(value)}px`);
36
+ }
37
+ function rem(px) {
38
+ return `${round(px / 16)}rem`;
39
+ }
40
+ function scaledRem(px) {
41
+ return scaled(rem(px));
42
+ }
43
+ function em(px, base) {
44
+ return `${round(px / base)}em`;
45
+ }
46
+ const colors = {
47
+ "--tw-prose-body": "color-mix(in oklab, var(--color-fd-foreground) 90%, transparent)",
48
+ "--tw-prose-headings": "var(--color-fd-foreground)",
49
+ "--tw-prose-lead": `var(--color-fd-foreground)`,
50
+ "--tw-prose-links": `var(--color-fd-foreground)`,
51
+ "--tw-prose-bold": `var(--color-fd-foreground)`,
52
+ "--tw-prose-counters": `var(--color-fd-muted-foreground)`,
53
+ "--tw-prose-bullets": `var(--color-fd-muted-foreground)`,
54
+ "--tw-prose-hr": `var(--color-fd-border)`,
55
+ "--tw-prose-quotes": `var(--color-fd-foreground)`,
56
+ "--tw-prose-quote-borders": `var(--color-fd-border)`,
57
+ "--tw-prose-captions": `var(--color-fd-foreground)`,
58
+ "--tw-prose-code": `var(--color-fd-foreground)`,
59
+ "--tw-prose-th-borders": `var(--color-fd-border)`,
60
+ "--tw-prose-td-borders": `var(--color-fd-border)`,
61
+ "--tw-prose-kbd": `var(--color-fd-foreground)`,
62
+ "--tw-prose-kbd-shadows": `color-mix(in oklab, var(--color-fd-primary) 50%, transparent)`
63
+ };
64
+ const roundedTable = {
65
+ table: {
66
+ borderCollapse: "separate",
67
+ borderSpacing: "0",
68
+ background: "var(--color-fd-card)",
69
+ borderRadius: "var(--radius-lg)",
70
+ border: "1px solid var(--color-fd-border)",
71
+ overflow: "hidden"
72
+ },
73
+ th: {
74
+ textAlign: "start",
75
+ padding: scaled("var(--spacing) * 2.5"),
76
+ "border-inline-start": "1px solid var(--color-fd-border)",
77
+ background: "var(--color-fd-muted)"
78
+ },
79
+ "th:first-child": { "border-inline-start": "none" },
80
+ "th:not(tr:last-child *), td:not(tr:last-child *)": { "border-bottom": "1px solid var(--color-fd-border)" },
81
+ td: {
82
+ textAlign: "start",
83
+ "border-inline-start": "1px solid var(--color-fd-border)",
84
+ padding: scaled("var(--spacing) * 2.5")
85
+ },
86
+ "td:first-child": { "border-inline-start": "none" },
87
+ "tfoot th, tfoot td": {
88
+ borderTopWidth: "1px",
89
+ borderTopColor: "var(--tw-prose-th-borders)"
90
+ },
91
+ "thead th, thead td": {
92
+ borderBottomWidth: "1px",
93
+ borderBottomColor: "var(--tw-prose-th-borders)"
94
+ }
95
+ };
96
+ const normalTable = {
97
+ thead: {
98
+ borderBottomWidth: "1px",
99
+ borderBottomColor: "var(--tw-prose-th-borders)"
100
+ },
101
+ "thead th": {
102
+ verticalAlign: "bottom",
103
+ paddingInlineEnd: em(8, 14),
104
+ paddingBottom: em(8, 14),
105
+ paddingInlineStart: em(8, 14)
106
+ },
107
+ "thead th:first-child": { paddingInlineStart: "0" },
108
+ "thead th:last-child": { paddingInlineEnd: "0" },
109
+ "tbody td, tfoot td": {
110
+ paddingTop: em(8, 14),
111
+ paddingInlineEnd: em(8, 14),
112
+ paddingBottom: em(8, 14),
113
+ paddingInlineStart: em(8, 14)
114
+ },
115
+ "tbody td:first-child, tfoot td:first-child": { paddingInlineStart: "0" },
116
+ "tbody td:last-child, tfoot td:last-child": { paddingInlineEnd: "0" },
117
+ "tbody tr": {
118
+ borderBottomWidth: "1px",
119
+ borderBottomColor: "var(--tw-prose-td-borders)"
120
+ },
121
+ "tbody tr:last-child": { borderBottomWidth: "0" },
122
+ "tbody td": { verticalAlign: "baseline" },
123
+ tfoot: {
124
+ borderTopWidth: "1px",
125
+ borderTopColor: "var(--tw-prose-th-borders)"
126
+ },
127
+ "tfoot td": { verticalAlign: "top" },
128
+ "th, td": { textAlign: "start" }
129
+ };
130
+ const DEFAULT = { css: [
131
+ {
132
+ "--tw-prose-size": "1",
133
+ color: "var(--tw-prose-body)",
134
+ maxWidth: "none",
135
+ fontSize: scaledRem(16),
136
+ lineHeight: scaledRem(28),
137
+ "[class~=\"lead\"]": {
138
+ fontSize: em(20, 16),
139
+ lineHeight: round(32 / 20),
140
+ marginTop: em(24, 20),
141
+ marginBottom: em(24, 20),
142
+ color: "var(--tw-prose-lead)"
143
+ },
144
+ ul: {
145
+ paddingInlineStart: scaledRem(16),
146
+ listStyleType: "disc",
147
+ marginTop: em(20, 16),
148
+ marginBottom: em(20, 16)
149
+ },
150
+ li: {
151
+ marginTop: em(8, 16),
152
+ marginBottom: em(8, 16)
153
+ },
154
+ "ol > li": { paddingInlineStart: em(6, 16) },
155
+ "ul > li": { paddingInlineStart: "0" },
156
+ "> ul > li p": {
157
+ marginTop: em(12, 16),
158
+ marginBottom: em(12, 16)
159
+ },
160
+ "> ul > li > p:first-child": { marginTop: em(20, 16) },
161
+ "> ul > li > p:last-child": { marginBottom: em(20, 16) },
162
+ "> ol > li > p:first-child": { marginTop: em(20, 16) },
163
+ "> ol > li > p:last-child": { marginBottom: em(20, 16) },
164
+ "ul ul, ul ol, ol ul, ol ol": {
165
+ marginTop: em(12, 16),
166
+ marginBottom: em(12, 16)
167
+ },
168
+ dl: {
169
+ marginTop: em(20, 16),
170
+ marginBottom: em(20, 16)
171
+ },
172
+ dt: {
173
+ color: "var(--tw-prose-headings)",
174
+ fontWeight: "600",
175
+ marginTop: em(20, 16)
176
+ },
177
+ dd: {
178
+ marginTop: em(8, 16),
179
+ paddingInlineStart: em(26, 16)
180
+ },
181
+ hr: {
182
+ borderColor: "var(--tw-prose-hr)",
183
+ borderTopWidth: "1px",
184
+ marginTop: em(48, 16),
185
+ marginBottom: em(48, 16)
186
+ },
187
+ p: {
188
+ marginTop: em(20, 16),
189
+ marginBottom: em(20, 16)
190
+ },
191
+ strong: {
192
+ color: "var(--tw-prose-bold)",
193
+ fontWeight: "500"
194
+ },
195
+ "a strong": { color: "inherit" },
196
+ "blockquote strong": { color: "inherit" },
197
+ "thead th strong": { color: "inherit" },
198
+ ol: {
199
+ listStyleType: "decimal",
200
+ marginTop: em(20, 16),
201
+ marginBottom: em(20, 16),
202
+ paddingInlineStart: em(26, 16)
203
+ },
204
+ "ol[type=\"A\"]": { listStyleType: "upper-alpha" },
205
+ "ol[type=\"a\"]": { listStyleType: "lower-alpha" },
206
+ "ol[type=\"A\" s]": { listStyleType: "upper-alpha" },
207
+ "ol[type=\"a\" s]": { listStyleType: "lower-alpha" },
208
+ "ol[type=\"I\"]": { listStyleType: "upper-roman" },
209
+ "ol[type=\"i\"]": { listStyleType: "lower-roman" },
210
+ "ol[type=\"I\" s]": { listStyleType: "upper-roman" },
211
+ "ol[type=\"i\" s]": { listStyleType: "lower-roman" },
212
+ "ol[type=\"1\"]": { listStyleType: "decimal" },
213
+ "ol > li::marker": {
214
+ fontWeight: "400",
215
+ color: "var(--tw-prose-counters)"
216
+ },
217
+ "ul > li::marker": { color: "var(--tw-prose-bullets)" },
218
+ blockquote: {
219
+ marginTop: em(32, 20),
220
+ marginBottom: em(32, 20),
221
+ paddingInlineStart: em(20, 20),
222
+ fontWeight: "500",
223
+ fontStyle: "italic",
224
+ color: "var(--tw-prose-quotes)",
225
+ borderInlineStartWidth: "0.25rem",
226
+ borderInlineStartColor: "var(--tw-prose-quote-borders)",
227
+ quotes: "\"\\201C\"\"\\201D\"\"\\2018\"\"\\2019\""
228
+ },
229
+ "blockquote p:first-of-type::before": { content: "open-quote" },
230
+ "blockquote p:last-of-type::after": { content: "close-quote" },
231
+ h1: {
232
+ color: "var(--tw-prose-headings)",
233
+ fontWeight: "800",
234
+ fontSize: scaled("var(--text-3xl)"),
235
+ marginTop: "0",
236
+ marginBottom: em(32, 36),
237
+ lineHeight: round(40 / 36)
238
+ },
239
+ "h1 strong": {
240
+ fontWeight: "900",
241
+ color: "inherit"
242
+ },
243
+ h2: {
244
+ color: "var(--tw-prose-headings)",
245
+ fontSize: em(24, 16),
246
+ marginTop: em(48, 24),
247
+ marginBottom: em(24, 24),
248
+ lineHeight: round(32 / 24),
249
+ fontWeight: "600"
250
+ },
251
+ "h2 strong": {
252
+ fontWeight: "800",
253
+ color: "inherit"
254
+ },
255
+ h3: {
256
+ color: "var(--tw-prose-headings)",
257
+ fontWeight: "600",
258
+ fontSize: em(20, 16),
259
+ marginTop: em(32, 20),
260
+ marginBottom: em(12, 20),
261
+ lineHeight: round(32 / 20)
262
+ },
263
+ "h3 strong": {
264
+ fontWeight: "700",
265
+ color: "inherit"
266
+ },
267
+ h4: {
268
+ color: "var(--tw-prose-headings)",
269
+ fontWeight: "600",
270
+ marginTop: em(24, 16),
271
+ marginBottom: em(8, 16),
272
+ lineHeight: round(24 / 16)
273
+ },
274
+ "h4 strong": {
275
+ fontWeight: "700",
276
+ color: "inherit"
277
+ },
278
+ "hr + *": { marginTop: "0" },
279
+ "h2 + *": { marginTop: "0" },
280
+ "h3 + *": { marginTop: "0" },
281
+ "h4 + *": { marginTop: "0" },
282
+ img: {
283
+ marginTop: em(32, 16),
284
+ marginBottom: em(32, 16)
285
+ },
286
+ picture: {
287
+ display: "block",
288
+ marginTop: em(32, 16),
289
+ marginBottom: em(32, 16)
290
+ },
291
+ "picture > img": {
292
+ marginTop: "0",
293
+ marginBottom: "0"
294
+ },
295
+ video: {
296
+ marginTop: em(32, 16),
297
+ marginBottom: em(32, 16)
298
+ },
299
+ kbd: {
300
+ fontSize: em(14, 16),
301
+ borderRadius: rem(5),
302
+ paddingTop: em(3, 16),
303
+ paddingInlineEnd: em(6, 16),
304
+ paddingBottom: em(3, 16),
305
+ paddingInlineStart: em(6, 16),
306
+ fontWeight: "500",
307
+ fontFamily: "inherit",
308
+ color: "var(--tw-prose-kbd)",
309
+ boxShadow: "0 0 0 1px var(--tw-prose-kbd-shadows),0 3px 0 var(--tw-prose-kbd-shadows)"
310
+ },
311
+ code: {
312
+ padding: scaledPx(3),
313
+ border: "solid 1px",
314
+ fontSize: scaledPx(13),
315
+ borderColor: `var(--color-fd-border)`,
316
+ borderRadius: "5px",
317
+ fontWeight: "400",
318
+ background: `var(--color-fd-muted)`,
319
+ color: "var(--tw-prose-code)"
320
+ },
321
+ "a code": { color: "inherit" },
322
+ "h1 code": {
323
+ color: "inherit",
324
+ fontSize: scaled("var(--text-2xl)")
325
+ },
326
+ "h2 code": {
327
+ color: "inherit",
328
+ fontSize: em(21, 24)
329
+ },
330
+ "h3 code": {
331
+ color: "inherit",
332
+ fontSize: em(18, 20)
333
+ },
334
+ "h4 code": { color: "inherit" },
335
+ "blockquote code": { color: "inherit" },
336
+ "thead th code": { color: "inherit" },
337
+ table: {
338
+ fontSize: em(14, 16),
339
+ lineHeight: round(24 / 14),
340
+ width: "100%",
341
+ tableLayout: "auto",
342
+ marginTop: em(32, 16),
343
+ marginBottom: em(32, 16)
344
+ },
345
+ "thead th": {
346
+ color: "var(--tw-prose-headings)",
347
+ fontWeight: "600"
348
+ },
349
+ figure: {
350
+ marginTop: em(32, 16),
351
+ marginBottom: em(32, 16)
352
+ },
353
+ "figure > *": {
354
+ marginTop: "0",
355
+ marginBottom: "0"
356
+ },
357
+ figcaption: {
358
+ color: "var(--tw-prose-captions)",
359
+ fontSize: em(14, 16),
360
+ lineHeight: round(20 / 14),
361
+ marginTop: em(12, 14)
362
+ },
363
+ "a:not([data-card])": {
364
+ color: "var(--tw-prose-links)",
365
+ transition: "opacity .2s",
366
+ fontWeight: "500",
367
+ textDecoration: "underline",
368
+ textUnderlineOffset: "3.5px",
369
+ textDecorationColor: "var(--color-fd-primary)",
370
+ textDecorationThickness: "1.5px"
371
+ },
372
+ "a:not([data-card]):hover": { opacity: "80%" }
373
+ },
374
+ colors,
375
+ {
376
+ "> :first-child": { marginTop: "0" },
377
+ "> :last-child": { marginBottom: "0" }
378
+ }
379
+ ] };
380
+ const SMALL = { css: [{
381
+ "--tw-prose-size": "0.875",
382
+ "dt, strong, blockquote, h1, h2, h3, h4, kbd, thead th, a:not([data-card])": { fontWeight: "450" }
383
+ }] };
384
+ //#endregion
385
+ //#region ../../node_modules/.pnpm/@fastify+deepmerge@3.2.1/node_modules/@fastify/deepmerge/index.js
386
+ var require_deepmerge = /* @__PURE__ */ __commonJSMin(((exports, module) => {
387
+ const JSON_PROTO = Object.getPrototypeOf({});
388
+ function defaultIsMergeableObjectFactory() {
389
+ return function defaultIsMergeableObject(value) {
390
+ return typeof value === "object" && value !== null && !(value instanceof RegExp) && !(value instanceof Date);
391
+ };
392
+ }
393
+ function deepmergeConstructor(options) {
394
+ function isNotPrototypeKey(value) {
395
+ return value !== "constructor" && value !== "prototype" && value !== "__proto__";
396
+ }
397
+ function cloneArray(value) {
398
+ let i = 0;
399
+ const il = value.length;
400
+ const result = new Array(il);
401
+ for (; i < il; ++i) result[i] = clone(value[i]);
402
+ return result;
403
+ }
404
+ function cloneObject(target) {
405
+ const result = {};
406
+ if (cloneProtoObject && Object.getPrototypeOf(target) !== JSON_PROTO) return cloneProtoObject(target);
407
+ const targetKeys = getKeys(target);
408
+ let i, il, key;
409
+ for (i = 0, il = targetKeys.length; i < il; ++i) isNotPrototypeKey(key = targetKeys[i]) && (result[key] = clone(target[key]));
410
+ return result;
411
+ }
412
+ function concatArrays(target, source) {
413
+ const tl = target.length;
414
+ const sl = source.length;
415
+ let i = 0;
416
+ const result = new Array(tl + sl);
417
+ for (; i < tl; ++i) result[i] = clone(target[i]);
418
+ for (i = 0; i < sl; ++i) result[i + tl] = clone(source[i]);
419
+ return result;
420
+ }
421
+ const propertyIsEnumerable = Object.prototype.propertyIsEnumerable;
422
+ function getSymbolsAndKeys(value) {
423
+ const result = Object.keys(value);
424
+ const keys = Object.getOwnPropertySymbols(value);
425
+ for (let i = 0, il = keys.length; i < il; ++i) propertyIsEnumerable.call(value, keys[i]) && result.push(keys[i]);
426
+ return result;
427
+ }
428
+ const getKeys = options?.symbols ? getSymbolsAndKeys : Object.keys;
429
+ const cloneProtoObject = typeof options?.cloneProtoObject === "function" ? options.cloneProtoObject : void 0;
430
+ const isMergeableObject = typeof options?.isMergeableObject === "function" ? options.isMergeableObject : defaultIsMergeableObjectFactory();
431
+ const onlyDefinedProperties = options?.onlyDefinedProperties === true;
432
+ function isPrimitive(value) {
433
+ return typeof value !== "object" || value === null;
434
+ }
435
+ const mergeArray = options && typeof options.mergeArray === "function" ? options.mergeArray({
436
+ clone,
437
+ deepmerge: _deepmerge,
438
+ getKeys,
439
+ isMergeableObject
440
+ }) : concatArrays;
441
+ function clone(entry) {
442
+ return isMergeableObject(entry) ? Array.isArray(entry) ? cloneArray(entry) : cloneObject(entry) : entry;
443
+ }
444
+ function mergeObject(target, source) {
445
+ const result = {};
446
+ const targetKeys = getKeys(target);
447
+ const sourceKeys = getKeys(source);
448
+ let i, il, key;
449
+ for (i = 0, il = targetKeys.length; i < il; ++i) isNotPrototypeKey(key = targetKeys[i]) && sourceKeys.indexOf(key) === -1 && (result[key] = clone(target[key]));
450
+ for (i = 0, il = sourceKeys.length; i < il; ++i) {
451
+ if (!isNotPrototypeKey(key = sourceKeys[i])) continue;
452
+ if (key in target) {
453
+ if (targetKeys.indexOf(key) !== -1) {
454
+ if (cloneProtoObject && isMergeableObject(source[key]) && Object.getPrototypeOf(source[key]) !== JSON_PROTO) result[key] = cloneProtoObject(source[key]);
455
+ else result[key] = _deepmerge(target[key], source[key]);
456
+ }
457
+ } else {
458
+ if (onlyDefinedProperties && typeof source[key] === "undefined") continue;
459
+ result[key] = clone(source[key]);
460
+ }
461
+ }
462
+ return result;
463
+ }
464
+ function _deepmerge(target, source) {
465
+ if (onlyDefinedProperties && typeof source === "undefined") return clone(target);
466
+ const sourceIsArray = Array.isArray(source);
467
+ const targetIsArray = Array.isArray(target);
468
+ if (isPrimitive(source)) return source;
469
+ else if (!isMergeableObject(target)) return clone(source);
470
+ else if (sourceIsArray && targetIsArray) return mergeArray(target, source);
471
+ else if (sourceIsArray !== targetIsArray) return clone(source);
472
+ else return mergeObject(target, source);
473
+ }
474
+ function _deepmergeAll() {
475
+ switch (arguments.length) {
476
+ case 0: return {};
477
+ case 1: return clone(arguments[0]);
478
+ case 2: return _deepmerge(arguments[0], arguments[1]);
479
+ }
480
+ let result;
481
+ for (let i = 0, il = arguments.length; i < il; ++i) result = _deepmerge(result, arguments[i]);
482
+ return result;
483
+ }
484
+ return options?.all ? _deepmergeAll : _deepmerge;
485
+ }
486
+ module.exports = deepmergeConstructor;
487
+ module.exports.default = deepmergeConstructor;
488
+ module.exports.deepmerge = deepmergeConstructor;
489
+ Object.defineProperty(module.exports, "isMergeableObject", { get: defaultIsMergeableObjectFactory });
490
+ }));
491
+ //#endregion
492
+ //#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.5/node_modules/postcss-selector-parser/dist/util/unesc.js
493
+ var require_unesc = /* @__PURE__ */ __commonJSMin(((exports) => {
494
+ Object.defineProperty(exports, "__esModule", { value: true });
495
+ exports.default = unesc;
496
+ /**
497
+ *
498
+ * @param {string} str
499
+ * @returns {[string, number]|undefined}
500
+ */
501
+ function gobbleHex(str) {
502
+ var lower = str.toLowerCase();
503
+ var hex = "";
504
+ var spaceTerminated = false;
505
+ for (var i = 0; i < 6 && lower[i] !== void 0; i++) {
506
+ var code = lower.charCodeAt(i);
507
+ var valid = code >= 97 && code <= 102 || code >= 48 && code <= 57;
508
+ spaceTerminated = code === 32;
509
+ if (!valid) break;
510
+ hex += lower[i];
511
+ }
512
+ if (hex.length === 0) return;
513
+ var codePoint = parseInt(hex, 16);
514
+ if (codePoint >= 55296 && codePoint <= 57343 || codePoint === 0 || codePoint > 1114111) return ["�", hex.length + (spaceTerminated ? 1 : 0)];
515
+ return [String.fromCodePoint(codePoint), hex.length + (spaceTerminated ? 1 : 0)];
516
+ }
517
+ var CONTAINS_ESCAPE = /\\/;
518
+ function unesc(str) {
519
+ if (!CONTAINS_ESCAPE.test(str)) return str;
520
+ var ret = "";
521
+ for (var i = 0; i < str.length; i++) {
522
+ if (str[i] === "\\") {
523
+ var gobbled = gobbleHex(str.slice(i + 1, i + 7));
524
+ if (gobbled !== void 0) {
525
+ ret += gobbled[0];
526
+ i += gobbled[1];
527
+ continue;
528
+ }
529
+ if (str[i + 1] === "\\") {
530
+ ret += "\\";
531
+ i++;
532
+ continue;
533
+ }
534
+ if (str.length === i + 1) ret += str[i];
535
+ continue;
536
+ }
537
+ ret += str[i];
538
+ }
539
+ return ret;
540
+ }
541
+ }));
542
+ //#endregion
543
+ //#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.5/node_modules/postcss-selector-parser/dist/util/getProp.js
544
+ var require_getProp = /* @__PURE__ */ __commonJSMin(((exports) => {
545
+ Object.defineProperty(exports, "__esModule", { value: true });
546
+ exports.default = getProp;
547
+ function getProp(obj) {
548
+ var props = [];
549
+ for (var _i = 1; _i < arguments.length; _i++) props[_i - 1] = arguments[_i];
550
+ while (props.length > 0) {
551
+ var prop = props.shift();
552
+ if (!obj[prop]) return;
553
+ obj = obj[prop];
554
+ }
555
+ return obj;
556
+ }
557
+ }));
558
+ //#endregion
559
+ //#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.5/node_modules/postcss-selector-parser/dist/util/ensureObject.js
560
+ var require_ensureObject = /* @__PURE__ */ __commonJSMin(((exports) => {
561
+ Object.defineProperty(exports, "__esModule", { value: true });
562
+ exports.default = ensureObject;
563
+ function ensureObject(obj) {
564
+ var props = [];
565
+ for (var _i = 1; _i < arguments.length; _i++) props[_i - 1] = arguments[_i];
566
+ while (props.length > 0) {
567
+ var prop = props.shift();
568
+ if (!obj[prop]) obj[prop] = {};
569
+ obj = obj[prop];
570
+ }
571
+ }
572
+ }));
573
+ //#endregion
574
+ //#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.5/node_modules/postcss-selector-parser/dist/util/stripComments.js
575
+ var require_stripComments = /* @__PURE__ */ __commonJSMin(((exports) => {
576
+ Object.defineProperty(exports, "__esModule", { value: true });
577
+ exports.default = stripComments;
578
+ function stripComments(str) {
579
+ var s = "";
580
+ var commentStart = str.indexOf("/*");
581
+ var lastEnd = 0;
582
+ while (commentStart >= 0) {
583
+ s = s + str.slice(lastEnd, commentStart);
584
+ var commentEnd = str.indexOf("*/", commentStart + 2);
585
+ if (commentEnd < 0) return s;
586
+ lastEnd = commentEnd + 2;
587
+ commentStart = str.indexOf("/*", lastEnd);
588
+ }
589
+ s = s + str.slice(lastEnd);
590
+ return s;
591
+ }
592
+ }));
593
+ //#endregion
594
+ //#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.5/node_modules/postcss-selector-parser/dist/util/maxNestingDepth.js
595
+ var require_maxNestingDepth = /* @__PURE__ */ __commonJSMin(((exports) => {
596
+ Object.defineProperty(exports, "__esModule", { value: true });
597
+ exports.MAX_NESTING_DEPTH = void 0;
598
+ exports.default = resolveMaxNestingDepth;
599
+ /**
600
+ * The default maximum selector nesting depth allowed when parsing or
601
+ * serializing a selector. Going beyond this would otherwise recurse deeply
602
+ * enough to overflow the call stack (CVE-2026-9358 / CWE-674). Real-world
603
+ * selectors never get anywhere near this, so it acts purely as a safety net
604
+ * that turns an uncatchable stack overflow into a catchable error.
605
+ */
606
+ exports.MAX_NESTING_DEPTH = 256;
607
+ /**
608
+ * Coerce a user-supplied nesting-depth limit into a safe value. Anything that
609
+ * is not a non-negative safe integer (NaN, Infinity, negative numbers, or a
610
+ * non-number) would disable or break the guard, so it falls back to the
611
+ * default.
612
+ *
613
+ * @param {unknown} value the limit provided through the `maxNestingDepth` option
614
+ * @returns {number} a safe, non-negative integer limit
615
+ */
616
+ function resolveMaxNestingDepth(value) {
617
+ return Number.isSafeInteger(value) && value >= 0 ? value : exports.MAX_NESTING_DEPTH;
618
+ }
619
+ }));
620
+ //#endregion
621
+ //#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.5/node_modules/postcss-selector-parser/dist/util/index.js
622
+ var require_util = /* @__PURE__ */ __commonJSMin(((exports) => {
623
+ var __importDefault = exports && exports.__importDefault || function(mod) {
624
+ return mod && mod.__esModule ? mod : { "default": mod };
625
+ };
626
+ Object.defineProperty(exports, "__esModule", { value: true });
627
+ exports.MAX_NESTING_DEPTH = exports.resolveMaxNestingDepth = exports.stripComments = exports.ensureObject = exports.getProp = exports.unesc = void 0;
628
+ var unesc_1 = require_unesc();
629
+ Object.defineProperty(exports, "unesc", {
630
+ enumerable: true,
631
+ get: function() {
632
+ return __importDefault(unesc_1).default;
633
+ }
634
+ });
635
+ var getProp_1 = require_getProp();
636
+ Object.defineProperty(exports, "getProp", {
637
+ enumerable: true,
638
+ get: function() {
639
+ return __importDefault(getProp_1).default;
640
+ }
641
+ });
642
+ var ensureObject_1 = require_ensureObject();
643
+ Object.defineProperty(exports, "ensureObject", {
644
+ enumerable: true,
645
+ get: function() {
646
+ return __importDefault(ensureObject_1).default;
647
+ }
648
+ });
649
+ var stripComments_1 = require_stripComments();
650
+ Object.defineProperty(exports, "stripComments", {
651
+ enumerable: true,
652
+ get: function() {
653
+ return __importDefault(stripComments_1).default;
654
+ }
655
+ });
656
+ var maxNestingDepth_1 = require_maxNestingDepth();
657
+ Object.defineProperty(exports, "resolveMaxNestingDepth", {
658
+ enumerable: true,
659
+ get: function() {
660
+ return __importDefault(maxNestingDepth_1).default;
661
+ }
662
+ });
663
+ Object.defineProperty(exports, "MAX_NESTING_DEPTH", {
664
+ enumerable: true,
665
+ get: function() {
666
+ return maxNestingDepth_1.MAX_NESTING_DEPTH;
667
+ }
668
+ });
669
+ }));
670
+ //#endregion
671
+ //#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.5/node_modules/postcss-selector-parser/dist/selectors/node.js
672
+ var require_node$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
673
+ Object.defineProperty(exports, "__esModule", { value: true });
674
+ var util_1 = require_util();
675
+ var cloneNode = function(obj, parent, depth) {
676
+ if (depth === void 0) depth = 0;
677
+ if (depth > util_1.MAX_NESTING_DEPTH) throw new Error("Cannot clone selector: nesting depth exceeds the maximum of ".concat(util_1.MAX_NESTING_DEPTH, "."));
678
+ if (typeof obj !== "object" || obj === null) return obj;
679
+ var cloned = new obj.constructor();
680
+ for (var i in obj) {
681
+ if (!obj.hasOwnProperty(i)) continue;
682
+ var value = obj[i];
683
+ if (i === "parent" && typeof value === "object") {
684
+ if (parent) cloned[i] = parent;
685
+ } else if (value instanceof Array) cloned[i] = value.map(function(j) {
686
+ return cloneNode(j, cloned, depth + 1);
687
+ });
688
+ else cloned[i] = cloneNode(value, cloned, depth + 1);
689
+ }
690
+ return cloned;
691
+ };
692
+ exports.default = function() {
693
+ function Node(opts) {
694
+ if (opts === void 0) opts = {};
695
+ Object.assign(this, opts);
696
+ this.spaces = this.spaces || {};
697
+ this.spaces.before = this.spaces.before || "";
698
+ this.spaces.after = this.spaces.after || "";
699
+ }
700
+ Node.prototype.remove = function() {
701
+ if (this.parent) this.parent.removeChild(this);
702
+ this.parent = void 0;
703
+ return this;
704
+ };
705
+ Node.prototype.replaceWith = function() {
706
+ if (this.parent) {
707
+ for (var index in arguments) this.parent.insertBefore(this, arguments[index]);
708
+ this.remove();
709
+ }
710
+ return this;
711
+ };
712
+ Node.prototype.next = function() {
713
+ return this.parent.at(this.parent.index(this) + 1);
714
+ };
715
+ Node.prototype.prev = function() {
716
+ return this.parent.at(this.parent.index(this) - 1);
717
+ };
718
+ Node.prototype.clone = function(overrides) {
719
+ if (overrides === void 0) overrides = {};
720
+ var cloned = cloneNode(this);
721
+ for (var name in overrides) cloned[name] = overrides[name];
722
+ return cloned;
723
+ };
724
+ /**
725
+ * Some non-standard syntax doesn't follow normal escaping rules for css.
726
+ * This allows non standard syntax to be appended to an existing property
727
+ * by specifying the escaped value. By specifying the escaped value,
728
+ * illegal characters are allowed to be directly inserted into css output.
729
+ * @param {string} name the property to set
730
+ * @param {any} value the unescaped value of the property
731
+ * @param {string} valueEscaped optional. the escaped value of the property.
732
+ */
733
+ Node.prototype.appendToPropertyAndEscape = function(name, value, valueEscaped) {
734
+ if (!this.raws) this.raws = {};
735
+ var originalValue = this[name];
736
+ var originalEscaped = this.raws[name];
737
+ this[name] = originalValue + value;
738
+ if (originalEscaped || valueEscaped !== value) this.raws[name] = (originalEscaped || originalValue) + valueEscaped;
739
+ else delete this.raws[name];
740
+ };
741
+ /**
742
+ * Some non-standard syntax doesn't follow normal escaping rules for css.
743
+ * This allows the escaped value to be specified directly, allowing illegal
744
+ * characters to be directly inserted into css output.
745
+ * @param {string} name the property to set
746
+ * @param {any} value the unescaped value of the property
747
+ * @param {string} valueEscaped the escaped value of the property.
748
+ */
749
+ Node.prototype.setPropertyAndEscape = function(name, value, valueEscaped) {
750
+ if (!this.raws) this.raws = {};
751
+ this[name] = value;
752
+ this.raws[name] = valueEscaped;
753
+ };
754
+ /**
755
+ * When you want a value to passed through to CSS directly. This method
756
+ * deletes the corresponding raw value causing the stringifier to fallback
757
+ * to the unescaped value.
758
+ * @param {string} name the property to set.
759
+ * @param {any} value The value that is both escaped and unescaped.
760
+ */
761
+ Node.prototype.setPropertyWithoutEscape = function(name, value) {
762
+ this[name] = value;
763
+ if (this.raws) delete this.raws[name];
764
+ };
765
+ /**
766
+ *
767
+ * @param {number} line The number (starting with 1)
768
+ * @param {number} column The column number (starting with 1)
769
+ */
770
+ Node.prototype.isAtPosition = function(line, column) {
771
+ if (this.source && this.source.start && this.source.end) {
772
+ if (this.source.start.line > line) return false;
773
+ if (this.source.end.line < line) return false;
774
+ if (this.source.start.line === line && this.source.start.column > column) return false;
775
+ if (this.source.end.line === line && this.source.end.column < column) return false;
776
+ return true;
777
+ }
778
+ };
779
+ Node.prototype.stringifyProperty = function(name) {
780
+ return this.raws && this.raws[name] || this[name];
781
+ };
782
+ Object.defineProperty(Node.prototype, "rawSpaceBefore", {
783
+ get: function() {
784
+ var rawSpace = this.raws && this.raws.spaces && this.raws.spaces.before;
785
+ if (rawSpace === void 0) rawSpace = this.spaces && this.spaces.before;
786
+ return rawSpace || "";
787
+ },
788
+ set: function(raw) {
789
+ (0, util_1.ensureObject)(this, "raws", "spaces");
790
+ this.raws.spaces.before = raw;
791
+ },
792
+ enumerable: false,
793
+ configurable: true
794
+ });
795
+ Object.defineProperty(Node.prototype, "rawSpaceAfter", {
796
+ get: function() {
797
+ var rawSpace = this.raws && this.raws.spaces && this.raws.spaces.after;
798
+ if (rawSpace === void 0) rawSpace = this.spaces.after;
799
+ return rawSpace || "";
800
+ },
801
+ set: function(raw) {
802
+ (0, util_1.ensureObject)(this, "raws", "spaces");
803
+ this.raws.spaces.after = raw;
804
+ },
805
+ enumerable: false,
806
+ configurable: true
807
+ });
808
+ Node.prototype.valueToString = function() {
809
+ return String(this.stringifyProperty("value"));
810
+ };
811
+ Node.prototype.toString = function() {
812
+ return [
813
+ this.rawSpaceBefore,
814
+ this.valueToString(),
815
+ this.rawSpaceAfter
816
+ ].join("");
817
+ };
818
+ Node.prototype._stringify = function() {
819
+ return this.toString();
820
+ };
821
+ return Node;
822
+ }();
823
+ }));
824
+ //#endregion
825
+ //#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.5/node_modules/postcss-selector-parser/dist/selectors/types.js
826
+ var require_types = /* @__PURE__ */ __commonJSMin(((exports) => {
827
+ Object.defineProperty(exports, "__esModule", { value: true });
828
+ exports.UNIVERSAL = exports.ATTRIBUTE = exports.CLASS = exports.COMBINATOR = exports.COMMENT = exports.ID = exports.NESTING = exports.PSEUDO = exports.ROOT = exports.SELECTOR = exports.STRING = exports.TAG = void 0;
829
+ exports.TAG = "tag";
830
+ exports.STRING = "string";
831
+ exports.SELECTOR = "selector";
832
+ exports.ROOT = "root";
833
+ exports.PSEUDO = "pseudo";
834
+ exports.NESTING = "nesting";
835
+ exports.ID = "id";
836
+ exports.COMMENT = "comment";
837
+ exports.COMBINATOR = "combinator";
838
+ exports.CLASS = "class";
839
+ exports.ATTRIBUTE = "attribute";
840
+ exports.UNIVERSAL = "universal";
841
+ }));
842
+ //#endregion
843
+ //#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.5/node_modules/postcss-selector-parser/dist/selectors/container.js
844
+ var require_container = /* @__PURE__ */ __commonJSMin(((exports) => {
845
+ var __extends = exports && exports.__extends || (function() {
846
+ var extendStatics = function(d, b) {
847
+ extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
848
+ d.__proto__ = b;
849
+ } || function(d, b) {
850
+ for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
851
+ };
852
+ return extendStatics(d, b);
853
+ };
854
+ return function(d, b) {
855
+ if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
856
+ extendStatics(d, b);
857
+ function __() {
858
+ this.constructor = d;
859
+ }
860
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
861
+ };
862
+ })();
863
+ var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
864
+ if (k2 === void 0) k2 = k;
865
+ var desc = Object.getOwnPropertyDescriptor(m, k);
866
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
867
+ enumerable: true,
868
+ get: function() {
869
+ return m[k];
870
+ }
871
+ };
872
+ Object.defineProperty(o, k2, desc);
873
+ }) : (function(o, m, k, k2) {
874
+ if (k2 === void 0) k2 = k;
875
+ o[k2] = m[k];
876
+ }));
877
+ var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
878
+ Object.defineProperty(o, "default", {
879
+ enumerable: true,
880
+ value: v
881
+ });
882
+ }) : function(o, v) {
883
+ o["default"] = v;
884
+ });
885
+ var __importStar = exports && exports.__importStar || (function() {
886
+ var ownKeys = function(o) {
887
+ ownKeys = Object.getOwnPropertyNames || function(o) {
888
+ var ar = [];
889
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
890
+ return ar;
891
+ };
892
+ return ownKeys(o);
893
+ };
894
+ return function(mod) {
895
+ if (mod && mod.__esModule) return mod;
896
+ var result = {};
897
+ if (mod != null) {
898
+ for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
899
+ }
900
+ __setModuleDefault(result, mod);
901
+ return result;
902
+ };
903
+ })();
904
+ var __values = exports && exports.__values || function(o) {
905
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
906
+ if (m) return m.call(o);
907
+ if (o && typeof o.length === "number") return { next: function() {
908
+ if (o && i >= o.length) o = void 0;
909
+ return {
910
+ value: o && o[i++],
911
+ done: !o
912
+ };
913
+ } };
914
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
915
+ };
916
+ var __read = exports && exports.__read || function(o, n) {
917
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
918
+ if (!m) return o;
919
+ var i = m.call(o), r, ar = [], e;
920
+ try {
921
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
922
+ } catch (error) {
923
+ e = { error };
924
+ } finally {
925
+ try {
926
+ if (r && !r.done && (m = i["return"])) m.call(i);
927
+ } finally {
928
+ if (e) throw e.error;
929
+ }
930
+ }
931
+ return ar;
932
+ };
933
+ var __spreadArray = exports && exports.__spreadArray || function(to, from, pack) {
934
+ if (pack || arguments.length === 2) {
935
+ for (var i = 0, l = from.length, ar; i < l; i++) if (ar || !(i in from)) {
936
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
937
+ ar[i] = from[i];
938
+ }
939
+ }
940
+ return to.concat(ar || Array.prototype.slice.call(from));
941
+ };
942
+ var __importDefault = exports && exports.__importDefault || function(mod) {
943
+ return mod && mod.__esModule ? mod : { "default": mod };
944
+ };
945
+ Object.defineProperty(exports, "__esModule", { value: true });
946
+ var util_1 = require_util();
947
+ var node_1 = __importDefault(require_node$1());
948
+ var types = __importStar(require_types());
949
+ exports.default = function(_super) {
950
+ __extends(Container, _super);
951
+ function Container(opts) {
952
+ var _this = _super.call(this, opts) || this;
953
+ if (!_this.nodes) _this.nodes = [];
954
+ return _this;
955
+ }
956
+ Container.prototype.append = function(selector) {
957
+ selector.parent = this;
958
+ this.nodes.push(selector);
959
+ return this;
960
+ };
961
+ Container.prototype.prepend = function(selector) {
962
+ selector.parent = this;
963
+ this.nodes.unshift(selector);
964
+ for (var id in this.indexes) this.indexes[id]++;
965
+ return this;
966
+ };
967
+ Container.prototype.at = function(index) {
968
+ return this.nodes[index];
969
+ };
970
+ Container.prototype.index = function(child) {
971
+ if (typeof child === "number") return child;
972
+ return this.nodes.indexOf(child);
973
+ };
974
+ Object.defineProperty(Container.prototype, "first", {
975
+ get: function() {
976
+ return this.at(0);
977
+ },
978
+ enumerable: false,
979
+ configurable: true
980
+ });
981
+ Object.defineProperty(Container.prototype, "last", {
982
+ get: function() {
983
+ return this.at(this.length - 1);
984
+ },
985
+ enumerable: false,
986
+ configurable: true
987
+ });
988
+ Object.defineProperty(Container.prototype, "length", {
989
+ get: function() {
990
+ return this.nodes.length;
991
+ },
992
+ enumerable: false,
993
+ configurable: true
994
+ });
995
+ Container.prototype.removeChild = function(child) {
996
+ child = this.index(child);
997
+ this.at(child).parent = void 0;
998
+ this.nodes.splice(child, 1);
999
+ var index;
1000
+ for (var id in this.indexes) {
1001
+ index = this.indexes[id];
1002
+ if (index >= child) this.indexes[id] = index - 1;
1003
+ }
1004
+ return this;
1005
+ };
1006
+ Container.prototype.removeAll = function() {
1007
+ var e_1, _a;
1008
+ try {
1009
+ for (var _b = __values(this.nodes), _c = _b.next(); !_c.done; _c = _b.next()) {
1010
+ var node = _c.value;
1011
+ node.parent = void 0;
1012
+ }
1013
+ } catch (e_1_1) {
1014
+ e_1 = { error: e_1_1 };
1015
+ } finally {
1016
+ try {
1017
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
1018
+ } finally {
1019
+ if (e_1) throw e_1.error;
1020
+ }
1021
+ }
1022
+ this.nodes = [];
1023
+ return this;
1024
+ };
1025
+ Container.prototype.empty = function() {
1026
+ return this.removeAll();
1027
+ };
1028
+ Container.prototype.insertAfter = function(oldNode, newNode) {
1029
+ var _a;
1030
+ newNode.parent = this;
1031
+ var oldIndex = this.index(oldNode);
1032
+ var resetNode = [];
1033
+ for (var i = 2; i < arguments.length; i++) resetNode.push(arguments[i]);
1034
+ (_a = this.nodes).splice.apply(_a, __spreadArray([
1035
+ oldIndex + 1,
1036
+ 0,
1037
+ newNode
1038
+ ], __read(resetNode), false));
1039
+ newNode.parent = this;
1040
+ var index;
1041
+ for (var id in this.indexes) {
1042
+ index = this.indexes[id];
1043
+ if (oldIndex < index) this.indexes[id] = index + arguments.length - 1;
1044
+ }
1045
+ return this;
1046
+ };
1047
+ Container.prototype.insertBefore = function(oldNode, newNode) {
1048
+ var _a;
1049
+ newNode.parent = this;
1050
+ var oldIndex = this.index(oldNode);
1051
+ var resetNode = [];
1052
+ for (var i = 2; i < arguments.length; i++) resetNode.push(arguments[i]);
1053
+ (_a = this.nodes).splice.apply(_a, __spreadArray([
1054
+ oldIndex,
1055
+ 0,
1056
+ newNode
1057
+ ], __read(resetNode), false));
1058
+ newNode.parent = this;
1059
+ var index;
1060
+ for (var id in this.indexes) {
1061
+ index = this.indexes[id];
1062
+ if (index >= oldIndex) this.indexes[id] = index + arguments.length - 1;
1063
+ }
1064
+ return this;
1065
+ };
1066
+ Container.prototype._findChildAtPosition = function(line, col) {
1067
+ var found = void 0;
1068
+ this.each(function(node) {
1069
+ if (node.atPosition) {
1070
+ var foundChild = node.atPosition(line, col);
1071
+ if (foundChild) {
1072
+ found = foundChild;
1073
+ return false;
1074
+ }
1075
+ } else if (node.isAtPosition(line, col)) {
1076
+ found = node;
1077
+ return false;
1078
+ }
1079
+ });
1080
+ return found;
1081
+ };
1082
+ /**
1083
+ * Return the most specific node at the line and column number given.
1084
+ * The source location is based on the original parsed location, locations aren't
1085
+ * updated as selector nodes are mutated.
1086
+ *
1087
+ * Note that this location is relative to the location of the first character
1088
+ * of the selector, and not the location of the selector in the overall document
1089
+ * when used in conjunction with postcss.
1090
+ *
1091
+ * If not found, returns undefined.
1092
+ * @param {number} line The line number of the node to find. (1-based index)
1093
+ * @param {number} col The column number of the node to find. (1-based index)
1094
+ */
1095
+ Container.prototype.atPosition = function(line, col) {
1096
+ if (this.isAtPosition(line, col)) return this._findChildAtPosition(line, col) || this;
1097
+ else return;
1098
+ };
1099
+ Container.prototype._inferEndPosition = function() {
1100
+ if (this.last && this.last.source && this.last.source.end) {
1101
+ this.source = this.source || {};
1102
+ this.source.end = this.source.end || {};
1103
+ Object.assign(this.source.end, this.last.source.end);
1104
+ }
1105
+ };
1106
+ Container.prototype.each = function(callback) {
1107
+ if (!this.lastEach) this.lastEach = 0;
1108
+ if (!this.indexes) this.indexes = {};
1109
+ this.lastEach++;
1110
+ var id = this.lastEach;
1111
+ this.indexes[id] = 0;
1112
+ if (!this.length) return;
1113
+ var index, result;
1114
+ while (this.indexes[id] < this.length) {
1115
+ index = this.indexes[id];
1116
+ result = callback(this.at(index), index);
1117
+ if (result === false) break;
1118
+ this.indexes[id] += 1;
1119
+ }
1120
+ delete this.indexes[id];
1121
+ if (result === false) return false;
1122
+ };
1123
+ Container.prototype.walk = function(callback, depth) {
1124
+ if (depth === void 0) depth = 0;
1125
+ if (depth > util_1.MAX_NESTING_DEPTH) throw new Error("Cannot walk selector: nesting depth exceeds the maximum of ".concat(util_1.MAX_NESTING_DEPTH, "."));
1126
+ return this.each(function(node, i) {
1127
+ var result = callback(node, i);
1128
+ if (result !== false && node.length) result = node.walk(callback, depth + 1);
1129
+ if (result === false) return false;
1130
+ });
1131
+ };
1132
+ Container.prototype.walkAttributes = function(callback) {
1133
+ var _this = this;
1134
+ return this.walk(function(selector) {
1135
+ if (selector.type === types.ATTRIBUTE) return callback.call(_this, selector);
1136
+ });
1137
+ };
1138
+ Container.prototype.walkClasses = function(callback) {
1139
+ var _this = this;
1140
+ return this.walk(function(selector) {
1141
+ if (selector.type === types.CLASS) return callback.call(_this, selector);
1142
+ });
1143
+ };
1144
+ Container.prototype.walkCombinators = function(callback) {
1145
+ var _this = this;
1146
+ return this.walk(function(selector) {
1147
+ if (selector.type === types.COMBINATOR) return callback.call(_this, selector);
1148
+ });
1149
+ };
1150
+ Container.prototype.walkComments = function(callback) {
1151
+ var _this = this;
1152
+ return this.walk(function(selector) {
1153
+ if (selector.type === types.COMMENT) return callback.call(_this, selector);
1154
+ });
1155
+ };
1156
+ Container.prototype.walkIds = function(callback) {
1157
+ var _this = this;
1158
+ return this.walk(function(selector) {
1159
+ if (selector.type === types.ID) return callback.call(_this, selector);
1160
+ });
1161
+ };
1162
+ Container.prototype.walkNesting = function(callback) {
1163
+ var _this = this;
1164
+ return this.walk(function(selector) {
1165
+ if (selector.type === types.NESTING) return callback.call(_this, selector);
1166
+ });
1167
+ };
1168
+ Container.prototype.walkPseudos = function(callback) {
1169
+ var _this = this;
1170
+ return this.walk(function(selector) {
1171
+ if (selector.type === types.PSEUDO) return callback.call(_this, selector);
1172
+ });
1173
+ };
1174
+ Container.prototype.walkTags = function(callback) {
1175
+ var _this = this;
1176
+ return this.walk(function(selector) {
1177
+ if (selector.type === types.TAG) return callback.call(_this, selector);
1178
+ });
1179
+ };
1180
+ Container.prototype.walkUniversals = function(callback) {
1181
+ var _this = this;
1182
+ return this.walk(function(selector) {
1183
+ if (selector.type === types.UNIVERSAL) return callback.call(_this, selector);
1184
+ });
1185
+ };
1186
+ Container.prototype.split = function(callback) {
1187
+ var _this = this;
1188
+ var current = [];
1189
+ return this.reduce(function(memo, node, index) {
1190
+ var split = callback.call(_this, node);
1191
+ current.push(node);
1192
+ if (split) {
1193
+ memo.push(current);
1194
+ current = [];
1195
+ } else if (index === _this.length - 1) memo.push(current);
1196
+ return memo;
1197
+ }, []);
1198
+ };
1199
+ Container.prototype.map = function(callback) {
1200
+ return this.nodes.map(callback);
1201
+ };
1202
+ Container.prototype.reduce = function(callback, memo) {
1203
+ return this.nodes.reduce(callback, memo);
1204
+ };
1205
+ Container.prototype.every = function(callback) {
1206
+ return this.nodes.every(callback);
1207
+ };
1208
+ Container.prototype.some = function(callback) {
1209
+ return this.nodes.some(callback);
1210
+ };
1211
+ Container.prototype.filter = function(callback) {
1212
+ return this.nodes.filter(callback);
1213
+ };
1214
+ Container.prototype.sort = function(callback) {
1215
+ return this.nodes.sort(callback);
1216
+ };
1217
+ Container.prototype.toString = function(options) {
1218
+ if (options === void 0) options = {};
1219
+ return this._stringify(options, 0, (0, util_1.resolveMaxNestingDepth)(options.maxNestingDepth));
1220
+ };
1221
+ Container.prototype._stringify = function(options, depth, max) {
1222
+ var _this = this;
1223
+ return this.map(function(child) {
1224
+ return _this._stringifyChild(child, options, depth, max);
1225
+ }).join("");
1226
+ };
1227
+ Container.prototype._stringifyChild = function(child, options, depth, max) {
1228
+ return typeof child._stringify === "function" ? child._stringify(options, depth, max) : String(child);
1229
+ };
1230
+ return Container;
1231
+ }(node_1.default);
1232
+ }));
1233
+ //#endregion
1234
+ //#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.5/node_modules/postcss-selector-parser/dist/selectors/root.js
1235
+ var require_root = /* @__PURE__ */ __commonJSMin(((exports) => {
1236
+ var __extends = exports && exports.__extends || (function() {
1237
+ var extendStatics = function(d, b) {
1238
+ extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
1239
+ d.__proto__ = b;
1240
+ } || function(d, b) {
1241
+ for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
1242
+ };
1243
+ return extendStatics(d, b);
1244
+ };
1245
+ return function(d, b) {
1246
+ if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
1247
+ extendStatics(d, b);
1248
+ function __() {
1249
+ this.constructor = d;
1250
+ }
1251
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
1252
+ };
1253
+ })();
1254
+ var __importDefault = exports && exports.__importDefault || function(mod) {
1255
+ return mod && mod.__esModule ? mod : { "default": mod };
1256
+ };
1257
+ Object.defineProperty(exports, "__esModule", { value: true });
1258
+ var container_1 = __importDefault(require_container());
1259
+ var types_1 = require_types();
1260
+ exports.default = function(_super) {
1261
+ __extends(Root, _super);
1262
+ function Root(opts) {
1263
+ var _this = _super.call(this, opts) || this;
1264
+ _this.type = types_1.ROOT;
1265
+ return _this;
1266
+ }
1267
+ Root.prototype._stringify = function(options, depth, max) {
1268
+ var _this = this;
1269
+ var str = this.reduce(function(memo, selector) {
1270
+ memo.push(_this._stringifyChild(selector, options, depth, max));
1271
+ return memo;
1272
+ }, []).join(",");
1273
+ return this.trailingComma ? str + "," : str;
1274
+ };
1275
+ Root.prototype.error = function(message, options) {
1276
+ if (this._error) return this._error(message, options);
1277
+ else return new Error(message);
1278
+ };
1279
+ Object.defineProperty(Root.prototype, "errorGenerator", {
1280
+ set: function(handler) {
1281
+ this._error = handler;
1282
+ },
1283
+ enumerable: false,
1284
+ configurable: true
1285
+ });
1286
+ return Root;
1287
+ }(container_1.default);
1288
+ }));
1289
+ //#endregion
1290
+ //#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.5/node_modules/postcss-selector-parser/dist/selectors/selector.js
1291
+ var require_selector = /* @__PURE__ */ __commonJSMin(((exports) => {
1292
+ var __extends = exports && exports.__extends || (function() {
1293
+ var extendStatics = function(d, b) {
1294
+ extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
1295
+ d.__proto__ = b;
1296
+ } || function(d, b) {
1297
+ for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
1298
+ };
1299
+ return extendStatics(d, b);
1300
+ };
1301
+ return function(d, b) {
1302
+ if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
1303
+ extendStatics(d, b);
1304
+ function __() {
1305
+ this.constructor = d;
1306
+ }
1307
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
1308
+ };
1309
+ })();
1310
+ var __importDefault = exports && exports.__importDefault || function(mod) {
1311
+ return mod && mod.__esModule ? mod : { "default": mod };
1312
+ };
1313
+ Object.defineProperty(exports, "__esModule", { value: true });
1314
+ var container_1 = __importDefault(require_container());
1315
+ var types_1 = require_types();
1316
+ exports.default = function(_super) {
1317
+ __extends(Selector, _super);
1318
+ function Selector(opts) {
1319
+ var _this = _super.call(this, opts) || this;
1320
+ _this.type = types_1.SELECTOR;
1321
+ return _this;
1322
+ }
1323
+ return Selector;
1324
+ }(container_1.default);
1325
+ }));
1326
+ //#endregion
1327
+ //#region ../../node_modules/.pnpm/cssesc@3.0.0/node_modules/cssesc/cssesc.js
1328
+ /*! https://mths.be/cssesc v3.0.0 by @mathias */
1329
+ var require_cssesc = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1330
+ var hasOwnProperty = {}.hasOwnProperty;
1331
+ var merge = function merge(options, defaults) {
1332
+ if (!options) return defaults;
1333
+ var result = {};
1334
+ for (var key in defaults) result[key] = hasOwnProperty.call(options, key) ? options[key] : defaults[key];
1335
+ return result;
1336
+ };
1337
+ var regexAnySingleEscape = /[ -,\.\/:-@\[-\^`\{-~]/;
1338
+ var regexSingleEscape = /[ -,\.\/:-@\[\]\^`\{-~]/;
1339
+ var regexExcessiveSpaces = /(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g;
1340
+ var cssesc = function cssesc(string, options) {
1341
+ options = merge(options, cssesc.options);
1342
+ if (options.quotes != "single" && options.quotes != "double") options.quotes = "single";
1343
+ var quote = options.quotes == "double" ? "\"" : "'";
1344
+ var isIdentifier = options.isIdentifier;
1345
+ var firstChar = string.charAt(0);
1346
+ var output = "";
1347
+ var counter = 0;
1348
+ var length = string.length;
1349
+ while (counter < length) {
1350
+ var character = string.charAt(counter++);
1351
+ var codePoint = character.charCodeAt();
1352
+ var value = void 0;
1353
+ if (codePoint < 32 || codePoint > 126) {
1354
+ if (codePoint >= 55296 && codePoint <= 56319 && counter < length) {
1355
+ var extra = string.charCodeAt(counter++);
1356
+ if ((extra & 64512) == 56320) codePoint = ((codePoint & 1023) << 10) + (extra & 1023) + 65536;
1357
+ else counter--;
1358
+ }
1359
+ value = "\\" + codePoint.toString(16).toUpperCase() + " ";
1360
+ } else if (options.escapeEverything) {
1361
+ if (regexAnySingleEscape.test(character)) value = "\\" + character;
1362
+ else value = "\\" + codePoint.toString(16).toUpperCase() + " ";
1363
+ } else if (/[\t\n\f\r\x0B]/.test(character)) value = "\\" + codePoint.toString(16).toUpperCase() + " ";
1364
+ else if (character == "\\" || !isIdentifier && (character == "\"" && quote == character || character == "'" && quote == character) || isIdentifier && regexSingleEscape.test(character)) value = "\\" + character;
1365
+ else value = character;
1366
+ output += value;
1367
+ }
1368
+ if (isIdentifier) {
1369
+ if (/^-[-\d]/.test(output)) output = "\\-" + output.slice(1);
1370
+ else if (/\d/.test(firstChar)) output = "\\3" + firstChar + " " + output.slice(1);
1371
+ }
1372
+ output = output.replace(regexExcessiveSpaces, function($0, $1, $2) {
1373
+ if ($1 && $1.length % 2) return $0;
1374
+ return ($1 || "") + $2;
1375
+ });
1376
+ if (!isIdentifier && options.wrap) return quote + output + quote;
1377
+ return output;
1378
+ };
1379
+ cssesc.options = {
1380
+ "escapeEverything": false,
1381
+ "isIdentifier": false,
1382
+ "quotes": "single",
1383
+ "wrap": false
1384
+ };
1385
+ cssesc.version = "3.0.0";
1386
+ module.exports = cssesc;
1387
+ }));
1388
+ //#endregion
1389
+ //#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.5/node_modules/postcss-selector-parser/dist/selectors/className.js
1390
+ var require_className = /* @__PURE__ */ __commonJSMin(((exports) => {
1391
+ var __extends = exports && exports.__extends || (function() {
1392
+ var extendStatics = function(d, b) {
1393
+ extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
1394
+ d.__proto__ = b;
1395
+ } || function(d, b) {
1396
+ for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
1397
+ };
1398
+ return extendStatics(d, b);
1399
+ };
1400
+ return function(d, b) {
1401
+ if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
1402
+ extendStatics(d, b);
1403
+ function __() {
1404
+ this.constructor = d;
1405
+ }
1406
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
1407
+ };
1408
+ })();
1409
+ var __importDefault = exports && exports.__importDefault || function(mod) {
1410
+ return mod && mod.__esModule ? mod : { "default": mod };
1411
+ };
1412
+ Object.defineProperty(exports, "__esModule", { value: true });
1413
+ var cssesc_1 = __importDefault(require_cssesc());
1414
+ var util_1 = require_util();
1415
+ var node_1 = __importDefault(require_node$1());
1416
+ var types_1 = require_types();
1417
+ exports.default = function(_super) {
1418
+ __extends(ClassName, _super);
1419
+ function ClassName(opts) {
1420
+ var _this = _super.call(this, opts) || this;
1421
+ _this.type = types_1.CLASS;
1422
+ _this._constructed = true;
1423
+ return _this;
1424
+ }
1425
+ Object.defineProperty(ClassName.prototype, "value", {
1426
+ get: function() {
1427
+ return this._value;
1428
+ },
1429
+ set: function(v) {
1430
+ if (this._constructed) {
1431
+ var escaped = (0, cssesc_1.default)(v, { isIdentifier: true });
1432
+ if (escaped !== v) {
1433
+ (0, util_1.ensureObject)(this, "raws");
1434
+ this.raws.value = escaped;
1435
+ } else if (this.raws) delete this.raws.value;
1436
+ }
1437
+ this._value = v;
1438
+ },
1439
+ enumerable: false,
1440
+ configurable: true
1441
+ });
1442
+ ClassName.prototype.valueToString = function() {
1443
+ return "." + _super.prototype.valueToString.call(this);
1444
+ };
1445
+ return ClassName;
1446
+ }(node_1.default);
1447
+ }));
1448
+ //#endregion
1449
+ //#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.5/node_modules/postcss-selector-parser/dist/selectors/comment.js
1450
+ var require_comment = /* @__PURE__ */ __commonJSMin(((exports) => {
1451
+ var __extends = exports && exports.__extends || (function() {
1452
+ var extendStatics = function(d, b) {
1453
+ extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
1454
+ d.__proto__ = b;
1455
+ } || function(d, b) {
1456
+ for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
1457
+ };
1458
+ return extendStatics(d, b);
1459
+ };
1460
+ return function(d, b) {
1461
+ if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
1462
+ extendStatics(d, b);
1463
+ function __() {
1464
+ this.constructor = d;
1465
+ }
1466
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
1467
+ };
1468
+ })();
1469
+ var __importDefault = exports && exports.__importDefault || function(mod) {
1470
+ return mod && mod.__esModule ? mod : { "default": mod };
1471
+ };
1472
+ Object.defineProperty(exports, "__esModule", { value: true });
1473
+ var node_1 = __importDefault(require_node$1());
1474
+ var types_1 = require_types();
1475
+ exports.default = function(_super) {
1476
+ __extends(Comment, _super);
1477
+ function Comment(opts) {
1478
+ var _this = _super.call(this, opts) || this;
1479
+ _this.type = types_1.COMMENT;
1480
+ return _this;
1481
+ }
1482
+ return Comment;
1483
+ }(node_1.default);
1484
+ }));
1485
+ //#endregion
1486
+ //#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.5/node_modules/postcss-selector-parser/dist/selectors/id.js
1487
+ var require_id = /* @__PURE__ */ __commonJSMin(((exports) => {
1488
+ var __extends = exports && exports.__extends || (function() {
1489
+ var extendStatics = function(d, b) {
1490
+ extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
1491
+ d.__proto__ = b;
1492
+ } || function(d, b) {
1493
+ for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
1494
+ };
1495
+ return extendStatics(d, b);
1496
+ };
1497
+ return function(d, b) {
1498
+ if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
1499
+ extendStatics(d, b);
1500
+ function __() {
1501
+ this.constructor = d;
1502
+ }
1503
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
1504
+ };
1505
+ })();
1506
+ var __importDefault = exports && exports.__importDefault || function(mod) {
1507
+ return mod && mod.__esModule ? mod : { "default": mod };
1508
+ };
1509
+ Object.defineProperty(exports, "__esModule", { value: true });
1510
+ var node_1 = __importDefault(require_node$1());
1511
+ var types_1 = require_types();
1512
+ exports.default = function(_super) {
1513
+ __extends(ID, _super);
1514
+ function ID(opts) {
1515
+ var _this = _super.call(this, opts) || this;
1516
+ _this.type = types_1.ID;
1517
+ return _this;
1518
+ }
1519
+ ID.prototype.valueToString = function() {
1520
+ return "#" + _super.prototype.valueToString.call(this);
1521
+ };
1522
+ return ID;
1523
+ }(node_1.default);
1524
+ }));
1525
+ //#endregion
1526
+ //#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.5/node_modules/postcss-selector-parser/dist/selectors/namespace.js
1527
+ var require_namespace = /* @__PURE__ */ __commonJSMin(((exports) => {
1528
+ var __extends = exports && exports.__extends || (function() {
1529
+ var extendStatics = function(d, b) {
1530
+ extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
1531
+ d.__proto__ = b;
1532
+ } || function(d, b) {
1533
+ for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
1534
+ };
1535
+ return extendStatics(d, b);
1536
+ };
1537
+ return function(d, b) {
1538
+ if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
1539
+ extendStatics(d, b);
1540
+ function __() {
1541
+ this.constructor = d;
1542
+ }
1543
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
1544
+ };
1545
+ })();
1546
+ var __importDefault = exports && exports.__importDefault || function(mod) {
1547
+ return mod && mod.__esModule ? mod : { "default": mod };
1548
+ };
1549
+ Object.defineProperty(exports, "__esModule", { value: true });
1550
+ var cssesc_1 = __importDefault(require_cssesc());
1551
+ var util_1 = require_util();
1552
+ exports.default = function(_super) {
1553
+ __extends(Namespace, _super);
1554
+ function Namespace() {
1555
+ return _super !== null && _super.apply(this, arguments) || this;
1556
+ }
1557
+ Object.defineProperty(Namespace.prototype, "namespace", {
1558
+ get: function() {
1559
+ return this._namespace;
1560
+ },
1561
+ set: function(namespace) {
1562
+ if (namespace === true || namespace === "*" || namespace === "&") {
1563
+ this._namespace = namespace;
1564
+ if (this.raws) delete this.raws.namespace;
1565
+ return;
1566
+ }
1567
+ var escaped = (0, cssesc_1.default)(namespace, { isIdentifier: true });
1568
+ this._namespace = namespace;
1569
+ if (escaped !== namespace) {
1570
+ (0, util_1.ensureObject)(this, "raws");
1571
+ this.raws.namespace = escaped;
1572
+ } else if (this.raws) delete this.raws.namespace;
1573
+ },
1574
+ enumerable: false,
1575
+ configurable: true
1576
+ });
1577
+ Object.defineProperty(Namespace.prototype, "ns", {
1578
+ get: function() {
1579
+ return this._namespace;
1580
+ },
1581
+ set: function(namespace) {
1582
+ this.namespace = namespace;
1583
+ },
1584
+ enumerable: false,
1585
+ configurable: true
1586
+ });
1587
+ Object.defineProperty(Namespace.prototype, "namespaceString", {
1588
+ get: function() {
1589
+ if (this.namespace) {
1590
+ var ns = this.stringifyProperty("namespace");
1591
+ if (ns === true) return "";
1592
+ else return ns;
1593
+ } else return "";
1594
+ },
1595
+ enumerable: false,
1596
+ configurable: true
1597
+ });
1598
+ Namespace.prototype.qualifiedName = function(value) {
1599
+ if (this.namespace) return "".concat(this.namespaceString, "|").concat(value);
1600
+ else return value;
1601
+ };
1602
+ Namespace.prototype.valueToString = function() {
1603
+ return this.qualifiedName(_super.prototype.valueToString.call(this));
1604
+ };
1605
+ return Namespace;
1606
+ }(__importDefault(require_node$1()).default);
1607
+ }));
1608
+ //#endregion
1609
+ //#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.5/node_modules/postcss-selector-parser/dist/selectors/tag.js
1610
+ var require_tag = /* @__PURE__ */ __commonJSMin(((exports) => {
1611
+ var __extends = exports && exports.__extends || (function() {
1612
+ var extendStatics = function(d, b) {
1613
+ extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
1614
+ d.__proto__ = b;
1615
+ } || function(d, b) {
1616
+ for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
1617
+ };
1618
+ return extendStatics(d, b);
1619
+ };
1620
+ return function(d, b) {
1621
+ if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
1622
+ extendStatics(d, b);
1623
+ function __() {
1624
+ this.constructor = d;
1625
+ }
1626
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
1627
+ };
1628
+ })();
1629
+ var __importDefault = exports && exports.__importDefault || function(mod) {
1630
+ return mod && mod.__esModule ? mod : { "default": mod };
1631
+ };
1632
+ Object.defineProperty(exports, "__esModule", { value: true });
1633
+ var namespace_1 = __importDefault(require_namespace());
1634
+ var types_1 = require_types();
1635
+ exports.default = function(_super) {
1636
+ __extends(Tag, _super);
1637
+ function Tag(opts) {
1638
+ var _this = _super.call(this, opts) || this;
1639
+ _this.type = types_1.TAG;
1640
+ return _this;
1641
+ }
1642
+ return Tag;
1643
+ }(namespace_1.default);
1644
+ }));
1645
+ //#endregion
1646
+ //#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.5/node_modules/postcss-selector-parser/dist/selectors/string.js
1647
+ var require_string = /* @__PURE__ */ __commonJSMin(((exports) => {
1648
+ var __extends = exports && exports.__extends || (function() {
1649
+ var extendStatics = function(d, b) {
1650
+ extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
1651
+ d.__proto__ = b;
1652
+ } || function(d, b) {
1653
+ for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
1654
+ };
1655
+ return extendStatics(d, b);
1656
+ };
1657
+ return function(d, b) {
1658
+ if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
1659
+ extendStatics(d, b);
1660
+ function __() {
1661
+ this.constructor = d;
1662
+ }
1663
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
1664
+ };
1665
+ })();
1666
+ var __importDefault = exports && exports.__importDefault || function(mod) {
1667
+ return mod && mod.__esModule ? mod : { "default": mod };
1668
+ };
1669
+ Object.defineProperty(exports, "__esModule", { value: true });
1670
+ var node_1 = __importDefault(require_node$1());
1671
+ var types_1 = require_types();
1672
+ var String = function(_super) {
1673
+ __extends(String, _super);
1674
+ function String(opts) {
1675
+ var _this = _super.call(this, opts) || this;
1676
+ _this.type = types_1.STRING;
1677
+ return _this;
1678
+ }
1679
+ return String;
1680
+ }(node_1.default);
1681
+ exports.default = String;
1682
+ }));
1683
+ //#endregion
1684
+ //#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.5/node_modules/postcss-selector-parser/dist/selectors/pseudo.js
1685
+ var require_pseudo = /* @__PURE__ */ __commonJSMin(((exports) => {
1686
+ var __extends = exports && exports.__extends || (function() {
1687
+ var extendStatics = function(d, b) {
1688
+ extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
1689
+ d.__proto__ = b;
1690
+ } || function(d, b) {
1691
+ for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
1692
+ };
1693
+ return extendStatics(d, b);
1694
+ };
1695
+ return function(d, b) {
1696
+ if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
1697
+ extendStatics(d, b);
1698
+ function __() {
1699
+ this.constructor = d;
1700
+ }
1701
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
1702
+ };
1703
+ })();
1704
+ var __importDefault = exports && exports.__importDefault || function(mod) {
1705
+ return mod && mod.__esModule ? mod : { "default": mod };
1706
+ };
1707
+ Object.defineProperty(exports, "__esModule", { value: true });
1708
+ var container_1 = __importDefault(require_container());
1709
+ var types_1 = require_types();
1710
+ exports.default = function(_super) {
1711
+ __extends(Pseudo, _super);
1712
+ function Pseudo(opts) {
1713
+ var _this = _super.call(this, opts) || this;
1714
+ _this.type = types_1.PSEUDO;
1715
+ return _this;
1716
+ }
1717
+ Pseudo.prototype._stringify = function(options, depth, max) {
1718
+ var _this = this;
1719
+ if (depth >= max) throw new Error("Cannot serialize selector: nesting depth exceeds the maximum of ".concat(max, "."));
1720
+ var params = this.length ? "(" + this.map(function(child) {
1721
+ return _this._stringifyChild(child, options, depth + 1, max);
1722
+ }).join(",") + ")" : "";
1723
+ return [
1724
+ this.rawSpaceBefore,
1725
+ this.stringifyProperty("value"),
1726
+ params,
1727
+ this.rawSpaceAfter
1728
+ ].join("");
1729
+ };
1730
+ return Pseudo;
1731
+ }(container_1.default);
1732
+ }));
1733
+ //#endregion
1734
+ //#region ../../node_modules/.pnpm/util-deprecate@1.0.2/node_modules/util-deprecate/node.js
1735
+ var require_node = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1736
+ /**
1737
+ * For Node.js, simply re-export the core `util.deprecate` function.
1738
+ */
1739
+ module.exports = __require("util").deprecate;
1740
+ }));
1741
+ //#endregion
1742
+ //#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.5/node_modules/postcss-selector-parser/dist/selectors/attribute.js
1743
+ var require_attribute = /* @__PURE__ */ __commonJSMin(((exports) => {
1744
+ var __extends = exports && exports.__extends || (function() {
1745
+ var extendStatics = function(d, b) {
1746
+ extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
1747
+ d.__proto__ = b;
1748
+ } || function(d, b) {
1749
+ for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
1750
+ };
1751
+ return extendStatics(d, b);
1752
+ };
1753
+ return function(d, b) {
1754
+ if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
1755
+ extendStatics(d, b);
1756
+ function __() {
1757
+ this.constructor = d;
1758
+ }
1759
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
1760
+ };
1761
+ })();
1762
+ var __importDefault = exports && exports.__importDefault || function(mod) {
1763
+ return mod && mod.__esModule ? mod : { "default": mod };
1764
+ };
1765
+ var _a;
1766
+ Object.defineProperty(exports, "__esModule", { value: true });
1767
+ exports.unescapeValue = unescapeValue;
1768
+ var cssesc_1 = __importDefault(require_cssesc());
1769
+ var unesc_1 = __importDefault(require_unesc());
1770
+ var namespace_1 = __importDefault(require_namespace());
1771
+ var types_1 = require_types();
1772
+ var deprecate = require_node();
1773
+ var WRAPPED_IN_QUOTES = /^('|")([^]*)\1$/;
1774
+ var warnOfDeprecatedValueAssignment = deprecate(function() {}, "Assigning an attribute a value containing characters that might need to be escaped is deprecated. Call attribute.setValue() instead.");
1775
+ var warnOfDeprecatedQuotedAssignment = deprecate(function() {}, "Assigning attr.quoted is deprecated and has no effect. Assign to attr.quoteMark instead.");
1776
+ var warnOfDeprecatedConstructor = deprecate(function() {}, "Constructing an Attribute selector with a value without specifying quoteMark is deprecated. Note: The value should be unescaped now.");
1777
+ function unescapeValue(value) {
1778
+ var deprecatedUsage = false;
1779
+ var quoteMark = null;
1780
+ var unescaped = value;
1781
+ var m = unescaped.match(WRAPPED_IN_QUOTES);
1782
+ if (m) {
1783
+ quoteMark = m[1];
1784
+ unescaped = m[2];
1785
+ }
1786
+ unescaped = (0, unesc_1.default)(unescaped);
1787
+ if (unescaped !== value) deprecatedUsage = true;
1788
+ return {
1789
+ deprecatedUsage,
1790
+ unescaped,
1791
+ quoteMark
1792
+ };
1793
+ }
1794
+ function handleDeprecatedContructorOpts(opts) {
1795
+ if (opts.quoteMark !== void 0) return opts;
1796
+ if (opts.value === void 0) return opts;
1797
+ warnOfDeprecatedConstructor();
1798
+ var _a = unescapeValue(opts.value), quoteMark = _a.quoteMark, unescaped = _a.unescaped;
1799
+ if (!opts.raws) opts.raws = {};
1800
+ if (opts.raws.value === void 0) opts.raws.value = opts.value;
1801
+ opts.value = unescaped;
1802
+ opts.quoteMark = quoteMark;
1803
+ return opts;
1804
+ }
1805
+ exports.default = function(_super) {
1806
+ __extends(Attribute, _super);
1807
+ function Attribute(opts) {
1808
+ if (opts === void 0) opts = {};
1809
+ var _this = _super.call(this, handleDeprecatedContructorOpts(opts)) || this;
1810
+ _this.type = types_1.ATTRIBUTE;
1811
+ _this.raws = _this.raws || {};
1812
+ Object.defineProperty(_this.raws, "unquoted", {
1813
+ get: deprecate(function() {
1814
+ return _this.value;
1815
+ }, "attr.raws.unquoted is deprecated. Call attr.value instead."),
1816
+ set: deprecate(function() {
1817
+ return _this.value;
1818
+ }, "Setting attr.raws.unquoted is deprecated and has no effect. attr.value is unescaped by default now.")
1819
+ });
1820
+ _this._constructed = true;
1821
+ return _this;
1822
+ }
1823
+ /**
1824
+ * Returns the Attribute's value quoted such that it would be legal to use
1825
+ * in the value of a css file. The original value's quotation setting
1826
+ * used for stringification is left unchanged. See `setValue(value, options)`
1827
+ * if you want to control the quote settings of a new value for the attribute.
1828
+ *
1829
+ * You can also change the quotation used for the current value by setting quoteMark.
1830
+ *
1831
+ * Options:
1832
+ * * quoteMark {'"' | "'" | null} - Use this value to quote the value. If this
1833
+ * option is not set, the original value for quoteMark will be used. If
1834
+ * indeterminate, a double quote is used. The legal values are:
1835
+ * * `null` - the value will be unquoted and characters will be escaped as necessary.
1836
+ * * `'` - the value will be quoted with a single quote and single quotes are escaped.
1837
+ * * `"` - the value will be quoted with a double quote and double quotes are escaped.
1838
+ * * preferCurrentQuoteMark {boolean} - if true, prefer the source quote mark
1839
+ * over the quoteMark option value.
1840
+ * * smart {boolean} - if true, will select a quote mark based on the value
1841
+ * and the other options specified here. See the `smartQuoteMark()`
1842
+ * method.
1843
+ **/
1844
+ Attribute.prototype.getQuotedValue = function(options) {
1845
+ if (options === void 0) options = {};
1846
+ var cssescopts = CSSESC_QUOTE_OPTIONS[this._determineQuoteMark(options)];
1847
+ return (0, cssesc_1.default)(this._value, cssescopts);
1848
+ };
1849
+ Attribute.prototype._determineQuoteMark = function(options) {
1850
+ return options.smart ? this.smartQuoteMark(options) : this.preferredQuoteMark(options);
1851
+ };
1852
+ /**
1853
+ * Set the unescaped value with the specified quotation options. The value
1854
+ * provided must not include any wrapping quote marks -- those quotes will
1855
+ * be interpreted as part of the value and escaped accordingly.
1856
+ */
1857
+ Attribute.prototype.setValue = function(value, options) {
1858
+ if (options === void 0) options = {};
1859
+ this._value = value;
1860
+ this._quoteMark = this._determineQuoteMark(options);
1861
+ this._syncRawValue();
1862
+ };
1863
+ /**
1864
+ * Intelligently select a quoteMark value based on the value's contents. If
1865
+ * the value is a legal CSS ident, it will not be quoted. Otherwise a quote
1866
+ * mark will be picked that minimizes the number of escapes.
1867
+ *
1868
+ * If there's no clear winner, the quote mark from these options is used,
1869
+ * then the source quote mark (this is inverted if `preferCurrentQuoteMark` is
1870
+ * true). If the quoteMark is unspecified, a double quote is used.
1871
+ *
1872
+ * @param options This takes the quoteMark and preferCurrentQuoteMark options
1873
+ * from the quoteValue method.
1874
+ */
1875
+ Attribute.prototype.smartQuoteMark = function(options) {
1876
+ var v = this.value;
1877
+ var numSingleQuotes = v.replace(/[^']/g, "").length;
1878
+ var numDoubleQuotes = v.replace(/[^"]/g, "").length;
1879
+ if (numSingleQuotes + numDoubleQuotes === 0) {
1880
+ var escaped = (0, cssesc_1.default)(v, { isIdentifier: true });
1881
+ if (escaped === v) return Attribute.NO_QUOTE;
1882
+ else {
1883
+ var pref = this.preferredQuoteMark(options);
1884
+ if (pref === Attribute.NO_QUOTE) {
1885
+ var quote = this.quoteMark || options.quoteMark || Attribute.DOUBLE_QUOTE;
1886
+ var opts = CSSESC_QUOTE_OPTIONS[quote];
1887
+ if ((0, cssesc_1.default)(v, opts).length < escaped.length) return quote;
1888
+ }
1889
+ return pref;
1890
+ }
1891
+ } else if (numDoubleQuotes === numSingleQuotes) return this.preferredQuoteMark(options);
1892
+ else if (numDoubleQuotes < numSingleQuotes) return Attribute.DOUBLE_QUOTE;
1893
+ else return Attribute.SINGLE_QUOTE;
1894
+ };
1895
+ /**
1896
+ * Selects the preferred quote mark based on the options and the current quote mark value.
1897
+ * If you want the quote mark to depend on the attribute value, call `smartQuoteMark(opts)`
1898
+ * instead.
1899
+ */
1900
+ Attribute.prototype.preferredQuoteMark = function(options) {
1901
+ var quoteMark = options.preferCurrentQuoteMark ? this.quoteMark : options.quoteMark;
1902
+ if (quoteMark === void 0) quoteMark = options.preferCurrentQuoteMark ? options.quoteMark : this.quoteMark;
1903
+ if (quoteMark === void 0) quoteMark = Attribute.DOUBLE_QUOTE;
1904
+ return quoteMark;
1905
+ };
1906
+ Object.defineProperty(Attribute.prototype, "quoted", {
1907
+ get: function() {
1908
+ var qm = this.quoteMark;
1909
+ return qm === "'" || qm === "\"";
1910
+ },
1911
+ set: function(value) {
1912
+ warnOfDeprecatedQuotedAssignment();
1913
+ },
1914
+ enumerable: false,
1915
+ configurable: true
1916
+ });
1917
+ Object.defineProperty(Attribute.prototype, "quoteMark", {
1918
+ /**
1919
+ * returns a single (`'`) or double (`"`) quote character if the value is quoted.
1920
+ * returns `null` if the value is not quoted.
1921
+ * returns `undefined` if the quotation state is unknown (this can happen when
1922
+ * the attribute is constructed without specifying a quote mark.)
1923
+ */
1924
+ get: function() {
1925
+ return this._quoteMark;
1926
+ },
1927
+ /**
1928
+ * Set the quote mark to be used by this attribute's value.
1929
+ * If the quote mark changes, the raw (escaped) value at `attr.raws.value` of the attribute
1930
+ * value is updated accordingly.
1931
+ *
1932
+ * @param {"'" | '"' | null} quoteMark The quote mark or `null` if the value should be unquoted.
1933
+ */
1934
+ set: function(quoteMark) {
1935
+ if (!this._constructed) {
1936
+ this._quoteMark = quoteMark;
1937
+ return;
1938
+ }
1939
+ if (this._quoteMark !== quoteMark) {
1940
+ this._quoteMark = quoteMark;
1941
+ this._syncRawValue();
1942
+ }
1943
+ },
1944
+ enumerable: false,
1945
+ configurable: true
1946
+ });
1947
+ Attribute.prototype._syncRawValue = function() {
1948
+ var rawValue = (0, cssesc_1.default)(this._value, CSSESC_QUOTE_OPTIONS[this.quoteMark]);
1949
+ if (rawValue === this._value) {
1950
+ if (this.raws) delete this.raws.value;
1951
+ } else this.raws.value = rawValue;
1952
+ };
1953
+ Object.defineProperty(Attribute.prototype, "qualifiedAttribute", {
1954
+ get: function() {
1955
+ return this.qualifiedName(this.raws.attribute || this.attribute);
1956
+ },
1957
+ enumerable: false,
1958
+ configurable: true
1959
+ });
1960
+ Object.defineProperty(Attribute.prototype, "insensitiveFlag", {
1961
+ get: function() {
1962
+ return this.insensitive ? "i" : "";
1963
+ },
1964
+ enumerable: false,
1965
+ configurable: true
1966
+ });
1967
+ Object.defineProperty(Attribute.prototype, "value", {
1968
+ get: function() {
1969
+ return this._value;
1970
+ },
1971
+ /**
1972
+ * Before 3.0, the value had to be set to an escaped value including any wrapped
1973
+ * quote marks. In 3.0, the semantics of `Attribute.value` changed so that the value
1974
+ * is unescaped during parsing and any quote marks are removed.
1975
+ *
1976
+ * Because the ambiguity of this semantic change, if you set `attr.value = newValue`,
1977
+ * a deprecation warning is raised when the new value contains any characters that would
1978
+ * require escaping (including if it contains wrapped quotes).
1979
+ *
1980
+ * Instead, you should call `attr.setValue(newValue, opts)` and pass options that describe
1981
+ * how the new value is quoted.
1982
+ */
1983
+ set: function(v) {
1984
+ if (this._constructed) {
1985
+ var _a = unescapeValue(v), deprecatedUsage = _a.deprecatedUsage, unescaped = _a.unescaped, quoteMark = _a.quoteMark;
1986
+ if (deprecatedUsage) warnOfDeprecatedValueAssignment();
1987
+ if (unescaped === this._value && quoteMark === this._quoteMark) return;
1988
+ this._value = unescaped;
1989
+ this._quoteMark = quoteMark;
1990
+ this._syncRawValue();
1991
+ } else this._value = v;
1992
+ },
1993
+ enumerable: false,
1994
+ configurable: true
1995
+ });
1996
+ Object.defineProperty(Attribute.prototype, "insensitive", {
1997
+ get: function() {
1998
+ return this._insensitive;
1999
+ },
2000
+ /**
2001
+ * Set the case insensitive flag.
2002
+ * If the case insensitive flag changes, the raw (escaped) value at `attr.raws.insensitiveFlag`
2003
+ * of the attribute is updated accordingly.
2004
+ *
2005
+ * @param {true | false} insensitive true if the attribute should match case-insensitively.
2006
+ */
2007
+ set: function(insensitive) {
2008
+ if (!insensitive) {
2009
+ this._insensitive = false;
2010
+ if (this.raws && (this.raws.insensitiveFlag === "I" || this.raws.insensitiveFlag === "i")) this.raws.insensitiveFlag = void 0;
2011
+ }
2012
+ this._insensitive = insensitive;
2013
+ },
2014
+ enumerable: false,
2015
+ configurable: true
2016
+ });
2017
+ Object.defineProperty(Attribute.prototype, "attribute", {
2018
+ get: function() {
2019
+ return this._attribute;
2020
+ },
2021
+ set: function(name) {
2022
+ this._handleEscapes("attribute", name);
2023
+ this._attribute = name;
2024
+ },
2025
+ enumerable: false,
2026
+ configurable: true
2027
+ });
2028
+ Attribute.prototype._handleEscapes = function(prop, value) {
2029
+ if (this._constructed) {
2030
+ var escaped = (0, cssesc_1.default)(value, { isIdentifier: true });
2031
+ if (escaped !== value) this.raws[prop] = escaped;
2032
+ else delete this.raws[prop];
2033
+ }
2034
+ };
2035
+ Attribute.prototype._spacesFor = function(name) {
2036
+ var attrSpaces = {
2037
+ before: "",
2038
+ after: ""
2039
+ };
2040
+ var spaces = this.spaces[name] || {};
2041
+ var rawSpaces = this.raws.spaces && this.raws.spaces[name] || {};
2042
+ return Object.assign(attrSpaces, spaces, rawSpaces);
2043
+ };
2044
+ Attribute.prototype._stringFor = function(name, spaceName, concat) {
2045
+ if (spaceName === void 0) spaceName = name;
2046
+ if (concat === void 0) concat = defaultAttrConcat;
2047
+ var attrSpaces = this._spacesFor(spaceName);
2048
+ return concat(this.stringifyProperty(name), attrSpaces);
2049
+ };
2050
+ /**
2051
+ * returns the offset of the attribute part specified relative to the
2052
+ * start of the node of the output string.
2053
+ *
2054
+ * * "ns" - alias for "namespace"
2055
+ * * "namespace" - the namespace if it exists.
2056
+ * * "attribute" - the attribute name
2057
+ * * "attributeNS" - the start of the attribute or its namespace
2058
+ * * "operator" - the match operator of the attribute
2059
+ * * "value" - The value (string or identifier)
2060
+ * * "insensitive" - the case insensitivity flag;
2061
+ * @param part One of the possible values inside an attribute.
2062
+ * @returns -1 if the name is invalid or the value doesn't exist in this attribute.
2063
+ */
2064
+ Attribute.prototype.offsetOf = function(name) {
2065
+ var count = 1;
2066
+ var attributeSpaces = this._spacesFor("attribute");
2067
+ count += attributeSpaces.before.length;
2068
+ if (name === "namespace" || name === "ns") return this.namespace ? count : -1;
2069
+ if (name === "attributeNS") return count;
2070
+ count += this.namespaceString.length;
2071
+ if (this.namespace) count += 1;
2072
+ if (name === "attribute") return count;
2073
+ count += this.stringifyProperty("attribute").length;
2074
+ count += attributeSpaces.after.length;
2075
+ var operatorSpaces = this._spacesFor("operator");
2076
+ count += operatorSpaces.before.length;
2077
+ var operator = this.stringifyProperty("operator");
2078
+ if (name === "operator") return operator ? count : -1;
2079
+ count += operator.length;
2080
+ count += operatorSpaces.after.length;
2081
+ var valueSpaces = this._spacesFor("value");
2082
+ count += valueSpaces.before.length;
2083
+ var value = this.stringifyProperty("value");
2084
+ if (name === "value") return value ? count : -1;
2085
+ count += value.length;
2086
+ count += valueSpaces.after.length;
2087
+ var insensitiveSpaces = this._spacesFor("insensitive");
2088
+ count += insensitiveSpaces.before.length;
2089
+ if (name === "insensitive") return this.insensitive ? count : -1;
2090
+ return -1;
2091
+ };
2092
+ Attribute.prototype.toString = function() {
2093
+ var _this = this;
2094
+ var selector = [this.rawSpaceBefore, "["];
2095
+ selector.push(this._stringFor("qualifiedAttribute", "attribute"));
2096
+ if (this.operator && (this.value || this.value === "")) {
2097
+ selector.push(this._stringFor("operator"));
2098
+ selector.push(this._stringFor("value"));
2099
+ selector.push(this._stringFor("insensitiveFlag", "insensitive", function(attrValue, attrSpaces) {
2100
+ if (attrValue.length > 0 && !_this.quoted && attrSpaces.before.length === 0 && !(_this.spaces.value && _this.spaces.value.after)) attrSpaces.before = " ";
2101
+ return defaultAttrConcat(attrValue, attrSpaces);
2102
+ }));
2103
+ }
2104
+ selector.push("]");
2105
+ selector.push(this.rawSpaceAfter);
2106
+ return selector.join("");
2107
+ };
2108
+ Attribute.NO_QUOTE = null;
2109
+ Attribute.SINGLE_QUOTE = "'";
2110
+ Attribute.DOUBLE_QUOTE = "\"";
2111
+ return Attribute;
2112
+ }(namespace_1.default);
2113
+ var CSSESC_QUOTE_OPTIONS = (_a = {
2114
+ "'": {
2115
+ quotes: "single",
2116
+ wrap: true
2117
+ },
2118
+ "\"": {
2119
+ quotes: "double",
2120
+ wrap: true
2121
+ }
2122
+ }, _a[null] = { isIdentifier: true }, _a);
2123
+ function defaultAttrConcat(attrValue, attrSpaces) {
2124
+ return "".concat(attrSpaces.before).concat(attrValue).concat(attrSpaces.after);
2125
+ }
2126
+ }));
2127
+ //#endregion
2128
+ //#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.5/node_modules/postcss-selector-parser/dist/selectors/universal.js
2129
+ var require_universal = /* @__PURE__ */ __commonJSMin(((exports) => {
2130
+ var __extends = exports && exports.__extends || (function() {
2131
+ var extendStatics = function(d, b) {
2132
+ extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
2133
+ d.__proto__ = b;
2134
+ } || function(d, b) {
2135
+ for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
2136
+ };
2137
+ return extendStatics(d, b);
2138
+ };
2139
+ return function(d, b) {
2140
+ if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
2141
+ extendStatics(d, b);
2142
+ function __() {
2143
+ this.constructor = d;
2144
+ }
2145
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
2146
+ };
2147
+ })();
2148
+ var __importDefault = exports && exports.__importDefault || function(mod) {
2149
+ return mod && mod.__esModule ? mod : { "default": mod };
2150
+ };
2151
+ Object.defineProperty(exports, "__esModule", { value: true });
2152
+ var namespace_1 = __importDefault(require_namespace());
2153
+ var types_1 = require_types();
2154
+ exports.default = function(_super) {
2155
+ __extends(Universal, _super);
2156
+ function Universal(opts) {
2157
+ var _this = _super.call(this, opts) || this;
2158
+ _this.type = types_1.UNIVERSAL;
2159
+ _this.value = "*";
2160
+ return _this;
2161
+ }
2162
+ return Universal;
2163
+ }(namespace_1.default);
2164
+ }));
2165
+ //#endregion
2166
+ //#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.5/node_modules/postcss-selector-parser/dist/selectors/combinator.js
2167
+ var require_combinator = /* @__PURE__ */ __commonJSMin(((exports) => {
2168
+ var __extends = exports && exports.__extends || (function() {
2169
+ var extendStatics = function(d, b) {
2170
+ extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
2171
+ d.__proto__ = b;
2172
+ } || function(d, b) {
2173
+ for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
2174
+ };
2175
+ return extendStatics(d, b);
2176
+ };
2177
+ return function(d, b) {
2178
+ if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
2179
+ extendStatics(d, b);
2180
+ function __() {
2181
+ this.constructor = d;
2182
+ }
2183
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
2184
+ };
2185
+ })();
2186
+ var __importDefault = exports && exports.__importDefault || function(mod) {
2187
+ return mod && mod.__esModule ? mod : { "default": mod };
2188
+ };
2189
+ Object.defineProperty(exports, "__esModule", { value: true });
2190
+ var node_1 = __importDefault(require_node$1());
2191
+ var types_1 = require_types();
2192
+ exports.default = function(_super) {
2193
+ __extends(Combinator, _super);
2194
+ function Combinator(opts) {
2195
+ var _this = _super.call(this, opts) || this;
2196
+ _this.type = types_1.COMBINATOR;
2197
+ return _this;
2198
+ }
2199
+ return Combinator;
2200
+ }(node_1.default);
2201
+ }));
2202
+ //#endregion
2203
+ //#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.5/node_modules/postcss-selector-parser/dist/selectors/nesting.js
2204
+ var require_nesting = /* @__PURE__ */ __commonJSMin(((exports) => {
2205
+ var __extends = exports && exports.__extends || (function() {
2206
+ var extendStatics = function(d, b) {
2207
+ extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
2208
+ d.__proto__ = b;
2209
+ } || function(d, b) {
2210
+ for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
2211
+ };
2212
+ return extendStatics(d, b);
2213
+ };
2214
+ return function(d, b) {
2215
+ if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
2216
+ extendStatics(d, b);
2217
+ function __() {
2218
+ this.constructor = d;
2219
+ }
2220
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
2221
+ };
2222
+ })();
2223
+ var __importDefault = exports && exports.__importDefault || function(mod) {
2224
+ return mod && mod.__esModule ? mod : { "default": mod };
2225
+ };
2226
+ Object.defineProperty(exports, "__esModule", { value: true });
2227
+ var node_1 = __importDefault(require_node$1());
2228
+ var types_1 = require_types();
2229
+ exports.default = function(_super) {
2230
+ __extends(Nesting, _super);
2231
+ function Nesting(opts) {
2232
+ var _this = _super.call(this, opts) || this;
2233
+ _this.type = types_1.NESTING;
2234
+ _this.value = "&";
2235
+ return _this;
2236
+ }
2237
+ return Nesting;
2238
+ }(node_1.default);
2239
+ }));
2240
+ //#endregion
2241
+ //#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.5/node_modules/postcss-selector-parser/dist/sortAscending.js
2242
+ var require_sortAscending = /* @__PURE__ */ __commonJSMin(((exports) => {
2243
+ Object.defineProperty(exports, "__esModule", { value: true });
2244
+ exports.default = sortAscending;
2245
+ function sortAscending(list) {
2246
+ return list.sort(function(a, b) {
2247
+ return a - b;
2248
+ });
2249
+ }
2250
+ }));
2251
+ //#endregion
2252
+ //#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.5/node_modules/postcss-selector-parser/dist/tokenTypes.js
2253
+ var require_tokenTypes = /* @__PURE__ */ __commonJSMin(((exports) => {
2254
+ Object.defineProperty(exports, "__esModule", { value: true });
2255
+ exports.combinator = exports.word = exports.comment = exports.str = exports.tab = exports.newline = exports.feed = exports.cr = exports.backslash = exports.bang = exports.slash = exports.doubleQuote = exports.singleQuote = exports.space = exports.greaterThan = exports.pipe = exports.equals = exports.plus = exports.caret = exports.tilde = exports.dollar = exports.closeSquare = exports.openSquare = exports.closeParenthesis = exports.openParenthesis = exports.semicolon = exports.colon = exports.comma = exports.at = exports.asterisk = exports.ampersand = void 0;
2256
+ exports.ampersand = 38;
2257
+ exports.asterisk = 42;
2258
+ exports.at = 64;
2259
+ exports.comma = 44;
2260
+ exports.colon = 58;
2261
+ exports.semicolon = 59;
2262
+ exports.openParenthesis = 40;
2263
+ exports.closeParenthesis = 41;
2264
+ exports.openSquare = 91;
2265
+ exports.closeSquare = 93;
2266
+ exports.dollar = 36;
2267
+ exports.tilde = 126;
2268
+ exports.caret = 94;
2269
+ exports.plus = 43;
2270
+ exports.equals = 61;
2271
+ exports.pipe = 124;
2272
+ exports.greaterThan = 62;
2273
+ exports.space = 32;
2274
+ exports.singleQuote = 39;
2275
+ exports.doubleQuote = 34;
2276
+ exports.slash = 47;
2277
+ exports.bang = 33;
2278
+ exports.backslash = 92;
2279
+ exports.cr = 13;
2280
+ exports.feed = 12;
2281
+ exports.newline = 10;
2282
+ exports.tab = 9;
2283
+ exports.str = exports.singleQuote;
2284
+ exports.comment = -1;
2285
+ exports.word = -2;
2286
+ exports.combinator = -3;
2287
+ }));
2288
+ //#endregion
2289
+ //#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.5/node_modules/postcss-selector-parser/dist/tokenize.js
2290
+ var require_tokenize = /* @__PURE__ */ __commonJSMin(((exports) => {
2291
+ var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
2292
+ if (k2 === void 0) k2 = k;
2293
+ var desc = Object.getOwnPropertyDescriptor(m, k);
2294
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
2295
+ enumerable: true,
2296
+ get: function() {
2297
+ return m[k];
2298
+ }
2299
+ };
2300
+ Object.defineProperty(o, k2, desc);
2301
+ }) : (function(o, m, k, k2) {
2302
+ if (k2 === void 0) k2 = k;
2303
+ o[k2] = m[k];
2304
+ }));
2305
+ var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
2306
+ Object.defineProperty(o, "default", {
2307
+ enumerable: true,
2308
+ value: v
2309
+ });
2310
+ }) : function(o, v) {
2311
+ o["default"] = v;
2312
+ });
2313
+ var __importStar = exports && exports.__importStar || (function() {
2314
+ var ownKeys = function(o) {
2315
+ ownKeys = Object.getOwnPropertyNames || function(o) {
2316
+ var ar = [];
2317
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
2318
+ return ar;
2319
+ };
2320
+ return ownKeys(o);
2321
+ };
2322
+ return function(mod) {
2323
+ if (mod && mod.__esModule) return mod;
2324
+ var result = {};
2325
+ if (mod != null) {
2326
+ for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
2327
+ }
2328
+ __setModuleDefault(result, mod);
2329
+ return result;
2330
+ };
2331
+ })();
2332
+ var _a;
2333
+ var _b;
2334
+ Object.defineProperty(exports, "__esModule", { value: true });
2335
+ exports.FIELDS = void 0;
2336
+ exports.default = tokenize;
2337
+ var t = __importStar(require_tokenTypes());
2338
+ var unescapable = (_a = {}, _a[t.tab] = true, _a[t.newline] = true, _a[t.cr] = true, _a[t.feed] = true, _a);
2339
+ var wordDelimiters = (_b = {}, _b[t.space] = true, _b[t.tab] = true, _b[t.newline] = true, _b[t.cr] = true, _b[t.feed] = true, _b[t.ampersand] = true, _b[t.asterisk] = true, _b[t.bang] = true, _b[t.comma] = true, _b[t.colon] = true, _b[t.semicolon] = true, _b[t.openParenthesis] = true, _b[t.closeParenthesis] = true, _b[t.openSquare] = true, _b[t.closeSquare] = true, _b[t.singleQuote] = true, _b[t.doubleQuote] = true, _b[t.plus] = true, _b[t.pipe] = true, _b[t.tilde] = true, _b[t.greaterThan] = true, _b[t.equals] = true, _b[t.dollar] = true, _b[t.caret] = true, _b[t.slash] = true, _b);
2340
+ var hex = {};
2341
+ var hexChars = "0123456789abcdefABCDEF";
2342
+ for (var i = 0; i < hexChars.length; i++) hex[hexChars.charCodeAt(i)] = true;
2343
+ /**
2344
+ * Returns the last index of the bar css word
2345
+ * @param {string} css The string in which the word begins
2346
+ * @param {number} start The index into the string where word's first letter occurs
2347
+ */
2348
+ function consumeWord(css, start) {
2349
+ var next = start;
2350
+ var code;
2351
+ do {
2352
+ code = css.charCodeAt(next);
2353
+ if (wordDelimiters[code]) return next - 1;
2354
+ else if (code === t.backslash) next = consumeEscape(css, next) + 1;
2355
+ else next++;
2356
+ } while (next < css.length);
2357
+ return next - 1;
2358
+ }
2359
+ /**
2360
+ * Returns the last index of the escape sequence
2361
+ * @param {string} css The string in which the sequence begins
2362
+ * @param {number} start The index into the string where escape character (`\`) occurs.
2363
+ */
2364
+ function consumeEscape(css, start) {
2365
+ var next = start;
2366
+ var code = css.charCodeAt(next + 1);
2367
+ if (unescapable[code]) {} else if (hex[code]) {
2368
+ var hexDigits = 0;
2369
+ do {
2370
+ next++;
2371
+ hexDigits++;
2372
+ code = css.charCodeAt(next + 1);
2373
+ } while (hex[code] && hexDigits < 6);
2374
+ if (hexDigits < 6 && code === t.space) next++;
2375
+ } else next++;
2376
+ return next;
2377
+ }
2378
+ exports.FIELDS = {
2379
+ TYPE: 0,
2380
+ START_LINE: 1,
2381
+ START_COL: 2,
2382
+ END_LINE: 3,
2383
+ END_COL: 4,
2384
+ START_POS: 5,
2385
+ END_POS: 6
2386
+ };
2387
+ function tokenize(input) {
2388
+ var tokens = [];
2389
+ var css = input.css.valueOf();
2390
+ var length = css.length;
2391
+ var offset = -1;
2392
+ var line = 1;
2393
+ var start = 0;
2394
+ var end = 0;
2395
+ var code, content, endColumn, endLine, escaped, escapePos, last, lines, next, nextLine, nextOffset, quote, tokenType;
2396
+ function unclosed(what, fix) {
2397
+ if (input.safe) {
2398
+ css += fix;
2399
+ next = css.length - 1;
2400
+ } else throw input.error("Unclosed " + what, line, start - offset, start);
2401
+ }
2402
+ while (start < length) {
2403
+ code = css.charCodeAt(start);
2404
+ if (code === t.newline) {
2405
+ offset = start;
2406
+ line += 1;
2407
+ }
2408
+ switch (code) {
2409
+ case t.space:
2410
+ case t.tab:
2411
+ case t.newline:
2412
+ case t.cr:
2413
+ case t.feed:
2414
+ next = start;
2415
+ do {
2416
+ next += 1;
2417
+ code = css.charCodeAt(next);
2418
+ if (code === t.newline) {
2419
+ offset = next;
2420
+ line += 1;
2421
+ }
2422
+ } while (code === t.space || code === t.newline || code === t.tab || code === t.cr || code === t.feed);
2423
+ tokenType = t.space;
2424
+ endLine = line;
2425
+ endColumn = next - offset - 1;
2426
+ end = next;
2427
+ break;
2428
+ case t.plus:
2429
+ case t.greaterThan:
2430
+ case t.tilde:
2431
+ case t.pipe:
2432
+ next = start;
2433
+ do {
2434
+ next += 1;
2435
+ code = css.charCodeAt(next);
2436
+ } while (code === t.plus || code === t.greaterThan || code === t.tilde || code === t.pipe);
2437
+ tokenType = t.combinator;
2438
+ endLine = line;
2439
+ endColumn = start - offset;
2440
+ end = next;
2441
+ break;
2442
+ case t.asterisk:
2443
+ case t.ampersand:
2444
+ case t.bang:
2445
+ case t.comma:
2446
+ case t.equals:
2447
+ case t.dollar:
2448
+ case t.caret:
2449
+ case t.openSquare:
2450
+ case t.closeSquare:
2451
+ case t.colon:
2452
+ case t.semicolon:
2453
+ case t.openParenthesis:
2454
+ case t.closeParenthesis:
2455
+ next = start;
2456
+ tokenType = code;
2457
+ endLine = line;
2458
+ endColumn = start - offset;
2459
+ end = next + 1;
2460
+ break;
2461
+ case t.singleQuote:
2462
+ case t.doubleQuote:
2463
+ quote = code === t.singleQuote ? "'" : "\"";
2464
+ next = start;
2465
+ do {
2466
+ escaped = false;
2467
+ next = css.indexOf(quote, next + 1);
2468
+ if (next === -1) unclosed("quote", quote);
2469
+ escapePos = next;
2470
+ while (css.charCodeAt(escapePos - 1) === t.backslash) {
2471
+ escapePos -= 1;
2472
+ escaped = !escaped;
2473
+ }
2474
+ } while (escaped);
2475
+ tokenType = t.str;
2476
+ endLine = line;
2477
+ endColumn = start - offset;
2478
+ end = next + 1;
2479
+ break;
2480
+ default:
2481
+ if (code === t.slash && css.charCodeAt(start + 1) === t.asterisk) {
2482
+ next = css.indexOf("*/", start + 2) + 1;
2483
+ if (next === 0) unclosed("comment", "*/");
2484
+ content = css.slice(start, next + 1);
2485
+ lines = content.split("\n");
2486
+ last = lines.length - 1;
2487
+ if (last > 0) {
2488
+ nextLine = line + last;
2489
+ nextOffset = next - lines[last].length;
2490
+ } else {
2491
+ nextLine = line;
2492
+ nextOffset = offset;
2493
+ }
2494
+ tokenType = t.comment;
2495
+ line = nextLine;
2496
+ endLine = nextLine;
2497
+ endColumn = next - nextOffset;
2498
+ } else if (code === t.slash) {
2499
+ next = start;
2500
+ tokenType = code;
2501
+ endLine = line;
2502
+ endColumn = start - offset;
2503
+ end = next + 1;
2504
+ } else {
2505
+ next = consumeWord(css, start);
2506
+ tokenType = t.word;
2507
+ endLine = line;
2508
+ endColumn = next - offset;
2509
+ }
2510
+ end = next + 1;
2511
+ }
2512
+ tokens.push([
2513
+ tokenType,
2514
+ line,
2515
+ start - offset,
2516
+ endLine,
2517
+ endColumn,
2518
+ start,
2519
+ end
2520
+ ]);
2521
+ if (nextOffset) {
2522
+ offset = nextOffset;
2523
+ nextOffset = null;
2524
+ }
2525
+ start = end;
2526
+ }
2527
+ return tokens;
2528
+ }
2529
+ }));
2530
+ //#endregion
2531
+ //#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.5/node_modules/postcss-selector-parser/dist/parser.js
2532
+ var require_parser = /* @__PURE__ */ __commonJSMin(((exports) => {
2533
+ var __assign = exports && exports.__assign || function() {
2534
+ __assign = Object.assign || function(t) {
2535
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
2536
+ s = arguments[i];
2537
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
2538
+ }
2539
+ return t;
2540
+ };
2541
+ return __assign.apply(this, arguments);
2542
+ };
2543
+ var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
2544
+ if (k2 === void 0) k2 = k;
2545
+ var desc = Object.getOwnPropertyDescriptor(m, k);
2546
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
2547
+ enumerable: true,
2548
+ get: function() {
2549
+ return m[k];
2550
+ }
2551
+ };
2552
+ Object.defineProperty(o, k2, desc);
2553
+ }) : (function(o, m, k, k2) {
2554
+ if (k2 === void 0) k2 = k;
2555
+ o[k2] = m[k];
2556
+ }));
2557
+ var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
2558
+ Object.defineProperty(o, "default", {
2559
+ enumerable: true,
2560
+ value: v
2561
+ });
2562
+ }) : function(o, v) {
2563
+ o["default"] = v;
2564
+ });
2565
+ var __importStar = exports && exports.__importStar || (function() {
2566
+ var ownKeys = function(o) {
2567
+ ownKeys = Object.getOwnPropertyNames || function(o) {
2568
+ var ar = [];
2569
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
2570
+ return ar;
2571
+ };
2572
+ return ownKeys(o);
2573
+ };
2574
+ return function(mod) {
2575
+ if (mod && mod.__esModule) return mod;
2576
+ var result = {};
2577
+ if (mod != null) {
2578
+ for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
2579
+ }
2580
+ __setModuleDefault(result, mod);
2581
+ return result;
2582
+ };
2583
+ })();
2584
+ var __read = exports && exports.__read || function(o, n) {
2585
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
2586
+ if (!m) return o;
2587
+ var i = m.call(o), r, ar = [], e;
2588
+ try {
2589
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
2590
+ } catch (error) {
2591
+ e = { error };
2592
+ } finally {
2593
+ try {
2594
+ if (r && !r.done && (m = i["return"])) m.call(i);
2595
+ } finally {
2596
+ if (e) throw e.error;
2597
+ }
2598
+ }
2599
+ return ar;
2600
+ };
2601
+ var __spreadArray = exports && exports.__spreadArray || function(to, from, pack) {
2602
+ if (pack || arguments.length === 2) {
2603
+ for (var i = 0, l = from.length, ar; i < l; i++) if (ar || !(i in from)) {
2604
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
2605
+ ar[i] = from[i];
2606
+ }
2607
+ }
2608
+ return to.concat(ar || Array.prototype.slice.call(from));
2609
+ };
2610
+ var __importDefault = exports && exports.__importDefault || function(mod) {
2611
+ return mod && mod.__esModule ? mod : { "default": mod };
2612
+ };
2613
+ var _a;
2614
+ var _b;
2615
+ Object.defineProperty(exports, "__esModule", { value: true });
2616
+ var root_1 = __importDefault(require_root());
2617
+ var selector_1 = __importDefault(require_selector());
2618
+ var className_1 = __importDefault(require_className());
2619
+ var comment_1 = __importDefault(require_comment());
2620
+ var id_1 = __importDefault(require_id());
2621
+ var tag_1 = __importDefault(require_tag());
2622
+ var string_1 = __importDefault(require_string());
2623
+ var pseudo_1 = __importDefault(require_pseudo());
2624
+ var attribute_1 = __importStar(require_attribute());
2625
+ var universal_1 = __importDefault(require_universal());
2626
+ var combinator_1 = __importDefault(require_combinator());
2627
+ var nesting_1 = __importDefault(require_nesting());
2628
+ var sortAscending_1 = __importDefault(require_sortAscending());
2629
+ var tokenize_1 = __importStar(require_tokenize());
2630
+ var tokens = __importStar(require_tokenTypes());
2631
+ var types = __importStar(require_types());
2632
+ var util_1 = require_util();
2633
+ var WHITESPACE_TOKENS = (_a = {}, _a[tokens.space] = true, _a[tokens.cr] = true, _a[tokens.feed] = true, _a[tokens.newline] = true, _a[tokens.tab] = true, _a);
2634
+ var WHITESPACE_EQUIV_TOKENS = __assign(__assign({}, WHITESPACE_TOKENS), (_b = {}, _b[tokens.comment] = true, _b));
2635
+ function tokenStart(token) {
2636
+ return {
2637
+ line: token[tokenize_1.FIELDS.START_LINE],
2638
+ column: token[tokenize_1.FIELDS.START_COL]
2639
+ };
2640
+ }
2641
+ function tokenEnd(token) {
2642
+ return {
2643
+ line: token[tokenize_1.FIELDS.END_LINE],
2644
+ column: token[tokenize_1.FIELDS.END_COL]
2645
+ };
2646
+ }
2647
+ function getSource(startLine, startColumn, endLine, endColumn) {
2648
+ return {
2649
+ start: {
2650
+ line: startLine,
2651
+ column: startColumn
2652
+ },
2653
+ end: {
2654
+ line: endLine,
2655
+ column: endColumn
2656
+ }
2657
+ };
2658
+ }
2659
+ function getTokenSource(token) {
2660
+ return getSource(token[tokenize_1.FIELDS.START_LINE], token[tokenize_1.FIELDS.START_COL], token[tokenize_1.FIELDS.END_LINE], token[tokenize_1.FIELDS.END_COL]);
2661
+ }
2662
+ function getTokenSourceSpan(startToken, endToken) {
2663
+ if (!startToken) return;
2664
+ return getSource(startToken[tokenize_1.FIELDS.START_LINE], startToken[tokenize_1.FIELDS.START_COL], endToken[tokenize_1.FIELDS.END_LINE], endToken[tokenize_1.FIELDS.END_COL]);
2665
+ }
2666
+ function unescapeProp(node, prop) {
2667
+ var value = node[prop];
2668
+ if (typeof value !== "string") return;
2669
+ if (value.indexOf("\\") !== -1) {
2670
+ (0, util_1.ensureObject)(node, "raws");
2671
+ node[prop] = (0, util_1.unesc)(value);
2672
+ if (node.raws[prop] === void 0) node.raws[prop] = value;
2673
+ }
2674
+ return node;
2675
+ }
2676
+ function indexesOf(array, item) {
2677
+ var i = -1;
2678
+ var indexes = [];
2679
+ while ((i = array.indexOf(item, i + 1)) !== -1) indexes.push(i);
2680
+ return indexes;
2681
+ }
2682
+ function uniqs() {
2683
+ var list = Array.prototype.concat.apply([], arguments);
2684
+ return list.filter(function(item, i) {
2685
+ return i === list.indexOf(item);
2686
+ });
2687
+ }
2688
+ exports.default = function() {
2689
+ function Parser(rule, options) {
2690
+ if (options === void 0) options = {};
2691
+ this.rule = rule;
2692
+ this.options = Object.assign({
2693
+ lossy: false,
2694
+ safe: false
2695
+ }, options);
2696
+ this.position = 0;
2697
+ this.nestingDepth = 0;
2698
+ this.maxNestingDepth = (0, util_1.resolveMaxNestingDepth)(this.options.maxNestingDepth);
2699
+ this.css = typeof this.rule === "string" ? this.rule : this.rule.selector;
2700
+ this.tokens = (0, tokenize_1.default)({
2701
+ css: this.css,
2702
+ error: this._errorGenerator(),
2703
+ safe: this.options.safe
2704
+ });
2705
+ var rootSource = getTokenSourceSpan(this.tokens[0], this.tokens[this.tokens.length - 1]);
2706
+ this.root = new root_1.default({ source: rootSource });
2707
+ this.root.errorGenerator = this._errorGenerator();
2708
+ var selector = new selector_1.default({
2709
+ source: { start: {
2710
+ line: 1,
2711
+ column: 1
2712
+ } },
2713
+ sourceIndex: 0
2714
+ });
2715
+ this.root.append(selector);
2716
+ this.current = selector;
2717
+ this.loop();
2718
+ }
2719
+ Parser.prototype._errorGenerator = function() {
2720
+ var _this = this;
2721
+ return function(message, errorOptions) {
2722
+ if (typeof _this.rule === "string") return new Error(message);
2723
+ return _this.rule.error(message, errorOptions);
2724
+ };
2725
+ };
2726
+ Parser.prototype.attribute = function() {
2727
+ var attr = [];
2728
+ var startingToken = this.currToken;
2729
+ this.position++;
2730
+ while (this.position < this.tokens.length && this.currToken[tokenize_1.FIELDS.TYPE] !== tokens.closeSquare) {
2731
+ attr.push(this.currToken);
2732
+ this.position++;
2733
+ }
2734
+ if (!this.currToken) return this.expected("closing square bracket", startingToken[tokenize_1.FIELDS.START_POS]);
2735
+ if (this.currToken[tokenize_1.FIELDS.TYPE] !== tokens.closeSquare) return this.expected("closing square bracket", this.currToken[tokenize_1.FIELDS.START_POS]);
2736
+ var len = attr.length;
2737
+ var node = {
2738
+ source: getSource(startingToken[1], startingToken[2], this.currToken[3], this.currToken[4]),
2739
+ sourceIndex: startingToken[tokenize_1.FIELDS.START_POS]
2740
+ };
2741
+ if (len === 1 && !~[tokens.word].indexOf(attr[0][tokenize_1.FIELDS.TYPE])) return this.expected("attribute", attr[0][tokenize_1.FIELDS.START_POS]);
2742
+ var pos = 0;
2743
+ var spaceBefore = "";
2744
+ var commentBefore = "";
2745
+ var lastAdded = null;
2746
+ var spaceAfterMeaningfulToken = false;
2747
+ while (pos < len) {
2748
+ var token = attr[pos];
2749
+ var content = this.content(token);
2750
+ var next = attr[pos + 1];
2751
+ switch (token[tokenize_1.FIELDS.TYPE]) {
2752
+ case tokens.space:
2753
+ spaceAfterMeaningfulToken = true;
2754
+ if (this.options.lossy) break;
2755
+ if (lastAdded) {
2756
+ (0, util_1.ensureObject)(node, "spaces", lastAdded);
2757
+ var prevContent = node.spaces[lastAdded].after || "";
2758
+ node.spaces[lastAdded].after = prevContent + content;
2759
+ var existingComment = (0, util_1.getProp)(node, "raws", "spaces", lastAdded, "after") || null;
2760
+ if (existingComment) node.raws.spaces[lastAdded].after = existingComment + content;
2761
+ } else {
2762
+ spaceBefore = spaceBefore + content;
2763
+ commentBefore = commentBefore + content;
2764
+ }
2765
+ break;
2766
+ case tokens.asterisk:
2767
+ if (next[tokenize_1.FIELDS.TYPE] === tokens.equals) {
2768
+ node.operator = content;
2769
+ lastAdded = "operator";
2770
+ } else if ((!node.namespace || lastAdded === "namespace" && !spaceAfterMeaningfulToken) && next) {
2771
+ if (spaceBefore) {
2772
+ (0, util_1.ensureObject)(node, "spaces", "attribute");
2773
+ node.spaces.attribute.before = spaceBefore;
2774
+ spaceBefore = "";
2775
+ }
2776
+ if (commentBefore) {
2777
+ (0, util_1.ensureObject)(node, "raws", "spaces", "attribute");
2778
+ node.raws.spaces.attribute.before = commentBefore;
2779
+ commentBefore = "";
2780
+ }
2781
+ node.namespace = (node.namespace || "") + content;
2782
+ var rawValue = (0, util_1.getProp)(node, "raws", "namespace") || null;
2783
+ if (rawValue) node.raws.namespace += content;
2784
+ lastAdded = "namespace";
2785
+ }
2786
+ spaceAfterMeaningfulToken = false;
2787
+ break;
2788
+ case tokens.dollar: if (lastAdded === "value") {
2789
+ var oldRawValue = (0, util_1.getProp)(node, "raws", "value");
2790
+ node.value += "$";
2791
+ if (oldRawValue) node.raws.value = oldRawValue + "$";
2792
+ break;
2793
+ }
2794
+ case tokens.caret:
2795
+ if (next[tokenize_1.FIELDS.TYPE] === tokens.equals) {
2796
+ node.operator = content;
2797
+ lastAdded = "operator";
2798
+ }
2799
+ spaceAfterMeaningfulToken = false;
2800
+ break;
2801
+ case tokens.combinator:
2802
+ if (content === "~" && next[tokenize_1.FIELDS.TYPE] === tokens.equals) {
2803
+ node.operator = content;
2804
+ lastAdded = "operator";
2805
+ }
2806
+ if (content !== "|") {
2807
+ spaceAfterMeaningfulToken = false;
2808
+ break;
2809
+ }
2810
+ if (next[tokenize_1.FIELDS.TYPE] === tokens.equals) {
2811
+ node.operator = content;
2812
+ lastAdded = "operator";
2813
+ } else if (!node.namespace && !node.attribute) node.namespace = true;
2814
+ spaceAfterMeaningfulToken = false;
2815
+ break;
2816
+ case tokens.word:
2817
+ if (next && this.content(next) === "|" && attr[pos + 2] && attr[pos + 2][tokenize_1.FIELDS.TYPE] !== tokens.equals && !node.operator && !node.namespace) {
2818
+ node.namespace = content;
2819
+ lastAdded = "namespace";
2820
+ } else if (!node.attribute || lastAdded === "attribute" && !spaceAfterMeaningfulToken) {
2821
+ if (spaceBefore) {
2822
+ (0, util_1.ensureObject)(node, "spaces", "attribute");
2823
+ node.spaces.attribute.before = spaceBefore;
2824
+ spaceBefore = "";
2825
+ }
2826
+ if (commentBefore) {
2827
+ (0, util_1.ensureObject)(node, "raws", "spaces", "attribute");
2828
+ node.raws.spaces.attribute.before = commentBefore;
2829
+ commentBefore = "";
2830
+ }
2831
+ node.attribute = (node.attribute || "") + content;
2832
+ var rawValue = (0, util_1.getProp)(node, "raws", "attribute") || null;
2833
+ if (rawValue) node.raws.attribute += content;
2834
+ lastAdded = "attribute";
2835
+ } else if (!node.value && node.value !== "" || lastAdded === "value" && !(spaceAfterMeaningfulToken || node.quoteMark)) {
2836
+ var unescaped_1 = (0, util_1.unesc)(content);
2837
+ var oldRawValue = (0, util_1.getProp)(node, "raws", "value") || "";
2838
+ var oldValue = node.value || "";
2839
+ node.value = oldValue + unescaped_1;
2840
+ node.quoteMark = null;
2841
+ if (unescaped_1 !== content || oldRawValue) {
2842
+ (0, util_1.ensureObject)(node, "raws");
2843
+ node.raws.value = (oldRawValue || oldValue) + content;
2844
+ }
2845
+ lastAdded = "value";
2846
+ } else {
2847
+ var insensitive = content === "i" || content === "I";
2848
+ if ((node.value || node.value === "") && (node.quoteMark || spaceAfterMeaningfulToken)) {
2849
+ node.insensitive = insensitive;
2850
+ if (!insensitive || content === "I") {
2851
+ (0, util_1.ensureObject)(node, "raws");
2852
+ node.raws.insensitiveFlag = content;
2853
+ }
2854
+ lastAdded = "insensitive";
2855
+ if (spaceBefore) {
2856
+ (0, util_1.ensureObject)(node, "spaces", "insensitive");
2857
+ node.spaces.insensitive.before = spaceBefore;
2858
+ spaceBefore = "";
2859
+ }
2860
+ if (commentBefore) {
2861
+ (0, util_1.ensureObject)(node, "raws", "spaces", "insensitive");
2862
+ node.raws.spaces.insensitive.before = commentBefore;
2863
+ commentBefore = "";
2864
+ }
2865
+ } else if (node.value || node.value === "") {
2866
+ lastAdded = "value";
2867
+ node.value += content;
2868
+ if (node.raws.value) node.raws.value += content;
2869
+ }
2870
+ }
2871
+ spaceAfterMeaningfulToken = false;
2872
+ break;
2873
+ case tokens.str:
2874
+ if (!node.attribute || !node.operator) return this.error("Expected an attribute followed by an operator preceding the string.", { index: token[tokenize_1.FIELDS.START_POS] });
2875
+ var _a = (0, attribute_1.unescapeValue)(content), unescaped = _a.unescaped, quoteMark = _a.quoteMark;
2876
+ node.value = unescaped;
2877
+ node.quoteMark = quoteMark;
2878
+ lastAdded = "value";
2879
+ (0, util_1.ensureObject)(node, "raws");
2880
+ node.raws.value = content;
2881
+ spaceAfterMeaningfulToken = false;
2882
+ break;
2883
+ case tokens.equals:
2884
+ if (!node.attribute) return this.expected("attribute", token[tokenize_1.FIELDS.START_POS], content);
2885
+ if (node.value) return this.error("Unexpected \"=\" found; an operator was already defined.", { index: token[tokenize_1.FIELDS.START_POS] });
2886
+ node.operator = node.operator ? node.operator + content : content;
2887
+ lastAdded = "operator";
2888
+ spaceAfterMeaningfulToken = false;
2889
+ break;
2890
+ case tokens.comment:
2891
+ if (lastAdded) {
2892
+ if (spaceAfterMeaningfulToken || next && next[tokenize_1.FIELDS.TYPE] === tokens.space || lastAdded === "insensitive") {
2893
+ var lastComment = (0, util_1.getProp)(node, "spaces", lastAdded, "after") || "";
2894
+ var rawLastComment = (0, util_1.getProp)(node, "raws", "spaces", lastAdded, "after") || lastComment;
2895
+ (0, util_1.ensureObject)(node, "raws", "spaces", lastAdded);
2896
+ node.raws.spaces[lastAdded].after = rawLastComment + content;
2897
+ } else {
2898
+ var lastValue = node[lastAdded] || "";
2899
+ var rawLastValue = (0, util_1.getProp)(node, "raws", lastAdded) || lastValue;
2900
+ (0, util_1.ensureObject)(node, "raws");
2901
+ node.raws[lastAdded] = rawLastValue + content;
2902
+ }
2903
+ } else commentBefore = commentBefore + content;
2904
+ break;
2905
+ default: return this.error("Unexpected \"".concat(content, "\" found."), { index: token[tokenize_1.FIELDS.START_POS] });
2906
+ }
2907
+ pos++;
2908
+ }
2909
+ unescapeProp(node, "attribute");
2910
+ unescapeProp(node, "namespace");
2911
+ this.newNode(new attribute_1.default(node));
2912
+ this.position++;
2913
+ };
2914
+ /**
2915
+ * return a node containing meaningless garbage up to (but not including) the specified token position.
2916
+ * if the token position is negative, all remaining tokens are consumed.
2917
+ *
2918
+ * This returns an array containing a single string node if all whitespace,
2919
+ * otherwise an array of comment nodes with space before and after.
2920
+ *
2921
+ * These tokens are not added to the current selector, the caller can add them or use them to amend
2922
+ * a previous node's space metadata.
2923
+ *
2924
+ * In lossy mode, this returns only comments.
2925
+ */
2926
+ Parser.prototype.parseWhitespaceEquivalentTokens = function(stopPosition) {
2927
+ if (stopPosition < 0) stopPosition = this.tokens.length;
2928
+ var startPosition = this.position;
2929
+ var nodes = [];
2930
+ var space = "";
2931
+ var lastComment = void 0;
2932
+ do
2933
+ if (WHITESPACE_TOKENS[this.currToken[tokenize_1.FIELDS.TYPE]]) {
2934
+ if (!this.options.lossy) space += this.content();
2935
+ } else if (this.currToken[tokenize_1.FIELDS.TYPE] === tokens.comment) {
2936
+ var spaces = {};
2937
+ if (space) {
2938
+ spaces.before = space;
2939
+ space = "";
2940
+ }
2941
+ lastComment = new comment_1.default({
2942
+ value: this.content(),
2943
+ source: getTokenSource(this.currToken),
2944
+ sourceIndex: this.currToken[tokenize_1.FIELDS.START_POS],
2945
+ spaces
2946
+ });
2947
+ nodes.push(lastComment);
2948
+ }
2949
+ while (++this.position < stopPosition);
2950
+ if (space) {
2951
+ if (lastComment) lastComment.spaces.after = space;
2952
+ else if (!this.options.lossy) {
2953
+ var firstToken = this.tokens[startPosition];
2954
+ var lastToken = this.tokens[this.position - 1];
2955
+ nodes.push(new string_1.default({
2956
+ value: "",
2957
+ source: getSource(firstToken[tokenize_1.FIELDS.START_LINE], firstToken[tokenize_1.FIELDS.START_COL], lastToken[tokenize_1.FIELDS.END_LINE], lastToken[tokenize_1.FIELDS.END_COL]),
2958
+ sourceIndex: firstToken[tokenize_1.FIELDS.START_POS],
2959
+ spaces: {
2960
+ before: space,
2961
+ after: ""
2962
+ }
2963
+ }));
2964
+ }
2965
+ }
2966
+ return nodes;
2967
+ };
2968
+ /**
2969
+ *
2970
+ * @param {*} nodes
2971
+ */
2972
+ Parser.prototype.convertWhitespaceNodesToSpace = function(nodes, requiredSpace) {
2973
+ var _this = this;
2974
+ if (requiredSpace === void 0) requiredSpace = false;
2975
+ var space = "";
2976
+ var rawSpace = "";
2977
+ nodes.forEach(function(n) {
2978
+ var spaceBefore = _this.lossySpace(n.spaces.before, requiredSpace);
2979
+ var rawSpaceBefore = _this.lossySpace(n.rawSpaceBefore, requiredSpace);
2980
+ space += spaceBefore + _this.lossySpace(n.spaces.after, requiredSpace && spaceBefore.length === 0);
2981
+ rawSpace += spaceBefore + n.value + _this.lossySpace(n.rawSpaceAfter, requiredSpace && rawSpaceBefore.length === 0);
2982
+ });
2983
+ if (rawSpace === space) rawSpace = void 0;
2984
+ return {
2985
+ space,
2986
+ rawSpace
2987
+ };
2988
+ };
2989
+ Parser.prototype.isNamedCombinator = function(position) {
2990
+ if (position === void 0) position = this.position;
2991
+ return this.tokens[position + 0] && this.tokens[position + 0][tokenize_1.FIELDS.TYPE] === tokens.slash && this.tokens[position + 1] && this.tokens[position + 1][tokenize_1.FIELDS.TYPE] === tokens.word && this.tokens[position + 2] && this.tokens[position + 2][tokenize_1.FIELDS.TYPE] === tokens.slash;
2992
+ };
2993
+ Parser.prototype.namedCombinator = function() {
2994
+ if (this.isNamedCombinator()) {
2995
+ var nameRaw = this.content(this.tokens[this.position + 1]);
2996
+ var name = (0, util_1.unesc)(nameRaw).toLowerCase();
2997
+ var raws = {};
2998
+ if (name !== nameRaw) raws.value = "/".concat(nameRaw, "/");
2999
+ var node = new combinator_1.default({
3000
+ value: "/".concat(name, "/"),
3001
+ source: getSource(this.currToken[tokenize_1.FIELDS.START_LINE], this.currToken[tokenize_1.FIELDS.START_COL], this.tokens[this.position + 2][tokenize_1.FIELDS.END_LINE], this.tokens[this.position + 2][tokenize_1.FIELDS.END_COL]),
3002
+ sourceIndex: this.currToken[tokenize_1.FIELDS.START_POS],
3003
+ raws
3004
+ });
3005
+ this.position = this.position + 3;
3006
+ return node;
3007
+ } else this.unexpected();
3008
+ };
3009
+ Parser.prototype.combinator = function() {
3010
+ var _this = this;
3011
+ if (this.content() === "|") return this.namespace();
3012
+ var nextSigTokenPos = this.locateNextMeaningfulToken(this.position);
3013
+ if (nextSigTokenPos < 0 || this.tokens[nextSigTokenPos][tokenize_1.FIELDS.TYPE] === tokens.comma || this.tokens[nextSigTokenPos][tokenize_1.FIELDS.TYPE] === tokens.closeParenthesis) {
3014
+ var nodes = this.parseWhitespaceEquivalentTokens(nextSigTokenPos);
3015
+ if (nodes.length > 0) {
3016
+ var last = this.current.last;
3017
+ if (last) {
3018
+ var _a = this.convertWhitespaceNodesToSpace(nodes), space = _a.space, rawSpace = _a.rawSpace;
3019
+ if (rawSpace !== void 0) last.rawSpaceAfter += rawSpace;
3020
+ last.spaces.after += space;
3021
+ } else nodes.forEach(function(n) {
3022
+ return _this.newNode(n);
3023
+ });
3024
+ }
3025
+ return;
3026
+ }
3027
+ var firstToken = this.currToken;
3028
+ var spaceOrDescendantSelectorNodes = void 0;
3029
+ if (nextSigTokenPos > this.position) spaceOrDescendantSelectorNodes = this.parseWhitespaceEquivalentTokens(nextSigTokenPos);
3030
+ var node;
3031
+ if (this.isNamedCombinator()) node = this.namedCombinator();
3032
+ else if (this.currToken[tokenize_1.FIELDS.TYPE] === tokens.combinator) {
3033
+ node = new combinator_1.default({
3034
+ value: this.content(),
3035
+ source: getTokenSource(this.currToken),
3036
+ sourceIndex: this.currToken[tokenize_1.FIELDS.START_POS]
3037
+ });
3038
+ this.position++;
3039
+ } else if (WHITESPACE_TOKENS[this.currToken[tokenize_1.FIELDS.TYPE]]) {} else if (!spaceOrDescendantSelectorNodes) this.unexpected();
3040
+ if (node) {
3041
+ if (spaceOrDescendantSelectorNodes) {
3042
+ var _b = this.convertWhitespaceNodesToSpace(spaceOrDescendantSelectorNodes), space = _b.space, rawSpace = _b.rawSpace;
3043
+ node.spaces.before = space;
3044
+ node.rawSpaceBefore = rawSpace;
3045
+ }
3046
+ } else {
3047
+ var _c = this.convertWhitespaceNodesToSpace(spaceOrDescendantSelectorNodes, true), space = _c.space, rawSpace = _c.rawSpace;
3048
+ if (!rawSpace) rawSpace = space;
3049
+ var spaces = {};
3050
+ var raws = { spaces: {} };
3051
+ if (space.endsWith(" ") && rawSpace.endsWith(" ")) {
3052
+ spaces.before = space.slice(0, space.length - 1);
3053
+ raws.spaces.before = rawSpace.slice(0, rawSpace.length - 1);
3054
+ } else if (space[0] === " " && rawSpace[0] === " ") {
3055
+ spaces.after = space.slice(1);
3056
+ raws.spaces.after = rawSpace.slice(1);
3057
+ } else raws.value = rawSpace;
3058
+ node = new combinator_1.default({
3059
+ value: " ",
3060
+ source: getTokenSourceSpan(firstToken, this.tokens[this.position - 1]),
3061
+ sourceIndex: firstToken[tokenize_1.FIELDS.START_POS],
3062
+ spaces,
3063
+ raws
3064
+ });
3065
+ }
3066
+ if (this.currToken && this.currToken[tokenize_1.FIELDS.TYPE] === tokens.space) {
3067
+ node.spaces.after = this.optionalSpace(this.content());
3068
+ this.position++;
3069
+ }
3070
+ return this.newNode(node);
3071
+ };
3072
+ Parser.prototype.comma = function() {
3073
+ if (this.position === this.tokens.length - 1) {
3074
+ this.root.trailingComma = true;
3075
+ this.position++;
3076
+ return;
3077
+ }
3078
+ this.current._inferEndPosition();
3079
+ var selector = new selector_1.default({
3080
+ source: { start: tokenStart(this.tokens[this.position + 1]) },
3081
+ sourceIndex: this.tokens[this.position + 1][tokenize_1.FIELDS.START_POS]
3082
+ });
3083
+ this.current.parent.append(selector);
3084
+ this.current = selector;
3085
+ this.position++;
3086
+ };
3087
+ Parser.prototype.comment = function() {
3088
+ var current = this.currToken;
3089
+ this.newNode(new comment_1.default({
3090
+ value: this.content(),
3091
+ source: getTokenSource(current),
3092
+ sourceIndex: current[tokenize_1.FIELDS.START_POS]
3093
+ }));
3094
+ this.position++;
3095
+ };
3096
+ Parser.prototype.error = function(message, opts) {
3097
+ throw this.root.error(message, opts);
3098
+ };
3099
+ Parser.prototype.missingBackslash = function() {
3100
+ return this.error("Expected a backslash preceding the semicolon.", { index: this.currToken[tokenize_1.FIELDS.START_POS] });
3101
+ };
3102
+ Parser.prototype.missingParenthesis = function() {
3103
+ return this.expected("opening parenthesis", this.currToken[tokenize_1.FIELDS.START_POS]);
3104
+ };
3105
+ Parser.prototype.missingSquareBracket = function() {
3106
+ return this.expected("opening square bracket", this.currToken[tokenize_1.FIELDS.START_POS]);
3107
+ };
3108
+ Parser.prototype.unexpected = function() {
3109
+ return this.error("Unexpected '".concat(this.content(), "'. Escaping special characters with \\ may help."), this.currToken[tokenize_1.FIELDS.START_POS]);
3110
+ };
3111
+ Parser.prototype.unexpectedPipe = function() {
3112
+ return this.error("Unexpected '|'.", this.currToken[tokenize_1.FIELDS.START_POS]);
3113
+ };
3114
+ Parser.prototype.namespace = function() {
3115
+ var prev = this.prevToken;
3116
+ var before = prev && (prev[tokenize_1.FIELDS.TYPE] === tokens.word || prev[tokenize_1.FIELDS.TYPE] === tokens.asterisk || prev[tokenize_1.FIELDS.TYPE] === tokens.ampersand) ? this.content(prev) : true;
3117
+ if (!this.nextToken) return this.unexpectedPipe();
3118
+ if (this.nextToken[tokenize_1.FIELDS.TYPE] === tokens.word) {
3119
+ this.position++;
3120
+ return this.word(before);
3121
+ } else if (this.nextToken[tokenize_1.FIELDS.TYPE] === tokens.asterisk) {
3122
+ this.position++;
3123
+ return this.universal(before);
3124
+ }
3125
+ this.unexpectedPipe();
3126
+ };
3127
+ Parser.prototype.nesting = function() {
3128
+ if (this.nextToken) {
3129
+ if (this.content(this.nextToken) === "|") {
3130
+ this.position++;
3131
+ return;
3132
+ }
3133
+ }
3134
+ var current = this.currToken;
3135
+ this.newNode(new nesting_1.default({
3136
+ value: this.content(),
3137
+ source: getTokenSource(current),
3138
+ sourceIndex: current[tokenize_1.FIELDS.START_POS]
3139
+ }));
3140
+ this.position++;
3141
+ };
3142
+ Parser.prototype.parentheses = function() {
3143
+ var last = this.current.last;
3144
+ var unbalanced = 1;
3145
+ var openingToken = this.currToken;
3146
+ this.position++;
3147
+ if (last && last.type === types.PSEUDO) {
3148
+ var selector = new selector_1.default({
3149
+ source: { start: tokenStart(this.tokens[this.position]) },
3150
+ sourceIndex: this.tokens[this.position][tokenize_1.FIELDS.START_POS]
3151
+ });
3152
+ var cache = this.current;
3153
+ last.append(selector);
3154
+ this.current = selector;
3155
+ this.nestingDepth++;
3156
+ try {
3157
+ if (this.nestingDepth > this.maxNestingDepth) this.error("Cannot parse selector: nesting depth exceeds the maximum of ".concat(this.maxNestingDepth, "."), { index: this.currToken[tokenize_1.FIELDS.START_POS] });
3158
+ while (this.position < this.tokens.length && unbalanced) {
3159
+ if (this.currToken[tokenize_1.FIELDS.TYPE] === tokens.openParenthesis) unbalanced++;
3160
+ if (this.currToken[tokenize_1.FIELDS.TYPE] === tokens.closeParenthesis) unbalanced--;
3161
+ if (unbalanced) this.parse();
3162
+ else {
3163
+ this.current.source.end = tokenEnd(this.currToken);
3164
+ this.current.parent.source.end = tokenEnd(this.currToken);
3165
+ this.position++;
3166
+ }
3167
+ }
3168
+ } finally {
3169
+ this.nestingDepth--;
3170
+ }
3171
+ this.current = cache;
3172
+ } else {
3173
+ var parenStart = this.currToken;
3174
+ var parenValue = "(";
3175
+ var parenEnd = void 0;
3176
+ while (this.position < this.tokens.length && unbalanced) {
3177
+ if (this.currToken[tokenize_1.FIELDS.TYPE] === tokens.openParenthesis) unbalanced++;
3178
+ if (this.currToken[tokenize_1.FIELDS.TYPE] === tokens.closeParenthesis) unbalanced--;
3179
+ parenEnd = this.currToken;
3180
+ parenValue += this.parseParenthesisToken(this.currToken);
3181
+ this.position++;
3182
+ }
3183
+ if (last) last.appendToPropertyAndEscape("value", parenValue, parenValue);
3184
+ else this.newNode(new string_1.default({
3185
+ value: parenValue,
3186
+ source: getSource(parenStart[tokenize_1.FIELDS.START_LINE], parenStart[tokenize_1.FIELDS.START_COL], parenEnd[tokenize_1.FIELDS.END_LINE], parenEnd[tokenize_1.FIELDS.END_COL]),
3187
+ sourceIndex: parenStart[tokenize_1.FIELDS.START_POS]
3188
+ }));
3189
+ }
3190
+ if (unbalanced) return this.expected("closing parenthesis", (this.currToken || openingToken)[tokenize_1.FIELDS.START_POS]);
3191
+ };
3192
+ Parser.prototype.pseudo = function() {
3193
+ var _this = this;
3194
+ var pseudoStr = "";
3195
+ var startingToken = this.currToken;
3196
+ while (this.currToken && this.currToken[tokenize_1.FIELDS.TYPE] === tokens.colon) {
3197
+ pseudoStr += this.content();
3198
+ this.position++;
3199
+ }
3200
+ if (!this.currToken) return this.expected(["pseudo-class", "pseudo-element"], this.position - 1);
3201
+ if (this.currToken[tokenize_1.FIELDS.TYPE] === tokens.word) this.splitWord(false, function(first, length) {
3202
+ pseudoStr += first;
3203
+ _this.newNode(new pseudo_1.default({
3204
+ value: pseudoStr,
3205
+ source: getTokenSourceSpan(startingToken, _this.currToken),
3206
+ sourceIndex: startingToken[tokenize_1.FIELDS.START_POS]
3207
+ }));
3208
+ if (length > 1 && _this.nextToken && _this.nextToken[tokenize_1.FIELDS.TYPE] === tokens.openParenthesis) _this.error("Misplaced parenthesis.", { index: _this.nextToken[tokenize_1.FIELDS.START_POS] });
3209
+ });
3210
+ else return this.expected(["pseudo-class", "pseudo-element"], this.currToken[tokenize_1.FIELDS.START_POS]);
3211
+ };
3212
+ Parser.prototype.space = function() {
3213
+ var content = this.content();
3214
+ if (this.position === 0 || this.prevToken[tokenize_1.FIELDS.TYPE] === tokens.comma || this.prevToken[tokenize_1.FIELDS.TYPE] === tokens.openParenthesis || this.current.nodes.every(function(node) {
3215
+ return node.type === "comment";
3216
+ })) {
3217
+ this.spaces = this.optionalSpace(content);
3218
+ this.position++;
3219
+ } else if (this.position === this.tokens.length - 1 || this.nextToken[tokenize_1.FIELDS.TYPE] === tokens.comma || this.nextToken[tokenize_1.FIELDS.TYPE] === tokens.closeParenthesis) {
3220
+ this.current.last.spaces.after = this.optionalSpace(content);
3221
+ this.position++;
3222
+ } else this.combinator();
3223
+ };
3224
+ Parser.prototype.string = function() {
3225
+ var current = this.currToken;
3226
+ this.newNode(new string_1.default({
3227
+ value: this.content(),
3228
+ source: getTokenSource(current),
3229
+ sourceIndex: current[tokenize_1.FIELDS.START_POS]
3230
+ }));
3231
+ this.position++;
3232
+ };
3233
+ Parser.prototype.universal = function(namespace) {
3234
+ var nextToken = this.nextToken;
3235
+ if (nextToken && this.content(nextToken) === "|") {
3236
+ this.position++;
3237
+ return this.namespace();
3238
+ }
3239
+ var current = this.currToken;
3240
+ this.newNode(new universal_1.default({
3241
+ value: this.content(),
3242
+ source: getTokenSource(current),
3243
+ sourceIndex: current[tokenize_1.FIELDS.START_POS]
3244
+ }), namespace);
3245
+ this.position++;
3246
+ };
3247
+ Parser.prototype.splitWord = function(namespace, firstCallback) {
3248
+ var _this = this;
3249
+ var nextToken = this.nextToken;
3250
+ var word = this.content();
3251
+ while (nextToken && ~[
3252
+ tokens.dollar,
3253
+ tokens.caret,
3254
+ tokens.equals,
3255
+ tokens.word
3256
+ ].indexOf(nextToken[tokenize_1.FIELDS.TYPE])) {
3257
+ this.position++;
3258
+ var current = this.content();
3259
+ word += current;
3260
+ if (current.lastIndexOf("\\") === current.length - 1) {
3261
+ var next = this.nextToken;
3262
+ if (next && next[tokenize_1.FIELDS.TYPE] === tokens.space) {
3263
+ word += this.requiredSpace(this.content(next));
3264
+ this.position++;
3265
+ }
3266
+ }
3267
+ nextToken = this.nextToken;
3268
+ }
3269
+ var hasClass = indexesOf(word, ".").filter(function(i) {
3270
+ var escapedDot = word[i - 1] === "\\";
3271
+ var isKeyframesPercent = /^\d+\.\d+%$/.test(word);
3272
+ return !escapedDot && !isKeyframesPercent;
3273
+ });
3274
+ var hasId = indexesOf(word, "#").filter(function(i) {
3275
+ return word[i - 1] !== "\\";
3276
+ });
3277
+ var interpolations = indexesOf(word, "#{");
3278
+ if (interpolations.length) hasId = hasId.filter(function(hashIndex) {
3279
+ return !~interpolations.indexOf(hashIndex);
3280
+ });
3281
+ var indices = (0, sortAscending_1.default)(uniqs(__spreadArray(__spreadArray([0], __read(hasClass), false), __read(hasId), false)));
3282
+ indices.forEach(function(ind, i) {
3283
+ var index = indices[i + 1] || word.length;
3284
+ var value = word.slice(ind, index);
3285
+ if (i === 0 && firstCallback) return firstCallback.call(_this, value, indices.length);
3286
+ var node;
3287
+ var current = _this.currToken;
3288
+ var sourceIndex = current[tokenize_1.FIELDS.START_POS] + indices[i];
3289
+ var source = getSource(current[1], current[2] + ind, current[3], current[2] + (index - 1));
3290
+ if (~hasClass.indexOf(ind)) {
3291
+ var classNameOpts = {
3292
+ value: value.slice(1),
3293
+ source,
3294
+ sourceIndex
3295
+ };
3296
+ node = new className_1.default(unescapeProp(classNameOpts, "value"));
3297
+ } else if (~hasId.indexOf(ind)) {
3298
+ var idOpts = {
3299
+ value: value.slice(1),
3300
+ source,
3301
+ sourceIndex
3302
+ };
3303
+ node = new id_1.default(unescapeProp(idOpts, "value"));
3304
+ } else {
3305
+ var tagOpts = {
3306
+ value,
3307
+ source,
3308
+ sourceIndex
3309
+ };
3310
+ unescapeProp(tagOpts, "value");
3311
+ node = new tag_1.default(tagOpts);
3312
+ }
3313
+ _this.newNode(node, namespace);
3314
+ namespace = null;
3315
+ });
3316
+ this.position++;
3317
+ };
3318
+ Parser.prototype.word = function(namespace) {
3319
+ var nextToken = this.nextToken;
3320
+ if (nextToken && this.content(nextToken) === "|") {
3321
+ this.position++;
3322
+ return this.namespace();
3323
+ }
3324
+ return this.splitWord(namespace);
3325
+ };
3326
+ Parser.prototype.loop = function() {
3327
+ while (this.position < this.tokens.length) this.parse(true);
3328
+ this.current._inferEndPosition();
3329
+ return this.root;
3330
+ };
3331
+ Parser.prototype.parse = function(throwOnParenthesis) {
3332
+ switch (this.currToken[tokenize_1.FIELDS.TYPE]) {
3333
+ case tokens.space:
3334
+ this.space();
3335
+ break;
3336
+ case tokens.comment:
3337
+ this.comment();
3338
+ break;
3339
+ case tokens.openParenthesis:
3340
+ this.parentheses();
3341
+ break;
3342
+ case tokens.closeParenthesis:
3343
+ if (throwOnParenthesis) this.missingParenthesis();
3344
+ break;
3345
+ case tokens.openSquare:
3346
+ this.attribute();
3347
+ break;
3348
+ case tokens.dollar:
3349
+ case tokens.caret:
3350
+ case tokens.equals:
3351
+ case tokens.word:
3352
+ this.word();
3353
+ break;
3354
+ case tokens.colon:
3355
+ this.pseudo();
3356
+ break;
3357
+ case tokens.comma:
3358
+ this.comma();
3359
+ break;
3360
+ case tokens.asterisk:
3361
+ this.universal();
3362
+ break;
3363
+ case tokens.ampersand:
3364
+ this.nesting();
3365
+ break;
3366
+ case tokens.slash:
3367
+ case tokens.combinator:
3368
+ this.combinator();
3369
+ break;
3370
+ case tokens.str:
3371
+ this.string();
3372
+ break;
3373
+ case tokens.closeSquare: this.missingSquareBracket();
3374
+ case tokens.semicolon: this.missingBackslash();
3375
+ default: this.unexpected();
3376
+ }
3377
+ };
3378
+ /**
3379
+ * Helpers
3380
+ */
3381
+ Parser.prototype.expected = function(description, index, found) {
3382
+ if (Array.isArray(description)) {
3383
+ var last = description.pop();
3384
+ description = "".concat(description.join(", "), " or ").concat(last);
3385
+ }
3386
+ var an = /^[aeiou]/.test(description[0]) ? "an" : "a";
3387
+ if (!found) return this.error("Expected ".concat(an, " ").concat(description, "."), { index });
3388
+ return this.error("Expected ".concat(an, " ").concat(description, ", found \"").concat(found, "\" instead."), { index });
3389
+ };
3390
+ Parser.prototype.requiredSpace = function(space) {
3391
+ return this.options.lossy ? " " : space;
3392
+ };
3393
+ Parser.prototype.optionalSpace = function(space) {
3394
+ return this.options.lossy ? "" : space;
3395
+ };
3396
+ Parser.prototype.lossySpace = function(space, required) {
3397
+ if (this.options.lossy) return required ? " " : "";
3398
+ else return space;
3399
+ };
3400
+ Parser.prototype.parseParenthesisToken = function(token) {
3401
+ var content = this.content(token);
3402
+ if (token[tokenize_1.FIELDS.TYPE] === tokens.space) return this.requiredSpace(content);
3403
+ else return content;
3404
+ };
3405
+ Parser.prototype.newNode = function(node, namespace) {
3406
+ if (namespace) {
3407
+ if (/^ +$/.test(namespace)) {
3408
+ if (!this.options.lossy) this.spaces = (this.spaces || "") + namespace;
3409
+ namespace = true;
3410
+ }
3411
+ node.namespace = namespace;
3412
+ unescapeProp(node, "namespace");
3413
+ }
3414
+ if (this.spaces) {
3415
+ node.spaces.before = this.spaces;
3416
+ this.spaces = "";
3417
+ }
3418
+ return this.current.append(node);
3419
+ };
3420
+ Parser.prototype.content = function(token) {
3421
+ if (token === void 0) token = this.currToken;
3422
+ return this.css.slice(token[tokenize_1.FIELDS.START_POS], token[tokenize_1.FIELDS.END_POS]);
3423
+ };
3424
+ Object.defineProperty(Parser.prototype, "currToken", {
3425
+ get: function() {
3426
+ return this.tokens[this.position];
3427
+ },
3428
+ enumerable: false,
3429
+ configurable: true
3430
+ });
3431
+ Object.defineProperty(Parser.prototype, "nextToken", {
3432
+ get: function() {
3433
+ return this.tokens[this.position + 1];
3434
+ },
3435
+ enumerable: false,
3436
+ configurable: true
3437
+ });
3438
+ Object.defineProperty(Parser.prototype, "prevToken", {
3439
+ get: function() {
3440
+ return this.tokens[this.position - 1];
3441
+ },
3442
+ enumerable: false,
3443
+ configurable: true
3444
+ });
3445
+ /**
3446
+ * returns the index of the next non-whitespace, non-comment token.
3447
+ * returns -1 if no meaningful token is found.
3448
+ */
3449
+ Parser.prototype.locateNextMeaningfulToken = function(startPosition) {
3450
+ if (startPosition === void 0) startPosition = this.position + 1;
3451
+ var searchPosition = startPosition;
3452
+ while (searchPosition < this.tokens.length) if (WHITESPACE_EQUIV_TOKENS[this.tokens[searchPosition][tokenize_1.FIELDS.TYPE]]) {
3453
+ searchPosition++;
3454
+ continue;
3455
+ } else return searchPosition;
3456
+ return -1;
3457
+ };
3458
+ return Parser;
3459
+ }();
3460
+ }));
3461
+ //#endregion
3462
+ //#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.5/node_modules/postcss-selector-parser/dist/processor.js
3463
+ var require_processor = /* @__PURE__ */ __commonJSMin(((exports) => {
3464
+ var __importDefault = exports && exports.__importDefault || function(mod) {
3465
+ return mod && mod.__esModule ? mod : { "default": mod };
3466
+ };
3467
+ Object.defineProperty(exports, "__esModule", { value: true });
3468
+ var parser_1 = __importDefault(require_parser());
3469
+ exports.default = function() {
3470
+ function Processor(func, options) {
3471
+ this.func = func || function noop() {};
3472
+ this.funcRes = null;
3473
+ this.options = options;
3474
+ }
3475
+ Processor.prototype._shouldUpdateSelector = function(rule, options) {
3476
+ if (options === void 0) options = {};
3477
+ if (Object.assign({}, this.options, options).updateSelector === false) return false;
3478
+ else return typeof rule !== "string";
3479
+ };
3480
+ Processor.prototype._isLossy = function(options) {
3481
+ if (options === void 0) options = {};
3482
+ if (Object.assign({}, this.options, options).lossless === false) return true;
3483
+ else return false;
3484
+ };
3485
+ Processor.prototype._root = function(rule, options) {
3486
+ if (options === void 0) options = {};
3487
+ return new parser_1.default(rule, this._parseOptions(options)).root;
3488
+ };
3489
+ Processor.prototype._parseOptions = function(options) {
3490
+ var merged = Object.assign({}, this.options, options);
3491
+ return {
3492
+ lossy: this._isLossy(merged),
3493
+ maxNestingDepth: merged.maxNestingDepth
3494
+ };
3495
+ };
3496
+ Processor.prototype._stringifyOptions = function(options) {
3497
+ return { maxNestingDepth: Object.assign({}, this.options, options).maxNestingDepth };
3498
+ };
3499
+ Processor.prototype._run = function(rule, options) {
3500
+ var _this = this;
3501
+ if (options === void 0) options = {};
3502
+ return new Promise(function(resolve, reject) {
3503
+ try {
3504
+ var root_1 = _this._root(rule, options);
3505
+ Promise.resolve(_this.func(root_1)).then(function(transform) {
3506
+ var string = void 0;
3507
+ if (_this._shouldUpdateSelector(rule, options)) {
3508
+ string = root_1.toString(_this._stringifyOptions(options));
3509
+ rule.selector = string;
3510
+ }
3511
+ return {
3512
+ transform,
3513
+ root: root_1,
3514
+ string
3515
+ };
3516
+ }).then(resolve, reject);
3517
+ } catch (e) {
3518
+ reject(e);
3519
+ return;
3520
+ }
3521
+ });
3522
+ };
3523
+ Processor.prototype._runSync = function(rule, options) {
3524
+ if (options === void 0) options = {};
3525
+ var root = this._root(rule, options);
3526
+ var transform = this.func(root);
3527
+ if (transform && typeof transform.then === "function") throw new Error("Selector processor returned a promise to a synchronous call.");
3528
+ var string = void 0;
3529
+ if (options.updateSelector && typeof rule !== "string") {
3530
+ string = root.toString(this._stringifyOptions(options));
3531
+ rule.selector = string;
3532
+ }
3533
+ return {
3534
+ transform,
3535
+ root,
3536
+ string
3537
+ };
3538
+ };
3539
+ /**
3540
+ * Process rule into a selector AST.
3541
+ *
3542
+ * @param rule {postcss.Rule | string} The css selector to be processed
3543
+ * @param options The options for processing
3544
+ * @returns {Promise<parser.Root>} The AST of the selector after processing it.
3545
+ */
3546
+ Processor.prototype.ast = function(rule, options) {
3547
+ return this._run(rule, options).then(function(result) {
3548
+ return result.root;
3549
+ });
3550
+ };
3551
+ /**
3552
+ * Process rule into a selector AST synchronously.
3553
+ *
3554
+ * @param rule {postcss.Rule | string} The css selector to be processed
3555
+ * @param options The options for processing
3556
+ * @returns {parser.Root} The AST of the selector after processing it.
3557
+ */
3558
+ Processor.prototype.astSync = function(rule, options) {
3559
+ return this._runSync(rule, options).root;
3560
+ };
3561
+ /**
3562
+ * Process a selector into a transformed value asynchronously
3563
+ *
3564
+ * @param rule {postcss.Rule | string} The css selector to be processed
3565
+ * @param options The options for processing
3566
+ * @returns {Promise<any>} The value returned by the processor.
3567
+ */
3568
+ Processor.prototype.transform = function(rule, options) {
3569
+ return this._run(rule, options).then(function(result) {
3570
+ return result.transform;
3571
+ });
3572
+ };
3573
+ /**
3574
+ * Process a selector into a transformed value synchronously.
3575
+ *
3576
+ * @param rule {postcss.Rule | string} The css selector to be processed
3577
+ * @param options The options for processing
3578
+ * @returns {any} The value returned by the processor.
3579
+ */
3580
+ Processor.prototype.transformSync = function(rule, options) {
3581
+ return this._runSync(rule, options).transform;
3582
+ };
3583
+ /**
3584
+ * Process a selector into a new selector string asynchronously.
3585
+ *
3586
+ * @param rule {postcss.Rule | string} The css selector to be processed
3587
+ * @param options The options for processing
3588
+ * @returns {string} the selector after processing.
3589
+ */
3590
+ Processor.prototype.process = function(rule, options) {
3591
+ var _this = this;
3592
+ return this._run(rule, options).then(function(result) {
3593
+ return result.string || result.root.toString(_this._stringifyOptions(options));
3594
+ });
3595
+ };
3596
+ /**
3597
+ * Process a selector into a new selector string synchronously.
3598
+ *
3599
+ * @param rule {postcss.Rule | string} The css selector to be processed
3600
+ * @param options The options for processing
3601
+ * @returns {string} the selector after processing.
3602
+ */
3603
+ Processor.prototype.processSync = function(rule, options) {
3604
+ var result = this._runSync(rule, options);
3605
+ return result.string || result.root.toString(this._stringifyOptions(options));
3606
+ };
3607
+ return Processor;
3608
+ }();
3609
+ }));
3610
+ //#endregion
3611
+ //#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.5/node_modules/postcss-selector-parser/dist/selectors/constructors.js
3612
+ var require_constructors = /* @__PURE__ */ __commonJSMin(((exports) => {
3613
+ var __importDefault = exports && exports.__importDefault || function(mod) {
3614
+ return mod && mod.__esModule ? mod : { "default": mod };
3615
+ };
3616
+ Object.defineProperty(exports, "__esModule", { value: true });
3617
+ exports.universal = exports.tag = exports.string = exports.selector = exports.root = exports.pseudo = exports.nesting = exports.id = exports.comment = exports.combinator = exports.className = exports.attribute = void 0;
3618
+ var attribute_1 = __importDefault(require_attribute());
3619
+ var className_1 = __importDefault(require_className());
3620
+ var combinator_1 = __importDefault(require_combinator());
3621
+ var comment_1 = __importDefault(require_comment());
3622
+ var id_1 = __importDefault(require_id());
3623
+ var nesting_1 = __importDefault(require_nesting());
3624
+ var pseudo_1 = __importDefault(require_pseudo());
3625
+ var root_1 = __importDefault(require_root());
3626
+ var selector_1 = __importDefault(require_selector());
3627
+ var string_1 = __importDefault(require_string());
3628
+ var tag_1 = __importDefault(require_tag());
3629
+ var universal_1 = __importDefault(require_universal());
3630
+ var attribute = function(opts) {
3631
+ return new attribute_1.default(opts);
3632
+ };
3633
+ exports.attribute = attribute;
3634
+ var className = function(opts) {
3635
+ return new className_1.default(opts);
3636
+ };
3637
+ exports.className = className;
3638
+ var combinator = function(opts) {
3639
+ return new combinator_1.default(opts);
3640
+ };
3641
+ exports.combinator = combinator;
3642
+ var comment = function(opts) {
3643
+ return new comment_1.default(opts);
3644
+ };
3645
+ exports.comment = comment;
3646
+ var id = function(opts) {
3647
+ return new id_1.default(opts);
3648
+ };
3649
+ exports.id = id;
3650
+ var nesting = function(opts) {
3651
+ return new nesting_1.default(opts);
3652
+ };
3653
+ exports.nesting = nesting;
3654
+ var pseudo = function(opts) {
3655
+ return new pseudo_1.default(opts);
3656
+ };
3657
+ exports.pseudo = pseudo;
3658
+ var root = function(opts) {
3659
+ return new root_1.default(opts);
3660
+ };
3661
+ exports.root = root;
3662
+ var selector = function(opts) {
3663
+ return new selector_1.default(opts);
3664
+ };
3665
+ exports.selector = selector;
3666
+ var string = function(opts) {
3667
+ return new string_1.default(opts);
3668
+ };
3669
+ exports.string = string;
3670
+ var tag = function(opts) {
3671
+ return new tag_1.default(opts);
3672
+ };
3673
+ exports.tag = tag;
3674
+ var universal = function(opts) {
3675
+ return new universal_1.default(opts);
3676
+ };
3677
+ exports.universal = universal;
3678
+ }));
3679
+ //#endregion
3680
+ //#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.5/node_modules/postcss-selector-parser/dist/selectors/guards.js
3681
+ var require_guards = /* @__PURE__ */ __commonJSMin(((exports) => {
3682
+ var _a;
3683
+ Object.defineProperty(exports, "__esModule", { value: true });
3684
+ exports.isUniversal = exports.isTag = exports.isString = exports.isSelector = exports.isRoot = exports.isPseudo = exports.isNesting = exports.isIdentifier = exports.isComment = exports.isCombinator = exports.isClassName = exports.isAttribute = void 0;
3685
+ exports.isNode = isNode;
3686
+ exports.isPseudoElement = isPseudoElement;
3687
+ exports.isPseudoClass = isPseudoClass;
3688
+ exports.isContainer = isContainer;
3689
+ exports.isNamespace = isNamespace;
3690
+ var types_1 = require_types();
3691
+ var IS_TYPE = (_a = {}, _a[types_1.ATTRIBUTE] = true, _a[types_1.CLASS] = true, _a[types_1.COMBINATOR] = true, _a[types_1.COMMENT] = true, _a[types_1.ID] = true, _a[types_1.NESTING] = true, _a[types_1.PSEUDO] = true, _a[types_1.ROOT] = true, _a[types_1.SELECTOR] = true, _a[types_1.STRING] = true, _a[types_1.TAG] = true, _a[types_1.UNIVERSAL] = true, _a);
3692
+ function isNode(node) {
3693
+ return typeof node === "object" && IS_TYPE[node.type];
3694
+ }
3695
+ function isNodeType(type, node) {
3696
+ return isNode(node) && node.type === type;
3697
+ }
3698
+ exports.isAttribute = isNodeType.bind(null, types_1.ATTRIBUTE);
3699
+ exports.isClassName = isNodeType.bind(null, types_1.CLASS);
3700
+ exports.isCombinator = isNodeType.bind(null, types_1.COMBINATOR);
3701
+ exports.isComment = isNodeType.bind(null, types_1.COMMENT);
3702
+ exports.isIdentifier = isNodeType.bind(null, types_1.ID);
3703
+ exports.isNesting = isNodeType.bind(null, types_1.NESTING);
3704
+ exports.isPseudo = isNodeType.bind(null, types_1.PSEUDO);
3705
+ exports.isRoot = isNodeType.bind(null, types_1.ROOT);
3706
+ exports.isSelector = isNodeType.bind(null, types_1.SELECTOR);
3707
+ exports.isString = isNodeType.bind(null, types_1.STRING);
3708
+ exports.isTag = isNodeType.bind(null, types_1.TAG);
3709
+ exports.isUniversal = isNodeType.bind(null, types_1.UNIVERSAL);
3710
+ function isPseudoElement(node) {
3711
+ return (0, exports.isPseudo)(node) && node.value && (node.value.startsWith("::") || node.value.toLowerCase() === ":before" || node.value.toLowerCase() === ":after" || node.value.toLowerCase() === ":first-letter" || node.value.toLowerCase() === ":first-line");
3712
+ }
3713
+ function isPseudoClass(node) {
3714
+ return (0, exports.isPseudo)(node) && !isPseudoElement(node);
3715
+ }
3716
+ function isContainer(node) {
3717
+ return !!(isNode(node) && node.walk);
3718
+ }
3719
+ function isNamespace(node) {
3720
+ return (0, exports.isAttribute)(node) || (0, exports.isTag)(node);
3721
+ }
3722
+ }));
3723
+ //#endregion
3724
+ //#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.5/node_modules/postcss-selector-parser/dist/selectors/index.js
3725
+ var require_selectors = /* @__PURE__ */ __commonJSMin(((exports) => {
3726
+ var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
3727
+ if (k2 === void 0) k2 = k;
3728
+ var desc = Object.getOwnPropertyDescriptor(m, k);
3729
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
3730
+ enumerable: true,
3731
+ get: function() {
3732
+ return m[k];
3733
+ }
3734
+ };
3735
+ Object.defineProperty(o, k2, desc);
3736
+ }) : (function(o, m, k, k2) {
3737
+ if (k2 === void 0) k2 = k;
3738
+ o[k2] = m[k];
3739
+ }));
3740
+ var __exportStar = exports && exports.__exportStar || function(m, exports$1) {
3741
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$1, p)) __createBinding(exports$1, m, p);
3742
+ };
3743
+ Object.defineProperty(exports, "__esModule", { value: true });
3744
+ __exportStar(require_types(), exports);
3745
+ __exportStar(require_constructors(), exports);
3746
+ __exportStar(require_guards(), exports);
3747
+ }));
3748
+ //#endregion
3749
+ //#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.5/node_modules/postcss-selector-parser/dist/index.js
3750
+ var require_dist = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3751
+ var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
3752
+ if (k2 === void 0) k2 = k;
3753
+ var desc = Object.getOwnPropertyDescriptor(m, k);
3754
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
3755
+ enumerable: true,
3756
+ get: function() {
3757
+ return m[k];
3758
+ }
3759
+ };
3760
+ Object.defineProperty(o, k2, desc);
3761
+ }) : (function(o, m, k, k2) {
3762
+ if (k2 === void 0) k2 = k;
3763
+ o[k2] = m[k];
3764
+ }));
3765
+ var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
3766
+ Object.defineProperty(o, "default", {
3767
+ enumerable: true,
3768
+ value: v
3769
+ });
3770
+ }) : function(o, v) {
3771
+ o["default"] = v;
3772
+ });
3773
+ var __importStar = exports && exports.__importStar || (function() {
3774
+ var ownKeys = function(o) {
3775
+ ownKeys = Object.getOwnPropertyNames || function(o) {
3776
+ var ar = [];
3777
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
3778
+ return ar;
3779
+ };
3780
+ return ownKeys(o);
3781
+ };
3782
+ return function(mod) {
3783
+ if (mod && mod.__esModule) return mod;
3784
+ var result = {};
3785
+ if (mod != null) {
3786
+ for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
3787
+ }
3788
+ __setModuleDefault(result, mod);
3789
+ return result;
3790
+ };
3791
+ })();
3792
+ var processor_1 = (exports && exports.__importDefault || function(mod) {
3793
+ return mod && mod.__esModule ? mod : { "default": mod };
3794
+ })(require_processor());
3795
+ var selectors = __importStar(require_selectors());
3796
+ var parser = function(processor) {
3797
+ return new processor_1.default(processor);
3798
+ };
3799
+ Object.assign(parser, selectors);
3800
+ delete parser.__esModule;
3801
+ module.exports = parser;
3802
+ }));
3803
+ //#endregion
3804
+ //#region src/typography/index.ts
3805
+ var import_deepmerge = require_deepmerge();
3806
+ var import_dist = /* @__PURE__ */ __toESM(require_dist(), 1);
3807
+ function inWhere(selector, { className, prefix, modifier }) {
3808
+ const prefixedNot = prefix(`.not-${className}`).slice(1);
3809
+ const selectorPrefix = selector.startsWith(">") ? `${modifier === "DEFAULT" ? `.${className}` : `.${className}-${modifier}`} ` : "";
3810
+ const [trailingPseudo, rebuiltSelector] = commonTrailingPseudos(selector);
3811
+ if (trailingPseudo) return `:where(${selectorPrefix}${rebuiltSelector}):not(:where([class~="${prefixedNot}"],[class~="${prefixedNot}"] *))${trailingPseudo}`;
3812
+ return `:where(${selectorPrefix}${selector}):not(:where([class~="${prefixedNot}"],[class~="${prefixedNot}"] *))`;
3813
+ }
3814
+ function configToCss(config = {}, { className, modifier, prefix }) {
3815
+ function updateSelector(k, v) {
3816
+ if (Array.isArray(v)) return [k, v];
3817
+ if (typeof v === "object" && v !== null) {
3818
+ if (Object.values(v).some((prop) => typeof prop === "object")) return [
3819
+ inWhere(k, {
3820
+ className,
3821
+ modifier,
3822
+ prefix
3823
+ }),
3824
+ v,
3825
+ Object.fromEntries(Object.entries(v).map(([k, v]) => updateSelector(k, v)))
3826
+ ];
3827
+ return [inWhere(k, {
3828
+ className,
3829
+ modifier,
3830
+ prefix
3831
+ }), v];
3832
+ }
3833
+ return [k, v];
3834
+ }
3835
+ const css = config.css ?? [];
3836
+ const mergedCss = Array.isArray(css) ? dm(...css) : css;
3837
+ return Object.fromEntries(Object.entries(mergedCss).map(([k, v]) => updateSelector(k, v)));
3838
+ }
3839
+ const dm = (0, import_deepmerge.deepmerge)({ all: true });
3840
+ const parseSelector = (0, import_dist.default)();
3841
+ function commonTrailingPseudos(selector) {
3842
+ const ast = parseSelector.astSync(selector);
3843
+ const matrix = [];
3844
+ for (const [i, sel] of ast.nodes.entries()) for (const [j, child] of [...sel.nodes].reverse().entries()) {
3845
+ if (child.type !== "pseudo" || !child.value.startsWith("::")) break;
3846
+ matrix[j] = matrix[j] || [];
3847
+ matrix[j][i] = child;
3848
+ }
3849
+ const trailingPseudos = import_dist.default.selector({ value: "" });
3850
+ for (const pseudos of matrix) {
3851
+ if (!pseudos) continue;
3852
+ if (new Set(pseudos.map((p) => p.value)).size > 1) break;
3853
+ pseudos.forEach((pseudo) => pseudo.remove());
3854
+ trailingPseudos.prepend(pseudos[0]);
3855
+ }
3856
+ if (trailingPseudos.nodes.length) return [trailingPseudos.toString(), ast.toString()];
3857
+ return [null, selector];
3858
+ }
3859
+ const SELECTORS = [
3860
+ [
3861
+ "headings",
3862
+ "h1",
3863
+ "h2",
3864
+ "h3",
3865
+ "h4",
3866
+ "h5",
3867
+ "h6",
3868
+ "th"
3869
+ ],
3870
+ ["h1"],
3871
+ ["h2"],
3872
+ ["h3"],
3873
+ ["h4"],
3874
+ ["h5"],
3875
+ ["h6"],
3876
+ ["p"],
3877
+ ["a"],
3878
+ ["blockquote"],
3879
+ ["figure"],
3880
+ ["figcaption"],
3881
+ ["strong"],
3882
+ ["em"],
3883
+ ["kbd"],
3884
+ ["code"],
3885
+ ["pre"],
3886
+ ["ol"],
3887
+ ["ul"],
3888
+ ["li"],
3889
+ ["table"],
3890
+ ["thead"],
3891
+ ["tr"],
3892
+ ["th"],
3893
+ ["td"],
3894
+ ["img"],
3895
+ ["video"],
3896
+ ["hr"],
3897
+ ["lead", "[class~=\"lead\"]"]
3898
+ ];
3899
+ const typography = plugin.withOptions(({ className = "prose", ...styleOptions } = {}) => {
3900
+ return ({ addVariant, addComponents, ...rest }) => {
3901
+ const prefix = rest.prefix;
3902
+ for (const [name, ...values] of SELECTORS) {
3903
+ const selector = (values.length === 0 ? [name] : values).join(", ");
3904
+ addVariant(`${className}-${name}`, `& :is(${inWhere(selector, {
3905
+ prefix,
3906
+ className
3907
+ })})`);
3908
+ }
3909
+ addComponents({
3910
+ [`.${className}`]: configToCss({
3911
+ ...DEFAULT,
3912
+ css: [...DEFAULT.css ?? [], styleOptions.disableRoundedTable ? normalTable : roundedTable]
3913
+ }, {
3914
+ className,
3915
+ modifier: "DEFAULT",
3916
+ prefix
3917
+ }),
3918
+ [`.${className}-sm`]: configToCss(SMALL, {
3919
+ className,
3920
+ modifier: "sm",
3921
+ prefix
3922
+ })
3923
+ });
3924
+ };
3925
+ });
3926
+ //#endregion
3927
+ export { typography as default, typography };