@weapp-tailwindcss/postcss 3.3.6 → 3.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/syntax.cjs CHANGED
@@ -25,7 +25,6 @@ let _weapp_tailwindcss_engine = require("@weapp-tailwindcss/engine");
25
25
  let _weapp_tailwindcss_source_scan = require("@weapp-tailwindcss/source-scan");
26
26
  let node_path = require("node:path");
27
27
  node_path = __toESM(node_path, 1);
28
- let _csstools_css_tokenizer = require("@csstools/css-tokenizer");
29
28
  let node_module = require("node:module");
30
29
  let tailwindcss_config = require("tailwindcss-config");
31
30
  let postcss = require("postcss");
@@ -203,9 +202,630 @@ async function expandTailwindSourceEntries(entries, options = {}) {
203
202
  }));
204
203
  }
205
204
  //#endregion
205
+ //#region ../../node_modules/.pnpm/@csstools+css-tokenizer@4.0.1/node_modules/@csstools/css-tokenizer/dist/index.mjs
206
+ var ParseError = class extends Error {
207
+ sourceStart;
208
+ sourceEnd;
209
+ parserState;
210
+ constructor(e, n, t, o) {
211
+ super(e), this.name = "ParseError", this.sourceStart = n, this.sourceEnd = t, this.parserState = o;
212
+ }
213
+ };
214
+ var ParseErrorWithToken = class extends ParseError {
215
+ token;
216
+ constructor(e, n, t, o, r) {
217
+ super(e, n, t, o), this.token = r;
218
+ }
219
+ };
220
+ const e = {
221
+ UnexpectedNewLineInString: "Unexpected newline while consuming a string token.",
222
+ UnexpectedEOFInString: "Unexpected EOF while consuming a string token.",
223
+ UnexpectedEOFInComment: "Unexpected EOF while consuming a comment.",
224
+ UnexpectedEOFInURL: "Unexpected EOF while consuming a url token.",
225
+ UnexpectedEOFInEscapedCodePoint: "Unexpected EOF while consuming an escaped code point.",
226
+ UnexpectedCharacterInURL: "Unexpected character while consuming a url token.",
227
+ InvalidEscapeSequenceInURL: "Invalid escape sequence while consuming a url token.",
228
+ InvalidEscapeSequenceAfterBackslash: "Invalid escape sequence after \"\\\""
229
+ };
230
+ "undefined" != typeof globalThis && "structuredClone" in globalThis;
231
+ const t = 13;
232
+ const o = 45;
233
+ const r = 10;
234
+ const i = 43;
235
+ const c = 65533;
236
+ const s = 92;
237
+ var u;
238
+ var a;
239
+ var d;
240
+ function isHexDigitCodePoint(e) {
241
+ return e >= 48 && e <= 57 || e >= 97 && e <= 102 || e >= 65 && e <= 70;
242
+ }
243
+ function isIdentStartCodePoint(e) {
244
+ return e >= 97 && e <= 122 || e >= 65 && e <= 90 || 95 === e || isNonASCII_IdentCodePoint(e);
245
+ }
246
+ function isNonASCII_IdentCodePoint(e) {
247
+ return e < 183 ? 0 === e : 183 === e || 8204 === e || 8205 === e || 8255 === e || 8256 === e || 8204 === e || 192 <= e && e <= 214 || 216 <= e && e <= 246 || 248 <= e && e <= 893 || 895 <= e && e <= 8191 || 8304 <= e && e <= 8591 || 11264 <= e && e <= 12271 || 12289 <= e && e <= 55295 || 63744 <= e && e <= 64975 || 65008 <= e && e <= 65533 || 0 === e || e >= 55296 && e <= 57343 || e >= 65536;
248
+ }
249
+ function isNonPrintableCodePoint(e) {
250
+ return 11 === e || 127 === e || 0 <= e && e <= 8 || 14 <= e && e <= 31;
251
+ }
252
+ function isNewLine(e) {
253
+ return e === r || e === t || 12 === e;
254
+ }
255
+ function isWhitespace(e) {
256
+ return 32 === e || e === r || 9 === e || e === t || 12 === e;
257
+ }
258
+ function isSurrogate(e) {
259
+ return e >= 55296 && e <= 57343;
260
+ }
261
+ function tokenize(e, n) {
262
+ const t = tokenizer(e, n), o = [];
263
+ for (; !t.endOfFile();) o.push(t.nextToken());
264
+ return o.push(t.nextToken()), o;
265
+ }
266
+ function tokenizer(n, C) {
267
+ const l = n.css.valueOf(), f = n.unicodeRangesAllowed ?? !1;
268
+ let m = 0, h = 0, k = -1, P = !1;
269
+ const p = C?.onParseError ?? noop;
270
+ function consumeIdentSequence() {
271
+ const e = m;
272
+ for (;;) {
273
+ const e = l.charCodeAt(m);
274
+ if (e >= 65 && e <= 90 || e >= 97 && e <= 122 || e >= 48 && e <= 57 || e === o || 95 === e) {
275
+ m += 1;
276
+ continue;
277
+ }
278
+ const n = l.codePointAt(m) ?? -1;
279
+ if (0 === n || n >= 55296 && n <= 57343 || n === s && !isNewLine(l.codePointAt(m + 1) ?? -1)) break;
280
+ if (!isNonASCII_IdentCodePoint(n)) break;
281
+ m += +(n > 65535) + 1;
282
+ }
283
+ const n = l.codePointAt(m) ?? -1;
284
+ if (0 !== n && !(n >= 55296 && n <= 57343) && (n !== s || isNewLine(l.codePointAt(m + 1) ?? -1))) return P = !0, k = m - 1, l.slice(e, m);
285
+ P = !1, m = e, k = -1;
286
+ let t = "";
287
+ for (;;) {
288
+ const e = l.codePointAt(m) ?? -1;
289
+ if (0 === e || isSurrogate(e)) t += String.fromCharCode(c), m += +(e > 65535) + 1, k = m - 1;
290
+ else if (e >= 65 && e <= 90 || e >= 97 && e <= 122 || e >= 48 && e <= 57 || e === o || 95 === e || isNonASCII_IdentCodePoint(e)) t += e > 65535 ? String.fromCodePoint(e) : String.fromCharCode(e), m += +(e > 65535) + 1, k = m - 1;
291
+ else {
292
+ if (l.codePointAt(m) !== s || isNewLine(l.codePointAt(m + 1) ?? -1)) return t;
293
+ m += 1, k = m - 1, t += String.fromCodePoint(consumeEscapedCodePoint());
294
+ }
295
+ }
296
+ }
297
+ function consumeEscapedCodePoint() {
298
+ const n = l.codePointAt(m);
299
+ if (void 0 === n) return p(new ParseError(e.UnexpectedEOFInEscapedCodePoint, h, k, ["4.3.7. Consume an escaped code point", "Unexpected EOF"])), c;
300
+ if (m += +(n > 65535) + 1, k = m - 1, isHexDigitCodePoint(n)) {
301
+ const e = [n];
302
+ let o;
303
+ for (; void 0 !== (o = l.codePointAt(m)) && isHexDigitCodePoint(o) && e.length < 6;) e.push(o), m += 1, k = m - 1;
304
+ isWhitespace(l.codePointAt(m) ?? -1) && (l.codePointAt(m) === t && l.codePointAt(m + 1) === r && (m += 1), m += 1, k = m - 1);
305
+ const i = parseInt(String.fromCodePoint(...e), 16);
306
+ return 0 === i || isSurrogate(i) || i > 1114111 ? c : i;
307
+ }
308
+ return 0 === n || isSurrogate(n) ? c : n;
309
+ }
310
+ function consumeBadURL() {
311
+ for (;;) {
312
+ const e = l.codePointAt(m);
313
+ if (void 0 === e) return;
314
+ if (41 === e) return m += 1, void (k = m - 1);
315
+ e !== s || isNewLine(l.codePointAt(m + 1) ?? -1) ? (m += 1, k = m - 1) : (m += 1, k = m - 1, consumeEscapedCodePoint());
316
+ }
317
+ }
318
+ function consumeComment() {
319
+ for (m += 2, k = m - 1;;) {
320
+ const n = l.codePointAt(m);
321
+ if (void 0 === n) {
322
+ const n = [
323
+ u.Comment,
324
+ l.slice(h, k + 1),
325
+ h,
326
+ k,
327
+ void 0
328
+ ];
329
+ return p(new ParseErrorWithToken(e.UnexpectedEOFInComment, h, k, ["4.3.2. Consume comments", "Unexpected EOF"], n)), n;
330
+ }
331
+ if (m += 1, k = m - 1, 42 === n && void 0 !== l.codePointAt(m) && 47 === l.codePointAt(m)) {
332
+ m += 1, k = m - 1;
333
+ break;
334
+ }
335
+ }
336
+ return [
337
+ u.Comment,
338
+ l.slice(h, k + 1),
339
+ h,
340
+ k,
341
+ void 0
342
+ ];
343
+ }
344
+ function consumeStringToken() {
345
+ let n = "";
346
+ const o = l.codePointAt(m);
347
+ for (m += 1, k = m - 1;;) {
348
+ const i = l.charCodeAt(m);
349
+ if (m >= l.length) {
350
+ const t = [
351
+ u.String,
352
+ l.slice(h, k + 1),
353
+ h,
354
+ k,
355
+ { value: n }
356
+ ];
357
+ return p(new ParseErrorWithToken(e.UnexpectedEOFInString, h, k, ["4.3.5. Consume a string token", "Unexpected EOF"], t)), t;
358
+ }
359
+ if (m += 1, k = m - 1, isNewLine(i)) {
360
+ m -= 1, k = m - 1;
361
+ const n = [
362
+ u.BadString,
363
+ l.slice(h, k + 1),
364
+ h,
365
+ k,
366
+ void 0
367
+ ];
368
+ return p(new ParseErrorWithToken(e.UnexpectedNewLineInString, h, l.codePointAt(m) === t && l.codePointAt(m + 1) === r ? k + 2 : k + 1, ["4.3.5. Consume a string token", "Unexpected newline"], n)), n;
369
+ }
370
+ if (i === o) return [
371
+ u.String,
372
+ l.slice(h, k + 1),
373
+ h,
374
+ k,
375
+ { value: n }
376
+ ];
377
+ if (i !== s) if (0 !== i) if (i < 128) n += String.fromCharCode(i);
378
+ else {
379
+ if (i >= 55296 && i <= 57343) {
380
+ const e = l.codePointAt(m - 1) ?? -1;
381
+ e >= 65536 ? (n += String.fromCodePoint(e), m += 1, k = m - 1) : n += String.fromCharCode(c);
382
+ continue;
383
+ }
384
+ n += String.fromCharCode(i);
385
+ }
386
+ else n += String.fromCharCode(c);
387
+ else {
388
+ if (void 0 === l.codePointAt(m)) continue;
389
+ if (isNewLine(l.codePointAt(m) ?? -1)) {
390
+ l.codePointAt(m) === t && l.codePointAt(m + 1) === r && (m += 1), m += 1, k = m - 1;
391
+ continue;
392
+ }
393
+ n += String.fromCodePoint(consumeEscapedCodePoint());
394
+ }
395
+ }
396
+ }
397
+ function consumeUnicodeRangeToken() {
398
+ m += 2, k = m - 1;
399
+ const e = [], n = [];
400
+ let t;
401
+ for (; void 0 !== (t = l.codePointAt(m)) && e.length < 6 && isHexDigitCodePoint(t);) e.push(t), m += 1, k = m - 1;
402
+ for (; void 0 !== (t = l.codePointAt(m)) && e.length < 6 && 63 === t;) 0 === n.length && n.push(...e), e.push(48), n.push(70), m += 1, k = m - 1;
403
+ if (!n.length && l.codePointAt(m) === o && isHexDigitCodePoint(l.codePointAt(m + 1) ?? -1)) for (m += 1, k = m - 1; void 0 !== (t = l.codePointAt(m)) && n.length < 6 && isHexDigitCodePoint(t);) n.push(t), m += 1, k = m - 1;
404
+ if (!n.length) {
405
+ const n = parseInt(String.fromCodePoint(...e), 16);
406
+ return [
407
+ u.UnicodeRange,
408
+ l.slice(h, k + 1),
409
+ h,
410
+ k,
411
+ {
412
+ startOfRange: n,
413
+ endOfRange: n
414
+ }
415
+ ];
416
+ }
417
+ const r = parseInt(String.fromCodePoint(...e), 16), i = parseInt(String.fromCodePoint(...n), 16);
418
+ return [
419
+ u.UnicodeRange,
420
+ l.slice(h, k + 1),
421
+ h,
422
+ k,
423
+ {
424
+ startOfRange: r,
425
+ endOfRange: i
426
+ }
427
+ ];
428
+ }
429
+ function consumeUrlToken() {
430
+ for (; isWhitespace(l.codePointAt(m) ?? -1);) m += 1, k = m - 1;
431
+ let n = "";
432
+ for (;;) {
433
+ if (void 0 === l.codePointAt(m)) {
434
+ const t = [
435
+ u.URL,
436
+ l.slice(h, k + 1),
437
+ h,
438
+ k,
439
+ { value: n }
440
+ ];
441
+ return p(new ParseErrorWithToken(e.UnexpectedEOFInURL, h, k, ["4.3.6. Consume a url token", "Unexpected EOF"], t)), t;
442
+ }
443
+ if (41 === l.codePointAt(m)) return m += 1, k = m - 1, [
444
+ u.URL,
445
+ l.slice(h, k + 1),
446
+ h,
447
+ k,
448
+ { value: n }
449
+ ];
450
+ if (isWhitespace(l.codePointAt(m) ?? -1)) {
451
+ for (m += 1, k = m - 1; isWhitespace(l.codePointAt(m) ?? -1);) m += 1, k = m - 1;
452
+ if (void 0 === l.codePointAt(m)) {
453
+ const t = [
454
+ u.URL,
455
+ l.slice(h, k + 1),
456
+ h,
457
+ k,
458
+ { value: n }
459
+ ];
460
+ return p(new ParseErrorWithToken(e.UnexpectedEOFInURL, h, k, [
461
+ "4.3.6. Consume a url token",
462
+ "Consume as much whitespace as possible",
463
+ "Unexpected EOF"
464
+ ], t)), t;
465
+ }
466
+ return 41 === l.codePointAt(m) ? (m += 1, k = m - 1, [
467
+ u.URL,
468
+ l.slice(h, k + 1),
469
+ h,
470
+ k,
471
+ { value: n }
472
+ ]) : (consumeBadURL(), [
473
+ u.BadURL,
474
+ l.slice(h, k + 1),
475
+ h,
476
+ k,
477
+ void 0
478
+ ]);
479
+ }
480
+ const t = l.codePointAt(m);
481
+ if (34 === t || 39 === t || 40 === t || isNonPrintableCodePoint(t ?? -1)) {
482
+ consumeBadURL();
483
+ const n = [
484
+ u.BadURL,
485
+ l.slice(h, k + 1),
486
+ h,
487
+ k,
488
+ void 0
489
+ ];
490
+ return p(new ParseErrorWithToken(e.UnexpectedCharacterInURL, h, k, ["4.3.6. Consume a url token", "Unexpected U+0022 QUOTATION MARK (\"), U+0027 APOSTROPHE ('), U+0028 LEFT PARENTHESIS (() or non-printable code point"], n)), n;
491
+ }
492
+ if (t === s) {
493
+ if (t === s && !isNewLine(l.codePointAt(m + 1) ?? -1)) {
494
+ m += 1, k = m - 1, n += String.fromCodePoint(consumeEscapedCodePoint());
495
+ continue;
496
+ }
497
+ consumeBadURL();
498
+ const o = [
499
+ u.BadURL,
500
+ l.slice(h, k + 1),
501
+ h,
502
+ k,
503
+ void 0
504
+ ];
505
+ return p(new ParseErrorWithToken(e.InvalidEscapeSequenceInURL, h, k, [
506
+ "4.3.6. Consume a url token",
507
+ "U+005C REVERSE SOLIDUS (\\)",
508
+ "The input stream does not start with a valid escape sequence"
509
+ ], o)), o;
510
+ }
511
+ 0 === t || isSurrogate(t ?? -1) ? (n += String.fromCharCode(c), m += 1, k = m - 1) : (n += String.fromCodePoint(t ?? c), m += +((t ?? -1) > 65535) + 1, k = m - 1);
512
+ }
513
+ }
514
+ function consumeNumericToken() {
515
+ let e;
516
+ {
517
+ const n = l.charCodeAt(m);
518
+ n === o ? e = "-" : n === i && (e = "+");
519
+ }
520
+ let n = a.Integer;
521
+ const t = l.charCodeAt(m);
522
+ t !== i && t !== o || (m += 1);
523
+ let r = l.charCodeAt(m);
524
+ for (; r >= 48 && r <= 57;) m += 1, r = l.charCodeAt(m);
525
+ if (46 === l.charCodeAt(m) && l.charCodeAt(m + 1) >= 48 && l.charCodeAt(m + 1) <= 57) for (m += 2, n = a.Number, r = l.charCodeAt(m); r >= 48 && r <= 57;) m += 1, r = l.charCodeAt(m);
526
+ const c = l.charCodeAt(m);
527
+ if (101 === c || 69 === c) {
528
+ const e = l.charCodeAt(m + 1);
529
+ if (e >= 48 && e <= 57) for (m += 2, n = a.Number, r = l.charCodeAt(m); r >= 48 && r <= 57;) m += 1, r = l.charCodeAt(m);
530
+ else if ((e === o || e === i) && l.charCodeAt(m + 2) >= 48 && l.charCodeAt(m + 2) <= 57) for (m += 3, n = a.Number, r = l.charCodeAt(m); r >= 48 && r <= 57;) m += 1, r = l.charCodeAt(m);
531
+ }
532
+ k = m - 1;
533
+ const s = parseFloat(l.slice(h, k + 1));
534
+ if (checkIfThreeCodePointsWouldStartAnIdentSequence()) {
535
+ const t = consumeIdentSequence();
536
+ return [
537
+ u.Dimension,
538
+ l.slice(h, k + 1),
539
+ h,
540
+ k,
541
+ {
542
+ value: s,
543
+ signCharacter: e,
544
+ type: n,
545
+ unit: t
546
+ }
547
+ ];
548
+ }
549
+ return 37 === l.charCodeAt(m) ? (m += 1, k = m - 1, [
550
+ u.Percentage,
551
+ l.slice(h, k + 1),
552
+ h,
553
+ k,
554
+ {
555
+ value: s,
556
+ signCharacter: e
557
+ }
558
+ ]) : [
559
+ u.Number,
560
+ l.slice(h, k + 1),
561
+ h,
562
+ k,
563
+ {
564
+ value: s,
565
+ signCharacter: e,
566
+ type: n
567
+ }
568
+ ];
569
+ }
570
+ function consumeIdentLikeToken() {
571
+ const e = consumeIdentSequence();
572
+ if (40 !== l.charCodeAt(m)) return [
573
+ u.Ident,
574
+ P ? e : l.slice(h, k + 1),
575
+ h,
576
+ k,
577
+ { value: e }
578
+ ];
579
+ if (!(3 !== e.length || 117 !== e.charCodeAt(0) && 85 !== e.charCodeAt(0) || 114 !== e.charCodeAt(1) && 82 !== e.charCodeAt(1) || 108 !== e.charCodeAt(2) && 76 !== e.charCodeAt(2))) {
580
+ m += 1, k = m - 1;
581
+ let n = 0;
582
+ for (; isWhitespace(l.charCodeAt(m));) n += 1, m += 1, k = m - 1;
583
+ const t = l.charCodeAt(m);
584
+ return 34 === t || 39 === t ? (n > 0 && (m -= n, k = m - 1), [
585
+ u.Function,
586
+ l.slice(h, k + 1),
587
+ h,
588
+ k,
589
+ { value: e }
590
+ ]) : consumeUrlToken();
591
+ }
592
+ return m += 1, k = m - 1, [
593
+ u.Function,
594
+ l.slice(h, k + 1),
595
+ h,
596
+ k,
597
+ { value: e }
598
+ ];
599
+ }
600
+ function consumeHashToken() {
601
+ m += 1, k = m - 1;
602
+ const e = l.charCodeAt(m);
603
+ if (e >= 65 && e <= 90 || e >= 97 && e <= 122 || e >= 48 && e <= 57 || e === o || 95 === e || isNonASCII_IdentCodePoint(e) || e === s && !isNewLine(l.codePointAt(m + 1) ?? -1)) {
604
+ let e = d.Unrestricted;
605
+ checkIfThreeCodePointsWouldStartAnIdentSequence() && (e = d.ID);
606
+ const n = consumeIdentSequence();
607
+ return [
608
+ u.Hash,
609
+ l.slice(h, k + 1),
610
+ h,
611
+ k,
612
+ {
613
+ value: n,
614
+ type: e
615
+ }
616
+ ];
617
+ }
618
+ return [
619
+ u.Delim,
620
+ "#",
621
+ h,
622
+ k,
623
+ { value: "#" }
624
+ ];
625
+ }
626
+ function consumeAtKeywordToken() {
627
+ if (m += 1, k = m - 1, checkIfThreeCodePointsWouldStartAnIdentSequence()) {
628
+ const e = consumeIdentSequence();
629
+ return [
630
+ u.AtKeyword,
631
+ l.slice(h, k + 1),
632
+ h,
633
+ k,
634
+ { value: e }
635
+ ];
636
+ }
637
+ return [
638
+ u.Delim,
639
+ "@",
640
+ h,
641
+ k,
642
+ { value: "@" }
643
+ ];
644
+ }
645
+ function consumeInvalidEscapeToken() {
646
+ m += 1, k = m - 1;
647
+ const n = [
648
+ u.Delim,
649
+ "\\",
650
+ h,
651
+ k,
652
+ { value: "\\" }
653
+ ];
654
+ return p(new ParseErrorWithToken(e.InvalidEscapeSequenceAfterBackslash, h, k, [
655
+ "4.3.1. Consume a token",
656
+ "U+005C REVERSE SOLIDUS (\\)",
657
+ "The input stream does not start with a valid escape sequence"
658
+ ], n)), n;
659
+ }
660
+ function checkIfThreeCodePointsWouldStartAnIdentSequence(e) {
661
+ const n = void 0 === e ? l.charCodeAt(m) : e;
662
+ return n === o ? l.charCodeAt(m + 1) === o || !!isIdentStartCodePoint(l.charCodeAt(m + 1)) || l.charCodeAt(m + 1) === s && !isNewLine(l.charCodeAt(m + 2)) : !!isIdentStartCodePoint(n) || l.charCodeAt(m) === s && !isNewLine(l.charCodeAt(m + 1));
663
+ }
664
+ function checkIfThreeCodePointsWouldStartANumber(e) {
665
+ return e === i || e === o ? l.charCodeAt(m + 1) >= 48 && l.charCodeAt(m + 1) <= 57 || 46 === l.charCodeAt(m + 1) && l.charCodeAt(m + 2) >= 48 && l.charCodeAt(m + 2) <= 57 : 46 === e ? l.charCodeAt(m + 1) >= 48 && l.charCodeAt(m + 1) <= 57 : e >= 48 && e <= 57;
666
+ }
667
+ return {
668
+ nextToken: function nextToken() {
669
+ if (h = m, k = -1, m >= l.length) return [
670
+ u.EOF,
671
+ "",
672
+ -1,
673
+ -1,
674
+ void 0
675
+ ];
676
+ const e = l.charCodeAt(m);
677
+ if (47 === e && 42 === l.charCodeAt(m + 1)) return consumeComment();
678
+ if (f && (117 === e || 85 === e) && l.codePointAt(m + 1) === i && (63 === l.codePointAt(m + 2) || isHexDigitCodePoint(l.codePointAt(m + 2) ?? -1))) return consumeUnicodeRangeToken();
679
+ if (isIdentStartCodePoint(e)) return consumeIdentLikeToken();
680
+ if ((n = e) >= 48 && n <= 57) return consumeNumericToken();
681
+ switch (e) {
682
+ case 44: return m += 1, k = m - 1, [
683
+ u.Comma,
684
+ ",",
685
+ h,
686
+ k,
687
+ void 0
688
+ ];
689
+ case 58: return m += 1, k = m - 1, [
690
+ u.Colon,
691
+ ":",
692
+ h,
693
+ k,
694
+ void 0
695
+ ];
696
+ case 59: return m += 1, k = m - 1, [
697
+ u.Semicolon,
698
+ ";",
699
+ h,
700
+ k,
701
+ void 0
702
+ ];
703
+ case 40: return m += 1, k = m - 1, [
704
+ u.OpenParen,
705
+ "(",
706
+ h,
707
+ k,
708
+ void 0
709
+ ];
710
+ case 41: return m += 1, k = m - 1, [
711
+ u.CloseParen,
712
+ ")",
713
+ h,
714
+ k,
715
+ void 0
716
+ ];
717
+ case 91: return m += 1, k = m - 1, [
718
+ u.OpenSquare,
719
+ "[",
720
+ h,
721
+ k,
722
+ void 0
723
+ ];
724
+ case 93: return m += 1, k = m - 1, [
725
+ u.CloseSquare,
726
+ "]",
727
+ h,
728
+ k,
729
+ void 0
730
+ ];
731
+ case 123: return m += 1, k = m - 1, [
732
+ u.OpenCurly,
733
+ "{",
734
+ h,
735
+ k,
736
+ void 0
737
+ ];
738
+ case 125: return m += 1, k = m - 1, [
739
+ u.CloseCurly,
740
+ "}",
741
+ h,
742
+ k,
743
+ void 0
744
+ ];
745
+ case 39:
746
+ case 34: return consumeStringToken();
747
+ case 35: return consumeHashToken();
748
+ case i:
749
+ case 46: return checkIfThreeCodePointsWouldStartANumber(e) ? consumeNumericToken() : (m += 1, k = m - 1, [
750
+ u.Delim,
751
+ l[h],
752
+ h,
753
+ k,
754
+ { value: l[h] }
755
+ ]);
756
+ case r:
757
+ case t:
758
+ case 12:
759
+ case 9:
760
+ case 32:
761
+ {
762
+ let e = l.charCodeAt(m);
763
+ for (; 32 === e || e === r || 9 === e || e === t || 12 === e;) m += 1, e = l.charCodeAt(m);
764
+ k = m - 1;
765
+ }
766
+ return [
767
+ u.Whitespace,
768
+ l.slice(h, k + 1),
769
+ h,
770
+ k,
771
+ void 0
772
+ ];
773
+ case o: return checkIfThreeCodePointsWouldStartANumber(e) ? consumeNumericToken() : l.charCodeAt(m + 1) === o && 62 === l.charCodeAt(m + 2) ? (m += 3, k = m - 1, [
774
+ u.CDC,
775
+ "-->",
776
+ h,
777
+ k,
778
+ void 0
779
+ ]) : checkIfThreeCodePointsWouldStartAnIdentSequence(e) ? consumeIdentLikeToken() : (m += 1, k = m - 1, [
780
+ u.Delim,
781
+ "-",
782
+ h,
783
+ k,
784
+ { value: "-" }
785
+ ]);
786
+ case 60: return 33 === l.charCodeAt(m + 1) && l.charCodeAt(m + 2) === o && l.charCodeAt(m + 3) === o ? (m += 4, k = m - 1, [
787
+ u.CDO,
788
+ "<!--",
789
+ h,
790
+ k,
791
+ void 0
792
+ ]) : (m += 1, k = m - 1, [
793
+ u.Delim,
794
+ "<",
795
+ h,
796
+ k,
797
+ { value: "<" }
798
+ ]);
799
+ case 64: return consumeAtKeywordToken();
800
+ case s: return e !== s || isNewLine(l.charCodeAt(m + 1)) ? consumeInvalidEscapeToken() : consumeIdentLikeToken();
801
+ default: return m += 1, k = m - 1, [
802
+ u.Delim,
803
+ l[h],
804
+ h,
805
+ k,
806
+ { value: l[h] }
807
+ ];
808
+ }
809
+ var n;
810
+ },
811
+ endOfFile: function endOfFile() {
812
+ return m >= l.length;
813
+ }
814
+ };
815
+ }
816
+ function noop() {}
817
+ (function(e) {
818
+ e.Comment = "comment", e.AtKeyword = "at-keyword-token", e.BadString = "bad-string-token", e.BadURL = "bad-url-token", e.CDC = "CDC-token", e.CDO = "CDO-token", e.Colon = "colon-token", e.Comma = "comma-token", e.Delim = "delim-token", e.Dimension = "dimension-token", e.EOF = "EOF-token", e.Function = "function-token", e.Hash = "hash-token", e.Ident = "ident-token", e.Number = "number-token", e.Percentage = "percentage-token", e.Semicolon = "semicolon-token", e.String = "string-token", e.URL = "url-token", e.Whitespace = "whitespace-token", e.OpenParen = "(-token", e.CloseParen = ")-token", e.OpenSquare = "[-token", e.CloseSquare = "]-token", e.OpenCurly = "{-token", e.CloseCurly = "}-token", e.UnicodeRange = "unicode-range-token";
819
+ })(u || (u = {})), function(e) {
820
+ e.Integer = "integer", e.Number = "number";
821
+ }(a || (a = {})), function(e) {
822
+ e.Unrestricted = "unrestricted", e.ID = "id";
823
+ }(d || (d = {}));
824
+ Object.values(u);
825
+ //#endregion
206
826
  //#region src/syntax/css-import.ts
207
827
  function significantTokens(params) {
208
- return (0, _csstools_css_tokenizer.tokenize)({ css: params }).filter((token) => token[0] !== _csstools_css_tokenizer.TokenType.Whitespace && token[0] !== _csstools_css_tokenizer.TokenType.Comment);
828
+ return tokenize({ css: params }).filter((token) => token[0] !== u.Whitespace && token[0] !== u.Comment);
209
829
  }
210
830
  function isCssWhitespace(char) {
211
831
  return char === " " || char === " " || char === "\n" || char === "\r" || char === "\f";
@@ -255,16 +875,16 @@ function parseCssImportSpecifier(params) {
255
875
  if (simple) return simple;
256
876
  const tokens = significantTokens(params);
257
877
  const first = tokens[0];
258
- if (!first || first[0] === _csstools_css_tokenizer.TokenType.EOF) return;
259
- if (first[0] === _csstools_css_tokenizer.TokenType.String || first[0] === _csstools_css_tokenizer.TokenType.URL || first[0] === _csstools_css_tokenizer.TokenType.Ident) return {
878
+ if (!first || first[0] === u.EOF) return;
879
+ if (first[0] === u.String || first[0] === u.URL || first[0] === u.Ident) return {
260
880
  specifier: first[4].value,
261
881
  raw: first[1],
262
- quote: first[0] === _csstools_css_tokenizer.TokenType.String ? first[1][0] : void 0
882
+ quote: first[0] === u.String ? first[1][0] : void 0
263
883
  };
264
- if (first[0] === _csstools_css_tokenizer.TokenType.Function && first[4].value.toLowerCase() === "url" && (tokens[1]?.[0] === _csstools_css_tokenizer.TokenType.String || tokens[1]?.[0] === _csstools_css_tokenizer.TokenType.Ident) && tokens[2]?.[0] === _csstools_css_tokenizer.TokenType.CloseParen) return {
884
+ if (first[0] === u.Function && first[4].value.toLowerCase() === "url" && (tokens[1]?.[0] === u.String || tokens[1]?.[0] === u.Ident) && tokens[2]?.[0] === u.CloseParen) return {
265
885
  specifier: tokens[1][4].value,
266
886
  raw: params.slice(first[2], tokens[2][3] + 1),
267
- quote: tokens[1][0] === _csstools_css_tokenizer.TokenType.String ? tokens[1][1][0] : void 0
887
+ quote: tokens[1][0] === u.String ? tokens[1][1][0] : void 0
268
888
  };
269
889
  }
270
890
  /** 把文件系统路径写成 CSS 请求串;缓存和读文件仍使用原始路径。 */
@@ -282,14 +902,14 @@ function isTailwindCssImport(params) {
282
902
  /** 解析 `@import "..." source(...)` 中的 source 参数。 */
283
903
  function parseImportSourceParam(params) {
284
904
  const tokens = significantTokens(params);
285
- const index = tokens.findIndex((token) => token[0] === _csstools_css_tokenizer.TokenType.Function && token[4].value === "source");
905
+ const index = tokens.findIndex((token) => token[0] === u.Function && token[4].value === "source");
286
906
  const value = tokens[index + 1];
287
- if (index < 0 || tokens[index + 2]?.[0] !== _csstools_css_tokenizer.TokenType.CloseParen) return;
288
- if (value?.[0] === _csstools_css_tokenizer.TokenType.Ident && value[4].value === "none") return {
907
+ if (index < 0 || tokens[index + 2]?.[0] !== u.CloseParen) return;
908
+ if (value?.[0] === u.Ident && value[4].value === "none") return {
289
909
  none: true,
290
910
  sourcePath: void 0
291
911
  };
292
- return value?.[0] === _csstools_css_tokenizer.TokenType.String ? {
912
+ return value?.[0] === u.String ? {
293
913
  none: false,
294
914
  sourcePath: value[4].value
295
915
  } : void 0;
@@ -474,22 +1094,22 @@ function isIndependentUrl(value) {
474
1094
  function hasCssLocationDependencies(source) {
475
1095
  if (!LOCATION_SYNTAX_HINT_RE.test(source)) return false;
476
1096
  let malformed = false;
477
- const stream = (0, _csstools_css_tokenizer.tokenizer)({ css: source }, { onParseError() {
1097
+ const stream = tokenizer({ css: source }, { onParseError() {
478
1098
  malformed = true;
479
1099
  } });
480
1100
  const nextSignificant = () => {
481
1101
  let token = stream.nextToken();
482
- while (token[0] === _csstools_css_tokenizer.TokenType.Whitespace || token[0] === _csstools_css_tokenizer.TokenType.Comment) token = stream.nextToken();
1102
+ while (token[0] === u.Whitespace || token[0] === u.Comment) token = stream.nextToken();
483
1103
  return token;
484
1104
  };
485
1105
  while (!stream.endOfFile()) {
486
1106
  const token = stream.nextToken();
487
- if (token[0] === _csstools_css_tokenizer.TokenType.AtKeyword && token[4].value.toLowerCase() === "import") return true;
488
- if (token[0] === _csstools_css_tokenizer.TokenType.URL && !isIndependentUrl(token[4].value)) return true;
489
- if (token[0] === _csstools_css_tokenizer.TokenType.Function && token[4].value.toLowerCase() === "url") {
1107
+ if (token[0] === u.AtKeyword && token[4].value.toLowerCase() === "import") return true;
1108
+ if (token[0] === u.URL && !isIndependentUrl(token[4].value)) return true;
1109
+ if (token[0] === u.Function && token[4].value.toLowerCase() === "url") {
490
1110
  const value = nextSignificant();
491
- if (value[0] !== _csstools_css_tokenizer.TokenType.String || !isIndependentUrl(value[4].value)) return true;
492
- if (nextSignificant()[0] !== _csstools_css_tokenizer.TokenType.CloseParen) return true;
1111
+ if (value[0] !== u.String || !isIndependentUrl(value[4].value)) return true;
1112
+ if (nextSignificant()[0] !== u.CloseParen) return true;
493
1113
  }
494
1114
  }
495
1115
  return malformed;