@projectwallace/css-analyzer 7.1.1 → 7.3.0

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