@projectwallace/css-analyzer 7.4.0 → 7.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
- import Xt from "css-tree/parser";
2
- import q from "css-tree/walker";
3
- import { calculateForAST as $t } from "@bramus/specificity/core";
4
- function We(r, t) {
1
+ import ei from "css-tree/parser";
2
+ import v from "css-tree/walker";
3
+ import { calculateForAST as ti } from "@bramus/specificity/core";
4
+ function He(r, t) {
5
5
  return t >= 65 && t <= 90 && (t = t | 32), r === t;
6
6
  }
7
7
  function S(r, t) {
@@ -9,47 +9,47 @@ function S(r, t) {
9
9
  let s = r.length;
10
10
  if (s !== t.length) return !1;
11
11
  for (let e = 0; e < s; e++)
12
- if (We(r.charCodeAt(e), t.charCodeAt(e)) === !1)
12
+ if (He(r.charCodeAt(e), t.charCodeAt(e)) === !1)
13
13
  return !1;
14
14
  return !0;
15
15
  }
16
- function R(r, t) {
16
+ function O(r, t) {
17
17
  if (r === t) return !0;
18
18
  let s = t.length, e = s - r.length;
19
19
  if (e < 0)
20
20
  return !1;
21
21
  for (let n = s - 1; n >= e; n--)
22
- if (We(r.charCodeAt(n - e), t.charCodeAt(n)) === !1)
22
+ if (He(r.charCodeAt(n - e), t.charCodeAt(n)) === !1)
23
23
  return !1;
24
24
  return !0;
25
25
  }
26
- function Ke(r, t) {
26
+ function We(r, t) {
27
27
  if (r === t) return !0;
28
28
  let s = r.length;
29
29
  if (t.length < s) return !1;
30
30
  for (let e = 0; e < s; e++)
31
- if (We(r.charCodeAt(e), t.charCodeAt(e)) === !1)
31
+ if (He(r.charCodeAt(e), t.charCodeAt(e)) === !1)
32
32
  return !1;
33
33
  return !0;
34
34
  }
35
- const Me = "Atrule", ei = "MediaQuery", Ie = "Rule", Ne = "Selector", Wt = "TypeSelector", G = "PseudoClassSelector", Kt = "AttributeSelector", Nt = "PseudoElementSelector", He = "Declaration", ti = "Value", O = "Identifier", ii = "Nth", ri = "Combinator", jt = "Number", je = "Dimension", W = "Operator", si = "Hash", li = "Url", Be = "Function";
36
- function Mt(r, t, s) {
35
+ const Te = "Atrule", ii = "MediaQuery", Me = "Rule", Ke = "Selector", Nt = "TypeSelector", G = "PseudoClassSelector", jt = "AttributeSelector", Bt = "PseudoElementSelector", Ve = "Declaration", ri = "Value", R = "Identifier", si = "Nth", li = "Combinator", Yt = "Number", Ne = "Dimension", W = "Operator", ni = "Hash", ai = "Url", je = "Function";
36
+ function Ut(r, t, s) {
37
37
  let e = r.value.children.first;
38
- return S(t, r.property) && e.type === O && S(s, e.name);
38
+ return S(t, r.property) && e.type === R && S(s, e.name);
39
39
  }
40
- function ni(r) {
40
+ function oi(r) {
41
41
  let t = !1;
42
- return q(r, function(s) {
43
- if (s.type === He && (Mt(s, "-webkit-appearance", "none") || Mt(s, "-moz-appearance", "meterbar")))
42
+ return v(r, function(s) {
43
+ if (s.type === Ve && (Ut(s, "-webkit-appearance", "none") || Ut(s, "-moz-appearance", "meterbar")))
44
44
  return t = !0, this.break;
45
45
  }), t;
46
46
  }
47
- function ai(r) {
47
+ function ui(r) {
48
48
  let t = !1;
49
- return q(r, function(s) {
49
+ return v(r, function(s) {
50
50
  let e = s.name, n = s.value;
51
- if (s.type === ei && s.mediaType !== null) {
52
- if (Ke("\\0", s.mediaType) || R("\\9 ", s.mediaType))
51
+ if (s.type === ii && s.mediaType !== null) {
52
+ if (We("\\0", s.mediaType) || O("\\9 ", s.mediaType))
53
53
  return t = !0, this.break;
54
54
  } else if (s.type === "Feature" && s.kind === "media") {
55
55
  if (n && n.unit && n.unit === "\\0")
@@ -63,9 +63,9 @@ function ai(r) {
63
63
  }
64
64
  }), t;
65
65
  }
66
- const It = 45;
67
- function F(r) {
68
- return r.charCodeAt(0) === It && r.charCodeAt(1) !== It && r.indexOf("-", 2) !== -1;
66
+ const Vt = 45;
67
+ function E(r) {
68
+ return r.charCodeAt(0) === Vt && r.charCodeAt(1) !== Vt && r.indexOf("-", 2) !== -1;
69
69
  }
70
70
  class A {
71
71
  /** @param {string[]} items */
@@ -77,16 +77,16 @@ class A {
77
77
  return this.set.has(t.toLowerCase());
78
78
  }
79
79
  }
80
- function Bt(r, t) {
80
+ function Gt(r, t) {
81
81
  let s = [];
82
- return q(r, {
83
- visit: Ne,
82
+ return v(r, {
83
+ visit: Ke,
84
84
  enter: function(e) {
85
85
  s.push(t(e));
86
86
  }
87
87
  }), s;
88
88
  }
89
- const Yt = new A([
89
+ const Qt = new A([
90
90
  "nth-child",
91
91
  "where",
92
92
  "not",
@@ -97,15 +97,15 @@ const Yt = new A([
97
97
  "-webkit-any",
98
98
  "-moz-any"
99
99
  ]);
100
- function Gt(r) {
100
+ function Zt(r) {
101
101
  let t = !1;
102
- return q(r, function(s) {
103
- if (s.type === Kt) {
102
+ return v(r, function(s) {
103
+ if (s.type === jt) {
104
104
  let e = s.name.name;
105
- if (S("role", e) || Ke("aria-", e))
105
+ if (S("role", e) || We("aria-", e))
106
106
  return t = !0, this.break;
107
- } else if (s.type === G && Yt.has(s.name)) {
108
- let e = Bt(s, Gt);
107
+ } else if (s.type === G && Qt.has(s.name)) {
108
+ let e = Gt(s, Zt);
109
109
  for (let n of e)
110
110
  if (n === !0) {
111
111
  t = !0;
@@ -115,29 +115,29 @@ function Gt(r) {
115
115
  }
116
116
  }), t;
117
117
  }
118
- function oi(r) {
118
+ function ci(r) {
119
119
  let t = !1;
120
- return q(r, function(s) {
120
+ return v(r, function(s) {
121
121
  let e = s.type;
122
- if ((e === Nt || e === Wt || e === G) && F(s.name))
122
+ if ((e === Bt || e === Nt || e === G) && E(s.name))
123
123
  return t = !0, this.break;
124
124
  }), t;
125
125
  }
126
- function ui(r) {
126
+ function fi(r) {
127
127
  let t = [];
128
- return q(r, function(s) {
128
+ return v(r, function(s) {
129
129
  s.type === G && t.push(s.name);
130
130
  }), t.length === 0 ? !1 : t;
131
131
  }
132
- function Qt(r) {
132
+ function Jt(r) {
133
133
  let t = 0;
134
- return q(r, function(s) {
134
+ return v(r, function(s) {
135
135
  let e = s.type;
136
- if (!(e === Ne || e === ii)) {
137
- if (t++, (e === Nt || e === Wt || e === G) && F(s.name) && t++, e === Kt)
136
+ if (!(e === Ke || e === si)) {
137
+ if (t++, (e === Bt || e === Nt || e === G) && E(s.name) && t++, e === jt)
138
138
  return s.value && t++, this.skip;
139
- if (e === G && Yt.has(s.name)) {
140
- let n = Bt(s, Qt);
139
+ if (e === G && Qt.has(s.name)) {
140
+ let n = Gt(s, Jt);
141
141
  if (n.length === 0) return;
142
142
  for (let a of n)
143
143
  t += a;
@@ -146,12 +146,12 @@ function Qt(r) {
146
146
  }
147
147
  }), t;
148
148
  }
149
- function ci(r, t) {
150
- q(r, function(s, e) {
151
- if (s.type === ri) {
149
+ function pi(r, t) {
150
+ v(r, function(s, e) {
151
+ if (s.type === li) {
152
152
  let n = s.loc, a = s.name;
153
153
  if (n === null) {
154
- let y = e.prev.data.loc.end, k = {
154
+ let y = e.prev.data.loc.end, b = {
155
155
  offset: y.offset,
156
156
  line: y.line,
157
157
  column: y.column
@@ -159,11 +159,11 @@ function ci(r, t) {
159
159
  t({
160
160
  name: a,
161
161
  loc: {
162
- start: k,
162
+ start: b,
163
163
  end: {
164
- offset: k.offset + 1,
165
- line: k.line,
166
- column: k.column + 1
164
+ offset: b.offset + 1,
165
+ line: b.line,
166
+ column: b.column + 1
167
167
  }
168
168
  }
169
169
  });
@@ -175,7 +175,7 @@ function ci(r, t) {
175
175
  }
176
176
  });
177
177
  }
178
- const fi = new A([
178
+ const hi = new A([
179
179
  // CSS Named Colors
180
180
  // Spec: https://drafts.csswg.org/css-color/#named-colors
181
181
  // Heuristic: popular names first for quick finding in set.has()
@@ -328,7 +328,7 @@ const fi = new A([
328
328
  "mediumorchid",
329
329
  "darksalmon",
330
330
  "mediumspringgreen"
331
- ]), pi = new A([
331
+ ]), mi = new A([
332
332
  // CSS System Colors
333
333
  // Spec: https://drafts.csswg.org/css-color/#css-system-colors
334
334
  "accentcolor",
@@ -350,7 +350,7 @@ const fi = new A([
350
350
  "selecteditem",
351
351
  "selecteditemtext",
352
352
  "visitedtext"
353
- ]), hi = new A([
353
+ ]), gi = new A([
354
354
  "rgba",
355
355
  "rgb",
356
356
  "hsla",
@@ -361,7 +361,7 @@ const fi = new A([
361
361
  "lch",
362
362
  "lab",
363
363
  "oklab"
364
- ]), mi = new A([
364
+ ]), di = new A([
365
365
  "transparent",
366
366
  "currentcolor"
367
367
  ]), ie = new A([
@@ -378,25 +378,25 @@ function te(r) {
378
378
  let t = r.children, s = t.size;
379
379
  if (!t || s > 1 || s === 0) return !1;
380
380
  let e = t.first;
381
- return e.type === O && ie.has(e.name);
381
+ return e.type === R && ie.has(e.name);
382
382
  }
383
- function Ut(r) {
383
+ function Ht(r) {
384
384
  return parseFloat(r) === 0;
385
385
  }
386
- function gi(r) {
386
+ function yi(r) {
387
387
  for (let t of r.children.toArray())
388
- if (!(t.type === jt && Ut(t.value)) && !(t.type === je && Ut(t.value)))
388
+ if (!(t.type === Yt && Ht(t.value)) && !(t.type === Ne && Ht(t.value)))
389
389
  return !1;
390
390
  return !0;
391
391
  }
392
- const di = new A([
392
+ const wi = new A([
393
393
  "caption",
394
394
  "icon",
395
395
  "menu",
396
396
  "message-box",
397
397
  "small-caption",
398
398
  "status-bar"
399
- ]), yi = new A([
399
+ ]), ki = new A([
400
400
  /* <absolute-size> values */
401
401
  "xx-small",
402
402
  "x-small",
@@ -409,39 +409,41 @@ const di = new A([
409
409
  /* <relative-size> values */
410
410
  "smaller",
411
411
  "larger"
412
- ]), wi = 44, Vt = 47;
413
- function Ue(r) {
412
+ ]), bi = 44, Wt = 47;
413
+ function Ie(r) {
414
414
  let t = r.children.first;
415
- return t === null ? !1 : t.type === O && di.has(t.name);
415
+ return t === null ? !1 : t.type === R && wi.has(t.name);
416
416
  }
417
- function bi(r, t, s) {
418
- var k;
419
- let e = Array.from({ length: 2 }), n, a;
417
+ function xi(r, t, s) {
418
+ var b;
419
+ let e = [,], n, a;
420
+ if (r.children.first.type === "Function" && r.children.first.name.toLowerCase() === "var")
421
+ return null;
420
422
  r.children.forEach(function(w, _) {
421
- let b = _.prev ? _.prev.data : void 0, P = _.next ? _.next.data : void 0;
422
- if (w.type === O && ie.has(w.name) && s({
423
+ let k = _.prev ? _.prev.data : void 0, P = _.next ? _.next.data : void 0;
424
+ if (w.type === R && ie.has(w.name) && s({
423
425
  type: "keyword",
424
426
  value: w.name
425
- }), P && P.type === W && P.value.charCodeAt(0) === Vt) {
427
+ }), P && P.type === W && P.value.charCodeAt(0) === Wt) {
426
428
  n = t(w);
427
429
  return;
428
430
  }
429
- if (b && b.type === W && b.value.charCodeAt(0) === Vt) {
431
+ if (k && k.type === W && k.value.charCodeAt(0) === Wt) {
430
432
  a = t(w);
431
433
  return;
432
434
  }
433
- if (P && P.type === W && P.value.charCodeAt(0) === wi && !e[0]) {
434
- e[0] = w, !n && b && (n = t(b));
435
+ if (P && P.type === W && P.value.charCodeAt(0) === bi && !e[0]) {
436
+ e[0] = w, !n && k && (n = t(k));
435
437
  return;
436
438
  }
437
- if (w.type !== jt) {
439
+ if (w.type !== Yt) {
438
440
  if (_.next === null) {
439
- e[1] = w, !n && !e[0] && b && (n = t(b));
441
+ e[1] = w, !n && !e[0] && k && (n = t(k));
440
442
  return;
441
443
  }
442
- if (w.type === O) {
444
+ if (w.type === R) {
443
445
  let D = w.name;
444
- if (yi.has(D)) {
446
+ if (ki.has(D)) {
445
447
  n = D;
446
448
  return;
447
449
  }
@@ -456,7 +458,7 @@ function bi(r, t, s) {
456
458
  end: {
457
459
  // Either the node we detected as the last node, or the end of the whole value
458
460
  // It's never 0 because the first node is always a font-size or font-style
459
- offset: ((k = e[1]) == null ? void 0 : k.loc.end.offset) || r.loc.end.offset
461
+ offset: ((b = e[1]) == null ? void 0 : b.loc.end.offset) || r.loc.end.offset
460
462
  }
461
463
  }
462
464
  }) : null;
@@ -466,7 +468,7 @@ function bi(r, t, s) {
466
468
  font_family: y
467
469
  };
468
470
  }
469
- const ki = new A([
471
+ const Ci = new A([
470
472
  "linear",
471
473
  "ease",
472
474
  "ease-in",
@@ -474,36 +476,36 @@ const ki = new A([
474
476
  "ease-in-out",
475
477
  "step-start",
476
478
  "step-end"
477
- ]), xi = new A([
479
+ ]), zi = new A([
478
480
  "cubic-bezier",
479
481
  "steps"
480
482
  ]);
481
- function Ci(r, t) {
483
+ function Si(r, t) {
482
484
  let s = !1;
483
485
  for (let e of r) {
484
486
  let n = e.type, a = e.name;
485
- n === W ? s = !1 : n === je && s === !1 ? (s = !0, t({
487
+ n === W ? s = !1 : n === Ne && s === !1 ? (s = !0, t({
486
488
  type: "duration",
487
489
  value: e
488
- })) : n === O ? ki.has(a) ? t({
490
+ })) : n === R ? Ci.has(a) ? t({
489
491
  type: "fn",
490
492
  value: e
491
493
  }) : ie.has(a) && t({
492
494
  type: "keyword",
493
495
  value: e
494
- }) : n === Be && xi.has(a) && t({
496
+ }) : n === je && zi.has(a) && t({
495
497
  type: "fn",
496
498
  value: e
497
499
  });
498
500
  }
499
501
  }
500
- function Zt(r) {
502
+ function Xt(r) {
501
503
  let t = r.children;
502
504
  if (!t)
503
505
  return !1;
504
506
  for (let s of t) {
505
507
  let { type: e, name: n } = s;
506
- if (e === O && F(n) || e === Be && (F(n) || Zt(s)))
508
+ if (e === R && E(n) || e === je && (E(n) || Xt(s)))
507
509
  return !0;
508
510
  }
509
511
  return !1;
@@ -552,7 +554,7 @@ class o {
552
554
  */
553
555
  c() {
554
556
  let t = /* @__PURE__ */ new Map(), s = {}, e = this._useLocations, n = this._items, a = this._nodes, y = n.size;
555
- n.forEach((_, b) => {
557
+ n.forEach((_, k) => {
556
558
  if (e) {
557
559
  let P = _.map(function(D) {
558
560
  let T = D * 4;
@@ -563,20 +565,20 @@ class o {
563
565
  length: a[T + 3]
564
566
  };
565
567
  });
566
- t.set(b, P);
568
+ t.set(k, P);
567
569
  } else
568
- s[b] = _.length;
570
+ s[k] = _.length;
569
571
  });
570
- let k = this._total, w = {
571
- total: k,
572
+ let b = this._total, w = {
573
+ total: b,
572
574
  totalUnique: y,
573
575
  unique: s,
574
- uniquenessRatio: k === 0 ? 0 : y / k
576
+ uniquenessRatio: b === 0 ? 0 : y / b
575
577
  };
576
578
  return e && (w.uniqueWithLocations = Object.fromEntries(t)), w;
577
579
  }
578
580
  }
579
- class Ve {
581
+ class Ue {
580
582
  /** @param {boolean} useLocations */
581
583
  constructor(t) {
582
584
  this._list = new o(t), this._contexts = /* @__PURE__ */ new Map(), this._useLocations = t;
@@ -599,11 +601,11 @@ class Ve {
599
601
  });
600
602
  }
601
603
  }
602
- function zi(r) {
604
+ function _i(r) {
603
605
  let t = /* @__PURE__ */ new Map(), s = -1, e = 0, n = 0, a = r.length;
604
606
  for (let y = 0; y < a; y++) {
605
- let k = r[y], w = (t.get(k) || 0) + 1;
606
- t.set(k, w), w > s && (s = w, e = 0, n = 0), w >= s && (e++, n += k);
607
+ let b = r[y], w = (t.get(b) || 0) + 1;
608
+ t.set(b, w), w > s && (s = w, e = 0, n = 0), w >= s && (e++, n += b);
607
609
  }
608
610
  return n / e;
609
611
  }
@@ -632,7 +634,7 @@ class C {
632
634
  range: 0,
633
635
  sum: 0
634
636
  };
635
- let s = this._items.slice().sort((k, w) => k - w), e = s[0], n = s[t - 1], a = zi(s), y = this._sum;
637
+ let s = this._items.slice().sort((b, w) => b - w), e = s[0], n = s[t - 1], a = _i(s), y = this._sum;
636
638
  return {
637
639
  min: e,
638
640
  max: n,
@@ -649,33 +651,33 @@ class C {
649
651
  return this._items;
650
652
  }
651
653
  }
652
- function Si(r) {
653
- if (Ye(r) || F(r)) return !1;
654
+ function qi(r) {
655
+ if (Be(r) || E(r)) return !1;
654
656
  let t = r.charCodeAt(0);
655
657
  return t === 47 || t === 42 || t === 95 || t === 43 || t === 38 || t === 36 || t === 35;
656
658
  }
657
- function Ye(r) {
659
+ function Be(r) {
658
660
  return r.length < 3 ? !1 : r.charCodeAt(0) === 45 && r.charCodeAt(1) === 45;
659
661
  }
660
662
  function m(r, t) {
661
- return Ye(t) ? !1 : R(r, t);
662
- }
663
- function _i(r) {
664
- return F(r) ? r.slice(r.indexOf("-", 2) + 1) : r;
663
+ return Be(t) ? !1 : O(r, t);
665
664
  }
666
665
  function vi(r) {
666
+ return E(r) ? r.slice(r.indexOf("-", 2) + 1) : r;
667
+ }
668
+ function Ai(r) {
667
669
  let t = 5, s = r.indexOf(";"), e = r.indexOf(",");
668
670
  return s === -1 || e !== -1 && e < s ? r.substring(t, e) : r.substring(t, s);
669
671
  }
670
- function qi(r) {
672
+ function Pi(r) {
671
673
  let t = r.children;
672
674
  if (t) {
673
675
  let s = t.last;
674
- return s && s.type === O && R("\\9", s.name);
676
+ return s && s.type === R && O("\\9", s.name);
675
677
  }
676
678
  return !1;
677
679
  }
678
- let Ai = new A([
680
+ let Li = new A([
679
681
  "border-radius",
680
682
  "border-top-left-radius",
681
683
  "border-top-right-radius",
@@ -689,11 +691,11 @@ let Ai = new A([
689
691
  function z(r, t) {
690
692
  return t === 0 ? 0 : r / t;
691
693
  }
692
- let Pi = {
694
+ let Oi = {
693
695
  useLocations: !1
694
696
  };
695
- function Di(r, t = {}) {
696
- let e = Object.assign({}, Pi, t).useLocations === !0, n = Date.now();
697
+ function Ei(r, t = {}) {
698
+ let e = Object.assign({}, Oi, t).useLocations === !0, n = Date.now();
697
699
  function a(i) {
698
700
  return y(i).trim();
699
701
  }
@@ -701,49 +703,49 @@ function Di(r, t = {}) {
701
703
  let Y = i.loc;
702
704
  return r.substring(Y.start.offset, Y.end.offset);
703
705
  }
704
- let k = 0, w = 0, _ = 0, b = {
706
+ let b = 0, w = 0, _ = 0, k = {
705
707
  total: 0,
706
708
  /** @type {Map<string, { size: number, count: number } & ({ uniqueWithLocations?: undefined } | ({ uniqueWithLocations: { offset: number, line: number, column: number, length: number }[] })) }>} */
707
709
  unique: /* @__PURE__ */ new Map()
708
- }, P = Date.now(), D = Xt(r, {
710
+ }, P = Date.now(), D = ei(r, {
709
711
  parseCustomProperty: !0,
710
712
  // To find font-families, colors, etc.
711
713
  positions: !0,
712
714
  // So we can use stringifyNode()
713
715
  /** @param {string} comment */
714
716
  onComment: function(i) {
715
- k++, w += i.length;
717
+ b++, w += i.length;
716
718
  }
717
- }), T = Date.now(), Jt = D.loc.end.line - D.loc.start.line + 1, re = 0, se = new C(), le = [], Ge = new o(e), ne = new o(e), Qe = new o(e), Ze = new o(e), Je = new o(e), Xe = new o(e), $e = new o(e), ae = new o(e), et = new o(e), oe = new o(e), ue = new o(e), tt = new o(e), Q = new o(e), it = new o(e), ce = new C(), rt = new o(e), fe = 0, pe = 0, he = new C(), me = new C(), ge = new C(), st = new o(e), lt = new o(e), nt = new o(e), de = new C(), at = new o(e), ye = new o(e), ot = /* @__PURE__ */ new Set(), we = new o(e), M, I, ut = new C(), ct = new C(), ft = new C(), pt = new o(e), Z = new C(), ht = new o(e), mt = [], be = new o(e), ke = new o(e), gt = new o(e), dt = new o(e), xe = new C(), yt = new o(e), wt = /* @__PURE__ */ new Set(), K = 0, bt = new C(), J = 0, Ce = 0, ze = new o(e), Se = new C(), kt = new o(e), N = new o(e), _e = new o(e), ve = new o(e), X = new o(e), j = new C(), qe = new C(), xt = new o(e), Ae = new o(e), Ct = new o(e), zt = new o(e), St = new o(e), Pe = new o(e), Le = new o(e), Re = new o(e), $ = new o(e), ee = new o(e), U = new Ve(e), V = new o(e), Oe = new Ve(e), _t = new o(e), B = new o(e), vt = new Ve(e), qt = new o(e), L = 0;
718
- q(D, {
719
+ }), T = Date.now(), $t = D.loc.end.line - D.loc.start.line + 1, Ye = new o(e), re = new C(), se = [], Ge = new o(e), le = new o(e), Qe = new o(e), Ze = new o(e), Je = new o(e), Xe = new o(e), $e = new o(e), ne = new o(e), et = new o(e), ae = new o(e), oe = new o(e), tt = new o(e), Q = new o(e), it = new o(e), ue = new C(), rt = new o(e), ce = 0, fe = 0, pe = new C(), he = new C(), me = new C(), st = new o(e), lt = new o(e), nt = new o(e), ge = new C(), at = new o(e), de = new o(e), ot = /* @__PURE__ */ new Set(), ye = new o(e), M, I, ut = new C(), ct = new C(), ft = new C(), pt = new o(e), Z = new C(), ht = new o(e), mt = [], we = new o(e), ke = new o(e), gt = new o(e), dt = new o(e), be = new C(), yt = new o(e), wt = /* @__PURE__ */ new Set(), K = 0, kt = new C(), J = 0, xe = 0, Ce = new o(e), ze = new C(), bt = new o(e), N = new o(e), Se = new o(e), _e = new o(e), X = new o(e), j = new C(), qe = new C(), xt = new o(e), ve = new o(e), Ct = new o(e), zt = new o(e), St = new o(e), Ae = new o(e), Pe = new o(e), Le = new o(e), $ = new o(e), ee = new o(e), U = new Ue(e), V = new o(e), Oe = new Ue(e), _t = new o(e), B = new o(e), qt = new Ue(e), vt = new o(e), L = 0;
720
+ v(D, {
719
721
  enter(i) {
720
- var Y, Tt;
722
+ var Y, Mt;
721
723
  switch (i.type) {
722
- case Me: {
723
- re++, ce.push(L), rt.p(L, i.loc);
724
+ case Te: {
725
+ Ye.p(i.name, i.loc), ue.push(L), rt.p(L, i.loc);
724
726
  let p = i.name;
725
727
  if (p === "font-face") {
726
728
  let g = {};
727
729
  e && Ge.p(i.loc.start.offset, i.loc), i.block.children.forEach((c) => {
728
- c.type === He && (g[c.property] = a(c.value));
729
- }), le.push(g), se.push(1);
730
+ c.type === Ve && (g[c.property] = a(c.value));
731
+ }), se.push(g), re.push(1);
730
732
  break;
731
733
  }
732
734
  let l = 1;
733
735
  if (i.prelude !== null) {
734
736
  let g = i.prelude, c = g && a(i.prelude), f = g.loc;
735
737
  if (p === "media")
736
- Ze.p(c, f), ai(g) && (Je.p(c, f), l++);
738
+ Ze.p(c, f), ui(g) && (Je.p(c, f), l++);
737
739
  else if (p === "supports")
738
- ae.p(c, f), ni(g) && (et.p(c, f), l++);
739
- else if (R("keyframes", p)) {
740
+ ne.p(c, f), oi(g) && (et.p(c, f), l++);
741
+ else if (O("keyframes", p)) {
740
742
  let u = "@" + p + " " + c;
741
- F(p) && (ue.p(u, f), l++), oe.p(u, f);
743
+ E(p) && (oe.p(u, f), l++), ae.p(u, f);
742
744
  } else if (p === "import")
743
- q(i, function(u) {
745
+ v(i, function(u) {
744
746
  if (u.type === "Condition" && u.kind === "supports") {
745
747
  let h = a(u);
746
- return ae.p(h, u.loc), this.break;
748
+ return ne.p(h, u.loc), this.break;
747
749
  }
748
750
  }), Qe.p(c, f);
749
751
  else if (p === "charset")
@@ -755,49 +757,49 @@ function Di(r, t = {}) {
755
757
  }
756
758
  } else p === "property" && it.p(c, f);
757
759
  } else
758
- p === "layer" && (ne.p("<anonymous>", i.loc), l++);
759
- se.push(l);
760
+ p === "layer" && (le.p("<anonymous>", i.loc), l++);
761
+ re.push(l);
760
762
  break;
761
763
  }
762
764
  case "Layer": {
763
- i.name !== null && ne.p(i.name, i.loc);
765
+ i.name !== null && le.p(i.name, i.loc);
764
766
  break;
765
767
  }
766
768
  case "Feature": {
767
769
  Xe.p(i.name, i.loc);
768
770
  break;
769
771
  }
770
- case Ie: {
772
+ case Me: {
771
773
  let p = i.prelude, l = i.block, g = p.children, c = l.children, f = g ? g.size : 0, u = c ? c.size : 0;
772
- he.push(f + u), st.p(f + u, i.loc), me.push(f), lt.p(f, p.loc), ge.push(u), nt.p(u, l.loc), de.push(L), at.p(L, i.loc), fe++, u === 0 && pe++;
774
+ pe.push(f + u), st.p(f + u, i.loc), he.push(f), lt.p(f, p.loc), me.push(u), nt.p(u, l.loc), ge.push(L), at.p(L, i.loc), ce++, u === 0 && fe++;
773
775
  break;
774
776
  }
775
- case Ne: {
777
+ case Ke: {
776
778
  let p = a(i);
777
- if (this.atrule && R("keyframes", this.atrule.name))
778
- return ye.p(p, i.loc), this.skip;
779
- Gt(i) && ke.p(p, i.loc);
780
- let l = ui(i);
779
+ if (this.atrule && O("keyframes", this.atrule.name))
780
+ return de.p(p, i.loc), this.skip;
781
+ Zt(i) && ke.p(p, i.loc);
782
+ let l = fi(i);
781
783
  if (l !== !1)
782
784
  for (let x of l)
783
785
  gt.p(x, i.loc);
784
- let g = Qt(i);
785
- oi(i) && we.p(p, i.loc), ot.add(p), Z.push(g), ht.p(g, i.loc), xe.push(L - 1), yt.p(L - 1, i.loc);
786
- let c = $t(i).toArray(), [f, u, h] = c;
787
- return pt.p(c.toString(), i.loc), ut.push(f), ct.push(u), ft.push(h), M === void 0 && (M = c), I === void 0 && (I = c), I !== void 0 && Ht(I, c) < 0 && (I = c), M !== void 0 && Ht(M, c) > 0 && (M = c), mt.push(c), f > 0 && be.p(p, i.loc), ci(i, function(v) {
788
- dt.p(v.name, v.loc);
786
+ let g = Jt(i);
787
+ ci(i) && ye.p(p, i.loc), ot.add(p), Z.push(g), ht.p(g, i.loc), be.push(L - 1), yt.p(L - 1, i.loc);
788
+ let c = ti(i).toArray(), [f, u, h] = c;
789
+ return pt.p(c.toString(), i.loc), ut.push(f), ct.push(u), ft.push(h), M === void 0 && (M = c), I === void 0 && (I = c), I !== void 0 && Kt(I, c) < 0 && (I = c), M !== void 0 && Kt(M, c) > 0 && (M = c), mt.push(c), f > 0 && we.p(p, i.loc), pi(i, function(q) {
790
+ dt.p(q.name, q.loc);
789
791
  }), this.skip;
790
792
  }
791
- case je: {
793
+ case Ne: {
792
794
  if (!this.declaration)
793
795
  break;
794
796
  let p = i.unit;
795
- return R("\\9", p) ? Oe.push(p.substring(0, p.length - 2), this.declaration.property, i.loc) : Oe.push(p, this.declaration.property, i.loc), this.skip;
797
+ return O("\\9", p) ? Oe.push(p.substring(0, p.length - 2), this.declaration.property, i.loc) : Oe.push(p, this.declaration.property, i.loc), this.skip;
796
798
  }
797
- case li: {
798
- if (Ke("data:", i.value)) {
799
- let p = i.value, l = p.length, g = vi(p);
800
- b.total++, _ += l;
799
+ case ai: {
800
+ if (We("data:", i.value)) {
801
+ let p = i.value, l = p.length, g = Ai(p);
802
+ k.total++, _ += l;
801
803
  let c = {
802
804
  /** @type {number} */
803
805
  line: i.loc.start.line,
@@ -808,49 +810,52 @@ function Di(r, t = {}) {
808
810
  /** @type {number} */
809
811
  length: i.loc.end.offset - i.loc.start.offset
810
812
  };
811
- if (b.unique.has(g)) {
812
- let f = b.unique.get(g);
813
- f.count++, f.size += l, b.unique.set(g, f), e && f.uniqueWithLocations.push(c);
813
+ if (k.unique.has(g)) {
814
+ let f = k.unique.get(g);
815
+ f.count++, f.size += l, k.unique.set(g, f), e && f.uniqueWithLocations.push(c);
814
816
  } else {
815
817
  let f = {
816
818
  count: 1,
817
819
  size: l
818
820
  };
819
- e && (f.uniqueWithLocations = [c]), b.unique.set(g, f);
821
+ e && (f.uniqueWithLocations = [c]), k.unique.set(g, f);
820
822
  }
821
823
  }
822
824
  break;
823
825
  }
824
- case ti: {
826
+ case ri: {
825
827
  if (te(i)) {
826
828
  qe.push(1), B.p(a(i), i.loc);
827
829
  break;
828
830
  }
829
831
  let p = this.declaration, { property: l, important: g } = p, c = 1;
830
- Zt(i) && (xt.p(a(i), i.loc), c++), typeof g == "string" && (Ae.p(y(i) + "!" + g, i.loc), c++), qi(i) && (Ae.p(a(i), i.loc), c++);
832
+ Xt(i) && (xt.p(a(i), i.loc), c++), typeof g == "string" && (ve.p(y(i) + "!" + g, i.loc), c++), Pi(i) && (ve.p(a(i), i.loc), c++);
831
833
  let f = i.children, u = i.loc;
832
834
  if (qe.push(c), m("margin", l) || m("margin-block", l) || m("margin-inline", l) || m("margin-top", l) || m("margin-right", l) || m("margin-bottom", l) || m("margin-left", l) || m("padding", l) || m("padding-block", l) || m("padding-inline", l) || m("padding-top", l) || m("padding-right", l) || m("padding-bottom", l) || m("padding-left", l))
833
- gi(i) && qt.p(l, p.loc);
835
+ yi(i) && vt.p(l, p.loc);
834
836
  else {
835
837
  if (m("z-index", l))
836
838
  return Ct.p(a(i), u), this.skip;
837
839
  if (m("font", l)) {
838
- if (Ue(i)) return;
839
- let { font_size: h, line_height: x, font_family: v } = bi(i, a, function(E) {
840
- E.type === "keyword" && B.p(E.value, u);
840
+ if (Ie(i)) return;
841
+ let h = xi(i, a, function(It) {
842
+ It.type === "keyword" && B.p(It.value, u);
841
843
  });
842
- v && Pe.p(v, u), h && Le.p(h, u), x && Re.p(x, u);
844
+ if (!h)
845
+ return this.skip;
846
+ let { font_size: x, line_height: q, font_family: F } = h;
847
+ F && Ae.p(F, u), x && Pe.p(x, u), q && Le.p(q, u);
843
848
  break;
844
849
  } else if (m("font-size", l)) {
845
- Ue(i) || Le.p(a(i), u);
850
+ Ie(i) || Pe.p(a(i), u);
846
851
  break;
847
852
  } else if (m("font-family", l)) {
848
- Ue(i) || Pe.p(a(i), u);
853
+ Ie(i) || Ae.p(a(i), u);
849
854
  break;
850
855
  } else if (m("line-height", l))
851
- Re.p(a(i), u);
856
+ Le.p(a(i), u);
852
857
  else if (m("transition", l) || m("animation", l)) {
853
- Ci(f, function(h) {
858
+ Si(f, function(h) {
854
859
  h.type === "fn" ? $.p(a(h.value), u) : h.type === "duration" ? ee.p(a(h.value), u) : h.type === "keyword" && B.p(a(h.value), u);
855
860
  });
856
861
  break;
@@ -867,49 +872,49 @@ function Di(r, t = {}) {
867
872
  } else if (m("container-name", l))
868
873
  Q.p(a(i), u);
869
874
  else if (m("container", l))
870
- ((Tt = f.first) == null ? void 0 : Tt.type) === "Identifier" && Q.p(f.first.name, u);
871
- else if (Ai.has(_i(l))) {
872
- te(i) || vt.push(a(i), l, u);
875
+ ((Mt = f.first) == null ? void 0 : Mt.type) === "Identifier" && Q.p(f.first.name, u);
876
+ else if (Li.has(vi(l))) {
877
+ te(i) || qt.push(a(i), l, u);
873
878
  break;
874
879
  } else m("text-shadow", l) ? te(i) || zt.p(a(i), u) : m("box-shadow", l) && (te(i) || St.p(a(i), u));
875
880
  }
876
- q(i, function(h) {
881
+ v(i, function(h) {
877
882
  let x = h.name;
878
883
  switch (h.type) {
879
- case si: {
880
- let v = h.value.length;
881
- return R("\\9", h.value) && (v = v - 2), U.push("#" + h.value, l, u), V.p("hex" + v, u), this.skip;
884
+ case ni: {
885
+ let q = h.value.length;
886
+ return O("\\9", h.value) && (q = q - 2), U.push("#" + h.value, l, u), V.p("hex" + q, u), this.skip;
882
887
  }
883
- case O: {
888
+ case R: {
884
889
  ie.has(x) && B.p(x, u);
885
- let v = x.length;
886
- if (v > 20 || v < 3)
890
+ let q = x.length;
891
+ if (q > 20 || q < 3)
887
892
  return this.skip;
888
- if (mi.has(x)) {
889
- let E = a(h);
890
- U.push(E, l, u), V.p(x.toLowerCase(), u);
893
+ if (di.has(x)) {
894
+ let F = a(h);
895
+ U.push(F, l, u), V.p(x.toLowerCase(), u);
891
896
  return;
892
897
  }
893
- if (fi.has(x)) {
894
- let E = a(h);
895
- U.push(E, l, u), V.p("named", u);
898
+ if (hi.has(x)) {
899
+ let F = a(h);
900
+ U.push(F, l, u), V.p("named", u);
896
901
  return;
897
902
  }
898
- if (pi.has(x)) {
899
- let E = a(h);
900
- U.push(E, l, u), V.p("system", u);
903
+ if (mi.has(x)) {
904
+ let F = a(h);
905
+ U.push(F, l, u), V.p("system", u);
901
906
  return;
902
907
  }
903
908
  return this.skip;
904
909
  }
905
- case Be: {
910
+ case je: {
906
911
  if (S("var", x))
907
912
  return this.skip;
908
- if (hi.has(x)) {
913
+ if (gi.has(x)) {
909
914
  U.push(a(h), l, h.loc), V.p(x.toLowerCase(), h.loc);
910
915
  return;
911
916
  }
912
- if (R("gradient", x)) {
917
+ if (O("gradient", x)) {
913
918
  _t.p(a(h), h.loc);
914
919
  return;
915
920
  }
@@ -918,12 +923,12 @@ function Di(r, t = {}) {
918
923
  });
919
924
  break;
920
925
  }
921
- case He: {
926
+ case Ve: {
922
927
  if (this.atrulePrelude !== null)
923
928
  return this.skip;
924
929
  K++;
925
930
  let p = 1;
926
- wt.add(a(i)), Se.push(L - 1), kt.p(L - 1, i.loc), i.important === !0 && (J++, p++, this.atrule && R("keyframes", this.atrule.name) && (Ce++, p++)), bt.push(p);
931
+ wt.add(a(i)), ze.push(L - 1), bt.p(L - 1, i.loc), i.important === !0 && (J++, p++, this.atrule && O("keyframes", this.atrule.name) && (xe++, p++)), kt.push(p);
927
932
  let { property: l, loc: { start: g } } = i, c = {
928
933
  start: {
929
934
  line: g.line,
@@ -934,25 +939,25 @@ function Di(r, t = {}) {
934
939
  offset: g.offset + l.length
935
940
  }
936
941
  };
937
- N.p(l, c), F(l) ? (ve.p(l, c), j.push(2)) : Si(l) ? (_e.p(l, c), j.push(2)) : Ye(l) ? (X.p(l, c), j.push(i.important ? 3 : 2), i.important === !0 && ze.p(l, c)) : j.push(1);
942
+ N.p(l, c), E(l) ? (_e.p(l, c), j.push(2)) : qi(l) ? (Se.p(l, c), j.push(2)) : Be(l) ? (X.p(l, c), j.push(i.important ? 3 : 2), i.important === !0 && Ce.p(l, c)) : j.push(1);
938
943
  break;
939
944
  }
940
945
  }
941
- (i.type === Ie || i.type === Me) && L++;
946
+ (i.type === Me || i.type === Te) && L++;
942
947
  },
943
948
  leave(i) {
944
- (i.type === Ie || i.type === Me) && L--;
949
+ (i.type === Me || i.type === Te) && L--;
945
950
  }
946
951
  });
947
- let At = wt.size, H = Z.size(), De = ut.aggregate(), Ee = ct.aggregate(), Fe = ft.aggregate(), Pt = ot.size, d = Object.assign, Lt = r.length, Te = le.length, Rt = se.aggregate(), Ot = Z.aggregate(), Dt = bt.aggregate(), Et = j.aggregate(), Ft = qe.aggregate();
952
+ let At = wt.size, H = Z.size(), Re = ut.aggregate(), De = ct.aggregate(), Fe = ft.aggregate(), Pt = ot.size, d = Object.assign, Lt = r.length, Ee = se.length, Ot = re.aggregate(), Rt = Z.aggregate(), Dt = kt.aggregate(), Ft = j.aggregate(), Et = qe.aggregate(), Tt = Ye.c();
948
953
  return {
949
954
  stylesheet: {
950
- sourceLinesOfCode: re + H + K + ye.size(),
951
- linesOfCode: Jt,
955
+ sourceLinesOfCode: Tt.total + H + K + de.size(),
956
+ linesOfCode: $t,
952
957
  size: Lt,
953
- complexity: Rt.sum + Ot.sum + Dt.sum + Et.sum + Ft.sum,
958
+ complexity: Ot.sum + Rt.sum + Dt.sum + Ft.sum + Et.sum,
954
959
  comments: {
955
- total: k,
960
+ total: b,
956
961
  size: w
957
962
  },
958
963
  embeddedContent: {
@@ -961,97 +966,99 @@ function Di(r, t = {}) {
961
966
  ratio: z(_, Lt)
962
967
  },
963
968
  types: {
964
- total: b.total,
965
- totalUnique: b.unique.size,
966
- uniquenessRatio: z(b.unique.size, b.total),
967
- unique: Object.fromEntries(b.unique)
969
+ total: k.total,
970
+ totalUnique: k.unique.size,
971
+ uniquenessRatio: z(k.unique.size, k.total),
972
+ unique: Object.fromEntries(k.unique)
968
973
  }
969
974
  }
970
975
  },
971
- atrules: {
972
- fontface: d({
973
- total: Te,
974
- totalUnique: Te,
975
- unique: le,
976
- uniquenessRatio: Te === 0 ? 0 : 1
977
- }, e ? {
978
- uniqueWithLocations: Ge.c().uniqueWithLocations
979
- } : {}),
980
- import: Qe.c(),
981
- media: d(
982
- Ze.c(),
983
- {
984
- browserhacks: Je.c(),
985
- features: Xe.c()
986
- }
987
- ),
988
- charset: $e.c(),
989
- supports: d(
990
- ae.c(),
991
- {
992
- browserhacks: et.c()
993
- }
994
- ),
995
- keyframes: d(
996
- oe.c(),
997
- {
998
- prefixed: d(
999
- ue.c(),
1000
- {
1001
- ratio: z(ue.size(), oe.size())
1002
- }
1003
- )
1004
- }
1005
- ),
1006
- container: d(
1007
- tt.c(),
1008
- {
1009
- names: Q.c()
1010
- }
1011
- ),
1012
- layer: ne.c(),
1013
- property: it.c(),
1014
- total: re,
1015
- complexity: Rt,
1016
- nesting: d(
1017
- ce.aggregate(),
1018
- {
1019
- items: ce.toArray()
1020
- },
1021
- rt.c()
1022
- )
1023
- },
976
+ atrules: d(
977
+ Tt,
978
+ {
979
+ fontface: d({
980
+ total: Ee,
981
+ totalUnique: Ee,
982
+ unique: se,
983
+ uniquenessRatio: Ee === 0 ? 0 : 1
984
+ }, e ? {
985
+ uniqueWithLocations: Ge.c().uniqueWithLocations
986
+ } : {}),
987
+ import: Qe.c(),
988
+ media: d(
989
+ Ze.c(),
990
+ {
991
+ browserhacks: Je.c(),
992
+ features: Xe.c()
993
+ }
994
+ ),
995
+ charset: $e.c(),
996
+ supports: d(
997
+ ne.c(),
998
+ {
999
+ browserhacks: et.c()
1000
+ }
1001
+ ),
1002
+ keyframes: d(
1003
+ ae.c(),
1004
+ {
1005
+ prefixed: d(
1006
+ oe.c(),
1007
+ {
1008
+ ratio: z(oe.size(), ae.size())
1009
+ }
1010
+ )
1011
+ }
1012
+ ),
1013
+ container: d(
1014
+ tt.c(),
1015
+ {
1016
+ names: Q.c()
1017
+ }
1018
+ ),
1019
+ layer: le.c(),
1020
+ property: it.c(),
1021
+ complexity: Ot,
1022
+ nesting: d(
1023
+ ue.aggregate(),
1024
+ {
1025
+ items: ue.toArray()
1026
+ },
1027
+ rt.c()
1028
+ )
1029
+ }
1030
+ ),
1024
1031
  rules: {
1025
- total: fe,
1032
+ total: ce,
1026
1033
  empty: {
1027
- total: pe,
1028
- ratio: z(pe, fe)
1034
+ total: fe,
1035
+ ratio: z(fe, ce)
1029
1036
  },
1030
1037
  sizes: d(
1031
- he.aggregate(),
1038
+ pe.aggregate(),
1032
1039
  {
1033
- items: he.toArray()
1040
+ items: pe.toArray()
1034
1041
  },
1035
1042
  st.c()
1036
1043
  ),
1037
1044
  nesting: d(
1038
- de.aggregate(),
1045
+ ge.aggregate(),
1039
1046
  {
1040
- items: de.toArray()
1047
+ items: ge.toArray()
1041
1048
  },
1042
1049
  at.c()
1043
1050
  ),
1044
1051
  selectors: d(
1045
- me.aggregate(),
1052
+ he.aggregate(),
1046
1053
  {
1047
- items: me.toArray()
1054
+ items: he.toArray()
1048
1055
  },
1049
1056
  lt.c()
1050
1057
  ),
1051
1058
  declarations: d(
1052
- ge.aggregate(),
1059
+ me.aggregate(),
1053
1060
  {
1054
- items: ge.toArray()
1061
+ items: me.toArray()
1055
1062
  },
1056
1063
  nt.c()
1057
1064
  )
@@ -1067,34 +1074,34 @@ function Di(r, t = {}) {
1067
1074
  /** @type Specificity */
1068
1075
  max: M === void 0 ? [0, 0, 0] : M,
1069
1076
  /** @type Specificity */
1070
- sum: [De.sum, Ee.sum, Fe.sum],
1077
+ sum: [Re.sum, De.sum, Fe.sum],
1071
1078
  /** @type Specificity */
1072
- mean: [De.mean, Ee.mean, Fe.mean],
1079
+ mean: [Re.mean, De.mean, Fe.mean],
1073
1080
  /** @type Specificity */
1074
- mode: [De.mode, Ee.mode, Fe.mode],
1081
+ mode: [Re.mode, De.mode, Fe.mode],
1075
1082
  /** @type Specificity */
1076
1083
  items: mt
1077
1084
  },
1078
1085
  pt.c()
1079
1086
  ),
1080
1087
  complexity: d(
1081
- Ot,
1088
+ Rt,
1082
1089
  ht.c(),
1083
1090
  {
1084
1091
  items: Z.toArray()
1085
1092
  }
1086
1093
  ),
1087
1094
  nesting: d(
1088
- xe.aggregate(),
1095
+ be.aggregate(),
1089
1096
  {
1090
- items: xe.toArray()
1097
+ items: be.toArray()
1091
1098
  },
1092
1099
  yt.c()
1093
1100
  ),
1094
1101
  id: d(
1095
- be.c(),
1102
+ we.c(),
1096
1103
  {
1097
- ratio: z(be.size(), H)
1104
+ ratio: z(we.size(), H)
1098
1105
  }
1099
1106
  ),
1100
1107
  pseudoClasses: gt.c(),
@@ -1104,11 +1111,11 @@ function Di(r, t = {}) {
1104
1111
  ratio: z(ke.size(), H)
1105
1112
  }
1106
1113
  ),
1107
- keyframes: ye.c(),
1114
+ keyframes: de.c(),
1108
1115
  prefixed: d(
1109
- we.c(),
1116
+ ye.c(),
1110
1117
  {
1111
- ratio: z(we.size(), H)
1118
+ ratio: z(ye.size(), H)
1112
1119
  }
1113
1120
  ),
1114
1121
  combinators: dt.c()
@@ -1121,26 +1128,26 @@ function Di(r, t = {}) {
1121
1128
  total: J,
1122
1129
  ratio: z(J, K),
1123
1130
  inKeyframes: {
1124
- total: Ce,
1125
- ratio: z(Ce, J)
1131
+ total: xe,
1132
+ ratio: z(xe, J)
1126
1133
  }
1127
1134
  },
1128
1135
  complexity: Dt,
1129
1136
  nesting: d(
1130
- Se.aggregate(),
1137
+ ze.aggregate(),
1131
1138
  {
1132
- items: Se.toArray()
1139
+ items: ze.toArray()
1133
1140
  },
1134
- kt.c()
1141
+ bt.c()
1135
1142
  )
1136
1143
  },
1137
1144
  properties: d(
1138
1145
  N.c(),
1139
1146
  {
1140
1147
  prefixed: d(
1141
- ve.c(),
1148
+ _e.c(),
1142
1149
  {
1143
- ratio: z(ve.size(), N.size())
1150
+ ratio: z(_e.size(), N.size())
1144
1151
  }
1145
1152
  ),
1146
1153
  custom: d(
@@ -1148,20 +1155,20 @@ function Di(r, t = {}) {
1148
1155
  {
1149
1156
  ratio: z(X.size(), N.size()),
1150
1157
  importants: d(
1151
- ze.c(),
1158
+ Ce.c(),
1152
1159
  {
1153
- ratio: z(ze.size(), X.size())
1160
+ ratio: z(Ce.size(), X.size())
1154
1161
  }
1155
1162
  )
1156
1163
  }
1157
1164
  ),
1158
1165
  browserhacks: d(
1159
- _e.c(),
1166
+ Se.c(),
1160
1167
  {
1161
- ratio: z(_e.size(), N.size())
1168
+ ratio: z(Se.size(), N.size())
1162
1169
  }
1163
1170
  ),
1164
- complexity: Et
1171
+ complexity: Ft
1165
1172
  }
1166
1173
  ),
1167
1174
  values: {
@@ -1172,23 +1179,23 @@ function Di(r, t = {}) {
1172
1179
  }
1173
1180
  ),
1174
1181
  gradients: _t.c(),
1175
- fontFamilies: Pe.c(),
1176
- fontSizes: Le.c(),
1177
- lineHeights: Re.c(),
1182
+ fontFamilies: Ae.c(),
1183
+ fontSizes: Pe.c(),
1184
+ lineHeights: Le.c(),
1178
1185
  zindexes: Ct.c(),
1179
1186
  textShadows: zt.c(),
1180
1187
  boxShadows: St.c(),
1181
- borderRadiuses: vt.count(),
1188
+ borderRadiuses: qt.count(),
1182
1189
  animations: {
1183
1190
  durations: ee.c(),
1184
1191
  timingFunctions: $.c()
1185
1192
  },
1186
1193
  prefixes: xt.c(),
1187
- browserhacks: Ae.c(),
1194
+ browserhacks: ve.c(),
1188
1195
  units: Oe.count(),
1189
- complexity: Ft,
1196
+ complexity: Et,
1190
1197
  keywords: B.c(),
1191
- resets: qt.c()
1198
+ resets: vt.c()
1192
1199
  },
1193
1200
  __meta__: {
1194
1201
  parseTime: T - P,
@@ -1197,18 +1204,18 @@ function Di(r, t = {}) {
1197
1204
  }
1198
1205
  };
1199
1206
  }
1200
- function Ht(r, t) {
1207
+ function Kt(r, t) {
1201
1208
  return r[0] === t[0] ? r[1] === t[1] ? t[2] - r[2] : t[1] - r[1] : t[0] - r[0];
1202
1209
  }
1203
1210
  export {
1204
- Di as analyze,
1205
- Ht as compareSpecificity,
1206
- F as hasVendorPrefix,
1207
- Gt as isAccessibilitySelector,
1208
- ai as isMediaBrowserhack,
1209
- Si as isPropertyHack,
1210
- oi as isSelectorPrefixed,
1211
- ni as isSupportsBrowserhack,
1212
- Zt as isValuePrefixed,
1213
- Qt as selectorComplexity
1211
+ Ei as analyze,
1212
+ Kt as compareSpecificity,
1213
+ E as hasVendorPrefix,
1214
+ Zt as isAccessibilitySelector,
1215
+ ui as isMediaBrowserhack,
1216
+ qi as isPropertyHack,
1217
+ ci as isSelectorPrefixed,
1218
+ oi as isSupportsBrowserhack,
1219
+ Xt as isValuePrefixed,
1220
+ Jt as selectorComplexity
1214
1221
  };
package/dist/index.d.ts CHANGED
@@ -44,7 +44,21 @@ export function analyze(css: string, options?: Options): {
44
44
  };
45
45
  };
46
46
  };
47
- atrules: {
47
+ atrules: ({
48
+ total: number;
49
+ totalUnique: number;
50
+ uniquenessRatio: number;
51
+ unique: Record<string, number>;
52
+ } & ({
53
+ uniqueWithLocations: Record<string, {
54
+ line: number;
55
+ column: number;
56
+ offset: number;
57
+ length: number;
58
+ }[]>;
59
+ } | {
60
+ uniqueWithLocations?: undefined;
61
+ })) & {
48
62
  fontface: {
49
63
  total: number;
50
64
  totalUnique: number;
@@ -261,7 +275,6 @@ export function analyze(css: string, options?: Options): {
261
275
  } | {
262
276
  uniqueWithLocations?: undefined;
263
277
  });
264
- total: number;
265
278
  complexity: {
266
279
  min: number | undefined;
267
280
  max: number | undefined;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@projectwallace/css-analyzer",
3
3
  "description": "The best CSS analyzer out there. Check design tokens, complexity, specificity, performance and more.",
4
- "version": "7.4.0",
4
+ "version": "7.5.1",
5
5
  "author": "Bart Veneman",
6
6
  "repository": {
7
7
  "type": "git",