pretty-lights
Advanced tools
Comparing version 0.0.12 to 0.0.13
@@ -1,2 +0,2 @@ | ||
function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=e(require("@emotion/stylis")),r=e(require("@emotion/hash")),n=e(require("@emotion/unitless")),o=e(require("@emotion/memoize")),a=e(require("@emotion/is-prop-valid")),i=e(require("@emotion/weak-memoize")),s=e(require("hoist-non-react-statics")),c=require("react"),u=e(c);function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function p(){return(p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach(function(t){f(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var v=function(){function e(t){!function(t,r){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this),this.isSpeedy=void 0===t.speedy?"production"===process.env.NODE_ENV:t.speedy,this.tags=[],this.ctr=0,this.nonce=t.nonce,this.key=t.key,this.container=t.container,this.before=null}var t;return(t=[{key:"insert",value:function(e){if(this.ctr%(this.isSpeedy?65e3:1)==0){var t=function(e){var t=document.createElement("style");return t.setAttribute("data-lights",e.key||""),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t}(this);this.container.insertBefore(t,0===this.tags.length?this.before:this.tags[this.tags.length-1].nextSibling),this.tags.push(t)}var r=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t+=1)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(r);try{var o=105===e.charCodeAt(1)&&64===e.charCodeAt(0);n.insertRule(e,o?0:n.cssRules.length)}catch(t){"production"!==process.env.NODE_ENV&&console.warn('There was a problem inserting the following rule: "'.concat(e,'"'),t)}}else r.appendChild(document.createTextNode(e));this.ctr+=1}},{key:"flush",value:function(){this.tags.forEach(function(e){return e.parentNode.removeChild(e)}),this.tags=[],this.ctr=0}}])&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(e.prototype,t),e}(),y="".concat("/*|*/","}"),m={current:null};function g(e){e&&m.current.insert("".concat(e,"}"))}var b,E=function(e,t,r,n,o,a,i,s,c,u){switch(e){default:break;case 1:switch(t.charCodeAt(0)){default:break;case 64:return m.current.insert("".concat(t,";")),"";case 108:if(98===t.charCodeAt(2))return""}break;case 2:if(0===s)return t+"/*|*/";break;case 3:switch(s){case 102:case 112:return m.current.insert(r[0]+t),"";default:return t+(0===u?"/*|*/":"")}case-2:t.split(y).forEach(g)}},w=function(e,t){if(1===e&&108===t.charCodeAt(0)&&98===t.charCodeAt(2))return""},_="undefined"!=typeof document,N=/\/\*\|\*\//g,O={},x=_?void 0:i(function(){var e=i(function(){return{}}),t={},r={};return function(n){return void 0===n||!0===n?t:!1===n?r:e(n)}}),k="You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences",j="You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).",A=/[A-Z]|^ms/g,P=/_EMO_([^_]+?)_([^]*?)_EMO_/g,S=function(e){return 45===e.charCodeAt(1)},C=function(e){return null!=e&&"boolean"!=typeof e},D=o(function(e){return S(e)?e:e.replace(A,"-$&").toLowerCase()}),V=function(e,t){switch(e){default:break;case"animation":case"animationName":if("string"==typeof t)return t.replace(P,function(e,t,r){return b={name:t,styles:r,next:b},t})}return 1===n[e]||S(e)||"number"!=typeof t||0===t?t:"".concat(t,"px")};if("production"!==process.env.NODE_ENV){var q=/(attr|calc|counters?|url)\(/,T=["normal","none","counter","open-quote","close-quote","no-open-quote","no-close-quote","initial","inherit","unset"],R=V,I=/^-ms-/,Y=/-(.)/g,L={};V=function(e,t){"content"===e&&("string"!=typeof t||-1===T.indexOf(t)&&!q.test(t)&&(t.charAt(0)!==t.charAt(t.length-1)||'"'!==t.charAt(0)&&"'"!==t.charAt(0)))&&console.error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\"".concat(t,"\"'`"));var r=R(e,t);return""===r||S(e)||-1===e.indexOf("-")||void 0!==L[e]||(L[e]=!0,console.error("Using kebab-case for css properties in objects is not supported. Did you mean ".concat(e.replace(I,"ms-").replace(Y,function(e,t){return t.toUpperCase()}),"?"))),r}}function M(e,t,r,n){if(null==r)return"";if(void 0!==r.__lights_styles){var o=r.toString();if("NO_COMPONENT_SELECTOR"===o&&"production"!==process.env.NODE_ENV)throw new Error("Component selectors can only be used in conjunction with pretty-lights/babel.");return o}switch(l(r)){case"boolean":return"";case"object":if(1===r.anim)return b={name:r.name,styles:r.styles,next:b},r.name;if(void 0!==r.styles){var a=r.next;if(void 0!==a)for(;void 0!==a;)b={name:a.name,styles:a.styles,next:b},a=a.next;var i="".concat(r.styles,";");return"production"!==process.env.NODE_ENV&&void 0!==r.map&&(i+=r.map),i}return function(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o<r.length;o+=1)n+=M(e,t,r[o],!1);else for(var a in r){var i=r[a];if("object"!==l(i))null!=t&&void 0!==t[i]?n+="".concat(a,"{").concat(t[i],"}"):C(i)&&(n+="".concat(D(a),":").concat(V(a,i),";"));else{if("NO_COMPONENT_SELECTOR"===a&&"production"!==process.env.NODE_ENV)throw new Error("Component selectors can only be used in conjunction with pretty-lights/babel.");if(!Array.isArray(i)||"string"!=typeof i[0]||null!=t&&void 0!==t[i[0]]){var s=M(e,t,i,!1);switch(a){case"animation":case"animationName":n+="".concat(D(a),":").concat(s,";");break;default:"production"!==process.env.NODE_ENV&&"undefined"===a&&console.error(j),n+="".concat(a,"{").concat(s,"}")}}else for(var c=0;c<i.length;c+=1)C(i[c])&&(n+="".concat(D(a),":").concat(V(a,i[c]),";"))}}return n}(e,t,r);case"function":if(void 0!==e){var s=b,c=r(e);return b=s,M(e,t,c,n)}"production"!==process.env.NODE_ENV&&console.error("Functions that are interpolated in css calls will be stringified.\nIf you want to have a css call based on props, create a function that returns a css call like this\nlet dynamicStyle = (props) => css`color: ${props.color}`\nIt can be called directly with props or interpolated in a styled call like this\nlet SomeComponent = styled('div')`${dynamicStyle}`");break;case"string":if("production"!==process.env.NODE_ENV){var u=[],f=r.replace(P,function(e,t,r){var n="animation".concat(u.length);return u.push("const ".concat(n," = keyframes`").concat(r.replace(/^@keyframes animation-\w+/,""),"`")),"${".concat(n,"}")});u.length&&console.error("".concat("`keyframes` output got interpolated into plain string, please wrap it with `css`.\n\nInstead of doing this:\n\n").concat([].concat(u,["`".concat(f,"`")]).join("\n"),"\n\nYou should wrap it with `css` like this:\n\ncss`").concat(f,"`"))}}if(null==t)return r;var p=t[r];return!1===n&&void 0!==p?p:r}var F,G=/label:\s*([^\s;\n{]+)\s*;/g;function z(e,t,n){if(1===e.length&&"object"===l(e[0])&&null!==e[0]&&void 0!==e[0].styles)return e[0];var o=!0,a="";b=void 0;var i,s=e[0];null==s||void 0===s.raw?(o=!1,a+=M(n,t,s,!1)):("production"!==process.env.NODE_ENV&&void 0===s[0]&&console.error(k),a+=s[0]);for(var c=1;c<e.length;c+=1)a+=M(n,t,e[c],46===a.charCodeAt(a.length-1)),o&&("production"!==process.env.NODE_ENV&&void 0===s[c]&&console.error(k),a+=s[c]);"production"!==process.env.NODE_ENV&&(a=a.replace(F,function(e){return i=e,""})),G.lastIndex=0;for(var u,f="";null!==(u=G.exec(a));)f+="-".concat(u[1]);return{name:r(a)+f,styles:a,map:i,next:b}}"production"!==process.env.NODE_ENV&&(F=/\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//);var U="undefined"!=typeof document;function $(e,t,r){var n="";return r.split(" ").forEach(function(r){void 0!==e[r]?t.push(e[r]):n+="".concat(r," ")}),n}var B=function(e,t){var r="".concat(e.key,"-").concat(t.name);if(void 0===e.registered[r]&&(e.registered[r]=t.styles),void 0===e.inserted[t.name]){var n="",o=t;do{var a=e.insert(".".concat(r),o,e.sheet,!0);U||void 0===a||(n+=a),o=o.next}while(void 0!==o);if(!U&&0!==n.length)return n}};function J(e,t){if(void 0===e.inserted[t.name])return e.insert("",t,e.sheet,!0)}function W(e,t,r){var n=[],o=$(e,n,r);return n.length<2?r:o+t(n)}var Z=u.createContext({}),H=a,K=function(e){return"theme"!==e&&"innerRef"!==e},Q=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?H:K},X=i(function(e){return i(function(t){return function(e,t){if("function"==typeof t){var r=t(e);if("production"!==process.env.NODE_ENV&&(null==r||"object"!==l(r)||Array.isArray(r)))throw new Error("[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!");return r}if("production"!==process.env.NODE_ENV&&(null==t||"object"!==l(t)||Array.isArray(t)))throw new Error("[ThemeProvider] Please make your theme prop a plain object");return h({},e,{},t)}(e,t)})});function ee(e,t,r){var n,o=t.theme&&t.theme[e];return"function"==typeof(n="function"==typeof o?o(r):r[o]?r[o]:r.none)?n(t):n}function te(e,t){return function(r){return ee(e,r,t)}}te.variants=function(e,t,r){return function(n){var o=n[t]&&r[n[t]];return o&&ee(e,n,o)}};var re=function(e){var r=function(e){void 0===e&&(e={});var r,n,o=e.key||"css";if("production"!==process.env.NODE_ENV&&/[^a-z-]/.test(o))throw new Error('Pretty Lights key must only contain lower case alphabetical characters and - but "'.concat(o,'" was passed'));void 0!==e.prefix&&(n={prefix:e.prefix});var a,i,s=new t(n),c={};if(_){a=e.container||document.head;var u="data-lights-".concat(o),l=document.querySelectorAll("style[".concat(u,"]"));Array.prototype.forEach.call(l,function(e){(e.getAttribute(u)||"").split(" ").forEach(function(e){c[e]=!0}),e.parentNode!==a&&a.appendChild(e)})}if(_)s.use(e.stylisPlugins)(E),i=function(e,t,n,o){if(m.current=n,"production"!==process.env.NODE_ENV&&void 0!==t.map){var a=t.map;m.current={insert:function(e){n.insert(e+a)}}}if(void 0===r.inserted[t.name]){var i=s(e,t.styles);o&&(r.inserted[t.name]=i.replace(N,""))}};else{s.use(w);var f=O;(e.stylisPlugins||void 0!==e.prefix)&&(s.use(e.stylisPlugins),f=x(e.stylisPlugins||O)(e.prefix)),i=function(e,t,n,o){if(void 0===r.inserted[t.name]){var a=function(e,t){var r=t.name;return void 0===f[r]&&(f[r]=s(e,t.styles)),f[r]}(e,t);if(!o)return a;r.inserted[t.name]=a}}}if("production"!==process.env.NODE_ENV){var p=/\/\*/g,d=/\*\//g;s.use(function(e,t){switch(e){default:break;case-1:for(;p.test(t);){if(d.lastIndex=p.lastIndex,!d.test(t))throw new Error('Your styles have an unterminated comment ("/*" without corresponding "*/").');p.lastIndex=d.lastIndex}p.lastIndex=0}})}return r={key:o,sheet:new v({key:o,container:a,nonce:e.nonce,speedy:e.speedy}),nonce:e.nonce,inserted:c,registered:{},insert:i}}(void 0);r.sheet.speedy=function(e){if("production"!==process.env.NODE_ENV&&0!==this.ctr)throw new Error("speedy must be changed before any rules are inserted");this.isSpeedy=e},r.compat=!0;var n=function(){for(var e=arguments,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=e[o];var a=z(n,r.registered),i="".concat(r.key,"-").concat(a.name);return B(r,a),i};return{css:n,cx:function(){for(var e=arguments,t=arguments.length,o=new Array(t),a=0;a<t;a++)o[a]=e[a];return W(r.registered,n,function e(t){for(var r="",n=0;n<t.length;n+=1){var o=t[n];if(null!=o){var a=void 0;switch(l(o)){case"boolean":break;case"object":if(Array.isArray(o))a=e(o);else for(var i in a="",o)o[i]&&i&&(a&&(a+=" "),a+=i);break;default:a=o}a&&(r&&(r+=" "),r+=a)}}return r}(o))},injectGlobal:function(){for(var e=arguments,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=e[o];var a=z(n,r.registered);J(r,a)},keyframes:function(){for(var e=arguments,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=e[o];var a=z(n,r.registered),i="animation-".concat(a.name);return J(r,{name:a.name,styles:"@keyframes ".concat(i,"{").concat(a.styles,"}")}),i},hydrate:function(e){e.forEach(function(e){r.inserted[e]=!0})},flush:function(){r.registered={},r.inserted={},r.sheet.flush()},sheet:r.sheet,cache:r,getRegisteredStyles:$,merge:W.bind(null,r.registered,n)}}(),ne=function(e){return function t(r,n){if("production"!==process.env.NODE_ENV&&void 0===r)throw new Error("You are trying to create a styled element with an undefined component.\nYou may have forgotten to import it.");var o,a,i;void 0!==n&&(o=n.label,i=n.target,a=r.__lights_forwardProp&&n.shouldForwardProp?function(e){return r.__lights_forwardProp(e)&&n.shouldForwardProp(e)}:n.shouldForwardProp);var s=r.__lights_real===r,u=s&&r.__lights_base||r;"function"!=typeof a&&s&&(a=r.__lights_forwardProp);var l=a||Q(u),f=!l("as");return function(){var p=arguments,d=s&&void 0!==r.__lights_styles?r.__lights_styles.slice(0):[];void 0!==o&&d.push("label:".concat(o,";"));for(var v=arguments.length,y=new Array(v),m=0;m<v;m++)y[m]=p[m];if(null==y[0]||void 0===y[0].raw)d.push.apply(d,y);else{"production"!==process.env.NODE_ENV&&void 0===y[0][0]&&console.error(k),d.push(y[0][0]);for(var g=y.length,b=1;b<g;b+=1)"production"!==process.env.NODE_ENV&&void 0===y[0][b]&&console.error(k),d.push(y[b],y[0][b])}var E=function(t){return c.createElement(Z.Consumer,null,function(r){var n=f&&t.as||u,o="",s=[],p=t;if(null==t.theme){for(var h in p={},t)p[h]=t[h];p.theme=r}"string"==typeof t.className?o=$(e.cache.registered,s,t.className):null!=t.className&&(o="".concat(t.className," "));var v=z(d.concat(s),e.cache.registered,p);B(e.cache,v),o+="".concat(e.cache.key,"-").concat(v.name),void 0!==i&&(o+=" ".concat(i));var y=f&&void 0===a?Q(n):l,m={};for(var g in t)f&&"as"===g||y(g)&&(m[g]=t[g]);return m.className=o,m.ref=t.innerRef,c.createElement(n,m)})};return E.displayName=void 0!==o?o:"Styled(".concat("string"==typeof u?u:u.displayName||u.name||"Component",")"),void 0!==r.defaultProps&&(E.defaultProps=r.defaultProps),E.__lights_styles=d,E.__lights_base=u,E.__lights_real=E,E.__lights_forwardProp=a,Object.defineProperty(E,"toString",{value:function(){return void 0===i&&"production"!==process.env.NODE_ENV?"NO_COMPONENT_SELECTOR":".".concat(i)}}),E.withComponent=function(e,r){return t(e,void 0!==r?h({},n||{},{},r):n).apply(void 0,function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(o=d)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(o)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}());var o},E}}}(re).bind();["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach(function(e){ne[e]=ne(e)});var oe=re.hydrate,ae=re.cx,ie=re.merge,se=re.getRegisteredStyles,ce=re.injectGlobal,ue=re.keyframes,le=re.css,fe=re.sheet,pe=re.cache;exports.flush=re.flush,exports.hydrate=oe,exports.cx=ae,exports.merge=ie,exports.getRegisteredStyles=se,exports.injectGlobal=ce,exports.keyframes=ue,exports.css=le,exports.sheet=fe,exports.cache=pe,exports.ThemeContext=Z,exports.ThemeProvider=function(e){return c.createElement(Z.Consumer,null,function(t){return e.theme!==t&&(t=X(t)(e.theme)),c.createElement(Z.Provider,{value:t},e.children)})},exports.useTheme=function(){return u.useContext(Z)},exports.withTheme=function(e){var t=e.displayName||e.name||"Component",r=c.forwardRef(function(t,r){return c.createElement(Z.Consumer,null,function(n){return c.createElement(e,p({theme:n,ref:r},t))})});return r.displayName="WithTheme(".concat(t,")"),s(r,e)},exports.themeFn=te,exports.styled=ne; | ||
function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=e(require("@emotion/stylis")),r=e(require("@emotion/hash")),n=e(require("@emotion/unitless")),o=e(require("@emotion/memoize")),a=e(require("@emotion/is-prop-valid")),i=e(require("@emotion/weak-memoize")),s=e(require("hoist-non-react-statics")),c=require("react"),u=e(c);function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function p(){return(p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach(function(t){f(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var v=function(){function e(t){!function(t,r){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this),this.isSpeedy=void 0===t.speedy?"production"===process.env.NODE_ENV:t.speedy,this.tags=[],this.ctr=0,this.nonce=t.nonce,this.key=t.key,this.container=t.container,this.before=null}var t;return(t=[{key:"insert",value:function(e){if(this.ctr%(this.isSpeedy?65e3:1)==0){var t=function(e){var t=document.createElement("style");return t.setAttribute("data-lights",e.key||""),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t}(this);this.container.insertBefore(t,0===this.tags.length?this.before:this.tags[this.tags.length-1].nextSibling),this.tags.push(t)}var r=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t+=1)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(r);try{var o=105===e.charCodeAt(1)&&64===e.charCodeAt(0);n.insertRule(e,o?0:n.cssRules.length)}catch(t){"production"!==process.env.NODE_ENV&&console.warn('There was a problem inserting the following rule: "'.concat(e,'"'),t)}}else r.appendChild(document.createTextNode(e));this.ctr+=1}},{key:"flush",value:function(){this.tags.forEach(function(e){return e.parentNode.removeChild(e)}),this.tags=[],this.ctr=0}}])&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(e.prototype,t),e}(),y="".concat("/*|*/","}"),m={current:null};function g(e){e&&m.current.insert("".concat(e,"}"))}var b,E=function(e,t,r,n,o,a,i,s,c,u){switch(e){default:break;case 1:switch(t.charCodeAt(0)){default:break;case 64:return m.current.insert("".concat(t,";")),"";case 108:if(98===t.charCodeAt(2))return""}break;case 2:if(0===s)return t+"/*|*/";break;case 3:switch(s){case 102:case 112:return m.current.insert(r[0]+t),"";default:return t+(0===u?"/*|*/":"")}case-2:t.split(y).forEach(g)}},w=function(e,t){if(1===e&&108===t.charCodeAt(0)&&98===t.charCodeAt(2))return""},_="undefined"!=typeof document,N=/\/\*\|\*\//g,O={},x=_?void 0:i(function(){var e=i(function(){return{}}),t={},r={};return function(n){return void 0===n||!0===n?t:!1===n?r:e(n)}}),k="You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences",j="You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).",A=/[A-Z]|^ms/g,P=/_EMO_([^_]+?)_([^]*?)_EMO_/g,S=function(e){return 45===e.charCodeAt(1)},C=function(e){return null!=e&&"boolean"!=typeof e},D=o(function(e){return S(e)?e:e.replace(A,"-$&").toLowerCase()}),V=function(e,t){switch(e){default:break;case"animation":case"animationName":if("string"==typeof t)return t.replace(P,function(e,t,r){return b={name:t,styles:r,next:b},t})}return 1===n[e]||S(e)||"number"!=typeof t||0===t?t:"".concat(t,"px")};if("production"!==process.env.NODE_ENV){var q=/(attr|calc|counters?|url)\(/,T=["normal","none","counter","open-quote","close-quote","no-open-quote","no-close-quote","initial","inherit","unset"],R=V,I=/^-ms-/,Y=/-(.)/g,L={};V=function(e,t){"content"===e&&("string"!=typeof t||-1===T.indexOf(t)&&!q.test(t)&&(t.charAt(0)!==t.charAt(t.length-1)||'"'!==t.charAt(0)&&"'"!==t.charAt(0)))&&console.error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\"".concat(t,"\"'`"));var r=R(e,t);return""===r||S(e)||-1===e.indexOf("-")||void 0!==L[e]||(L[e]=!0,console.error("Using kebab-case for css properties in objects is not supported. Did you mean ".concat(e.replace(I,"ms-").replace(Y,function(e,t){return t.toUpperCase()}),"?"))),r}}function M(e,t,r,n){if(null==r)return"";if(void 0!==r.__lights_styles){var o=r.toString();if("NO_COMPONENT_SELECTOR"===o&&"production"!==process.env.NODE_ENV)throw new Error("Component selectors can only be used in conjunction with pretty-lights/babel.");return o}switch(l(r)){case"boolean":return"";case"object":if(1===r.anim)return b={name:r.name,styles:r.styles,next:b},r.name;if(void 0!==r.styles){var a=r.next;if(void 0!==a)for(;void 0!==a;)b={name:a.name,styles:a.styles,next:b},a=a.next;var i="".concat(r.styles,";");return"production"!==process.env.NODE_ENV&&void 0!==r.map&&(i+=r.map),i}return function(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o<r.length;o+=1)n+=M(e,t,r[o],!1);else for(var a in r){var i=r[a];if("object"!==l(i))null!=t&&void 0!==t[i]?n+="".concat(a,"{").concat(t[i],"}"):C(i)&&(n+="".concat(D(a),":").concat(V(a,i),";"));else{if("NO_COMPONENT_SELECTOR"===a&&"production"!==process.env.NODE_ENV)throw new Error("Component selectors can only be used in conjunction with pretty-lights/babel.");if(!Array.isArray(i)||"string"!=typeof i[0]||null!=t&&void 0!==t[i[0]]){var s=M(e,t,i,!1);switch(a){case"animation":case"animationName":n+="".concat(D(a),":").concat(s,";");break;default:"production"!==process.env.NODE_ENV&&"undefined"===a&&console.error(j),n+="".concat(a,"{").concat(s,"}")}}else for(var c=0;c<i.length;c+=1)C(i[c])&&(n+="".concat(D(a),":").concat(V(a,i[c]),";"))}}return n}(e,t,r);case"function":if(void 0!==e){var s=b,c=r(e);return b=s,M(e,t,c,n)}"production"!==process.env.NODE_ENV&&console.error("Functions that are interpolated in css calls will be stringified.\nIf you want to have a css call based on props, create a function that returns a css call like this\nlet dynamicStyle = (props) => css`color: ${props.color}`\nIt can be called directly with props or interpolated in a styled call like this\nlet SomeComponent = styled('div')`${dynamicStyle}`");break;case"string":if("production"!==process.env.NODE_ENV){var u=[],f=r.replace(P,function(e,t,r){var n="animation".concat(u.length);return u.push("const ".concat(n," = keyframes`").concat(r.replace(/^@keyframes animation-\w+/,""),"`")),"${".concat(n,"}")});u.length&&console.error("".concat("`keyframes` output got interpolated into plain string, please wrap it with `css`.\n\nInstead of doing this:\n\n").concat([].concat(u,["`".concat(f,"`")]).join("\n"),"\n\nYou should wrap it with `css` like this:\n\ncss`").concat(f,"`"))}}if(null==t)return r;var p=t[r];return!1===n&&void 0!==p?p:r}var F,G=/label:\s*([^\s;\n{]+)\s*;/g;function z(e,t,n){if(1===e.length&&"object"===l(e[0])&&null!==e[0]&&void 0!==e[0].styles)return e[0];var o=!0,a="";b=void 0;var i,s=e[0];null==s||void 0===s.raw?(o=!1,a+=M(n,t,s,!1)):("production"!==process.env.NODE_ENV&&void 0===s[0]&&console.error(k),a+=s[0]);for(var c=1;c<e.length;c+=1)a+=M(n,t,e[c],46===a.charCodeAt(a.length-1)),o&&("production"!==process.env.NODE_ENV&&void 0===s[c]&&console.error(k),a+=s[c]);"production"!==process.env.NODE_ENV&&(a=a.replace(F,function(e){return i=e,""})),G.lastIndex=0;for(var u,f="";null!==(u=G.exec(a));)f+="-".concat(u[1]);return{name:r(a)+f,styles:a,map:i,next:b}}"production"!==process.env.NODE_ENV&&(F=/\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//);var U="undefined"!=typeof document;function $(e,t,r){var n="";return r.split(" ").forEach(function(r){void 0!==e[r]?t.push(e[r]):r&&(n+="".concat(r," "))}),n}var B=function(e,t){var r="".concat(e.key,"-").concat(t.name);if(void 0===e.registered[r]&&(e.registered[r]=t.styles),void 0===e.inserted[t.name]){var n="",o=t;do{var a=e.insert(".".concat(r),o,e.sheet,!0);U||void 0===a||(n+=a),o=o.next}while(void 0!==o);if(!U&&0!==n.length)return n}};function J(e,t){if(void 0===e.inserted[t.name])return e.insert("",t,e.sheet,!0)}function W(e,t,r){var n=[],o=$(e,n,r);return n.length<2?r:o+t(n)}var Z=u.createContext({}),H=a,K=function(e){return"theme"!==e&&"innerRef"!==e},Q=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?H:K},X=i(function(e){return i(function(t){return function(e,t){if("function"==typeof t){var r=t(e);if("production"!==process.env.NODE_ENV&&(null==r||"object"!==l(r)||Array.isArray(r)))throw new Error("[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!");return r}if("production"!==process.env.NODE_ENV&&(null==t||"object"!==l(t)||Array.isArray(t)))throw new Error("[ThemeProvider] Please make your theme prop a plain object");return h({},e,{},t)}(e,t)})});function ee(e,t,r){var n,o=t.theme&&t.theme[e];return"function"==typeof(n="function"==typeof o?o(r):r[o]?r[o]:r.none)?n(t):n}function te(e,t){return function(r){return ee(e,r,t)}}te.variants=function(e,t,r){return function(n){var o=n[t]&&r[n[t]];return o&&ee(e,n,o)}};var re=function(e){var r=function(e){void 0===e&&(e={});var r,n,o=e.key||"css";if("production"!==process.env.NODE_ENV&&/[^a-z-]/.test(o))throw new Error('Pretty Lights key must only contain lower case alphabetical characters and - but "'.concat(o,'" was passed'));void 0!==e.prefix&&(n={prefix:e.prefix});var a,i,s=new t(n),c={};if(_){a=e.container||document.head;var u="data-lights-".concat(o),l=document.querySelectorAll("style[".concat(u,"]"));Array.prototype.forEach.call(l,function(e){(e.getAttribute(u)||"").split(" ").forEach(function(e){c[e]=!0}),e.parentNode!==a&&a.appendChild(e)})}if(_)s.use(e.stylisPlugins)(E),i=function(e,t,n,o){if(m.current=n,"production"!==process.env.NODE_ENV&&void 0!==t.map){var a=t.map;m.current={insert:function(e){n.insert(e+a)}}}if(void 0===r.inserted[t.name]){var i=s(e,t.styles);o&&(r.inserted[t.name]=i.replace(N,""))}};else{s.use(w);var f=O;(e.stylisPlugins||void 0!==e.prefix)&&(s.use(e.stylisPlugins),f=x(e.stylisPlugins||O)(e.prefix)),i=function(e,t,n,o){if(void 0===r.inserted[t.name]){var a=function(e,t){var r=t.name;return void 0===f[r]&&(f[r]=s(e,t.styles)),f[r]}(e,t);if(!o)return a;r.inserted[t.name]=a}}}if("production"!==process.env.NODE_ENV){var p=/\/\*/g,d=/\*\//g;s.use(function(e,t){switch(e){default:break;case-1:for(;p.test(t);){if(d.lastIndex=p.lastIndex,!d.test(t))throw new Error('Your styles have an unterminated comment ("/*" without corresponding "*/").');p.lastIndex=d.lastIndex}p.lastIndex=0}})}return r={key:o,sheet:new v({key:o,container:a,nonce:e.nonce,speedy:e.speedy}),nonce:e.nonce,inserted:c,registered:{},insert:i}}(void 0);r.sheet.speedy=function(e){if("production"!==process.env.NODE_ENV&&0!==this.ctr)throw new Error("speedy must be changed before any rules are inserted");this.isSpeedy=e},r.compat=!0;var n=function(){for(var e=arguments,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=e[o];var a=z(n,r.registered),i="".concat(r.key,"-").concat(a.name);return B(r,a),i};return{css:n,cx:function(){for(var e=arguments,t=arguments.length,o=new Array(t),a=0;a<t;a++)o[a]=e[a];return W(r.registered,n,function e(t){for(var r="",n=0;n<t.length;n+=1){var o=t[n];if(null!=o){var a=void 0;switch(l(o)){case"boolean":break;case"object":if(Array.isArray(o))a=e(o);else for(var i in a="",o)o[i]&&i&&(a&&(a+=" "),a+=i);break;default:a=o}a&&(r&&(r+=" "),r+=a)}}return r}(o))},injectGlobal:function(){for(var e=arguments,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=e[o];var a=z(n,r.registered);J(r,a)},keyframes:function(){for(var e=arguments,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=e[o];var a=z(n,r.registered),i="animation-".concat(a.name);return J(r,{name:a.name,styles:"@keyframes ".concat(i,"{").concat(a.styles,"}")}),i},hydrate:function(e){e.forEach(function(e){r.inserted[e]=!0})},flush:function(){r.registered={},r.inserted={},r.sheet.flush()},sheet:r.sheet,cache:r,getRegisteredStyles:$,merge:W.bind(null,r.registered,n)}}(),ne=function(e){return function t(r,n){if("production"!==process.env.NODE_ENV&&void 0===r)throw new Error("You are trying to create a styled element with an undefined component.\nYou may have forgotten to import it.");var o,a,i;void 0!==n&&(o=n.label,i=n.target,a=r.__lights_forwardProp&&n.shouldForwardProp?function(e){return r.__lights_forwardProp(e)&&n.shouldForwardProp(e)}:n.shouldForwardProp);var s=r.__lights_real===r,u=s&&r.__lights_base||r;"function"!=typeof a&&s&&(a=r.__lights_forwardProp);var l=a||Q(u),f=!l("as");return function(){var p=arguments,d=s&&void 0!==r.__lights_styles?r.__lights_styles.slice(0):[];void 0!==o&&d.push("label:".concat(o,";"));for(var v=arguments.length,y=new Array(v),m=0;m<v;m++)y[m]=p[m];if(null==y[0]||void 0===y[0].raw)d.push.apply(d,y);else{"production"!==process.env.NODE_ENV&&void 0===y[0][0]&&console.error(k),d.push(y[0][0]);for(var g=y.length,b=1;b<g;b+=1)"production"!==process.env.NODE_ENV&&void 0===y[0][b]&&console.error(k),d.push(y[b],y[0][b])}var E=function(t){return c.createElement(Z.Consumer,null,function(r){var n=f&&t.as||u,o="",s=[],p=t;if(null==t.theme){for(var h in p={},t)p[h]=t[h];p.theme=r}"string"==typeof t.className?o=$(e.cache.registered,s,t.className):null!=t.className&&(o="".concat(t.className," "));var v=z(d.concat(s),e.cache.registered,p);B(e.cache,v),o+="".concat(e.cache.key,"-").concat(v.name),void 0!==i&&(o+=" ".concat(i));var y=f&&void 0===a?Q(n):l,m={};for(var g in t)f&&"as"===g||y(g)&&(m[g]=t[g]);return m.className=o,m.ref=t.innerRef,c.createElement(n,m)})};return E.displayName=void 0!==o?o:"Styled(".concat("string"==typeof u?u:u.displayName||u.name||"Component",")"),void 0!==r.defaultProps&&(E.defaultProps=r.defaultProps),E.__lights_styles=d,E.__lights_base=u,E.__lights_real=E,E.__lights_forwardProp=a,Object.defineProperty(E,"toString",{value:function(){return void 0===i&&"production"!==process.env.NODE_ENV?"NO_COMPONENT_SELECTOR":".".concat(i)}}),E.withComponent=function(e,r){return t(e,void 0!==r?h({},n||{},{},r):n).apply(void 0,function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(o=d)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(o)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}());var o},E}}}(re).bind();["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach(function(e){ne[e]=ne(e)});var oe=re.hydrate,ae=re.cx,ie=re.merge,se=re.getRegisteredStyles,ce=re.injectGlobal,ue=re.keyframes,le=re.css,fe=re.sheet,pe=re.cache;exports.flush=re.flush,exports.hydrate=oe,exports.cx=ae,exports.merge=ie,exports.getRegisteredStyles=se,exports.injectGlobal=ce,exports.keyframes=ue,exports.css=le,exports.sheet=fe,exports.cache=pe,exports.ThemeContext=Z,exports.ThemeProvider=function(e){return c.createElement(Z.Consumer,null,function(t){return e.theme!==t&&(t=X(t)(e.theme)),c.createElement(Z.Provider,{value:t},e.children)})},exports.useTheme=function(){return u.useContext(Z)},exports.withTheme=function(e){var t=e.displayName||e.name||"Component",r=c.forwardRef(function(t,r){return c.createElement(Z.Consumer,null,function(n){return c.createElement(e,p({theme:n,ref:r},t))})});return r.displayName="WithTheme(".concat(t,")"),s(r,e)},exports.themeFn=te,exports.styled=ne; | ||
//# sourceMappingURL=pretty-lights.js.map |
@@ -1,2 +0,2 @@ | ||
import e from"@emotion/stylis";import t from"@emotion/hash";import n from"@emotion/unitless";import r from"@emotion/memoize";import o from"@emotion/is-prop-valid";import i from"@emotion/weak-memoize";import a from"hoist-non-react-statics";import s,{createElement as c,forwardRef as u}from"react";function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(){return(p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach(function(t){f(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var v=function(){function e(t){!function(t,n){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this),this.isSpeedy=void 0===t.speedy?"production"===process.env.NODE_ENV:t.speedy,this.tags=[],this.ctr=0,this.nonce=t.nonce,this.key=t.key,this.container=t.container,this.before=null}var t;return(t=[{key:"insert",value:function(e){if(this.ctr%(this.isSpeedy?65e3:1)==0){var t=function(e){var t=document.createElement("style");return t.setAttribute("data-lights",e.key||""),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t}(this);this.container.insertBefore(t,0===this.tags.length?this.before:this.tags[this.tags.length-1].nextSibling),this.tags.push(t)}var n=this.tags[this.tags.length-1];if(this.isSpeedy){var r=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t+=1)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(n);try{var o=105===e.charCodeAt(1)&&64===e.charCodeAt(0);r.insertRule(e,o?0:r.cssRules.length)}catch(t){"production"!==process.env.NODE_ENV&&console.warn('There was a problem inserting the following rule: "'.concat(e,'"'),t)}}else n.appendChild(document.createTextNode(e));this.ctr+=1}},{key:"flush",value:function(){this.tags.forEach(function(e){return e.parentNode.removeChild(e)}),this.tags=[],this.ctr=0}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}(),m="".concat("/*|*/","}"),y={current:null};function g(e){e&&y.current.insert("".concat(e,"}"))}var b,w=function(e,t,n,r,o,i,a,s,c,u){switch(e){default:break;case 1:switch(t.charCodeAt(0)){default:break;case 64:return y.current.insert("".concat(t,";")),"";case 108:if(98===t.charCodeAt(2))return""}break;case 2:if(0===s)return t+"/*|*/";break;case 3:switch(s){case 102:case 112:return y.current.insert(n[0]+t),"";default:return t+(0===u?"/*|*/":"")}case-2:t.split(m).forEach(g)}},E=function(e,t){if(1===e&&108===t.charCodeAt(0)&&98===t.charCodeAt(2))return""},_="undefined"!=typeof document,N=/\/\*\|\*\//g,O={},k=_?void 0:i(function(){var e=i(function(){return{}}),t={},n={};return function(r){return void 0===r||!0===r?t:!1===r?n:e(r)}}),A="You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences",j="You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).",S=/[A-Z]|^ms/g,P=/_EMO_([^_]+?)_([^]*?)_EMO_/g,x=function(e){return 45===e.charCodeAt(1)},C=function(e){return null!=e&&"boolean"!=typeof e},D=r(function(e){return x(e)?e:e.replace(S,"-$&").toLowerCase()}),V=function(e,t){switch(e){default:break;case"animation":case"animationName":if("string"==typeof t)return t.replace(P,function(e,t,n){return b={name:t,styles:n,next:b},t})}return 1===n[e]||x(e)||"number"!=typeof t||0===t?t:"".concat(t,"px")};if("production"!==process.env.NODE_ENV){var T=/(attr|calc|counters?|url)\(/,R=["normal","none","counter","open-quote","close-quote","no-open-quote","no-close-quote","initial","inherit","unset"],q=V,I=/^-ms-/,Y=/-(.)/g,L={};V=function(e,t){"content"===e&&("string"!=typeof t||-1===R.indexOf(t)&&!T.test(t)&&(t.charAt(0)!==t.charAt(t.length-1)||'"'!==t.charAt(0)&&"'"!==t.charAt(0)))&&console.error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\"".concat(t,"\"'`"));var n=q(e,t);return""===n||x(e)||-1===e.indexOf("-")||void 0!==L[e]||(L[e]=!0,console.error("Using kebab-case for css properties in objects is not supported. Did you mean ".concat(e.replace(I,"ms-").replace(Y,function(e,t){return t.toUpperCase()}),"?"))),n}}function M(e,t,n,r){if(null==n)return"";if(void 0!==n.__lights_styles){var o=n.toString();if("NO_COMPONENT_SELECTOR"===o&&"production"!==process.env.NODE_ENV)throw new Error("Component selectors can only be used in conjunction with pretty-lights/babel.");return o}switch(l(n)){case"boolean":return"";case"object":if(1===n.anim)return b={name:n.name,styles:n.styles,next:b},n.name;if(void 0!==n.styles){var i=n.next;if(void 0!==i)for(;void 0!==i;)b={name:i.name,styles:i.styles,next:b},i=i.next;var a="".concat(n.styles,";");return"production"!==process.env.NODE_ENV&&void 0!==n.map&&(a+=n.map),a}return function(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o<n.length;o+=1)r+=M(e,t,n[o],!1);else for(var i in n){var a=n[i];if("object"!==l(a))null!=t&&void 0!==t[a]?r+="".concat(i,"{").concat(t[a],"}"):C(a)&&(r+="".concat(D(i),":").concat(V(i,a),";"));else{if("NO_COMPONENT_SELECTOR"===i&&"production"!==process.env.NODE_ENV)throw new Error("Component selectors can only be used in conjunction with pretty-lights/babel.");if(!Array.isArray(a)||"string"!=typeof a[0]||null!=t&&void 0!==t[a[0]]){var s=M(e,t,a,!1);switch(i){case"animation":case"animationName":r+="".concat(D(i),":").concat(s,";");break;default:"production"!==process.env.NODE_ENV&&"undefined"===i&&console.error(j),r+="".concat(i,"{").concat(s,"}")}}else for(var c=0;c<a.length;c+=1)C(a[c])&&(r+="".concat(D(i),":").concat(V(i,a[c]),";"))}}return r}(e,t,n);case"function":if(void 0!==e){var s=b,c=n(e);return b=s,M(e,t,c,r)}"production"!==process.env.NODE_ENV&&console.error("Functions that are interpolated in css calls will be stringified.\nIf you want to have a css call based on props, create a function that returns a css call like this\nlet dynamicStyle = (props) => css`color: ${props.color}`\nIt can be called directly with props or interpolated in a styled call like this\nlet SomeComponent = styled('div')`${dynamicStyle}`");break;case"string":if("production"!==process.env.NODE_ENV){var u=[],f=n.replace(P,function(e,t,n){var r="animation".concat(u.length);return u.push("const ".concat(r," = keyframes`").concat(n.replace(/^@keyframes animation-\w+/,""),"`")),"${".concat(r,"}")});u.length&&console.error("".concat("`keyframes` output got interpolated into plain string, please wrap it with `css`.\n\nInstead of doing this:\n\n").concat([].concat(u,["`".concat(f,"`")]).join("\n"),"\n\nYou should wrap it with `css` like this:\n\ncss`").concat(f,"`"))}}if(null==t)return n;var p=t[n];return!1===r&&void 0!==p?p:n}var F,z=/label:\s*([^\s;\n{]+)\s*;/g;function G(e,n,r){if(1===e.length&&"object"===l(e[0])&&null!==e[0]&&void 0!==e[0].styles)return e[0];var o=!0,i="";b=void 0;var a,s=e[0];null==s||void 0===s.raw?(o=!1,i+=M(r,n,s,!1)):("production"!==process.env.NODE_ENV&&void 0===s[0]&&console.error(A),i+=s[0]);for(var c=1;c<e.length;c+=1)i+=M(r,n,e[c],46===i.charCodeAt(i.length-1)),o&&("production"!==process.env.NODE_ENV&&void 0===s[c]&&console.error(A),i+=s[c]);"production"!==process.env.NODE_ENV&&(i=i.replace(F,function(e){return a=e,""})),z.lastIndex=0;for(var u,f="";null!==(u=z.exec(i));)f+="-".concat(u[1]);return{name:t(i)+f,styles:i,map:a,next:b}}"production"!==process.env.NODE_ENV&&(F=/\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//);var U="undefined"!=typeof document;function $(e,t,n){var r="";return n.split(" ").forEach(function(n){void 0!==e[n]?t.push(e[n]):r+="".concat(n," ")}),r}var B=function(e,t){var n="".concat(e.key,"-").concat(t.name);if(void 0===e.registered[n]&&(e.registered[n]=t.styles),void 0===e.inserted[t.name]){var r="",o=t;do{var i=e.insert(".".concat(n),o,e.sheet,!0);U||void 0===i||(r+=i),o=o.next}while(void 0!==o);if(!U&&0!==r.length)return r}};function J(e,t){if(void 0===e.inserted[t.name])return e.insert("",t,e.sheet,!0)}function W(e,t,n){var r=[],o=$(e,r,n);return r.length<2?n:o+t(r)}var Z=s.createContext({}),H=o,K=function(e){return"theme"!==e&&"innerRef"!==e},Q=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?H:K},X=i(function(e){return i(function(t){return function(e,t){if("function"==typeof t){var n=t(e);if("production"!==process.env.NODE_ENV&&(null==n||"object"!==l(n)||Array.isArray(n)))throw new Error("[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!");return n}if("production"!==process.env.NODE_ENV&&(null==t||"object"!==l(t)||Array.isArray(t)))throw new Error("[ThemeProvider] Please make your theme prop a plain object");return h({},e,{},t)}(e,t)})}),ee=function(e){return c(Z.Consumer,null,function(t){return e.theme!==t&&(t=X(t)(e.theme)),c(Z.Provider,{value:t},e.children)})};function te(e){var t=e.displayName||e.name||"Component",n=u(function(t,n){return c(Z.Consumer,null,function(r){return c(e,p({theme:r,ref:n},t))})});return n.displayName="WithTheme(".concat(t,")"),a(n,e)}function ne(){return s.useContext(Z)}function re(e,t,n){var r,o=t.theme&&t.theme[e];return"function"==typeof(r="function"==typeof o?o(n):n[o]?n[o]:n.none)?r(t):r}function oe(e,t){return function(n){return re(e,n,t)}}oe.variants=function(e,t,n){return function(r){var o=r[t]&&n[r[t]];return o&&re(e,r,o)}};var ie=function(t){var n=function(t){void 0===t&&(t={});var n,r,o=t.key||"css";if("production"!==process.env.NODE_ENV&&/[^a-z-]/.test(o))throw new Error('Pretty Lights key must only contain lower case alphabetical characters and - but "'.concat(o,'" was passed'));void 0!==t.prefix&&(r={prefix:t.prefix});var i,a,s=new e(r),c={};if(_){i=t.container||document.head;var u="data-lights-".concat(o),l=document.querySelectorAll("style[".concat(u,"]"));Array.prototype.forEach.call(l,function(e){(e.getAttribute(u)||"").split(" ").forEach(function(e){c[e]=!0}),e.parentNode!==i&&i.appendChild(e)})}if(_)s.use(t.stylisPlugins)(w),a=function(e,t,r,o){if(y.current=r,"production"!==process.env.NODE_ENV&&void 0!==t.map){var i=t.map;y.current={insert:function(e){r.insert(e+i)}}}if(void 0===n.inserted[t.name]){var a=s(e,t.styles);o&&(n.inserted[t.name]=a.replace(N,""))}};else{s.use(E);var f=O;(t.stylisPlugins||void 0!==t.prefix)&&(s.use(t.stylisPlugins),f=k(t.stylisPlugins||O)(t.prefix)),a=function(e,t,r,o){if(void 0===n.inserted[t.name]){var i=function(e,t){var n=t.name;return void 0===f[n]&&(f[n]=s(e,t.styles)),f[n]}(e,t);if(!o)return i;n.inserted[t.name]=i}}}if("production"!==process.env.NODE_ENV){var p=/\/\*/g,d=/\*\//g;s.use(function(e,t){switch(e){default:break;case-1:for(;p.test(t);){if(d.lastIndex=p.lastIndex,!d.test(t))throw new Error('Your styles have an unterminated comment ("/*" without corresponding "*/").');p.lastIndex=d.lastIndex}p.lastIndex=0}})}return n={key:o,sheet:new v({key:o,container:i,nonce:t.nonce,speedy:t.speedy}),nonce:t.nonce,inserted:c,registered:{},insert:a}}(void 0);n.sheet.speedy=function(e){if("production"!==process.env.NODE_ENV&&0!==this.ctr)throw new Error("speedy must be changed before any rules are inserted");this.isSpeedy=e},n.compat=!0;var r=function(){for(var e=arguments,t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=e[o];var i=G(r,n.registered),a="".concat(n.key,"-").concat(i.name);return B(n,i),a};return{css:r,cx:function(){for(var e=arguments,t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=e[i];return W(n.registered,r,function e(t){for(var n="",r=0;r<t.length;r+=1){var o=t[r];if(null!=o){var i=void 0;switch(l(o)){case"boolean":break;case"object":if(Array.isArray(o))i=e(o);else for(var a in i="",o)o[a]&&a&&(i&&(i+=" "),i+=a);break;default:i=o}i&&(n&&(n+=" "),n+=i)}}return n}(o))},injectGlobal:function(){for(var e=arguments,t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=e[o];var i=G(r,n.registered);J(n,i)},keyframes:function(){for(var e=arguments,t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=e[o];var i=G(r,n.registered),a="animation-".concat(i.name);return J(n,{name:i.name,styles:"@keyframes ".concat(a,"{").concat(i.styles,"}")}),a},hydrate:function(e){e.forEach(function(e){n.inserted[e]=!0})},flush:function(){n.registered={},n.inserted={},n.sheet.flush()},sheet:n.sheet,cache:n,getRegisteredStyles:$,merge:W.bind(null,n.registered,r)}}(),ae=function(e){return function t(n,r){if("production"!==process.env.NODE_ENV&&void 0===n)throw new Error("You are trying to create a styled element with an undefined component.\nYou may have forgotten to import it.");var o,i,a;void 0!==r&&(o=r.label,a=r.target,i=n.__lights_forwardProp&&r.shouldForwardProp?function(e){return n.__lights_forwardProp(e)&&r.shouldForwardProp(e)}:r.shouldForwardProp);var s=n.__lights_real===n,u=s&&n.__lights_base||n;"function"!=typeof i&&s&&(i=n.__lights_forwardProp);var l=i||Q(u),f=!l("as");return function(){var p=arguments,d=s&&void 0!==n.__lights_styles?n.__lights_styles.slice(0):[];void 0!==o&&d.push("label:".concat(o,";"));for(var v=arguments.length,m=new Array(v),y=0;y<v;y++)m[y]=p[y];if(null==m[0]||void 0===m[0].raw)d.push.apply(d,m);else{"production"!==process.env.NODE_ENV&&void 0===m[0][0]&&console.error(A),d.push(m[0][0]);for(var g=m.length,b=1;b<g;b+=1)"production"!==process.env.NODE_ENV&&void 0===m[0][b]&&console.error(A),d.push(m[b],m[0][b])}var w=function(t){return c(Z.Consumer,null,function(n){var r=f&&t.as||u,o="",s=[],p=t;if(null==t.theme){for(var h in p={},t)p[h]=t[h];p.theme=n}"string"==typeof t.className?o=$(e.cache.registered,s,t.className):null!=t.className&&(o="".concat(t.className," "));var v=G(d.concat(s),e.cache.registered,p);B(e.cache,v),o+="".concat(e.cache.key,"-").concat(v.name),void 0!==a&&(o+=" ".concat(a));var m=f&&void 0===i?Q(r):l,y={};for(var g in t)f&&"as"===g||m(g)&&(y[g]=t[g]);return y.className=o,y.ref=t.innerRef,c(r,y)})};return w.displayName=void 0!==o?o:"Styled(".concat("string"==typeof u?u:u.displayName||u.name||"Component",")"),void 0!==n.defaultProps&&(w.defaultProps=n.defaultProps),w.__lights_styles=d,w.__lights_base=u,w.__lights_real=w,w.__lights_forwardProp=i,Object.defineProperty(w,"toString",{value:function(){return void 0===a&&"production"!==process.env.NODE_ENV?"NO_COMPONENT_SELECTOR":".".concat(a)}}),w.withComponent=function(e,n){return t(e,void 0!==n?h({},r||{},{},n):r).apply(void 0,function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(o=d)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(o)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}());var o},w}}}(ie).bind();["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach(function(e){ae[e]=ae(e)});var se=ie.flush,ce=ie.hydrate,ue=ie.cx,le=ie.merge,fe=ie.getRegisteredStyles,pe=ie.injectGlobal,de=ie.keyframes,he=ie.css,ve=ie.sheet,me=ie.cache;export{se as flush,ce as hydrate,ue as cx,le as merge,fe as getRegisteredStyles,pe as injectGlobal,de as keyframes,he as css,ve as sheet,me as cache,Z as ThemeContext,ee as ThemeProvider,ne as useTheme,te as withTheme,oe as themeFn,ae as styled}; | ||
import e from"@emotion/stylis";import t from"@emotion/hash";import n from"@emotion/unitless";import r from"@emotion/memoize";import o from"@emotion/is-prop-valid";import i from"@emotion/weak-memoize";import a from"hoist-non-react-statics";import s,{createElement as c,forwardRef as u}from"react";function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(){return(p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach(function(t){f(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var v=function(){function e(t){!function(t,n){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this),this.isSpeedy=void 0===t.speedy?"production"===process.env.NODE_ENV:t.speedy,this.tags=[],this.ctr=0,this.nonce=t.nonce,this.key=t.key,this.container=t.container,this.before=null}var t;return(t=[{key:"insert",value:function(e){if(this.ctr%(this.isSpeedy?65e3:1)==0){var t=function(e){var t=document.createElement("style");return t.setAttribute("data-lights",e.key||""),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t}(this);this.container.insertBefore(t,0===this.tags.length?this.before:this.tags[this.tags.length-1].nextSibling),this.tags.push(t)}var n=this.tags[this.tags.length-1];if(this.isSpeedy){var r=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t+=1)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(n);try{var o=105===e.charCodeAt(1)&&64===e.charCodeAt(0);r.insertRule(e,o?0:r.cssRules.length)}catch(t){"production"!==process.env.NODE_ENV&&console.warn('There was a problem inserting the following rule: "'.concat(e,'"'),t)}}else n.appendChild(document.createTextNode(e));this.ctr+=1}},{key:"flush",value:function(){this.tags.forEach(function(e){return e.parentNode.removeChild(e)}),this.tags=[],this.ctr=0}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}(),m="".concat("/*|*/","}"),y={current:null};function g(e){e&&y.current.insert("".concat(e,"}"))}var b,w=function(e,t,n,r,o,i,a,s,c,u){switch(e){default:break;case 1:switch(t.charCodeAt(0)){default:break;case 64:return y.current.insert("".concat(t,";")),"";case 108:if(98===t.charCodeAt(2))return""}break;case 2:if(0===s)return t+"/*|*/";break;case 3:switch(s){case 102:case 112:return y.current.insert(n[0]+t),"";default:return t+(0===u?"/*|*/":"")}case-2:t.split(m).forEach(g)}},E=function(e,t){if(1===e&&108===t.charCodeAt(0)&&98===t.charCodeAt(2))return""},_="undefined"!=typeof document,N=/\/\*\|\*\//g,O={},k=_?void 0:i(function(){var e=i(function(){return{}}),t={},n={};return function(r){return void 0===r||!0===r?t:!1===r?n:e(r)}}),A="You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences",j="You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).",S=/[A-Z]|^ms/g,P=/_EMO_([^_]+?)_([^]*?)_EMO_/g,x=function(e){return 45===e.charCodeAt(1)},C=function(e){return null!=e&&"boolean"!=typeof e},D=r(function(e){return x(e)?e:e.replace(S,"-$&").toLowerCase()}),V=function(e,t){switch(e){default:break;case"animation":case"animationName":if("string"==typeof t)return t.replace(P,function(e,t,n){return b={name:t,styles:n,next:b},t})}return 1===n[e]||x(e)||"number"!=typeof t||0===t?t:"".concat(t,"px")};if("production"!==process.env.NODE_ENV){var T=/(attr|calc|counters?|url)\(/,R=["normal","none","counter","open-quote","close-quote","no-open-quote","no-close-quote","initial","inherit","unset"],q=V,I=/^-ms-/,Y=/-(.)/g,L={};V=function(e,t){"content"===e&&("string"!=typeof t||-1===R.indexOf(t)&&!T.test(t)&&(t.charAt(0)!==t.charAt(t.length-1)||'"'!==t.charAt(0)&&"'"!==t.charAt(0)))&&console.error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\"".concat(t,"\"'`"));var n=q(e,t);return""===n||x(e)||-1===e.indexOf("-")||void 0!==L[e]||(L[e]=!0,console.error("Using kebab-case for css properties in objects is not supported. Did you mean ".concat(e.replace(I,"ms-").replace(Y,function(e,t){return t.toUpperCase()}),"?"))),n}}function M(e,t,n,r){if(null==n)return"";if(void 0!==n.__lights_styles){var o=n.toString();if("NO_COMPONENT_SELECTOR"===o&&"production"!==process.env.NODE_ENV)throw new Error("Component selectors can only be used in conjunction with pretty-lights/babel.");return o}switch(l(n)){case"boolean":return"";case"object":if(1===n.anim)return b={name:n.name,styles:n.styles,next:b},n.name;if(void 0!==n.styles){var i=n.next;if(void 0!==i)for(;void 0!==i;)b={name:i.name,styles:i.styles,next:b},i=i.next;var a="".concat(n.styles,";");return"production"!==process.env.NODE_ENV&&void 0!==n.map&&(a+=n.map),a}return function(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o<n.length;o+=1)r+=M(e,t,n[o],!1);else for(var i in n){var a=n[i];if("object"!==l(a))null!=t&&void 0!==t[a]?r+="".concat(i,"{").concat(t[a],"}"):C(a)&&(r+="".concat(D(i),":").concat(V(i,a),";"));else{if("NO_COMPONENT_SELECTOR"===i&&"production"!==process.env.NODE_ENV)throw new Error("Component selectors can only be used in conjunction with pretty-lights/babel.");if(!Array.isArray(a)||"string"!=typeof a[0]||null!=t&&void 0!==t[a[0]]){var s=M(e,t,a,!1);switch(i){case"animation":case"animationName":r+="".concat(D(i),":").concat(s,";");break;default:"production"!==process.env.NODE_ENV&&"undefined"===i&&console.error(j),r+="".concat(i,"{").concat(s,"}")}}else for(var c=0;c<a.length;c+=1)C(a[c])&&(r+="".concat(D(i),":").concat(V(i,a[c]),";"))}}return r}(e,t,n);case"function":if(void 0!==e){var s=b,c=n(e);return b=s,M(e,t,c,r)}"production"!==process.env.NODE_ENV&&console.error("Functions that are interpolated in css calls will be stringified.\nIf you want to have a css call based on props, create a function that returns a css call like this\nlet dynamicStyle = (props) => css`color: ${props.color}`\nIt can be called directly with props or interpolated in a styled call like this\nlet SomeComponent = styled('div')`${dynamicStyle}`");break;case"string":if("production"!==process.env.NODE_ENV){var u=[],f=n.replace(P,function(e,t,n){var r="animation".concat(u.length);return u.push("const ".concat(r," = keyframes`").concat(n.replace(/^@keyframes animation-\w+/,""),"`")),"${".concat(r,"}")});u.length&&console.error("".concat("`keyframes` output got interpolated into plain string, please wrap it with `css`.\n\nInstead of doing this:\n\n").concat([].concat(u,["`".concat(f,"`")]).join("\n"),"\n\nYou should wrap it with `css` like this:\n\ncss`").concat(f,"`"))}}if(null==t)return n;var p=t[n];return!1===r&&void 0!==p?p:n}var F,z=/label:\s*([^\s;\n{]+)\s*;/g;function G(e,n,r){if(1===e.length&&"object"===l(e[0])&&null!==e[0]&&void 0!==e[0].styles)return e[0];var o=!0,i="";b=void 0;var a,s=e[0];null==s||void 0===s.raw?(o=!1,i+=M(r,n,s,!1)):("production"!==process.env.NODE_ENV&&void 0===s[0]&&console.error(A),i+=s[0]);for(var c=1;c<e.length;c+=1)i+=M(r,n,e[c],46===i.charCodeAt(i.length-1)),o&&("production"!==process.env.NODE_ENV&&void 0===s[c]&&console.error(A),i+=s[c]);"production"!==process.env.NODE_ENV&&(i=i.replace(F,function(e){return a=e,""})),z.lastIndex=0;for(var u,f="";null!==(u=z.exec(i));)f+="-".concat(u[1]);return{name:t(i)+f,styles:i,map:a,next:b}}"production"!==process.env.NODE_ENV&&(F=/\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//);var U="undefined"!=typeof document;function $(e,t,n){var r="";return n.split(" ").forEach(function(n){void 0!==e[n]?t.push(e[n]):n&&(r+="".concat(n," "))}),r}var B=function(e,t){var n="".concat(e.key,"-").concat(t.name);if(void 0===e.registered[n]&&(e.registered[n]=t.styles),void 0===e.inserted[t.name]){var r="",o=t;do{var i=e.insert(".".concat(n),o,e.sheet,!0);U||void 0===i||(r+=i),o=o.next}while(void 0!==o);if(!U&&0!==r.length)return r}};function J(e,t){if(void 0===e.inserted[t.name])return e.insert("",t,e.sheet,!0)}function W(e,t,n){var r=[],o=$(e,r,n);return r.length<2?n:o+t(r)}var Z=s.createContext({}),H=o,K=function(e){return"theme"!==e&&"innerRef"!==e},Q=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?H:K},X=i(function(e){return i(function(t){return function(e,t){if("function"==typeof t){var n=t(e);if("production"!==process.env.NODE_ENV&&(null==n||"object"!==l(n)||Array.isArray(n)))throw new Error("[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!");return n}if("production"!==process.env.NODE_ENV&&(null==t||"object"!==l(t)||Array.isArray(t)))throw new Error("[ThemeProvider] Please make your theme prop a plain object");return h({},e,{},t)}(e,t)})}),ee=function(e){return c(Z.Consumer,null,function(t){return e.theme!==t&&(t=X(t)(e.theme)),c(Z.Provider,{value:t},e.children)})};function te(e){var t=e.displayName||e.name||"Component",n=u(function(t,n){return c(Z.Consumer,null,function(r){return c(e,p({theme:r,ref:n},t))})});return n.displayName="WithTheme(".concat(t,")"),a(n,e)}function ne(){return s.useContext(Z)}function re(e,t,n){var r,o=t.theme&&t.theme[e];return"function"==typeof(r="function"==typeof o?o(n):n[o]?n[o]:n.none)?r(t):r}function oe(e,t){return function(n){return re(e,n,t)}}oe.variants=function(e,t,n){return function(r){var o=r[t]&&n[r[t]];return o&&re(e,r,o)}};var ie=function(t){var n=function(t){void 0===t&&(t={});var n,r,o=t.key||"css";if("production"!==process.env.NODE_ENV&&/[^a-z-]/.test(o))throw new Error('Pretty Lights key must only contain lower case alphabetical characters and - but "'.concat(o,'" was passed'));void 0!==t.prefix&&(r={prefix:t.prefix});var i,a,s=new e(r),c={};if(_){i=t.container||document.head;var u="data-lights-".concat(o),l=document.querySelectorAll("style[".concat(u,"]"));Array.prototype.forEach.call(l,function(e){(e.getAttribute(u)||"").split(" ").forEach(function(e){c[e]=!0}),e.parentNode!==i&&i.appendChild(e)})}if(_)s.use(t.stylisPlugins)(w),a=function(e,t,r,o){if(y.current=r,"production"!==process.env.NODE_ENV&&void 0!==t.map){var i=t.map;y.current={insert:function(e){r.insert(e+i)}}}if(void 0===n.inserted[t.name]){var a=s(e,t.styles);o&&(n.inserted[t.name]=a.replace(N,""))}};else{s.use(E);var f=O;(t.stylisPlugins||void 0!==t.prefix)&&(s.use(t.stylisPlugins),f=k(t.stylisPlugins||O)(t.prefix)),a=function(e,t,r,o){if(void 0===n.inserted[t.name]){var i=function(e,t){var n=t.name;return void 0===f[n]&&(f[n]=s(e,t.styles)),f[n]}(e,t);if(!o)return i;n.inserted[t.name]=i}}}if("production"!==process.env.NODE_ENV){var p=/\/\*/g,d=/\*\//g;s.use(function(e,t){switch(e){default:break;case-1:for(;p.test(t);){if(d.lastIndex=p.lastIndex,!d.test(t))throw new Error('Your styles have an unterminated comment ("/*" without corresponding "*/").');p.lastIndex=d.lastIndex}p.lastIndex=0}})}return n={key:o,sheet:new v({key:o,container:i,nonce:t.nonce,speedy:t.speedy}),nonce:t.nonce,inserted:c,registered:{},insert:a}}(void 0);n.sheet.speedy=function(e){if("production"!==process.env.NODE_ENV&&0!==this.ctr)throw new Error("speedy must be changed before any rules are inserted");this.isSpeedy=e},n.compat=!0;var r=function(){for(var e=arguments,t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=e[o];var i=G(r,n.registered),a="".concat(n.key,"-").concat(i.name);return B(n,i),a};return{css:r,cx:function(){for(var e=arguments,t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=e[i];return W(n.registered,r,function e(t){for(var n="",r=0;r<t.length;r+=1){var o=t[r];if(null!=o){var i=void 0;switch(l(o)){case"boolean":break;case"object":if(Array.isArray(o))i=e(o);else for(var a in i="",o)o[a]&&a&&(i&&(i+=" "),i+=a);break;default:i=o}i&&(n&&(n+=" "),n+=i)}}return n}(o))},injectGlobal:function(){for(var e=arguments,t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=e[o];var i=G(r,n.registered);J(n,i)},keyframes:function(){for(var e=arguments,t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=e[o];var i=G(r,n.registered),a="animation-".concat(i.name);return J(n,{name:i.name,styles:"@keyframes ".concat(a,"{").concat(i.styles,"}")}),a},hydrate:function(e){e.forEach(function(e){n.inserted[e]=!0})},flush:function(){n.registered={},n.inserted={},n.sheet.flush()},sheet:n.sheet,cache:n,getRegisteredStyles:$,merge:W.bind(null,n.registered,r)}}(),ae=function(e){return function t(n,r){if("production"!==process.env.NODE_ENV&&void 0===n)throw new Error("You are trying to create a styled element with an undefined component.\nYou may have forgotten to import it.");var o,i,a;void 0!==r&&(o=r.label,a=r.target,i=n.__lights_forwardProp&&r.shouldForwardProp?function(e){return n.__lights_forwardProp(e)&&r.shouldForwardProp(e)}:r.shouldForwardProp);var s=n.__lights_real===n,u=s&&n.__lights_base||n;"function"!=typeof i&&s&&(i=n.__lights_forwardProp);var l=i||Q(u),f=!l("as");return function(){var p=arguments,d=s&&void 0!==n.__lights_styles?n.__lights_styles.slice(0):[];void 0!==o&&d.push("label:".concat(o,";"));for(var v=arguments.length,m=new Array(v),y=0;y<v;y++)m[y]=p[y];if(null==m[0]||void 0===m[0].raw)d.push.apply(d,m);else{"production"!==process.env.NODE_ENV&&void 0===m[0][0]&&console.error(A),d.push(m[0][0]);for(var g=m.length,b=1;b<g;b+=1)"production"!==process.env.NODE_ENV&&void 0===m[0][b]&&console.error(A),d.push(m[b],m[0][b])}var w=function(t){return c(Z.Consumer,null,function(n){var r=f&&t.as||u,o="",s=[],p=t;if(null==t.theme){for(var h in p={},t)p[h]=t[h];p.theme=n}"string"==typeof t.className?o=$(e.cache.registered,s,t.className):null!=t.className&&(o="".concat(t.className," "));var v=G(d.concat(s),e.cache.registered,p);B(e.cache,v),o+="".concat(e.cache.key,"-").concat(v.name),void 0!==a&&(o+=" ".concat(a));var m=f&&void 0===i?Q(r):l,y={};for(var g in t)f&&"as"===g||m(g)&&(y[g]=t[g]);return y.className=o,y.ref=t.innerRef,c(r,y)})};return w.displayName=void 0!==o?o:"Styled(".concat("string"==typeof u?u:u.displayName||u.name||"Component",")"),void 0!==n.defaultProps&&(w.defaultProps=n.defaultProps),w.__lights_styles=d,w.__lights_base=u,w.__lights_real=w,w.__lights_forwardProp=i,Object.defineProperty(w,"toString",{value:function(){return void 0===a&&"production"!==process.env.NODE_ENV?"NO_COMPONENT_SELECTOR":".".concat(a)}}),w.withComponent=function(e,n){return t(e,void 0!==n?h({},r||{},{},n):r).apply(void 0,function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(o=d)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(o)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}());var o},w}}}(ie).bind();["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach(function(e){ae[e]=ae(e)});var se=ie.flush,ce=ie.hydrate,ue=ie.cx,le=ie.merge,fe=ie.getRegisteredStyles,pe=ie.injectGlobal,de=ie.keyframes,he=ie.css,ve=ie.sheet,me=ie.cache;export{se as flush,ce as hydrate,ue as cx,le as merge,fe as getRegisteredStyles,pe as injectGlobal,de as keyframes,he as css,ve as sheet,me as cache,Z as ThemeContext,ee as ThemeProvider,ne as useTheme,te as withTheme,oe as themeFn,ae as styled}; | ||
//# sourceMappingURL=pretty-lights.modern.js.map |
{ | ||
"name": "pretty-lights", | ||
"version": "0.0.12", | ||
"version": "0.0.13", | ||
"description": "CSS-in-JS with a reliable API", | ||
@@ -5,0 +5,0 @@ "main": "lib/pretty-lights.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
100740