index.min.js
8.24 KB
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):e.emotionStylis=r()}(this,function(){"use strict";return function(e){function j(e,r,a){var t=r.trim().split(b),c=(r=t).length,s=e.length;switch(s){case 0:case 1:var i=0;for(e=0===s?"":e[0]+" ";i<c;++i)r[i]=l(e,r[i],a).trim();break;default:var n=i=0;for(r=[];i<c;++i)for(var o=0;o<s;++o)r[n++]=l(e[o]+" ",t[i],a).trim()}return r}function l(e,r,a){var t=r.charCodeAt(0);switch(t<33&&(t=(r=r.trim()).charCodeAt(0)),t){case 38:return r.replace(c,"$1"+e.trim());case 58:return e.trim()+r.replace(c,"$1"+e.trim());default:if(0<1*a&&0<r.indexOf("\f"))return r.replace(c,(58===e.charCodeAt(0)?"":"$1")+e.trim())}return e+r}function S(e,r,a,t){var c=e+";",s=2*r+3*a+4*t;if(944===s){e=c.indexOf(":",9)+1;var i=c.substring(e,c.length-1).trim();return i=c.substring(0,e).trim()+i+";",1===N||2===N&&B(i,1)?"-webkit-"+i+i:i}if(0===N||2===N&&!B(c,1))return c;switch(s){case 1015:return 97===c.charCodeAt(10)?"-webkit-"+c+c:c;case 951:return 116===c.charCodeAt(3)?"-webkit-"+c+c:c;case 963:return 110===c.charCodeAt(5)?"-webkit-"+c+c:c;case 1009:if(100!==c.charCodeAt(4))break;case 969:case 942:return"-webkit-"+c+c;case 978:return"-webkit-"+c+"-moz-"+c+c;case 1019:case 983:return"-webkit-"+c+"-moz-"+c+"-ms-"+c+c;case 883:if(45===c.charCodeAt(8))return"-webkit-"+c+c;if(0<c.indexOf("image-set(",11))return c.replace(w,"$1-webkit-$2")+c;break;case 932:if(45===c.charCodeAt(4))switch(c.charCodeAt(5)){case 103:return"-webkit-box-"+c.replace("-grow","")+"-webkit-"+c+"-ms-"+c.replace("grow","positive")+c;case 115:return"-webkit-"+c+"-ms-"+c.replace("shrink","negative")+c;case 98:return"-webkit-"+c+"-ms-"+c.replace("basis","preferred-size")+c}return"-webkit-"+c+"-ms-"+c+c;case 964:return"-webkit-"+c+"-ms-flex-"+c+c;case 1023:if(99!==c.charCodeAt(8))break;return"-webkit-box-pack"+(i=c.substring(c.indexOf(":",15)).replace("flex-","").replace("space-between","justify"))+"-webkit-"+c+"-ms-flex-pack"+i+c;case 1005:return o.test(c)?c.replace(n,":-webkit-")+c.replace(n,":-moz-")+c:c;case 1e3:switch(r=(i=c.substring(13).trim()).indexOf("-")+1,i.charCodeAt(0)+i.charCodeAt(r)){case 226:i=c.replace(h,"tb");break;case 232:i=c.replace(h,"tb-rl");break;case 220:i=c.replace(h,"lr");break;default:return c}return"-webkit-"+c+"-ms-"+i+c;case 1017:if(-1===c.indexOf("sticky",9))break;case 975:switch(r=(c=e).length-10,s=(i=(33===c.charCodeAt(r)?c.substring(0,r):c).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|i.charCodeAt(7))){case 203:if(i.charCodeAt(8)<111)break;case 115:c=c.replace(i,"-webkit-"+i)+";"+c;break;case 207:case 102:c=c.replace(i,"-webkit-"+(102<s?"inline-":"")+"box")+";"+c.replace(i,"-webkit-"+i)+";"+c.replace(i,"-ms-"+i+"box")+";"+c}return c+";";case 938:if(45===c.charCodeAt(5))switch(c.charCodeAt(6)){case 105:return i=c.replace("-items",""),"-webkit-"+c+"-webkit-box-"+i+"-ms-flex-"+i+c;case 115:return"-webkit-"+c+"-ms-flex-item-"+c.replace(d,"")+c;default:return"-webkit-"+c+"-ms-flex-line-pack"+c.replace("align-content","").replace(d,"")+c}break;case 973:case 989:if(45!==c.charCodeAt(3)||122===c.charCodeAt(4))break;case 931:case 953:if(!0===k.test(e))return 115===(i=e.substring(e.indexOf(":")+1)).charCodeAt(0)?S(e.replace("stretch","fill-available"),r,a,t).replace(":fill-available",":stretch"):c.replace(i,"-webkit-"+i)+c.replace(i,"-moz-"+i.replace("fill-",""))+c;break;case 962:if(c="-webkit-"+c+(102===c.charCodeAt(5)?"-ms-"+c:"")+c,211===a+t&&105===c.charCodeAt(13)&&0<c.indexOf("transform",10))return c.substring(0,c.indexOf(";",27)+1).replace(f,"$1-webkit-$2")+c}return c}function B(e,r){var a=e.indexOf(1===r?":":"{"),t=e.substring(0,3!==r?a:10);return a=e.substring(a+1,e.length-1),i(2!==r?t:t.replace(s,"$1"),a,r)}function F(e,r){var a=S(r,r.charCodeAt(0),r.charCodeAt(1),r.charCodeAt(2));return a!==r+";"?a.replace(t," or ($1)").substring(4):"("+r+")"}function q(e,r,a,t,c,s,i,n,o,l){for(var f,b=0,h=r;b<Q;++b)switch(f=p[b].call(u,e,h,a,t,c,s,i,n,o,l)){case void 0:case!1:case!0:case null:break;default:h=f}if(h!==r)return h}function r(e){return void 0!==(e=e.prefix)&&(i=null,e?"function"!=typeof e?N=1:(N=2,i=e):N=0),r}function u(e,r){var a=e;if(a.charCodeAt(0)<33&&(a=a.trim()),a=[a],0<Q){var t=q(-1,r,a,a,L,K,0,0,0,0);void 0!==t&&"string"==typeof t&&(r=t)}var c=function e(r,a,t,c,s){for(var i,n,o,l,f,b=0,h=0,u=0,d=0,k=0,w=0,p=o=i=0,g=0,A=0,m=0,C=0,v=t.length,x=v-1,$="",O="",y="",z="";g<v;){if(n=t.charCodeAt(g),g===x&&0!==h+d+u+b&&(0!==h&&(n=47===h?10:47),d=u=b=0,v++,x++),0===h+d+u+b){if(g===x&&(0<A&&($=$.replace(E,"")),0<$.trim().length)){switch(n){case 32:case 9:case 59:case 13:case 10:break;default:$+=t.charAt(g)}n=59}switch(n){case 123:for(i=($=$.trim()).charCodeAt(0),o=1,C=++g;g<v;){switch(n=t.charCodeAt(g)){case 123:o++;break;case 125:o--;break;case 47:switch(n=t.charCodeAt(g+1)){case 42:case 47:e:{for(p=g+1;p<x;++p)switch(t.charCodeAt(p)){case 47:if(42===n&&42===t.charCodeAt(p-1)&&g+2!==p){g=p+1;break e}break;case 10:if(47===n){g=p+1;break e}}g=p}}break;case 91:n++;case 40:n++;case 34:case 39:for(;g++<x&&t.charCodeAt(g)!==n;);}if(0===o)break;g++}switch(o=t.substring(C,g),0===i&&(i=($=$.replace(D,"").trim()).charCodeAt(0)),i){case 64:switch(0<A&&($=$.replace(E,"")),n=$.charCodeAt(1)){case 100:case 109:case 115:case 45:A=a;break;default:A=P}if(C=(o=e(a,A,o,n,s+1)).length,0<Q&&(f=q(3,o,A=j(P,$,m),a,L,K,C,n,s,c),$=A.join(""),void 0!==f&&0===(C=(o=f.trim()).length)&&(n=0,o="")),0<C)switch(n){case 115:$=$.replace(J,F);case 100:case 109:case 45:o=$+"{"+o+"}";break;case 107:o=($=$.replace(G,"$1 $2"))+"{"+o+"}",o=1===N||2===N&&B("@"+o,3)?"@-webkit-"+o+"@"+o:"@"+o;break;default:o=$+o,112===c&&(O+=o,o="")}else o="";break;default:o=e(a,j(a,$,m),o,c,s+1)}y+=o,o=m=A=p=i=0,$="",n=t.charCodeAt(++g);break;case 125:case 59:if(1<(C=($=(0<A?$.replace(E,""):$).trim()).length))switch(0===p&&(i=$.charCodeAt(0),45===i||96<i&&i<123)&&(C=($=$.replace(" ",":")).length),0<Q&&void 0!==(f=q(1,$,a,r,L,K,O.length,c,s,c))&&0===(C=($=f.trim()).length)&&($="\0\0"),i=$.charCodeAt(0),n=$.charCodeAt(1),i){case 0:break;case 64:if(105===n||99===n){z+=$+t.charAt(g);break}default:58!==$.charCodeAt(C-1)&&(O+=S($,i,n,$.charCodeAt(2)))}m=A=p=i=0,$="",n=t.charCodeAt(++g)}}switch(n){case 13:case 10:47===h?h=0:0===1+i&&107!==c&&0<$.length&&(A=1,$+="\0"),0<Q*R&&q(0,$,a,r,L,K,O.length,c,s,c),K=1,L++;break;case 59:case 125:if(0===h+d+u+b){K++;break}default:switch(K++,l=t.charAt(g),n){case 9:case 32:if(0===d+b+h)switch(k){case 44:case 58:case 9:case 32:l="";break;default:32!==n&&(l=" ")}break;case 0:l="\\0";break;case 12:l="\\f";break;case 11:l="\\v";break;case 38:0===d+h+b&&(A=m=1,l="\f"+l);break;case 108:if(0===d+h+b+M&&0<p)switch(g-p){case 2:112===k&&58===t.charCodeAt(g-3)&&(M=k);case 8:111===w&&(M=w)}break;case 58:0===d+h+b&&(p=g);break;case 44:0===h+u+d+b&&(A=1,l+="\r");break;case 34:case 39:0===h&&(d=d===n?0:0===d?n:d);break;case 91:0===d+h+u&&b++;break;case 93:0===d+h+u&&b--;break;case 41:0===d+h+b&&u--;break;case 40:if(0===d+h+b){if(0===i)switch(2*k+3*w){case 533:break;default:i=1}u++}break;case 64:0===h+u+d+b+p+o&&(o=1);break;case 42:case 47:if(!(0<d+b+u))switch(h){case 0:switch(2*n+3*t.charCodeAt(g+1)){case 235:h=47;break;case 220:C=g,h=42}break;case 42:47===n&&42===k&&C+2!==g&&(33===t.charCodeAt(C+2)&&(O+=t.substring(C,g+1)),l="",h=0)}}0===h&&($+=l)}w=k,k=n,g++}if(0<(C=O.length)){if(A=a,0<Q&&void 0!==(f=q(2,O,A,r,L,K,C,c,s,c))&&0===(O=f).length)return z+O+y;if(O=A.join(",")+"{"+O+"}",0!=N*M){switch(2!==N||B(O,2)||(M=0),M){case 111:O=O.replace(I,":-moz-$1")+O;break;case 112:O=O.replace(H,"::-webkit-input-$1")+O.replace(H,"::-moz-$1")+O.replace(H,":-ms-input-$1")+O}M=0}}return z+O+y}(P,a,r,0,0);return 0<Q&&void 0!==(t=q(-2,c,a,a,L,K,c.length,0,0,0))&&(c=t),M=0,K=L=1,c}var D=/^\0+/g,E=/[\0\r\f]/g,n=/: */g,o=/zoo|gra/,f=/([,: ])(transform)/g,b=/,\r+?/g,c=/([\t\r\n ])*\f?&/g,G=/@(k\w+)\s*(\S*)\s*/,H=/::(place)/g,I=/:(read-only)/g,h=/[svh]\w+-[tblr]{2}/,J=/\(\s*(.*)\s*\)/g,t=/([\s\S]*?);/g,d=/-self|flex-/g,s=/[^]*?(:[rp][el]a[\w-]+)[^]*/,k=/stretch|:\s*\w+\-(?:conte|avail)/,w=/([^-])(image-set\()/,K=1,L=1,M=0,N=1,P=[],p=[],Q=0,i=null,R=0;return u.use=function e(r){switch(r){case void 0:case null:Q=p.length=0;break;default:switch(r.constructor){case Array:for(var a=0,t=r.length;a<t;++a)e(r[a]);break;case Function:p[Q++]=r;break;case Boolean:R=0|!!r}}return e},u.set=r,void 0!==e&&r(e),u}});
//# sourceMappingURL=index.min.js.map