Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

stylis

Package Overview
Dependencies
Maintainers
1
Versions
174
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stylis - npm Package Compare versions

Comparing version 3.5.1 to 3.5.2

4

CHANGELOG.md

@@ -0,1 +1,5 @@

## 3.5.2 July 12, 2018
- Fixes [#110](https://github.com/thysultan/stylis.js/issues/110)
## 3.5.1 June 19, 2018

@@ -2,0 +6,0 @@

2

package.json

@@ -8,3 +8,3 @@ {

"description": "light - weight css preprocessor",
"version": "3.5.1",
"version": "3.5.2",
"homepage": "https://github.com/thysultan/stylis.js",

@@ -11,0 +11,0 @@ "license": "MIT",

@@ -41,3 +41,3 @@ declare enum Context {

at: number,
depth: number): null | void | string
depth: number): any
}

@@ -44,0 +44,0 @@

@@ -181,3 +181,2 @@ /*

var bracket = 0 /* brackets [] */
var comment = 0 /* comments /* // or /* */
var parentheses = 0 /* functions () */

@@ -221,14 +220,9 @@ var quote = 0 /* quotes '', "" */

// last character + noop context, add synthetic padding for noop context to terminate
if (comment + quote + parentheses + bracket !== 0) {
if (comment !== 0) {
code = comment === FOWARDSLASH ? NEWLINE : FOWARDSLASH
}
if (quote + parentheses + bracket !== 0) {
quote = parentheses = bracket = 0
eof++
eol++
eof = (eol = eof) + 1
}
}
if (comment + quote + parentheses + bracket === 0) {
if (quote + parentheses + bracket === 0) {
// eof varient

@@ -321,5 +315,3 @@ if (caret === eol) {

while (caret < eof) {
code = body.charCodeAt(caret)
switch (code) {
switch (code = body.charCodeAt(caret)) {
case OPENBRACES: {

@@ -333,2 +325,11 @@ counter++

}
case FOWARDSLASH: {
switch (second = body.charCodeAt(caret + 1)) {
// /*, //
case STAR:
case FOWARDSLASH: {
caret = comment(second, caret, eol, body)
}
}
}
}

@@ -514,3 +515,3 @@

// auto insert semicolon
if (comment + quote + parentheses + bracket + semicolon === 0) {
if (quote + parentheses + bracket + semicolon === 0) {
// valid non-whitespace characters that

@@ -545,6 +546,3 @@ // may precede a newline

// terminate line comment
if (comment === FOWARDSLASH) {
comment = 0
} else if (cascade + context === 0 && id !== KEYFRAME && chars.length > 0) {
if (cascade + context === 0 && id !== KEYFRAME && chars.length > 0) {
format = 1

@@ -566,3 +564,3 @@ chars += '\0'

case CLOSEBRACES: {
if (comment + quote + parentheses + bracket === 0) {
if (quote + parentheses + bracket === 0) {
column++

@@ -583,3 +581,3 @@ break

case SPACE: {
if (quote + bracket + comment === 0) {
if (quote + bracket === 0) {
switch (tail) {

@@ -618,3 +616,3 @@ case COMMA:

// inverted selector pattern i.e html &
if (quote + comment + bracket === 0 && cascade > 0) {
if (quote + bracket === 0 && cascade > 0) {
invert = 1

@@ -629,3 +627,3 @@ format = 1

case 108: {
if (quote + comment + bracket + pattern === 0 && pseudo > 0) {
if (quote + bracket + pattern === 0 && pseudo > 0) {
switch (caret - pseudo) {

@@ -650,3 +648,3 @@ // ::placeholder

case COLON: {
if (quote + comment + bracket === 0) {
if (quote + bracket === 0) {
pseudo = caret

@@ -658,3 +656,3 @@ }

case COMMA: {
if (comment + parentheses + quote + bracket === 0) {
if (parentheses + quote + bracket === 0) {
format = 1

@@ -667,11 +665,7 @@ char += '\r'

case DOUBLEQUOTE: {
if (comment === 0) {
quote = quote === code ? 0 : (quote === 0 ? code : quote)
}
quote = quote === code ? 0 : (quote === 0 ? code : quote)
break
}
case SINGLEQUOTE: {
if (comment === 0) {
quote = quote === code ? 0 : (quote === 0 ? code : quote)
}
quote = quote === code ? 0 : (quote === 0 ? code : quote)
break

@@ -681,3 +675,3 @@ }

case OPENBRACKET: {
if (quote + comment + parentheses === 0) {
if (quote + parentheses === 0) {
bracket++

@@ -688,3 +682,3 @@ }

case CLOSEBRACKET: {
if (quote + comment + parentheses === 0) {
if (quote + parentheses === 0) {
bracket--

@@ -696,3 +690,3 @@ }

case CLOSEPARENTHESES: {
if (quote + comment + bracket === 0) {
if (quote + bracket === 0) {
parentheses--

@@ -703,3 +697,3 @@ }

case OPENPARENTHESES: {
if (quote + comment + bracket === 0) {
if (quote + bracket === 0) {
if (context === 0) {

@@ -724,3 +718,3 @@ switch (tail*2 + trail*3) {

case AT: {
if (comment + parentheses + quote + bracket + pseudo + atrule === 0) {
if (parentheses + quote + bracket + pseudo + atrule === 0) {
atrule = 1

@@ -731,37 +725,19 @@ }

// block/line comments
case STAR:
case FOWARDSLASH: {
if (quote + bracket + parentheses > 0) {
break
}
switch (comment) {
// initialize line/block comment context
case 0: {
switch (code*2 + body.charCodeAt(caret+1)*3) {
// //
case 235: {
comment = FOWARDSLASH
break
if (quote + bracket + parentheses === 0) {
switch (first = second = body.charCodeAt(caret + 1)) {
// /*!
case STAR: {
second = body.charCodeAt(caret + 2)
}
// /*, //
case FOWARDSLASH: {
if (char = '', caret = comment(first, length = caret, eol, body), second === 33) {
out += body.substring(length, caret)
}
// /*
case 220: {
length = caret
comment = STAR
break
if (caret === eol) {
eof = (eol = eof) + 1
}
}
break
}
// end block comment context
case STAR: {
if (code === FOWARDSLASH && tail === STAR) {
// /*<!> ... */, !
if (body.charCodeAt(length+2) === 33) {
out += body.substring(length, caret+1)
}
char = ''
comment = 0
}
}
}

@@ -771,60 +747,15 @@ }

// ignore comment blocks
if (comment === 0) {
// aggressive isolation mode, divide each individual selector
// including selectors in :not function but excluding selectors in :global function
if (cascade + quote + bracket + atrule === 0 && id !== KEYFRAME && code !== SEMICOLON) {
switch (code) {
case COMMA:
case TILDE:
case GREATERTHAN:
case PLUS:
case CLOSEPARENTHESES:
case OPENPARENTHESES: {
if (context === 0) {
// outside of an isolated context i.e nth-child(<...>)
switch (tail) {
case TAB:
case SPACE:
case NEWLINE:
case CARRIAGE: {
char = char + '\0'
break
}
default: {
char = '\0' + char + (code === COMMA ? '' : '\0')
}
}
format = 1
} else {
// within an isolated context, sleep untill it's terminated
switch (code) {
case OPENPARENTHESES: {
// :globa<l>(
if (pseudo + 7 === caret && tail === 108) {
pseudo = 0
}
context = ++counter
break
}
case CLOSEPARENTHESES: {
if ((context = --counter) === 0) {
format = 1
char += '\0'
}
break
}
}
}
break
}
case TAB:
case SPACE: {
// aggressive isolation mode, divide each individual selector
// including selectors in :not function but excluding selectors in :global function
if (cascade + quote + bracket + atrule === 0 && id !== KEYFRAME && code !== SEMICOLON) {
switch (code) {
case COMMA:
case TILDE:
case GREATERTHAN:
case PLUS:
case CLOSEPARENTHESES:
case OPENPARENTHESES: {
if (context === 0) {
// outside of an isolated context i.e nth-child(<...>)
switch (tail) {
case NULL:
case OPENBRACES:
case CLOSEBRACES:
case SEMICOLON:
case COMMA:
case FORMFEED:
case TAB:

@@ -834,23 +765,65 @@ case SPACE:

case CARRIAGE: {
char = char + '\0'
break
}
default: {
// ignore in isolated contexts
if (context === 0) {
char = '\0' + char + (code === COMMA ? '' : '\0')
}
}
format = 1
} else {
// within an isolated context, sleep untill it's terminated
switch (code) {
case OPENPARENTHESES: {
// :globa<l>(
if (pseudo + 7 === caret && tail === 108) {
pseudo = 0
}
context = ++counter
break
}
case CLOSEPARENTHESES: {
if ((context = --counter) === 0) {
format = 1
char += '\0'
}
break
}
}
}
break
}
case TAB:
case SPACE: {
switch (tail) {
case NULL:
case OPENBRACES:
case CLOSEBRACES:
case SEMICOLON:
case COMMA:
case FORMFEED:
case TAB:
case SPACE:
case NEWLINE:
case CARRIAGE: {
break
}
default: {
// ignore in isolated contexts
if (context === 0) {
format = 1
char += '\0'
}
}
}
}
}
}
// concat buffer of characters
chars += char
// concat buffer of characters
chars += char
// previous non-whitespace character code
if (code !== SPACE && code !== TAB) {
peak = code
}
// previous non-whitespace character code
if (code !== SPACE && code !== TAB) {
peak = code
}

@@ -1501,2 +1474,29 @@ }

/**
* @param {number} type
* @param {number} index
* @param {number} length
* @param {string} body
* @return {number}
*/
function comment (type, index, length, body) {
var i = index
if (type !== FOWARDSLASH) {
for (; i < length; ++i) {
if (body.charCodeAt(i) === FOWARDSLASH && body.charCodeAt(i - 1) === STAR) {
return i + 1
}
}
} else {
for (; i < length; i++) {
if (body.charCodeAt(i) === NEWLINE) {
return i + 1
}
}
}
return i
}
/**
* Minify

@@ -1503,0 +1503,0 @@ *

@@ -1,2 +0,2 @@

!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(null):"function"==typeof define&&define.amd?define(e(null)):window.stylis=e(null)}(function e(a){"use strict";var c=/^\0+/g,r=/[\0\r\f]/g,s=/: */g,t=/zoo|gra/,i=/([,: ])(transform)/g,f=/,+\s*(?![^(]*[)])/g,n=/ +\s*(?![^(]*[)])/g,l=/ *[\0] */g,o=/,\r+?/g,h=/([\t\r\n ])*\f?&/g,u=/:global\(((?:[^\(\)\[\]]*|\[.*\]|\([^\(\)]*\))*)\)/g,d=/\W+/g,b=/@(k\w+)\s*(\S*)\s*/,k=/::(place)/g,p=/:(read-only)/g,g=/\s+(?=[{\];=:>])/g,A=/([[}=:>])\s+/g,w=/(\{[^{]+?);(?=\})/g,C=/\s{2,}/g,v=/([^\(])(:+) */g,m=/[svh]\w+-[tblr]{2}/,x=/\(\s*(.*)\s*\)/g,$=/([\s\S]*?);/g,y=/-self|flex-/g,O=/[^]*?(:[rp][el]a[\w-]+)[^]*/,j=/stretch|:\s*\w+\-(?:conte|avail)/,z=/([^-])(image-set\()/,F="-webkit-",N="-moz-",S="-ms-",B=59,W=125,q=123,D=40,E=41,G=91,H=93,I=10,J=13,K=9,L=64,M=32,P=38,Q=45,R=95,T=42,U=44,V=58,X=39,Y=34,Z=47,_=62,ee=43,ae=126,ce=0,re=12,se=11,te=107,ie=109,fe=115,ne=112,le=111,oe=105,he=99,ue=100,de=112,be=1,ke=1,pe=0,ge=1,Ae=1,we=1,Ce=0,ve=0,me=0,xe=[],$e=[],ye=0,Oe=null,je=-2,ze=-1,Fe=0,Ne=1,Se=2,Be=3,We=0,qe=1,De="",Ee="",Ge="";function He(e,a,s,t,i){for(var f,n,o=0,h=0,u=0,d=0,g=0,A=0,w=0,C=0,m=0,$=0,y=0,O=0,j=0,z=0,R=0,Ce=0,$e=0,Oe=0,je=0,ze=s.length,Je=ze-1,Qe="",Re="",Te="",Ue="",Ve="",Xe="";R<ze;){if(w=s.charCodeAt(R),R===Je)if(h+d+u+o!==0){if(0!==h)w=h===Z?I:Z;d=u=o=0,ze++,Je++}if(h+d+u+o===0){if(R===Je){if(Ce>0)Re=Re.replace(r,"");if(Re.trim().length>0){switch(w){case M:case K:case B:case J:case I:break;default:Re+=s.charAt(R)}w=B}}if(1===$e)switch(w){case q:case W:case B:case Y:case X:case D:case E:case U:$e=0;case K:case J:case I:case M:break;default:for($e=0,je=R,g=w,R--,w=B;je<ze;)switch(s.charCodeAt(je++)){case I:case J:case B:++R,w=g,je=ze;break;case V:if(Ce>0)++R,w=g;case q:je=ze}}switch(w){case q:for(g=(Re=Re.trim()).charCodeAt(0),y=1,je=++R;R<ze;){switch(w=s.charCodeAt(R)){case q:y++;break;case W:y--}if(0===y)break;R++}if(Te=s.substring(je,R),g===ce)g=(Re=Re.replace(c,"").trim()).charCodeAt(0);switch(g){case L:if(Ce>0)Re=Re.replace(r,"");switch(A=Re.charCodeAt(1)){case ue:case ie:case fe:case Q:f=a;break;default:f=xe}if(je=(Te=He(a,f,Te,A,i+1)).length,me>0&&0===je)je=Re.length;if(ye>0)if(f=Ie(xe,Re,Oe),n=Pe(Be,Te,f,a,ke,be,je,A,i,t),Re=f.join(""),void 0!==n)if(0===(je=(Te=n.trim()).length))A=0,Te="";if(je>0)switch(A){case fe:Re=Re.replace(x,Me);case ue:case ie:case Q:Te=Re+"{"+Te+"}";break;case te:if(Te=(Re=Re.replace(b,"$1 $2"+(qe>0?De:"")))+"{"+Te+"}",1===Ae||2===Ae&&Le("@"+Te,3))Te="@"+F+Te+"@"+Te;else Te="@"+Te;break;default:if(Te=Re+Te,t===de)Ue+=Te,Te=""}else Te="";break;default:Te=He(a,Ie(a,Re,Oe),Te,t,i+1)}Ve+=Te,O=0,$e=0,z=0,Ce=0,Oe=0,j=0,Re="",Te="",w=s.charCodeAt(++R);break;case W:case B:if((je=(Re=(Ce>0?Re.replace(r,""):Re).trim()).length)>1){if(0===z)if((g=Re.charCodeAt(0))===Q||g>96&&g<123)je=(Re=Re.replace(" ",":")).length;if(ye>0)if(void 0!==(n=Pe(Ne,Re,a,e,ke,be,Ue.length,t,i,t)))if(0===(je=(Re=n.trim()).length))Re="\0\0";switch(g=Re.charCodeAt(0),A=Re.charCodeAt(1),g){case ce:break;case L:if(A===oe||A===he){Xe+=Re+s.charAt(R);break}default:if(Re.charCodeAt(je-1)===V)break;Ue+=Ke(Re,g,A,Re.charCodeAt(2))}}O=0,$e=0,z=0,Ce=0,Oe=0,Re="",w=s.charCodeAt(++R)}}switch(w){case J:case I:if(h+d+u+o+ve===0)switch($){case E:case X:case Y:case L:case ae:case _:case T:case ee:case Z:case Q:case V:case U:case B:case q:case W:break;default:if(z>0)$e=1}if(h===Z)h=0;else if(ge+O===0&&t!==te&&Re.length>0)Ce=1,Re+="\0";if(ye*We>0)Pe(Fe,Re,a,e,ke,be,Ue.length,t,i,t);be=1,ke++;break;case B:case W:if(h+d+u+o===0){be++;break}default:switch(be++,Qe=s.charAt(R),w){case K:case M:if(d+o+h===0)switch(C){case U:case V:case K:case M:Qe="";break;default:if(w!==M)Qe=" "}break;case ce:Qe="\\0";break;case re:Qe="\\f";break;case se:Qe="\\v";break;case P:if(d+h+o===0&&ge>0)Oe=1,Ce=1,Qe="\f"+Qe;break;case 108:if(d+h+o+pe===0&&z>0)switch(R-z){case 2:if(C===ne&&s.charCodeAt(R-3)===V)pe=C;case 8:if(m===le)pe=m}break;case V:if(d+h+o===0)z=R;break;case U:if(h+u+d+o===0)Ce=1,Qe+="\r";break;case Y:case X:if(0===h)d=d===w?0:0===d?w:d;break;case G:if(d+h+u===0)o++;break;case H:if(d+h+u===0)o--;break;case E:if(d+h+o===0)u--;break;case D:if(d+h+o===0){if(0===O)switch(2*C+3*m){case 533:break;default:y=0,O=1}u++}break;case L:if(h+u+d+o+z+j===0)j=1;break;case T:case Z:if(d+o+u>0)break;switch(h){case 0:switch(2*w+3*s.charCodeAt(R+1)){case 235:h=Z;break;case 220:je=R,h=T}break;case T:if(w===Z&&C===T){if(33===s.charCodeAt(je+2))Ue+=s.substring(je,R+1);Qe="",h=0}}}if(0===h){if(ge+d+o+j===0&&t!==te&&w!==B)switch(w){case U:case ae:case _:case ee:case E:case D:if(0===O){switch(C){case K:case M:case I:case J:Qe+="\0";break;default:Qe="\0"+Qe+(w===U?"":"\0")}Ce=1}else switch(w){case D:if(z+7===R&&108===C)z=0;O=++y;break;case E:if(0==(O=--y))Ce=1,Qe+="\0"}break;case K:case M:switch(C){case ce:case q:case W:case B:case U:case re:case K:case M:case I:case J:break;default:if(0===O)Ce=1,Qe+="\0"}}if(Re+=Qe,w!==M&&w!==K)$=w}}m=C,C=w,R++}if(je=Ue.length,me>0)if(0===je&&0===Ve.length&&0===a[0].length==false)if(t!==ie||1===a.length&&(ge>0?Ee:Ge)===a[0])je=a.join(",").length+2;if(je>0){if(f=0===ge&&t!==te?function(e){for(var a,c,s=0,t=e.length,i=Array(t);s<t;++s){for(var f=e[s].split(l),n="",o=0,h=0,u=0,d=0,b=f.length;o<b;++o){if(0===(h=(c=f[o]).length)&&b>1)continue;if(u=n.charCodeAt(n.length-1),d=c.charCodeAt(0),a="",0!==o)switch(u){case T:case ae:case _:case ee:case M:case D:break;default:a=" "}switch(d){case P:c=a+Ee;case ae:case _:case ee:case M:case E:case D:break;case G:c=a+c+Ee;break;case V:switch(2*c.charCodeAt(1)+3*c.charCodeAt(2)){case 530:if(we>0){c=a+c.substring(8,h-1);break}default:if(o<1||f[o-1].length<1)c=a+Ee+c}break;case U:a="";default:if(h>1&&c.indexOf(":")>0)c=a+c.replace(v,"$1"+Ee+"$2");else c=a+c+Ee}n+=c}i[s]=n.replace(r,"").trim()}return i}(a):a,ye>0)if(void 0!==(n=Pe(Se,Ue,f,e,ke,be,je,t,i,t))&&0===(Ue=n).length)return Xe+Ue+Ve;if(Ue=f.join(",")+"{"+Ue+"}",Ae*pe!=0){if(2===Ae&&!Le(Ue,2))pe=0;switch(pe){case le:Ue=Ue.replace(p,":"+N+"$1")+Ue;break;case ne:Ue=Ue.replace(k,"::"+F+"input-$1")+Ue.replace(k,"::"+N+"$1")+Ue.replace(k,":"+S+"input-$1")+Ue}pe=0}}return Xe+Ue+Ve}function Ie(e,a,c){var r=a.trim().split(o),s=r,t=r.length,i=e.length;switch(i){case 0:case 1:for(var f=0,n=0===i?"":e[0]+" ";f<t;++f)s[f]=Je(n,s[f],c,i).trim();break;default:f=0;var l=0;for(s=[];f<t;++f)for(var h=0;h<i;++h)s[l++]=Je(e[h]+" ",r[f],c,i).trim()}return s}function Je(e,a,c,r){var s=a,t=s.charCodeAt(0);if(t<33)t=(s=s.trim()).charCodeAt(0);switch(t){case P:switch(ge+r){case 0:case 1:if(0===e.trim().length)break;default:return s.replace(h,"$1"+e.trim())}break;case V:switch(s.charCodeAt(1)){case 103:if(we>0&&ge>0)return s.replace(u,"$1").replace(h,"$1"+Ge);break;default:return e.trim()+s.replace(h,"$1"+e.trim())}default:if(c*ge>0&&s.indexOf("\f")>0)return s.replace(h,(e.charCodeAt(0)===V?"":"$1")+e.trim())}return e+s}function Ke(e,a,c,r){var l,o=0,h=e+";",u=2*a+3*c+4*r;if(944===u)return function(e){var a=e.length,c=e.indexOf(":",9)+1,r=e.substring(0,c).trim(),s=e.substring(c,a-1).trim();switch(e.charCodeAt(9)*qe){case 0:break;case Q:if(110!==e.charCodeAt(10))break;default:for(var t=s.split((s="",f)),i=0,c=0,a=t.length;i<a;c=0,++i){for(var l=t[i],o=l.split(n);l=o[c];){var h=l.charCodeAt(0);if(1===qe&&(h>L&&h<90||h>96&&h<123||h===R||h===Q&&l.charCodeAt(1)!==Q))switch(isNaN(parseFloat(l))+(-1!==l.indexOf("("))){case 1:switch(l){case"infinite":case"alternate":case"backwards":case"running":case"normal":case"forwards":case"both":case"none":case"linear":case"ease":case"ease-in":case"ease-out":case"ease-in-out":case"paused":case"reverse":case"alternate-reverse":case"inherit":case"initial":case"unset":case"step-start":case"step-end":break;default:l+=De}}o[c++]=l}s+=(0===i?"":",")+o.join(" ")}}if(s=r+s+";",1===Ae||2===Ae&&Le(s,1))return F+s+s;return s}(h);else if(0===Ae||2===Ae&&!Le(h,1))return h;switch(u){case 1015:return 97===h.charCodeAt(10)?F+h+h:h;case 951:return 116===h.charCodeAt(3)?F+h+h:h;case 963:return 110===h.charCodeAt(5)?F+h+h:h;case 1009:if(100!==h.charCodeAt(4))break;case 969:case 942:return F+h+h;case 978:return F+h+N+h+h;case 1019:case 983:return F+h+N+h+S+h+h;case 883:if(h.charCodeAt(8)===Q)return F+h+h;if(h.indexOf("image-set(",11)>0)return h.replace(z,"$1"+F+"$2")+h;return h;case 932:if(h.charCodeAt(4)===Q)switch(h.charCodeAt(5)){case 103:return F+"box-"+h.replace("-grow","")+F+h+S+h.replace("grow","positive")+h;case 115:return F+h+S+h.replace("shrink","negative")+h;case 98:return F+h+S+h.replace("basis","preferred-size")+h}return F+h+S+h+h;case 964:return F+h+S+"flex-"+h+h;case 1023:if(99!==h.charCodeAt(8))break;return l=h.substring(h.indexOf(":",15)).replace("flex-","").replace("space-between","justify"),F+"box-pack"+l+F+h+S+"flex-pack"+l+h;case 1005:return t.test(h)?h.replace(s,":"+F)+h.replace(s,":"+N)+h:h;case 1e3:switch(o=(l=h.substring(13).trim()).indexOf("-")+1,l.charCodeAt(0)+l.charCodeAt(o)){case 226:l=h.replace(m,"tb");break;case 232:l=h.replace(m,"tb-rl");break;case 220:l=h.replace(m,"lr");break;default:return h}return F+h+S+l+h;case 1017:if(-1===h.indexOf("sticky",9))return h;case 975:switch(o=(h=e).length-10,u=(l=(33===h.charCodeAt(o)?h.substring(0,o):h).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|l.charCodeAt(7))){case 203:if(l.charCodeAt(8)<111)break;case 115:h=h.replace(l,F+l)+";"+h;break;case 207:case 102:h=h.replace(l,F+(u>102?"inline-":"")+"box")+";"+h.replace(l,F+l)+";"+h.replace(l,S+l+"box")+";"+h}return h+";";case 938:if(h.charCodeAt(5)===Q)switch(h.charCodeAt(6)){case 105:return l=h.replace("-items",""),F+h+F+"box-"+l+S+"flex-"+l+h;case 115:return F+h+S+"flex-item-"+h.replace(y,"")+h;default:return F+h+S+"flex-line-pack"+h.replace("align-content","").replace(y,"")+h}break;case 973:case 989:if(h.charCodeAt(3)!==Q||122===h.charCodeAt(4))break;case 931:case 953:if(true===j.test(e))if(115===(l=e.substring(e.indexOf(":")+1)).charCodeAt(0))return Ke(e.replace("stretch","fill-available"),a,c,r).replace(":fill-available",":stretch");else return h.replace(l,F+l)+h.replace(l,N+l.replace("fill-",""))+h;break;case 962:if(h=F+h+(102===h.charCodeAt(5)?S+h:"")+h,c+r===211&&105===h.charCodeAt(13)&&h.indexOf("transform",10)>0)return h.substring(0,h.indexOf(";",27)+1).replace(i,"$1"+F+"$2")+h}return h}function Le(e,a){var c=e.indexOf(1===a?":":"{"),r=e.substring(0,3!==a?c:10),s=e.substring(c+1,e.length-1);return Oe(2!==a?r:r.replace(O,"$1"),s,a)}function Me(e,a){var c=Ke(a,a.charCodeAt(0),a.charCodeAt(1),a.charCodeAt(2));return c!==a+";"?c.replace($," or ($1)").substring(4):"("+a+")"}function Pe(e,a,c,r,s,t,i,f,n,l){for(var o,h=0,u=a;h<ye;++h)switch(o=$e[h].call(Re,e,u,c,r,s,t,i,f,n,l)){case void 0:case false:case true:case null:break;default:u=o}switch(u){case void 0:case false:case true:case null:case a:break;default:return u}}function Qe(e){for(var a in e){var c=e[a];switch(a){case"keyframe":qe=0|c;break;case"global":we=0|c;break;case"cascade":ge=0|c;break;case"compress":Ce=0|c;break;case"semicolon":ve=0|c;break;case"preserve":me=0|c;break;case"prefix":if(Oe=null,!c)Ae=0;else if("function"!=typeof c)Ae=1;else Ae=2,Oe=c}}return Qe}function Re(a,c){if(void 0!==this&&this.constructor===Re)return e(a);var s=a,t=s.charCodeAt(0);if(t<33)t=(s=s.trim()).charCodeAt(0);if(qe>0)De=s.replace(d,t===G?"":"-");if(t=1,1===ge)Ge=s;else Ee=s;var i,f=[Ge];if(ye>0)if(void 0!==(i=Pe(ze,c,f,f,ke,be,0,0,0,0))&&"string"==typeof i)c=i;var n=He(xe,f,c,0,0);if(ye>0)if(void 0!==(i=Pe(je,n,f,f,ke,be,n.length,0,0,0))&&"string"!=typeof(n=i))t=0;return De="",Ge="",Ee="",pe=0,ke=1,be=1,Ce*t==0?n:n.replace(r,"").replace(g,"").replace(A,"$1").replace(w,"$1").replace(C," ")}if(Re.use=function e(a){switch(a){case void 0:case null:ye=$e.length=0;break;default:switch(a.constructor){case Array:for(var c=0,r=a.length;c<r;++c)e(a[c]);break;case Function:$e[ye++]=a;break;case Boolean:We=0|!!a}}return e},Re.set=Qe,void 0!==a)Qe(a);return Re});
!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(null):"function"==typeof define&&define.amd?define(e(null)):window.stylis=e(null)}(function e(a){"use strict";var r=/^\0+/g,c=/[\0\r\f]/g,s=/: */g,t=/zoo|gra/,i=/([,: ])(transform)/g,f=/,+\s*(?![^(]*[)])/g,n=/ +\s*(?![^(]*[)])/g,l=/ *[\0] */g,o=/,\r+?/g,h=/([\t\r\n ])*\f?&/g,u=/:global\(((?:[^\(\)\[\]]*|\[.*\]|\([^\(\)]*\))*)\)/g,d=/\W+/g,b=/@(k\w+)\s*(\S*)\s*/,p=/::(place)/g,k=/:(read-only)/g,g=/\s+(?=[{\];=:>])/g,A=/([[}=:>])\s+/g,C=/(\{[^{]+?);(?=\})/g,w=/\s{2,}/g,v=/([^\(])(:+) */g,m=/[svh]\w+-[tblr]{2}/,x=/\(\s*(.*)\s*\)/g,$=/([\s\S]*?);/g,y=/-self|flex-/g,O=/[^]*?(:[rp][el]a[\w-]+)[^]*/,j=/stretch|:\s*\w+\-(?:conte|avail)/,z=/([^-])(image-set\()/,F="-webkit-",N="-moz-",S="-ms-",B=59,W=125,q=123,D=40,E=41,G=91,H=93,I=10,J=13,K=9,L=64,M=32,P=38,Q=45,R=95,T=42,U=44,V=58,X=39,Y=34,Z=47,_=62,ee=43,ae=126,re=0,ce=12,se=11,te=107,ie=109,fe=115,ne=112,le=111,oe=105,he=99,ue=100,de=112,be=1,pe=1,ke=0,ge=1,Ae=1,Ce=1,we=0,ve=0,me=0,xe=[],$e=[],ye=0,Oe=null,je=-2,ze=-1,Fe=0,Ne=1,Se=2,Be=3,We=0,qe=1,De="",Ee="",Ge="";function He(e,a,s,t,i){for(var f,n,o=0,h=0,u=0,d=0,g=0,A=0,C=0,w=0,m=0,$=0,y=0,O=0,j=0,z=0,R=0,we=0,$e=0,Oe=0,je=s.length,ze=je-1,Je="",Re="",Te="",Ue="",Ve="",Xe="";z<je;){if(A=s.charCodeAt(z),z===ze)if(u+h+o!==0)u=h=o=0,je=(ze=je)+1;if(u+h+o===0){if(z===ze){if(R>0)Re=Re.replace(c,"");if(Re.trim().length>0){switch(A){case M:case K:case B:case J:case I:break;default:Re+=s.charAt(z)}A=B}}if(1===we)switch(A){case q:case W:case B:case Y:case X:case D:case E:case U:we=0;case K:case J:case I:case M:break;default:for(we=0,Oe=z,d=A,z--,A=B;Oe<je;)switch(s.charCodeAt(Oe++)){case I:case J:case B:++z,A=d,Oe=je;break;case V:if(R>0)++z,A=d;case q:Oe=je}}switch(A){case q:for(d=(Re=Re.trim()).charCodeAt(0),$=1,Oe=++z;z<je;){switch(A=s.charCodeAt(z)){case q:$++;break;case W:$--;break;case Z:switch(g=s.charCodeAt(z+1)){case T:case Z:z=Qe(g,z,ze,s)}}if(0===$)break;z++}if(Te=s.substring(Oe,z),d===re)d=(Re=Re.replace(r,"").trim()).charCodeAt(0);switch(d){case L:if(R>0)Re=Re.replace(c,"");switch(g=Re.charCodeAt(1)){case ue:case ie:case fe:case Q:f=a;break;default:f=xe}if(Oe=(Te=He(a,f,Te,g,i+1)).length,me>0&&0===Oe)Oe=Re.length;if(ye>0)if(f=Ie(xe,Re,$e),n=Pe(Be,Te,f,a,pe,be,Oe,g,i,t),Re=f.join(""),void 0!==n)if(0===(Oe=(Te=n.trim()).length))g=0,Te="";if(Oe>0)switch(g){case fe:Re=Re.replace(x,Me);case ue:case ie:case Q:Te=Re+"{"+Te+"}";break;case te:if(Te=(Re=Re.replace(b,"$1 $2"+(qe>0?De:"")))+"{"+Te+"}",1===Ae||2===Ae&&Le("@"+Te,3))Te="@"+F+Te+"@"+Te;else Te="@"+Te;break;default:if(Te=Re+Te,t===de)Ue+=Te,Te=""}else Te="";break;default:Te=He(a,Ie(a,Re,$e),Te,t,i+1)}Ve+=Te,y=0,we=0,j=0,R=0,$e=0,O=0,Re="",Te="",A=s.charCodeAt(++z);break;case W:case B:if((Oe=(Re=(R>0?Re.replace(c,""):Re).trim()).length)>1){if(0===j)if((d=Re.charCodeAt(0))===Q||d>96&&d<123)Oe=(Re=Re.replace(" ",":")).length;if(ye>0)if(void 0!==(n=Pe(Ne,Re,a,e,pe,be,Ue.length,t,i,t)))if(0===(Oe=(Re=n.trim()).length))Re="\0\0";switch(d=Re.charCodeAt(0),g=Re.charCodeAt(1),d){case re:break;case L:if(g===oe||g===he){Xe+=Re+s.charAt(z);break}default:if(Re.charCodeAt(Oe-1)===V)break;Ue+=Ke(Re,d,g,Re.charCodeAt(2))}}y=0,we=0,j=0,R=0,$e=0,Re="",A=s.charCodeAt(++z)}}switch(A){case J:case I:if(u+h+o+ve===0)switch(m){case E:case X:case Y:case L:case ae:case _:case T:case ee:case Z:case Q:case V:case U:case B:case q:case W:break;default:if(j>0)we=1}if(ge+y===0&&t!==te&&Re.length>0)R=1,Re+="\0";if(ye*We>0)Pe(Fe,Re,a,e,pe,be,Ue.length,t,i,t);be=1,pe++;break;case B:case W:if(u+h+o===0){be++;break}default:switch(be++,Je=s.charAt(z),A){case K:case M:if(u+o===0)switch(C){case U:case V:case K:case M:Je="";break;default:if(A!==M)Je=" "}break;case re:Je="\\0";break;case ce:Je="\\f";break;case se:Je="\\v";break;case P:if(u+o===0&&ge>0)$e=1,R=1,Je="\f"+Je;break;case 108:if(u+o+ke===0&&j>0)switch(z-j){case 2:if(C===ne&&s.charCodeAt(z-3)===V)ke=C;case 8:if(w===le)ke=w}break;case V:if(u+o===0)j=z;break;case U:if(h+u+o===0)R=1,Je+="\r";break;case Y:case X:u=u===A?0:0===u?A:u;break;case G:if(u+h===0)o++;break;case H:if(u+h===0)o--;break;case E:if(u+o===0)h--;break;case D:if(u+o===0){if(0===y)switch(2*C+3*w){case 533:break;default:$=0,y=1}h++}break;case L:if(h+u+o+j+O===0)O=1;break;case Z:if(u+o+h===0)switch(d=g=s.charCodeAt(z+1)){case T:g=s.charCodeAt(z+2);case Z:if(Je="",z=Qe(d,Oe=z,ze,s),33===g)Ue+=s.substring(Oe,z);if(z===ze)je=(ze=je)+1}}if(ge+u+o+O===0&&t!==te&&A!==B)switch(A){case U:case ae:case _:case ee:case E:case D:if(0===y){switch(C){case K:case M:case I:case J:Je+="\0";break;default:Je="\0"+Je+(A===U?"":"\0")}R=1}else switch(A){case D:if(j+7===z&&108===C)j=0;y=++$;break;case E:if(0==(y=--$))R=1,Je+="\0"}break;case K:case M:switch(C){case re:case q:case W:case B:case U:case ce:case K:case M:case I:case J:break;default:if(0===y)R=1,Je+="\0"}}if(Re+=Je,A!==M&&A!==K)m=A}w=C,C=A,z++}if(Oe=Ue.length,me>0)if(0===Oe&&0===Ve.length&&0===a[0].length==false)if(t!==ie||1===a.length&&(ge>0?Ee:Ge)===a[0])Oe=a.join(",").length+2;if(Oe>0){if(f=0===ge&&t!==te?function(e){for(var a,r,s=0,t=e.length,i=Array(t);s<t;++s){for(var f=e[s].split(l),n="",o=0,h=0,u=0,d=0,b=f.length;o<b;++o){if(0===(h=(r=f[o]).length)&&b>1)continue;if(u=n.charCodeAt(n.length-1),d=r.charCodeAt(0),a="",0!==o)switch(u){case T:case ae:case _:case ee:case M:case D:break;default:a=" "}switch(d){case P:r=a+Ee;case ae:case _:case ee:case M:case E:case D:break;case G:r=a+r+Ee;break;case V:switch(2*r.charCodeAt(1)+3*r.charCodeAt(2)){case 530:if(Ce>0){r=a+r.substring(8,h-1);break}default:if(o<1||f[o-1].length<1)r=a+Ee+r}break;case U:a="";default:if(h>1&&r.indexOf(":")>0)r=a+r.replace(v,"$1"+Ee+"$2");else r=a+r+Ee}n+=r}i[s]=n.replace(c,"").trim()}return i}(a):a,ye>0)if(void 0!==(n=Pe(Se,Ue,f,e,pe,be,Oe,t,i,t))&&0===(Ue=n).length)return Xe+Ue+Ve;if(Ue=f.join(",")+"{"+Ue+"}",Ae*ke!=0){if(2===Ae&&!Le(Ue,2))ke=0;switch(ke){case le:Ue=Ue.replace(k,":"+N+"$1")+Ue;break;case ne:Ue=Ue.replace(p,"::"+F+"input-$1")+Ue.replace(p,"::"+N+"$1")+Ue.replace(p,":"+S+"input-$1")+Ue}ke=0}}return Xe+Ue+Ve}function Ie(e,a,r){var c=a.trim().split(o),s=c,t=c.length,i=e.length;switch(i){case 0:case 1:for(var f=0,n=0===i?"":e[0]+" ";f<t;++f)s[f]=Je(n,s[f],r,i).trim();break;default:f=0;var l=0;for(s=[];f<t;++f)for(var h=0;h<i;++h)s[l++]=Je(e[h]+" ",c[f],r,i).trim()}return s}function Je(e,a,r,c){var s=a,t=s.charCodeAt(0);if(t<33)t=(s=s.trim()).charCodeAt(0);switch(t){case P:switch(ge+c){case 0:case 1:if(0===e.trim().length)break;default:return s.replace(h,"$1"+e.trim())}break;case V:switch(s.charCodeAt(1)){case 103:if(Ce>0&&ge>0)return s.replace(u,"$1").replace(h,"$1"+Ge);break;default:return e.trim()+s.replace(h,"$1"+e.trim())}default:if(r*ge>0&&s.indexOf("\f")>0)return s.replace(h,(e.charCodeAt(0)===V?"":"$1")+e.trim())}return e+s}function Ke(e,a,r,c){var l,o=0,h=e+";",u=2*a+3*r+4*c;if(944===u)return function(e){var a=e.length,r=e.indexOf(":",9)+1,c=e.substring(0,r).trim(),s=e.substring(r,a-1).trim();switch(e.charCodeAt(9)*qe){case 0:break;case Q:if(110!==e.charCodeAt(10))break;default:for(var t=s.split((s="",f)),i=0,r=0,a=t.length;i<a;r=0,++i){for(var l=t[i],o=l.split(n);l=o[r];){var h=l.charCodeAt(0);if(1===qe&&(h>L&&h<90||h>96&&h<123||h===R||h===Q&&l.charCodeAt(1)!==Q))switch(isNaN(parseFloat(l))+(-1!==l.indexOf("("))){case 1:switch(l){case"infinite":case"alternate":case"backwards":case"running":case"normal":case"forwards":case"both":case"none":case"linear":case"ease":case"ease-in":case"ease-out":case"ease-in-out":case"paused":case"reverse":case"alternate-reverse":case"inherit":case"initial":case"unset":case"step-start":case"step-end":break;default:l+=De}}o[r++]=l}s+=(0===i?"":",")+o.join(" ")}}if(s=c+s+";",1===Ae||2===Ae&&Le(s,1))return F+s+s;return s}(h);else if(0===Ae||2===Ae&&!Le(h,1))return h;switch(u){case 1015:return 97===h.charCodeAt(10)?F+h+h:h;case 951:return 116===h.charCodeAt(3)?F+h+h:h;case 963:return 110===h.charCodeAt(5)?F+h+h:h;case 1009:if(100!==h.charCodeAt(4))break;case 969:case 942:return F+h+h;case 978:return F+h+N+h+h;case 1019:case 983:return F+h+N+h+S+h+h;case 883:if(h.charCodeAt(8)===Q)return F+h+h;if(h.indexOf("image-set(",11)>0)return h.replace(z,"$1"+F+"$2")+h;return h;case 932:if(h.charCodeAt(4)===Q)switch(h.charCodeAt(5)){case 103:return F+"box-"+h.replace("-grow","")+F+h+S+h.replace("grow","positive")+h;case 115:return F+h+S+h.replace("shrink","negative")+h;case 98:return F+h+S+h.replace("basis","preferred-size")+h}return F+h+S+h+h;case 964:return F+h+S+"flex-"+h+h;case 1023:if(99!==h.charCodeAt(8))break;return l=h.substring(h.indexOf(":",15)).replace("flex-","").replace("space-between","justify"),F+"box-pack"+l+F+h+S+"flex-pack"+l+h;case 1005:return t.test(h)?h.replace(s,":"+F)+h.replace(s,":"+N)+h:h;case 1e3:switch(o=(l=h.substring(13).trim()).indexOf("-")+1,l.charCodeAt(0)+l.charCodeAt(o)){case 226:l=h.replace(m,"tb");break;case 232:l=h.replace(m,"tb-rl");break;case 220:l=h.replace(m,"lr");break;default:return h}return F+h+S+l+h;case 1017:if(-1===h.indexOf("sticky",9))return h;case 975:switch(o=(h=e).length-10,u=(l=(33===h.charCodeAt(o)?h.substring(0,o):h).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|l.charCodeAt(7))){case 203:if(l.charCodeAt(8)<111)break;case 115:h=h.replace(l,F+l)+";"+h;break;case 207:case 102:h=h.replace(l,F+(u>102?"inline-":"")+"box")+";"+h.replace(l,F+l)+";"+h.replace(l,S+l+"box")+";"+h}return h+";";case 938:if(h.charCodeAt(5)===Q)switch(h.charCodeAt(6)){case 105:return l=h.replace("-items",""),F+h+F+"box-"+l+S+"flex-"+l+h;case 115:return F+h+S+"flex-item-"+h.replace(y,"")+h;default:return F+h+S+"flex-line-pack"+h.replace("align-content","").replace(y,"")+h}break;case 973:case 989:if(h.charCodeAt(3)!==Q||122===h.charCodeAt(4))break;case 931:case 953:if(true===j.test(e))if(115===(l=e.substring(e.indexOf(":")+1)).charCodeAt(0))return Ke(e.replace("stretch","fill-available"),a,r,c).replace(":fill-available",":stretch");else return h.replace(l,F+l)+h.replace(l,N+l.replace("fill-",""))+h;break;case 962:if(h=F+h+(102===h.charCodeAt(5)?S+h:"")+h,r+c===211&&105===h.charCodeAt(13)&&h.indexOf("transform",10)>0)return h.substring(0,h.indexOf(";",27)+1).replace(i,"$1"+F+"$2")+h}return h}function Le(e,a){var r=e.indexOf(1===a?":":"{"),c=e.substring(0,3!==a?r:10),s=e.substring(r+1,e.length-1);return Oe(2!==a?c:c.replace(O,"$1"),s,a)}function Me(e,a){var r=Ke(a,a.charCodeAt(0),a.charCodeAt(1),a.charCodeAt(2));return r!==a+";"?r.replace($," or ($1)").substring(4):"("+a+")"}function Pe(e,a,r,c,s,t,i,f,n,l){for(var o,h=0,u=a;h<ye;++h)switch(o=$e[h].call(Te,e,u,r,c,s,t,i,f,n,l)){case void 0:case false:case true:case null:break;default:u=o}switch(u){case void 0:case false:case true:case null:case a:break;default:return u}}function Qe(e,a,r,c){var s=a;if(e!==Z){for(;s<r;++s)if(c.charCodeAt(s)===Z&&c.charCodeAt(s-1)===T)return s+1}else for(;s<r;s++)if(c.charCodeAt(s)===I)return s+1;return s}function Re(e){for(var a in e){var r=e[a];switch(a){case"keyframe":qe=0|r;break;case"global":Ce=0|r;break;case"cascade":ge=0|r;break;case"compress":we=0|r;break;case"semicolon":ve=0|r;break;case"preserve":me=0|r;break;case"prefix":if(Oe=null,!r)Ae=0;else if("function"!=typeof r)Ae=1;else Ae=2,Oe=r}}return Re}function Te(a,r){if(void 0!==this&&this.constructor===Te)return e(a);var s=a,t=s.charCodeAt(0);if(t<33)t=(s=s.trim()).charCodeAt(0);if(qe>0)De=s.replace(d,t===G?"":"-");if(t=1,1===ge)Ge=s;else Ee=s;var i,f=[Ge];if(ye>0)if(void 0!==(i=Pe(ze,r,f,f,pe,be,0,0,0,0))&&"string"==typeof i)r=i;var n=He(xe,f,r,0,0);if(ye>0)if(void 0!==(i=Pe(je,n,f,f,pe,be,n.length,0,0,0))&&"string"!=typeof(n=i))t=0;return De="",Ge="",Ee="",ke=0,pe=1,be=1,we*t==0?n:n.replace(c,"").replace(g,"").replace(A,"$1").replace(C,"$1").replace(w," ")}if(Te.use=function e(a){switch(a){case void 0:case null:ye=$e.length=0;break;default:switch(a.constructor){case Array:for(var r=0,c=a.length;r<c;++r)e(a[r]);break;case Function:$e[ye++]=a;break;case Boolean:We=0|!!a}}return e},Te.set=Re,void 0!==a)Re(a);return Te});
//# sourceMappingURL=stylis.min.js.map

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc