@analogjs/content 3.0.0-alpha.1 → 3.0.0-alpha.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/LICENSE +21 -0
  2. package/fesm2022/__vite-browser-external.mjs +9 -0
  3. package/fesm2022/analogjs-content-md4x.mjs +290 -0
  4. package/fesm2022/analogjs-content-mdc.mjs +170 -0
  5. package/fesm2022/analogjs-content-og.mjs +34 -46
  6. package/fesm2022/analogjs-content-prism-highlighter.mjs +81 -68
  7. package/fesm2022/analogjs-content-resources.mjs +115 -124
  8. package/fesm2022/analogjs-content-shiki-highlighter.mjs +9 -14
  9. package/fesm2022/analogjs-content.mjs +18538 -621
  10. package/fesm2022/api_vite.mjs +7 -0
  11. package/fesm2022/browser.mjs +6069 -0
  12. package/fesm2022/build2.mjs +5259 -0
  13. package/fesm2022/chunk.mjs +37 -0
  14. package/fesm2022/chunk2.mjs +41 -0
  15. package/fesm2022/jiti.mjs +4477 -0
  16. package/fesm2022/lib.mjs +365 -0
  17. package/fesm2022/main.mjs +2341 -0
  18. package/fesm2022/node.mjs +791 -0
  19. package/fesm2022/postcss-import.mjs +451 -0
  20. package/fesm2022/postcss.mjs +3236 -0
  21. package/fesm2022/prompt-BYQIwEjg.mjs +847 -0
  22. package/md4x/package.json +4 -0
  23. package/mdc/package.json +4 -0
  24. package/og/package.json +2 -2
  25. package/package.json +35 -9
  26. package/prism-highlighter/package.json +2 -2
  27. package/resources/package.json +2 -2
  28. package/shiki-highlighter/package.json +2 -2
  29. package/src/lib/devtools/content-devtools-client.ts +215 -0
  30. package/src/lib/devtools/content-devtools.styles.css +194 -0
  31. package/types/md4x/src/index.d.ts +5 -0
  32. package/types/md4x/src/lib/md4x-content-renderer.service.d.ts +33 -0
  33. package/types/md4x/src/lib/md4x-wasm-content-renderer.service.d.ts +16 -0
  34. package/types/md4x/src/lib/provide-md4x.d.ts +26 -0
  35. package/types/md4x/src/lib/streaming-markdown-renderer.d.ts +21 -0
  36. package/types/mdc/src/index.d.ts +2 -0
  37. package/types/mdc/src/lib/mdc-component-registry.d.ts +25 -0
  38. package/types/mdc/src/lib/mdc-renderer.directive.d.ts +33 -0
  39. package/types/og/src/index.d.ts +2 -0
  40. package/types/og/src/lib/og.d.ts +5 -0
  41. package/types/og/src/lib/options.d.ts +11 -0
  42. package/types/prism-highlighter/src/index.d.ts +8 -0
  43. package/types/prism-highlighter/src/lib/prism/angular.d.ts +1 -0
  44. package/types/prism-highlighter/src/lib/prism-highlighter.d.ts +8 -0
  45. package/types/resources/src/content-file-resource.d.ts +37 -0
  46. package/types/resources/src/content-files-resource.d.ts +3 -0
  47. package/types/resources/src/index.d.ts +2 -0
  48. package/types/shiki-highlighter/src/index.d.ts +7 -0
  49. package/types/src/index.d.ts +18 -0
  50. package/types/src/lib/anchor-navigation.directive.d.ts +9 -0
  51. package/types/src/lib/content-file-loader.d.ts +6 -0
  52. package/types/src/lib/content-file.d.ts +8 -0
  53. package/types/src/lib/content-files-list-token.d.ts +3 -0
  54. package/types/src/lib/content-files-token.d.ts +3 -0
  55. package/types/src/lib/content-list-loader.d.ts +7 -0
  56. package/types/src/lib/content-renderer.d.ts +33 -0
  57. package/types/src/lib/content.d.ts +14 -0
  58. package/types/src/lib/devtools/content-devtools-plugin.d.ts +23 -0
  59. package/types/src/lib/devtools/content-devtools-renderer.d.ts +23 -0
  60. package/types/src/lib/devtools/index.d.ts +23 -0
  61. package/types/src/lib/get-content-files.d.ts +14 -0
  62. package/types/src/lib/inject-content-files.d.ts +4 -0
  63. package/types/src/lib/markdown-content-renderer.service.d.ts +10 -0
  64. package/types/src/lib/markdown-route.component.d.ts +15 -0
  65. package/types/src/lib/markdown.component.d.ts +26 -0
  66. package/types/src/lib/marked-content-highlighter.d.ts +17 -0
  67. package/types/src/lib/marked-setup.service.d.ts +10 -0
  68. package/types/src/lib/parse-raw-content-file.d.ts +18 -0
  69. package/types/src/lib/provide-content.d.ts +7 -0
  70. package/types/src/lib/render-task.service.d.ts +8 -0
  71. package/types/src/lib/utils/zone-wait-for.d.ts +2 -0
  72. package/fesm2022/analogjs-content-og.mjs.map +0 -1
  73. package/fesm2022/analogjs-content-prism-highlighter.mjs.map +0 -1
  74. package/fesm2022/analogjs-content-resources.mjs.map +0 -1
  75. package/fesm2022/analogjs-content-shiki-highlighter.mjs.map +0 -1
  76. package/fesm2022/analogjs-content.mjs.map +0 -1
  77. package/og/README.md +0 -3
  78. package/plugin/README.md +0 -11
  79. package/plugin/migrations.json +0 -75
  80. package/plugin/package.json +0 -23
  81. package/plugin/src/index.d.ts +0 -2
  82. package/plugin/src/index.js +0 -4
  83. package/plugin/src/index.js.map +0 -1
  84. package/plugin/src/migrations/update-markdown-renderer-feature/compat.d.ts +0 -2
  85. package/plugin/src/migrations/update-markdown-renderer-feature/compat.js +0 -6
  86. package/plugin/src/migrations/update-markdown-renderer-feature/compat.js.map +0 -1
  87. package/plugin/src/migrations/update-markdown-renderer-feature/update-markdown-renderer-feature.d.ts +0 -2
  88. package/plugin/src/migrations/update-markdown-renderer-feature/update-markdown-renderer-feature.js +0 -48
  89. package/plugin/src/migrations/update-markdown-renderer-feature/update-markdown-renderer-feature.js.map +0 -1
  90. package/plugin/src/migrations/update-markdown-version/compat.d.ts +0 -2
  91. package/plugin/src/migrations/update-markdown-version/compat.js +0 -6
  92. package/plugin/src/migrations/update-markdown-version/compat.js.map +0 -1
  93. package/plugin/src/migrations/update-markdown-version/update-markdown-version.d.ts +0 -2
  94. package/plugin/src/migrations/update-markdown-version/update-markdown-version.js +0 -23
  95. package/plugin/src/migrations/update-markdown-version/update-markdown-version.js.map +0 -1
  96. package/prism-highlighter/README.md +0 -3
  97. package/resources/README.md +0 -3
  98. package/shiki-highlighter/README.md +0 -3
  99. package/types/analogjs-content-og.d.ts +0 -19
  100. package/types/analogjs-content-prism-highlighter.d.ts +0 -15
  101. package/types/analogjs-content-resources.d.ts +0 -20
  102. package/types/analogjs-content-shiki-highlighter.d.ts +0 -11
  103. package/types/analogjs-content.d.ts +0 -168
@@ -0,0 +1,3236 @@
1
+ import { i as __toESM, t as __commonJSMin } from "./chunk.mjs";
2
+ import { t as require___vite_browser_external } from "./__vite-browser-external.mjs";
3
+ //#region node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.browser.js
4
+ var require_picocolors_browser = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5
+ var x = String;
6
+ var create = function() {
7
+ return {
8
+ isColorSupported: false,
9
+ reset: x,
10
+ bold: x,
11
+ dim: x,
12
+ italic: x,
13
+ underline: x,
14
+ inverse: x,
15
+ hidden: x,
16
+ strikethrough: x,
17
+ black: x,
18
+ red: x,
19
+ green: x,
20
+ yellow: x,
21
+ blue: x,
22
+ magenta: x,
23
+ cyan: x,
24
+ white: x,
25
+ gray: x,
26
+ bgBlack: x,
27
+ bgRed: x,
28
+ bgGreen: x,
29
+ bgYellow: x,
30
+ bgBlue: x,
31
+ bgMagenta: x,
32
+ bgCyan: x,
33
+ bgWhite: x,
34
+ blackBright: x,
35
+ redBright: x,
36
+ greenBright: x,
37
+ yellowBright: x,
38
+ blueBright: x,
39
+ magentaBright: x,
40
+ cyanBright: x,
41
+ whiteBright: x,
42
+ bgBlackBright: x,
43
+ bgRedBright: x,
44
+ bgGreenBright: x,
45
+ bgYellowBright: x,
46
+ bgBlueBright: x,
47
+ bgMagentaBright: x,
48
+ bgCyanBright: x,
49
+ bgWhiteBright: x
50
+ };
51
+ };
52
+ module.exports = create();
53
+ module.exports.createColors = create;
54
+ }));
55
+ //#endregion
56
+ //#region node_modules/.pnpm/postcss@8.5.8/node_modules/postcss/lib/css-syntax-error.js
57
+ var require_css_syntax_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
58
+ var pico = require_picocolors_browser();
59
+ var terminalHighlight = require___vite_browser_external();
60
+ var CssSyntaxError = class CssSyntaxError extends Error {
61
+ constructor(message, line, column, source, file, plugin) {
62
+ super(message);
63
+ this.name = "CssSyntaxError";
64
+ this.reason = message;
65
+ if (file) this.file = file;
66
+ if (source) this.source = source;
67
+ if (plugin) this.plugin = plugin;
68
+ if (typeof line !== "undefined" && typeof column !== "undefined") if (typeof line === "number") {
69
+ this.line = line;
70
+ this.column = column;
71
+ } else {
72
+ this.line = line.line;
73
+ this.column = line.column;
74
+ this.endLine = column.line;
75
+ this.endColumn = column.column;
76
+ }
77
+ this.setMessage();
78
+ if (Error.captureStackTrace) Error.captureStackTrace(this, CssSyntaxError);
79
+ }
80
+ setMessage() {
81
+ this.message = this.plugin ? this.plugin + ": " : "";
82
+ this.message += this.file ? this.file : "<css input>";
83
+ if (typeof this.line !== "undefined") this.message += ":" + this.line + ":" + this.column;
84
+ this.message += ": " + this.reason;
85
+ }
86
+ showSourceCode(color) {
87
+ if (!this.source) return "";
88
+ let css = this.source;
89
+ if (color == null) color = pico.isColorSupported;
90
+ let aside = (text) => text;
91
+ let mark = (text) => text;
92
+ let highlight = (text) => text;
93
+ if (color) {
94
+ let { bold, gray, red } = pico.createColors(true);
95
+ mark = (text) => bold(red(text));
96
+ aside = (text) => gray(text);
97
+ if (terminalHighlight) highlight = (text) => terminalHighlight(text);
98
+ }
99
+ let lines = css.split(/\r?\n/);
100
+ let start = Math.max(this.line - 3, 0);
101
+ let end = Math.min(this.line + 2, lines.length);
102
+ let maxWidth = String(end).length;
103
+ return lines.slice(start, end).map((line, index) => {
104
+ let number = start + 1 + index;
105
+ let gutter = " " + (" " + number).slice(-maxWidth) + " | ";
106
+ if (number === this.line) {
107
+ if (line.length > 160) {
108
+ let padding = 20;
109
+ let subLineStart = Math.max(0, this.column - padding);
110
+ let subLineEnd = Math.max(this.column + padding, this.endColumn + padding);
111
+ let subLine = line.slice(subLineStart, subLineEnd);
112
+ let spacing = aside(gutter.replace(/\d/g, " ")) + line.slice(0, Math.min(this.column - 1, padding - 1)).replace(/[^\t]/g, " ");
113
+ return mark(">") + aside(gutter) + highlight(subLine) + "\n " + spacing + mark("^");
114
+ }
115
+ let spacing = aside(gutter.replace(/\d/g, " ")) + line.slice(0, this.column - 1).replace(/[^\t]/g, " ");
116
+ return mark(">") + aside(gutter) + highlight(line) + "\n " + spacing + mark("^");
117
+ }
118
+ return " " + aside(gutter) + highlight(line);
119
+ }).join("\n");
120
+ }
121
+ toString() {
122
+ let code = this.showSourceCode();
123
+ if (code) code = "\n\n" + code + "\n";
124
+ return this.name + ": " + this.message + code;
125
+ }
126
+ };
127
+ module.exports = CssSyntaxError;
128
+ CssSyntaxError.default = CssSyntaxError;
129
+ }));
130
+ //#endregion
131
+ //#region node_modules/.pnpm/postcss@8.5.8/node_modules/postcss/lib/stringifier.js
132
+ var require_stringifier = /* @__PURE__ */ __commonJSMin(((exports, module) => {
133
+ var DEFAULT_RAW = {
134
+ after: "\n",
135
+ beforeClose: "\n",
136
+ beforeComment: "\n",
137
+ beforeDecl: "\n",
138
+ beforeOpen: " ",
139
+ beforeRule: "\n",
140
+ colon: ": ",
141
+ commentLeft: " ",
142
+ commentRight: " ",
143
+ emptyBody: "",
144
+ indent: " ",
145
+ semicolon: false
146
+ };
147
+ function capitalize(str) {
148
+ return str[0].toUpperCase() + str.slice(1);
149
+ }
150
+ var Stringifier = class {
151
+ constructor(builder) {
152
+ this.builder = builder;
153
+ }
154
+ atrule(node, semicolon) {
155
+ let name = "@" + node.name;
156
+ let params = node.params ? this.rawValue(node, "params") : "";
157
+ if (typeof node.raws.afterName !== "undefined") name += node.raws.afterName;
158
+ else if (params) name += " ";
159
+ if (node.nodes) this.block(node, name + params);
160
+ else {
161
+ let end = (node.raws.between || "") + (semicolon ? ";" : "");
162
+ this.builder(name + params + end, node);
163
+ }
164
+ }
165
+ beforeAfter(node, detect) {
166
+ let value;
167
+ if (node.type === "decl") value = this.raw(node, null, "beforeDecl");
168
+ else if (node.type === "comment") value = this.raw(node, null, "beforeComment");
169
+ else if (detect === "before") value = this.raw(node, null, "beforeRule");
170
+ else value = this.raw(node, null, "beforeClose");
171
+ let buf = node.parent;
172
+ let depth = 0;
173
+ while (buf && buf.type !== "root") {
174
+ depth += 1;
175
+ buf = buf.parent;
176
+ }
177
+ if (value.includes("\n")) {
178
+ let indent = this.raw(node, null, "indent");
179
+ if (indent.length) for (let step = 0; step < depth; step++) value += indent;
180
+ }
181
+ return value;
182
+ }
183
+ block(node, start) {
184
+ let between = this.raw(node, "between", "beforeOpen");
185
+ this.builder(start + between + "{", node, "start");
186
+ let after;
187
+ if (node.nodes && node.nodes.length) {
188
+ this.body(node);
189
+ after = this.raw(node, "after");
190
+ } else after = this.raw(node, "after", "emptyBody");
191
+ if (after) this.builder(after);
192
+ this.builder("}", node, "end");
193
+ }
194
+ body(node) {
195
+ let last = node.nodes.length - 1;
196
+ while (last > 0) {
197
+ if (node.nodes[last].type !== "comment") break;
198
+ last -= 1;
199
+ }
200
+ let semicolon = this.raw(node, "semicolon");
201
+ for (let i = 0; i < node.nodes.length; i++) {
202
+ let child = node.nodes[i];
203
+ let before = this.raw(child, "before");
204
+ if (before) this.builder(before);
205
+ this.stringify(child, last !== i || semicolon);
206
+ }
207
+ }
208
+ comment(node) {
209
+ let left = this.raw(node, "left", "commentLeft");
210
+ let right = this.raw(node, "right", "commentRight");
211
+ this.builder("/*" + left + node.text + right + "*/", node);
212
+ }
213
+ decl(node, semicolon) {
214
+ let between = this.raw(node, "between", "colon");
215
+ let string = node.prop + between + this.rawValue(node, "value");
216
+ if (node.important) string += node.raws.important || " !important";
217
+ if (semicolon) string += ";";
218
+ this.builder(string, node);
219
+ }
220
+ document(node) {
221
+ this.body(node);
222
+ }
223
+ raw(node, own, detect) {
224
+ let value;
225
+ if (!detect) detect = own;
226
+ if (own) {
227
+ value = node.raws[own];
228
+ if (typeof value !== "undefined") return value;
229
+ }
230
+ let parent = node.parent;
231
+ if (detect === "before") {
232
+ if (!parent || parent.type === "root" && parent.first === node) return "";
233
+ if (parent && parent.type === "document") return "";
234
+ }
235
+ if (!parent) return DEFAULT_RAW[detect];
236
+ let root = node.root();
237
+ if (!root.rawCache) root.rawCache = {};
238
+ if (typeof root.rawCache[detect] !== "undefined") return root.rawCache[detect];
239
+ if (detect === "before" || detect === "after") return this.beforeAfter(node, detect);
240
+ else {
241
+ let method = "raw" + capitalize(detect);
242
+ if (this[method]) value = this[method](root, node);
243
+ else root.walk((i) => {
244
+ value = i.raws[own];
245
+ if (typeof value !== "undefined") return false;
246
+ });
247
+ }
248
+ if (typeof value === "undefined") value = DEFAULT_RAW[detect];
249
+ root.rawCache[detect] = value;
250
+ return value;
251
+ }
252
+ rawBeforeClose(root) {
253
+ let value;
254
+ root.walk((i) => {
255
+ if (i.nodes && i.nodes.length > 0) {
256
+ if (typeof i.raws.after !== "undefined") {
257
+ value = i.raws.after;
258
+ if (value.includes("\n")) value = value.replace(/[^\n]+$/, "");
259
+ return false;
260
+ }
261
+ }
262
+ });
263
+ if (value) value = value.replace(/\S/g, "");
264
+ return value;
265
+ }
266
+ rawBeforeComment(root, node) {
267
+ let value;
268
+ root.walkComments((i) => {
269
+ if (typeof i.raws.before !== "undefined") {
270
+ value = i.raws.before;
271
+ if (value.includes("\n")) value = value.replace(/[^\n]+$/, "");
272
+ return false;
273
+ }
274
+ });
275
+ if (typeof value === "undefined") value = this.raw(node, null, "beforeDecl");
276
+ else if (value) value = value.replace(/\S/g, "");
277
+ return value;
278
+ }
279
+ rawBeforeDecl(root, node) {
280
+ let value;
281
+ root.walkDecls((i) => {
282
+ if (typeof i.raws.before !== "undefined") {
283
+ value = i.raws.before;
284
+ if (value.includes("\n")) value = value.replace(/[^\n]+$/, "");
285
+ return false;
286
+ }
287
+ });
288
+ if (typeof value === "undefined") value = this.raw(node, null, "beforeRule");
289
+ else if (value) value = value.replace(/\S/g, "");
290
+ return value;
291
+ }
292
+ rawBeforeOpen(root) {
293
+ let value;
294
+ root.walk((i) => {
295
+ if (i.type !== "decl") {
296
+ value = i.raws.between;
297
+ if (typeof value !== "undefined") return false;
298
+ }
299
+ });
300
+ return value;
301
+ }
302
+ rawBeforeRule(root) {
303
+ let value;
304
+ root.walk((i) => {
305
+ if (i.nodes && (i.parent !== root || root.first !== i)) {
306
+ if (typeof i.raws.before !== "undefined") {
307
+ value = i.raws.before;
308
+ if (value.includes("\n")) value = value.replace(/[^\n]+$/, "");
309
+ return false;
310
+ }
311
+ }
312
+ });
313
+ if (value) value = value.replace(/\S/g, "");
314
+ return value;
315
+ }
316
+ rawColon(root) {
317
+ let value;
318
+ root.walkDecls((i) => {
319
+ if (typeof i.raws.between !== "undefined") {
320
+ value = i.raws.between.replace(/[^\s:]/g, "");
321
+ return false;
322
+ }
323
+ });
324
+ return value;
325
+ }
326
+ rawEmptyBody(root) {
327
+ let value;
328
+ root.walk((i) => {
329
+ if (i.nodes && i.nodes.length === 0) {
330
+ value = i.raws.after;
331
+ if (typeof value !== "undefined") return false;
332
+ }
333
+ });
334
+ return value;
335
+ }
336
+ rawIndent(root) {
337
+ if (root.raws.indent) return root.raws.indent;
338
+ let value;
339
+ root.walk((i) => {
340
+ let p = i.parent;
341
+ if (p && p !== root && p.parent && p.parent === root) {
342
+ if (typeof i.raws.before !== "undefined") {
343
+ let parts = i.raws.before.split("\n");
344
+ value = parts[parts.length - 1];
345
+ value = value.replace(/\S/g, "");
346
+ return false;
347
+ }
348
+ }
349
+ });
350
+ return value;
351
+ }
352
+ rawSemicolon(root) {
353
+ let value;
354
+ root.walk((i) => {
355
+ if (i.nodes && i.nodes.length && i.last.type === "decl") {
356
+ value = i.raws.semicolon;
357
+ if (typeof value !== "undefined") return false;
358
+ }
359
+ });
360
+ return value;
361
+ }
362
+ rawValue(node, prop) {
363
+ let value = node[prop];
364
+ let raw = node.raws[prop];
365
+ if (raw && raw.value === value) return raw.raw;
366
+ return value;
367
+ }
368
+ root(node) {
369
+ this.body(node);
370
+ if (node.raws.after) this.builder(node.raws.after);
371
+ }
372
+ rule(node) {
373
+ this.block(node, this.rawValue(node, "selector"));
374
+ if (node.raws.ownSemicolon) this.builder(node.raws.ownSemicolon, node, "end");
375
+ }
376
+ stringify(node, semicolon) {
377
+ /* c8 ignore start */
378
+ if (!this[node.type]) throw new Error("Unknown AST node type " + node.type + ". Maybe you need to change PostCSS stringifier.");
379
+ /* c8 ignore stop */
380
+ this[node.type](node, semicolon);
381
+ }
382
+ };
383
+ module.exports = Stringifier;
384
+ Stringifier.default = Stringifier;
385
+ }));
386
+ //#endregion
387
+ //#region node_modules/.pnpm/postcss@8.5.8/node_modules/postcss/lib/stringify.js
388
+ var require_stringify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
389
+ var Stringifier = require_stringifier();
390
+ function stringify(node, builder) {
391
+ new Stringifier(builder).stringify(node);
392
+ }
393
+ module.exports = stringify;
394
+ stringify.default = stringify;
395
+ }));
396
+ //#endregion
397
+ //#region node_modules/.pnpm/postcss@8.5.8/node_modules/postcss/lib/symbols.js
398
+ var require_symbols = /* @__PURE__ */ __commonJSMin(((exports, module) => {
399
+ module.exports.isClean = Symbol("isClean");
400
+ module.exports.my = Symbol("my");
401
+ }));
402
+ //#endregion
403
+ //#region node_modules/.pnpm/postcss@8.5.8/node_modules/postcss/lib/node.js
404
+ var require_node = /* @__PURE__ */ __commonJSMin(((exports, module) => {
405
+ var CssSyntaxError = require_css_syntax_error();
406
+ var Stringifier = require_stringifier();
407
+ var stringify = require_stringify();
408
+ var { isClean, my } = require_symbols();
409
+ function cloneNode(obj, parent) {
410
+ let cloned = new obj.constructor();
411
+ for (let i in obj) {
412
+ if (!Object.prototype.hasOwnProperty.call(obj, i))
413
+ /* c8 ignore next 2 */
414
+ continue;
415
+ if (i === "proxyCache") continue;
416
+ let value = obj[i];
417
+ let type = typeof value;
418
+ if (i === "parent" && type === "object") {
419
+ if (parent) cloned[i] = parent;
420
+ } else if (i === "source") cloned[i] = value;
421
+ else if (Array.isArray(value)) cloned[i] = value.map((j) => cloneNode(j, cloned));
422
+ else {
423
+ if (type === "object" && value !== null) value = cloneNode(value);
424
+ cloned[i] = value;
425
+ }
426
+ }
427
+ return cloned;
428
+ }
429
+ function sourceOffset(inputCSS, position) {
430
+ if (position && typeof position.offset !== "undefined") return position.offset;
431
+ let column = 1;
432
+ let line = 1;
433
+ let offset = 0;
434
+ for (let i = 0; i < inputCSS.length; i++) {
435
+ if (line === position.line && column === position.column) {
436
+ offset = i;
437
+ break;
438
+ }
439
+ if (inputCSS[i] === "\n") {
440
+ column = 1;
441
+ line += 1;
442
+ } else column += 1;
443
+ }
444
+ return offset;
445
+ }
446
+ var Node = class {
447
+ get proxyOf() {
448
+ return this;
449
+ }
450
+ constructor(defaults = {}) {
451
+ this.raws = {};
452
+ this[isClean] = false;
453
+ this[my] = true;
454
+ for (let name in defaults) if (name === "nodes") {
455
+ this.nodes = [];
456
+ for (let node of defaults[name]) if (typeof node.clone === "function") this.append(node.clone());
457
+ else this.append(node);
458
+ } else this[name] = defaults[name];
459
+ }
460
+ addToError(error) {
461
+ error.postcssNode = this;
462
+ if (error.stack && this.source && /\n\s{4}at /.test(error.stack)) {
463
+ let s = this.source;
464
+ error.stack = error.stack.replace(/\n\s{4}at /, `$&${s.input.from}:${s.start.line}:${s.start.column}$&`);
465
+ }
466
+ return error;
467
+ }
468
+ after(add) {
469
+ this.parent.insertAfter(this, add);
470
+ return this;
471
+ }
472
+ assign(overrides = {}) {
473
+ for (let name in overrides) this[name] = overrides[name];
474
+ return this;
475
+ }
476
+ before(add) {
477
+ this.parent.insertBefore(this, add);
478
+ return this;
479
+ }
480
+ cleanRaws(keepBetween) {
481
+ delete this.raws.before;
482
+ delete this.raws.after;
483
+ if (!keepBetween) delete this.raws.between;
484
+ }
485
+ clone(overrides = {}) {
486
+ let cloned = cloneNode(this);
487
+ for (let name in overrides) cloned[name] = overrides[name];
488
+ return cloned;
489
+ }
490
+ cloneAfter(overrides = {}) {
491
+ let cloned = this.clone(overrides);
492
+ this.parent.insertAfter(this, cloned);
493
+ return cloned;
494
+ }
495
+ cloneBefore(overrides = {}) {
496
+ let cloned = this.clone(overrides);
497
+ this.parent.insertBefore(this, cloned);
498
+ return cloned;
499
+ }
500
+ error(message, opts = {}) {
501
+ if (this.source) {
502
+ let { end, start } = this.rangeBy(opts);
503
+ return this.source.input.error(message, {
504
+ column: start.column,
505
+ line: start.line
506
+ }, {
507
+ column: end.column,
508
+ line: end.line
509
+ }, opts);
510
+ }
511
+ return new CssSyntaxError(message);
512
+ }
513
+ getProxyProcessor() {
514
+ return {
515
+ get(node, prop) {
516
+ if (prop === "proxyOf") return node;
517
+ else if (prop === "root") return () => node.root().toProxy();
518
+ else return node[prop];
519
+ },
520
+ set(node, prop, value) {
521
+ if (node[prop] === value) return true;
522
+ node[prop] = value;
523
+ if (prop === "prop" || prop === "value" || prop === "name" || prop === "params" || prop === "important" || prop === "text") node.markDirty();
524
+ return true;
525
+ }
526
+ };
527
+ }
528
+ /* c8 ignore next 3 */
529
+ markClean() {
530
+ this[isClean] = true;
531
+ }
532
+ markDirty() {
533
+ if (this[isClean]) {
534
+ this[isClean] = false;
535
+ let next = this;
536
+ while (next = next.parent) next[isClean] = false;
537
+ }
538
+ }
539
+ next() {
540
+ if (!this.parent) return void 0;
541
+ let index = this.parent.index(this);
542
+ return this.parent.nodes[index + 1];
543
+ }
544
+ positionBy(opts = {}) {
545
+ let pos = this.source.start;
546
+ if (opts.index) pos = this.positionInside(opts.index);
547
+ else if (opts.word) {
548
+ let inputString = "document" in this.source.input ? this.source.input.document : this.source.input.css;
549
+ let index = inputString.slice(sourceOffset(inputString, this.source.start), sourceOffset(inputString, this.source.end)).indexOf(opts.word);
550
+ if (index !== -1) pos = this.positionInside(index);
551
+ }
552
+ return pos;
553
+ }
554
+ positionInside(index) {
555
+ let column = this.source.start.column;
556
+ let line = this.source.start.line;
557
+ let inputString = "document" in this.source.input ? this.source.input.document : this.source.input.css;
558
+ let offset = sourceOffset(inputString, this.source.start);
559
+ let end = offset + index;
560
+ for (let i = offset; i < end; i++) if (inputString[i] === "\n") {
561
+ column = 1;
562
+ line += 1;
563
+ } else column += 1;
564
+ return {
565
+ column,
566
+ line,
567
+ offset: end
568
+ };
569
+ }
570
+ prev() {
571
+ if (!this.parent) return void 0;
572
+ let index = this.parent.index(this);
573
+ return this.parent.nodes[index - 1];
574
+ }
575
+ rangeBy(opts = {}) {
576
+ let inputString = "document" in this.source.input ? this.source.input.document : this.source.input.css;
577
+ let start = {
578
+ column: this.source.start.column,
579
+ line: this.source.start.line,
580
+ offset: sourceOffset(inputString, this.source.start)
581
+ };
582
+ let end = this.source.end ? {
583
+ column: this.source.end.column + 1,
584
+ line: this.source.end.line,
585
+ offset: typeof this.source.end.offset === "number" ? this.source.end.offset : sourceOffset(inputString, this.source.end) + 1
586
+ } : {
587
+ column: start.column + 1,
588
+ line: start.line,
589
+ offset: start.offset + 1
590
+ };
591
+ if (opts.word) {
592
+ let index = inputString.slice(sourceOffset(inputString, this.source.start), sourceOffset(inputString, this.source.end)).indexOf(opts.word);
593
+ if (index !== -1) {
594
+ start = this.positionInside(index);
595
+ end = this.positionInside(index + opts.word.length);
596
+ }
597
+ } else {
598
+ if (opts.start) start = {
599
+ column: opts.start.column,
600
+ line: opts.start.line,
601
+ offset: sourceOffset(inputString, opts.start)
602
+ };
603
+ else if (opts.index) start = this.positionInside(opts.index);
604
+ if (opts.end) end = {
605
+ column: opts.end.column,
606
+ line: opts.end.line,
607
+ offset: sourceOffset(inputString, opts.end)
608
+ };
609
+ else if (typeof opts.endIndex === "number") end = this.positionInside(opts.endIndex);
610
+ else if (opts.index) end = this.positionInside(opts.index + 1);
611
+ }
612
+ if (end.line < start.line || end.line === start.line && end.column <= start.column) end = {
613
+ column: start.column + 1,
614
+ line: start.line,
615
+ offset: start.offset + 1
616
+ };
617
+ return {
618
+ end,
619
+ start
620
+ };
621
+ }
622
+ raw(prop, defaultType) {
623
+ return new Stringifier().raw(this, prop, defaultType);
624
+ }
625
+ remove() {
626
+ if (this.parent) this.parent.removeChild(this);
627
+ this.parent = void 0;
628
+ return this;
629
+ }
630
+ replaceWith(...nodes) {
631
+ if (this.parent) {
632
+ let bookmark = this;
633
+ let foundSelf = false;
634
+ for (let node of nodes) if (node === this) foundSelf = true;
635
+ else if (foundSelf) {
636
+ this.parent.insertAfter(bookmark, node);
637
+ bookmark = node;
638
+ } else this.parent.insertBefore(bookmark, node);
639
+ if (!foundSelf) this.remove();
640
+ }
641
+ return this;
642
+ }
643
+ root() {
644
+ let result = this;
645
+ while (result.parent && result.parent.type !== "document") result = result.parent;
646
+ return result;
647
+ }
648
+ toJSON(_, inputs) {
649
+ let fixed = {};
650
+ let emitInputs = inputs == null;
651
+ inputs = inputs || /* @__PURE__ */ new Map();
652
+ let inputsNextIndex = 0;
653
+ for (let name in this) {
654
+ if (!Object.prototype.hasOwnProperty.call(this, name))
655
+ /* c8 ignore next 2 */
656
+ continue;
657
+ if (name === "parent" || name === "proxyCache") continue;
658
+ let value = this[name];
659
+ if (Array.isArray(value)) fixed[name] = value.map((i) => {
660
+ if (typeof i === "object" && i.toJSON) return i.toJSON(null, inputs);
661
+ else return i;
662
+ });
663
+ else if (typeof value === "object" && value.toJSON) fixed[name] = value.toJSON(null, inputs);
664
+ else if (name === "source") {
665
+ if (value == null) continue;
666
+ let inputId = inputs.get(value.input);
667
+ if (inputId == null) {
668
+ inputId = inputsNextIndex;
669
+ inputs.set(value.input, inputsNextIndex);
670
+ inputsNextIndex++;
671
+ }
672
+ fixed[name] = {
673
+ end: value.end,
674
+ inputId,
675
+ start: value.start
676
+ };
677
+ } else fixed[name] = value;
678
+ }
679
+ if (emitInputs) fixed.inputs = [...inputs.keys()].map((input) => input.toJSON());
680
+ return fixed;
681
+ }
682
+ toProxy() {
683
+ if (!this.proxyCache) this.proxyCache = new Proxy(this, this.getProxyProcessor());
684
+ return this.proxyCache;
685
+ }
686
+ toString(stringifier = stringify) {
687
+ if (stringifier.stringify) stringifier = stringifier.stringify;
688
+ let result = "";
689
+ stringifier(this, (i) => {
690
+ result += i;
691
+ });
692
+ return result;
693
+ }
694
+ warn(result, text, opts = {}) {
695
+ let data = { node: this };
696
+ for (let i in opts) data[i] = opts[i];
697
+ return result.warn(text, data);
698
+ }
699
+ };
700
+ module.exports = Node;
701
+ Node.default = Node;
702
+ }));
703
+ //#endregion
704
+ //#region node_modules/.pnpm/postcss@8.5.8/node_modules/postcss/lib/comment.js
705
+ var require_comment = /* @__PURE__ */ __commonJSMin(((exports, module) => {
706
+ var Node = require_node();
707
+ var Comment = class extends Node {
708
+ constructor(defaults) {
709
+ super(defaults);
710
+ this.type = "comment";
711
+ }
712
+ };
713
+ module.exports = Comment;
714
+ Comment.default = Comment;
715
+ }));
716
+ //#endregion
717
+ //#region node_modules/.pnpm/postcss@8.5.8/node_modules/postcss/lib/declaration.js
718
+ var require_declaration = /* @__PURE__ */ __commonJSMin(((exports, module) => {
719
+ var Node = require_node();
720
+ var Declaration = class extends Node {
721
+ get variable() {
722
+ return this.prop.startsWith("--") || this.prop[0] === "$";
723
+ }
724
+ constructor(defaults) {
725
+ if (defaults && typeof defaults.value !== "undefined" && typeof defaults.value !== "string") defaults = {
726
+ ...defaults,
727
+ value: String(defaults.value)
728
+ };
729
+ super(defaults);
730
+ this.type = "decl";
731
+ }
732
+ };
733
+ module.exports = Declaration;
734
+ Declaration.default = Declaration;
735
+ }));
736
+ //#endregion
737
+ //#region node_modules/.pnpm/postcss@8.5.8/node_modules/postcss/lib/container.js
738
+ var require_container = /* @__PURE__ */ __commonJSMin(((exports, module) => {
739
+ var Comment = require_comment();
740
+ var Declaration = require_declaration();
741
+ var Node = require_node();
742
+ var { isClean, my } = require_symbols();
743
+ var AtRule, parse, Root, Rule;
744
+ function cleanSource(nodes) {
745
+ return nodes.map((i) => {
746
+ if (i.nodes) i.nodes = cleanSource(i.nodes);
747
+ delete i.source;
748
+ return i;
749
+ });
750
+ }
751
+ function markTreeDirty(node) {
752
+ node[isClean] = false;
753
+ if (node.proxyOf.nodes) for (let i of node.proxyOf.nodes) markTreeDirty(i);
754
+ }
755
+ var Container = class Container extends Node {
756
+ get first() {
757
+ if (!this.proxyOf.nodes) return void 0;
758
+ return this.proxyOf.nodes[0];
759
+ }
760
+ get last() {
761
+ if (!this.proxyOf.nodes) return void 0;
762
+ return this.proxyOf.nodes[this.proxyOf.nodes.length - 1];
763
+ }
764
+ append(...children) {
765
+ for (let child of children) {
766
+ let nodes = this.normalize(child, this.last);
767
+ for (let node of nodes) this.proxyOf.nodes.push(node);
768
+ }
769
+ this.markDirty();
770
+ return this;
771
+ }
772
+ cleanRaws(keepBetween) {
773
+ super.cleanRaws(keepBetween);
774
+ if (this.nodes) for (let node of this.nodes) node.cleanRaws(keepBetween);
775
+ }
776
+ each(callback) {
777
+ if (!this.proxyOf.nodes) return void 0;
778
+ let iterator = this.getIterator();
779
+ let index, result;
780
+ while (this.indexes[iterator] < this.proxyOf.nodes.length) {
781
+ index = this.indexes[iterator];
782
+ result = callback(this.proxyOf.nodes[index], index);
783
+ if (result === false) break;
784
+ this.indexes[iterator] += 1;
785
+ }
786
+ delete this.indexes[iterator];
787
+ return result;
788
+ }
789
+ every(condition) {
790
+ return this.nodes.every(condition);
791
+ }
792
+ getIterator() {
793
+ if (!this.lastEach) this.lastEach = 0;
794
+ if (!this.indexes) this.indexes = {};
795
+ this.lastEach += 1;
796
+ let iterator = this.lastEach;
797
+ this.indexes[iterator] = 0;
798
+ return iterator;
799
+ }
800
+ getProxyProcessor() {
801
+ return {
802
+ get(node, prop) {
803
+ if (prop === "proxyOf") return node;
804
+ else if (!node[prop]) return node[prop];
805
+ else if (prop === "each" || typeof prop === "string" && prop.startsWith("walk")) return (...args) => {
806
+ return node[prop](...args.map((i) => {
807
+ if (typeof i === "function") return (child, index) => i(child.toProxy(), index);
808
+ else return i;
809
+ }));
810
+ };
811
+ else if (prop === "every" || prop === "some") return (cb) => {
812
+ return node[prop]((child, ...other) => cb(child.toProxy(), ...other));
813
+ };
814
+ else if (prop === "root") return () => node.root().toProxy();
815
+ else if (prop === "nodes") return node.nodes.map((i) => i.toProxy());
816
+ else if (prop === "first" || prop === "last") return node[prop].toProxy();
817
+ else return node[prop];
818
+ },
819
+ set(node, prop, value) {
820
+ if (node[prop] === value) return true;
821
+ node[prop] = value;
822
+ if (prop === "name" || prop === "params" || prop === "selector") node.markDirty();
823
+ return true;
824
+ }
825
+ };
826
+ }
827
+ index(child) {
828
+ if (typeof child === "number") return child;
829
+ if (child.proxyOf) child = child.proxyOf;
830
+ return this.proxyOf.nodes.indexOf(child);
831
+ }
832
+ insertAfter(exist, add) {
833
+ let existIndex = this.index(exist);
834
+ let nodes = this.normalize(add, this.proxyOf.nodes[existIndex]).reverse();
835
+ existIndex = this.index(exist);
836
+ for (let node of nodes) this.proxyOf.nodes.splice(existIndex + 1, 0, node);
837
+ let index;
838
+ for (let id in this.indexes) {
839
+ index = this.indexes[id];
840
+ if (existIndex < index) this.indexes[id] = index + nodes.length;
841
+ }
842
+ this.markDirty();
843
+ return this;
844
+ }
845
+ insertBefore(exist, add) {
846
+ let existIndex = this.index(exist);
847
+ let type = existIndex === 0 ? "prepend" : false;
848
+ let nodes = this.normalize(add, this.proxyOf.nodes[existIndex], type).reverse();
849
+ existIndex = this.index(exist);
850
+ for (let node of nodes) this.proxyOf.nodes.splice(existIndex, 0, node);
851
+ let index;
852
+ for (let id in this.indexes) {
853
+ index = this.indexes[id];
854
+ if (existIndex <= index) this.indexes[id] = index + nodes.length;
855
+ }
856
+ this.markDirty();
857
+ return this;
858
+ }
859
+ normalize(nodes, sample) {
860
+ if (typeof nodes === "string") nodes = cleanSource(parse(nodes).nodes);
861
+ else if (typeof nodes === "undefined") nodes = [];
862
+ else if (Array.isArray(nodes)) {
863
+ nodes = nodes.slice(0);
864
+ for (let i of nodes) if (i.parent) i.parent.removeChild(i, "ignore");
865
+ } else if (nodes.type === "root" && this.type !== "document") {
866
+ nodes = nodes.nodes.slice(0);
867
+ for (let i of nodes) if (i.parent) i.parent.removeChild(i, "ignore");
868
+ } else if (nodes.type) nodes = [nodes];
869
+ else if (nodes.prop) {
870
+ if (typeof nodes.value === "undefined") throw new Error("Value field is missed in node creation");
871
+ else if (typeof nodes.value !== "string") nodes.value = String(nodes.value);
872
+ nodes = [new Declaration(nodes)];
873
+ } else if (nodes.selector || nodes.selectors) nodes = [new Rule(nodes)];
874
+ else if (nodes.name) nodes = [new AtRule(nodes)];
875
+ else if (nodes.text) nodes = [new Comment(nodes)];
876
+ else throw new Error("Unknown node type in node creation");
877
+ return nodes.map((i) => {
878
+ /* c8 ignore next */
879
+ if (!i[my]) Container.rebuild(i);
880
+ i = i.proxyOf;
881
+ if (i.parent) i.parent.removeChild(i);
882
+ if (i[isClean]) markTreeDirty(i);
883
+ if (!i.raws) i.raws = {};
884
+ if (typeof i.raws.before === "undefined") {
885
+ if (sample && typeof sample.raws.before !== "undefined") i.raws.before = sample.raws.before.replace(/\S/g, "");
886
+ }
887
+ i.parent = this.proxyOf;
888
+ return i;
889
+ });
890
+ }
891
+ prepend(...children) {
892
+ children = children.reverse();
893
+ for (let child of children) {
894
+ let nodes = this.normalize(child, this.first, "prepend").reverse();
895
+ for (let node of nodes) this.proxyOf.nodes.unshift(node);
896
+ for (let id in this.indexes) this.indexes[id] = this.indexes[id] + nodes.length;
897
+ }
898
+ this.markDirty();
899
+ return this;
900
+ }
901
+ push(child) {
902
+ child.parent = this;
903
+ this.proxyOf.nodes.push(child);
904
+ return this;
905
+ }
906
+ removeAll() {
907
+ for (let node of this.proxyOf.nodes) node.parent = void 0;
908
+ this.proxyOf.nodes = [];
909
+ this.markDirty();
910
+ return this;
911
+ }
912
+ removeChild(child) {
913
+ child = this.index(child);
914
+ this.proxyOf.nodes[child].parent = void 0;
915
+ this.proxyOf.nodes.splice(child, 1);
916
+ let index;
917
+ for (let id in this.indexes) {
918
+ index = this.indexes[id];
919
+ if (index >= child) this.indexes[id] = index - 1;
920
+ }
921
+ this.markDirty();
922
+ return this;
923
+ }
924
+ replaceValues(pattern, opts, callback) {
925
+ if (!callback) {
926
+ callback = opts;
927
+ opts = {};
928
+ }
929
+ this.walkDecls((decl) => {
930
+ if (opts.props && !opts.props.includes(decl.prop)) return;
931
+ if (opts.fast && !decl.value.includes(opts.fast)) return;
932
+ decl.value = decl.value.replace(pattern, callback);
933
+ });
934
+ this.markDirty();
935
+ return this;
936
+ }
937
+ some(condition) {
938
+ return this.nodes.some(condition);
939
+ }
940
+ walk(callback) {
941
+ return this.each((child, i) => {
942
+ let result;
943
+ try {
944
+ result = callback(child, i);
945
+ } catch (e) {
946
+ throw child.addToError(e);
947
+ }
948
+ if (result !== false && child.walk) result = child.walk(callback);
949
+ return result;
950
+ });
951
+ }
952
+ walkAtRules(name, callback) {
953
+ if (!callback) {
954
+ callback = name;
955
+ return this.walk((child, i) => {
956
+ if (child.type === "atrule") return callback(child, i);
957
+ });
958
+ }
959
+ if (name instanceof RegExp) return this.walk((child, i) => {
960
+ if (child.type === "atrule" && name.test(child.name)) return callback(child, i);
961
+ });
962
+ return this.walk((child, i) => {
963
+ if (child.type === "atrule" && child.name === name) return callback(child, i);
964
+ });
965
+ }
966
+ walkComments(callback) {
967
+ return this.walk((child, i) => {
968
+ if (child.type === "comment") return callback(child, i);
969
+ });
970
+ }
971
+ walkDecls(prop, callback) {
972
+ if (!callback) {
973
+ callback = prop;
974
+ return this.walk((child, i) => {
975
+ if (child.type === "decl") return callback(child, i);
976
+ });
977
+ }
978
+ if (prop instanceof RegExp) return this.walk((child, i) => {
979
+ if (child.type === "decl" && prop.test(child.prop)) return callback(child, i);
980
+ });
981
+ return this.walk((child, i) => {
982
+ if (child.type === "decl" && child.prop === prop) return callback(child, i);
983
+ });
984
+ }
985
+ walkRules(selector, callback) {
986
+ if (!callback) {
987
+ callback = selector;
988
+ return this.walk((child, i) => {
989
+ if (child.type === "rule") return callback(child, i);
990
+ });
991
+ }
992
+ if (selector instanceof RegExp) return this.walk((child, i) => {
993
+ if (child.type === "rule" && selector.test(child.selector)) return callback(child, i);
994
+ });
995
+ return this.walk((child, i) => {
996
+ if (child.type === "rule" && child.selector === selector) return callback(child, i);
997
+ });
998
+ }
999
+ };
1000
+ Container.registerParse = (dependant) => {
1001
+ parse = dependant;
1002
+ };
1003
+ Container.registerRule = (dependant) => {
1004
+ Rule = dependant;
1005
+ };
1006
+ Container.registerAtRule = (dependant) => {
1007
+ AtRule = dependant;
1008
+ };
1009
+ Container.registerRoot = (dependant) => {
1010
+ Root = dependant;
1011
+ };
1012
+ module.exports = Container;
1013
+ Container.default = Container;
1014
+ /* c8 ignore start */
1015
+ Container.rebuild = (node) => {
1016
+ if (node.type === "atrule") Object.setPrototypeOf(node, AtRule.prototype);
1017
+ else if (node.type === "rule") Object.setPrototypeOf(node, Rule.prototype);
1018
+ else if (node.type === "decl") Object.setPrototypeOf(node, Declaration.prototype);
1019
+ else if (node.type === "comment") Object.setPrototypeOf(node, Comment.prototype);
1020
+ else if (node.type === "root") Object.setPrototypeOf(node, Root.prototype);
1021
+ node[my] = true;
1022
+ if (node.nodes) node.nodes.forEach((child) => {
1023
+ Container.rebuild(child);
1024
+ });
1025
+ };
1026
+ }));
1027
+ /* c8 ignore stop */
1028
+ //#endregion
1029
+ //#region node_modules/.pnpm/postcss@8.5.8/node_modules/postcss/lib/at-rule.js
1030
+ var require_at_rule = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1031
+ var Container = require_container();
1032
+ var AtRule = class extends Container {
1033
+ constructor(defaults) {
1034
+ super(defaults);
1035
+ this.type = "atrule";
1036
+ }
1037
+ append(...children) {
1038
+ if (!this.proxyOf.nodes) this.nodes = [];
1039
+ return super.append(...children);
1040
+ }
1041
+ prepend(...children) {
1042
+ if (!this.proxyOf.nodes) this.nodes = [];
1043
+ return super.prepend(...children);
1044
+ }
1045
+ };
1046
+ module.exports = AtRule;
1047
+ AtRule.default = AtRule;
1048
+ Container.registerAtRule(AtRule);
1049
+ }));
1050
+ //#endregion
1051
+ //#region node_modules/.pnpm/postcss@8.5.8/node_modules/postcss/lib/document.js
1052
+ var require_document = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1053
+ var Container = require_container();
1054
+ var LazyResult, Processor;
1055
+ var Document = class extends Container {
1056
+ constructor(defaults) {
1057
+ super({
1058
+ type: "document",
1059
+ ...defaults
1060
+ });
1061
+ if (!this.nodes) this.nodes = [];
1062
+ }
1063
+ toResult(opts = {}) {
1064
+ return new LazyResult(new Processor(), this, opts).stringify();
1065
+ }
1066
+ };
1067
+ Document.registerLazyResult = (dependant) => {
1068
+ LazyResult = dependant;
1069
+ };
1070
+ Document.registerProcessor = (dependant) => {
1071
+ Processor = dependant;
1072
+ };
1073
+ module.exports = Document;
1074
+ Document.default = Document;
1075
+ }));
1076
+ //#endregion
1077
+ //#region node_modules/.pnpm/nanoid@3.3.11/node_modules/nanoid/non-secure/index.cjs
1078
+ var require_non_secure = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1079
+ var urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
1080
+ var customAlphabet = (alphabet, defaultSize = 21) => {
1081
+ return (size = defaultSize) => {
1082
+ let id = "";
1083
+ let i = size | 0;
1084
+ while (i--) id += alphabet[Math.random() * alphabet.length | 0];
1085
+ return id;
1086
+ };
1087
+ };
1088
+ var nanoid = (size = 21) => {
1089
+ let id = "";
1090
+ let i = size | 0;
1091
+ while (i--) id += urlAlphabet[Math.random() * 64 | 0];
1092
+ return id;
1093
+ };
1094
+ module.exports = {
1095
+ nanoid,
1096
+ customAlphabet
1097
+ };
1098
+ }));
1099
+ //#endregion
1100
+ //#region node_modules/.pnpm/postcss@8.5.8/node_modules/postcss/lib/previous-map.js
1101
+ var require_previous_map = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1102
+ var { existsSync, readFileSync } = require___vite_browser_external();
1103
+ var { dirname, join } = require___vite_browser_external();
1104
+ var { SourceMapConsumer, SourceMapGenerator } = require___vite_browser_external();
1105
+ function fromBase64(str) {
1106
+ if (Buffer) return Buffer.from(str, "base64").toString();
1107
+ else
1108
+ /* c8 ignore next 2 */
1109
+ return window.atob(str);
1110
+ }
1111
+ var PreviousMap = class {
1112
+ constructor(css, opts) {
1113
+ if (opts.map === false) return;
1114
+ this.loadAnnotation(css);
1115
+ this.inline = this.startWith(this.annotation, "data:");
1116
+ let prev = opts.map ? opts.map.prev : void 0;
1117
+ let text = this.loadMap(opts.from, prev);
1118
+ if (!this.mapFile && opts.from) this.mapFile = opts.from;
1119
+ if (this.mapFile) this.root = dirname(this.mapFile);
1120
+ if (text) this.text = text;
1121
+ }
1122
+ consumer() {
1123
+ if (!this.consumerCache) this.consumerCache = new SourceMapConsumer(this.text);
1124
+ return this.consumerCache;
1125
+ }
1126
+ decodeInline(text) {
1127
+ let baseCharsetUri = /^data:application\/json;charset=utf-?8;base64,/;
1128
+ let baseUri = /^data:application\/json;base64,/;
1129
+ let uriMatch = text.match(/^data:application\/json;charset=utf-?8,/) || text.match(/^data:application\/json,/);
1130
+ if (uriMatch) return decodeURIComponent(text.substr(uriMatch[0].length));
1131
+ let baseUriMatch = text.match(baseCharsetUri) || text.match(baseUri);
1132
+ if (baseUriMatch) return fromBase64(text.substr(baseUriMatch[0].length));
1133
+ let encoding = text.match(/data:application\/json;([^,]+),/)[1];
1134
+ throw new Error("Unsupported source map encoding " + encoding);
1135
+ }
1136
+ getAnnotationURL(sourceMapString) {
1137
+ return sourceMapString.replace(/^\/\*\s*# sourceMappingURL=/, "").trim();
1138
+ }
1139
+ isMap(map) {
1140
+ if (typeof map !== "object") return false;
1141
+ return typeof map.mappings === "string" || typeof map._mappings === "string" || Array.isArray(map.sections);
1142
+ }
1143
+ loadAnnotation(css) {
1144
+ let comments = css.match(/\/\*\s*# sourceMappingURL=/g);
1145
+ if (!comments) return;
1146
+ let start = css.lastIndexOf(comments.pop());
1147
+ let end = css.indexOf("*/", start);
1148
+ if (start > -1 && end > -1) this.annotation = this.getAnnotationURL(css.substring(start, end));
1149
+ }
1150
+ loadFile(path) {
1151
+ this.root = dirname(path);
1152
+ if (existsSync(path)) {
1153
+ this.mapFile = path;
1154
+ return readFileSync(path, "utf-8").toString().trim();
1155
+ }
1156
+ }
1157
+ loadMap(file, prev) {
1158
+ if (prev === false) return false;
1159
+ if (prev) if (typeof prev === "string") return prev;
1160
+ else if (typeof prev === "function") {
1161
+ let prevPath = prev(file);
1162
+ if (prevPath) {
1163
+ let map = this.loadFile(prevPath);
1164
+ if (!map) throw new Error("Unable to load previous source map: " + prevPath.toString());
1165
+ return map;
1166
+ }
1167
+ } else if (prev instanceof SourceMapConsumer) return SourceMapGenerator.fromSourceMap(prev).toString();
1168
+ else if (prev instanceof SourceMapGenerator) return prev.toString();
1169
+ else if (this.isMap(prev)) return JSON.stringify(prev);
1170
+ else throw new Error("Unsupported previous source map format: " + prev.toString());
1171
+ else if (this.inline) return this.decodeInline(this.annotation);
1172
+ else if (this.annotation) {
1173
+ let map = this.annotation;
1174
+ if (file) map = join(dirname(file), map);
1175
+ return this.loadFile(map);
1176
+ }
1177
+ }
1178
+ startWith(string, start) {
1179
+ if (!string) return false;
1180
+ return string.substr(0, start.length) === start;
1181
+ }
1182
+ withContent() {
1183
+ return !!(this.consumer().sourcesContent && this.consumer().sourcesContent.length > 0);
1184
+ }
1185
+ };
1186
+ module.exports = PreviousMap;
1187
+ PreviousMap.default = PreviousMap;
1188
+ }));
1189
+ //#endregion
1190
+ //#region node_modules/.pnpm/postcss@8.5.8/node_modules/postcss/lib/input.js
1191
+ var require_input = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1192
+ var { nanoid } = require_non_secure();
1193
+ var { isAbsolute, resolve } = require___vite_browser_external();
1194
+ var { SourceMapConsumer, SourceMapGenerator } = require___vite_browser_external();
1195
+ var { fileURLToPath, pathToFileURL } = require___vite_browser_external();
1196
+ var CssSyntaxError = require_css_syntax_error();
1197
+ var PreviousMap = require_previous_map();
1198
+ var terminalHighlight = require___vite_browser_external();
1199
+ var lineToIndexCache = Symbol("lineToIndexCache");
1200
+ var sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator);
1201
+ var pathAvailable = Boolean(resolve && isAbsolute);
1202
+ function getLineToIndex(input) {
1203
+ if (input[lineToIndexCache]) return input[lineToIndexCache];
1204
+ let lines = input.css.split("\n");
1205
+ let lineToIndex = new Array(lines.length);
1206
+ let prevIndex = 0;
1207
+ for (let i = 0, l = lines.length; i < l; i++) {
1208
+ lineToIndex[i] = prevIndex;
1209
+ prevIndex += lines[i].length + 1;
1210
+ }
1211
+ input[lineToIndexCache] = lineToIndex;
1212
+ return lineToIndex;
1213
+ }
1214
+ var Input = class {
1215
+ get from() {
1216
+ return this.file || this.id;
1217
+ }
1218
+ constructor(css, opts = {}) {
1219
+ if (css === null || typeof css === "undefined" || typeof css === "object" && !css.toString) throw new Error(`PostCSS received ${css} instead of CSS string`);
1220
+ this.css = css.toString();
1221
+ if (this.css[0] === "" || this.css[0] === "￾") {
1222
+ this.hasBOM = true;
1223
+ this.css = this.css.slice(1);
1224
+ } else this.hasBOM = false;
1225
+ this.document = this.css;
1226
+ if (opts.document) this.document = opts.document.toString();
1227
+ if (opts.from) if (!pathAvailable || /^\w+:\/\//.test(opts.from) || isAbsolute(opts.from)) this.file = opts.from;
1228
+ else this.file = resolve(opts.from);
1229
+ if (pathAvailable && sourceMapAvailable) {
1230
+ let map = new PreviousMap(this.css, opts);
1231
+ if (map.text) {
1232
+ this.map = map;
1233
+ let file = map.consumer().file;
1234
+ if (!this.file && file) this.file = this.mapResolve(file);
1235
+ }
1236
+ }
1237
+ if (!this.file) this.id = "<input css " + nanoid(6) + ">";
1238
+ if (this.map) this.map.file = this.from;
1239
+ }
1240
+ error(message, line, column, opts = {}) {
1241
+ let endColumn, endLine, endOffset, offset, result;
1242
+ if (line && typeof line === "object") {
1243
+ let start = line;
1244
+ let end = column;
1245
+ if (typeof start.offset === "number") {
1246
+ offset = start.offset;
1247
+ let pos = this.fromOffset(offset);
1248
+ line = pos.line;
1249
+ column = pos.col;
1250
+ } else {
1251
+ line = start.line;
1252
+ column = start.column;
1253
+ offset = this.fromLineAndColumn(line, column);
1254
+ }
1255
+ if (typeof end.offset === "number") {
1256
+ endOffset = end.offset;
1257
+ let pos = this.fromOffset(endOffset);
1258
+ endLine = pos.line;
1259
+ endColumn = pos.col;
1260
+ } else {
1261
+ endLine = end.line;
1262
+ endColumn = end.column;
1263
+ endOffset = this.fromLineAndColumn(end.line, end.column);
1264
+ }
1265
+ } else if (!column) {
1266
+ offset = line;
1267
+ let pos = this.fromOffset(offset);
1268
+ line = pos.line;
1269
+ column = pos.col;
1270
+ } else offset = this.fromLineAndColumn(line, column);
1271
+ let origin = this.origin(line, column, endLine, endColumn);
1272
+ if (origin) result = new CssSyntaxError(message, origin.endLine === void 0 ? origin.line : {
1273
+ column: origin.column,
1274
+ line: origin.line
1275
+ }, origin.endLine === void 0 ? origin.column : {
1276
+ column: origin.endColumn,
1277
+ line: origin.endLine
1278
+ }, origin.source, origin.file, opts.plugin);
1279
+ else result = new CssSyntaxError(message, endLine === void 0 ? line : {
1280
+ column,
1281
+ line
1282
+ }, endLine === void 0 ? column : {
1283
+ column: endColumn,
1284
+ line: endLine
1285
+ }, this.css, this.file, opts.plugin);
1286
+ result.input = {
1287
+ column,
1288
+ endColumn,
1289
+ endLine,
1290
+ endOffset,
1291
+ line,
1292
+ offset,
1293
+ source: this.css
1294
+ };
1295
+ if (this.file) {
1296
+ if (pathToFileURL) result.input.url = pathToFileURL(this.file).toString();
1297
+ result.input.file = this.file;
1298
+ }
1299
+ return result;
1300
+ }
1301
+ fromLineAndColumn(line, column) {
1302
+ return getLineToIndex(this)[line - 1] + column - 1;
1303
+ }
1304
+ fromOffset(offset) {
1305
+ let lineToIndex = getLineToIndex(this);
1306
+ let lastLine = lineToIndex[lineToIndex.length - 1];
1307
+ let min = 0;
1308
+ if (offset >= lastLine) min = lineToIndex.length - 1;
1309
+ else {
1310
+ let max = lineToIndex.length - 2;
1311
+ let mid;
1312
+ while (min < max) {
1313
+ mid = min + (max - min >> 1);
1314
+ if (offset < lineToIndex[mid]) max = mid - 1;
1315
+ else if (offset >= lineToIndex[mid + 1]) min = mid + 1;
1316
+ else {
1317
+ min = mid;
1318
+ break;
1319
+ }
1320
+ }
1321
+ }
1322
+ return {
1323
+ col: offset - lineToIndex[min] + 1,
1324
+ line: min + 1
1325
+ };
1326
+ }
1327
+ mapResolve(file) {
1328
+ if (/^\w+:\/\//.test(file)) return file;
1329
+ return resolve(this.map.consumer().sourceRoot || this.map.root || ".", file);
1330
+ }
1331
+ origin(line, column, endLine, endColumn) {
1332
+ if (!this.map) return false;
1333
+ let consumer = this.map.consumer();
1334
+ let from = consumer.originalPositionFor({
1335
+ column,
1336
+ line
1337
+ });
1338
+ if (!from.source) return false;
1339
+ let to;
1340
+ if (typeof endLine === "number") to = consumer.originalPositionFor({
1341
+ column: endColumn,
1342
+ line: endLine
1343
+ });
1344
+ let fromUrl;
1345
+ if (isAbsolute(from.source)) fromUrl = pathToFileURL(from.source);
1346
+ else fromUrl = new URL(from.source, this.map.consumer().sourceRoot || pathToFileURL(this.map.mapFile));
1347
+ let result = {
1348
+ column: from.column,
1349
+ endColumn: to && to.column,
1350
+ endLine: to && to.line,
1351
+ line: from.line,
1352
+ url: fromUrl.toString()
1353
+ };
1354
+ if (fromUrl.protocol === "file:") if (fileURLToPath) result.file = fileURLToPath(fromUrl);
1355
+ else
1356
+ /* c8 ignore next 2 */
1357
+ throw new Error(`file: protocol is not available in this PostCSS build`);
1358
+ let source = consumer.sourceContentFor(from.source);
1359
+ if (source) result.source = source;
1360
+ return result;
1361
+ }
1362
+ toJSON() {
1363
+ let json = {};
1364
+ for (let name of [
1365
+ "hasBOM",
1366
+ "css",
1367
+ "file",
1368
+ "id"
1369
+ ]) if (this[name] != null) json[name] = this[name];
1370
+ if (this.map) {
1371
+ json.map = { ...this.map };
1372
+ if (json.map.consumerCache) json.map.consumerCache = void 0;
1373
+ }
1374
+ return json;
1375
+ }
1376
+ };
1377
+ module.exports = Input;
1378
+ Input.default = Input;
1379
+ if (terminalHighlight && terminalHighlight.registerInput) terminalHighlight.registerInput(Input);
1380
+ }));
1381
+ //#endregion
1382
+ //#region node_modules/.pnpm/postcss@8.5.8/node_modules/postcss/lib/root.js
1383
+ var require_root = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1384
+ var Container = require_container();
1385
+ var LazyResult, Processor;
1386
+ var Root = class extends Container {
1387
+ constructor(defaults) {
1388
+ super(defaults);
1389
+ this.type = "root";
1390
+ if (!this.nodes) this.nodes = [];
1391
+ }
1392
+ normalize(child, sample, type) {
1393
+ let nodes = super.normalize(child);
1394
+ if (sample) {
1395
+ if (type === "prepend") if (this.nodes.length > 1) sample.raws.before = this.nodes[1].raws.before;
1396
+ else delete sample.raws.before;
1397
+ else if (this.first !== sample) for (let node of nodes) node.raws.before = sample.raws.before;
1398
+ }
1399
+ return nodes;
1400
+ }
1401
+ removeChild(child, ignore) {
1402
+ let index = this.index(child);
1403
+ if (!ignore && index === 0 && this.nodes.length > 1) this.nodes[1].raws.before = this.nodes[index].raws.before;
1404
+ return super.removeChild(child);
1405
+ }
1406
+ toResult(opts = {}) {
1407
+ return new LazyResult(new Processor(), this, opts).stringify();
1408
+ }
1409
+ };
1410
+ Root.registerLazyResult = (dependant) => {
1411
+ LazyResult = dependant;
1412
+ };
1413
+ Root.registerProcessor = (dependant) => {
1414
+ Processor = dependant;
1415
+ };
1416
+ module.exports = Root;
1417
+ Root.default = Root;
1418
+ Container.registerRoot(Root);
1419
+ }));
1420
+ //#endregion
1421
+ //#region node_modules/.pnpm/postcss@8.5.8/node_modules/postcss/lib/list.js
1422
+ var require_list = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1423
+ var list = {
1424
+ comma(string) {
1425
+ return list.split(string, [","], true);
1426
+ },
1427
+ space(string) {
1428
+ return list.split(string, [
1429
+ " ",
1430
+ "\n",
1431
+ " "
1432
+ ]);
1433
+ },
1434
+ split(string, separators, last) {
1435
+ let array = [];
1436
+ let current = "";
1437
+ let split = false;
1438
+ let func = 0;
1439
+ let inQuote = false;
1440
+ let prevQuote = "";
1441
+ let escape = false;
1442
+ for (let letter of string) {
1443
+ if (escape) escape = false;
1444
+ else if (letter === "\\") escape = true;
1445
+ else if (inQuote) {
1446
+ if (letter === prevQuote) inQuote = false;
1447
+ } else if (letter === "\"" || letter === "'") {
1448
+ inQuote = true;
1449
+ prevQuote = letter;
1450
+ } else if (letter === "(") func += 1;
1451
+ else if (letter === ")") {
1452
+ if (func > 0) func -= 1;
1453
+ } else if (func === 0) {
1454
+ if (separators.includes(letter)) split = true;
1455
+ }
1456
+ if (split) {
1457
+ if (current !== "") array.push(current.trim());
1458
+ current = "";
1459
+ split = false;
1460
+ } else current += letter;
1461
+ }
1462
+ if (last || current !== "") array.push(current.trim());
1463
+ return array;
1464
+ }
1465
+ };
1466
+ module.exports = list;
1467
+ list.default = list;
1468
+ }));
1469
+ //#endregion
1470
+ //#region node_modules/.pnpm/postcss@8.5.8/node_modules/postcss/lib/rule.js
1471
+ var require_rule = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1472
+ var Container = require_container();
1473
+ var list = require_list();
1474
+ var Rule = class extends Container {
1475
+ get selectors() {
1476
+ return list.comma(this.selector);
1477
+ }
1478
+ set selectors(values) {
1479
+ let match = this.selector ? this.selector.match(/,\s*/) : null;
1480
+ let sep = match ? match[0] : "," + this.raw("between", "beforeOpen");
1481
+ this.selector = values.join(sep);
1482
+ }
1483
+ constructor(defaults) {
1484
+ super(defaults);
1485
+ this.type = "rule";
1486
+ if (!this.nodes) this.nodes = [];
1487
+ }
1488
+ };
1489
+ module.exports = Rule;
1490
+ Rule.default = Rule;
1491
+ Container.registerRule(Rule);
1492
+ }));
1493
+ //#endregion
1494
+ //#region node_modules/.pnpm/postcss@8.5.8/node_modules/postcss/lib/fromJSON.js
1495
+ var require_fromJSON = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1496
+ var AtRule = require_at_rule();
1497
+ var Comment = require_comment();
1498
+ var Declaration = require_declaration();
1499
+ var Input = require_input();
1500
+ var PreviousMap = require_previous_map();
1501
+ var Root = require_root();
1502
+ var Rule = require_rule();
1503
+ function fromJSON(json, inputs) {
1504
+ if (Array.isArray(json)) return json.map((n) => fromJSON(n));
1505
+ let { inputs: ownInputs, ...defaults } = json;
1506
+ if (ownInputs) {
1507
+ inputs = [];
1508
+ for (let input of ownInputs) {
1509
+ let inputHydrated = {
1510
+ ...input,
1511
+ __proto__: Input.prototype
1512
+ };
1513
+ if (inputHydrated.map) inputHydrated.map = {
1514
+ ...inputHydrated.map,
1515
+ __proto__: PreviousMap.prototype
1516
+ };
1517
+ inputs.push(inputHydrated);
1518
+ }
1519
+ }
1520
+ if (defaults.nodes) defaults.nodes = json.nodes.map((n) => fromJSON(n, inputs));
1521
+ if (defaults.source) {
1522
+ let { inputId, ...source } = defaults.source;
1523
+ defaults.source = source;
1524
+ if (inputId != null) defaults.source.input = inputs[inputId];
1525
+ }
1526
+ if (defaults.type === "root") return new Root(defaults);
1527
+ else if (defaults.type === "decl") return new Declaration(defaults);
1528
+ else if (defaults.type === "rule") return new Rule(defaults);
1529
+ else if (defaults.type === "comment") return new Comment(defaults);
1530
+ else if (defaults.type === "atrule") return new AtRule(defaults);
1531
+ else throw new Error("Unknown node type: " + json.type);
1532
+ }
1533
+ module.exports = fromJSON;
1534
+ fromJSON.default = fromJSON;
1535
+ }));
1536
+ //#endregion
1537
+ //#region node_modules/.pnpm/postcss@8.5.8/node_modules/postcss/lib/map-generator.js
1538
+ var require_map_generator = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1539
+ var { dirname, relative, resolve, sep } = require___vite_browser_external();
1540
+ var { SourceMapConsumer, SourceMapGenerator } = require___vite_browser_external();
1541
+ var { pathToFileURL } = require___vite_browser_external();
1542
+ var Input = require_input();
1543
+ var sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator);
1544
+ var pathAvailable = Boolean(dirname && resolve && relative && sep);
1545
+ var MapGenerator = class {
1546
+ constructor(stringify, root, opts, cssString) {
1547
+ this.stringify = stringify;
1548
+ this.mapOpts = opts.map || {};
1549
+ this.root = root;
1550
+ this.opts = opts;
1551
+ this.css = cssString;
1552
+ this.originalCSS = cssString;
1553
+ this.usesFileUrls = !this.mapOpts.from && this.mapOpts.absolute;
1554
+ this.memoizedFileURLs = /* @__PURE__ */ new Map();
1555
+ this.memoizedPaths = /* @__PURE__ */ new Map();
1556
+ this.memoizedURLs = /* @__PURE__ */ new Map();
1557
+ }
1558
+ addAnnotation() {
1559
+ let content;
1560
+ if (this.isInline()) content = "data:application/json;base64," + this.toBase64(this.map.toString());
1561
+ else if (typeof this.mapOpts.annotation === "string") content = this.mapOpts.annotation;
1562
+ else if (typeof this.mapOpts.annotation === "function") content = this.mapOpts.annotation(this.opts.to, this.root);
1563
+ else content = this.outputFile() + ".map";
1564
+ let eol = "\n";
1565
+ if (this.css.includes("\r\n")) eol = "\r\n";
1566
+ this.css += eol + "/*# sourceMappingURL=" + content + " */";
1567
+ }
1568
+ applyPrevMaps() {
1569
+ for (let prev of this.previous()) {
1570
+ let from = this.toUrl(this.path(prev.file));
1571
+ let root = prev.root || dirname(prev.file);
1572
+ let map;
1573
+ if (this.mapOpts.sourcesContent === false) {
1574
+ map = new SourceMapConsumer(prev.text);
1575
+ if (map.sourcesContent) map.sourcesContent = null;
1576
+ } else map = prev.consumer();
1577
+ this.map.applySourceMap(map, from, this.toUrl(this.path(root)));
1578
+ }
1579
+ }
1580
+ clearAnnotation() {
1581
+ if (this.mapOpts.annotation === false) return;
1582
+ if (this.root) {
1583
+ let node;
1584
+ for (let i = this.root.nodes.length - 1; i >= 0; i--) {
1585
+ node = this.root.nodes[i];
1586
+ if (node.type !== "comment") continue;
1587
+ if (node.text.startsWith("# sourceMappingURL=")) this.root.removeChild(i);
1588
+ }
1589
+ } else if (this.css) {
1590
+ let startIndex;
1591
+ while ((startIndex = this.css.lastIndexOf("/*#")) !== -1) {
1592
+ let endIndex = this.css.indexOf("*/", startIndex + 3);
1593
+ if (endIndex === -1) break;
1594
+ while (startIndex > 0 && this.css[startIndex - 1] === "\n") startIndex--;
1595
+ this.css = this.css.slice(0, startIndex) + this.css.slice(endIndex + 2);
1596
+ }
1597
+ }
1598
+ }
1599
+ generate() {
1600
+ this.clearAnnotation();
1601
+ if (pathAvailable && sourceMapAvailable && this.isMap()) return this.generateMap();
1602
+ else {
1603
+ let result = "";
1604
+ this.stringify(this.root, (i) => {
1605
+ result += i;
1606
+ });
1607
+ return [result];
1608
+ }
1609
+ }
1610
+ generateMap() {
1611
+ if (this.root) this.generateString();
1612
+ else if (this.previous().length === 1) {
1613
+ let prev = this.previous()[0].consumer();
1614
+ prev.file = this.outputFile();
1615
+ this.map = SourceMapGenerator.fromSourceMap(prev, { ignoreInvalidMapping: true });
1616
+ } else {
1617
+ this.map = new SourceMapGenerator({
1618
+ file: this.outputFile(),
1619
+ ignoreInvalidMapping: true
1620
+ });
1621
+ this.map.addMapping({
1622
+ generated: {
1623
+ column: 0,
1624
+ line: 1
1625
+ },
1626
+ original: {
1627
+ column: 0,
1628
+ line: 1
1629
+ },
1630
+ source: this.opts.from ? this.toUrl(this.path(this.opts.from)) : "<no source>"
1631
+ });
1632
+ }
1633
+ if (this.isSourcesContent()) this.setSourcesContent();
1634
+ if (this.root && this.previous().length > 0) this.applyPrevMaps();
1635
+ if (this.isAnnotation()) this.addAnnotation();
1636
+ if (this.isInline()) return [this.css];
1637
+ else return [this.css, this.map];
1638
+ }
1639
+ generateString() {
1640
+ this.css = "";
1641
+ this.map = new SourceMapGenerator({
1642
+ file: this.outputFile(),
1643
+ ignoreInvalidMapping: true
1644
+ });
1645
+ let line = 1;
1646
+ let column = 1;
1647
+ let noSource = "<no source>";
1648
+ let mapping = {
1649
+ generated: {
1650
+ column: 0,
1651
+ line: 0
1652
+ },
1653
+ original: {
1654
+ column: 0,
1655
+ line: 0
1656
+ },
1657
+ source: ""
1658
+ };
1659
+ let last, lines;
1660
+ this.stringify(this.root, (str, node, type) => {
1661
+ this.css += str;
1662
+ if (node && type !== "end") {
1663
+ mapping.generated.line = line;
1664
+ mapping.generated.column = column - 1;
1665
+ if (node.source && node.source.start) {
1666
+ mapping.source = this.sourcePath(node);
1667
+ mapping.original.line = node.source.start.line;
1668
+ mapping.original.column = node.source.start.column - 1;
1669
+ this.map.addMapping(mapping);
1670
+ } else {
1671
+ mapping.source = noSource;
1672
+ mapping.original.line = 1;
1673
+ mapping.original.column = 0;
1674
+ this.map.addMapping(mapping);
1675
+ }
1676
+ }
1677
+ lines = str.match(/\n/g);
1678
+ if (lines) {
1679
+ line += lines.length;
1680
+ last = str.lastIndexOf("\n");
1681
+ column = str.length - last;
1682
+ } else column += str.length;
1683
+ if (node && type !== "start") {
1684
+ let p = node.parent || { raws: {} };
1685
+ if (!(node.type === "decl" || node.type === "atrule" && !node.nodes) || node !== p.last || p.raws.semicolon) if (node.source && node.source.end) {
1686
+ mapping.source = this.sourcePath(node);
1687
+ mapping.original.line = node.source.end.line;
1688
+ mapping.original.column = node.source.end.column - 1;
1689
+ mapping.generated.line = line;
1690
+ mapping.generated.column = column - 2;
1691
+ this.map.addMapping(mapping);
1692
+ } else {
1693
+ mapping.source = noSource;
1694
+ mapping.original.line = 1;
1695
+ mapping.original.column = 0;
1696
+ mapping.generated.line = line;
1697
+ mapping.generated.column = column - 1;
1698
+ this.map.addMapping(mapping);
1699
+ }
1700
+ }
1701
+ });
1702
+ }
1703
+ isAnnotation() {
1704
+ if (this.isInline()) return true;
1705
+ if (typeof this.mapOpts.annotation !== "undefined") return this.mapOpts.annotation;
1706
+ if (this.previous().length) return this.previous().some((i) => i.annotation);
1707
+ return true;
1708
+ }
1709
+ isInline() {
1710
+ if (typeof this.mapOpts.inline !== "undefined") return this.mapOpts.inline;
1711
+ let annotation = this.mapOpts.annotation;
1712
+ if (typeof annotation !== "undefined" && annotation !== true) return false;
1713
+ if (this.previous().length) return this.previous().some((i) => i.inline);
1714
+ return true;
1715
+ }
1716
+ isMap() {
1717
+ if (typeof this.opts.map !== "undefined") return !!this.opts.map;
1718
+ return this.previous().length > 0;
1719
+ }
1720
+ isSourcesContent() {
1721
+ if (typeof this.mapOpts.sourcesContent !== "undefined") return this.mapOpts.sourcesContent;
1722
+ if (this.previous().length) return this.previous().some((i) => i.withContent());
1723
+ return true;
1724
+ }
1725
+ outputFile() {
1726
+ if (this.opts.to) return this.path(this.opts.to);
1727
+ else if (this.opts.from) return this.path(this.opts.from);
1728
+ else return "to.css";
1729
+ }
1730
+ path(file) {
1731
+ if (this.mapOpts.absolute) return file;
1732
+ if (file.charCodeAt(0) === 60) return file;
1733
+ if (/^\w+:\/\//.test(file)) return file;
1734
+ let cached = this.memoizedPaths.get(file);
1735
+ if (cached) return cached;
1736
+ let from = this.opts.to ? dirname(this.opts.to) : ".";
1737
+ if (typeof this.mapOpts.annotation === "string") from = dirname(resolve(from, this.mapOpts.annotation));
1738
+ let path = relative(from, file);
1739
+ this.memoizedPaths.set(file, path);
1740
+ return path;
1741
+ }
1742
+ previous() {
1743
+ if (!this.previousMaps) {
1744
+ this.previousMaps = [];
1745
+ if (this.root) this.root.walk((node) => {
1746
+ if (node.source && node.source.input.map) {
1747
+ let map = node.source.input.map;
1748
+ if (!this.previousMaps.includes(map)) this.previousMaps.push(map);
1749
+ }
1750
+ });
1751
+ else {
1752
+ let input = new Input(this.originalCSS, this.opts);
1753
+ if (input.map) this.previousMaps.push(input.map);
1754
+ }
1755
+ }
1756
+ return this.previousMaps;
1757
+ }
1758
+ setSourcesContent() {
1759
+ let already = {};
1760
+ if (this.root) this.root.walk((node) => {
1761
+ if (node.source) {
1762
+ let from = node.source.input.from;
1763
+ if (from && !already[from]) {
1764
+ already[from] = true;
1765
+ let fromUrl = this.usesFileUrls ? this.toFileUrl(from) : this.toUrl(this.path(from));
1766
+ this.map.setSourceContent(fromUrl, node.source.input.css);
1767
+ }
1768
+ }
1769
+ });
1770
+ else if (this.css) {
1771
+ let from = this.opts.from ? this.toUrl(this.path(this.opts.from)) : "<no source>";
1772
+ this.map.setSourceContent(from, this.css);
1773
+ }
1774
+ }
1775
+ sourcePath(node) {
1776
+ if (this.mapOpts.from) return this.toUrl(this.mapOpts.from);
1777
+ else if (this.usesFileUrls) return this.toFileUrl(node.source.input.from);
1778
+ else return this.toUrl(this.path(node.source.input.from));
1779
+ }
1780
+ toBase64(str) {
1781
+ if (Buffer) return Buffer.from(str).toString("base64");
1782
+ else return window.btoa(unescape(encodeURIComponent(str)));
1783
+ }
1784
+ toFileUrl(path) {
1785
+ let cached = this.memoizedFileURLs.get(path);
1786
+ if (cached) return cached;
1787
+ if (pathToFileURL) {
1788
+ let fileURL = pathToFileURL(path).toString();
1789
+ this.memoizedFileURLs.set(path, fileURL);
1790
+ return fileURL;
1791
+ } else throw new Error("`map.absolute` option is not available in this PostCSS build");
1792
+ }
1793
+ toUrl(path) {
1794
+ let cached = this.memoizedURLs.get(path);
1795
+ if (cached) return cached;
1796
+ if (sep === "\\") path = path.replace(/\\/g, "/");
1797
+ let url = encodeURI(path).replace(/[#?]/g, encodeURIComponent);
1798
+ this.memoizedURLs.set(path, url);
1799
+ return url;
1800
+ }
1801
+ };
1802
+ module.exports = MapGenerator;
1803
+ }));
1804
+ //#endregion
1805
+ //#region node_modules/.pnpm/postcss@8.5.8/node_modules/postcss/lib/tokenize.js
1806
+ var require_tokenize = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1807
+ var SINGLE_QUOTE = "'".charCodeAt(0);
1808
+ var DOUBLE_QUOTE = "\"".charCodeAt(0);
1809
+ var BACKSLASH = "\\".charCodeAt(0);
1810
+ var SLASH = "/".charCodeAt(0);
1811
+ var NEWLINE = "\n".charCodeAt(0);
1812
+ var SPACE = " ".charCodeAt(0);
1813
+ var FEED = "\f".charCodeAt(0);
1814
+ var TAB = " ".charCodeAt(0);
1815
+ var CR = "\r".charCodeAt(0);
1816
+ var OPEN_SQUARE = "[".charCodeAt(0);
1817
+ var CLOSE_SQUARE = "]".charCodeAt(0);
1818
+ var OPEN_PARENTHESES = "(".charCodeAt(0);
1819
+ var CLOSE_PARENTHESES = ")".charCodeAt(0);
1820
+ var OPEN_CURLY = "{".charCodeAt(0);
1821
+ var CLOSE_CURLY = "}".charCodeAt(0);
1822
+ var SEMICOLON = ";".charCodeAt(0);
1823
+ var ASTERISK = "*".charCodeAt(0);
1824
+ var COLON = ":".charCodeAt(0);
1825
+ var AT = "@".charCodeAt(0);
1826
+ var RE_AT_END = /[\t\n\f\r "#'()/;[\\\]{}]/g;
1827
+ var RE_WORD_END = /[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g;
1828
+ var RE_BAD_BRACKET = /.[\r\n"'(/\\]/;
1829
+ var RE_HEX_ESCAPE = /[\da-f]/i;
1830
+ module.exports = function tokenizer(input, options = {}) {
1831
+ let css = input.css.valueOf();
1832
+ let ignore = options.ignoreErrors;
1833
+ let code, content, escape, next, quote;
1834
+ let currentToken, escaped, escapePos, n, prev;
1835
+ let length = css.length;
1836
+ let pos = 0;
1837
+ let buffer = [];
1838
+ let returned = [];
1839
+ function position() {
1840
+ return pos;
1841
+ }
1842
+ function unclosed(what) {
1843
+ throw input.error("Unclosed " + what, pos);
1844
+ }
1845
+ function endOfFile() {
1846
+ return returned.length === 0 && pos >= length;
1847
+ }
1848
+ function nextToken(opts) {
1849
+ if (returned.length) return returned.pop();
1850
+ if (pos >= length) return;
1851
+ let ignoreUnclosed = opts ? opts.ignoreUnclosed : false;
1852
+ code = css.charCodeAt(pos);
1853
+ switch (code) {
1854
+ case NEWLINE:
1855
+ case SPACE:
1856
+ case TAB:
1857
+ case CR:
1858
+ case FEED:
1859
+ next = pos;
1860
+ do {
1861
+ next += 1;
1862
+ code = css.charCodeAt(next);
1863
+ } while (code === SPACE || code === NEWLINE || code === TAB || code === CR || code === FEED);
1864
+ currentToken = ["space", css.slice(pos, next)];
1865
+ pos = next - 1;
1866
+ break;
1867
+ case OPEN_SQUARE:
1868
+ case CLOSE_SQUARE:
1869
+ case OPEN_CURLY:
1870
+ case CLOSE_CURLY:
1871
+ case COLON:
1872
+ case SEMICOLON:
1873
+ case CLOSE_PARENTHESES: {
1874
+ let controlChar = String.fromCharCode(code);
1875
+ currentToken = [
1876
+ controlChar,
1877
+ controlChar,
1878
+ pos
1879
+ ];
1880
+ break;
1881
+ }
1882
+ case OPEN_PARENTHESES:
1883
+ prev = buffer.length ? buffer.pop()[1] : "";
1884
+ n = css.charCodeAt(pos + 1);
1885
+ if (prev === "url" && n !== SINGLE_QUOTE && n !== DOUBLE_QUOTE && n !== SPACE && n !== NEWLINE && n !== TAB && n !== FEED && n !== CR) {
1886
+ next = pos;
1887
+ do {
1888
+ escaped = false;
1889
+ next = css.indexOf(")", next + 1);
1890
+ if (next === -1) if (ignore || ignoreUnclosed) {
1891
+ next = pos;
1892
+ break;
1893
+ } else unclosed("bracket");
1894
+ escapePos = next;
1895
+ while (css.charCodeAt(escapePos - 1) === BACKSLASH) {
1896
+ escapePos -= 1;
1897
+ escaped = !escaped;
1898
+ }
1899
+ } while (escaped);
1900
+ currentToken = [
1901
+ "brackets",
1902
+ css.slice(pos, next + 1),
1903
+ pos,
1904
+ next
1905
+ ];
1906
+ pos = next;
1907
+ } else {
1908
+ next = css.indexOf(")", pos + 1);
1909
+ content = css.slice(pos, next + 1);
1910
+ if (next === -1 || RE_BAD_BRACKET.test(content)) currentToken = [
1911
+ "(",
1912
+ "(",
1913
+ pos
1914
+ ];
1915
+ else {
1916
+ currentToken = [
1917
+ "brackets",
1918
+ content,
1919
+ pos,
1920
+ next
1921
+ ];
1922
+ pos = next;
1923
+ }
1924
+ }
1925
+ break;
1926
+ case SINGLE_QUOTE:
1927
+ case DOUBLE_QUOTE:
1928
+ quote = code === SINGLE_QUOTE ? "'" : "\"";
1929
+ next = pos;
1930
+ do {
1931
+ escaped = false;
1932
+ next = css.indexOf(quote, next + 1);
1933
+ if (next === -1) if (ignore || ignoreUnclosed) {
1934
+ next = pos + 1;
1935
+ break;
1936
+ } else unclosed("string");
1937
+ escapePos = next;
1938
+ while (css.charCodeAt(escapePos - 1) === BACKSLASH) {
1939
+ escapePos -= 1;
1940
+ escaped = !escaped;
1941
+ }
1942
+ } while (escaped);
1943
+ currentToken = [
1944
+ "string",
1945
+ css.slice(pos, next + 1),
1946
+ pos,
1947
+ next
1948
+ ];
1949
+ pos = next;
1950
+ break;
1951
+ case AT:
1952
+ RE_AT_END.lastIndex = pos + 1;
1953
+ RE_AT_END.test(css);
1954
+ if (RE_AT_END.lastIndex === 0) next = css.length - 1;
1955
+ else next = RE_AT_END.lastIndex - 2;
1956
+ currentToken = [
1957
+ "at-word",
1958
+ css.slice(pos, next + 1),
1959
+ pos,
1960
+ next
1961
+ ];
1962
+ pos = next;
1963
+ break;
1964
+ case BACKSLASH:
1965
+ next = pos;
1966
+ escape = true;
1967
+ while (css.charCodeAt(next + 1) === BACKSLASH) {
1968
+ next += 1;
1969
+ escape = !escape;
1970
+ }
1971
+ code = css.charCodeAt(next + 1);
1972
+ if (escape && code !== SLASH && code !== SPACE && code !== NEWLINE && code !== TAB && code !== CR && code !== FEED) {
1973
+ next += 1;
1974
+ if (RE_HEX_ESCAPE.test(css.charAt(next))) {
1975
+ while (RE_HEX_ESCAPE.test(css.charAt(next + 1))) next += 1;
1976
+ if (css.charCodeAt(next + 1) === SPACE) next += 1;
1977
+ }
1978
+ }
1979
+ currentToken = [
1980
+ "word",
1981
+ css.slice(pos, next + 1),
1982
+ pos,
1983
+ next
1984
+ ];
1985
+ pos = next;
1986
+ break;
1987
+ default:
1988
+ if (code === SLASH && css.charCodeAt(pos + 1) === ASTERISK) {
1989
+ next = css.indexOf("*/", pos + 2) + 1;
1990
+ if (next === 0) if (ignore || ignoreUnclosed) next = css.length;
1991
+ else unclosed("comment");
1992
+ currentToken = [
1993
+ "comment",
1994
+ css.slice(pos, next + 1),
1995
+ pos,
1996
+ next
1997
+ ];
1998
+ pos = next;
1999
+ } else {
2000
+ RE_WORD_END.lastIndex = pos + 1;
2001
+ RE_WORD_END.test(css);
2002
+ if (RE_WORD_END.lastIndex === 0) next = css.length - 1;
2003
+ else next = RE_WORD_END.lastIndex - 2;
2004
+ currentToken = [
2005
+ "word",
2006
+ css.slice(pos, next + 1),
2007
+ pos,
2008
+ next
2009
+ ];
2010
+ buffer.push(currentToken);
2011
+ pos = next;
2012
+ }
2013
+ break;
2014
+ }
2015
+ pos++;
2016
+ return currentToken;
2017
+ }
2018
+ function back(token) {
2019
+ returned.push(token);
2020
+ }
2021
+ return {
2022
+ back,
2023
+ endOfFile,
2024
+ nextToken,
2025
+ position
2026
+ };
2027
+ };
2028
+ }));
2029
+ //#endregion
2030
+ //#region node_modules/.pnpm/postcss@8.5.8/node_modules/postcss/lib/parser.js
2031
+ var require_parser = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2032
+ var AtRule = require_at_rule();
2033
+ var Comment = require_comment();
2034
+ var Declaration = require_declaration();
2035
+ var Root = require_root();
2036
+ var Rule = require_rule();
2037
+ var tokenizer = require_tokenize();
2038
+ var SAFE_COMMENT_NEIGHBOR = {
2039
+ empty: true,
2040
+ space: true
2041
+ };
2042
+ function findLastWithPosition(tokens) {
2043
+ for (let i = tokens.length - 1; i >= 0; i--) {
2044
+ let token = tokens[i];
2045
+ let pos = token[3] || token[2];
2046
+ if (pos) return pos;
2047
+ }
2048
+ }
2049
+ var Parser = class {
2050
+ constructor(input) {
2051
+ this.input = input;
2052
+ this.root = new Root();
2053
+ this.current = this.root;
2054
+ this.spaces = "";
2055
+ this.semicolon = false;
2056
+ this.createTokenizer();
2057
+ this.root.source = {
2058
+ input,
2059
+ start: {
2060
+ column: 1,
2061
+ line: 1,
2062
+ offset: 0
2063
+ }
2064
+ };
2065
+ }
2066
+ atrule(token) {
2067
+ let node = new AtRule();
2068
+ node.name = token[1].slice(1);
2069
+ if (node.name === "") this.unnamedAtrule(node, token);
2070
+ this.init(node, token[2]);
2071
+ let type;
2072
+ let prev;
2073
+ let shift;
2074
+ let last = false;
2075
+ let open = false;
2076
+ let params = [];
2077
+ let brackets = [];
2078
+ while (!this.tokenizer.endOfFile()) {
2079
+ token = this.tokenizer.nextToken();
2080
+ type = token[0];
2081
+ if (type === "(" || type === "[") brackets.push(type === "(" ? ")" : "]");
2082
+ else if (type === "{" && brackets.length > 0) brackets.push("}");
2083
+ else if (type === brackets[brackets.length - 1]) brackets.pop();
2084
+ if (brackets.length === 0) if (type === ";") {
2085
+ node.source.end = this.getPosition(token[2]);
2086
+ node.source.end.offset++;
2087
+ this.semicolon = true;
2088
+ break;
2089
+ } else if (type === "{") {
2090
+ open = true;
2091
+ break;
2092
+ } else if (type === "}") {
2093
+ if (params.length > 0) {
2094
+ shift = params.length - 1;
2095
+ prev = params[shift];
2096
+ while (prev && prev[0] === "space") prev = params[--shift];
2097
+ if (prev) {
2098
+ node.source.end = this.getPosition(prev[3] || prev[2]);
2099
+ node.source.end.offset++;
2100
+ }
2101
+ }
2102
+ this.end(token);
2103
+ break;
2104
+ } else params.push(token);
2105
+ else params.push(token);
2106
+ if (this.tokenizer.endOfFile()) {
2107
+ last = true;
2108
+ break;
2109
+ }
2110
+ }
2111
+ node.raws.between = this.spacesAndCommentsFromEnd(params);
2112
+ if (params.length) {
2113
+ node.raws.afterName = this.spacesAndCommentsFromStart(params);
2114
+ this.raw(node, "params", params);
2115
+ if (last) {
2116
+ token = params[params.length - 1];
2117
+ node.source.end = this.getPosition(token[3] || token[2]);
2118
+ node.source.end.offset++;
2119
+ this.spaces = node.raws.between;
2120
+ node.raws.between = "";
2121
+ }
2122
+ } else {
2123
+ node.raws.afterName = "";
2124
+ node.params = "";
2125
+ }
2126
+ if (open) {
2127
+ node.nodes = [];
2128
+ this.current = node;
2129
+ }
2130
+ }
2131
+ checkMissedSemicolon(tokens) {
2132
+ let colon = this.colon(tokens);
2133
+ if (colon === false) return;
2134
+ let founded = 0;
2135
+ let token;
2136
+ for (let j = colon - 1; j >= 0; j--) {
2137
+ token = tokens[j];
2138
+ if (token[0] !== "space") {
2139
+ founded += 1;
2140
+ if (founded === 2) break;
2141
+ }
2142
+ }
2143
+ throw this.input.error("Missed semicolon", token[0] === "word" ? token[3] + 1 : token[2]);
2144
+ }
2145
+ colon(tokens) {
2146
+ let brackets = 0;
2147
+ let prev, token, type;
2148
+ for (let [i, element] of tokens.entries()) {
2149
+ token = element;
2150
+ type = token[0];
2151
+ if (type === "(") brackets += 1;
2152
+ if (type === ")") brackets -= 1;
2153
+ if (brackets === 0 && type === ":") if (!prev) this.doubleColon(token);
2154
+ else if (prev[0] === "word" && prev[1] === "progid") continue;
2155
+ else return i;
2156
+ prev = token;
2157
+ }
2158
+ return false;
2159
+ }
2160
+ comment(token) {
2161
+ let node = new Comment();
2162
+ this.init(node, token[2]);
2163
+ node.source.end = this.getPosition(token[3] || token[2]);
2164
+ node.source.end.offset++;
2165
+ let text = token[1].slice(2, -2);
2166
+ if (!text.trim()) {
2167
+ node.text = "";
2168
+ node.raws.left = text;
2169
+ node.raws.right = "";
2170
+ } else {
2171
+ let match = text.match(/^(\s*)([^]*\S)(\s*)$/);
2172
+ node.text = match[2];
2173
+ node.raws.left = match[1];
2174
+ node.raws.right = match[3];
2175
+ }
2176
+ }
2177
+ createTokenizer() {
2178
+ this.tokenizer = tokenizer(this.input);
2179
+ }
2180
+ decl(tokens, customProperty) {
2181
+ let node = new Declaration();
2182
+ this.init(node, tokens[0][2]);
2183
+ let last = tokens[tokens.length - 1];
2184
+ if (last[0] === ";") {
2185
+ this.semicolon = true;
2186
+ tokens.pop();
2187
+ }
2188
+ node.source.end = this.getPosition(last[3] || last[2] || findLastWithPosition(tokens));
2189
+ node.source.end.offset++;
2190
+ while (tokens[0][0] !== "word") {
2191
+ if (tokens.length === 1) this.unknownWord(tokens);
2192
+ node.raws.before += tokens.shift()[1];
2193
+ }
2194
+ node.source.start = this.getPosition(tokens[0][2]);
2195
+ node.prop = "";
2196
+ while (tokens.length) {
2197
+ let type = tokens[0][0];
2198
+ if (type === ":" || type === "space" || type === "comment") break;
2199
+ node.prop += tokens.shift()[1];
2200
+ }
2201
+ node.raws.between = "";
2202
+ let token;
2203
+ while (tokens.length) {
2204
+ token = tokens.shift();
2205
+ if (token[0] === ":") {
2206
+ node.raws.between += token[1];
2207
+ break;
2208
+ } else {
2209
+ if (token[0] === "word" && /\w/.test(token[1])) this.unknownWord([token]);
2210
+ node.raws.between += token[1];
2211
+ }
2212
+ }
2213
+ if (node.prop[0] === "_" || node.prop[0] === "*") {
2214
+ node.raws.before += node.prop[0];
2215
+ node.prop = node.prop.slice(1);
2216
+ }
2217
+ let firstSpaces = [];
2218
+ let next;
2219
+ while (tokens.length) {
2220
+ next = tokens[0][0];
2221
+ if (next !== "space" && next !== "comment") break;
2222
+ firstSpaces.push(tokens.shift());
2223
+ }
2224
+ this.precheckMissedSemicolon(tokens);
2225
+ for (let i = tokens.length - 1; i >= 0; i--) {
2226
+ token = tokens[i];
2227
+ if (token[1].toLowerCase() === "!important") {
2228
+ node.important = true;
2229
+ let string = this.stringFrom(tokens, i);
2230
+ string = this.spacesFromEnd(tokens) + string;
2231
+ if (string !== " !important") node.raws.important = string;
2232
+ break;
2233
+ } else if (token[1].toLowerCase() === "important") {
2234
+ let cache = tokens.slice(0);
2235
+ let str = "";
2236
+ for (let j = i; j > 0; j--) {
2237
+ let type = cache[j][0];
2238
+ if (str.trim().startsWith("!") && type !== "space") break;
2239
+ str = cache.pop()[1] + str;
2240
+ }
2241
+ if (str.trim().startsWith("!")) {
2242
+ node.important = true;
2243
+ node.raws.important = str;
2244
+ tokens = cache;
2245
+ }
2246
+ }
2247
+ if (token[0] !== "space" && token[0] !== "comment") break;
2248
+ }
2249
+ if (tokens.some((i) => i[0] !== "space" && i[0] !== "comment")) {
2250
+ node.raws.between += firstSpaces.map((i) => i[1]).join("");
2251
+ firstSpaces = [];
2252
+ }
2253
+ this.raw(node, "value", firstSpaces.concat(tokens), customProperty);
2254
+ if (node.value.includes(":") && !customProperty) this.checkMissedSemicolon(tokens);
2255
+ }
2256
+ doubleColon(token) {
2257
+ throw this.input.error("Double colon", { offset: token[2] }, { offset: token[2] + token[1].length });
2258
+ }
2259
+ emptyRule(token) {
2260
+ let node = new Rule();
2261
+ this.init(node, token[2]);
2262
+ node.selector = "";
2263
+ node.raws.between = "";
2264
+ this.current = node;
2265
+ }
2266
+ end(token) {
2267
+ if (this.current.nodes && this.current.nodes.length) this.current.raws.semicolon = this.semicolon;
2268
+ this.semicolon = false;
2269
+ this.current.raws.after = (this.current.raws.after || "") + this.spaces;
2270
+ this.spaces = "";
2271
+ if (this.current.parent) {
2272
+ this.current.source.end = this.getPosition(token[2]);
2273
+ this.current.source.end.offset++;
2274
+ this.current = this.current.parent;
2275
+ } else this.unexpectedClose(token);
2276
+ }
2277
+ endFile() {
2278
+ if (this.current.parent) this.unclosedBlock();
2279
+ if (this.current.nodes && this.current.nodes.length) this.current.raws.semicolon = this.semicolon;
2280
+ this.current.raws.after = (this.current.raws.after || "") + this.spaces;
2281
+ this.root.source.end = this.getPosition(this.tokenizer.position());
2282
+ }
2283
+ freeSemicolon(token) {
2284
+ this.spaces += token[1];
2285
+ if (this.current.nodes) {
2286
+ let prev = this.current.nodes[this.current.nodes.length - 1];
2287
+ if (prev && prev.type === "rule" && !prev.raws.ownSemicolon) {
2288
+ prev.raws.ownSemicolon = this.spaces;
2289
+ this.spaces = "";
2290
+ prev.source.end = this.getPosition(token[2]);
2291
+ prev.source.end.offset += prev.raws.ownSemicolon.length;
2292
+ }
2293
+ }
2294
+ }
2295
+ getPosition(offset) {
2296
+ let pos = this.input.fromOffset(offset);
2297
+ return {
2298
+ column: pos.col,
2299
+ line: pos.line,
2300
+ offset
2301
+ };
2302
+ }
2303
+ init(node, offset) {
2304
+ this.current.push(node);
2305
+ node.source = {
2306
+ input: this.input,
2307
+ start: this.getPosition(offset)
2308
+ };
2309
+ node.raws.before = this.spaces;
2310
+ this.spaces = "";
2311
+ if (node.type !== "comment") this.semicolon = false;
2312
+ }
2313
+ other(start) {
2314
+ let end = false;
2315
+ let type = null;
2316
+ let colon = false;
2317
+ let bracket = null;
2318
+ let brackets = [];
2319
+ let customProperty = start[1].startsWith("--");
2320
+ let tokens = [];
2321
+ let token = start;
2322
+ while (token) {
2323
+ type = token[0];
2324
+ tokens.push(token);
2325
+ if (type === "(" || type === "[") {
2326
+ if (!bracket) bracket = token;
2327
+ brackets.push(type === "(" ? ")" : "]");
2328
+ } else if (customProperty && colon && type === "{") {
2329
+ if (!bracket) bracket = token;
2330
+ brackets.push("}");
2331
+ } else if (brackets.length === 0) {
2332
+ if (type === ";") if (colon) {
2333
+ this.decl(tokens, customProperty);
2334
+ return;
2335
+ } else break;
2336
+ else if (type === "{") {
2337
+ this.rule(tokens);
2338
+ return;
2339
+ } else if (type === "}") {
2340
+ this.tokenizer.back(tokens.pop());
2341
+ end = true;
2342
+ break;
2343
+ } else if (type === ":") colon = true;
2344
+ } else if (type === brackets[brackets.length - 1]) {
2345
+ brackets.pop();
2346
+ if (brackets.length === 0) bracket = null;
2347
+ }
2348
+ token = this.tokenizer.nextToken();
2349
+ }
2350
+ if (this.tokenizer.endOfFile()) end = true;
2351
+ if (brackets.length > 0) this.unclosedBracket(bracket);
2352
+ if (end && colon) {
2353
+ if (!customProperty) while (tokens.length) {
2354
+ token = tokens[tokens.length - 1][0];
2355
+ if (token !== "space" && token !== "comment") break;
2356
+ this.tokenizer.back(tokens.pop());
2357
+ }
2358
+ this.decl(tokens, customProperty);
2359
+ } else this.unknownWord(tokens);
2360
+ }
2361
+ parse() {
2362
+ let token;
2363
+ while (!this.tokenizer.endOfFile()) {
2364
+ token = this.tokenizer.nextToken();
2365
+ switch (token[0]) {
2366
+ case "space":
2367
+ this.spaces += token[1];
2368
+ break;
2369
+ case ";":
2370
+ this.freeSemicolon(token);
2371
+ break;
2372
+ case "}":
2373
+ this.end(token);
2374
+ break;
2375
+ case "comment":
2376
+ this.comment(token);
2377
+ break;
2378
+ case "at-word":
2379
+ this.atrule(token);
2380
+ break;
2381
+ case "{":
2382
+ this.emptyRule(token);
2383
+ break;
2384
+ default:
2385
+ this.other(token);
2386
+ break;
2387
+ }
2388
+ }
2389
+ this.endFile();
2390
+ }
2391
+ precheckMissedSemicolon() {}
2392
+ raw(node, prop, tokens, customProperty) {
2393
+ let token, type;
2394
+ let length = tokens.length;
2395
+ let value = "";
2396
+ let clean = true;
2397
+ let next, prev;
2398
+ for (let i = 0; i < length; i += 1) {
2399
+ token = tokens[i];
2400
+ type = token[0];
2401
+ if (type === "space" && i === length - 1 && !customProperty) clean = false;
2402
+ else if (type === "comment") {
2403
+ prev = tokens[i - 1] ? tokens[i - 1][0] : "empty";
2404
+ next = tokens[i + 1] ? tokens[i + 1][0] : "empty";
2405
+ if (!SAFE_COMMENT_NEIGHBOR[prev] && !SAFE_COMMENT_NEIGHBOR[next]) if (value.slice(-1) === ",") clean = false;
2406
+ else value += token[1];
2407
+ else clean = false;
2408
+ } else value += token[1];
2409
+ }
2410
+ if (!clean) {
2411
+ let raw = tokens.reduce((all, i) => all + i[1], "");
2412
+ node.raws[prop] = {
2413
+ raw,
2414
+ value
2415
+ };
2416
+ }
2417
+ node[prop] = value;
2418
+ }
2419
+ rule(tokens) {
2420
+ tokens.pop();
2421
+ let node = new Rule();
2422
+ this.init(node, tokens[0][2]);
2423
+ node.raws.between = this.spacesAndCommentsFromEnd(tokens);
2424
+ this.raw(node, "selector", tokens);
2425
+ this.current = node;
2426
+ }
2427
+ spacesAndCommentsFromEnd(tokens) {
2428
+ let lastTokenType;
2429
+ let spaces = "";
2430
+ while (tokens.length) {
2431
+ lastTokenType = tokens[tokens.length - 1][0];
2432
+ if (lastTokenType !== "space" && lastTokenType !== "comment") break;
2433
+ spaces = tokens.pop()[1] + spaces;
2434
+ }
2435
+ return spaces;
2436
+ }
2437
+ spacesAndCommentsFromStart(tokens) {
2438
+ let next;
2439
+ let spaces = "";
2440
+ while (tokens.length) {
2441
+ next = tokens[0][0];
2442
+ if (next !== "space" && next !== "comment") break;
2443
+ spaces += tokens.shift()[1];
2444
+ }
2445
+ return spaces;
2446
+ }
2447
+ spacesFromEnd(tokens) {
2448
+ let lastTokenType;
2449
+ let spaces = "";
2450
+ while (tokens.length) {
2451
+ lastTokenType = tokens[tokens.length - 1][0];
2452
+ if (lastTokenType !== "space") break;
2453
+ spaces = tokens.pop()[1] + spaces;
2454
+ }
2455
+ return spaces;
2456
+ }
2457
+ stringFrom(tokens, from) {
2458
+ let result = "";
2459
+ for (let i = from; i < tokens.length; i++) result += tokens[i][1];
2460
+ tokens.splice(from, tokens.length - from);
2461
+ return result;
2462
+ }
2463
+ unclosedBlock() {
2464
+ let pos = this.current.source.start;
2465
+ throw this.input.error("Unclosed block", pos.line, pos.column);
2466
+ }
2467
+ unclosedBracket(bracket) {
2468
+ throw this.input.error("Unclosed bracket", { offset: bracket[2] }, { offset: bracket[2] + 1 });
2469
+ }
2470
+ unexpectedClose(token) {
2471
+ throw this.input.error("Unexpected }", { offset: token[2] }, { offset: token[2] + 1 });
2472
+ }
2473
+ unknownWord(tokens) {
2474
+ throw this.input.error("Unknown word " + tokens[0][1], { offset: tokens[0][2] }, { offset: tokens[0][2] + tokens[0][1].length });
2475
+ }
2476
+ unnamedAtrule(node, token) {
2477
+ throw this.input.error("At-rule without name", { offset: token[2] }, { offset: token[2] + token[1].length });
2478
+ }
2479
+ };
2480
+ module.exports = Parser;
2481
+ }));
2482
+ //#endregion
2483
+ //#region node_modules/.pnpm/postcss@8.5.8/node_modules/postcss/lib/parse.js
2484
+ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2485
+ var Container = require_container();
2486
+ var Input = require_input();
2487
+ var Parser = require_parser();
2488
+ function parse(css, opts) {
2489
+ let parser = new Parser(new Input(css, opts));
2490
+ try {
2491
+ parser.parse();
2492
+ } catch (e) {
2493
+ if (process.env.NODE_ENV !== "production") {
2494
+ if (e.name === "CssSyntaxError" && opts && opts.from) {
2495
+ if (/\.scss$/i.test(opts.from)) e.message += "\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser";
2496
+ else if (/\.sass/i.test(opts.from)) e.message += "\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser";
2497
+ else if (/\.less$/i.test(opts.from)) e.message += "\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser";
2498
+ }
2499
+ }
2500
+ throw e;
2501
+ }
2502
+ return parser.root;
2503
+ }
2504
+ module.exports = parse;
2505
+ parse.default = parse;
2506
+ Container.registerParse(parse);
2507
+ }));
2508
+ //#endregion
2509
+ //#region node_modules/.pnpm/postcss@8.5.8/node_modules/postcss/lib/warning.js
2510
+ var require_warning = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2511
+ var Warning = class {
2512
+ constructor(text, opts = {}) {
2513
+ this.type = "warning";
2514
+ this.text = text;
2515
+ if (opts.node && opts.node.source) {
2516
+ let range = opts.node.rangeBy(opts);
2517
+ this.line = range.start.line;
2518
+ this.column = range.start.column;
2519
+ this.endLine = range.end.line;
2520
+ this.endColumn = range.end.column;
2521
+ }
2522
+ for (let opt in opts) this[opt] = opts[opt];
2523
+ }
2524
+ toString() {
2525
+ if (this.node) return this.node.error(this.text, {
2526
+ index: this.index,
2527
+ plugin: this.plugin,
2528
+ word: this.word
2529
+ }).message;
2530
+ if (this.plugin) return this.plugin + ": " + this.text;
2531
+ return this.text;
2532
+ }
2533
+ };
2534
+ module.exports = Warning;
2535
+ Warning.default = Warning;
2536
+ }));
2537
+ //#endregion
2538
+ //#region node_modules/.pnpm/postcss@8.5.8/node_modules/postcss/lib/result.js
2539
+ var require_result = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2540
+ var Warning = require_warning();
2541
+ var Result = class {
2542
+ get content() {
2543
+ return this.css;
2544
+ }
2545
+ constructor(processor, root, opts) {
2546
+ this.processor = processor;
2547
+ this.messages = [];
2548
+ this.root = root;
2549
+ this.opts = opts;
2550
+ this.css = "";
2551
+ this.map = void 0;
2552
+ }
2553
+ toString() {
2554
+ return this.css;
2555
+ }
2556
+ warn(text, opts = {}) {
2557
+ if (!opts.plugin) {
2558
+ if (this.lastPlugin && this.lastPlugin.postcssPlugin) opts.plugin = this.lastPlugin.postcssPlugin;
2559
+ }
2560
+ let warning = new Warning(text, opts);
2561
+ this.messages.push(warning);
2562
+ return warning;
2563
+ }
2564
+ warnings() {
2565
+ return this.messages.filter((i) => i.type === "warning");
2566
+ }
2567
+ };
2568
+ module.exports = Result;
2569
+ Result.default = Result;
2570
+ }));
2571
+ //#endregion
2572
+ //#region node_modules/.pnpm/postcss@8.5.8/node_modules/postcss/lib/warn-once.js
2573
+ var require_warn_once = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2574
+ var printed = {};
2575
+ module.exports = function warnOnce(message) {
2576
+ if (printed[message]) return;
2577
+ printed[message] = true;
2578
+ if (typeof console !== "undefined" && console.warn) console.warn(message);
2579
+ };
2580
+ }));
2581
+ //#endregion
2582
+ //#region node_modules/.pnpm/postcss@8.5.8/node_modules/postcss/lib/lazy-result.js
2583
+ var require_lazy_result = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2584
+ var Container = require_container();
2585
+ var Document = require_document();
2586
+ var MapGenerator = require_map_generator();
2587
+ var parse = require_parse();
2588
+ var Result = require_result();
2589
+ var Root = require_root();
2590
+ var stringify = require_stringify();
2591
+ var { isClean, my } = require_symbols();
2592
+ var warnOnce = require_warn_once();
2593
+ var TYPE_TO_CLASS_NAME = {
2594
+ atrule: "AtRule",
2595
+ comment: "Comment",
2596
+ decl: "Declaration",
2597
+ document: "Document",
2598
+ root: "Root",
2599
+ rule: "Rule"
2600
+ };
2601
+ var PLUGIN_PROPS = {
2602
+ AtRule: true,
2603
+ AtRuleExit: true,
2604
+ Comment: true,
2605
+ CommentExit: true,
2606
+ Declaration: true,
2607
+ DeclarationExit: true,
2608
+ Document: true,
2609
+ DocumentExit: true,
2610
+ Once: true,
2611
+ OnceExit: true,
2612
+ postcssPlugin: true,
2613
+ prepare: true,
2614
+ Root: true,
2615
+ RootExit: true,
2616
+ Rule: true,
2617
+ RuleExit: true
2618
+ };
2619
+ var NOT_VISITORS = {
2620
+ Once: true,
2621
+ postcssPlugin: true,
2622
+ prepare: true
2623
+ };
2624
+ var CHILDREN = 0;
2625
+ function isPromise(obj) {
2626
+ return typeof obj === "object" && typeof obj.then === "function";
2627
+ }
2628
+ function getEvents(node) {
2629
+ let key = false;
2630
+ let type = TYPE_TO_CLASS_NAME[node.type];
2631
+ if (node.type === "decl") key = node.prop.toLowerCase();
2632
+ else if (node.type === "atrule") key = node.name.toLowerCase();
2633
+ if (key && node.append) return [
2634
+ type,
2635
+ type + "-" + key,
2636
+ CHILDREN,
2637
+ type + "Exit",
2638
+ type + "Exit-" + key
2639
+ ];
2640
+ else if (key) return [
2641
+ type,
2642
+ type + "-" + key,
2643
+ type + "Exit",
2644
+ type + "Exit-" + key
2645
+ ];
2646
+ else if (node.append) return [
2647
+ type,
2648
+ CHILDREN,
2649
+ type + "Exit"
2650
+ ];
2651
+ else return [type, type + "Exit"];
2652
+ }
2653
+ function toStack(node) {
2654
+ let events;
2655
+ if (node.type === "document") events = [
2656
+ "Document",
2657
+ CHILDREN,
2658
+ "DocumentExit"
2659
+ ];
2660
+ else if (node.type === "root") events = [
2661
+ "Root",
2662
+ CHILDREN,
2663
+ "RootExit"
2664
+ ];
2665
+ else events = getEvents(node);
2666
+ return {
2667
+ eventIndex: 0,
2668
+ events,
2669
+ iterator: 0,
2670
+ node,
2671
+ visitorIndex: 0,
2672
+ visitors: []
2673
+ };
2674
+ }
2675
+ function cleanMarks(node) {
2676
+ node[isClean] = false;
2677
+ if (node.nodes) node.nodes.forEach((i) => cleanMarks(i));
2678
+ return node;
2679
+ }
2680
+ var postcss = {};
2681
+ var LazyResult = class LazyResult {
2682
+ get content() {
2683
+ return this.stringify().content;
2684
+ }
2685
+ get css() {
2686
+ return this.stringify().css;
2687
+ }
2688
+ get map() {
2689
+ return this.stringify().map;
2690
+ }
2691
+ get messages() {
2692
+ return this.sync().messages;
2693
+ }
2694
+ get opts() {
2695
+ return this.result.opts;
2696
+ }
2697
+ get processor() {
2698
+ return this.result.processor;
2699
+ }
2700
+ get root() {
2701
+ return this.sync().root;
2702
+ }
2703
+ get [Symbol.toStringTag]() {
2704
+ return "LazyResult";
2705
+ }
2706
+ constructor(processor, css, opts) {
2707
+ this.stringified = false;
2708
+ this.processed = false;
2709
+ let root;
2710
+ if (typeof css === "object" && css !== null && (css.type === "root" || css.type === "document")) root = cleanMarks(css);
2711
+ else if (css instanceof LazyResult || css instanceof Result) {
2712
+ root = cleanMarks(css.root);
2713
+ if (css.map) {
2714
+ if (typeof opts.map === "undefined") opts.map = {};
2715
+ if (!opts.map.inline) opts.map.inline = false;
2716
+ opts.map.prev = css.map;
2717
+ }
2718
+ } else {
2719
+ let parser = parse;
2720
+ if (opts.syntax) parser = opts.syntax.parse;
2721
+ if (opts.parser) parser = opts.parser;
2722
+ if (parser.parse) parser = parser.parse;
2723
+ try {
2724
+ root = parser(css, opts);
2725
+ } catch (error) {
2726
+ this.processed = true;
2727
+ this.error = error;
2728
+ }
2729
+ if (root && !root[my])
2730
+ /* c8 ignore next 2 */
2731
+ Container.rebuild(root);
2732
+ }
2733
+ this.result = new Result(processor, root, opts);
2734
+ this.helpers = {
2735
+ ...postcss,
2736
+ postcss,
2737
+ result: this.result
2738
+ };
2739
+ this.plugins = this.processor.plugins.map((plugin) => {
2740
+ if (typeof plugin === "object" && plugin.prepare) return {
2741
+ ...plugin,
2742
+ ...plugin.prepare(this.result)
2743
+ };
2744
+ else return plugin;
2745
+ });
2746
+ }
2747
+ async() {
2748
+ if (this.error) return Promise.reject(this.error);
2749
+ if (this.processed) return Promise.resolve(this.result);
2750
+ if (!this.processing) this.processing = this.runAsync();
2751
+ return this.processing;
2752
+ }
2753
+ catch(onRejected) {
2754
+ return this.async().catch(onRejected);
2755
+ }
2756
+ finally(onFinally) {
2757
+ return this.async().then(onFinally, onFinally);
2758
+ }
2759
+ getAsyncError() {
2760
+ throw new Error("Use process(css).then(cb) to work with async plugins");
2761
+ }
2762
+ handleError(error, node) {
2763
+ let plugin = this.result.lastPlugin;
2764
+ try {
2765
+ if (node) node.addToError(error);
2766
+ this.error = error;
2767
+ if (error.name === "CssSyntaxError" && !error.plugin) {
2768
+ error.plugin = plugin.postcssPlugin;
2769
+ error.setMessage();
2770
+ } else if (plugin.postcssVersion) {
2771
+ if (process.env.NODE_ENV !== "production") {
2772
+ let pluginName = plugin.postcssPlugin;
2773
+ let pluginVer = plugin.postcssVersion;
2774
+ let runtimeVer = this.result.processor.version;
2775
+ let a = pluginVer.split(".");
2776
+ let b = runtimeVer.split(".");
2777
+ if (a[0] !== b[0] || parseInt(a[1]) > parseInt(b[1])) console.error("Unknown error from PostCSS plugin. Your current PostCSS version is " + runtimeVer + ", but " + pluginName + " uses " + pluginVer + ". Perhaps this is the source of the error below.");
2778
+ }
2779
+ }
2780
+ } catch (err) {
2781
+ /* c8 ignore next 3 */
2782
+ if (console && console.error) console.error(err);
2783
+ }
2784
+ return error;
2785
+ }
2786
+ prepareVisitors() {
2787
+ this.listeners = {};
2788
+ let add = (plugin, type, cb) => {
2789
+ if (!this.listeners[type]) this.listeners[type] = [];
2790
+ this.listeners[type].push([plugin, cb]);
2791
+ };
2792
+ for (let plugin of this.plugins) if (typeof plugin === "object") for (let event in plugin) {
2793
+ if (!PLUGIN_PROPS[event] && /^[A-Z]/.test(event)) throw new Error(`Unknown event ${event} in ${plugin.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);
2794
+ if (!NOT_VISITORS[event]) {
2795
+ if (typeof plugin[event] === "object") for (let filter in plugin[event]) if (filter === "*") add(plugin, event, plugin[event][filter]);
2796
+ else add(plugin, event + "-" + filter.toLowerCase(), plugin[event][filter]);
2797
+ else if (typeof plugin[event] === "function") add(plugin, event, plugin[event]);
2798
+ }
2799
+ }
2800
+ this.hasListener = Object.keys(this.listeners).length > 0;
2801
+ }
2802
+ async runAsync() {
2803
+ this.plugin = 0;
2804
+ for (let i = 0; i < this.plugins.length; i++) {
2805
+ let plugin = this.plugins[i];
2806
+ let promise = this.runOnRoot(plugin);
2807
+ if (isPromise(promise)) try {
2808
+ await promise;
2809
+ } catch (error) {
2810
+ throw this.handleError(error);
2811
+ }
2812
+ }
2813
+ this.prepareVisitors();
2814
+ if (this.hasListener) {
2815
+ let root = this.result.root;
2816
+ while (!root[isClean]) {
2817
+ root[isClean] = true;
2818
+ let stack = [toStack(root)];
2819
+ while (stack.length > 0) {
2820
+ let promise = this.visitTick(stack);
2821
+ if (isPromise(promise)) try {
2822
+ await promise;
2823
+ } catch (e) {
2824
+ let node = stack[stack.length - 1].node;
2825
+ throw this.handleError(e, node);
2826
+ }
2827
+ }
2828
+ }
2829
+ if (this.listeners.OnceExit) for (let [plugin, visitor] of this.listeners.OnceExit) {
2830
+ this.result.lastPlugin = plugin;
2831
+ try {
2832
+ if (root.type === "document") {
2833
+ let roots = root.nodes.map((subRoot) => visitor(subRoot, this.helpers));
2834
+ await Promise.all(roots);
2835
+ } else await visitor(root, this.helpers);
2836
+ } catch (e) {
2837
+ throw this.handleError(e);
2838
+ }
2839
+ }
2840
+ }
2841
+ this.processed = true;
2842
+ return this.stringify();
2843
+ }
2844
+ runOnRoot(plugin) {
2845
+ this.result.lastPlugin = plugin;
2846
+ try {
2847
+ if (typeof plugin === "object" && plugin.Once) {
2848
+ if (this.result.root.type === "document") {
2849
+ let roots = this.result.root.nodes.map((root) => plugin.Once(root, this.helpers));
2850
+ if (isPromise(roots[0])) return Promise.all(roots);
2851
+ return roots;
2852
+ }
2853
+ return plugin.Once(this.result.root, this.helpers);
2854
+ } else if (typeof plugin === "function") return plugin(this.result.root, this.result);
2855
+ } catch (error) {
2856
+ throw this.handleError(error);
2857
+ }
2858
+ }
2859
+ stringify() {
2860
+ if (this.error) throw this.error;
2861
+ if (this.stringified) return this.result;
2862
+ this.stringified = true;
2863
+ this.sync();
2864
+ let opts = this.result.opts;
2865
+ let str = stringify;
2866
+ if (opts.syntax) str = opts.syntax.stringify;
2867
+ if (opts.stringifier) str = opts.stringifier;
2868
+ if (str.stringify) str = str.stringify;
2869
+ let data = new MapGenerator(str, this.result.root, this.result.opts).generate();
2870
+ this.result.css = data[0];
2871
+ this.result.map = data[1];
2872
+ return this.result;
2873
+ }
2874
+ sync() {
2875
+ if (this.error) throw this.error;
2876
+ if (this.processed) return this.result;
2877
+ this.processed = true;
2878
+ if (this.processing) throw this.getAsyncError();
2879
+ for (let plugin of this.plugins) if (isPromise(this.runOnRoot(plugin))) throw this.getAsyncError();
2880
+ this.prepareVisitors();
2881
+ if (this.hasListener) {
2882
+ let root = this.result.root;
2883
+ while (!root[isClean]) {
2884
+ root[isClean] = true;
2885
+ this.walkSync(root);
2886
+ }
2887
+ if (this.listeners.OnceExit) if (root.type === "document") for (let subRoot of root.nodes) this.visitSync(this.listeners.OnceExit, subRoot);
2888
+ else this.visitSync(this.listeners.OnceExit, root);
2889
+ }
2890
+ return this.result;
2891
+ }
2892
+ then(onFulfilled, onRejected) {
2893
+ if (process.env.NODE_ENV !== "production") {
2894
+ if (!("from" in this.opts)) warnOnce("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.");
2895
+ }
2896
+ return this.async().then(onFulfilled, onRejected);
2897
+ }
2898
+ toString() {
2899
+ return this.css;
2900
+ }
2901
+ visitSync(visitors, node) {
2902
+ for (let [plugin, visitor] of visitors) {
2903
+ this.result.lastPlugin = plugin;
2904
+ let promise;
2905
+ try {
2906
+ promise = visitor(node, this.helpers);
2907
+ } catch (e) {
2908
+ throw this.handleError(e, node.proxyOf);
2909
+ }
2910
+ if (node.type !== "root" && node.type !== "document" && !node.parent) return true;
2911
+ if (isPromise(promise)) throw this.getAsyncError();
2912
+ }
2913
+ }
2914
+ visitTick(stack) {
2915
+ let visit = stack[stack.length - 1];
2916
+ let { node, visitors } = visit;
2917
+ if (node.type !== "root" && node.type !== "document" && !node.parent) {
2918
+ stack.pop();
2919
+ return;
2920
+ }
2921
+ if (visitors.length > 0 && visit.visitorIndex < visitors.length) {
2922
+ let [plugin, visitor] = visitors[visit.visitorIndex];
2923
+ visit.visitorIndex += 1;
2924
+ if (visit.visitorIndex === visitors.length) {
2925
+ visit.visitors = [];
2926
+ visit.visitorIndex = 0;
2927
+ }
2928
+ this.result.lastPlugin = plugin;
2929
+ try {
2930
+ return visitor(node.toProxy(), this.helpers);
2931
+ } catch (e) {
2932
+ throw this.handleError(e, node);
2933
+ }
2934
+ }
2935
+ if (visit.iterator !== 0) {
2936
+ let iterator = visit.iterator;
2937
+ let child;
2938
+ while (child = node.nodes[node.indexes[iterator]]) {
2939
+ node.indexes[iterator] += 1;
2940
+ if (!child[isClean]) {
2941
+ child[isClean] = true;
2942
+ stack.push(toStack(child));
2943
+ return;
2944
+ }
2945
+ }
2946
+ visit.iterator = 0;
2947
+ delete node.indexes[iterator];
2948
+ }
2949
+ let events = visit.events;
2950
+ while (visit.eventIndex < events.length) {
2951
+ let event = events[visit.eventIndex];
2952
+ visit.eventIndex += 1;
2953
+ if (event === CHILDREN) {
2954
+ if (node.nodes && node.nodes.length) {
2955
+ node[isClean] = true;
2956
+ visit.iterator = node.getIterator();
2957
+ }
2958
+ return;
2959
+ } else if (this.listeners[event]) {
2960
+ visit.visitors = this.listeners[event];
2961
+ return;
2962
+ }
2963
+ }
2964
+ stack.pop();
2965
+ }
2966
+ walkSync(node) {
2967
+ node[isClean] = true;
2968
+ let events = getEvents(node);
2969
+ for (let event of events) if (event === CHILDREN) {
2970
+ if (node.nodes) node.each((child) => {
2971
+ if (!child[isClean]) this.walkSync(child);
2972
+ });
2973
+ } else {
2974
+ let visitors = this.listeners[event];
2975
+ if (visitors) {
2976
+ if (this.visitSync(visitors, node.toProxy())) return;
2977
+ }
2978
+ }
2979
+ }
2980
+ warnings() {
2981
+ return this.sync().warnings();
2982
+ }
2983
+ };
2984
+ LazyResult.registerPostcss = (dependant) => {
2985
+ postcss = dependant;
2986
+ };
2987
+ module.exports = LazyResult;
2988
+ LazyResult.default = LazyResult;
2989
+ Root.registerLazyResult(LazyResult);
2990
+ Document.registerLazyResult(LazyResult);
2991
+ }));
2992
+ //#endregion
2993
+ //#region node_modules/.pnpm/postcss@8.5.8/node_modules/postcss/lib/no-work-result.js
2994
+ var require_no_work_result = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2995
+ var MapGenerator = require_map_generator();
2996
+ var parse = require_parse();
2997
+ var Result = require_result();
2998
+ var stringify = require_stringify();
2999
+ var warnOnce = require_warn_once();
3000
+ var NoWorkResult = class {
3001
+ get content() {
3002
+ return this.result.css;
3003
+ }
3004
+ get css() {
3005
+ return this.result.css;
3006
+ }
3007
+ get map() {
3008
+ return this.result.map;
3009
+ }
3010
+ get messages() {
3011
+ return [];
3012
+ }
3013
+ get opts() {
3014
+ return this.result.opts;
3015
+ }
3016
+ get processor() {
3017
+ return this.result.processor;
3018
+ }
3019
+ get root() {
3020
+ if (this._root) return this._root;
3021
+ let root;
3022
+ let parser = parse;
3023
+ try {
3024
+ root = parser(this._css, this._opts);
3025
+ } catch (error) {
3026
+ this.error = error;
3027
+ }
3028
+ if (this.error) throw this.error;
3029
+ else {
3030
+ this._root = root;
3031
+ return root;
3032
+ }
3033
+ }
3034
+ get [Symbol.toStringTag]() {
3035
+ return "NoWorkResult";
3036
+ }
3037
+ constructor(processor, css, opts) {
3038
+ css = css.toString();
3039
+ this.stringified = false;
3040
+ this._processor = processor;
3041
+ this._css = css;
3042
+ this._opts = opts;
3043
+ this._map = void 0;
3044
+ let str = stringify;
3045
+ this.result = new Result(this._processor, void 0, this._opts);
3046
+ this.result.css = css;
3047
+ let self = this;
3048
+ Object.defineProperty(this.result, "root", { get() {
3049
+ return self.root;
3050
+ } });
3051
+ let map = new MapGenerator(str, void 0, this._opts, css);
3052
+ if (map.isMap()) {
3053
+ let [generatedCSS, generatedMap] = map.generate();
3054
+ if (generatedCSS) this.result.css = generatedCSS;
3055
+ if (generatedMap) this.result.map = generatedMap;
3056
+ } else {
3057
+ map.clearAnnotation();
3058
+ this.result.css = map.css;
3059
+ }
3060
+ }
3061
+ async() {
3062
+ if (this.error) return Promise.reject(this.error);
3063
+ return Promise.resolve(this.result);
3064
+ }
3065
+ catch(onRejected) {
3066
+ return this.async().catch(onRejected);
3067
+ }
3068
+ finally(onFinally) {
3069
+ return this.async().then(onFinally, onFinally);
3070
+ }
3071
+ sync() {
3072
+ if (this.error) throw this.error;
3073
+ return this.result;
3074
+ }
3075
+ then(onFulfilled, onRejected) {
3076
+ if (process.env.NODE_ENV !== "production") {
3077
+ if (!("from" in this._opts)) warnOnce("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.");
3078
+ }
3079
+ return this.async().then(onFulfilled, onRejected);
3080
+ }
3081
+ toString() {
3082
+ return this._css;
3083
+ }
3084
+ warnings() {
3085
+ return [];
3086
+ }
3087
+ };
3088
+ module.exports = NoWorkResult;
3089
+ NoWorkResult.default = NoWorkResult;
3090
+ }));
3091
+ //#endregion
3092
+ //#region node_modules/.pnpm/postcss@8.5.8/node_modules/postcss/lib/processor.js
3093
+ var require_processor = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3094
+ var Document = require_document();
3095
+ var LazyResult = require_lazy_result();
3096
+ var NoWorkResult = require_no_work_result();
3097
+ var Root = require_root();
3098
+ var Processor = class {
3099
+ constructor(plugins = []) {
3100
+ this.version = "8.5.8";
3101
+ this.plugins = this.normalize(plugins);
3102
+ }
3103
+ normalize(plugins) {
3104
+ let normalized = [];
3105
+ for (let i of plugins) {
3106
+ if (i.postcss === true) i = i();
3107
+ else if (i.postcss) i = i.postcss;
3108
+ if (typeof i === "object" && Array.isArray(i.plugins)) normalized = normalized.concat(i.plugins);
3109
+ else if (typeof i === "object" && i.postcssPlugin) normalized.push(i);
3110
+ else if (typeof i === "function") normalized.push(i);
3111
+ else if (typeof i === "object" && (i.parse || i.stringify)) {
3112
+ if (process.env.NODE_ENV !== "production") throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.");
3113
+ } else throw new Error(i + " is not a PostCSS plugin");
3114
+ }
3115
+ return normalized;
3116
+ }
3117
+ process(css, opts = {}) {
3118
+ if (!this.plugins.length && !opts.parser && !opts.stringifier && !opts.syntax) return new NoWorkResult(this, css, opts);
3119
+ else return new LazyResult(this, css, opts);
3120
+ }
3121
+ use(plugin) {
3122
+ this.plugins = this.plugins.concat(this.normalize([plugin]));
3123
+ return this;
3124
+ }
3125
+ };
3126
+ module.exports = Processor;
3127
+ Processor.default = Processor;
3128
+ Root.registerProcessor(Processor);
3129
+ Document.registerProcessor(Processor);
3130
+ }));
3131
+ //#endregion
3132
+ //#region node_modules/.pnpm/postcss@8.5.8/node_modules/postcss/lib/postcss.mjs
3133
+ var import_postcss = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
3134
+ var AtRule = require_at_rule();
3135
+ var Comment = require_comment();
3136
+ var Container = require_container();
3137
+ var CssSyntaxError = require_css_syntax_error();
3138
+ var Declaration = require_declaration();
3139
+ var Document = require_document();
3140
+ var fromJSON = require_fromJSON();
3141
+ var Input = require_input();
3142
+ var LazyResult = require_lazy_result();
3143
+ var list = require_list();
3144
+ var Node = require_node();
3145
+ var parse = require_parse();
3146
+ var Processor = require_processor();
3147
+ var Result = require_result();
3148
+ var Root = require_root();
3149
+ var Rule = require_rule();
3150
+ var stringify = require_stringify();
3151
+ var Warning = require_warning();
3152
+ function postcss(...plugins) {
3153
+ if (plugins.length === 1 && Array.isArray(plugins[0])) plugins = plugins[0];
3154
+ return new Processor(plugins);
3155
+ }
3156
+ postcss.plugin = function plugin(name, initializer) {
3157
+ let warningPrinted = false;
3158
+ function creator(...args) {
3159
+ if (console && console.warn && !warningPrinted) {
3160
+ warningPrinted = true;
3161
+ console.warn(name + ": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration");
3162
+ if (process.env.LANG && process.env.LANG.startsWith("cn"))
3163
+ /* c8 ignore next 7 */
3164
+ console.warn(name + ": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226");
3165
+ }
3166
+ let transformer = initializer(...args);
3167
+ transformer.postcssPlugin = name;
3168
+ transformer.postcssVersion = new Processor().version;
3169
+ return transformer;
3170
+ }
3171
+ let cache;
3172
+ Object.defineProperty(creator, "postcss", { get() {
3173
+ if (!cache) cache = creator();
3174
+ return cache;
3175
+ } });
3176
+ creator.process = function(css, processOpts, pluginOpts) {
3177
+ return postcss([creator(pluginOpts)]).process(css, processOpts);
3178
+ };
3179
+ return creator;
3180
+ };
3181
+ postcss.stringify = stringify;
3182
+ postcss.parse = parse;
3183
+ postcss.fromJSON = fromJSON;
3184
+ postcss.list = list;
3185
+ postcss.comment = (defaults) => new Comment(defaults);
3186
+ postcss.atRule = (defaults) => new AtRule(defaults);
3187
+ postcss.decl = (defaults) => new Declaration(defaults);
3188
+ postcss.rule = (defaults) => new Rule(defaults);
3189
+ postcss.root = (defaults) => new Root(defaults);
3190
+ postcss.document = (defaults) => new Document(defaults);
3191
+ postcss.CssSyntaxError = CssSyntaxError;
3192
+ postcss.Declaration = Declaration;
3193
+ postcss.Container = Container;
3194
+ postcss.Processor = Processor;
3195
+ postcss.Document = Document;
3196
+ postcss.Comment = Comment;
3197
+ postcss.Warning = Warning;
3198
+ postcss.AtRule = AtRule;
3199
+ postcss.Result = Result;
3200
+ postcss.Input = Input;
3201
+ postcss.Rule = Rule;
3202
+ postcss.Root = Root;
3203
+ postcss.Node = Node;
3204
+ LazyResult.registerPostcss(postcss);
3205
+ module.exports = postcss;
3206
+ postcss.default = postcss;
3207
+ })))(), 1);
3208
+ var postcss_default = import_postcss.default;
3209
+ var stringify = import_postcss.default.stringify;
3210
+ var fromJSON = import_postcss.default.fromJSON;
3211
+ var plugin = import_postcss.default.plugin;
3212
+ var parse = import_postcss.default.parse;
3213
+ var list = import_postcss.default.list;
3214
+ var document = import_postcss.default.document;
3215
+ var comment = import_postcss.default.comment;
3216
+ var atRule = import_postcss.default.atRule;
3217
+ var rule = import_postcss.default.rule;
3218
+ var decl = import_postcss.default.decl;
3219
+ var root = import_postcss.default.root;
3220
+ var CssSyntaxError = import_postcss.default.CssSyntaxError;
3221
+ var Declaration = import_postcss.default.Declaration;
3222
+ var Container = import_postcss.default.Container;
3223
+ var Processor = import_postcss.default.Processor;
3224
+ var Document = import_postcss.default.Document;
3225
+ var Comment = import_postcss.default.Comment;
3226
+ var Warning = import_postcss.default.Warning;
3227
+ var AtRule = import_postcss.default.AtRule;
3228
+ var Result = import_postcss.default.Result;
3229
+ var Input = import_postcss.default.Input;
3230
+ var Rule = import_postcss.default.Rule;
3231
+ var Root = import_postcss.default.Root;
3232
+ var Node = import_postcss.default.Node;
3233
+ //#endregion
3234
+ export { AtRule, Comment, Container, CssSyntaxError, Declaration, Document, Input, Node, Processor, Result, Root, Rule, Warning, atRule, comment, decl, postcss_default as default, document, fromJSON, list, parse, plugin, root, rule, stringify };
3235
+
3236
+ //# sourceMappingURL=postcss.mjs.map