styled-components 6.3.9 → 6.3.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- import e from"css-to-react-native";import{parse as t}from"postcss";import{__spreadArray as n,__assign as r}from"tslib";import o,{createElement as i}from"react";import*as s from"stylis";import a from"@emotion/unitless";var c=Object.freeze([]),u=Object.freeze({}),l="production"!==process.env.NODE_ENV?{1:"Cannot create styled-component for component: %s.\n\n",2:"Can't collect styles once you've consumed a `ServerStyleSheet`'s styles! `ServerStyleSheet` is a one off instance for each server-side render cycle.\n\n- Are you trying to reuse it across renders?\n- Are you accidentally calling collectStyles twice?\n\n",3:"Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.\n\n",4:"The `StyleSheetManager` expects a valid target or sheet prop!\n\n- Does this error occur on the client and is your target falsy?\n- Does this error occur on the server and is the sheet falsy?\n\n",5:"The clone method cannot be used on the client!\n\n- Are you running in a client-like environment on the server?\n- Are you trying to run SSR on the client?\n\n",6:"Trying to insert a new style tag, but the given Node is unmounted!\n\n- Are you using a custom target that isn't mounted?\n- Does your document not have a valid head element?\n- Have you accidentally removed a style tag manually?\n\n",7:'ThemeProvider: Please return an object from your "theme" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n',8:'ThemeProvider: Please make your "theme" prop an object.\n\n',9:"Missing document `<head>`\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 `<StyleSheetManager stylisPlugins={[]}>`, 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 `<ThemeProvider>`"}:{};function p(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=e[0],r=[],o=1,i=e.length;o<i;o+=1)r.push(e[o]);return r.forEach(function(e){n=n.replace(/%[a-z]/,e)}),n}function h(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return"production"===process.env.NODE_ENV?new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(e," for more information.").concat(t.length>0?" Args: ".concat(t.join(", ")):"")):new Error(p.apply(void 0,n([l[e]],t,!1)).trim())}function f(e,t){Object.defineProperty(e,"toString",{value:t})}var d="undefined"!=typeof process&&void 0!==process.env&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",y="active",v="data-styled-version",m="6.3.9",g="/*!sc*/\n",S="undefined"!=typeof window&&"undefined"!=typeof document,w=void 0===o.createContext,A=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),b=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e,this._cGroup=0,this._cIndex=0}return e.prototype.indexOfGroup=function(e){if(e===this._cGroup)return this._cIndex;var t=this._cIndex;if(e>this._cGroup)for(var n=this._cGroup;n<e;n++)t+=this.groupSizes[n];else for(n=this._cGroup-1;n>=e;n--)t-=this.groupSizes[n];return this._cGroup=e,this._cIndex=t,t},e.prototype.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,o=r;e>=o;)if((o<<=1)<0)throw h(16,"".concat(e));this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var i=r;i<o;i++)this.groupSizes[i]=0}for(var s=this.indexOfGroup(e+1),a=0,c=(i=0,t.length);i<c;i++)this.tag.insertRule(s,t[i])&&(this.groupSizes[e]++,s++,a++);a>0&&this._cGroup>e&&(this._cIndex+=a)},e.prototype.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],n=this.indexOfGroup(e),r=n+t;this.groupSizes[e]=0;for(var o=n;o<r;o++)this.tag.deleteRule(n);t>0&&this._cGroup>e&&(this._cIndex-=t)}},e.prototype.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),o=r+n,i=r;i<o;i++)t+=this.tag.getRule(i)+g;return t},e}(),C=1<<30,E=new Map,_=new Map,P=1,N=function(e){if(E.has(e))return E.get(e);for(;_.has(P);)P++;var t=P++;if("production"!==process.env.NODE_ENV&&((0|t)<0||t>C))throw h(16,"".concat(t));return E.set(e,t),_.set(t,e),t},T=function(e,t){P=t+1,E.set(e,t),_.set(t,e)},O="style[".concat(d,"][").concat(v,'="').concat(m,'"]'),R=new RegExp("^".concat(d,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),x=function(e){return"undefined"!=typeof ShadowRoot&&e instanceof ShadowRoot||"host"in e&&11===e.nodeType},D=function(e){if(!e)return document;if(x(e))return e;if("getRootNode"in e){var t=e.getRootNode();if(x(t))return t}return document},j=function(e,t,n){for(var r,o=n.split(","),i=0,s=o.length;i<s;i++)(r=o[i])&&e.registerName(t,r)},I=function(e,t){for(var n,r=(null!==(n=t.textContent)&&void 0!==n?n:"").split(g),o=[],i=0,s=r.length;i<s;i++){var a=r[i].trim();if(a){var c=a.match(R);if(c){var u=0|parseInt(c[1],10),l=c[2];0!==u&&(T(l,u),j(e,l,c[3]),e.getTag().insertRules(u,o)),o.length=0}else o.push(a)}}},z=function(e){for(var t=D(e.options.target).querySelectorAll(O),n=0,r=t.length;n<r;n++){var o=t[n];o&&o.getAttribute(d)!==y&&(I(e,o),o.parentNode&&o.parentNode.removeChild(o))}},B=function(e){var t=document.head,n=e||t,r=document.createElement("style"),o=function(e){var t=Array.from(e.querySelectorAll("style[".concat(d,"]")));return t[t.length-1]}(n),i=void 0!==o?o.nextSibling:null;r.setAttribute(d,y),r.setAttribute(v,m);var s="undefined"!=typeof __webpack_nonce__?__webpack_nonce__:null;return s&&r.setAttribute("nonce",s),n.insertBefore(r,i),r},G=function(){function e(e){this.element=B(e),this.element.appendChild(document.createTextNode("")),this.sheet=function(e){var t;if(e.sheet)return e.sheet;for(var n=null!==(t=e.getRootNode().styleSheets)&&void 0!==t?t:document.styleSheets,r=0,o=n.length;r<o;r++){var i=n[r];if(i.ownerNode===e)return i}throw h(17)}(this.element),this.length=0}return e.prototype.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}},e.prototype.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},e.prototype.getRule=function(e){var t=this.sheet.cssRules[e];return t&&t.cssText?t.cssText:""},e}(),L=function(){function e(e){this.element=B(e),this.nodes=this.element.childNodes,this.length=0}return e.prototype.insertRule=function(e,t){if(e<=this.length&&e>=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 e<this.length?this.nodes[e].textContent:""},e}(),V=function(){function e(e){this.rules=[],this.length=0}return e.prototype.insertRule=function(e,t){return e<=this.length&&(e===this.length?this.rules.push(t):this.rules.splice(e,0,t),this.length++,!0)},e.prototype.deleteRule=function(e){this.rules.splice(e,1),this.length--},e.prototype.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),k=S,$={isServer:!S,useCSSOMInjection:!A},F=function(){function e(e,t,n){void 0===e&&(e=u),void 0===t&&(t={});var o=this;this.options=r(r({},$),e),this.gs=t,this.names=new Map(n),this.server=!!e.isServer,!this.server&&S&&k&&(k=!1,z(this)),f(this,function(){return function(e){for(var t=e.getTag(),n=t.length,r="",o=function(n){var o=function(e){return _.get(e)}(n);if(void 0===o)return"continue";var i=e.names.get(o);if(void 0===i||!i.size)return"continue";var s=t.getGroup(n);if(0===s.length)return"continue";var a=d+".g"+n+'[id="'+o+'"]',c="";i.forEach(function(e){e.length>0&&(c+=e+",")}),r+=s+a+'{content:"'+c+'"}'+g},i=0;i<n;i++)o(i);return r}(o)})}return e.registerId=function(e){return N(e)},e.prototype.rehydrate=function(){!this.server&&S&&z(this)},e.prototype.reconstructWithOptions=function(t,n){void 0===n&&(n=!0);var o=new e(r(r({},this.options),t),this.gs,n&&this.names||void 0);return!this.server&&S&&t.target!==this.options.target&&D(this.options.target)!==D(t.target)&&z(o),o},e.prototype.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},e.prototype.getTag=function(){return this.tag||(this.tag=(e=function(e){var t=e.useCSSOMInjection,n=e.target;return e.isServer?new V(n):t?new G(n):new L(n)}(this.options),new b(e)));var e},e.prototype.hasNameForId=function(e,t){var n,r;return null!==(r=null===(n=this.names.get(e))||void 0===n?void 0:n.has(t))&&void 0!==r&&r},e.prototype.registerName=function(e,t){N(e);var n=this.names.get(e);n?n.add(t):this.names.set(e,new Set([t]))},e.prototype.insertRules=function(e,t,n){this.registerName(e,t),this.getTag().insertRules(N(e),n)},e.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},e.prototype.clearRules=function(e){this.getTag().clearGroup(N(e)),this.clearNames(e)},e.prototype.clearTag=function(){this.tag=void 0},e}(),M=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},Y=/&/g,W=47,q=42;function H(e){if(-1===e.indexOf("}"))return!1;for(var t=e.length,n=0,r=0,o=!1,i=0;i<t;i++){var s=e.charCodeAt(i);if(0!==r||o||s!==W||e.charCodeAt(i+1)!==q)if(o)s===q&&e.charCodeAt(i+1)===W&&(o=!1,i++);else if(34!==s&&39!==s||0!==i&&92===e.charCodeAt(i-1)){if(0===r)if(123===s)n++;else if(125===s&&--n<0)return!0}else 0===r?r=s:r===s&&(r=0);else o=!0,i++}return 0!==n||0!==r}function U(e,t){return e.map(function(e){return"rule"===e.type&&(e.value="".concat(t," ").concat(e.value),e.value=e.value.replaceAll(",",",".concat(t," ")),e.props=e.props.map(function(e){return"".concat(t," ").concat(e)})),Array.isArray(e.children)&&"@keyframes"!==e.type&&(e.children=U(e.children,t)),e})}var K=new F,Z=function(){var e,t,n,r=u.options,o=void 0===r?u:r,i=u.plugins,a=void 0===i?c:i,l=function(n,r,o){return o.startsWith(t)&&o.endsWith(t)&&o.replaceAll(t,"").length>0?".".concat(e):n},p=a.slice();p.push(function(e){e.type===s.RULESET&&e.value.includes("&")&&(n||(n=new RegExp("\\".concat(t,"\\b"),"g")),e.props[0]=e.props[0].replace(Y,t).replace(n,l))}),o.prefix&&p.push(s.prefixer),p.push(s.stringify);var f=[],d=s.middleware(p.concat(s.rulesheet(function(e){return f.push(e)}))),y=function(r,i,a,c){void 0===i&&(i=""),void 0===a&&(a=""),void 0===c&&(c="&"),e=c,t=i,n=void 0;var u=function(e){if(!H(e))return e;for(var t=e.length,n="",r=0,o=0,i=0,s=!1,a=0;a<t;a++){var c=e.charCodeAt(a);if(0!==i||s||c!==W||e.charCodeAt(a+1)!==q)if(s)c===q&&e.charCodeAt(a+1)===W&&(s=!1,a++);else if(34!==c&&39!==c||0!==a&&92===e.charCodeAt(a-1)){if(0===i)if(123===c)o++;else if(125===c){if(--o<0){for(var u=a+1;u<t;){var l=e.charCodeAt(u);if(59===l||10===l)break;u++}u<t&&59===e.charCodeAt(u)&&u++,o=0,a=u-1,r=u;continue}0===o&&(n+=e.substring(r,a+1),r=a+1)}else 59===c&&0===o&&(n+=e.substring(r,a+1),r=a+1)}else 0===i?i=c:i===c&&(i=0);else s=!0,a++}if(r<t){var p=e.substring(r);H(p)||(n+=p)}return n}(function(e){if(-1===e.indexOf("//"))return e;for(var t=e.length,n=[],r=0,o=0,i=0,s=0;o<t;){var a=e.charCodeAt(o);if(34!==a&&39!==a||0!==o&&92===e.charCodeAt(o-1))if(0===i)if(a===W&&o+1<t&&e.charCodeAt(o+1)===q){for(o+=2;o+1<t&&(e.charCodeAt(o)!==q||e.charCodeAt(o+1)!==W);)o++;o+=2}else if(40===a&&o>=3&&108==(32|e.charCodeAt(o-1))&&114==(32|e.charCodeAt(o-2))&&117==(32|e.charCodeAt(o-3)))s=1,o++;else if(s>0)41===a?s--:40===a&&s++,o++;else if(a===q&&o+1<t&&e.charCodeAt(o+1)===W)o>r&&n.push(e.substring(r,o)),r=o+=2;else if(a===W&&o+1<t&&e.charCodeAt(o+1)===W){for(o>r&&n.push(e.substring(r,o));o<t&&10!==e.charCodeAt(o);)o++;r=o}else o++;else o++;else 0===i?i=a:i===a&&(i=0),o++}return 0===r?e:(r<t&&n.push(e.substring(r)),n.join(""))}(r)),l=s.compile(a||i?"".concat(a," ").concat(i," { ").concat(u," }"):u);return o.namespace&&(l=U(l,o.namespace)),f=[],s.serialize(l,d),f};return y.hash=a.length?a.reduce(function(e,t){return t.name||h(15),M(e,t.name)},5381).toString():"",y}(),J=(w||o.createContext({shouldForwardProp:void 0,styleSheet:K,stylis:Z}),w||o.createContext(void 0),function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=Z);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,f(this,function(){throw h(12,String(n.name))})}return e.prototype.getName=function(e){return void 0===e&&(e=Z),this.name+e.hash},e}());function Q(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||e in a||e.startsWith("--")?String(t).trim():"".concat(t,"px")}function X(e){return"production"!==process.env.NODE_ENV&&"string"==typeof e&&e||e.displayName||e.name||"Component"}var ee=function(e){return e>="A"&&e<="Z"};function te(e){for(var t="",n=0;n<e.length;n++){var r=e[n];if(1===n&&"-"===r&&"-"===e[0])return e;ee(r)?t+="-"+r.toLowerCase():t+=r}return t.startsWith("ms-")?"-"+t:t}function ne(e){return"function"==typeof e}function re(e){return null!==e&&"object"==typeof e&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function oe(e){return"object"==typeof e&&"styledComponentId"in e}var ie=function(e){return null==e||!1===e||""===e},se=function(e){var t=[];for(var r in e){var o=e[r];e.hasOwnProperty(r)&&!ie(o)&&(Array.isArray(o)&&o.isCss||ne(o)?t.push("".concat(te(r),":"),o,";"):re(o)?t.push.apply(t,n(n(["".concat(r," {")],se(o),!1),["}"],!1)):t.push("".concat(te(r),": ").concat(Q(r,o),";")))}return t};function ae(e,t,n,r,o){if(void 0===o&&(o=[]),"string"==typeof e)return e&&o.push(e),o;if(ie(e))return o;if(oe(e))return o.push(".".concat(e.styledComponentId)),o;if(ne(e)){if(!ne(s=e)||s.prototype&&s.prototype.isReactComponent||!t)return o.push(e),o;var i=e(t);return"production"===process.env.NODE_ENV||"object"!=typeof i||Array.isArray(i)||i instanceof J||re(i)||null===i||console.error("".concat(X(e)," 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.")),ae(i,t,n,r,o)}var s;if(e instanceof J)return n?(e.inject(n,r),o.push(e.getName(r))):o.push(e),o;if(re(e)){for(var a=se(e),c=0;c<a.length;c++)o.push(a[c]);return o}if(!Array.isArray(e))return o.push(e.toString()),o;for(c=0;c<e.length;c++)ae(e[c],t,n,r,o);return o}function ce(e,t){for(var n=[e[0]],r=0,o=t.length;r<o;r+=1)n.push(t[r],e[r+1]);return n}var ue=function(e){return Object.assign(e,{isCss:!0})};function le(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(ne(e)||re(e))return ue(ae(ce(c,n([e],t,!0))));var o=e;return 0===t.length&&1===o.length&&"string"==typeof o[0]?ae(o):ue(ae(ce(o,t)))}function pe(e,t,o){if(void 0===o&&(o=u),!t)throw h(1,t);var i=function(r){for(var i=[],s=1;s<arguments.length;s++)i[s-1]=arguments[s];return e(t,o,le.apply(void 0,n([r],i,!1)))};return i.attrs=function(n){return pe(e,t,r(r({},o),{attrs:Array.prototype.concat(o.attrs,n).filter(Boolean)}))},i.withConfig=function(n){return pe(e,t,r(r({},o),n))},i}var he,fe=w?{Provider:function(e){return e.children},Consumer:function(e){return(0,e.children)(void 0)}}:o.createContext(void 0),de=fe.Consumer;function ye(){var e=w?void 0:o.useContext(fe);if(!e)throw h(18);return e}function ve(e){if(w)return e.children;var t=o.useContext(fe),n=o.useMemo(function(){return function(e,t){if(!e)throw h(14);if(ne(e)){var n=e(t);if("production"!==process.env.NODE_ENV&&(null===n||Array.isArray(n)||"object"!=typeof n))throw h(7);return n}if(Array.isArray(e)||"object"!=typeof e)throw h(8);return t?r(r({},t),e):e}(e.theme,t)},[e.theme,t]);return e.children?o.createElement(fe.Provider,{value:n},e.children):null}function me(e,t,n){return void 0===n&&(n=u),e.theme!==n.theme&&e.theme||t||n.theme}var ge="function"==typeof Symbol&&Symbol.for,Se=ge?Symbol.for("react.memo"):60115,we=ge?Symbol.for("react.forward_ref"):60112,Ae={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},be={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Ce={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Ee=((he={})[we]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},he[Se]=Ce,he);function _e(e){return("type"in(t=e)&&t.type.$$typeof)===Se?Ce:"$$typeof"in e?Ee[e.$$typeof]:Ae;var t}var Pe=Object.defineProperty,Ne=Object.getOwnPropertyNames,Te=Object.getOwnPropertySymbols,Oe=Object.getOwnPropertyDescriptor,Re=Object.getPrototypeOf,xe=Object.prototype;function De(e,t,n){if("string"!=typeof t){if(xe){var r=Re(t);r&&r!==xe&&De(e,r,n)}var o=Ne(t);Te&&(o=o.concat(Te(t)));for(var i=_e(e),s=_e(t),a=0;a<o.length;++a){var c=o[a];if(!(c in be||n&&n[c]||s&&c in s||i&&c in i)){var u=Oe(t,c);try{Pe(e,c,u)}catch(e){}}}}return e}function je(e){var t=o.forwardRef(function(t,n){var i=me(t,w?void 0:o.useContext(fe),e.defaultProps);return"production"!==process.env.NODE_ENV&&void 0===i&&console.warn('[withTheme] You are not using a ThemeProvider nor passing a theme prop or a theme in defaultProps in component class "'.concat(X(e),'"')),o.createElement(e,r(r({},t),{theme:i,ref:n}))});return t.displayName="WithTheme(".concat(X(e),")"),De(t,e)}var Ie=/(a)(d)/gi,ze=function(e){return String.fromCharCode(e+(e>25?39:97))};function Be(e,t){return e.join(t||"")}var Ge=["fit-content","min-content","max-content"],Le={};function Ve(e,t,n){if(void 0===n&&(n=!1),!n&&!re(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var r=0;r<t.length;r++)e[r]=Ve(e[r],t[r]);else if(re(t))for(var r in t)e[r]=Ve(e[r],t[r]);return e}var ke,$e,Fe=require("react-native"),Me=(ke=Fe.StyleSheet,$e=function(){function n(e){this.rules=e}return n.prototype.generateStyleObject=function(n){var r=Be(ae(this.rules,n)),o=function(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=ze(t%52)+n;return(ze(t%52)+n).replace(Ie,"$1-$2")}(M(5381,r)>>>0);if(!Le[o]){var i=t(r),s=[];i.each(function(e){if("decl"===e.type){if(Ge.includes(e.value))return void("production"!==process.env.NODE_ENV&&console.warn('[styled-components/native] The value "'.concat(e.value,'" for property "').concat(e.prop,'" is not supported in React Native and will be ignored.')));s.push([e.prop,e.value])}else"production"!==process.env.NODE_ENV&&"comment"!==e.type&&console.warn("Node of type ".concat(e.type," not supported as an inline style"))});var a=e(s,["borderWidth","borderColor"]),c=ke.create({generated:a});Le[o]=c.generated}return Le[o]},n}(),function(e,t,n){var s=oe(e),a=e,l=t.displayName,p=void 0===l?function(e){return function(e){return"string"==typeof e&&("production"===process.env.NODE_ENV||e.charAt(0)===e.charAt(0).toLowerCase())}(e)?"styled.".concat(e):"Styled(".concat(X(e),")")}(e):l,h=t.attrs,f=void 0===h?c:h,d=s&&a.attrs?a.attrs.concat(f).filter(Boolean):f,y=t.shouldForwardProp;if(s&&a.shouldForwardProp){var v=a.shouldForwardProp;if(t.shouldForwardProp){var m=t.shouldForwardProp;y=function(e,t){return v(e,t)&&m(e,t)}}else y=v}var g=function(e,t){return function(e,t,n){var s=e.attrs,a=e.inlineStyle,c=e.defaultProps,l=e.shouldForwardProp,p=e.target,h=o.useContext?o.useContext(fe):void 0,f=function(e,t,n){void 0===e&&(e=u);var o=r(r({},t),{theme:e}),i={};return n.forEach(function(e){var t,n=ne(e)?e(o):e;for(t in n)o[t]=i[t]=n[t]}),[o,i]}(me(t,h,c)||u,t,s),d=f[1],y=a.generateStyleObject(f[0]),v=n,m=d.as||t.as||p,g=d!==t?r(r({},t),d):t,S={};for(var w in g)"$"!==w[0]&&"as"!==w&&("forwardedAs"===w?S.as=g[w]:l&&!l(w,m)||(S[w]=g[w]));return S.style=o.useMemo?o.useMemo(function(){return ne(t.style)?function(e){return[y].concat(t.style(e))}:t.style?[y].concat(t.style):y},[t.style,y]):ne(t.style)?function(e){return[y].concat(t.style(e))}:t.style?[y].concat(t.style):y,n&&(S.ref=v),i(m,S)}(S,e,t)};g.displayName=p;var S=o.forwardRef(g);return S.attrs=d,S.inlineStyle=new $e(s?a.inlineStyle.rules.concat(n):n),S.displayName=p,S.shouldForwardProp=y,S.styledComponentId=!0,S.target=s?a.target:e,Object.defineProperty(S,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(e){this._foldedDefaultProps=s?function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0,o=t;r<o.length;r++)Ve(e,o[r],!0);return e}({},a.defaultProps,e):e}}),De(S,e,{attrs:!0,inlineStyle:!0,displayName:!0,shouldForwardProp:!0,target:!0}),S}),Ye=function(e){return pe(Me,e)};["ActivityIndicator","Button","DatePickerIOS","DrawerLayoutAndroid","FlatList","Image","ImageBackground","KeyboardAvoidingView","Modal","Pressable","ProgressBarAndroid","ProgressViewIOS","RefreshControl","SafeAreaView","ScrollView","SectionList","Slider","Switch","Text","TextInput","TouchableHighlight","TouchableOpacity","View","VirtualizedList"].forEach(function(e){return Object.defineProperty(Ye,e,{enumerable:!0,configurable:!1,get:function(){if(e in Fe&&Fe[e])return Ye(Fe[e]);throw new Error("".concat(e," is not available in the currently-installed version of react-native"))}})});var We=function(n){var r=Be(ae(n)),o=t(r),i=[];o.each(function(e){"decl"===e.type?i.push([e.prop,e.value]):"production"!==process.env.NODE_ENV&&"comment"!==e.type&&console.warn("Node of type ".concat(e.type," not supported as an inline style"))});var s=e(i,["borderWidth","borderColor"]);return Fe.StyleSheet.create({style:s}).style};export{de as ThemeConsumer,fe as ThemeContext,ve as ThemeProvider,le as css,Ye as default,oe as isStyledComponent,Ye as styled,We as toStyleSheet,ye as useTheme,je as withTheme};
1
+ import e from"css-to-react-native";import{parse as t}from"postcss";import{__spreadArray as n,__assign as r}from"tslib";import o,{createElement as i}from"react";import*as s from"stylis";import a from"@emotion/unitless";var c=Object.freeze([]),u=Object.freeze({}),l="production"!==process.env.NODE_ENV?{1:"Cannot create styled-component for component: %s.\n\n",2:"Can't collect styles once you've consumed a `ServerStyleSheet`'s styles! `ServerStyleSheet` is a one off instance for each server-side render cycle.\n\n- Are you trying to reuse it across renders?\n- Are you accidentally calling collectStyles twice?\n\n",3:"Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.\n\n",4:"The `StyleSheetManager` expects a valid target or sheet prop!\n\n- Does this error occur on the client and is your target falsy?\n- Does this error occur on the server and is the sheet falsy?\n\n",5:"The clone method cannot be used on the client!\n\n- Are you running in a client-like environment on the server?\n- Are you trying to run SSR on the client?\n\n",6:"Trying to insert a new style tag, but the given Node is unmounted!\n\n- Are you using a custom target that isn't mounted?\n- Does your document not have a valid head element?\n- Have you accidentally removed a style tag manually?\n\n",7:'ThemeProvider: Please return an object from your "theme" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n',8:'ThemeProvider: Please make your "theme" prop an object.\n\n',9:"Missing document `<head>`\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 `<StyleSheetManager stylisPlugins={[]}>`, 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 `<ThemeProvider>`"}:{};function p(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=e[0],r=[],o=1,i=e.length;o<i;o+=1)r.push(e[o]);return r.forEach(function(e){n=n.replace(/%[a-z]/,e)}),n}function h(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return"production"===process.env.NODE_ENV?new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(e," for more information.").concat(t.length>0?" Args: ".concat(t.join(", ")):"")):new Error(p.apply(void 0,n([l[e]],t,!1)).trim())}function f(e,t){Object.defineProperty(e,"toString",{value:t})}var d="undefined"!=typeof process&&void 0!==process.env&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",y="active",v="data-styled-version",m="6.3.10",g="/*!sc*/\n",S="undefined"!=typeof window&&"undefined"!=typeof document,w=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),A=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e,this._cGroup=0,this._cIndex=0}return e.prototype.indexOfGroup=function(e){if(e===this._cGroup)return this._cIndex;var t=this._cIndex;if(e>this._cGroup)for(var n=this._cGroup;n<e;n++)t+=this.groupSizes[n];else for(n=this._cGroup-1;n>=e;n--)t-=this.groupSizes[n];return this._cGroup=e,this._cIndex=t,t},e.prototype.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,o=r;e>=o;)if((o<<=1)<0)throw h(16,"".concat(e));this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var i=r;i<o;i++)this.groupSizes[i]=0}for(var s=this.indexOfGroup(e+1),a=0,c=(i=0,t.length);i<c;i++)this.tag.insertRule(s,t[i])&&(this.groupSizes[e]++,s++,a++);a>0&&this._cGroup>e&&(this._cIndex+=a)},e.prototype.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],n=this.indexOfGroup(e),r=n+t;this.groupSizes[e]=0;for(var o=n;o<r;o++)this.tag.deleteRule(n);t>0&&this._cGroup>e&&(this._cIndex-=t)}},e.prototype.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),o=r+n,i=r;i<o;i++)t+=this.tag.getRule(i)+g;return t},e}(),b=1<<30,C=new Map,E=new Map,_=1,P=function(e){if(C.has(e))return C.get(e);for(;E.has(_);)_++;var t=_++;if("production"!==process.env.NODE_ENV&&((0|t)<0||t>b))throw h(16,"".concat(t));return C.set(e,t),E.set(t,e),t},N=function(e,t){_=t+1,C.set(e,t),E.set(t,e)},T="style[".concat(d,"][").concat(v,'="').concat(m,'"]'),O=new RegExp("^".concat(d,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),R=function(e){return"undefined"!=typeof ShadowRoot&&e instanceof ShadowRoot||"host"in e&&11===e.nodeType},D=function(e){if(!e)return document;if(R(e))return e;if("getRootNode"in e){var t=e.getRootNode();if(R(t))return t}return document},x=function(e,t,n){for(var r,o=n.split(","),i=0,s=o.length;i<s;i++)(r=o[i])&&e.registerName(t,r)},j=function(e,t){for(var n,r=(null!==(n=t.textContent)&&void 0!==n?n:"").split(g),o=[],i=0,s=r.length;i<s;i++){var a=r[i].trim();if(a){var c=a.match(O);if(c){var u=0|parseInt(c[1],10),l=c[2];0!==u&&(N(l,u),x(e,l,c[3]),e.getTag().insertRules(u,o)),o.length=0}else o.push(a)}}},I=function(e){for(var t=D(e.options.target).querySelectorAll(T),n=0,r=t.length;n<r;n++){var o=t[n];o&&o.getAttribute(d)!==y&&(j(e,o),o.parentNode&&o.parentNode.removeChild(o))}},z=function(e){var t=document.head,n=e||t,r=document.createElement("style"),o=function(e){var t=Array.from(e.querySelectorAll("style[".concat(d,"]")));return t[t.length-1]}(n),i=void 0!==o?o.nextSibling:null;r.setAttribute(d,y),r.setAttribute(v,m);var s="undefined"!=typeof __webpack_nonce__?__webpack_nonce__:null;return s&&r.setAttribute("nonce",s),n.insertBefore(r,i),r},B=function(){function e(e){this.element=z(e),this.element.appendChild(document.createTextNode("")),this.sheet=function(e){var t;if(e.sheet)return e.sheet;for(var n=null!==(t=e.getRootNode().styleSheets)&&void 0!==t?t:document.styleSheets,r=0,o=n.length;r<o;r++){var i=n[r];if(i.ownerNode===e)return i}throw h(17)}(this.element),this.length=0}return e.prototype.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}},e.prototype.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},e.prototype.getRule=function(e){var t=this.sheet.cssRules[e];return t&&t.cssText?t.cssText:""},e}(),G=function(){function e(e){this.element=z(e),this.nodes=this.element.childNodes,this.length=0}return e.prototype.insertRule=function(e,t){if(e<=this.length&&e>=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 e<this.length?this.nodes[e].textContent:""},e}(),L=function(){function e(e){this.rules=[],this.length=0}return e.prototype.insertRule=function(e,t){return e<=this.length&&(e===this.length?this.rules.push(t):this.rules.splice(e,0,t),this.length++,!0)},e.prototype.deleteRule=function(e){this.rules.splice(e,1),this.length--},e.prototype.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),V=S,k={isServer:!S,useCSSOMInjection:!w},$=function(){function e(e,t,n){void 0===e&&(e=u),void 0===t&&(t={});var o=this;this.options=r(r({},k),e),this.gs=t,this.names=new Map(n),this.server=!!e.isServer,!this.server&&S&&V&&(V=!1,I(this)),f(this,function(){return function(e){for(var t=e.getTag(),n=t.length,r="",o=function(n){var o=function(e){return E.get(e)}(n);if(void 0===o)return"continue";var i=e.names.get(o);if(void 0===i||!i.size)return"continue";var s=t.getGroup(n);if(0===s.length)return"continue";var a=d+".g"+n+'[id="'+o+'"]',c="";i.forEach(function(e){e.length>0&&(c+=e+",")}),r+=s+a+'{content:"'+c+'"}'+g},i=0;i<n;i++)o(i);return r}(o)})}return e.registerId=function(e){return P(e)},e.prototype.rehydrate=function(){!this.server&&S&&I(this)},e.prototype.reconstructWithOptions=function(t,n){void 0===n&&(n=!0);var o=new e(r(r({},this.options),t),this.gs,n&&this.names||void 0);return!this.server&&S&&t.target!==this.options.target&&D(this.options.target)!==D(t.target)&&I(o),o},e.prototype.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},e.prototype.getTag=function(){return this.tag||(this.tag=(e=function(e){var t=e.useCSSOMInjection,n=e.target;return e.isServer?new L(n):t?new B(n):new G(n)}(this.options),new A(e)));var e},e.prototype.hasNameForId=function(e,t){var n,r;return null!==(r=null===(n=this.names.get(e))||void 0===n?void 0:n.has(t))&&void 0!==r&&r},e.prototype.registerName=function(e,t){P(e);var n=this.names.get(e);n?n.add(t):this.names.set(e,new Set([t]))},e.prototype.insertRules=function(e,t,n){this.registerName(e,t),this.getTag().insertRules(P(e),n)},e.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},e.prototype.clearRules=function(e){this.getTag().clearGroup(P(e)),this.clearNames(e)},e.prototype.clearTag=function(){this.tag=void 0},e}(),F=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},M=/&/g,Y=47,W=42;function q(e){if(-1===e.indexOf("}"))return!1;for(var t=e.length,n=0,r=0,o=!1,i=0;i<t;i++){var s=e.charCodeAt(i);if(0!==r||o||s!==Y||e.charCodeAt(i+1)!==W)if(o)s===W&&e.charCodeAt(i+1)===Y&&(o=!1,i++);else if(34!==s&&39!==s||0!==i&&92===e.charCodeAt(i-1)){if(0===r)if(123===s)n++;else if(125===s&&--n<0)return!0}else 0===r?r=s:r===s&&(r=0);else o=!0,i++}return 0!==n||0!==r}function H(e,t){return e.map(function(e){return"rule"===e.type&&(e.value="".concat(t," ").concat(e.value),e.value=e.value.replaceAll(",",",".concat(t," ")),e.props=e.props.map(function(e){return"".concat(t," ").concat(e)})),Array.isArray(e.children)&&"@keyframes"!==e.type&&(e.children=H(e.children,t)),e})}var U=new $,K=function(){var e,t,n,r=u.options,o=void 0===r?u:r,i=u.plugins,a=void 0===i?c:i,l=function(n,r,o){return o.startsWith(t)&&o.endsWith(t)&&o.replaceAll(t,"").length>0?".".concat(e):n},p=a.slice();p.push(function(e){e.type===s.RULESET&&e.value.includes("&")&&(n||(n=new RegExp("\\".concat(t,"\\b"),"g")),e.props[0]=e.props[0].replace(M,t).replace(n,l))}),o.prefix&&p.push(s.prefixer),p.push(s.stringify);var f=[],d=s.middleware(p.concat(s.rulesheet(function(e){return f.push(e)}))),y=function(r,i,a,c){void 0===i&&(i=""),void 0===a&&(a=""),void 0===c&&(c="&"),e=c,t=i,n=void 0;var u=function(e){if(!q(e))return e;for(var t=e.length,n="",r=0,o=0,i=0,s=!1,a=0;a<t;a++){var c=e.charCodeAt(a);if(0!==i||s||c!==Y||e.charCodeAt(a+1)!==W)if(s)c===W&&e.charCodeAt(a+1)===Y&&(s=!1,a++);else if(34!==c&&39!==c||0!==a&&92===e.charCodeAt(a-1)){if(0===i)if(123===c)o++;else if(125===c){if(--o<0){for(var u=a+1;u<t;){var l=e.charCodeAt(u);if(59===l||10===l)break;u++}u<t&&59===e.charCodeAt(u)&&u++,o=0,a=u-1,r=u;continue}0===o&&(n+=e.substring(r,a+1),r=a+1)}else 59===c&&0===o&&(n+=e.substring(r,a+1),r=a+1)}else 0===i?i=c:i===c&&(i=0);else s=!0,a++}if(r<t){var p=e.substring(r);q(p)||(n+=p)}return n}(function(e){if(-1===e.indexOf("//"))return e;for(var t=e.length,n=[],r=0,o=0,i=0,s=0;o<t;){var a=e.charCodeAt(o);if(34!==a&&39!==a||0!==o&&92===e.charCodeAt(o-1))if(0===i)if(a===Y&&o+1<t&&e.charCodeAt(o+1)===W){for(o+=2;o+1<t&&(e.charCodeAt(o)!==W||e.charCodeAt(o+1)!==Y);)o++;o+=2}else if(40===a&&o>=3&&108==(32|e.charCodeAt(o-1))&&114==(32|e.charCodeAt(o-2))&&117==(32|e.charCodeAt(o-3)))s=1,o++;else if(s>0)41===a?s--:40===a&&s++,o++;else if(a===W&&o+1<t&&e.charCodeAt(o+1)===Y)o>r&&n.push(e.substring(r,o)),r=o+=2;else if(a===Y&&o+1<t&&e.charCodeAt(o+1)===Y){for(o>r&&n.push(e.substring(r,o));o<t&&10!==e.charCodeAt(o);)o++;r=o}else o++;else o++;else 0===i?i=a:i===a&&(i=0),o++}return 0===r?e:(r<t&&n.push(e.substring(r)),n.join(""))}(r)),l=s.compile(a||i?"".concat(a," ").concat(i," { ").concat(u," }"):u);return o.namespace&&(l=H(l,o.namespace)),f=[],s.serialize(l,d),f};return y.hash=a.length?a.reduce(function(e,t){return t.name||h(15),F(e,t.name)},5381).toString():"",y}(),Z=(o.createContext({shouldForwardProp:void 0,styleSheet:U,stylis:K}),o.createContext(void 0),function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=K);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,f(this,function(){throw h(12,String(n.name))})}return e.prototype.getName=function(e){return void 0===e&&(e=K),this.name+e.hash},e}());function J(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||e in a||e.startsWith("--")?String(t).trim():"".concat(t,"px")}function Q(e){return"production"!==process.env.NODE_ENV&&"string"==typeof e&&e||e.displayName||e.name||"Component"}var X=function(e){return e>="A"&&e<="Z"};function ee(e){for(var t="",n=0;n<e.length;n++){var r=e[n];if(1===n&&"-"===r&&"-"===e[0])return e;X(r)?t+="-"+r.toLowerCase():t+=r}return t.startsWith("ms-")?"-"+t:t}function te(e){return"function"==typeof e}function ne(e){return null!==e&&"object"==typeof e&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function re(e){return"object"==typeof e&&"styledComponentId"in e}var oe=function(e){return null==e||!1===e||""===e},ie=function(e){var t=[];for(var r in e){var o=e[r];e.hasOwnProperty(r)&&!oe(o)&&(Array.isArray(o)&&o.isCss||te(o)?t.push("".concat(ee(r),":"),o,";"):ne(o)?t.push.apply(t,n(n(["".concat(r," {")],ie(o),!1),["}"],!1)):t.push("".concat(ee(r),": ").concat(J(r,o),";")))}return t};function se(e,t,n,r,o){if(void 0===o&&(o=[]),"string"==typeof e)return e&&o.push(e),o;if(oe(e))return o;if(re(e))return o.push(".".concat(e.styledComponentId)),o;if(te(e)){if(!te(s=e)||s.prototype&&s.prototype.isReactComponent||!t)return o.push(e),o;var i=e(t);return"production"===process.env.NODE_ENV||"object"!=typeof i||Array.isArray(i)||i instanceof Z||ne(i)||null===i||console.error("".concat(Q(e)," 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.")),se(i,t,n,r,o)}var s;if(e instanceof Z)return n?(e.inject(n,r),o.push(e.getName(r))):o.push(e),o;if(ne(e)){for(var a=ie(e),c=0;c<a.length;c++)o.push(a[c]);return o}if(!Array.isArray(e))return o.push(e.toString()),o;for(c=0;c<e.length;c++)se(e[c],t,n,r,o);return o}function ae(e,t){for(var n=[e[0]],r=0,o=t.length;r<o;r+=1)n.push(t[r],e[r+1]);return n}var ce=function(e){return Object.assign(e,{isCss:!0})};function ue(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(te(e)||ne(e))return ce(se(ae(c,n([e],t,!0))));var o=e;return 0===t.length&&1===o.length&&"string"==typeof o[0]?se(o):ce(se(ae(o,t)))}function le(e,t,o){if(void 0===o&&(o=u),!t)throw h(1,t);var i=function(r){for(var i=[],s=1;s<arguments.length;s++)i[s-1]=arguments[s];return e(t,o,ue.apply(void 0,n([r],i,!1)))};return i.attrs=function(n){return le(e,t,r(r({},o),{attrs:Array.prototype.concat(o.attrs,n).filter(Boolean)}))},i.withConfig=function(n){return le(e,t,r(r({},o),n))},i}var pe,he=o.createContext(void 0),fe=he.Consumer;function de(){var e=o.useContext(he);if(!e)throw h(18);return e}function ye(e){var t=o.useContext(he),n=o.useMemo(function(){return function(e,t){if(!e)throw h(14);if(te(e)){var n=e(t);if("production"!==process.env.NODE_ENV&&(null===n||Array.isArray(n)||"object"!=typeof n))throw h(7);return n}if(Array.isArray(e)||"object"!=typeof e)throw h(8);return t?r(r({},t),e):e}(e.theme,t)},[e.theme,t]);return e.children?o.createElement(he.Provider,{value:n},e.children):null}function ve(e,t,n){return void 0===n&&(n=u),e.theme!==n.theme&&e.theme||t||n.theme}var me="function"==typeof Symbol&&Symbol.for,ge=me?Symbol.for("react.memo"):60115,Se=me?Symbol.for("react.forward_ref"):60112,we={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Ae={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},be={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Ce=((pe={})[Se]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},pe[ge]=be,pe);function Ee(e){return("type"in(t=e)&&t.type.$$typeof)===ge?be:"$$typeof"in e?Ce[e.$$typeof]:we;var t}var _e=Object.defineProperty,Pe=Object.getOwnPropertyNames,Ne=Object.getOwnPropertySymbols,Te=Object.getOwnPropertyDescriptor,Oe=Object.getPrototypeOf,Re=Object.prototype;function De(e,t,n){if("string"!=typeof t){if(Re){var r=Oe(t);r&&r!==Re&&De(e,r,n)}var o=Pe(t);Ne&&(o=o.concat(Ne(t)));for(var i=Ee(e),s=Ee(t),a=0;a<o.length;++a){var c=o[a];if(!(c in Ae||n&&n[c]||s&&c in s||i&&c in i)){var u=Te(t,c);try{_e(e,c,u)}catch(e){}}}}return e}function xe(e){var t=o.forwardRef(function(t,n){var i=ve(t,o.useContext(he),e.defaultProps);return"production"!==process.env.NODE_ENV&&void 0===i&&console.warn('[withTheme] You are not using a ThemeProvider nor passing a theme prop or a theme in defaultProps in component class "'.concat(Q(e),'"')),o.createElement(e,r(r({},t),{theme:i,ref:n}))});return t.displayName="WithTheme(".concat(Q(e),")"),De(t,e)}var je=/(a)(d)/gi,Ie=function(e){return String.fromCharCode(e+(e>25?39:97))};function ze(e,t){return e.join(t||"")}var Be=["fit-content","min-content","max-content"],Ge={};function Le(e,t,n){if(void 0===n&&(n=!1),!n&&!ne(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var r=0;r<t.length;r++)e[r]=Le(e[r],t[r]);else if(ne(t))for(var r in t)e[r]=Le(e[r],t[r]);return e}var Ve,ke,$e=require("react-native"),Fe=(Ve=$e.StyleSheet,ke=function(){function n(e){this.rules=e}return n.prototype.generateStyleObject=function(n){var r=ze(se(this.rules,n)),o=function(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=Ie(t%52)+n;return(Ie(t%52)+n).replace(je,"$1-$2")}(F(5381,r)>>>0);if(!Ge[o]){var i=t(r),s=[];i.each(function(e){if("decl"===e.type){if(Be.includes(e.value))return void("production"!==process.env.NODE_ENV&&console.warn('[styled-components/native] The value "'.concat(e.value,'" for property "').concat(e.prop,'" is not supported in React Native and will be ignored.')));s.push([e.prop,e.value])}else"production"!==process.env.NODE_ENV&&"comment"!==e.type&&console.warn("Node of type ".concat(e.type," not supported as an inline style"))});var a=e(s,["borderWidth","borderColor"]),c=Ve.create({generated:a});Ge[o]=c.generated}return Ge[o]},n}(),function(e,t,n){var s=re(e),a=e,l=t.displayName,p=void 0===l?function(e){return function(e){return"string"==typeof e&&("production"===process.env.NODE_ENV||e.charAt(0)===e.charAt(0).toLowerCase())}(e)?"styled.".concat(e):"Styled(".concat(Q(e),")")}(e):l,h=t.attrs,f=void 0===h?c:h,d=s&&a.attrs?a.attrs.concat(f).filter(Boolean):f,y=t.shouldForwardProp;if(s&&a.shouldForwardProp){var v=a.shouldForwardProp;if(t.shouldForwardProp){var m=t.shouldForwardProp;y=function(e,t){return v(e,t)&&m(e,t)}}else y=v}var g=function(e,t){return function(e,t,n){var s=e.attrs,a=e.inlineStyle,c=e.defaultProps,l=e.shouldForwardProp,p=e.target,h=o.useContext?o.useContext(he):void 0,f=function(e,t,n){void 0===e&&(e=u);var o=r(r({},t),{theme:e}),i={};return n.forEach(function(e){var t,n=te(e)?e(o):e;for(t in n)o[t]=i[t]=n[t]}),[o,i]}(ve(t,h,c)||u,t,s),d=f[1],y=a.generateStyleObject(f[0]),v=n,m=d.as||t.as||p,g=d!==t?r(r({},t),d):t,S={};for(var w in g)"$"!==w[0]&&"as"!==w&&("forwardedAs"===w?S.as=g[w]:l&&!l(w,m)||(S[w]=g[w]));return S.style=o.useMemo?o.useMemo(function(){return te(t.style)?function(e){return[y].concat(t.style(e))}:t.style?[y].concat(t.style):y},[t.style,y]):te(t.style)?function(e){return[y].concat(t.style(e))}:t.style?[y].concat(t.style):y,n&&(S.ref=v),i(m,S)}(S,e,t)};g.displayName=p;var S=o.forwardRef(g);return S.attrs=d,S.inlineStyle=new ke(s?a.inlineStyle.rules.concat(n):n),S.displayName=p,S.shouldForwardProp=y,S.styledComponentId=!0,S.target=s?a.target:e,Object.defineProperty(S,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(e){this._foldedDefaultProps=s?function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0,o=t;r<o.length;r++)Le(e,o[r],!0);return e}({},a.defaultProps,e):e}}),De(S,e,{attrs:!0,inlineStyle:!0,displayName:!0,shouldForwardProp:!0,target:!0}),S}),Me=function(e){return le(Fe,e)};["ActivityIndicator","Button","DatePickerIOS","DrawerLayoutAndroid","FlatList","Image","ImageBackground","KeyboardAvoidingView","Modal","Pressable","ProgressBarAndroid","ProgressViewIOS","RefreshControl","SafeAreaView","ScrollView","SectionList","Slider","Switch","Text","TextInput","TouchableHighlight","TouchableOpacity","View","VirtualizedList"].forEach(function(e){return Object.defineProperty(Me,e,{enumerable:!0,configurable:!1,get:function(){if(e in $e&&$e[e])return Me($e[e]);throw new Error("".concat(e," is not available in the currently-installed version of react-native"))}})});var Ye=function(n){var r=ze(se(n)),o=t(r),i=[];o.each(function(e){"decl"===e.type?i.push([e.prop,e.value]):"production"!==process.env.NODE_ENV&&"comment"!==e.type&&console.warn("Node of type ".concat(e.type," not supported as an inline style"))});var s=e(i,["borderWidth","borderColor"]);return $e.StyleSheet.create({style:s}).style};export{fe as ThemeConsumer,he as ThemeContext,ye as ThemeProvider,ue as css,Me as default,re as isStyledComponent,Me as styled,Ye as toStyleSheet,de as useTheme,xe as withTheme};
2
2
  //# sourceMappingURL=styled-components.native.esm.js.map