tailwind-clamp 4.2.2 → 4.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.
- package/README.md +78 -0
- package/dist/index.js +703 -664
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var C = (t, e, n) =>
|
|
4
|
-
function
|
|
1
|
+
var vt = Object.defineProperty;
|
|
2
|
+
var gt = (t, e, n) => e in t ? vt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var C = (t, e, n) => gt(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
function _e(t, e) {
|
|
5
5
|
return { handler: t, config: e };
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
_e.withOptions = function(t, e = () => ({})) {
|
|
8
8
|
function n(r) {
|
|
9
9
|
return { handler: t(r), config: e(r) };
|
|
10
10
|
}
|
|
11
11
|
return n.__isOptionsFunction = !0, n;
|
|
12
12
|
};
|
|
13
|
-
var
|
|
14
|
-
const
|
|
13
|
+
var mt = _e;
|
|
14
|
+
const ht = (t) => {
|
|
15
15
|
switch (t) {
|
|
16
16
|
// Sizing & Spacing
|
|
17
17
|
case "p":
|
|
@@ -558,7 +558,7 @@ const lt = (t) => {
|
|
|
558
558
|
default:
|
|
559
559
|
return null;
|
|
560
560
|
}
|
|
561
|
-
},
|
|
561
|
+
}, ee = {
|
|
562
562
|
error() {
|
|
563
563
|
console.log("\x1B[31m", ...arguments, "\x1B[0m");
|
|
564
564
|
},
|
|
@@ -572,7 +572,7 @@ const lt = (t) => {
|
|
|
572
572
|
console.log("\x1B[90m", ...arguments, "\x1B[0m");
|
|
573
573
|
}
|
|
574
574
|
};
|
|
575
|
-
class
|
|
575
|
+
class De extends Error {
|
|
576
576
|
constructor(n, r, o, i) {
|
|
577
577
|
super(n);
|
|
578
578
|
C(this, "sourceStart");
|
|
@@ -581,73 +581,73 @@ class be extends Error {
|
|
|
581
581
|
this.name = "ParseError", this.sourceStart = r, this.sourceEnd = o, this.parserState = i;
|
|
582
582
|
}
|
|
583
583
|
}
|
|
584
|
-
class
|
|
584
|
+
class Y extends De {
|
|
585
585
|
constructor(n, r, o, i, s) {
|
|
586
586
|
super(n, r, o, i);
|
|
587
587
|
C(this, "token");
|
|
588
588
|
this.token = s;
|
|
589
589
|
}
|
|
590
590
|
}
|
|
591
|
-
const
|
|
592
|
-
function
|
|
591
|
+
const H = { UnexpectedNewLineInString: "Unexpected newline while consuming a string token.", UnexpectedEOFInString: "Unexpected EOF while consuming a string token.", UnexpectedEOFInComment: "Unexpected EOF while consuming a comment.", UnexpectedEOFInURL: "Unexpected EOF while consuming a url token.", UnexpectedEOFInEscapedCodePoint: "Unexpected EOF while consuming an escaped code point.", UnexpectedCharacterInURL: "Unexpected character while consuming a url token.", InvalidEscapeSequenceInURL: "Invalid escape sequence while consuming a url token.", InvalidEscapeSequenceAfterBackslash: 'Invalid escape sequence after "\\"' };
|
|
592
|
+
function G(...t) {
|
|
593
593
|
let e = "";
|
|
594
594
|
for (let n = 0; n < t.length; n++) e += t[n][1];
|
|
595
595
|
return e;
|
|
596
596
|
}
|
|
597
|
-
const
|
|
598
|
-
function
|
|
599
|
-
return t.source.codePointAt(t.cursor) === 60 && t.source.codePointAt(t.cursor + 1) === 33 && t.source.codePointAt(t.cursor + 2) ===
|
|
597
|
+
const ne = 13, A = 45, re = 10, oe = 43, Z = 65533;
|
|
598
|
+
function Ct(t) {
|
|
599
|
+
return t.source.codePointAt(t.cursor) === 60 && t.source.codePointAt(t.cursor + 1) === 33 && t.source.codePointAt(t.cursor + 2) === A && t.source.codePointAt(t.cursor + 3) === A;
|
|
600
600
|
}
|
|
601
|
-
function
|
|
601
|
+
function W(t) {
|
|
602
602
|
return t >= 48 && t <= 57;
|
|
603
603
|
}
|
|
604
|
-
function
|
|
604
|
+
function yt(t) {
|
|
605
605
|
return t >= 65 && t <= 90;
|
|
606
606
|
}
|
|
607
|
-
function
|
|
607
|
+
function Et(t) {
|
|
608
608
|
return t >= 97 && t <= 122;
|
|
609
609
|
}
|
|
610
|
-
function
|
|
610
|
+
function te(t) {
|
|
611
611
|
return t >= 48 && t <= 57 || t >= 97 && t <= 102 || t >= 65 && t <= 70;
|
|
612
612
|
}
|
|
613
|
-
function
|
|
614
|
-
return
|
|
613
|
+
function Pt(t) {
|
|
614
|
+
return Et(t) || yt(t);
|
|
615
615
|
}
|
|
616
|
-
function
|
|
617
|
-
return
|
|
616
|
+
function ie(t) {
|
|
617
|
+
return Pt(t) || kt(t) || t === 95;
|
|
618
618
|
}
|
|
619
|
-
function
|
|
620
|
-
return
|
|
619
|
+
function qe(t) {
|
|
620
|
+
return ie(t) || W(t) || t === A;
|
|
621
621
|
}
|
|
622
|
-
function
|
|
623
|
-
return t === 183 || t === 8204 || t === 8205 || t === 8255 || t === 8256 || t === 8204 || 192 <= t && t <= 214 || 216 <= t && t <= 246 || 248 <= t && t <= 893 || 895 <= t && t <= 8191 || 8304 <= t && t <= 8591 || 11264 <= t && t <= 12271 || 12289 <= t && t <= 55295 || 63744 <= t && t <= 64975 || 65008 <= t && t <= 65533 || t === 0 || !!
|
|
622
|
+
function kt(t) {
|
|
623
|
+
return t === 183 || t === 8204 || t === 8205 || t === 8255 || t === 8256 || t === 8204 || 192 <= t && t <= 214 || 216 <= t && t <= 246 || 248 <= t && t <= 893 || 895 <= t && t <= 8191 || 8304 <= t && t <= 8591 || 11264 <= t && t <= 12271 || 12289 <= t && t <= 55295 || 63744 <= t && t <= 64975 || 65008 <= t && t <= 65533 || t === 0 || !!ae(t) || t >= 65536;
|
|
624
624
|
}
|
|
625
|
-
function
|
|
626
|
-
return t ===
|
|
625
|
+
function be(t) {
|
|
626
|
+
return t === re || t === ne || t === 12;
|
|
627
627
|
}
|
|
628
|
-
function
|
|
629
|
-
return t === 32 || t ===
|
|
628
|
+
function X(t) {
|
|
629
|
+
return t === 32 || t === re || t === 9 || t === ne || t === 12;
|
|
630
630
|
}
|
|
631
|
-
function
|
|
631
|
+
function ae(t) {
|
|
632
632
|
return t >= 55296 && t <= 57343;
|
|
633
633
|
}
|
|
634
|
-
function
|
|
635
|
-
return t.source.codePointAt(t.cursor) === 92 && !
|
|
634
|
+
function de(t) {
|
|
635
|
+
return t.source.codePointAt(t.cursor) === 92 && !be(t.source.codePointAt(t.cursor + 1) ?? -1);
|
|
636
636
|
}
|
|
637
|
-
function
|
|
638
|
-
return e.source.codePointAt(e.cursor) ===
|
|
637
|
+
function Se(t, e) {
|
|
638
|
+
return e.source.codePointAt(e.cursor) === A ? e.source.codePointAt(e.cursor + 1) === A || !!ie(e.source.codePointAt(e.cursor + 1) ?? -1) || e.source.codePointAt(e.cursor + 1) === 92 && !be(e.source.codePointAt(e.cursor + 2) ?? -1) : !!ie(e.source.codePointAt(e.cursor) ?? -1) || de(e);
|
|
639
639
|
}
|
|
640
|
-
function
|
|
641
|
-
return t.source.codePointAt(t.cursor) ===
|
|
640
|
+
function Ye(t) {
|
|
641
|
+
return t.source.codePointAt(t.cursor) === oe || t.source.codePointAt(t.cursor) === A ? !!W(t.source.codePointAt(t.cursor + 1) ?? -1) || t.source.codePointAt(t.cursor + 1) === 46 && W(t.source.codePointAt(t.cursor + 2) ?? -1) : t.source.codePointAt(t.cursor) === 46 ? W(t.source.codePointAt(t.cursor + 1) ?? -1) : W(t.source.codePointAt(t.cursor) ?? -1);
|
|
642
642
|
}
|
|
643
|
-
function
|
|
643
|
+
function bt(t) {
|
|
644
644
|
return t.source.codePointAt(t.cursor) === 47 && t.source.codePointAt(t.cursor + 1) === 42;
|
|
645
645
|
}
|
|
646
|
-
function
|
|
647
|
-
return t.source.codePointAt(t.cursor) ===
|
|
646
|
+
function St(t) {
|
|
647
|
+
return t.source.codePointAt(t.cursor) === A && t.source.codePointAt(t.cursor + 1) === A && t.source.codePointAt(t.cursor + 2) === 62;
|
|
648
648
|
}
|
|
649
|
-
var a,
|
|
650
|
-
function
|
|
649
|
+
var a, d, Ae;
|
|
650
|
+
function At(t) {
|
|
651
651
|
switch (t) {
|
|
652
652
|
case a.OpenParen:
|
|
653
653
|
return a.CloseParen;
|
|
@@ -665,7 +665,7 @@ function Ct(t) {
|
|
|
665
665
|
return null;
|
|
666
666
|
}
|
|
667
667
|
}
|
|
668
|
-
function
|
|
668
|
+
function Dt(t) {
|
|
669
669
|
switch (t[0]) {
|
|
670
670
|
case a.OpenParen:
|
|
671
671
|
return [a.CloseParen, ")", -1, -1, void 0];
|
|
@@ -683,12 +683,12 @@ function yt(t) {
|
|
|
683
683
|
return null;
|
|
684
684
|
}
|
|
685
685
|
}
|
|
686
|
-
function
|
|
686
|
+
function Bt(t, e) {
|
|
687
687
|
for (e.advanceCodePoint(2); ; ) {
|
|
688
688
|
const n = e.readCodePoint();
|
|
689
689
|
if (n === void 0) {
|
|
690
690
|
const r = [a.Comment, e.source.slice(e.representationStart, e.representationEnd + 1), e.representationStart, e.representationEnd, void 0];
|
|
691
|
-
return t.onParseError(new
|
|
691
|
+
return t.onParseError(new Y(H.UnexpectedEOFInComment, e.representationStart, e.representationEnd, ["4.3.2. Consume comments", "Unexpected EOF"], r)), r;
|
|
692
692
|
}
|
|
693
693
|
if (n === 42 && e.source.codePointAt(e.cursor) !== void 0 && e.source.codePointAt(e.cursor) === 47) {
|
|
694
694
|
e.advanceCodePoint();
|
|
@@ -697,81 +697,81 @@ function Et(t, e) {
|
|
|
697
697
|
}
|
|
698
698
|
return [a.Comment, e.source.slice(e.representationStart, e.representationEnd + 1), e.representationStart, e.representationEnd, void 0];
|
|
699
699
|
}
|
|
700
|
-
function
|
|
700
|
+
function Be(t, e) {
|
|
701
701
|
const n = e.readCodePoint();
|
|
702
|
-
if (n === void 0) return t.onParseError(new
|
|
703
|
-
if (
|
|
702
|
+
if (n === void 0) return t.onParseError(new De(H.UnexpectedEOFInEscapedCodePoint, e.representationStart, e.representationEnd, ["4.3.7. Consume an escaped code point", "Unexpected EOF"])), Z;
|
|
703
|
+
if (te(n)) {
|
|
704
704
|
const r = [n];
|
|
705
705
|
let o;
|
|
706
|
-
for (; (o = e.source.codePointAt(e.cursor)) !== void 0 &&
|
|
707
|
-
|
|
706
|
+
for (; (o = e.source.codePointAt(e.cursor)) !== void 0 && te(o) && r.length < 6; ) r.push(o), e.advanceCodePoint();
|
|
707
|
+
X(e.source.codePointAt(e.cursor) ?? -1) && (e.source.codePointAt(e.cursor) === ne && e.source.codePointAt(e.cursor + 1) === re && e.advanceCodePoint(), e.advanceCodePoint());
|
|
708
708
|
const i = parseInt(String.fromCodePoint(...r), 16);
|
|
709
|
-
return i === 0 ||
|
|
709
|
+
return i === 0 || ae(i) || i > 1114111 ? Z : i;
|
|
710
710
|
}
|
|
711
|
-
return n === 0 ||
|
|
711
|
+
return n === 0 || ae(n) ? Z : n;
|
|
712
712
|
}
|
|
713
|
-
function
|
|
713
|
+
function Fe(t, e) {
|
|
714
714
|
const n = [];
|
|
715
715
|
for (; ; ) {
|
|
716
716
|
const r = e.source.codePointAt(e.cursor) ?? -1;
|
|
717
|
-
if (r === 0 ||
|
|
718
|
-
else if (
|
|
717
|
+
if (r === 0 || ae(r)) n.push(Z), e.advanceCodePoint(+(r > 65535) + 1);
|
|
718
|
+
else if (qe(r)) n.push(r), e.advanceCodePoint(+(r > 65535) + 1);
|
|
719
719
|
else {
|
|
720
|
-
if (!
|
|
721
|
-
e.advanceCodePoint(), n.push(
|
|
720
|
+
if (!de(e)) return n;
|
|
721
|
+
e.advanceCodePoint(), n.push(Be(t, e));
|
|
722
722
|
}
|
|
723
723
|
}
|
|
724
724
|
}
|
|
725
|
-
function
|
|
725
|
+
function Ft(t, e) {
|
|
726
726
|
e.advanceCodePoint();
|
|
727
727
|
const n = e.source.codePointAt(e.cursor);
|
|
728
|
-
if (n !== void 0 && (
|
|
729
|
-
let r =
|
|
730
|
-
|
|
731
|
-
const o =
|
|
728
|
+
if (n !== void 0 && (qe(n) || de(e))) {
|
|
729
|
+
let r = Ae.Unrestricted;
|
|
730
|
+
Se(0, e) && (r = Ae.ID);
|
|
731
|
+
const o = Fe(t, e);
|
|
732
732
|
return [a.Hash, e.source.slice(e.representationStart, e.representationEnd + 1), e.representationStart, e.representationEnd, { value: String.fromCodePoint(...o), type: r }];
|
|
733
733
|
}
|
|
734
734
|
return [a.Delim, "#", e.representationStart, e.representationEnd, { value: "#" }];
|
|
735
735
|
}
|
|
736
|
-
function
|
|
737
|
-
let n =
|
|
738
|
-
for (e.source.codePointAt(e.cursor) !==
|
|
739
|
-
if (e.source.codePointAt(e.cursor) === 46 &&
|
|
736
|
+
function Nt(t, e) {
|
|
737
|
+
let n = d.Integer;
|
|
738
|
+
for (e.source.codePointAt(e.cursor) !== oe && e.source.codePointAt(e.cursor) !== A || e.advanceCodePoint(); W(e.source.codePointAt(e.cursor) ?? -1); ) e.advanceCodePoint();
|
|
739
|
+
if (e.source.codePointAt(e.cursor) === 46 && W(e.source.codePointAt(e.cursor + 1) ?? -1)) for (e.advanceCodePoint(2), n = d.Number; W(e.source.codePointAt(e.cursor) ?? -1); ) e.advanceCodePoint();
|
|
740
740
|
if (e.source.codePointAt(e.cursor) === 101 || e.source.codePointAt(e.cursor) === 69) {
|
|
741
|
-
if (
|
|
741
|
+
if (W(e.source.codePointAt(e.cursor + 1) ?? -1)) e.advanceCodePoint(2);
|
|
742
742
|
else {
|
|
743
|
-
if (e.source.codePointAt(e.cursor + 1) !==
|
|
743
|
+
if (e.source.codePointAt(e.cursor + 1) !== A && e.source.codePointAt(e.cursor + 1) !== oe || !W(e.source.codePointAt(e.cursor + 2) ?? -1)) return n;
|
|
744
744
|
e.advanceCodePoint(3);
|
|
745
745
|
}
|
|
746
|
-
for (n =
|
|
746
|
+
for (n = d.Number; W(e.source.codePointAt(e.cursor) ?? -1); ) e.advanceCodePoint();
|
|
747
747
|
}
|
|
748
748
|
return n;
|
|
749
749
|
}
|
|
750
|
-
function
|
|
750
|
+
function Me(t, e) {
|
|
751
751
|
let n;
|
|
752
752
|
{
|
|
753
753
|
const i = e.source.codePointAt(e.cursor);
|
|
754
|
-
i ===
|
|
754
|
+
i === A ? n = "-" : i === oe && (n = "+");
|
|
755
755
|
}
|
|
756
|
-
const r =
|
|
757
|
-
if (
|
|
758
|
-
const i =
|
|
756
|
+
const r = Nt(0, e), o = parseFloat(e.source.slice(e.representationStart, e.representationEnd + 1));
|
|
757
|
+
if (Se(0, e)) {
|
|
758
|
+
const i = Fe(t, e);
|
|
759
759
|
return [a.Dimension, e.source.slice(e.representationStart, e.representationEnd + 1), e.representationStart, e.representationEnd, { value: o, signCharacter: n, type: r, unit: String.fromCodePoint(...i) }];
|
|
760
760
|
}
|
|
761
761
|
return e.source.codePointAt(e.cursor) === 37 ? (e.advanceCodePoint(), [a.Percentage, e.source.slice(e.representationStart, e.representationEnd + 1), e.representationStart, e.representationEnd, { value: o, signCharacter: n }]) : [a.Number, e.source.slice(e.representationStart, e.representationEnd + 1), e.representationStart, e.representationEnd, { value: o, signCharacter: n, type: r }];
|
|
762
762
|
}
|
|
763
|
-
function
|
|
764
|
-
for (;
|
|
763
|
+
function wt(t) {
|
|
764
|
+
for (; X(t.source.codePointAt(t.cursor) ?? -1); ) t.advanceCodePoint();
|
|
765
765
|
return [a.Whitespace, t.source.slice(t.representationStart, t.representationEnd + 1), t.representationStart, t.representationEnd, void 0];
|
|
766
766
|
}
|
|
767
767
|
(function(t) {
|
|
768
768
|
t.Comment = "comment", t.AtKeyword = "at-keyword-token", t.BadString = "bad-string-token", t.BadURL = "bad-url-token", t.CDC = "CDC-token", t.CDO = "CDO-token", t.Colon = "colon-token", t.Comma = "comma-token", t.Delim = "delim-token", t.Dimension = "dimension-token", t.EOF = "EOF-token", t.Function = "function-token", t.Hash = "hash-token", t.Ident = "ident-token", t.Number = "number-token", t.Percentage = "percentage-token", t.Semicolon = "semicolon-token", t.String = "string-token", t.URL = "url-token", t.Whitespace = "whitespace-token", t.OpenParen = "(-token", t.CloseParen = ")-token", t.OpenSquare = "[-token", t.CloseSquare = "]-token", t.OpenCurly = "{-token", t.CloseCurly = "}-token", t.UnicodeRange = "unicode-range-token";
|
|
769
769
|
})(a || (a = {})), (function(t) {
|
|
770
770
|
t.Integer = "integer", t.Number = "number";
|
|
771
|
-
})(
|
|
771
|
+
})(d || (d = {})), (function(t) {
|
|
772
772
|
t.Unrestricted = "unrestricted", t.ID = "id";
|
|
773
|
-
})(
|
|
774
|
-
class
|
|
773
|
+
})(Ae || (Ae = {}));
|
|
774
|
+
class It {
|
|
775
775
|
constructor(e) {
|
|
776
776
|
C(this, "cursor", 0);
|
|
777
777
|
C(this, "source", "");
|
|
@@ -793,87 +793,87 @@ class St {
|
|
|
793
793
|
this.representationStart = this.cursor, this.representationEnd = -1;
|
|
794
794
|
}
|
|
795
795
|
}
|
|
796
|
-
function
|
|
796
|
+
function xt(t, e) {
|
|
797
797
|
let n = "";
|
|
798
798
|
const r = e.readCodePoint();
|
|
799
799
|
for (; ; ) {
|
|
800
800
|
const o = e.readCodePoint();
|
|
801
801
|
if (o === void 0) {
|
|
802
802
|
const i = [a.String, e.source.slice(e.representationStart, e.representationEnd + 1), e.representationStart, e.representationEnd, { value: n }];
|
|
803
|
-
return t.onParseError(new
|
|
803
|
+
return t.onParseError(new Y(H.UnexpectedEOFInString, e.representationStart, e.representationEnd, ["4.3.5. Consume a string token", "Unexpected EOF"], i)), i;
|
|
804
804
|
}
|
|
805
|
-
if (
|
|
805
|
+
if (be(o)) {
|
|
806
806
|
e.unreadCodePoint();
|
|
807
807
|
const i = [a.BadString, e.source.slice(e.representationStart, e.representationEnd + 1), e.representationStart, e.representationEnd, void 0];
|
|
808
|
-
return t.onParseError(new
|
|
808
|
+
return t.onParseError(new Y(H.UnexpectedNewLineInString, e.representationStart, e.source.codePointAt(e.cursor) === ne && e.source.codePointAt(e.cursor + 1) === re ? e.representationEnd + 2 : e.representationEnd + 1, ["4.3.5. Consume a string token", "Unexpected newline"], i)), i;
|
|
809
809
|
}
|
|
810
810
|
if (o === r) return [a.String, e.source.slice(e.representationStart, e.representationEnd + 1), e.representationStart, e.representationEnd, { value: n }];
|
|
811
|
-
if (o !== 92) o === 0 ||
|
|
811
|
+
if (o !== 92) o === 0 || ae(o) ? n += String.fromCodePoint(Z) : n += String.fromCodePoint(o);
|
|
812
812
|
else {
|
|
813
813
|
if (e.source.codePointAt(e.cursor) === void 0) continue;
|
|
814
|
-
if (
|
|
815
|
-
e.source.codePointAt(e.cursor) ===
|
|
814
|
+
if (be(e.source.codePointAt(e.cursor) ?? -1)) {
|
|
815
|
+
e.source.codePointAt(e.cursor) === ne && e.source.codePointAt(e.cursor + 1) === re && e.advanceCodePoint(), e.advanceCodePoint();
|
|
816
816
|
continue;
|
|
817
817
|
}
|
|
818
|
-
n += String.fromCodePoint(
|
|
818
|
+
n += String.fromCodePoint(Be(t, e));
|
|
819
819
|
}
|
|
820
820
|
}
|
|
821
821
|
}
|
|
822
|
-
function
|
|
822
|
+
function Ot(t) {
|
|
823
823
|
return !(t.length !== 3 || t[0] !== 117 && t[0] !== 85 || t[1] !== 114 && t[1] !== 82 || t[2] !== 108 && t[2] !== 76);
|
|
824
824
|
}
|
|
825
|
-
function
|
|
825
|
+
function Re(t, e) {
|
|
826
826
|
for (; ; ) {
|
|
827
827
|
const n = e.source.codePointAt(e.cursor);
|
|
828
828
|
if (n === void 0) return;
|
|
829
829
|
if (n === 41) return void e.advanceCodePoint();
|
|
830
|
-
|
|
830
|
+
de(e) ? (e.advanceCodePoint(), Be(t, e)) : e.advanceCodePoint();
|
|
831
831
|
}
|
|
832
832
|
}
|
|
833
|
-
function
|
|
834
|
-
for (;
|
|
833
|
+
function Tt(t, e) {
|
|
834
|
+
for (; X(e.source.codePointAt(e.cursor) ?? -1); ) e.advanceCodePoint();
|
|
835
835
|
let n = "";
|
|
836
836
|
for (; ; ) {
|
|
837
837
|
if (e.source.codePointAt(e.cursor) === void 0) {
|
|
838
838
|
const i = [a.URL, e.source.slice(e.representationStart, e.representationEnd + 1), e.representationStart, e.representationEnd, { value: n }];
|
|
839
|
-
return t.onParseError(new
|
|
839
|
+
return t.onParseError(new Y(H.UnexpectedEOFInURL, e.representationStart, e.representationEnd, ["4.3.6. Consume a url token", "Unexpected EOF"], i)), i;
|
|
840
840
|
}
|
|
841
841
|
if (e.source.codePointAt(e.cursor) === 41) return e.advanceCodePoint(), [a.URL, e.source.slice(e.representationStart, e.representationEnd + 1), e.representationStart, e.representationEnd, { value: n }];
|
|
842
|
-
if (
|
|
843
|
-
for (e.advanceCodePoint();
|
|
842
|
+
if (X(e.source.codePointAt(e.cursor) ?? -1)) {
|
|
843
|
+
for (e.advanceCodePoint(); X(e.source.codePointAt(e.cursor) ?? -1); ) e.advanceCodePoint();
|
|
844
844
|
if (e.source.codePointAt(e.cursor) === void 0) {
|
|
845
845
|
const i = [a.URL, e.source.slice(e.representationStart, e.representationEnd + 1), e.representationStart, e.representationEnd, { value: n }];
|
|
846
|
-
return t.onParseError(new
|
|
846
|
+
return t.onParseError(new Y(H.UnexpectedEOFInURL, e.representationStart, e.representationEnd, ["4.3.6. Consume a url token", "Consume as much whitespace as possible", "Unexpected EOF"], i)), i;
|
|
847
847
|
}
|
|
848
|
-
return e.source.codePointAt(e.cursor) === 41 ? (e.advanceCodePoint(), [a.URL, e.source.slice(e.representationStart, e.representationEnd + 1), e.representationStart, e.representationEnd, { value: n }]) : (
|
|
848
|
+
return e.source.codePointAt(e.cursor) === 41 ? (e.advanceCodePoint(), [a.URL, e.source.slice(e.representationStart, e.representationEnd + 1), e.representationStart, e.representationEnd, { value: n }]) : (Re(t, e), [a.BadURL, e.source.slice(e.representationStart, e.representationEnd + 1), e.representationStart, e.representationEnd, void 0]);
|
|
849
849
|
}
|
|
850
850
|
const o = e.source.codePointAt(e.cursor);
|
|
851
851
|
if (o === 34 || o === 39 || o === 40 || (r = o ?? -1) === 11 || r === 127 || 0 <= r && r <= 8 || 14 <= r && r <= 31) {
|
|
852
|
-
|
|
852
|
+
Re(t, e);
|
|
853
853
|
const i = [a.BadURL, e.source.slice(e.representationStart, e.representationEnd + 1), e.representationStart, e.representationEnd, void 0];
|
|
854
|
-
return t.onParseError(new
|
|
854
|
+
return t.onParseError(new Y(H.UnexpectedCharacterInURL, e.representationStart, e.representationEnd, ["4.3.6. Consume a url token", `Unexpected U+0022 QUOTATION MARK ("), U+0027 APOSTROPHE ('), U+0028 LEFT PARENTHESIS (() or non-printable code point`], i)), i;
|
|
855
855
|
}
|
|
856
856
|
if (o === 92) {
|
|
857
|
-
if (
|
|
858
|
-
e.advanceCodePoint(), n += String.fromCodePoint(
|
|
857
|
+
if (de(e)) {
|
|
858
|
+
e.advanceCodePoint(), n += String.fromCodePoint(Be(t, e));
|
|
859
859
|
continue;
|
|
860
860
|
}
|
|
861
|
-
|
|
861
|
+
Re(t, e);
|
|
862
862
|
const i = [a.BadURL, e.source.slice(e.representationStart, e.representationEnd + 1), e.representationStart, e.representationEnd, void 0];
|
|
863
|
-
return t.onParseError(new
|
|
863
|
+
return t.onParseError(new Y(H.InvalidEscapeSequenceInURL, e.representationStart, e.representationEnd, ["4.3.6. Consume a url token", "U+005C REVERSE SOLIDUS (\\)", "The input stream does not start with a valid escape sequence"], i)), i;
|
|
864
864
|
}
|
|
865
|
-
e.source.codePointAt(e.cursor) === 0 ||
|
|
865
|
+
e.source.codePointAt(e.cursor) === 0 || ae(e.source.codePointAt(e.cursor) ?? -1) ? (n += String.fromCodePoint(Z), e.advanceCodePoint()) : (n += e.source[e.cursor], e.advanceCodePoint());
|
|
866
866
|
}
|
|
867
867
|
var r;
|
|
868
868
|
}
|
|
869
|
-
function
|
|
870
|
-
const n =
|
|
869
|
+
function Ue(t, e) {
|
|
870
|
+
const n = Fe(t, e);
|
|
871
871
|
if (e.source.codePointAt(e.cursor) !== 40) return [a.Ident, e.source.slice(e.representationStart, e.representationEnd + 1), e.representationStart, e.representationEnd, { value: String.fromCodePoint(...n) }];
|
|
872
|
-
if (
|
|
872
|
+
if (Ot(n)) {
|
|
873
873
|
e.advanceCodePoint();
|
|
874
874
|
let r = 0;
|
|
875
875
|
for (; ; ) {
|
|
876
|
-
const o =
|
|
876
|
+
const o = X(e.source.codePointAt(e.cursor) ?? -1), i = X(e.source.codePointAt(e.cursor + 1) ?? -1);
|
|
877
877
|
if (o && i) {
|
|
878
878
|
r += 1, e.advanceCodePoint(1);
|
|
879
879
|
continue;
|
|
@@ -882,20 +882,20 @@ function Ie(t, e) {
|
|
|
882
882
|
if (s === 34 || s === 39) return r > 0 && e.unreadCodePoint(r), [a.Function, e.source.slice(e.representationStart, e.representationEnd + 1), e.representationStart, e.representationEnd, { value: String.fromCodePoint(...n) }];
|
|
883
883
|
break;
|
|
884
884
|
}
|
|
885
|
-
return
|
|
885
|
+
return Tt(t, e);
|
|
886
886
|
}
|
|
887
887
|
return e.advanceCodePoint(), [a.Function, e.source.slice(e.representationStart, e.representationEnd + 1), e.representationStart, e.representationEnd, { value: String.fromCodePoint(...n) }];
|
|
888
888
|
}
|
|
889
|
-
function
|
|
890
|
-
return !(t.source.codePointAt(t.cursor) !== 117 && t.source.codePointAt(t.cursor) !== 85 || t.source.codePointAt(t.cursor + 1) !==
|
|
889
|
+
function Mt(t) {
|
|
890
|
+
return !(t.source.codePointAt(t.cursor) !== 117 && t.source.codePointAt(t.cursor) !== 85 || t.source.codePointAt(t.cursor + 1) !== oe || t.source.codePointAt(t.cursor + 2) !== 63 && !te(t.source.codePointAt(t.cursor + 2) ?? -1));
|
|
891
891
|
}
|
|
892
|
-
function
|
|
892
|
+
function Rt(t, e) {
|
|
893
893
|
e.advanceCodePoint(2);
|
|
894
894
|
const n = [], r = [];
|
|
895
895
|
let o;
|
|
896
|
-
for (; (o = e.source.codePointAt(e.cursor)) !== void 0 && n.length < 6 &&
|
|
896
|
+
for (; (o = e.source.codePointAt(e.cursor)) !== void 0 && n.length < 6 && te(o); ) n.push(o), e.advanceCodePoint();
|
|
897
897
|
for (; (o = e.source.codePointAt(e.cursor)) !== void 0 && n.length < 6 && o === 63; ) r.length === 0 && r.push(...n), n.push(48), r.push(70), e.advanceCodePoint();
|
|
898
|
-
if (!r.length && e.source.codePointAt(e.cursor) ===
|
|
898
|
+
if (!r.length && e.source.codePointAt(e.cursor) === A && te(e.source.codePointAt(e.cursor + 1) ?? -1)) for (e.advanceCodePoint(); (o = e.source.codePointAt(e.cursor)) !== void 0 && r.length < 6 && te(o); ) r.push(o), e.advanceCodePoint();
|
|
899
899
|
if (!r.length) {
|
|
900
900
|
const u = parseInt(String.fromCodePoint(...n), 16);
|
|
901
901
|
return [a.UnicodeRange, e.source.slice(e.representationStart, e.representationEnd + 1), e.representationStart, e.representationEnd, { startOfRange: u, endOfRange: u }];
|
|
@@ -903,21 +903,21 @@ function Nt(t, e) {
|
|
|
903
903
|
const i = parseInt(String.fromCodePoint(...n), 16), s = parseInt(String.fromCodePoint(...r), 16);
|
|
904
904
|
return [a.UnicodeRange, e.source.slice(e.representationStart, e.representationEnd + 1), e.representationStart, e.representationEnd, { startOfRange: i, endOfRange: s }];
|
|
905
905
|
}
|
|
906
|
-
function
|
|
907
|
-
const n =
|
|
906
|
+
function Ut(t, e) {
|
|
907
|
+
const n = Wt(t), r = [];
|
|
908
908
|
for (; !n.endOfFile(); ) r.push(n.nextToken());
|
|
909
909
|
return r.push(n.nextToken()), r;
|
|
910
910
|
}
|
|
911
|
-
function
|
|
912
|
-
const n = t.css.valueOf(), r = t.unicodeRangesAllowed ?? !1, o = new
|
|
911
|
+
function Wt(t, e) {
|
|
912
|
+
const n = t.css.valueOf(), r = t.unicodeRangesAllowed ?? !1, o = new It(n), i = { onParseError: Lt };
|
|
913
913
|
return { nextToken: function() {
|
|
914
914
|
o.resetRepresentation();
|
|
915
915
|
const u = o.source.codePointAt(o.cursor);
|
|
916
916
|
if (u === void 0) return [a.EOF, "", -1, -1, void 0];
|
|
917
|
-
if (u === 47 &&
|
|
918
|
-
if (r && (u === 117 || u === 85) &&
|
|
919
|
-
if (
|
|
920
|
-
if (
|
|
917
|
+
if (u === 47 && bt(o)) return Bt(i, o);
|
|
918
|
+
if (r && (u === 117 || u === 85) && Mt(o)) return Rt(0, o);
|
|
919
|
+
if (ie(u)) return Ue(i, o);
|
|
920
|
+
if (W(u)) return Me(i, o);
|
|
921
921
|
switch (u) {
|
|
922
922
|
case 44:
|
|
923
923
|
return o.advanceCodePoint(), [a.Comma, ",", o.representationStart, o.representationEnd, void 0];
|
|
@@ -939,33 +939,33 @@ function It(t, e) {
|
|
|
939
939
|
return o.advanceCodePoint(), [a.CloseCurly, "}", o.representationStart, o.representationEnd, void 0];
|
|
940
940
|
case 39:
|
|
941
941
|
case 34:
|
|
942
|
-
return
|
|
942
|
+
return xt(i, o);
|
|
943
943
|
case 35:
|
|
944
|
-
return
|
|
945
|
-
case
|
|
944
|
+
return Ft(i, o);
|
|
945
|
+
case oe:
|
|
946
946
|
case 46:
|
|
947
|
-
return
|
|
948
|
-
case
|
|
949
|
-
case
|
|
947
|
+
return Ye(o) ? Me(i, o) : (o.advanceCodePoint(), [a.Delim, o.source[o.representationStart], o.representationStart, o.representationEnd, { value: o.source[o.representationStart] }]);
|
|
948
|
+
case re:
|
|
949
|
+
case ne:
|
|
950
950
|
case 12:
|
|
951
951
|
case 9:
|
|
952
952
|
case 32:
|
|
953
|
-
return
|
|
954
|
-
case
|
|
955
|
-
return
|
|
953
|
+
return wt(o);
|
|
954
|
+
case A:
|
|
955
|
+
return Ye(o) ? Me(i, o) : St(o) ? (o.advanceCodePoint(3), [a.CDC, "-->", o.representationStart, o.representationEnd, void 0]) : Se(0, o) ? Ue(i, o) : (o.advanceCodePoint(), [a.Delim, "-", o.representationStart, o.representationEnd, { value: "-" }]);
|
|
956
956
|
case 60:
|
|
957
|
-
return
|
|
957
|
+
return Ct(o) ? (o.advanceCodePoint(4), [a.CDO, "<!--", o.representationStart, o.representationEnd, void 0]) : (o.advanceCodePoint(), [a.Delim, "<", o.representationStart, o.representationEnd, { value: "<" }]);
|
|
958
958
|
case 64:
|
|
959
|
-
if (o.advanceCodePoint(),
|
|
960
|
-
const c =
|
|
959
|
+
if (o.advanceCodePoint(), Se(0, o)) {
|
|
960
|
+
const c = Fe(i, o);
|
|
961
961
|
return [a.AtKeyword, o.source.slice(o.representationStart, o.representationEnd + 1), o.representationStart, o.representationEnd, { value: String.fromCodePoint(...c) }];
|
|
962
962
|
}
|
|
963
963
|
return [a.Delim, "@", o.representationStart, o.representationEnd, { value: "@" }];
|
|
964
964
|
case 92: {
|
|
965
|
-
if (
|
|
965
|
+
if (de(o)) return Ue(i, o);
|
|
966
966
|
o.advanceCodePoint();
|
|
967
967
|
const c = [a.Delim, "\\", o.representationStart, o.representationEnd, { value: "\\" }];
|
|
968
|
-
return i.onParseError(new
|
|
968
|
+
return i.onParseError(new Y(H.InvalidEscapeSequenceAfterBackslash, o.representationStart, o.representationEnd, ["4.3.1. Consume a token", "U+005C REVERSE SOLIDUS (\\)", "The input stream does not start with a valid escape sequence"], c)), c;
|
|
969
969
|
}
|
|
970
970
|
}
|
|
971
971
|
return o.advanceCodePoint(), [a.Delim, o.source[o.representationStart], o.representationStart, o.representationEnd, { value: o.source[o.representationStart] }];
|
|
@@ -973,41 +973,41 @@ function It(t, e) {
|
|
|
973
973
|
return o.source.codePointAt(o.cursor) === void 0;
|
|
974
974
|
} };
|
|
975
975
|
}
|
|
976
|
-
function
|
|
976
|
+
function Lt() {
|
|
977
977
|
}
|
|
978
|
-
function
|
|
978
|
+
function $t(t, e) {
|
|
979
979
|
const n = [];
|
|
980
980
|
for (const u of e) n.push(u.codePointAt(0));
|
|
981
|
-
const r =
|
|
982
|
-
r[0] === 101 &&
|
|
981
|
+
const r = qt(n);
|
|
982
|
+
r[0] === 101 && Le(r, 0, r[0]);
|
|
983
983
|
const o = String.fromCodePoint(...r), i = t[4].signCharacter === "+" ? t[4].signCharacter : "", s = t[4].value.toString();
|
|
984
984
|
t[1] = `${i}${s}${o}`, t[4].unit = e;
|
|
985
985
|
}
|
|
986
|
-
function
|
|
986
|
+
function qt(t) {
|
|
987
987
|
let e = 0;
|
|
988
|
-
if (t[0] === 0) t.splice(0, 1,
|
|
989
|
-
else if (t[0] ===
|
|
990
|
-
else if (t[0] ===
|
|
988
|
+
if (t[0] === 0) t.splice(0, 1, Z), e = 1;
|
|
989
|
+
else if (t[0] === A && t[1] === A) e = 2;
|
|
990
|
+
else if (t[0] === A && t[1]) e = 2, ie(t[1]) || (e += Le(t, 1, t[1]));
|
|
991
991
|
else {
|
|
992
|
-
if (t[0] ===
|
|
993
|
-
|
|
992
|
+
if (t[0] === A && !t[1]) return [92, t[0]];
|
|
993
|
+
ie(t[0]) ? e = 1 : (e = 1, e += Le(t, 0, t[0]));
|
|
994
994
|
}
|
|
995
|
-
for (let n = e; n < t.length; n++) t[n] !== 0 ?
|
|
995
|
+
for (let n = e; n < t.length; n++) t[n] !== 0 ? qe(t[n]) || (n += zt(t, n, t[n])) : (t.splice(n, 1, Z), n++);
|
|
996
996
|
return t;
|
|
997
997
|
}
|
|
998
|
-
function
|
|
998
|
+
function zt(t, e, n) {
|
|
999
999
|
return t.splice(e, 1, 92, n), 1;
|
|
1000
1000
|
}
|
|
1001
|
-
function
|
|
1001
|
+
function Le(t, e, n) {
|
|
1002
1002
|
const r = n.toString(16), o = [];
|
|
1003
1003
|
for (const i of r) o.push(i.codePointAt(0));
|
|
1004
1004
|
return t.splice(e, 1, 92, ...o, 32), 1 + o.length;
|
|
1005
1005
|
}
|
|
1006
|
-
const
|
|
1007
|
-
function
|
|
1008
|
-
return !!Array.isArray(t) && !(t.length < 4) && !!
|
|
1006
|
+
const Vt = Object.values(a);
|
|
1007
|
+
function et(t) {
|
|
1008
|
+
return !!Array.isArray(t) && !(t.length < 4) && !!Vt.includes(t[0]) && typeof t[1] == "string" && typeof t[2] == "number" && typeof t[3] == "number";
|
|
1009
1009
|
}
|
|
1010
|
-
function
|
|
1010
|
+
function D(t) {
|
|
1011
1011
|
if (!t) return !1;
|
|
1012
1012
|
switch (t[0]) {
|
|
1013
1013
|
case a.Dimension:
|
|
@@ -1018,7 +1018,7 @@ function S(t) {
|
|
|
1018
1018
|
return !1;
|
|
1019
1019
|
}
|
|
1020
1020
|
}
|
|
1021
|
-
function
|
|
1021
|
+
function tt(t) {
|
|
1022
1022
|
if (!t) return !1;
|
|
1023
1023
|
switch (t[0]) {
|
|
1024
1024
|
case a.Whitespace:
|
|
@@ -1028,50 +1028,50 @@ function Ze(t) {
|
|
|
1028
1028
|
return !1;
|
|
1029
1029
|
}
|
|
1030
1030
|
}
|
|
1031
|
-
function
|
|
1031
|
+
function se(t) {
|
|
1032
1032
|
return !!t && t[0] === a.Comma;
|
|
1033
1033
|
}
|
|
1034
|
-
function
|
|
1034
|
+
function nt(t) {
|
|
1035
1035
|
return !!t && t[0] === a.Comment;
|
|
1036
1036
|
}
|
|
1037
|
-
function
|
|
1037
|
+
function Ze(t) {
|
|
1038
1038
|
return !!t && t[0] === a.Delim;
|
|
1039
1039
|
}
|
|
1040
|
-
function
|
|
1040
|
+
function k(t) {
|
|
1041
1041
|
return !!t && t[0] === a.Dimension;
|
|
1042
1042
|
}
|
|
1043
|
-
function
|
|
1043
|
+
function K(t) {
|
|
1044
1044
|
return !!t && t[0] === a.EOF;
|
|
1045
1045
|
}
|
|
1046
|
-
function
|
|
1046
|
+
function jt(t) {
|
|
1047
1047
|
return !!t && t[0] === a.Function;
|
|
1048
1048
|
}
|
|
1049
|
-
function
|
|
1049
|
+
function ge(t) {
|
|
1050
1050
|
return !!t && t[0] === a.Ident;
|
|
1051
1051
|
}
|
|
1052
1052
|
function g(t) {
|
|
1053
1053
|
return !!t && t[0] === a.Number;
|
|
1054
1054
|
}
|
|
1055
|
-
function
|
|
1055
|
+
function b(t) {
|
|
1056
1056
|
return !!t && t[0] === a.Percentage;
|
|
1057
1057
|
}
|
|
1058
|
-
function
|
|
1058
|
+
function ze(t) {
|
|
1059
1059
|
return !!t && t[0] === a.Whitespace;
|
|
1060
1060
|
}
|
|
1061
|
-
function
|
|
1061
|
+
function rt(t) {
|
|
1062
1062
|
return !!t && t[0] === a.OpenParen;
|
|
1063
1063
|
}
|
|
1064
|
-
function
|
|
1064
|
+
function Ht(t) {
|
|
1065
1065
|
return !!t && t[0] === a.CloseParen;
|
|
1066
1066
|
}
|
|
1067
|
-
function
|
|
1067
|
+
function Gt(t) {
|
|
1068
1068
|
return !!t && t[0] === a.OpenSquare;
|
|
1069
1069
|
}
|
|
1070
|
-
function
|
|
1070
|
+
function Jt(t) {
|
|
1071
1071
|
return !!t && t[0] === a.OpenCurly;
|
|
1072
1072
|
}
|
|
1073
|
-
var
|
|
1074
|
-
function
|
|
1073
|
+
var $;
|
|
1074
|
+
function ot(t) {
|
|
1075
1075
|
let e = t.slice();
|
|
1076
1076
|
return (n, r, o) => {
|
|
1077
1077
|
let i = -1;
|
|
@@ -1079,30 +1079,30 @@ function Xe(t) {
|
|
|
1079
1079
|
return i === -1 || i === o && r === n[o] && (i++, i >= n.length) ? -1 : (e = n.slice(), i);
|
|
1080
1080
|
};
|
|
1081
1081
|
}
|
|
1082
|
-
function
|
|
1082
|
+
function Ve(t, e) {
|
|
1083
1083
|
const n = e[0];
|
|
1084
|
-
if (
|
|
1085
|
-
const r =
|
|
1084
|
+
if (rt(n) || Jt(n) || Gt(n)) {
|
|
1085
|
+
const r = Zt(t, e);
|
|
1086
1086
|
return { advance: r.advance, node: r.node };
|
|
1087
1087
|
}
|
|
1088
|
-
if (
|
|
1089
|
-
const r =
|
|
1088
|
+
if (jt(n)) {
|
|
1089
|
+
const r = Yt(t, e);
|
|
1090
1090
|
return { advance: r.advance, node: r.node };
|
|
1091
1091
|
}
|
|
1092
|
-
if (
|
|
1093
|
-
const r =
|
|
1092
|
+
if (ze(n)) {
|
|
1093
|
+
const r = at(t, e);
|
|
1094
1094
|
return { advance: r.advance, node: r.node };
|
|
1095
1095
|
}
|
|
1096
|
-
if (
|
|
1097
|
-
const r =
|
|
1096
|
+
if (nt(n)) {
|
|
1097
|
+
const r = Kt(t, e);
|
|
1098
1098
|
return { advance: r.advance, node: r.node };
|
|
1099
1099
|
}
|
|
1100
|
-
return { advance: 1, node: new
|
|
1100
|
+
return { advance: 1, node: new f(n) };
|
|
1101
1101
|
}
|
|
1102
1102
|
(function(t) {
|
|
1103
1103
|
t.Function = "function", t.SimpleBlock = "simple-block", t.Whitespace = "whitespace", t.Comment = "comment", t.Token = "token";
|
|
1104
|
-
})(
|
|
1105
|
-
class
|
|
1104
|
+
})($ || ($ = {}));
|
|
1105
|
+
class it {
|
|
1106
1106
|
constructor() {
|
|
1107
1107
|
C(this, "value", []);
|
|
1108
1108
|
}
|
|
@@ -1114,7 +1114,7 @@ class _e {
|
|
|
1114
1114
|
}
|
|
1115
1115
|
forEach(e, n) {
|
|
1116
1116
|
if (this.value.length === 0) return;
|
|
1117
|
-
const r =
|
|
1117
|
+
const r = ot(this.value);
|
|
1118
1118
|
let o = 0;
|
|
1119
1119
|
for (; o < this.value.length; ) {
|
|
1120
1120
|
const i = this.value[o];
|
|
@@ -1127,10 +1127,10 @@ class _e {
|
|
|
1127
1127
|
this.value.length !== 0 && this.forEach(((r, o) => e(r, o) !== !1 && (!("walk" in r.node) || !this.value.includes(r.node) || r.node.walk(e, r.state) !== !1) && void 0), n);
|
|
1128
1128
|
}
|
|
1129
1129
|
}
|
|
1130
|
-
class
|
|
1130
|
+
class N extends it {
|
|
1131
1131
|
constructor(n, r, o) {
|
|
1132
1132
|
super();
|
|
1133
|
-
C(this, "type",
|
|
1133
|
+
C(this, "type", $.Function);
|
|
1134
1134
|
C(this, "name");
|
|
1135
1135
|
C(this, "endToken");
|
|
1136
1136
|
this.name = n, this.endToken = r, this.value = o;
|
|
@@ -1139,93 +1139,93 @@ class F extends _e {
|
|
|
1139
1139
|
return this.name[4].value;
|
|
1140
1140
|
}
|
|
1141
1141
|
normalize() {
|
|
1142
|
-
|
|
1142
|
+
K(this.endToken) && (this.endToken = [a.CloseParen, ")", -1, -1, void 0]);
|
|
1143
1143
|
}
|
|
1144
1144
|
tokens() {
|
|
1145
|
-
return
|
|
1145
|
+
return K(this.endToken) ? [this.name, ...this.value.flatMap(((n) => n.tokens()))] : [this.name, ...this.value.flatMap(((n) => n.tokens())), this.endToken];
|
|
1146
1146
|
}
|
|
1147
1147
|
toString() {
|
|
1148
|
-
const n = this.value.map(((r) =>
|
|
1149
|
-
return
|
|
1148
|
+
const n = this.value.map(((r) => et(r) ? G(r) : r.toString())).join("");
|
|
1149
|
+
return G(this.name) + n + G(this.endToken);
|
|
1150
1150
|
}
|
|
1151
1151
|
toJSON() {
|
|
1152
1152
|
return { type: this.type, name: this.getName(), tokens: this.tokens(), value: this.value.map(((n) => n.toJSON())) };
|
|
1153
1153
|
}
|
|
1154
1154
|
isFunctionNode() {
|
|
1155
|
-
return
|
|
1155
|
+
return N.isFunctionNode(this);
|
|
1156
1156
|
}
|
|
1157
1157
|
static isFunctionNode(n) {
|
|
1158
|
-
return !!n && n instanceof
|
|
1158
|
+
return !!n && n instanceof N && n.type === $.Function;
|
|
1159
1159
|
}
|
|
1160
1160
|
}
|
|
1161
|
-
function
|
|
1161
|
+
function Yt(t, e) {
|
|
1162
1162
|
const n = [];
|
|
1163
1163
|
let r = 1;
|
|
1164
1164
|
for (; ; ) {
|
|
1165
1165
|
const o = e[r];
|
|
1166
|
-
if (!o ||
|
|
1167
|
-
if (
|
|
1168
|
-
if (
|
|
1169
|
-
const s =
|
|
1166
|
+
if (!o || K(o)) return t.onParseError(new De("Unexpected EOF while consuming a function.", e[0][2], e[e.length - 1][3], ["5.4.9. Consume a function", "Unexpected EOF"])), { advance: e.length, node: new N(e[0], o, n) };
|
|
1167
|
+
if (Ht(o)) return { advance: r + 1, node: new N(e[0], o, n) };
|
|
1168
|
+
if (tt(o)) {
|
|
1169
|
+
const s = st(t, e.slice(r));
|
|
1170
1170
|
r += s.advance, n.push(...s.nodes);
|
|
1171
1171
|
continue;
|
|
1172
1172
|
}
|
|
1173
|
-
const i =
|
|
1173
|
+
const i = Ve(t, e.slice(r));
|
|
1174
1174
|
r += i.advance, n.push(i.node);
|
|
1175
1175
|
}
|
|
1176
1176
|
}
|
|
1177
|
-
class
|
|
1177
|
+
class ue extends it {
|
|
1178
1178
|
constructor(n, r, o) {
|
|
1179
1179
|
super();
|
|
1180
|
-
C(this, "type",
|
|
1180
|
+
C(this, "type", $.SimpleBlock);
|
|
1181
1181
|
C(this, "startToken");
|
|
1182
1182
|
C(this, "endToken");
|
|
1183
1183
|
this.startToken = n, this.endToken = r, this.value = o;
|
|
1184
1184
|
}
|
|
1185
1185
|
normalize() {
|
|
1186
|
-
if (
|
|
1187
|
-
const n =
|
|
1186
|
+
if (K(this.endToken)) {
|
|
1187
|
+
const n = Dt(this.startToken);
|
|
1188
1188
|
n && (this.endToken = n);
|
|
1189
1189
|
}
|
|
1190
1190
|
}
|
|
1191
1191
|
tokens() {
|
|
1192
|
-
return
|
|
1192
|
+
return K(this.endToken) ? [this.startToken, ...this.value.flatMap(((n) => n.tokens()))] : [this.startToken, ...this.value.flatMap(((n) => n.tokens())), this.endToken];
|
|
1193
1193
|
}
|
|
1194
1194
|
toString() {
|
|
1195
|
-
const n = this.value.map(((r) =>
|
|
1196
|
-
return
|
|
1195
|
+
const n = this.value.map(((r) => et(r) ? G(r) : r.toString())).join("");
|
|
1196
|
+
return G(this.startToken) + n + G(this.endToken);
|
|
1197
1197
|
}
|
|
1198
1198
|
toJSON() {
|
|
1199
1199
|
return { type: this.type, startToken: this.startToken, tokens: this.tokens(), value: this.value.map(((n) => n.toJSON())) };
|
|
1200
1200
|
}
|
|
1201
1201
|
isSimpleBlockNode() {
|
|
1202
|
-
return
|
|
1202
|
+
return ue.isSimpleBlockNode(this);
|
|
1203
1203
|
}
|
|
1204
1204
|
static isSimpleBlockNode(n) {
|
|
1205
|
-
return !!n && n instanceof
|
|
1205
|
+
return !!n && n instanceof ue && n.type === $.SimpleBlock;
|
|
1206
1206
|
}
|
|
1207
1207
|
}
|
|
1208
|
-
function
|
|
1209
|
-
const n =
|
|
1208
|
+
function Zt(t, e) {
|
|
1209
|
+
const n = At(e[0][0]);
|
|
1210
1210
|
if (!n) throw new Error("Failed to parse, a mirror variant must exist for all block open tokens.");
|
|
1211
1211
|
const r = [];
|
|
1212
1212
|
let o = 1;
|
|
1213
1213
|
for (; ; ) {
|
|
1214
1214
|
const i = e[o];
|
|
1215
|
-
if (!i ||
|
|
1216
|
-
if (i[0] === n) return { advance: o + 1, node: new
|
|
1217
|
-
if (
|
|
1218
|
-
const u =
|
|
1215
|
+
if (!i || K(i)) return t.onParseError(new De("Unexpected EOF while consuming a simple block.", e[0][2], e[e.length - 1][3], ["5.4.8. Consume a simple block", "Unexpected EOF"])), { advance: e.length, node: new ue(e[0], i, r) };
|
|
1216
|
+
if (i[0] === n) return { advance: o + 1, node: new ue(e[0], i, r) };
|
|
1217
|
+
if (tt(i)) {
|
|
1218
|
+
const u = st(t, e.slice(o));
|
|
1219
1219
|
o += u.advance, r.push(...u.nodes);
|
|
1220
1220
|
continue;
|
|
1221
1221
|
}
|
|
1222
|
-
const s =
|
|
1222
|
+
const s = Ve(t, e.slice(o));
|
|
1223
1223
|
o += s.advance, r.push(s.node);
|
|
1224
1224
|
}
|
|
1225
1225
|
}
|
|
1226
|
-
class
|
|
1226
|
+
class T {
|
|
1227
1227
|
constructor(e) {
|
|
1228
|
-
C(this, "type",
|
|
1228
|
+
C(this, "type", $.Whitespace);
|
|
1229
1229
|
C(this, "value");
|
|
1230
1230
|
this.value = e;
|
|
1231
1231
|
}
|
|
@@ -1233,29 +1233,29 @@ class O {
|
|
|
1233
1233
|
return this.value;
|
|
1234
1234
|
}
|
|
1235
1235
|
toString() {
|
|
1236
|
-
return
|
|
1236
|
+
return G(...this.value);
|
|
1237
1237
|
}
|
|
1238
1238
|
toJSON() {
|
|
1239
1239
|
return { type: this.type, tokens: this.tokens() };
|
|
1240
1240
|
}
|
|
1241
1241
|
isWhitespaceNode() {
|
|
1242
|
-
return
|
|
1242
|
+
return T.isWhitespaceNode(this);
|
|
1243
1243
|
}
|
|
1244
1244
|
static isWhitespaceNode(e) {
|
|
1245
|
-
return !!e && e instanceof
|
|
1245
|
+
return !!e && e instanceof T && e.type === $.Whitespace;
|
|
1246
1246
|
}
|
|
1247
1247
|
}
|
|
1248
|
-
function
|
|
1248
|
+
function at(t, e) {
|
|
1249
1249
|
let n = 0;
|
|
1250
1250
|
for (; ; ) {
|
|
1251
1251
|
const r = e[n];
|
|
1252
|
-
if (!
|
|
1252
|
+
if (!ze(r)) return { advance: n, node: new T(e.slice(0, n)) };
|
|
1253
1253
|
n++;
|
|
1254
1254
|
}
|
|
1255
1255
|
}
|
|
1256
|
-
class
|
|
1256
|
+
class ce {
|
|
1257
1257
|
constructor(e) {
|
|
1258
|
-
C(this, "type",
|
|
1258
|
+
C(this, "type", $.Comment);
|
|
1259
1259
|
C(this, "value");
|
|
1260
1260
|
this.value = e;
|
|
1261
1261
|
}
|
|
@@ -1263,35 +1263,35 @@ class se {
|
|
|
1263
1263
|
return [this.value];
|
|
1264
1264
|
}
|
|
1265
1265
|
toString() {
|
|
1266
|
-
return
|
|
1266
|
+
return G(this.value);
|
|
1267
1267
|
}
|
|
1268
1268
|
toJSON() {
|
|
1269
1269
|
return { type: this.type, tokens: this.tokens() };
|
|
1270
1270
|
}
|
|
1271
1271
|
isCommentNode() {
|
|
1272
|
-
return
|
|
1272
|
+
return ce.isCommentNode(this);
|
|
1273
1273
|
}
|
|
1274
1274
|
static isCommentNode(e) {
|
|
1275
|
-
return !!e && e instanceof
|
|
1275
|
+
return !!e && e instanceof ce && e.type === $.Comment;
|
|
1276
1276
|
}
|
|
1277
1277
|
}
|
|
1278
|
-
function
|
|
1279
|
-
return { advance: 1, node: new
|
|
1278
|
+
function Kt(t, e) {
|
|
1279
|
+
return { advance: 1, node: new ce(e[0]) };
|
|
1280
1280
|
}
|
|
1281
|
-
function
|
|
1281
|
+
function st(t, e) {
|
|
1282
1282
|
const n = [];
|
|
1283
1283
|
let r = 0;
|
|
1284
|
-
for (; ; ) if (
|
|
1285
|
-
const o =
|
|
1284
|
+
for (; ; ) if (ze(e[r])) {
|
|
1285
|
+
const o = at(0, e.slice(r));
|
|
1286
1286
|
r += o.advance, n.push(o.node);
|
|
1287
1287
|
} else {
|
|
1288
|
-
if (!
|
|
1289
|
-
n.push(new
|
|
1288
|
+
if (!nt(e[r])) return { advance: r, nodes: n };
|
|
1289
|
+
n.push(new ce(e[r])), r++;
|
|
1290
1290
|
}
|
|
1291
1291
|
}
|
|
1292
|
-
class
|
|
1292
|
+
class f {
|
|
1293
1293
|
constructor(e) {
|
|
1294
|
-
C(this, "type",
|
|
1294
|
+
C(this, "type", $.Token);
|
|
1295
1295
|
C(this, "value");
|
|
1296
1296
|
this.value = e;
|
|
1297
1297
|
}
|
|
@@ -1305,32 +1305,32 @@ class d {
|
|
|
1305
1305
|
return { type: this.type, tokens: this.tokens() };
|
|
1306
1306
|
}
|
|
1307
1307
|
isTokenNode() {
|
|
1308
|
-
return
|
|
1308
|
+
return f.isTokenNode(this);
|
|
1309
1309
|
}
|
|
1310
1310
|
static isTokenNode(e) {
|
|
1311
|
-
return !!e && e instanceof
|
|
1311
|
+
return !!e && e instanceof f && e.type === $.Token;
|
|
1312
1312
|
}
|
|
1313
1313
|
}
|
|
1314
|
-
function
|
|
1314
|
+
function Qt(t, e) {
|
|
1315
1315
|
const n = { onParseError: (e == null ? void 0 : e.onParseError) ?? (() => {
|
|
1316
1316
|
}) }, r = [...t];
|
|
1317
1317
|
if (t.length === 0) return [];
|
|
1318
|
-
|
|
1318
|
+
K(r[r.length - 1]) && r.push([a.EOF, "", r[r.length - 1][2], r[r.length - 1][3], void 0]);
|
|
1319
1319
|
const o = [];
|
|
1320
1320
|
let i = [], s = 0;
|
|
1321
1321
|
for (; ; ) {
|
|
1322
|
-
if (!r[s] ||
|
|
1323
|
-
if (
|
|
1322
|
+
if (!r[s] || K(r[s])) return i.length && o.push(i), o;
|
|
1323
|
+
if (se(r[s])) {
|
|
1324
1324
|
o.push(i), i = [], s++;
|
|
1325
1325
|
continue;
|
|
1326
1326
|
}
|
|
1327
|
-
const u =
|
|
1327
|
+
const u = Ve(n, t.slice(s));
|
|
1328
1328
|
i.push(u.node), s += u.advance;
|
|
1329
1329
|
}
|
|
1330
1330
|
}
|
|
1331
|
-
function
|
|
1331
|
+
function Xt(t, e, n) {
|
|
1332
1332
|
if (t.length === 0) return;
|
|
1333
|
-
const r =
|
|
1333
|
+
const r = ot(t);
|
|
1334
1334
|
let o = 0;
|
|
1335
1335
|
for (; o < t.length; ) {
|
|
1336
1336
|
const i = t[o];
|
|
@@ -1338,207 +1338,207 @@ function jt(t, e, n) {
|
|
|
1338
1338
|
if (o = r(t, i, o), o === -1) break;
|
|
1339
1339
|
}
|
|
1340
1340
|
}
|
|
1341
|
-
function
|
|
1342
|
-
t.length !== 0 &&
|
|
1341
|
+
function _t(t, e, n) {
|
|
1342
|
+
t.length !== 0 && Xt(t, ((r, o) => e(r, o) !== !1 && (!("walk" in r.node) || !t.includes(r.node) || r.node.walk(e, r.state) !== !1) && void 0));
|
|
1343
1343
|
}
|
|
1344
|
-
function
|
|
1344
|
+
function en(t, e) {
|
|
1345
1345
|
for (let n = 0; n < t.length; n++)
|
|
1346
|
-
|
|
1346
|
+
_t(t[n], ((r, o) => {
|
|
1347
1347
|
if (typeof o != "number") return;
|
|
1348
1348
|
const i = e(r.node);
|
|
1349
1349
|
i && (Array.isArray(i) ? r.parent.value.splice(o, 1, ...i) : r.parent.value.splice(o, 1, i));
|
|
1350
1350
|
}));
|
|
1351
1351
|
return t;
|
|
1352
1352
|
}
|
|
1353
|
-
function
|
|
1354
|
-
return
|
|
1353
|
+
function tn(t) {
|
|
1354
|
+
return ue.isSimpleBlockNode(t);
|
|
1355
1355
|
}
|
|
1356
|
-
function
|
|
1357
|
-
return
|
|
1356
|
+
function pe(t) {
|
|
1357
|
+
return N.isFunctionNode(t);
|
|
1358
1358
|
}
|
|
1359
|
-
function
|
|
1360
|
-
return
|
|
1359
|
+
function ut(t) {
|
|
1360
|
+
return T.isWhitespaceNode(t);
|
|
1361
1361
|
}
|
|
1362
|
-
function
|
|
1363
|
-
return
|
|
1362
|
+
function ct(t) {
|
|
1363
|
+
return ce.isCommentNode(t);
|
|
1364
1364
|
}
|
|
1365
|
-
function
|
|
1366
|
-
return
|
|
1365
|
+
function _(t) {
|
|
1366
|
+
return ut(t) || ct(t);
|
|
1367
1367
|
}
|
|
1368
|
-
function
|
|
1369
|
-
return
|
|
1368
|
+
function h(t) {
|
|
1369
|
+
return f.isTokenNode(t);
|
|
1370
1370
|
}
|
|
1371
|
-
const
|
|
1372
|
-
function
|
|
1373
|
-
return t.replace(
|
|
1371
|
+
const nn = /[A-Z]/g;
|
|
1372
|
+
function M(t) {
|
|
1373
|
+
return t.replace(nn, ((e) => String.fromCharCode(e.charCodeAt(0) + 32)));
|
|
1374
1374
|
}
|
|
1375
|
-
const
|
|
1376
|
-
function
|
|
1377
|
-
if (!
|
|
1378
|
-
const n =
|
|
1375
|
+
const rn = /* @__PURE__ */ new Map([["cm", (t) => t], ["mm", (t) => 10 * t], ["q", (t) => 40 * t], ["in", (t) => t / 2.54], ["pc", (t) => t / 2.54 * 6], ["pt", (t) => t / 2.54 * 72], ["px", (t) => t / 2.54 * 96]]), Ne = /* @__PURE__ */ new Map([["deg", (t) => t], ["grad", (t) => t / 0.9], ["rad", (t) => t / 180 * Math.PI], ["turn", (t) => t / 360]]), me = /* @__PURE__ */ new Map([["deg", (t) => 0.9 * t], ["grad", (t) => t], ["rad", (t) => 0.9 * t / 180 * Math.PI], ["turn", (t) => 0.9 * t / 360]]), on = /* @__PURE__ */ new Map([["hz", (t) => t], ["khz", (t) => t / 1e3]]), an = /* @__PURE__ */ new Map([["cm", (t) => 2.54 * t], ["mm", (t) => 25.4 * t], ["q", (t) => 25.4 * t * 4], ["in", (t) => t], ["pc", (t) => 6 * t], ["pt", (t) => 72 * t], ["px", (t) => 96 * t]]), sn = /* @__PURE__ */ new Map([["hz", (t) => 1e3 * t], ["khz", (t) => t]]), un = /* @__PURE__ */ new Map([["cm", (t) => t / 10], ["mm", (t) => t], ["q", (t) => 4 * t], ["in", (t) => t / 25.4], ["pc", (t) => t / 25.4 * 6], ["pt", (t) => t / 25.4 * 72], ["px", (t) => t / 25.4 * 96]]), cn = /* @__PURE__ */ new Map([["ms", (t) => t], ["s", (t) => t / 1e3]]), ln = /* @__PURE__ */ new Map([["cm", (t) => t / 6 * 2.54], ["mm", (t) => t / 6 * 25.4], ["q", (t) => t / 6 * 25.4 * 4], ["in", (t) => t / 6], ["pc", (t) => t], ["pt", (t) => t / 6 * 72], ["px", (t) => t / 6 * 96]]), dn = /* @__PURE__ */ new Map([["cm", (t) => t / 72 * 2.54], ["mm", (t) => t / 72 * 25.4], ["q", (t) => t / 72 * 25.4 * 4], ["in", (t) => t / 72], ["pc", (t) => t / 72 * 6], ["pt", (t) => t], ["px", (t) => t / 72 * 96]]), pn = /* @__PURE__ */ new Map([["cm", (t) => t / 96 * 2.54], ["mm", (t) => t / 96 * 25.4], ["q", (t) => t / 96 * 25.4 * 4], ["in", (t) => t / 96], ["pc", (t) => t / 96 * 6], ["pt", (t) => t / 96 * 72], ["px", (t) => t]]), fn = /* @__PURE__ */ new Map([["cm", (t) => t / 4 / 10], ["mm", (t) => t / 4], ["q", (t) => t], ["in", (t) => t / 4 / 25.4], ["pc", (t) => t / 4 / 25.4 * 6], ["pt", (t) => t / 4 / 25.4 * 72], ["px", (t) => t / 4 / 25.4 * 96]]), lt = /* @__PURE__ */ new Map([["deg", (t) => 180 * t / Math.PI], ["grad", (t) => 180 * t / Math.PI / 0.9], ["rad", (t) => t], ["turn", (t) => 180 * t / Math.PI / 360]]), vn = /* @__PURE__ */ new Map([["ms", (t) => 1e3 * t], ["s", (t) => t]]), he = /* @__PURE__ */ new Map([["deg", (t) => 360 * t], ["grad", (t) => 360 * t / 0.9], ["rad", (t) => 360 * t / 180 * Math.PI], ["turn", (t) => t]]), gn = /* @__PURE__ */ new Map([["cm", rn], ["mm", un], ["q", fn], ["in", an], ["pc", ln], ["pt", dn], ["px", pn], ["ms", cn], ["s", vn], ["deg", Ne], ["grad", me], ["rad", lt], ["turn", he], ["hz", on], ["khz", sn]]);
|
|
1376
|
+
function R(t, e) {
|
|
1377
|
+
if (!k(t) || !k(e)) return e;
|
|
1378
|
+
const n = M(t[4].unit), r = M(e[4].unit);
|
|
1379
1379
|
if (n === r) return e;
|
|
1380
|
-
const o =
|
|
1380
|
+
const o = gn.get(r);
|
|
1381
1381
|
if (!o) return e;
|
|
1382
1382
|
const i = o.get(n);
|
|
1383
1383
|
if (!i) return e;
|
|
1384
|
-
const s = i(e[4].value), u = [a.Dimension, "", e[2], e[3], { ...e[4], signCharacter: s < 0 ? "-" : void 0, type: Number.isInteger(s) ?
|
|
1385
|
-
return
|
|
1384
|
+
const s = i(e[4].value), u = [a.Dimension, "", e[2], e[3], { ...e[4], signCharacter: s < 0 ? "-" : void 0, type: Number.isInteger(s) ? d.Integer : d.Number, value: s }];
|
|
1385
|
+
return $t(u, t[4].unit), u;
|
|
1386
1386
|
}
|
|
1387
|
-
function
|
|
1387
|
+
function mn(t) {
|
|
1388
1388
|
if (t.length !== 2) return -1;
|
|
1389
1389
|
const e = t[0].value;
|
|
1390
1390
|
let n = t[1].value;
|
|
1391
1391
|
if (g(e) && g(n)) {
|
|
1392
1392
|
const r = e[4].value + n[4].value;
|
|
1393
|
-
return new
|
|
1393
|
+
return new f([a.Number, r.toString(), e[2], n[3], { value: r, type: e[4].type === d.Integer && n[4].type === d.Integer ? d.Integer : d.Number }]);
|
|
1394
1394
|
}
|
|
1395
|
-
if (
|
|
1395
|
+
if (b(e) && b(n)) {
|
|
1396
1396
|
const r = e[4].value + n[4].value;
|
|
1397
|
-
return new
|
|
1397
|
+
return new f([a.Percentage, r.toString() + "%", e[2], n[3], { value: r }]);
|
|
1398
1398
|
}
|
|
1399
|
-
if (
|
|
1399
|
+
if (k(e) && k(n) && (n = R(e, n), M(e[4].unit) === M(n[4].unit))) {
|
|
1400
1400
|
const r = e[4].value + n[4].value;
|
|
1401
|
-
return new
|
|
1401
|
+
return new f([a.Dimension, r.toString() + e[4].unit, e[2], n[3], { value: r, type: e[4].type === d.Integer && n[4].type === d.Integer ? d.Integer : d.Number, unit: e[4].unit }]);
|
|
1402
1402
|
}
|
|
1403
1403
|
return -1;
|
|
1404
1404
|
}
|
|
1405
|
-
function
|
|
1405
|
+
function hn(t) {
|
|
1406
1406
|
if (t.length !== 2) return -1;
|
|
1407
1407
|
const e = t[0].value, n = t[1].value;
|
|
1408
1408
|
if (g(e) && g(n)) {
|
|
1409
1409
|
const r = e[4].value / n[4].value;
|
|
1410
|
-
return new
|
|
1410
|
+
return new f([a.Number, r.toString(), e[2], n[3], { value: r, type: Number.isInteger(r) ? d.Integer : d.Number }]);
|
|
1411
1411
|
}
|
|
1412
|
-
if (
|
|
1412
|
+
if (b(e) && g(n)) {
|
|
1413
1413
|
const r = e[4].value / n[4].value;
|
|
1414
|
-
return new
|
|
1414
|
+
return new f([a.Percentage, r.toString() + "%", e[2], n[3], { value: r }]);
|
|
1415
1415
|
}
|
|
1416
|
-
if (
|
|
1416
|
+
if (k(e) && g(n)) {
|
|
1417
1417
|
const r = e[4].value / n[4].value;
|
|
1418
|
-
return new
|
|
1418
|
+
return new f([a.Dimension, r.toString() + e[4].unit, e[2], n[3], { value: r, type: Number.isInteger(r) ? d.Integer : d.Number, unit: e[4].unit }]);
|
|
1419
1419
|
}
|
|
1420
1420
|
return -1;
|
|
1421
1421
|
}
|
|
1422
|
-
function
|
|
1422
|
+
function Q(t) {
|
|
1423
1423
|
return !!t && typeof t == "object" && "inputs" in t && Array.isArray(t.inputs) && "operation" in t;
|
|
1424
1424
|
}
|
|
1425
|
-
function
|
|
1425
|
+
function w(t) {
|
|
1426
1426
|
if (t === -1) return -1;
|
|
1427
1427
|
const e = [];
|
|
1428
1428
|
for (let n = 0; n < t.inputs.length; n++) {
|
|
1429
1429
|
const r = t.inputs[n];
|
|
1430
|
-
if (
|
|
1430
|
+
if (h(r)) {
|
|
1431
1431
|
e.push(r);
|
|
1432
1432
|
continue;
|
|
1433
1433
|
}
|
|
1434
|
-
const o =
|
|
1434
|
+
const o = w(r);
|
|
1435
1435
|
if (o === -1) return -1;
|
|
1436
1436
|
e.push(o);
|
|
1437
1437
|
}
|
|
1438
1438
|
return t.operation(e);
|
|
1439
1439
|
}
|
|
1440
|
-
function
|
|
1440
|
+
function Cn(t) {
|
|
1441
1441
|
if (t.length !== 2) return -1;
|
|
1442
1442
|
const e = t[0].value, n = t[1].value;
|
|
1443
1443
|
if (g(e) && g(n)) {
|
|
1444
1444
|
const r = e[4].value * n[4].value;
|
|
1445
|
-
return new
|
|
1445
|
+
return new f([a.Number, r.toString(), e[2], n[3], { value: r, type: e[4].type === d.Integer && n[4].type === d.Integer ? d.Integer : d.Number }]);
|
|
1446
1446
|
}
|
|
1447
|
-
if (
|
|
1447
|
+
if (b(e) && g(n)) {
|
|
1448
1448
|
const r = e[4].value * n[4].value;
|
|
1449
|
-
return new
|
|
1449
|
+
return new f([a.Percentage, r.toString() + "%", e[2], n[3], { value: r }]);
|
|
1450
1450
|
}
|
|
1451
|
-
if (g(e) &&
|
|
1451
|
+
if (g(e) && b(n)) {
|
|
1452
1452
|
const r = e[4].value * n[4].value;
|
|
1453
|
-
return new
|
|
1453
|
+
return new f([a.Percentage, r.toString() + "%", e[2], n[3], { value: r }]);
|
|
1454
1454
|
}
|
|
1455
|
-
if (
|
|
1455
|
+
if (k(e) && g(n)) {
|
|
1456
1456
|
const r = e[4].value * n[4].value;
|
|
1457
|
-
return new
|
|
1457
|
+
return new f([a.Dimension, r.toString() + e[4].unit, e[2], n[3], { value: r, type: e[4].type === d.Integer && n[4].type === d.Integer ? d.Integer : d.Number, unit: e[4].unit }]);
|
|
1458
1458
|
}
|
|
1459
|
-
if (g(e) &&
|
|
1459
|
+
if (g(e) && k(n)) {
|
|
1460
1460
|
const r = e[4].value * n[4].value;
|
|
1461
|
-
return new
|
|
1461
|
+
return new f([a.Dimension, r.toString() + n[4].unit, e[2], n[3], { value: r, type: e[4].type === d.Integer && n[4].type === d.Integer ? d.Integer : d.Number, unit: n[4].unit }]);
|
|
1462
1462
|
}
|
|
1463
1463
|
return -1;
|
|
1464
1464
|
}
|
|
1465
|
-
function
|
|
1465
|
+
function le(t, e) {
|
|
1466
1466
|
for (let n = 0; n < t.length; n++) {
|
|
1467
1467
|
const r = t[n];
|
|
1468
|
-
if (!
|
|
1468
|
+
if (!h(r)) continue;
|
|
1469
1469
|
const o = r.value;
|
|
1470
|
-
if (!
|
|
1471
|
-
const i =
|
|
1470
|
+
if (!ge(o)) continue;
|
|
1471
|
+
const i = M(o[4].value);
|
|
1472
1472
|
switch (i) {
|
|
1473
1473
|
case "e":
|
|
1474
|
-
t.splice(n, 1, new
|
|
1474
|
+
t.splice(n, 1, new f([a.Number, Math.E.toString(), o[2], o[3], { value: Math.E, type: d.Number }]));
|
|
1475
1475
|
break;
|
|
1476
1476
|
case "pi":
|
|
1477
|
-
t.splice(n, 1, new
|
|
1477
|
+
t.splice(n, 1, new f([a.Number, Math.PI.toString(), o[2], o[3], { value: Math.PI, type: d.Number }]));
|
|
1478
1478
|
break;
|
|
1479
1479
|
case "infinity":
|
|
1480
|
-
t.splice(n, 1, new
|
|
1480
|
+
t.splice(n, 1, new f([a.Number, "infinity", o[2], o[3], { value: 1 / 0, type: d.Number }]));
|
|
1481
1481
|
break;
|
|
1482
1482
|
case "-infinity":
|
|
1483
|
-
t.splice(n, 1, new
|
|
1483
|
+
t.splice(n, 1, new f([a.Number, "-infinity", o[2], o[3], { value: -1 / 0, type: d.Number }]));
|
|
1484
1484
|
break;
|
|
1485
1485
|
case "nan":
|
|
1486
|
-
t.splice(n, 1, new
|
|
1486
|
+
t.splice(n, 1, new f([a.Number, "NaN", o[2], o[3], { value: Number.NaN, type: d.Number }]));
|
|
1487
1487
|
break;
|
|
1488
1488
|
default:
|
|
1489
1489
|
if (e.has(i)) {
|
|
1490
1490
|
const s = e.get(i);
|
|
1491
|
-
t.splice(n, 1, new
|
|
1491
|
+
t.splice(n, 1, new f(s));
|
|
1492
1492
|
}
|
|
1493
1493
|
}
|
|
1494
1494
|
}
|
|
1495
1495
|
return t;
|
|
1496
1496
|
}
|
|
1497
|
-
function
|
|
1497
|
+
function we(t) {
|
|
1498
1498
|
if (t.length !== 1) return -1;
|
|
1499
1499
|
const e = t[0].value;
|
|
1500
|
-
return
|
|
1500
|
+
return D(e) ? t[0] : -1;
|
|
1501
1501
|
}
|
|
1502
|
-
function
|
|
1503
|
-
return
|
|
1502
|
+
function I(t, e, n) {
|
|
1503
|
+
return k(e) ? Ce(t, e[4].unit, n) : b(e) ? yn(t, n) : g(e) ? j(t, n) : -1;
|
|
1504
1504
|
}
|
|
1505
|
-
function
|
|
1505
|
+
function Ce(t, e, n) {
|
|
1506
1506
|
const r = t.tokens();
|
|
1507
|
-
return { inputs: [new
|
|
1507
|
+
return { inputs: [new f([a.Dimension, n.toString() + e, r[0][2], r[r.length - 1][3], { value: n, type: Number.isInteger(n) ? d.Integer : d.Number, unit: e }])], operation: we };
|
|
1508
1508
|
}
|
|
1509
|
-
function
|
|
1509
|
+
function yn(t, e) {
|
|
1510
1510
|
const n = t.tokens();
|
|
1511
|
-
return { inputs: [new
|
|
1511
|
+
return { inputs: [new f([a.Percentage, e.toString() + "%", n[0][2], n[n.length - 1][3], { value: e }])], operation: we };
|
|
1512
1512
|
}
|
|
1513
|
-
function
|
|
1513
|
+
function j(t, e) {
|
|
1514
1514
|
const n = t.tokens();
|
|
1515
|
-
return { inputs: [new
|
|
1515
|
+
return { inputs: [new f([a.Number, e.toString(), n[0][2], n[n.length - 1][3], { value: e, type: Number.isInteger(e) ? d.Integer : d.Number }])], operation: we };
|
|
1516
1516
|
}
|
|
1517
|
-
function
|
|
1517
|
+
function En(t, e) {
|
|
1518
1518
|
const n = e.value;
|
|
1519
|
-
return g(n) ?
|
|
1519
|
+
return g(n) ? Ce(t, "rad", Math.acos(n[4].value)) : -1;
|
|
1520
1520
|
}
|
|
1521
|
-
function
|
|
1521
|
+
function Pn(t, e) {
|
|
1522
1522
|
const n = e.value;
|
|
1523
|
-
return g(n) ?
|
|
1523
|
+
return g(n) ? Ce(t, "rad", Math.asin(n[4].value)) : -1;
|
|
1524
1524
|
}
|
|
1525
|
-
function
|
|
1525
|
+
function kn(t, e) {
|
|
1526
1526
|
const n = e.value;
|
|
1527
|
-
return g(n) ?
|
|
1527
|
+
return g(n) ? Ce(t, "rad", Math.atan(n[4].value)) : -1;
|
|
1528
1528
|
}
|
|
1529
|
-
function
|
|
1530
|
-
return
|
|
1529
|
+
function Ie(t) {
|
|
1530
|
+
return k(t) || g(t);
|
|
1531
1531
|
}
|
|
1532
|
-
function
|
|
1532
|
+
function je(t) {
|
|
1533
1533
|
if (t.length === 0) return !0;
|
|
1534
1534
|
const e = t[0];
|
|
1535
|
-
if (!
|
|
1535
|
+
if (!D(e)) return !1;
|
|
1536
1536
|
if (t.length === 1) return !0;
|
|
1537
|
-
if (
|
|
1538
|
-
const n =
|
|
1537
|
+
if (k(e)) {
|
|
1538
|
+
const n = M(e[4].unit);
|
|
1539
1539
|
for (let r = 1; r < t.length; r++) {
|
|
1540
1540
|
const o = t[r];
|
|
1541
|
-
if (e[0] !== o[0] || n !==
|
|
1541
|
+
if (e[0] !== o[0] || n !== M(o[4].unit)) return !1;
|
|
1542
1542
|
}
|
|
1543
1543
|
return !0;
|
|
1544
1544
|
}
|
|
@@ -1548,105 +1548,105 @@ function We(t) {
|
|
|
1548
1548
|
}
|
|
1549
1549
|
return !0;
|
|
1550
1550
|
}
|
|
1551
|
-
function
|
|
1552
|
-
return !!
|
|
1551
|
+
function J(t, e) {
|
|
1552
|
+
return !!D(t) && (k(t) ? t[0] === e[0] && M(t[4].unit) === M(e[4].unit) : t[0] === e[0]);
|
|
1553
1553
|
}
|
|
1554
|
-
function
|
|
1554
|
+
function bn(t, e, n) {
|
|
1555
1555
|
const r = e.value;
|
|
1556
|
-
if (!
|
|
1557
|
-
const o =
|
|
1558
|
-
return
|
|
1556
|
+
if (!Ie(r)) return -1;
|
|
1557
|
+
const o = R(r, n.value);
|
|
1558
|
+
return J(r, o) ? Ce(t, "rad", Math.atan2(r[4].value, o[4].value)) : -1;
|
|
1559
1559
|
}
|
|
1560
|
-
function
|
|
1560
|
+
function Sn(t, e, n) {
|
|
1561
1561
|
const r = e.value;
|
|
1562
|
-
return !
|
|
1562
|
+
return !D(r) || !n.rawPercentages && b(r) ? -1 : I(t, r, Math.abs(r[4].value));
|
|
1563
1563
|
}
|
|
1564
|
-
function
|
|
1565
|
-
if (!
|
|
1564
|
+
function An(t, e, n, r, o) {
|
|
1565
|
+
if (!h(e) || !h(n) || !h(r)) return -1;
|
|
1566
1566
|
const i = e.value;
|
|
1567
|
-
if (!
|
|
1568
|
-
const s =
|
|
1569
|
-
if (!
|
|
1570
|
-
const u =
|
|
1571
|
-
return
|
|
1567
|
+
if (!D(i) || !o.rawPercentages && b(i)) return -1;
|
|
1568
|
+
const s = R(i, n.value);
|
|
1569
|
+
if (!J(i, s)) return -1;
|
|
1570
|
+
const u = R(i, r.value);
|
|
1571
|
+
return J(i, u) ? I(t, i, Math.max(i[4].value, Math.min(s[4].value, u[4].value))) : -1;
|
|
1572
1572
|
}
|
|
1573
|
-
function
|
|
1573
|
+
function Dn(t, e) {
|
|
1574
1574
|
const n = e.value;
|
|
1575
|
-
if (!
|
|
1575
|
+
if (!Ie(n)) return -1;
|
|
1576
1576
|
let r = n[4].value;
|
|
1577
|
-
if (
|
|
1577
|
+
if (k(n)) switch (n[4].unit.toLowerCase()) {
|
|
1578
1578
|
case "rad":
|
|
1579
1579
|
break;
|
|
1580
1580
|
case "deg":
|
|
1581
|
-
r =
|
|
1581
|
+
r = Ne.get("rad")(n[4].value);
|
|
1582
1582
|
break;
|
|
1583
1583
|
case "grad":
|
|
1584
|
-
r =
|
|
1584
|
+
r = me.get("rad")(n[4].value);
|
|
1585
1585
|
break;
|
|
1586
1586
|
case "turn":
|
|
1587
|
-
r =
|
|
1587
|
+
r = he.get("rad")(n[4].value);
|
|
1588
1588
|
break;
|
|
1589
1589
|
default:
|
|
1590
1590
|
return -1;
|
|
1591
1591
|
}
|
|
1592
|
-
return r = Math.cos(r),
|
|
1592
|
+
return r = Math.cos(r), j(t, r);
|
|
1593
1593
|
}
|
|
1594
|
-
function
|
|
1594
|
+
function Bn(t, e) {
|
|
1595
1595
|
const n = e.value;
|
|
1596
|
-
return g(n) ?
|
|
1596
|
+
return g(n) ? j(t, Math.exp(n[4].value)) : -1;
|
|
1597
1597
|
}
|
|
1598
|
-
function
|
|
1599
|
-
if (!e.every(
|
|
1598
|
+
function Fn(t, e, n) {
|
|
1599
|
+
if (!e.every(h)) return -1;
|
|
1600
1600
|
const r = e[0].value;
|
|
1601
|
-
if (!
|
|
1602
|
-
const o = e.map(((u) =>
|
|
1603
|
-
if (!
|
|
1601
|
+
if (!D(r) || !n.rawPercentages && b(r)) return -1;
|
|
1602
|
+
const o = e.map(((u) => R(r, u.value)));
|
|
1603
|
+
if (!je(o)) return -1;
|
|
1604
1604
|
const i = o.map(((u) => u[4].value)), s = Math.hypot(...i);
|
|
1605
|
-
return
|
|
1605
|
+
return I(t, r, s);
|
|
1606
1606
|
}
|
|
1607
|
-
function
|
|
1608
|
-
if (!e.every(
|
|
1607
|
+
function Ke(t, e, n) {
|
|
1608
|
+
if (!e.every(h)) return -1;
|
|
1609
1609
|
const r = e[0].value;
|
|
1610
|
-
if (!
|
|
1611
|
-
const o = e.map(((u) =>
|
|
1612
|
-
if (!
|
|
1610
|
+
if (!D(r) || !n.rawPercentages && b(r)) return -1;
|
|
1611
|
+
const o = e.map(((u) => R(r, u.value)));
|
|
1612
|
+
if (!je(o)) return -1;
|
|
1613
1613
|
const i = o.map(((u) => u[4].value)), s = Math.max(...i);
|
|
1614
|
-
return
|
|
1614
|
+
return I(t, r, s);
|
|
1615
1615
|
}
|
|
1616
|
-
function
|
|
1617
|
-
if (!e.every(
|
|
1616
|
+
function Qe(t, e, n) {
|
|
1617
|
+
if (!e.every(h)) return -1;
|
|
1618
1618
|
const r = e[0].value;
|
|
1619
|
-
if (!
|
|
1620
|
-
const o = e.map(((u) =>
|
|
1621
|
-
if (!
|
|
1619
|
+
if (!D(r) || !n.rawPercentages && b(r)) return -1;
|
|
1620
|
+
const o = e.map(((u) => R(r, u.value)));
|
|
1621
|
+
if (!je(o)) return -1;
|
|
1622
1622
|
const i = o.map(((u) => u[4].value)), s = Math.min(...i);
|
|
1623
|
-
return
|
|
1623
|
+
return I(t, r, s);
|
|
1624
1624
|
}
|
|
1625
|
-
function
|
|
1625
|
+
function Nn(t, e, n) {
|
|
1626
1626
|
const r = e.value;
|
|
1627
|
-
if (!
|
|
1628
|
-
const o =
|
|
1629
|
-
if (!
|
|
1627
|
+
if (!D(r)) return -1;
|
|
1628
|
+
const o = R(r, n.value);
|
|
1629
|
+
if (!J(r, o)) return -1;
|
|
1630
1630
|
let i;
|
|
1631
|
-
return i = o[4].value === 0 ? Number.NaN : Number.isFinite(r[4].value) && (Number.isFinite(o[4].value) || (o[4].value !== Number.POSITIVE_INFINITY || r[4].value !== Number.NEGATIVE_INFINITY && !Object.is(0 * r[4].value, -0)) && (o[4].value !== Number.NEGATIVE_INFINITY || r[4].value !== Number.POSITIVE_INFINITY && !Object.is(0 * r[4].value, 0))) ? Number.isFinite(o[4].value) ? (r[4].value % o[4].value + o[4].value) % o[4].value : r[4].value : Number.NaN,
|
|
1631
|
+
return i = o[4].value === 0 ? Number.NaN : Number.isFinite(r[4].value) && (Number.isFinite(o[4].value) || (o[4].value !== Number.POSITIVE_INFINITY || r[4].value !== Number.NEGATIVE_INFINITY && !Object.is(0 * r[4].value, -0)) && (o[4].value !== Number.NEGATIVE_INFINITY || r[4].value !== Number.POSITIVE_INFINITY && !Object.is(0 * r[4].value, 0))) ? Number.isFinite(o[4].value) ? (r[4].value % o[4].value + o[4].value) % o[4].value : r[4].value : Number.NaN, I(t, r, i);
|
|
1632
1632
|
}
|
|
1633
|
-
function
|
|
1633
|
+
function wn(t, e, n) {
|
|
1634
1634
|
const r = e.value, o = n.value;
|
|
1635
|
-
return !g(r) || !
|
|
1635
|
+
return !g(r) || !J(r, o) ? -1 : j(t, Math.pow(r[4].value, o[4].value));
|
|
1636
1636
|
}
|
|
1637
|
-
function
|
|
1637
|
+
function In(t, e, n) {
|
|
1638
1638
|
const r = e.value;
|
|
1639
|
-
if (!
|
|
1640
|
-
const o =
|
|
1641
|
-
if (!
|
|
1639
|
+
if (!D(r)) return -1;
|
|
1640
|
+
const o = R(r, n.value);
|
|
1641
|
+
if (!J(r, o)) return -1;
|
|
1642
1642
|
let i;
|
|
1643
|
-
return i = o[4].value === 0 ? Number.NaN : Number.isFinite(r[4].value) ? Number.isFinite(o[4].value) ? r[4].value % o[4].value : r[4].value : Number.NaN,
|
|
1643
|
+
return i = o[4].value === 0 ? Number.NaN : Number.isFinite(r[4].value) ? Number.isFinite(o[4].value) ? r[4].value % o[4].value : r[4].value : Number.NaN, I(t, r, i);
|
|
1644
1644
|
}
|
|
1645
|
-
function
|
|
1645
|
+
function xn(t, e, n, r, o) {
|
|
1646
1646
|
const i = n.value;
|
|
1647
|
-
if (!
|
|
1648
|
-
const s =
|
|
1649
|
-
if (!
|
|
1647
|
+
if (!D(i) || !o.rawPercentages && b(i)) return -1;
|
|
1648
|
+
const s = R(i, r.value);
|
|
1649
|
+
if (!J(i, s)) return -1;
|
|
1650
1650
|
let u;
|
|
1651
1651
|
if (s[4].value === 0) u = Number.NaN;
|
|
1652
1652
|
else if (Number.isFinite(i[4].value) || Number.isFinite(s[4].value)) if (!Number.isFinite(i[4].value) && Number.isFinite(s[4].value)) u = i[4].value;
|
|
@@ -1673,252 +1673,252 @@ function An(t, e, n, r, o) {
|
|
|
1673
1673
|
default: {
|
|
1674
1674
|
let c = Math.floor(i[4].value / s[4].value) * s[4].value, p = Math.ceil(i[4].value / s[4].value) * s[4].value;
|
|
1675
1675
|
if (c > p) {
|
|
1676
|
-
const
|
|
1677
|
-
c = p, p =
|
|
1676
|
+
const y = c;
|
|
1677
|
+
c = p, p = y;
|
|
1678
1678
|
}
|
|
1679
|
-
const
|
|
1680
|
-
u =
|
|
1679
|
+
const l = Math.abs(i[4].value - c), v = Math.abs(i[4].value - p);
|
|
1680
|
+
u = l === v ? p : l < v ? c : p;
|
|
1681
1681
|
break;
|
|
1682
1682
|
}
|
|
1683
1683
|
}
|
|
1684
1684
|
else u = i[4].value;
|
|
1685
1685
|
else u = Number.NaN;
|
|
1686
|
-
return
|
|
1686
|
+
return I(t, i, u);
|
|
1687
1687
|
}
|
|
1688
|
-
function
|
|
1688
|
+
function On(t, e, n) {
|
|
1689
1689
|
const r = e.value;
|
|
1690
|
-
return !
|
|
1690
|
+
return !D(r) || !n.rawPercentages && b(r) ? -1 : j(t, Math.sign(r[4].value));
|
|
1691
1691
|
}
|
|
1692
|
-
function
|
|
1692
|
+
function Tn(t, e) {
|
|
1693
1693
|
const n = e.value;
|
|
1694
|
-
if (!
|
|
1694
|
+
if (!Ie(n)) return -1;
|
|
1695
1695
|
let r = n[4].value;
|
|
1696
|
-
if (
|
|
1696
|
+
if (k(n)) switch (M(n[4].unit)) {
|
|
1697
1697
|
case "rad":
|
|
1698
1698
|
break;
|
|
1699
1699
|
case "deg":
|
|
1700
|
-
r =
|
|
1700
|
+
r = Ne.get("rad")(n[4].value);
|
|
1701
1701
|
break;
|
|
1702
1702
|
case "grad":
|
|
1703
|
-
r =
|
|
1703
|
+
r = me.get("rad")(n[4].value);
|
|
1704
1704
|
break;
|
|
1705
1705
|
case "turn":
|
|
1706
|
-
r =
|
|
1706
|
+
r = he.get("rad")(n[4].value);
|
|
1707
1707
|
break;
|
|
1708
1708
|
default:
|
|
1709
1709
|
return -1;
|
|
1710
1710
|
}
|
|
1711
|
-
return r = Math.sin(r),
|
|
1711
|
+
return r = Math.sin(r), j(t, r);
|
|
1712
1712
|
}
|
|
1713
|
-
function
|
|
1713
|
+
function Mn(t, e) {
|
|
1714
1714
|
const n = e.value;
|
|
1715
|
-
return g(n) ?
|
|
1715
|
+
return g(n) ? j(t, Math.sqrt(n[4].value)) : -1;
|
|
1716
1716
|
}
|
|
1717
|
-
function
|
|
1717
|
+
function Rn(t, e) {
|
|
1718
1718
|
const n = e.value;
|
|
1719
|
-
if (!
|
|
1719
|
+
if (!Ie(n)) return -1;
|
|
1720
1720
|
const r = n[4].value;
|
|
1721
1721
|
let o = 0, i = n[4].value;
|
|
1722
|
-
if (
|
|
1722
|
+
if (k(n)) switch (M(n[4].unit)) {
|
|
1723
1723
|
case "rad":
|
|
1724
|
-
o =
|
|
1724
|
+
o = lt.get("deg")(r);
|
|
1725
1725
|
break;
|
|
1726
1726
|
case "deg":
|
|
1727
|
-
o = r, i =
|
|
1727
|
+
o = r, i = Ne.get("rad")(r);
|
|
1728
1728
|
break;
|
|
1729
1729
|
case "grad":
|
|
1730
|
-
o =
|
|
1730
|
+
o = me.get("deg")(r), i = me.get("rad")(r);
|
|
1731
1731
|
break;
|
|
1732
1732
|
case "turn":
|
|
1733
|
-
o =
|
|
1733
|
+
o = he.get("deg")(r), i = he.get("rad")(r);
|
|
1734
1734
|
break;
|
|
1735
1735
|
default:
|
|
1736
1736
|
return -1;
|
|
1737
1737
|
}
|
|
1738
1738
|
const s = o / 90;
|
|
1739
|
-
return i = o % 90 == 0 && s % 2 != 0 ? s > 0 ? 1 / 0 : -1 / 0 : Math.tan(i),
|
|
1739
|
+
return i = o % 90 == 0 && s % 2 != 0 ? s > 0 ? 1 / 0 : -1 / 0 : Math.tan(i), j(t, i);
|
|
1740
1740
|
}
|
|
1741
|
-
function
|
|
1741
|
+
function Un(t) {
|
|
1742
1742
|
if (t.length !== 2) return -1;
|
|
1743
1743
|
const e = t[0].value;
|
|
1744
1744
|
let n = t[1].value;
|
|
1745
1745
|
if (g(e) && g(n)) {
|
|
1746
1746
|
const r = e[4].value - n[4].value;
|
|
1747
|
-
return new
|
|
1747
|
+
return new f([a.Number, r.toString(), e[2], n[3], { value: r, type: e[4].type === d.Integer && n[4].type === d.Integer ? d.Integer : d.Number }]);
|
|
1748
1748
|
}
|
|
1749
|
-
if (
|
|
1749
|
+
if (b(e) && b(n)) {
|
|
1750
1750
|
const r = e[4].value - n[4].value;
|
|
1751
|
-
return new
|
|
1751
|
+
return new f([a.Percentage, r.toString() + "%", e[2], n[3], { value: r }]);
|
|
1752
1752
|
}
|
|
1753
|
-
if (
|
|
1753
|
+
if (k(e) && k(n) && (n = R(e, n), M(e[4].unit) === M(n[4].unit))) {
|
|
1754
1754
|
const r = e[4].value - n[4].value;
|
|
1755
|
-
return new
|
|
1755
|
+
return new f([a.Dimension, r.toString() + e[4].unit, e[2], n[3], { value: r, type: e[4].type === d.Integer && n[4].type === d.Integer ? d.Integer : d.Number, unit: e[4].unit }]);
|
|
1756
1756
|
}
|
|
1757
1757
|
return -1;
|
|
1758
1758
|
}
|
|
1759
|
-
function
|
|
1759
|
+
function Wn(t, e) {
|
|
1760
1760
|
if (e.length === 1) {
|
|
1761
1761
|
const n = e[0];
|
|
1762
|
-
if (!n || !
|
|
1762
|
+
if (!n || !h(n)) return -1;
|
|
1763
1763
|
const r = n.value;
|
|
1764
|
-
return g(r) ?
|
|
1764
|
+
return g(r) ? j(t, Math.log(r[4].value)) : -1;
|
|
1765
1765
|
}
|
|
1766
1766
|
if (e.length === 2) {
|
|
1767
1767
|
const n = e[0];
|
|
1768
|
-
if (!n || !
|
|
1768
|
+
if (!n || !h(n)) return -1;
|
|
1769
1769
|
const r = n.value;
|
|
1770
1770
|
if (!g(r)) return -1;
|
|
1771
1771
|
const o = e[1];
|
|
1772
|
-
if (!o || !
|
|
1772
|
+
if (!o || !h(o)) return -1;
|
|
1773
1773
|
const i = o.value;
|
|
1774
|
-
return g(i) ?
|
|
1774
|
+
return g(i) ? j(t, Math.log(r[4].value) / Math.log(i[4].value)) : -1;
|
|
1775
1775
|
}
|
|
1776
1776
|
return -1;
|
|
1777
1777
|
}
|
|
1778
|
-
const
|
|
1779
|
-
function
|
|
1778
|
+
const Ln = /^none$/i;
|
|
1779
|
+
function $e(t) {
|
|
1780
1780
|
if (Array.isArray(t)) {
|
|
1781
|
-
const n = t.filter(((r) => !(
|
|
1782
|
-
return n.length === 1 &&
|
|
1781
|
+
const n = t.filter(((r) => !(ut(r) && ct(r))));
|
|
1782
|
+
return n.length === 1 && $e(n[0]);
|
|
1783
1783
|
}
|
|
1784
|
-
if (!
|
|
1784
|
+
if (!h(t)) return !1;
|
|
1785
1785
|
const e = t.value;
|
|
1786
|
-
return !!
|
|
1786
|
+
return !!ge(e) && Ln.test(e[4].value);
|
|
1787
1787
|
}
|
|
1788
|
-
const
|
|
1789
|
-
function
|
|
1788
|
+
const $n = String.fromCodePoint(0);
|
|
1789
|
+
function qn(t, e, n, r, o, i) {
|
|
1790
1790
|
var E;
|
|
1791
1791
|
if (e.fixed === -1 && !i.randomCaching) return -1;
|
|
1792
1792
|
i.randomCaching || (i.randomCaching = { propertyName: "", propertyN: 0, elementID: "", documentID: "" }), i.randomCaching && !i.randomCaching.propertyN && (i.randomCaching.propertyN = 0);
|
|
1793
1793
|
const s = n.value;
|
|
1794
|
-
if (!
|
|
1795
|
-
const u =
|
|
1796
|
-
if (!
|
|
1794
|
+
if (!D(s)) return -1;
|
|
1795
|
+
const u = R(s, r.value);
|
|
1796
|
+
if (!J(s, u)) return -1;
|
|
1797
1797
|
let c = null;
|
|
1798
|
-
if (o && (c =
|
|
1799
|
-
if (!Number.isFinite(s[4].value) || !Number.isFinite(u[4].value) || !Number.isFinite(u[4].value - s[4].value)) return
|
|
1800
|
-
if (c && !Number.isFinite(c[4].value)) return
|
|
1801
|
-
const p = e.fixed === -1 ?
|
|
1802
|
-
let
|
|
1803
|
-
if (
|
|
1804
|
-
const
|
|
1805
|
-
let
|
|
1798
|
+
if (o && (c = R(s, o.value), !J(s, c))) return -1;
|
|
1799
|
+
if (!Number.isFinite(s[4].value) || !Number.isFinite(u[4].value) || !Number.isFinite(u[4].value - s[4].value)) return I(t, s, Number.NaN);
|
|
1800
|
+
if (c && !Number.isFinite(c[4].value)) return I(t, s, s[4].value);
|
|
1801
|
+
const p = e.fixed === -1 ? zn(Vn([e.dashedIdent ? e.dashedIdent : `${(E = i.randomCaching) == null ? void 0 : E.propertyName} ${i.randomCaching.propertyN++}`, e.elementShared ? "" : i.randomCaching.elementID, i.randomCaching.documentID].join($n))) : () => e.fixed;
|
|
1802
|
+
let l = s[4].value, v = u[4].value;
|
|
1803
|
+
if (l > v && ([l, v] = [v, l]), c && (c[4].value <= 0 || Math.abs(l - v) / c[4].value > 1e10) && (c = null), c) {
|
|
1804
|
+
const P = Math.max(c[4].value / 1e3, 1e-9), m = [l];
|
|
1805
|
+
let z = 0;
|
|
1806
1806
|
for (; ; ) {
|
|
1807
|
-
|
|
1808
|
-
const
|
|
1809
|
-
if (!(
|
|
1810
|
-
|
|
1807
|
+
z += c[4].value;
|
|
1808
|
+
const x = l + z;
|
|
1809
|
+
if (!(x + P < v)) {
|
|
1810
|
+
m.push(v);
|
|
1811
1811
|
break;
|
|
1812
1812
|
}
|
|
1813
|
-
if (
|
|
1813
|
+
if (m.push(x), x + c[4].value - P > v) break;
|
|
1814
1814
|
}
|
|
1815
|
-
const
|
|
1816
|
-
return
|
|
1815
|
+
const U = p();
|
|
1816
|
+
return I(t, s, Number(m[Math.floor(m.length * U)].toFixed(5)));
|
|
1817
1817
|
}
|
|
1818
|
-
const
|
|
1819
|
-
return
|
|
1818
|
+
const y = p();
|
|
1819
|
+
return I(t, s, Number((y * (v - l) + l).toFixed(5)));
|
|
1820
1820
|
}
|
|
1821
|
-
function
|
|
1821
|
+
function zn(t = 0.34944106645296036, e = 0.19228640875738723, n = 0.8784393832007205, r = 0.04850964319275053) {
|
|
1822
1822
|
return () => {
|
|
1823
1823
|
const o = ((t |= 0) + (e |= 0) | 0) + (r |= 0) | 0;
|
|
1824
1824
|
return r = r + 1 | 0, t = e ^ e >>> 9, e = (n |= 0) + (n << 3) | 0, n = (n = n << 21 | n >>> 11) + o | 0, (o >>> 0) / 4294967296;
|
|
1825
1825
|
};
|
|
1826
1826
|
}
|
|
1827
|
-
function
|
|
1827
|
+
function Vn(t) {
|
|
1828
1828
|
let e = 0, n = 0, r = 0;
|
|
1829
1829
|
e ^= -1;
|
|
1830
1830
|
for (let o = 0, i = t.length; o < i; o++) r = 255 & (e ^ t.charCodeAt(o)), n = +("0x" + "00000000 77073096 EE0E612C 990951BA 076DC419 706AF48F E963A535 9E6495A3 0EDB8832 79DCB8A4 E0D5E91E 97D2D988 09B64C2B 7EB17CBD E7B82D07 90BF1D91 1DB71064 6AB020F2 F3B97148 84BE41DE 1ADAD47D 6DDDE4EB F4D4B551 83D385C7 136C9856 646BA8C0 FD62F97A 8A65C9EC 14015C4F 63066CD9 FA0F3D63 8D080DF5 3B6E20C8 4C69105E D56041E4 A2677172 3C03E4D1 4B04D447 D20D85FD A50AB56B 35B5A8FA 42B2986C DBBBC9D6 ACBCF940 32D86CE3 45DF5C75 DCD60DCF ABD13D59 26D930AC 51DE003A C8D75180 BFD06116 21B4F4B5 56B3C423 CFBA9599 B8BDA50F 2802B89E 5F058808 C60CD9B2 B10BE924 2F6F7C87 58684C11 C1611DAB B6662D3D 76DC4190 01DB7106 98D220BC EFD5102A 71B18589 06B6B51F 9FBFE4A5 E8B8D433 7807C9A2 0F00F934 9609A88E E10E9818 7F6A0DBB 086D3D2D 91646C97 E6635C01 6B6B51F4 1C6C6162 856530D8 F262004E 6C0695ED 1B01A57B 8208F4C1 F50FC457 65B0D9C6 12B7E950 8BBEB8EA FCB9887C 62DD1DDF 15DA2D49 8CD37CF3 FBD44C65 4DB26158 3AB551CE A3BC0074 D4BB30E2 4ADFA541 3DD895D7 A4D1C46D D3D6F4FB 4369E96A 346ED9FC AD678846 DA60B8D0 44042D73 33031DE5 AA0A4C5F DD0D7CC9 5005713C 270241AA BE0B1010 C90C2086 5768B525 206F85B3 B966D409 CE61E49F 5EDEF90E 29D9C998 B0D09822 C7D7A8B4 59B33D17 2EB40D81 B7BD5C3B C0BA6CAD EDB88320 9ABFB3B6 03B6E20C 74B1D29A EAD54739 9DD277AF 04DB2615 73DC1683 E3630B12 94643B84 0D6D6A3E 7A6A5AA8 E40ECF0B 9309FF9D 0A00AE27 7D079EB1 F00F9344 8708A3D2 1E01F268 6906C2FE F762575D 806567CB 196C3671 6E6B06E7 FED41B76 89D32BE0 10DA7A5A 67DD4ACC F9B9DF6F 8EBEEFF9 17B7BE43 60B08ED5 D6D6A3E8 A1D1937E 38D8C2C4 4FDFF252 D1BB67F1 A6BC5767 3FB506DD 48B2364B D80D2BDA AF0A1B4C 36034AF6 41047A60 DF60EFC3 A867DF55 316E8EEF 4669BE79 CB61B38C BC66831A 256FD2A0 5268E236 CC0C7795 BB0B4703 220216B9 5505262F C5BA3BBE B2BD0B28 2BB45A92 5CB36A04 C2D7FFA7 B5D0CF31 2CD99E8B 5BDEAE1D 9B64C2B0 EC63F226 756AA39C 026D930A 9C0906A9 EB0E363F 72076785 05005713 95BF4A82 E2B87A14 7BB12BAE 0CB61B38 92D28E9B E5D5BE0D 7CDCEFB7 0BDBDF21 86D3D2D4 F1D4E242 68DDB3F8 1FDA836E 81BE16CD F6B9265B 6FB077E1 18B74777 88085AE6 FF0F6A70 66063BCA 11010B5C 8F659EFF F862AE69 616BFFD3 166CCF45 A00AE278 D70DD2EE 4E048354 3903B3C2 A7672661 D06016F7 4969474D 3E6E77DB AED16A4A D9D65ADC 40DF0B66 37D83BF0 A9BCAE53 DEBB9EC5 47B2CF7F 30B5FFE9 BDBDF21C CABAC28A 53B39330 24B4A3A6 BAD03605 CDD70693 54DE5729 23D967BF B3667A2E C4614AB8 5D681B02 2A6F2B94 B40BBE37 C30C8EA1 5A05DF1B 2D02EF8D".substring(9 * r, 9 * r + 8)), e = e >>> 8 ^ n;
|
|
1831
1831
|
return (-1 ^ e) >>> 0;
|
|
1832
1832
|
}
|
|
1833
|
-
const
|
|
1834
|
-
return
|
|
1833
|
+
const He = /* @__PURE__ */ new Map([["abs", function(e, n, r) {
|
|
1834
|
+
return V(e, n, r, Sn);
|
|
1835
1835
|
}], ["acos", function(e, n, r) {
|
|
1836
|
-
return
|
|
1836
|
+
return V(e, n, r, En);
|
|
1837
1837
|
}], ["asin", function(e, n, r) {
|
|
1838
|
-
return
|
|
1838
|
+
return V(e, n, r, Pn);
|
|
1839
1839
|
}], ["atan", function(e, n, r) {
|
|
1840
|
-
return
|
|
1840
|
+
return V(e, n, r, kn);
|
|
1841
1841
|
}], ["atan2", function(e, n, r) {
|
|
1842
|
-
return
|
|
1843
|
-
}], ["calc",
|
|
1844
|
-
const o =
|
|
1842
|
+
return Ee(e, n, r, bn);
|
|
1843
|
+
}], ["calc", F], ["clamp", function(e, n, r) {
|
|
1844
|
+
const o = le([...e.value.filter(((m) => !_(m)))], n), i = [], s = [], u = [];
|
|
1845
1845
|
{
|
|
1846
|
-
let
|
|
1847
|
-
for (let
|
|
1848
|
-
const
|
|
1849
|
-
if (
|
|
1850
|
-
if (
|
|
1851
|
-
if (
|
|
1852
|
-
|
|
1846
|
+
let m = i;
|
|
1847
|
+
for (let z = 0; z < o.length; z++) {
|
|
1848
|
+
const U = o[z];
|
|
1849
|
+
if (h(U) && se(U.value)) {
|
|
1850
|
+
if (m === u) return -1;
|
|
1851
|
+
if (m === s) {
|
|
1852
|
+
m = u;
|
|
1853
1853
|
continue;
|
|
1854
1854
|
}
|
|
1855
|
-
if (
|
|
1856
|
-
|
|
1855
|
+
if (m === i) {
|
|
1856
|
+
m = s;
|
|
1857
1857
|
continue;
|
|
1858
1858
|
}
|
|
1859
1859
|
return -1;
|
|
1860
1860
|
}
|
|
1861
|
-
|
|
1861
|
+
m.push(U);
|
|
1862
1862
|
}
|
|
1863
1863
|
}
|
|
1864
|
-
const c =
|
|
1865
|
-
if (c && p) return
|
|
1866
|
-
const
|
|
1867
|
-
if (
|
|
1864
|
+
const c = $e(i), p = $e(u);
|
|
1865
|
+
if (c && p) return F(O(s), n, r);
|
|
1866
|
+
const l = w(F(O(s), n, r));
|
|
1867
|
+
if (l === -1) return -1;
|
|
1868
1868
|
if (c) {
|
|
1869
|
-
const
|
|
1870
|
-
return
|
|
1869
|
+
const m = w(F(O(u), n, r));
|
|
1870
|
+
return m === -1 ? -1 : Qe((v = l, y = m, new N([a.Function, "min(", -1, -1, { value: "min" }], [a.CloseParen, ")", -1, -1, void 0], [v, new f([a.Comma, ",", -1, -1, void 0]), y])), [l, m], r);
|
|
1871
1871
|
}
|
|
1872
1872
|
if (p) {
|
|
1873
|
-
const
|
|
1874
|
-
return
|
|
1873
|
+
const m = w(F(O(i), n, r));
|
|
1874
|
+
return m === -1 ? -1 : Ke(Yn(m, l), [m, l], r);
|
|
1875
1875
|
}
|
|
1876
|
-
var v,
|
|
1877
|
-
const E =
|
|
1876
|
+
var v, y;
|
|
1877
|
+
const E = w(F(O(i), n, r));
|
|
1878
1878
|
if (E === -1) return -1;
|
|
1879
|
-
const
|
|
1880
|
-
return
|
|
1879
|
+
const P = w(F(O(u), n, r));
|
|
1880
|
+
return P === -1 ? -1 : An(e, E, l, P, r);
|
|
1881
1881
|
}], ["cos", function(e, n, r) {
|
|
1882
|
-
return
|
|
1882
|
+
return V(e, n, r, Dn);
|
|
1883
1883
|
}], ["exp", function(e, n, r) {
|
|
1884
|
-
return
|
|
1884
|
+
return V(e, n, r, Bn);
|
|
1885
1885
|
}], ["hypot", function(e, n, r) {
|
|
1886
|
-
return
|
|
1886
|
+
return Pe(e, e.value, n, r, Fn);
|
|
1887
1887
|
}], ["log", function(e, n, r) {
|
|
1888
|
-
return
|
|
1888
|
+
return Pe(e, e.value, n, r, Wn);
|
|
1889
1889
|
}], ["max", function(e, n, r) {
|
|
1890
|
-
return
|
|
1890
|
+
return Pe(e, e.value, n, r, Ke);
|
|
1891
1891
|
}], ["min", function(e, n, r) {
|
|
1892
|
-
return
|
|
1892
|
+
return Pe(e, e.value, n, r, Qe);
|
|
1893
1893
|
}], ["mod", function(e, n, r) {
|
|
1894
|
-
return
|
|
1894
|
+
return Ee(e, n, r, Nn);
|
|
1895
1895
|
}], ["pow", function(e, n, r) {
|
|
1896
|
-
return
|
|
1896
|
+
return Ee(e, n, r, wn);
|
|
1897
1897
|
}], ["random", function(e, n, r) {
|
|
1898
|
-
const o =
|
|
1898
|
+
const o = Jn(e.value.filter(((v) => !_(v))), n, r);
|
|
1899
1899
|
if (o === -1) return -1;
|
|
1900
|
-
const [i, s] = o, u =
|
|
1900
|
+
const [i, s] = o, u = dt(s, n, r);
|
|
1901
1901
|
if (u === -1) return -1;
|
|
1902
|
-
const [c, p,
|
|
1903
|
-
return !c || !p ? -1 :
|
|
1902
|
+
const [c, p, l] = u;
|
|
1903
|
+
return !c || !p ? -1 : qn(e, i, c, p, l, r);
|
|
1904
1904
|
}], ["rem", function(e, n, r) {
|
|
1905
|
-
return
|
|
1905
|
+
return Ee(e, n, r, In);
|
|
1906
1906
|
}], ["round", function(e, n, r) {
|
|
1907
|
-
const o =
|
|
1907
|
+
const o = le([...e.value.filter(((v) => !_(v)))], n);
|
|
1908
1908
|
let i = "", s = !1;
|
|
1909
1909
|
const u = [], c = [];
|
|
1910
1910
|
{
|
|
1911
1911
|
let v = u;
|
|
1912
|
-
for (let
|
|
1913
|
-
const E = o[
|
|
1914
|
-
if (!i && u.length === 0 && c.length === 0 &&
|
|
1915
|
-
const
|
|
1916
|
-
if (
|
|
1917
|
-
i =
|
|
1912
|
+
for (let y = 0; y < o.length; y++) {
|
|
1913
|
+
const E = o[y];
|
|
1914
|
+
if (!i && u.length === 0 && c.length === 0 && h(E) && ge(E.value)) {
|
|
1915
|
+
const P = E.value[4].value.toLowerCase();
|
|
1916
|
+
if (Gn.has(P)) {
|
|
1917
|
+
i = P;
|
|
1918
1918
|
continue;
|
|
1919
1919
|
}
|
|
1920
1920
|
}
|
|
1921
|
-
if (
|
|
1921
|
+
if (h(E) && se(E.value)) {
|
|
1922
1922
|
if (v === c) return -1;
|
|
1923
1923
|
if (v === u && i && u.length === 0) continue;
|
|
1924
1924
|
if (v === u) {
|
|
@@ -1930,103 +1930,103 @@ const Le = /* @__PURE__ */ new Map([["abs", function(e, n, r) {
|
|
|
1930
1930
|
v.push(E);
|
|
1931
1931
|
}
|
|
1932
1932
|
}
|
|
1933
|
-
const p =
|
|
1933
|
+
const p = w(F(O(u), n, r));
|
|
1934
1934
|
if (p === -1) return -1;
|
|
1935
|
-
s || c.length !== 0 || c.push(new
|
|
1936
|
-
const
|
|
1937
|
-
return
|
|
1935
|
+
s || c.length !== 0 || c.push(new f([a.Number, "1", -1, -1, { value: 1, type: d.Integer }]));
|
|
1936
|
+
const l = w(F(O(c), n, r));
|
|
1937
|
+
return l === -1 ? -1 : (i || (i = "nearest"), xn(e, i, p, l, r));
|
|
1938
1938
|
}], ["sign", function(e, n, r) {
|
|
1939
|
-
return
|
|
1939
|
+
return V(e, n, r, On);
|
|
1940
1940
|
}], ["sin", function(e, n, r) {
|
|
1941
|
-
return
|
|
1941
|
+
return V(e, n, r, Tn);
|
|
1942
1942
|
}], ["sqrt", function(e, n, r) {
|
|
1943
|
-
return
|
|
1943
|
+
return V(e, n, r, Mn);
|
|
1944
1944
|
}], ["tan", function(e, n, r) {
|
|
1945
|
-
return
|
|
1945
|
+
return V(e, n, r, Rn);
|
|
1946
1946
|
}]]);
|
|
1947
|
-
function
|
|
1948
|
-
const r =
|
|
1949
|
-
if (r.length === 1 &&
|
|
1947
|
+
function F(t, e, n) {
|
|
1948
|
+
const r = le([...t.value.filter(((i) => !_(i)))], e);
|
|
1949
|
+
if (r.length === 1 && h(r[0])) return { inputs: [r[0]], operation: we };
|
|
1950
1950
|
let o = 0;
|
|
1951
1951
|
for (; o < r.length; ) {
|
|
1952
1952
|
const i = r[o];
|
|
1953
|
-
if (
|
|
1954
|
-
const s =
|
|
1953
|
+
if (tn(i) && rt(i.startToken)) {
|
|
1954
|
+
const s = F(i, e, n);
|
|
1955
1955
|
if (s === -1) return -1;
|
|
1956
1956
|
r.splice(o, 1, s);
|
|
1957
|
-
} else if (
|
|
1958
|
-
const s =
|
|
1957
|
+
} else if (pe(i)) {
|
|
1958
|
+
const s = He.get(i.getName().toLowerCase());
|
|
1959
1959
|
if (!s) return -1;
|
|
1960
1960
|
const u = s(i, e, n);
|
|
1961
1961
|
if (u === -1) return -1;
|
|
1962
1962
|
r.splice(o, 1, u);
|
|
1963
1963
|
} else o++;
|
|
1964
1964
|
}
|
|
1965
|
-
if (o = 0, r.length === 1 &&
|
|
1965
|
+
if (o = 0, r.length === 1 && Q(r[0])) return r[0];
|
|
1966
1966
|
for (; o < r.length; ) {
|
|
1967
1967
|
const i = r[o];
|
|
1968
|
-
if (!i || !
|
|
1968
|
+
if (!i || !h(i) && !Q(i)) {
|
|
1969
1969
|
o++;
|
|
1970
1970
|
continue;
|
|
1971
1971
|
}
|
|
1972
1972
|
const s = r[o + 1];
|
|
1973
|
-
if (!s || !
|
|
1973
|
+
if (!s || !h(s)) {
|
|
1974
1974
|
o++;
|
|
1975
1975
|
continue;
|
|
1976
1976
|
}
|
|
1977
1977
|
const u = s.value;
|
|
1978
|
-
if (!
|
|
1978
|
+
if (!Ze(u) || u[4].value !== "*" && u[4].value !== "/") {
|
|
1979
1979
|
o++;
|
|
1980
1980
|
continue;
|
|
1981
1981
|
}
|
|
1982
1982
|
const c = r[o + 2];
|
|
1983
|
-
if (!c || !
|
|
1984
|
-
u[4].value !== "*" ? u[4].value !== "/" ? o++ : r.splice(o, 3, { inputs: [i, c], operation:
|
|
1983
|
+
if (!c || !h(c) && !Q(c)) return -1;
|
|
1984
|
+
u[4].value !== "*" ? u[4].value !== "/" ? o++ : r.splice(o, 3, { inputs: [i, c], operation: hn }) : r.splice(o, 3, { inputs: [i, c], operation: Cn });
|
|
1985
1985
|
}
|
|
1986
|
-
if (o = 0, r.length === 1 &&
|
|
1986
|
+
if (o = 0, r.length === 1 && Q(r[0])) return r[0];
|
|
1987
1987
|
for (; o < r.length; ) {
|
|
1988
1988
|
const i = r[o];
|
|
1989
|
-
if (!i || !
|
|
1989
|
+
if (!i || !h(i) && !Q(i)) {
|
|
1990
1990
|
o++;
|
|
1991
1991
|
continue;
|
|
1992
1992
|
}
|
|
1993
1993
|
const s = r[o + 1];
|
|
1994
|
-
if (!s || !
|
|
1994
|
+
if (!s || !h(s)) {
|
|
1995
1995
|
o++;
|
|
1996
1996
|
continue;
|
|
1997
1997
|
}
|
|
1998
1998
|
const u = s.value;
|
|
1999
|
-
if (!
|
|
1999
|
+
if (!Ze(u) || u[4].value !== "+" && u[4].value !== "-") {
|
|
2000
2000
|
o++;
|
|
2001
2001
|
continue;
|
|
2002
2002
|
}
|
|
2003
2003
|
const c = r[o + 2];
|
|
2004
|
-
if (!c || !
|
|
2005
|
-
u[4].value !== "+" ? u[4].value !== "-" ? o++ : r.splice(o, 3, { inputs: [i, c], operation:
|
|
2004
|
+
if (!c || !h(c) && !Q(c)) return -1;
|
|
2005
|
+
u[4].value !== "+" ? u[4].value !== "-" ? o++ : r.splice(o, 3, { inputs: [i, c], operation: Un }) : r.splice(o, 3, { inputs: [i, c], operation: mn });
|
|
2006
2006
|
}
|
|
2007
|
-
return r.length === 1 &&
|
|
2007
|
+
return r.length === 1 && Q(r[0]) ? r[0] : -1;
|
|
2008
2008
|
}
|
|
2009
|
-
function
|
|
2010
|
-
const o =
|
|
2009
|
+
function V(t, e, n, r) {
|
|
2010
|
+
const o = jn(t.value, e, n);
|
|
2011
2011
|
return o === -1 ? -1 : r(t, o, n);
|
|
2012
2012
|
}
|
|
2013
|
-
function
|
|
2014
|
-
const r =
|
|
2013
|
+
function jn(t, e, n) {
|
|
2014
|
+
const r = w(F(O(le([...t.filter(((o) => !_(o)))], e)), e, n));
|
|
2015
2015
|
return r === -1 ? -1 : r;
|
|
2016
2016
|
}
|
|
2017
|
-
function
|
|
2018
|
-
const o =
|
|
2017
|
+
function Ee(t, e, n, r) {
|
|
2018
|
+
const o = Hn(t.value, e, n);
|
|
2019
2019
|
if (o === -1) return -1;
|
|
2020
2020
|
const [i, s] = o;
|
|
2021
2021
|
return r(t, i, s, n);
|
|
2022
2022
|
}
|
|
2023
|
-
function
|
|
2024
|
-
const r =
|
|
2023
|
+
function Hn(t, e, n) {
|
|
2024
|
+
const r = le([...t.filter(((c) => !_(c)))], e), o = [], i = [];
|
|
2025
2025
|
{
|
|
2026
2026
|
let c = o;
|
|
2027
2027
|
for (let p = 0; p < r.length; p++) {
|
|
2028
|
-
const
|
|
2029
|
-
if (
|
|
2028
|
+
const l = r[p];
|
|
2029
|
+
if (h(l) && se(l.value)) {
|
|
2030
2030
|
if (c === i) return -1;
|
|
2031
2031
|
if (c === o) {
|
|
2032
2032
|
c = i;
|
|
@@ -2034,46 +2034,46 @@ function Wn(t, e, n) {
|
|
|
2034
2034
|
}
|
|
2035
2035
|
return -1;
|
|
2036
2036
|
}
|
|
2037
|
-
c.push(
|
|
2037
|
+
c.push(l);
|
|
2038
2038
|
}
|
|
2039
2039
|
}
|
|
2040
|
-
const s =
|
|
2040
|
+
const s = w(F(O(o), e, n));
|
|
2041
2041
|
if (s === -1) return -1;
|
|
2042
|
-
const u =
|
|
2042
|
+
const u = w(F(O(i), e, n));
|
|
2043
2043
|
return u === -1 ? -1 : [s, u];
|
|
2044
2044
|
}
|
|
2045
|
-
function
|
|
2046
|
-
const i =
|
|
2045
|
+
function Pe(t, e, n, r, o) {
|
|
2046
|
+
const i = dt(t.value, n, r);
|
|
2047
2047
|
return i === -1 ? -1 : o(t, i, r);
|
|
2048
2048
|
}
|
|
2049
|
-
function
|
|
2050
|
-
const r =
|
|
2049
|
+
function dt(t, e, n) {
|
|
2050
|
+
const r = le([...t.filter(((i) => !_(i)))], e), o = [];
|
|
2051
2051
|
{
|
|
2052
2052
|
const i = [];
|
|
2053
2053
|
let s = [];
|
|
2054
2054
|
for (let u = 0; u < r.length; u++) {
|
|
2055
2055
|
const c = r[u];
|
|
2056
|
-
|
|
2056
|
+
h(c) && se(c.value) ? (i.push(s), s = []) : s.push(c);
|
|
2057
2057
|
}
|
|
2058
2058
|
i.push(s);
|
|
2059
2059
|
for (let u = 0; u < i.length; u++) {
|
|
2060
2060
|
if (i[u].length === 0) return -1;
|
|
2061
|
-
const c =
|
|
2061
|
+
const c = w(F(O(i[u]), e, n));
|
|
2062
2062
|
if (c === -1) return -1;
|
|
2063
2063
|
o.push(c);
|
|
2064
2064
|
}
|
|
2065
2065
|
}
|
|
2066
2066
|
return o;
|
|
2067
2067
|
}
|
|
2068
|
-
const
|
|
2069
|
-
function
|
|
2068
|
+
const Gn = /* @__PURE__ */ new Set(["nearest", "up", "down", "to-zero"]);
|
|
2069
|
+
function Jn(t, e, n) {
|
|
2070
2070
|
const r = { isAuto: !1, dashedIdent: "", fixed: -1, elementShared: !1 }, o = t[0];
|
|
2071
|
-
if (!
|
|
2071
|
+
if (!h(o) || !ge(o.value)) return [r, t];
|
|
2072
2072
|
for (let i = 0; i < t.length; i++) {
|
|
2073
2073
|
const s = t[i];
|
|
2074
|
-
if (!
|
|
2075
|
-
if (
|
|
2076
|
-
if (!
|
|
2074
|
+
if (!h(s)) return -1;
|
|
2075
|
+
if (se(s.value)) return [r, t.slice(i + 1)];
|
|
2076
|
+
if (!ge(s.value)) return -1;
|
|
2077
2077
|
const u = s.value[4].value.toLowerCase();
|
|
2078
2078
|
if (u !== "element-shared") if (u !== "fixed") if (u !== "auto") {
|
|
2079
2079
|
if (u.startsWith("--")) {
|
|
@@ -2089,7 +2089,7 @@ function $n(t, e, n) {
|
|
|
2089
2089
|
i++;
|
|
2090
2090
|
const c = t[i];
|
|
2091
2091
|
if (!c) return -1;
|
|
2092
|
-
const p =
|
|
2092
|
+
const p = w(F(O([c]), e, n));
|
|
2093
2093
|
if (p === -1 || !g(p.value) || p.value[4].value < 0 || p.value[4].value > 1) return -1;
|
|
2094
2094
|
r.fixed = Math.max(0, Math.min(p.value[4].value, 1 - 1e-9));
|
|
2095
2095
|
}
|
|
@@ -2100,188 +2100,227 @@ function $n(t, e, n) {
|
|
|
2100
2100
|
}
|
|
2101
2101
|
return -1;
|
|
2102
2102
|
}
|
|
2103
|
-
function
|
|
2104
|
-
return new
|
|
2103
|
+
function O(t) {
|
|
2104
|
+
return new N([a.Function, "calc(", -1, -1, { value: "calc" }], [a.CloseParen, ")", -1, -1, void 0], t);
|
|
2105
2105
|
}
|
|
2106
|
-
function
|
|
2107
|
-
return new
|
|
2106
|
+
function Yn(t, e) {
|
|
2107
|
+
return new N([a.Function, "max(", -1, -1, { value: "max" }], [a.CloseParen, ")", -1, -1, void 0], [t, new f([a.Comma, ",", -1, -1, void 0]), e]);
|
|
2108
2108
|
}
|
|
2109
|
-
function
|
|
2109
|
+
function Zn(t) {
|
|
2110
2110
|
if (t === -1) return -1;
|
|
2111
|
-
if (
|
|
2111
|
+
if (pe(t)) return t;
|
|
2112
2112
|
const e = t.value;
|
|
2113
|
-
return
|
|
2113
|
+
return D(e) && Number.isNaN(e[4].value) ? g(e) ? new N([a.Function, "calc(", e[2], e[3], { value: "calc" }], [a.CloseParen, ")", e[2], e[3], void 0], [new f([a.Ident, "NaN", e[2], e[3], { value: "NaN" }])]) : k(e) ? new N([a.Function, "calc(", e[2], e[3], { value: "calc" }], [a.CloseParen, ")", e[2], e[3], void 0], [new f([a.Ident, "NaN", e[2], e[3], { value: "NaN" }]), new T([[a.Whitespace, " ", e[2], e[3], void 0]]), new f([a.Delim, "*", e[2], e[3], { value: "*" }]), new T([[a.Whitespace, " ", e[2], e[3], void 0]]), new f([a.Dimension, "1" + e[4].unit, e[2], e[3], { value: 1, type: d.Integer, unit: e[4].unit }])]) : b(e) ? new N([a.Function, "calc(", e[2], e[3], { value: "calc" }], [a.CloseParen, ")", e[2], e[3], void 0], [new f([a.Ident, "NaN", e[2], e[3], { value: "NaN" }]), new T([[a.Whitespace, " ", e[2], e[3], void 0]]), new f([a.Delim, "*", e[2], e[3], { value: "*" }]), new T([[a.Whitespace, " ", e[2], e[3], void 0]]), new f([a.Percentage, "1%", e[2], e[3], { value: 1 }])]) : -1 : t;
|
|
2114
2114
|
}
|
|
2115
|
-
function
|
|
2115
|
+
function Kn(t) {
|
|
2116
2116
|
if (t === -1) return -1;
|
|
2117
|
-
if (
|
|
2117
|
+
if (pe(t)) return t;
|
|
2118
2118
|
const e = t.value;
|
|
2119
|
-
if (!
|
|
2119
|
+
if (!D(e) || Number.isFinite(e[4].value) || Number.isNaN(e[4].value)) return t;
|
|
2120
2120
|
let n = "";
|
|
2121
|
-
return Number.NEGATIVE_INFINITY === e[4].value && (n = "-"), g(e) ? new
|
|
2121
|
+
return Number.NEGATIVE_INFINITY === e[4].value && (n = "-"), g(e) ? new N([a.Function, "calc(", e[2], e[3], { value: "calc" }], [a.CloseParen, ")", e[2], e[3], void 0], [new f([a.Ident, n + "infinity", e[2], e[3], { value: n + "infinity" }])]) : k(e) ? new N([a.Function, "calc(", e[2], e[3], { value: "calc" }], [a.CloseParen, ")", e[2], e[3], void 0], [new f([a.Ident, n + "infinity", e[2], e[3], { value: n + "infinity" }]), new T([[a.Whitespace, " ", e[2], e[3], void 0]]), new f([a.Delim, "*", e[2], e[3], { value: "*" }]), new T([[a.Whitespace, " ", e[2], e[3], void 0]]), new f([a.Dimension, "1" + e[4].unit, e[2], e[3], { value: 1, type: d.Integer, unit: e[4].unit }])]) : new N([a.Function, "calc(", e[2], e[3], { value: "calc" }], [a.CloseParen, ")", e[2], e[3], void 0], [new f([a.Ident, n + "infinity", e[2], e[3], { value: n + "infinity" }]), new T([[a.Whitespace, " ", e[2], e[3], void 0]]), new f([a.Delim, "*", e[2], e[3], { value: "*" }]), new T([[a.Whitespace, " ", e[2], e[3], void 0]]), new f([a.Percentage, "1%", e[2], e[3], { value: 1 }])]);
|
|
2122
2122
|
}
|
|
2123
|
-
function
|
|
2123
|
+
function Qn(t) {
|
|
2124
2124
|
if (t === -1) return -1;
|
|
2125
|
-
if (
|
|
2125
|
+
if (pe(t)) return t;
|
|
2126
2126
|
const e = t.value;
|
|
2127
|
-
return
|
|
2127
|
+
return D(e) && Object.is(-0, e[4].value) && (e[1] === "-0" || (b(e) ? e[1] = "-0%" : k(e) ? e[1] = "-0" + e[4].unit : e[1] = "-0")), t;
|
|
2128
2128
|
}
|
|
2129
|
-
function
|
|
2129
|
+
function Xn(t, e = 13) {
|
|
2130
2130
|
if (t === -1) return -1;
|
|
2131
|
-
if (e <= 0 ||
|
|
2131
|
+
if (e <= 0 || pe(t)) return t;
|
|
2132
2132
|
const n = t.value;
|
|
2133
|
-
if (!
|
|
2133
|
+
if (!D(n) || Number.isInteger(n[4].value)) return t;
|
|
2134
2134
|
const r = Number(n[4].value.toFixed(e)).toString();
|
|
2135
|
-
return g(n) ? n[1] = r :
|
|
2135
|
+
return g(n) ? n[1] = r : b(n) ? n[1] = r + "%" : k(n) && (n[1] = r + n[4].unit), t;
|
|
2136
2136
|
}
|
|
2137
|
-
function
|
|
2137
|
+
function _n(t, e) {
|
|
2138
2138
|
let n = t;
|
|
2139
|
-
return n =
|
|
2139
|
+
return n = Xn(n, e == null ? void 0 : e.precision), n = Qn(n), n = Zn(n), n = Kn(n), n;
|
|
2140
2140
|
}
|
|
2141
|
-
function
|
|
2141
|
+
function er(t) {
|
|
2142
2142
|
return /* @__PURE__ */ new Map();
|
|
2143
2143
|
}
|
|
2144
|
-
function
|
|
2145
|
-
return
|
|
2144
|
+
function tr(t, e) {
|
|
2145
|
+
return nr(Qt(Ut({ css: t }), {}), e).map(((n) => n.map(((r) => G(...r.tokens()))).join(""))).join(",");
|
|
2146
2146
|
}
|
|
2147
|
-
function
|
|
2148
|
-
const n =
|
|
2149
|
-
return
|
|
2150
|
-
if (!
|
|
2151
|
-
const o =
|
|
2147
|
+
function nr(t, e) {
|
|
2148
|
+
const n = er();
|
|
2149
|
+
return en(t, ((r) => {
|
|
2150
|
+
if (!pe(r)) return;
|
|
2151
|
+
const o = He.get(r.getName().toLowerCase());
|
|
2152
2152
|
if (!o) return;
|
|
2153
|
-
const i =
|
|
2153
|
+
const i = _n(w(o(r, n, {})), e);
|
|
2154
2154
|
return i !== -1 ? i : void 0;
|
|
2155
2155
|
}));
|
|
2156
2156
|
}
|
|
2157
|
-
new Set(
|
|
2158
|
-
const
|
|
2157
|
+
new Set(He.keys());
|
|
2158
|
+
const L = (t) => {
|
|
2159
2159
|
const e = `${t}`, n = parseFloat(e);
|
|
2160
2160
|
let r = "unsupported";
|
|
2161
2161
|
const o = e.match(/px|rem|em/);
|
|
2162
2162
|
return o && (r = o[0]), n === 0 && r === "unsupported" && (r = "zero"), { number: n, unit: r };
|
|
2163
|
-
},
|
|
2163
|
+
}, Xe = (t) => {
|
|
2164
2164
|
const e = {};
|
|
2165
2165
|
if (typeof t == "string")
|
|
2166
|
-
e.fontSize =
|
|
2166
|
+
e.fontSize = L(t);
|
|
2167
2167
|
else if (Array.isArray(t)) {
|
|
2168
|
-
if (e.fontSize =
|
|
2169
|
-
e.lineHeight =
|
|
2168
|
+
if (e.fontSize = L(t[0]), typeof t[1] == "string")
|
|
2169
|
+
e.lineHeight = L(t[1]);
|
|
2170
2170
|
else if (typeof t[1] == "object") {
|
|
2171
2171
|
if ("lineHeight" in t[1]) {
|
|
2172
2172
|
let n = t[1].lineHeight;
|
|
2173
|
-
typeof n == "string" && n.includes("calc") && (n =
|
|
2174
|
-
const r =
|
|
2173
|
+
typeof n == "string" && n.includes("calc") && (n = tr(n));
|
|
2174
|
+
const r = L(n);
|
|
2175
2175
|
r.unit === "unsupported" ? e.lineHeight = {
|
|
2176
2176
|
number: n * e.fontSize.number,
|
|
2177
2177
|
unit: e.fontSize.unit
|
|
2178
2178
|
} : e.lineHeight = r;
|
|
2179
2179
|
}
|
|
2180
|
-
"letterSpacing" in t[1] && (e.letterSpacing =
|
|
2180
|
+
"letterSpacing" in t[1] && (e.letterSpacing = L(t[1].letterSpacing));
|
|
2181
2181
|
}
|
|
2182
2182
|
}
|
|
2183
2183
|
return e;
|
|
2184
|
-
},
|
|
2184
|
+
}, ve = (t, e, n, r = null) => t.number === e.number ? (ee.error(
|
|
2185
2185
|
`Same value for start an end${r ? ` (${r})` : ""}: "clamp-[${n}]".`
|
|
2186
|
-
), null) : t.unit !== e.unit && t.unit !== "zero" && e.unit !== "zero" ? (
|
|
2186
|
+
), null) : t.unit !== e.unit && t.unit !== "zero" && e.unit !== "zero" ? (ee.error(
|
|
2187
2187
|
`Units need to match${r ? ` (${r})` : ""}: "clamp-[${n}]" ${t.unit} !== ${e.unit}.`
|
|
2188
|
-
), null) : t.unit === "unsupported" || e.unit === "unsupported" ? (
|
|
2188
|
+
), null) : t.unit === "unsupported" || e.unit === "unsupported" ? (ee.error(
|
|
2189
2189
|
`Only px, rem and em units are supported${r ? ` (${r})` : ""}: "clamp-[${n}]".`
|
|
2190
|
-
), null) : !0,
|
|
2190
|
+
), null) : !0, We = (t, e, n = { number: 23.4375, unit: "rem" }, r = { number: 90, unit: "rem" }, o = !1) => {
|
|
2191
2191
|
const i = t.unit === "zero" ? e.unit : t.unit, s = i === "px";
|
|
2192
|
-
let u = t.number, c = e.number, p = !1,
|
|
2193
|
-
n.unit !== "px" && s && (
|
|
2194
|
-
const
|
|
2195
|
-
return p ? `calc(${
|
|
2196
|
-
},
|
|
2192
|
+
let u = t.number, c = e.number, p = !1, l = n.number, v = r.number;
|
|
2193
|
+
n.unit !== "px" && s && (l = n.number * 16), n.unit === "px" && !s && (l = n.number / 16), r.unit !== "px" && s && (v = r.number * 16), r.unit === "px" && !s && (v = r.number / 16), c < u && u < 0 && c < 0 ? (u = Math.abs(u), c = Math.abs(c), p = !0) : c < u && u > 0 && c > 0 ? (u = u * -1, c = c * -1, p = !0) : c < u && (u = Math.abs(u) * -1, c = Math.abs(c), p = !0);
|
|
2194
|
+
const y = (c - u) / (v - l), E = `${(u - l * y).toFixed(6)}${i} + ${(100 * y).toFixed(6)}${o ? "cqw" : "vw"}`, P = `clamp(${u}${i}, ${E}, ${c}${i})`;
|
|
2195
|
+
return p ? `calc(${P} * -1)` : P;
|
|
2196
|
+
}, rr = {
|
|
2197
2197
|
minSize: "23.4375rem",
|
|
2198
2198
|
maxSize: "90rem"
|
|
2199
2199
|
};
|
|
2200
|
-
function
|
|
2200
|
+
function ke(t, e, n, r) {
|
|
2201
2201
|
if (!t)
|
|
2202
2202
|
return {
|
|
2203
|
-
...
|
|
2203
|
+
...L(e),
|
|
2204
2204
|
isContainer: !1
|
|
2205
2205
|
};
|
|
2206
2206
|
const o = t.startsWith("@"), i = o ? t.slice(1) : t, s = o ? r[i] || i : n[i] || i;
|
|
2207
2207
|
return {
|
|
2208
|
-
...
|
|
2208
|
+
...L(s),
|
|
2209
2209
|
isContainer: o
|
|
2210
2210
|
};
|
|
2211
2211
|
}
|
|
2212
|
-
const
|
|
2213
|
-
const e = { ...
|
|
2214
|
-
return function({ matchUtilities: n,
|
|
2212
|
+
const or = (t) => /^-?\d*\.?\d+(px|rem|em)$/.test(t.trim()) || t.trim() === "0", sr = mt.withOptions(function(t = {}) {
|
|
2213
|
+
const e = { ...rr, ...t };
|
|
2214
|
+
return function({ matchUtilities: n, addBase: r, theme: o, config: i }) {
|
|
2215
|
+
const s = o("clamp") || {}, u = {}, c = {};
|
|
2216
|
+
for (const [p, l] of Object.entries(s)) {
|
|
2217
|
+
const v = l.split(",")[0];
|
|
2218
|
+
or(v) ? c[p] = l : u[p] = l;
|
|
2219
|
+
}
|
|
2220
|
+
if (Object.keys(c).length > 0) {
|
|
2221
|
+
const p = o("screens"), l = o("containers"), v = {};
|
|
2222
|
+
for (const [y, E] of Object.entries(c)) {
|
|
2223
|
+
const P = E.split(",").map((ye) => ye.trim());
|
|
2224
|
+
if (P.length < 2) {
|
|
2225
|
+
ee.error(
|
|
2226
|
+
`Theme clamp variable "--clamp-${y}" requires at least 2 values (start, end).`
|
|
2227
|
+
);
|
|
2228
|
+
continue;
|
|
2229
|
+
}
|
|
2230
|
+
const m = L(P[0]), z = L(P[1]), U = ke(
|
|
2231
|
+
P[2],
|
|
2232
|
+
e.minSize,
|
|
2233
|
+
p,
|
|
2234
|
+
l
|
|
2235
|
+
), x = ke(
|
|
2236
|
+
P[3],
|
|
2237
|
+
e.maxSize,
|
|
2238
|
+
p,
|
|
2239
|
+
l
|
|
2240
|
+
);
|
|
2241
|
+
if (!ve(U, x, `--clamp-${y}`) || !ve(m, z, `--clamp-${y}`)) continue;
|
|
2242
|
+
const xe = U.isContainer;
|
|
2243
|
+
v[`--clamp-${y}`] = We(
|
|
2244
|
+
m,
|
|
2245
|
+
z,
|
|
2246
|
+
U,
|
|
2247
|
+
x,
|
|
2248
|
+
xe
|
|
2249
|
+
);
|
|
2250
|
+
}
|
|
2251
|
+
Object.keys(v).length > 0 && r({ ":root": v });
|
|
2252
|
+
}
|
|
2215
2253
|
n(
|
|
2216
2254
|
{
|
|
2217
|
-
clamp: (
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2255
|
+
clamp: (p) => {
|
|
2256
|
+
var Ge, Je;
|
|
2257
|
+
const l = p.split(",");
|
|
2258
|
+
if (l.length < 3)
|
|
2259
|
+
return ee.error(
|
|
2260
|
+
`The clamp utility requires at least 3 arguments: "clamp-[${p}]".`
|
|
2222
2261
|
), {};
|
|
2223
|
-
const
|
|
2224
|
-
|
|
2262
|
+
const v = o("screens"), y = o("containers"), E = ke(
|
|
2263
|
+
l[3],
|
|
2225
2264
|
e.minSize,
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
),
|
|
2229
|
-
|
|
2265
|
+
v,
|
|
2266
|
+
y
|
|
2267
|
+
), P = ke(
|
|
2268
|
+
l[4],
|
|
2230
2269
|
e.maxSize,
|
|
2231
|
-
|
|
2232
|
-
|
|
2270
|
+
v,
|
|
2271
|
+
y
|
|
2233
2272
|
);
|
|
2234
|
-
if (!
|
|
2273
|
+
if (!ve(E, P, p))
|
|
2235
2274
|
return {};
|
|
2236
|
-
const
|
|
2237
|
-
if (!
|
|
2238
|
-
return
|
|
2239
|
-
`Property "${
|
|
2275
|
+
const m = E.isContainer, U = l[0].startsWith("--") ? { type: "regular", key: null, props: [l[0]] } : ht(l[0]);
|
|
2276
|
+
if (!U)
|
|
2277
|
+
return ee.error(
|
|
2278
|
+
`Property "${l[0]}" is not supported: "clamp-[${p}]".`
|
|
2240
2279
|
), {};
|
|
2241
|
-
const { key:
|
|
2242
|
-
if (
|
|
2243
|
-
const
|
|
2244
|
-
|
|
2245
|
-
),
|
|
2246
|
-
|
|
2247
|
-
),
|
|
2248
|
-
return Object.keys(
|
|
2249
|
-
if (
|
|
2250
|
-
if ((
|
|
2251
|
-
|
|
2252
|
-
else if (
|
|
2253
|
-
const
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2280
|
+
const { key: x, props: xe, type: ye } = U;
|
|
2281
|
+
if (ye === "fontSize") {
|
|
2282
|
+
const S = Xe(
|
|
2283
|
+
i().theme[x][l[1]] || l[1]
|
|
2284
|
+
), q = Xe(
|
|
2285
|
+
i().theme[x][l[2]] || l[2]
|
|
2286
|
+
), fe = {};
|
|
2287
|
+
return Object.keys(S).forEach((B) => {
|
|
2288
|
+
if (B in q) {
|
|
2289
|
+
if ((B === "letterSpacing" || B === "lineHeight") && S[B].number === q[B].number && S[B].unit === q[B].unit)
|
|
2290
|
+
fe[B] = `${S[B].number}${S[B].unit}`;
|
|
2291
|
+
else if (ve(S[B], q[B], p, B)) {
|
|
2292
|
+
const ft = We(
|
|
2293
|
+
S[B],
|
|
2294
|
+
q[B],
|
|
2295
|
+
E,
|
|
2296
|
+
P,
|
|
2297
|
+
m
|
|
2259
2298
|
);
|
|
2260
|
-
|
|
2299
|
+
fe[B] = ft;
|
|
2261
2300
|
}
|
|
2262
2301
|
}
|
|
2263
|
-
}),
|
|
2302
|
+
}), fe;
|
|
2264
2303
|
}
|
|
2265
|
-
let L =
|
|
2266
|
-
if (
|
|
2267
|
-
const
|
|
2268
|
-
typeof
|
|
2269
|
-
),
|
|
2270
|
-
|
|
2271
|
-
number:
|
|
2272
|
-
unit:
|
|
2273
|
-
}),
|
|
2274
|
-
number:
|
|
2275
|
-
unit:
|
|
2304
|
+
let Oe = L(x && ((Ge = i().theme[x]) == null ? void 0 : Ge[l[1]]) || l[1]), Te = L(x && ((Je = i().theme[x]) == null ? void 0 : Je[l[2]]) || l[2]);
|
|
2305
|
+
if (ye === "spacing") {
|
|
2306
|
+
const S = L(
|
|
2307
|
+
typeof o("spacing") == "string" ? o("spacing") : o("spacing.1")
|
|
2308
|
+
), q = /^-?\d*\.?\d+$/.test(l[1]), fe = /^-?\d*\.?\d+$/.test(l[2]);
|
|
2309
|
+
q && (Oe = {
|
|
2310
|
+
number: S.number * parseFloat(l[1]),
|
|
2311
|
+
unit: S.unit
|
|
2312
|
+
}), fe && (Te = {
|
|
2313
|
+
number: S.number * parseFloat(l[2]),
|
|
2314
|
+
unit: S.unit
|
|
2276
2315
|
});
|
|
2277
2316
|
}
|
|
2278
|
-
if (!
|
|
2317
|
+
if (!ve(Oe, Te, p))
|
|
2279
2318
|
return {};
|
|
2280
|
-
const
|
|
2281
|
-
return
|
|
2319
|
+
const pt = We(Oe, Te, E, P, m);
|
|
2320
|
+
return xe.reduce((S, q) => (typeof q == "string" ? S[q] = pt : S = { ...S, ...q }, S), {});
|
|
2282
2321
|
}
|
|
2283
2322
|
},
|
|
2284
|
-
{ values:
|
|
2323
|
+
{ values: u },
|
|
2285
2324
|
{
|
|
2286
2325
|
supportsNegativeValues: !1,
|
|
2287
2326
|
modifiers: {
|
|
@@ -2293,6 +2332,6 @@ const _n = ct.withOptions(function(t = {}) {
|
|
|
2293
2332
|
};
|
|
2294
2333
|
});
|
|
2295
2334
|
export {
|
|
2296
|
-
|
|
2335
|
+
sr as default
|
|
2297
2336
|
};
|
|
2298
2337
|
//# sourceMappingURL=index.js.map
|