@projectwallace/css-analyzer 7.6.1 → 7.6.3

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