"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("@emotion/is-prop-valid"),n=require("react"),r=require("shallowequal"),o=require("stylis"),s=require("@emotion/unitless");function i(e){return e&&e.__esModule?e:{default:e}}function a(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var c=/*#__PURE__*/i(t),l=/*#__PURE__*/i(n),u=/*#__PURE__*/i(r),p=/*#__PURE__*/a(o),d=/*#__PURE__*/i(s),h="undefined"!=typeof process&&void 0!==process.env&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",f="undefined"!=typeof window&&"HTMLElement"in window,y=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY?"false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY:"production"!==process.env.NODE_ENV),m={},v=/invalid hook call/i,g=new Set,S=function(t,r){if("production"!==process.env.NODE_ENV){var o=r?' with the id of "'.concat(r,'"'):"",s="The component ".concat(t).concat(o," has been created dynamically.\n")+"You may see this warning because you've called styled inside another component.\nTo resolve this only create new StyledComponents outside of any render method and function component.",i=console.error;try{var a=!0;console.error=function(t){for(var n=[],r=1;r?@[\\\]^`{|}~-]+/g,P=/(^-|-$)/g;function C(e){return e.replace(N,"-").replace(P,"")}var A=/(a)(d)/gi,I=function(e){return String.fromCharCode(e+(e>25?39:97))};function O(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=I(t%52)+n;return(I(t%52)+n).replace(A,"$1-$2")}var x,D=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},T=function(e){return D(5381,e)};function R(e){return O(T(e)>>>0)}function j(e){return"production"!==process.env.NODE_ENV&&"string"==typeof e&&e||e.displayName||e.name||"Component"}function k(e){return"string"==typeof e&&("production"===process.env.NODE_ENV||e.charAt(0)===e.charAt(0).toLowerCase())}var V="function"==typeof Symbol&&Symbol.for,M=V?Symbol.for("react.memo"):60115,F=V?Symbol.for("react.forward_ref"):60112,z={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},$={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},B={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},L=((x={})[F]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},x[M]=B,x);function G(e){return("type"in(t=e)&&t.type.$$typeof)===M?B:"$$typeof"in e?L[e.$$typeof]:z;var t}var q=Object.defineProperty,Y=Object.getOwnPropertyNames,W=Object.getOwnPropertySymbols,H=Object.getOwnPropertyDescriptor,U=Object.getPrototypeOf,J=Object.prototype;function X(e,t,n){if("string"!=typeof t){if(J){var r=U(t);r&&r!==J&&X(e,r,n)}var o=Y(t);W&&(o=o.concat(W(t)));for(var s=G(e),i=G(t),a=0;a ({})}\n```\n\n',8:'ThemeProvider: Please make your "theme" prop an object.\n\n',9:"Missing document ``\n\n",10:"Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021\n\n",11:"_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.\n\n",12:"It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\`\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\n\n",13:"%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.\n\n",14:'ThemeProvider: "theme" prop is required.\n\n',15:"A stylis plugin has been supplied that is not named. We need a name for each plugin to be able to prevent styling collisions between different stylis configurations within the same app. Before you pass your plugin to ``, please make sure each plugin is uniquely-named, e.g.\n\n```js\nObject.defineProperty(importedPlugin, 'name', { value: 'some-unique-name' });\n```\n\n",16:"Reached the limit of how many styled components may be created at group %s.\nYou may only create up to 1,073,741,824 components. If you're creating components dynamically,\nas for instance in your render method then you may be running into this limitation.\n\n",17:"CSSStyleSheet could not be found on HTMLStyleElement.\nHas styled-components' style tag been unmounted or altered by another script?\n",18:"ThemeProvider: Please make sure your useTheme hook is within a ``"}:{};function se(){for(var e=[],t=0;t0?" Args: ".concat(n.join(", ")):"")):new Error(se.apply(void 0,e.__spreadArray([oe[t]],n,!1)).trim())}var ae=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return e.prototype.indexOfGroup=function(e){for(var t=0,n=0;n=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,o=r;e>=o;)if((o<<=1)<0)throw ie(16,"".concat(e));this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var s=r;s=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),o=r+n,s=r;s1073741824))throw ie(16,"".concat(t));return ce.set(e,t),le.set(t,e),t},de=function(e,t){ce.set(e,t),le.set(t,e)},he="style[".concat(h,"][").concat("data-styled-version",'="').concat("6.0.8",'"]'),fe=new RegExp("^".concat(h,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),ye=function(e,t,n){for(var r,o=n.split(","),s=0,i=o.length;s=0){var n=document.createTextNode(t);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},e.prototype.getRule=function(e){return e0&&(c+="".concat(e,","))}),r+="".concat(i).concat(a,'{content:"').concat(c,'"}').concat("/*!sc*/\n")},s=0;s0?".".concat(t):e},u=c.slice();u.push(function(e){e.type===p.RULESET&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(Pe,n).replace(r,l))}),i.prefix&&u.push(p.prefixer),u.push(p.stringify);var d=function(e,o,s,a){void 0===o&&(o=""),void 0===s&&(s=""),void 0===a&&(a="&"),t=a,n=o,r=new RegExp("\\".concat(n,"\\b"),"g");var c=e.replace(Ce,""),l=p.compile(s||o?"".concat(s," ").concat(o," { ").concat(c," }"):c);i.namespace&&(l=Ae(l,i.namespace));var d=[];return p.serialize(l,p.middleware(u.concat(p.rulesheet(function(e){return d.push(e)})))),d};return d.hash=c.length?c.reduce(function(e,t){return t.name||ie(15),D(e,t.name)},5381).toString():"",d}var Oe=new Ne,xe=Ie(),De=l.default.createContext({shouldForwardProp:void 0,styleSheet:Oe,stylis:xe}),Te=De.Consumer,Re=l.default.createContext(void 0);function je(){return n.useContext(De)}function ke(e){var t=n.useState(e.stylisPlugins),r=t[0],o=t[1],s=je().styleSheet,i=n.useMemo(function(){var t=s;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t},[e.disableCSSOMInjection,e.sheet,e.target,s]),a=n.useMemo(function(){return Ie({options:{namespace:e.namespace,prefix:e.enableVendorPrefixes},plugins:r})},[e.enableVendorPrefixes,e.namespace,r]);n.useEffect(function(){u.default(r,e.stylisPlugins)||o(e.stylisPlugins)},[e.stylisPlugins]);var c=n.useMemo(function(){return{shouldForwardProp:e.shouldForwardProp,styleSheet:i,stylis:a}},[e.shouldForwardProp,i,a]);return l.default.createElement(De.Provider,{value:c},l.default.createElement(Re.Provider,{value:a},e.children))}var Ve=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=xe);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"))},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=t,re(this,function(){throw ie(12,String(n.name))})}return e.prototype.getName=function(e){return void 0===e&&(e=xe),this.name+e.hash},e}(),Me=function(e){return e>="A"&&e<="Z"};function Fe(e){for(var t="",n=0;n>>0);if(!t.hasNameForId(this.componentId,s)){var i=n(o,".".concat(s),void 0,this.componentId);t.insertRules(this.componentId,s,i)}r=Q(r,s),this.staticRulesId=s}else{for(var a=D(this.baseHash,n.hash),c="",l=0;l>>0);t.hasNameForId(this.componentId,d)||t.insertRules(this.componentId,d,n(c,".".concat(d),void 0,this.componentId)),r=Q(r,d)}}return r},e}(),Ye=l.default.createContext(void 0),We=Ye.Consumer,He={},Ue=new Set;function Je(t,r,o){var s=K(t),i=t,a=!k(t),u=r.attrs,p=void 0===u?w:u,d=r.componentId,h=void 0===d?function(e,t){var n="string"!=typeof e?"sc":C(e);He[n]=(He[n]||0)+1;var r="".concat(n,"-").concat(R("6.0.8"+n+He[n]));return t?"".concat(t,"-").concat(r):r}(r.displayName,r.parentComponentId):d,f=r.displayName,y=void 0===f?function(e){return k(e)?"styled.".concat(e):"Styled(".concat(j(e),")")}(t):f,m=r.displayName&&r.componentId?"".concat(C(r.displayName),"-").concat(r.componentId):r.componentId||h,v=s&&i.attrs?i.attrs.concat(p).filter(Boolean):p,g=r.shouldForwardProp;if(s&&i.shouldForwardProp){var N=i.shouldForwardProp;if(r.shouldForwardProp){var P=r.shouldForwardProp;g=function(e,t){return N(e,t)&&P(e,t)}}else g=N}var A=new qe(o,m,s?i.componentStyle:void 0);function I(t,r){return function(t,r,o){var s=t.attrs,i=t.componentStyle,a=t.defaultProps,u=t.foldedComponentIds,p=t.styledComponentId,d=t.target,h=l.default.useContext(Ye),f=je(),y=t.shouldForwardProp||f.shouldForwardProp;"production"!==process.env.NODE_ENV&&n.useDebugValue(p);var m=function(t,n,r){for(var o,s=e.__assign(e.__assign({},n),{className:void 0,theme:r}),i=0;i` (connect an API like `@emotion/is-prop-valid`) or consider using transient props (`$` prefix for automatic filtering.)')))));var w=function(e,t){var r=je(),o=e.generateAndInjectStyles(t,r.styleSheet,r.stylis);return"production"!==process.env.NODE_ENV&&n.useDebugValue(o),o}(i,m);"production"!==process.env.NODE_ENV&&t.warnTooManyClasses&&t.warnTooManyClasses(w);var N=Q(u,p);return w&&(N+=" "+w),m.className&&(N+=" "+m.className),g[k(v)&&!E.has(v)?"class":"className"]=N,g.ref=o,n.createElement(v,g)}(O,t,r)}"production"!==process.env.NODE_ENV&&(I.displayName=y);var O=l.default.forwardRef(I);return O.attrs=v,O.componentStyle=A,O.shouldForwardProp=g,"production"!==process.env.NODE_ENV&&(O.displayName=y),O.foldedComponentIds=s?Q(i.foldedComponentIds,i.styledComponentId):"",O.styledComponentId=m,O.target=s?i.target:t,Object.defineProperty(O,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(e){this._foldedDefaultProps=s?function(e){for(var t=[],n=1;n=200)){var s=t?' with the id of "'.concat(t,'"'):"";console.warn("Over ".concat(200," classes were generated for component ").concat(e).concat(s,".\n")+"Consider using the attrs method, together with a style object for frequently changed styles.\nExample:\n const Component = styled.div.attrs(props => ({\n style: {\n background: props.background,\n },\n }))`width: 100%;`\n\n "),r=!0,n={}}}}(y,m)),re(O,function(){return".".concat(O.styledComponentId)}),a&&X(O,t,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),O}function Xe(e,t){for(var n=[e[0]],r=0,o=t.length;r2&&Ne.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,t,n,r)},e}(),rt=function(){function t(){var t=this;this._emitSheetCSS=function(){var e=t.instance.toString(),n=ve(),r=ee([n&&'nonce="'.concat(n,'"'),"".concat(h,'="true"'),"".concat("data-styled-version",'="').concat("6.0.8",'"')].filter(Boolean)," ");return"")},this.getStyleTags=function(){if(t.sealed)throw ie(2);return t._emitSheetCSS()},this.getStyleElement=function(){var n;if(t.sealed)throw ie(2);var r=((n={})[h]="",n["data-styled-version"]="6.0.8",n.dangerouslySetInnerHTML={__html:t.instance.toString()},n),o=ve();return o&&(r.nonce=o),[l.default.createElement("style",e.__assign({},r,{key:"sc-0-0"}))]},this.seal=function(){t.sealed=!0},this.instance=new Ne({isServer:!0}),this.sealed=!1}return t.prototype.collectStyles=function(e){if(this.sealed)throw ie(2);return l.default.createElement(ke,{sheet:this.instance},e)},t.prototype.interleaveWithNodeStream=function(e){throw ie(3)},t}(),ot={StyleSheet:Ne,mainSheet:Oe};"production"!==process.env.NODE_ENV&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product&&console.warn("It looks like you've imported 'styled-components' on React Native.\nPerhaps you're looking to import 'styled-components/native'?\nRead more about this at https://www.styled-components.com/docs/basics#react-native");var st="__sc-".concat(h,"__");"production"!==process.env.NODE_ENV&&"test"!==process.env.NODE_ENV&&"undefined"!=typeof window&&(window[st]||(window[st]=0),1===window[st]&&console.warn("It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.\n\nSee https://s-c.sh/2BAXzed for more info."),window[st]+=1),exports.ServerStyleSheet=rt,exports.StyleSheetConsumer=Te,exports.StyleSheetContext=De,exports.StyleSheetManager=ke,exports.ThemeConsumer=We,exports.ThemeContext=Ye,exports.ThemeProvider=function(t){var r=l.default.useContext(Ye),o=n.useMemo(function(){return function(t,n){if(!t)throw ie(14);if(Z(t)){var r=t(n);if("production"!==process.env.NODE_ENV&&(null===r||Array.isArray(r)||"object"!=typeof r))throw ie(7);return r}if(Array.isArray(t)||"object"!=typeof t)throw ie(8);return n?e.__assign(e.__assign({},n),t):t}(t.theme,r)},[t.theme,r]);return t.children?l.default.createElement(Ye.Provider,{value:o},t.children):null},exports.__PRIVATE__=ot,exports.createGlobalStyle=function(t){for(var n=[],r=1;r meta tag to the stylesheet, or simply embedding it manually in your index.html section for a simpler app."),t.styleSheet.server&&c(r,e,t.styleSheet,n,t.stylis),l.default.useLayoutEffect(function(){if(!t.styleSheet.server)return c(r,e,t.styleSheet,n,t.stylis),function(){return i.removeStyles(r,t.styleSheet)}},[r,e,t.styleSheet,n,t.stylis]),null};function c(t,n,r,o,s){if(i.isStatic)i.renderStyles(t,m,r,s);else{var c=e.__assign(e.__assign({},n),{theme:b(n,o,a.defaultProps)});i.renderStyles(t,c,r,s)}}return l.default.memo(a)},exports.css=Ke,exports.default=tt,exports.isStyledComponent=K,exports.keyframes=function(t){for(var n=[],r=1;r