webpackJsonp([22],{ /***/ "APD3": /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @typechecks */ var _uppercasePattern = /([A-Z])/g; /** * Hyphenates a camelcased string, for example: * * > hyphenate('backgroundColor') * < "background-color" * * For CSS style names, use `hyphenateStyleName` instead which works properly * with all vendor prefixes, including `ms`. * * @param {string} string * @return {string} */ function hyphenate(string) { return string.replace(_uppercasePattern, '-$1').toLowerCase(); } module.exports = hyphenate; /***/ }), /***/ "CdOH": /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /***/ "IM/B": /***/ (function(module, exports, __webpack_require__) { (function (factory) { true ? (module['exports'] = factory()) : typeof define === 'function' && define['amd'] ? define(factory()) : (window['stylisRuleSheet'] = factory()) }(function () { 'use strict' return function (insertRule) { var delimiter = '/*|*/' var needle = delimiter+'}' function toSheet (block) { if (block) try { insertRule(block + '}') } catch (e) {} } return function ruleSheet (context, content, selectors, parents, line, column, length, ns, depth, at) { switch (context) { // property case 1: // @import if (depth === 0 && content.charCodeAt(0) === 64) return insertRule(content+';'), '' break // selector case 2: if (ns === 0) return content + delimiter break // at-rule case 3: switch (ns) { // @font-face, @page case 102: case 112: return insertRule(selectors[0]+content), '' default: return content + (at === 0 ? delimiter : '') } case -2: content.split(needle).forEach(toSheet) } } } })) /***/ }), /***/ "LpuX": /***/ (function(module, exports, __webpack_require__) { "use strict"; /** @license React v16.13.1 * react-is.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b? Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119; function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d; exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t}; exports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p}; exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z; /***/ }), /***/ "Ruo5": /***/ (function(module, exports, __webpack_require__) { /* * __ ___ * _____/ /___ __/ (_)____ * / ___/ __/ / / / / / ___/ * (__ ) /_/ /_/ / / (__ ) * /____/\__/\__, /_/_/____/ * /____/ * * light - weight css preprocessor @licence MIT */ (function (factory) {/* eslint-disable */ true ? (module['exports'] = factory(null)) : typeof define === 'function' && define['amd'] ? define(factory(null)) : (window['stylis'] = factory(null)) }(/** @param {*=} options */function factory (options) {/* eslint-disable */ 'use strict' /** * Notes * * The [''] pattern is used to support closure compiler * the jsdoc signatures are also used to the same effect * * ---- * * int + int + int === n4 [faster] * * vs * * int === n1 && int === n2 && int === n3 * * ---- * * switch (int) { case ints...} [faster] * * vs * * if (int == 1 && int === 2 ...) * * ---- * * The (first*n1 + second*n2 + third*n3) format used in the property parser * is a simple way to hash the sequence of characters * taking into account the index they occur in * since any number of 3 character sequences could produce duplicates. * * On the other hand sequences that are directly tied to the index of the character * resolve a far more accurate measure, it's also faster * to evaluate one condition in a switch statement * than three in an if statement regardless of the added math. * * This allows the vendor prefixer to be both small and fast. */ var nullptn = /^\0+/g /* matches leading null characters */ var formatptn = /[\0\r\f]/g /* matches new line, null and formfeed characters */ var colonptn = /: */g /* splits animation rules */ var cursorptn = /zoo|gra/ /* assert cursor varient */ var transformptn = /([,: ])(transform)/g /* vendor prefix transform, older webkit */ var animationptn = /,+\s*(?![^(]*[)])/g /* splits multiple shorthand notation animations */ var propertiesptn = / +\s*(?![^(]*[)])/g /* animation properties */ var elementptn = / *[\0] */g /* selector elements */ var selectorptn = /,\r+?/g /* splits selectors */ var andptn = /([\t\r\n ])*\f?&/g /* match & */ var escapeptn = /:global\(((?:[^\(\)\[\]]*|\[.*\]|\([^\(\)]*\))*)\)/g /* matches :global(.*) */ var invalidptn = /\W+/g /* removes invalid characters from keyframes */ var keyframeptn = /@(k\w+)\s*(\S*)\s*/ /* matches @keyframes $1 */ var plcholdrptn = /::(place)/g /* match ::placeholder varient */ var readonlyptn = /:(read-only)/g /* match :read-only varient */ var beforeptn = /\s+(?=[{\];=:>])/g /* matches \s before ] ; = : */ var afterptn = /([[}=:>])\s+/g /* matches \s after characters [ } = : */ var tailptn = /(\{[^{]+?);(?=\})/g /* matches tail semi-colons ;} */ var whiteptn = /\s{2,}/g /* matches repeating whitespace */ var pseudoptn = /([^\(])(:+) */g /* pseudo element */ var writingptn = /[svh]\w+-[tblr]{2}/ /* match writing mode property values */ var gradientptn = /([\w-]+t\()/g /* match *gradient property */ var supportsptn = /\(\s*(.*)\s*\)/g /* match supports (groups) */ var propertyptn = /([\s\S]*?);/g /* match properties leading semicolon */ var selfptn = /-self|flex-/g /* match flex- and -self in align-self: flex-*; */ var pseudofmt = /[^]*?(:[rp][el]a[\w-]+)[^]*/ /* extrats :readonly or :placholder from selector */ var trimptn = /[ \t]+$/ /* match tail whitspace */ var dimensionptn = /stretch|:\s*\w+\-(?:conte|avail)/ /* match max/min/fit-content, fill-available */ var imgsrcptn = /([^-])(image-set\()/ /* vendors */ var webkit = '-webkit-' var moz = '-moz-' var ms = '-ms-' /* character codes */ var SEMICOLON = 59 /* ; */ var CLOSEBRACES = 125 /* } */ var OPENBRACES = 123 /* { */ var OPENPARENTHESES = 40 /* ( */ var CLOSEPARENTHESES = 41 /* ) */ var OPENBRACKET = 91 /* [ */ var CLOSEBRACKET = 93 /* ] */ var NEWLINE = 10 /* \n */ var CARRIAGE = 13 /* \r */ var TAB = 9 /* \t */ var AT = 64 /* @ */ var SPACE = 32 /* */ var AND = 38 /* & */ var DASH = 45 /* - */ var UNDERSCORE = 95 /* _ */ var STAR = 42 /* * */ var COMMA = 44 /* , */ var COLON = 58 /* : */ var SINGLEQUOTE = 39 /* ' */ var DOUBLEQUOTE = 34 /* " */ var FOWARDSLASH = 47 /* / */ var GREATERTHAN = 62 /* > */ var PLUS = 43 /* + */ var TILDE = 126 /* ~ */ var NULL = 0 /* \0 */ var FORMFEED = 12 /* \f */ var VERTICALTAB = 11 /* \v */ /* special identifiers */ var KEYFRAME = 107 /* k */ var MEDIA = 109 /* m */ var SUPPORTS = 115 /* s */ var PLACEHOLDER = 112 /* p */ var READONLY = 111 /* o */ var IMPORT = 105 /* i */ var CHARSET = 99 /* c */ var DOCUMENT = 100 /* d */ var PAGE = 112 /* p */ var column = 1 /* current column */ var line = 1 /* current line numebr */ var pattern = 0 /* :pattern */ var cascade = 1 /* #id h1 h2 vs h1#id h2#id */ var prefix = 1 /* vendor prefix */ var escape = 1 /* escape :global() pattern */ var compress = 0 /* compress output */ var semicolon = 0 /* no/semicolon option */ var preserve = 0 /* preserve empty selectors */ /* empty reference */ var array = [] /* plugins */ var plugins = [] var plugged = 0 var should = null /* plugin context */ var POSTS = -2 var PREPS = -1 var UNKWN = 0 var PROPS = 1 var BLCKS = 2 var ATRUL = 3 /* plugin newline context */ var unkwn = 0 /* keyframe animation */ var keyed = 1 var key = '' /* selector namespace */ var nscopealt = '' var nscope = '' /** * Compile * * @param {Array} parent * @param {Array} current * @param {string} body * @param {number} id * @param {number} depth * @return {string} */ function compile (parent, current, body, id, depth) { var bracket = 0 /* brackets [] */ var comment = 0 /* comments /* // or /* */ var parentheses = 0 /* functions () */ var quote = 0 /* quotes '', "" */ var first = 0 /* first character code */ var second = 0 /* second character code */ var code = 0 /* current character code */ var tail = 0 /* previous character code */ var trail = 0 /* character before previous code */ var peak = 0 /* previous non-whitespace code */ var counter = 0 /* count sequence termination */ var context = 0 /* track current context */ var atrule = 0 /* track @at-rule context */ var pseudo = 0 /* track pseudo token index */ var caret = 0 /* current character index */ var format = 0 /* control character formating context */ var insert = 0 /* auto semicolon insertion */ var invert = 0 /* inverted selector pattern */ var length = 0 /* generic length address */ var eof = body.length /* end of file(length) */ var eol = eof - 1 /* end of file(characters) */ var char = '' /* current character */ var chars = '' /* current buffer of characters */ var child = '' /* next buffer of characters */ var out = '' /* compiled body */ var children = '' /* compiled children */ var flat = '' /* compiled leafs */ var selector /* generic selector address */ var result /* generic address */ // ...build body while (caret < eof) { code = body.charCodeAt(caret) // eof varient if (caret === eol) { // last character + noop context, add synthetic padding for noop context to terminate if (comment + quote + parentheses + bracket !== 0) { if (comment !== 0) { code = comment === FOWARDSLASH ? NEWLINE : FOWARDSLASH } quote = parentheses = bracket = 0 eof++ eol++ } } if (comment + quote + parentheses + bracket === 0) { // eof varient if (caret === eol) { if (format > 0) { chars = chars.replace(formatptn, '') } if (chars.trim().length > 0) { switch (code) { case SPACE: case TAB: case SEMICOLON: case CARRIAGE: case NEWLINE: { break } default: { chars += body.charAt(caret) } } code = SEMICOLON } } // auto semicolon insertion if (insert === 1) { switch (code) { // false flags case OPENBRACES: case CLOSEBRACES: case SEMICOLON: case DOUBLEQUOTE: case SINGLEQUOTE: case OPENPARENTHESES: case CLOSEPARENTHESES: case COMMA: { insert = 0 } // ignore case TAB: case CARRIAGE: case NEWLINE: case SPACE: { break } // valid default: { insert = 0 length = caret first = code caret-- code = SEMICOLON while (length < eof) { switch (body.charCodeAt(length++)) { case NEWLINE: case CARRIAGE: case SEMICOLON: { ++caret code = first length = eof break } case COLON: { if (format > 0) { ++caret code = first } } case OPENBRACES: { length = eof } } } } } } // token varient switch (code) { case OPENBRACES: { chars = chars.trim() first = chars.charCodeAt(0) counter = 1 length = ++caret while (caret < eof) { switch (code = body.charCodeAt(caret)) { case OPENBRACES: { counter++ break } case CLOSEBRACES: { counter-- break } case FOWARDSLASH: { switch (second = body.charCodeAt(caret + 1)) { // /*, // case STAR: case FOWARDSLASH: { caret = delimited(second, caret, eol, body) } } break } // given "[" === 91 & "]" === 93 hence forth 91 + 1 + 1 === 93 case OPENBRACKET: { code++ } // given "(" === 40 & ")" === 41 hence forth 40 + 1 === 41 case OPENPARENTHESES: { code++ } // quote tail delimiter is identical to the head delimiter hence noop, // fallthrough clauses have been shifted to the correct tail delimiter case DOUBLEQUOTE: case SINGLEQUOTE: { while (caret++ < eol) { if (body.charCodeAt(caret) === code) { break } } } } if (counter === 0) { break } caret++ } child = body.substring(length, caret) if (first === NULL) { first = (chars = chars.replace(nullptn, '').trim()).charCodeAt(0) } switch (first) { // @at-rule case AT: { if (format > 0) { chars = chars.replace(formatptn, '') } second = chars.charCodeAt(1) switch (second) { case DOCUMENT: case MEDIA: case SUPPORTS: case DASH: { selector = current break } default: { selector = array } } child = compile(current, selector, child, second, depth+1) length = child.length // preserve empty @at-rule if (preserve > 0 && length === 0) { length = chars.length } // execute plugins, @at-rule context if (plugged > 0) { selector = select(array, chars, invert) result = proxy(ATRUL, child, selector, current, line, column, length, second, depth, id) chars = selector.join('') if (result !== void 0) { if ((length = (child = result.trim()).length) === 0) { second = 0 child = '' } } } if (length > 0) { switch (second) { case SUPPORTS: { chars = chars.replace(supportsptn, supports) } case DOCUMENT: case MEDIA: case DASH: { child = chars + '{' + child + '}' break } case KEYFRAME: { chars = chars.replace(keyframeptn, '$1 $2' + (keyed > 0 ? key : '')) child = chars + '{' + child + '}' if (prefix === 1 || (prefix === 2 && vendor('@'+child, 3))) { child = '@' + webkit + child + '@' + child } else { child = '@' + child } break } default: { child = chars + child if (id === PAGE) { child = (out += child, '') } } } } else { child = '' } break } // selector default: { child = compile(current, select(current, chars, invert), child, id, depth+1) } } children += child // reset context = 0 insert = 0 pseudo = 0 format = 0 invert = 0 atrule = 0 chars = '' child = '' code = body.charCodeAt(++caret) break } case CLOSEBRACES: case SEMICOLON: { chars = (format > 0 ? chars.replace(formatptn, '') : chars).trim() if ((length = chars.length) > 1) { // monkey-patch missing colon if (pseudo === 0) { first = chars.charCodeAt(0) // first character is a letter or dash, buffer has a space character if ((first === DASH || first > 96 && first < 123)) { length = (chars = chars.replace(' ', ':')).length } } // execute plugins, property context if (plugged > 0) { if ((result = proxy(PROPS, chars, current, parent, line, column, out.length, id, depth, id)) !== void 0) { if ((length = (chars = result.trim()).length) === 0) { chars = '\0\0' } } } first = chars.charCodeAt(0) second = chars.charCodeAt(1) switch (first) { case NULL: { break } case AT: { if (second === IMPORT || second === CHARSET) { flat += chars + body.charAt(caret) break } } default: { if (chars.charCodeAt(length-1) === COLON) { break } out += property(chars, first, second, chars.charCodeAt(2)) } } } // reset context = 0 insert = 0 pseudo = 0 format = 0 invert = 0 chars = '' code = body.charCodeAt(++caret) break } } } // parse characters switch (code) { case CARRIAGE: case NEWLINE: { // auto insert semicolon if (comment + quote + parentheses + bracket + semicolon === 0) { // valid non-whitespace characters that // may precede a newline switch (peak) { case CLOSEPARENTHESES: case SINGLEQUOTE: case DOUBLEQUOTE: case AT: case TILDE: case GREATERTHAN: case STAR: case PLUS: case FOWARDSLASH: case DASH: case COLON: case COMMA: case SEMICOLON: case OPENBRACES: case CLOSEBRACES: { break } default: { // current buffer has a colon if (pseudo > 0) { insert = 1 } } } } // terminate line comment if (comment === FOWARDSLASH) { comment = 0 } else if (cascade + context === 0 && id !== KEYFRAME && chars.length > 0) { format = 1 chars += '\0' } // execute plugins, newline context if (plugged * unkwn > 0) { proxy(UNKWN, chars, current, parent, line, column, out.length, id, depth, id) } // next line, reset column position column = 1 line++ break } case SEMICOLON: case CLOSEBRACES: { if (comment + quote + parentheses + bracket === 0) { column++ break } } default: { // increment column position column++ // current character char = body.charAt(caret) // remove comments, escape functions, strings, attributes and prepare selectors switch (code) { case TAB: case SPACE: { if (quote + bracket + comment === 0) { switch (tail) { case COMMA: case COLON: case TAB: case SPACE: { char = '' break } default: { if (code !== SPACE) { char = ' ' } } } } break } // escape breaking control characters case NULL: { char = '\\0' break } case FORMFEED: { char = '\\f' break } case VERTICALTAB: { char = '\\v' break } // & case AND: { // inverted selector pattern i.e html & if (quote + comment + bracket === 0 && cascade > 0) { invert = 1 format = 1 char = '\f' + char } break } // ::paceholder, l // :read-ony, l case 108: { if (quote + comment + bracket + pattern === 0 && pseudo > 0) { switch (caret - pseudo) { // ::placeholder case 2: { if (tail === PLACEHOLDER && body.charCodeAt(caret-3) === COLON) { pattern = tail } } // :read-only case 8: { if (trail === READONLY) { pattern = trail } } } } break } // : case COLON: { if (quote + comment + bracket === 0) { pseudo = caret } break } // selectors case COMMA: { if (comment + parentheses + quote + bracket === 0) { format = 1 char += '\r' } break } // quotes case DOUBLEQUOTE: case SINGLEQUOTE: { if (comment === 0) { quote = quote === code ? 0 : (quote === 0 ? code : quote) } break } // attributes case OPENBRACKET: { if (quote + comment + parentheses === 0) { bracket++ } break } case CLOSEBRACKET: { if (quote + comment + parentheses === 0) { bracket-- } break } // functions case CLOSEPARENTHESES: { if (quote + comment + bracket === 0) { parentheses-- } break } case OPENPARENTHESES: { if (quote + comment + bracket === 0) { if (context === 0) { switch (tail*2 + trail*3) { // :matches case 533: { break } // :global, :not, :nth-child etc... default: { counter = 0 context = 1 } } } parentheses++ } break } case AT: { if (comment + parentheses + quote + bracket + pseudo + atrule === 0) { atrule = 1 } break } // block/line comments case STAR: case FOWARDSLASH: { if (quote + bracket + parentheses > 0) { break } switch (comment) { // initialize line/block comment context case 0: { switch (code*2 + body.charCodeAt(caret+1)*3) { // // case 235: { comment = FOWARDSLASH break } // /* case 220: { length = caret comment = STAR break } } break } // end block comment context case STAR: { if (code === FOWARDSLASH && tail === STAR && length + 2 !== caret) { // /* ... */, ! if (body.charCodeAt(length+2) === 33) { out += body.substring(length, caret+1) } char = '' comment = 0 } } } } } // ignore comment blocks if (comment === 0) { // aggressive isolation mode, divide each individual selector // including selectors in :not function but excluding selectors in :global function if (cascade + quote + bracket + atrule === 0 && id !== KEYFRAME && code !== SEMICOLON) { switch (code) { case COMMA: case TILDE: case GREATERTHAN: case PLUS: case CLOSEPARENTHESES: case OPENPARENTHESES: { if (context === 0) { // outside of an isolated context i.e nth-child(<...>) switch (tail) { case TAB: case SPACE: case NEWLINE: case CARRIAGE: { char = char + '\0' break } default: { char = '\0' + char + (code === COMMA ? '' : '\0') } } format = 1 } else { // within an isolated context, sleep untill it's terminated switch (code) { case OPENPARENTHESES: { // :globa( if (pseudo + 7 === caret && tail === 108) { pseudo = 0 } context = ++counter break } case CLOSEPARENTHESES: { if ((context = --counter) === 0) { format = 1 char += '\0' } break } } } break } case TAB: case SPACE: { switch (tail) { case NULL: case OPENBRACES: case CLOSEBRACES: case SEMICOLON: case COMMA: case FORMFEED: case TAB: case SPACE: case NEWLINE: case CARRIAGE: { break } default: { // ignore in isolated contexts if (context === 0) { format = 1 char += '\0' } } } } } } // concat buffer of characters chars += char // previous non-whitespace character code if (code !== SPACE && code !== TAB) { peak = code } } } } // tail character codes trail = tail tail = code // visit every character caret++ } length = out.length // preserve empty selector if (preserve > 0) { if (length === 0 && children.length === 0 && (current[0].length === 0) === false) { if (id !== MEDIA || (current.length === 1 && (cascade > 0 ? nscopealt : nscope) === current[0])) { length = current.join(',').length + 2 } } } if (length > 0) { // cascade isolation mode? selector = cascade === 0 && id !== KEYFRAME ? isolate(current) : current // execute plugins, block context if (plugged > 0) { result = proxy(BLCKS, out, selector, parent, line, column, length, id, depth, id) if (result !== void 0 && (out = result).length === 0) { return flat + out + children } } out = selector.join(',') + '{' + out + '}' if (prefix*pattern !== 0) { if (prefix === 2 && !vendor(out, 2)) pattern = 0 switch (pattern) { // ::read-only case READONLY: { out = out.replace(readonlyptn, ':'+moz+'$1')+out break } // ::placeholder case PLACEHOLDER: { out = ( out.replace(plcholdrptn, '::' + webkit + 'input-$1') + out.replace(plcholdrptn, '::' + moz + '$1') + out.replace(plcholdrptn, ':' + ms + 'input-$1') + out ) break } } pattern = 0 } } return flat + out + children } /** * Select * * @param {Array} parent * @param {string} current * @param {number} invert * @return {Array} */ function select (parent, current, invert) { var selectors = current.trim().split(selectorptn) var out = selectors var length = selectors.length var l = parent.length switch (l) { // 0-1 parent selectors case 0: case 1: { for (var i = 0, selector = l === 0 ? '' : parent[0] + ' '; i < length; ++i) { out[i] = scope(selector, out[i], invert, l).trim() } break } // >2 parent selectors, nested default: { for (var i = 0, j = 0, out = []; i < length; ++i) { for (var k = 0; k < l; ++k) { out[j++] = scope(parent[k] + ' ', selectors[i], invert, l).trim() } } } } return out } /** * Scope * * @param {string} parent * @param {string} current * @param {number} invert * @param {number} level * @return {string} */ function scope (parent, current, invert, level) { var selector = current var code = selector.charCodeAt(0) // trim leading whitespace if (code < 33) { code = (selector = selector.trim()).charCodeAt(0) } switch (code) { // & case AND: { switch (cascade + level) { case 0: case 1: { if (parent.trim().length === 0) { break } } default: { return selector.replace(andptn, '$1'+parent.trim()) } } break } // : case COLON: { switch (selector.charCodeAt(1)) { // g in :global case 103: { if (escape > 0 && cascade > 0) { return selector.replace(escapeptn, '$1').replace(andptn, '$1'+nscope) } break } default: { // :hover return parent.trim() + selector.replace(andptn, '$1'+parent.trim()) } } } default: { // html & if (invert*cascade > 0 && selector.indexOf('\f') > 0) { return selector.replace(andptn, (parent.charCodeAt(0) === COLON ? '' : '$1')+parent.trim()) } } } return parent + selector } /** * Property * * @param {string} input * @param {number} first * @param {number} second * @param {number} third * @return {string} */ function property (input, first, second, third) { var index = 0 var out = input + ';' var hash = (first*2) + (second*3) + (third*4) var cache // animation: a, n, i characters if (hash === 944) { return animation(out) } else if (prefix === 0 || (prefix === 2 && !vendor(out, 1))) { return out } // vendor prefix switch (hash) { // text-decoration/text-size-adjust/text-shadow/text-align/text-transform: t, e, x case 1015: { // text-shadow/text-align/text-transform, a return out.charCodeAt(10) === 97 ? webkit + out + out : out } // filter/fill f, i, l case 951: { // filter, t return out.charCodeAt(3) === 116 ? webkit + out + out : out } // color/column, c, o, l case 963: { // column, n return out.charCodeAt(5) === 110 ? webkit + out + out : out } // box-decoration-break, b, o, x case 1009: { if (out.charCodeAt(4) !== 100) { break } } // mask, m, a, s // clip-path, c, l, i case 969: case 942: { return webkit + out + out } // appearance: a, p, p case 978: { return webkit + out + moz + out + out } // hyphens: h, y, p // user-select: u, s, e case 1019: case 983: { return webkit + out + moz + out + ms + out + out } // background/backface-visibility, b, a, c case 883: { // backface-visibility, - if (out.charCodeAt(8) === DASH) { return webkit + out + out } // image-set(...) if (out.indexOf('image-set(', 11) > 0) { return out.replace(imgsrcptn, '$1'+webkit+'$2') + out } return out } // flex: f, l, e case 932: { if (out.charCodeAt(4) === DASH) { switch (out.charCodeAt(5)) { // flex-grow, g case 103: { return webkit + 'box-' + out.replace('-grow', '') + webkit + out + ms + out.replace('grow', 'positive') + out } // flex-shrink, s case 115: { return webkit + out + ms + out.replace('shrink', 'negative') + out } // flex-basis, b case 98: { return webkit + out + ms + out.replace('basis', 'preferred-size') + out } } } return webkit + out + ms + out + out } // order: o, r, d case 964: { return webkit + out + ms + 'flex' + '-' + out + out } // justify-items/justify-content, j, u, s case 1023: { // justify-content, c if (out.charCodeAt(8) !== 99) { break } cache = out.substring(out.indexOf(':', 15)).replace('flex-', '').replace('space-between', 'justify') return webkit + 'box-pack' + cache + webkit + out + ms + 'flex-pack' + cache + out } // cursor, c, u, r case 1005: { return cursorptn.test(out) ? out.replace(colonptn, ':' + webkit) + out.replace(colonptn, ':' + moz) + out : out } // writing-mode, w, r, i case 1000: { cache = out.substring(13).trim() index = cache.indexOf('-') + 1 switch (cache.charCodeAt(0)+cache.charCodeAt(index)) { // vertical-lr case 226: { cache = out.replace(writingptn, 'tb') break } // vertical-rl case 232: { cache = out.replace(writingptn, 'tb-rl') break } // horizontal-tb case 220: { cache = out.replace(writingptn, 'lr') break } default: { return out } } return webkit + out + ms + cache + out } // position: sticky case 1017: { if (out.indexOf('sticky', 9) === -1) { return out } } // display(flex/inline-flex/inline-box): d, i, s case 975: { index = (out = input).length - 10 cache = (out.charCodeAt(index) === 33 ? out.substring(0, index) : out).substring(input.indexOf(':', 7) + 1).trim() switch (hash = cache.charCodeAt(0) + (cache.charCodeAt(7)|0)) { // inline- case 203: { // inline-box if (cache.charCodeAt(8) < 111) { break } } // inline-box/sticky case 115: { out = out.replace(cache, webkit+cache)+';'+out break } // inline-flex // flex case 207: case 102: { out = ( out.replace(cache, webkit+(hash > 102 ? 'inline-' : '')+'box')+';'+ out.replace(cache, webkit+cache)+';'+ out.replace(cache, ms+cache+'box')+';'+ out ) } } return out + ';' } // align-items, align-center, align-self: a, l, i, - case 938: { if (out.charCodeAt(5) === DASH) { switch (out.charCodeAt(6)) { // align-items, i case 105: { cache = out.replace('-items', '') return webkit + out + webkit + 'box-' + cache + ms + 'flex-' + cache + out } // align-self, s case 115: { return webkit + out + ms + 'flex-item-' + out.replace(selfptn, '') + out } // align-content default: { return webkit + out + ms + 'flex-line-pack' + out.replace('align-content', '').replace(selfptn, '') + out } } } break } // min/max case 973: case 989: { // min-/max- height/width/block-size/inline-size if (out.charCodeAt(3) !== DASH || out.charCodeAt(4) === 122) { break } } // height/width: min-content / width: max-content case 931: case 953: { if (dimensionptn.test(input) === true) { // stretch if ((cache = input.substring(input.indexOf(':') + 1)).charCodeAt(0) === 115) return property(input.replace('stretch', 'fill-available'), first, second, third).replace(':fill-available', ':stretch') else return out.replace(cache, webkit + cache) + out.replace(cache, moz + cache.replace('fill-', '')) + out } break } // transform, transition: t, r, a case 962: { out = webkit + out + (out.charCodeAt(5) === 102 ? ms + out : '') + out // transitions if (second + third === 211 && out.charCodeAt(13) === 105 && out.indexOf('transform', 10) > 0) { return out.substring(0, out.indexOf(';', 27) + 1).replace(transformptn, '$1' + webkit + '$2') + out } break } } return out } /** * Vendor * * @param {string} content * @param {number} context * @return {boolean} */ function vendor (content, context) { var index = content.indexOf(context === 1 ? ':' : '{') var key = content.substring(0, context !== 3 ? index : 10) var value = content.substring(index + 1, content.length - 1) return should(context !== 2 ? key : key.replace(pseudofmt, '$1'), value, context) } /** * Supports * * @param {string} match * @param {string} group * @return {string} */ function supports (match, group) { var out = property(group, group.charCodeAt(0), group.charCodeAt(1), group.charCodeAt(2)) return out !== group+';' ? out.replace(propertyptn, ' or ($1)').substring(4) : '('+group+')' } /** * Animation * * @param {string} input * @return {string} */ function animation (input) { var length = input.length var index = input.indexOf(':', 9) + 1 var declare = input.substring(0, index).trim() var out = input.substring(index, length-1).trim() switch (input.charCodeAt(9)*keyed) { case 0: { break } // animation-*, - case DASH: { // animation-name, n if (input.charCodeAt(10) !== 110) { break } } // animation/animation-name default: { // split in case of multiple animations var list = out.split((out = '', animationptn)) for (var i = 0, index = 0, length = list.length; i < length; index = 0, ++i) { var value = list[i] var items = value.split(propertiesptn) while (value = items[index]) { var peak = value.charCodeAt(0) if (keyed === 1 && ( // letters (peak > AT && peak < 90) || (peak > 96 && peak < 123) || peak === UNDERSCORE || // dash but not in sequence i.e -- (peak === DASH && value.charCodeAt(1) !== DASH) )) { // not a number/function switch (isNaN(parseFloat(value)) + (value.indexOf('(') !== -1)) { case 1: { switch (value) { // not a valid reserved keyword case 'infinite': case 'alternate': case 'backwards': case 'running': case 'normal': case 'forwards': case 'both': case 'none': case 'linear': case 'ease': case 'ease-in': case 'ease-out': case 'ease-in-out': case 'paused': case 'reverse': case 'alternate-reverse': case 'inherit': case 'initial': case 'unset': case 'step-start': case 'step-end': { break } default: { value += key } } } } } items[index++] = value } out += (i === 0 ? '' : ',') + items.join(' ') } } } out = declare + out + ';' if (prefix === 1 || (prefix === 2 && vendor(out, 1))) return webkit + out + out return out } /** * Isolate * * @param {Array} current */ function isolate (current) { for (var i = 0, length = current.length, selector = Array(length), padding, element; i < length; ++i) { // split individual elements in a selector i.e h1 h2 === [h1, h2] var elements = current[i].split(elementptn) var out = '' for (var j = 0, size = 0, tail = 0, code = 0, l = elements.length; j < l; ++j) { // empty element if ((size = (element = elements[j]).length) === 0 && l > 1) { continue } tail = out.charCodeAt(out.length-1) code = element.charCodeAt(0) padding = '' if (j !== 0) { // determine if we need padding switch (tail) { case STAR: case TILDE: case GREATERTHAN: case PLUS: case SPACE: case OPENPARENTHESES: { break } default: { padding = ' ' } } } switch (code) { case AND: { element = padding + nscopealt } case TILDE: case GREATERTHAN: case PLUS: case SPACE: case CLOSEPARENTHESES: case OPENPARENTHESES: { break } case OPENBRACKET: { element = padding + element + nscopealt break } case COLON: { switch (element.charCodeAt(1)*2 + element.charCodeAt(2)*3) { // :global case 530: { if (escape > 0) { element = padding + element.substring(8, size - 1) break } } // :hover, :nth-child(), ... default: { if (j < 1 || elements[j-1].length < 1) { element = padding + nscopealt + element } } } break } case COMMA: { padding = '' } default: { if (size > 1 && element.indexOf(':') > 0) { element = padding + element.replace(pseudoptn, '$1' + nscopealt + '$2') } else { element = padding + element + nscopealt } } } out += element } selector[i] = out.replace(formatptn, '').trim() } return selector } /** * Proxy * * @param {number} context * @param {string} content * @param {Array} selectors * @param {Array} parents * @param {number} line * @param {number} column * @param {number} length * @param {number} id * @param {number} depth * @param {number} at * @return {(string|void|*)} */ function proxy (context, content, selectors, parents, line, column, length, id, depth, at) { for (var i = 0, out = content, next; i < plugged; ++i) { switch (next = plugins[i].call(stylis, context, out, selectors, parents, line, column, length, id, depth, at)) { case void 0: case false: case true: case null: { break } default: { out = next } } } if (out !== content) { return out } } /** * @param {number} code * @param {number} index * @param {number} length * @param {string} body * @return {number} */ function delimited (code, index, length, body) { for (var i = index + 1; i < length; ++i) { switch (body.charCodeAt(i)) { // /* case FOWARDSLASH: { if (code === STAR) { if (body.charCodeAt(i - 1) === STAR && index + 2 !== i) { return i + 1 } } break } // // case NEWLINE: { if (code === FOWARDSLASH) { return i + 1 } } } } return i } /** * @param {number} type * @param {number} index * @param {number} length * @param {number} find * @param {string} body * @return {number} */ function match (type, index, length, body) { for (var i = index + 1; i < length; ++i) { switch (body.charCodeAt(i)) { case type: { return i } } } return i } /** * Minify * * @param {(string|*)} output * @return {string} */ function minify (output) { return output .replace(formatptn, '') .replace(beforeptn, '') .replace(afterptn, '$1') .replace(tailptn, '$1') .replace(whiteptn, ' ') } /** * Use * * @param {(Array|function(...?)|number|void)?} plugin */ function use (plugin) { switch (plugin) { case void 0: case null: { plugged = plugins.length = 0 break } default: { if (typeof plugin === 'function') { plugins[plugged++] = plugin } else if (typeof plugin === 'object') { for (var i = 0, length = plugin.length; i < length; ++i) { use(plugin[i]) } } else { unkwn = !!plugin|0 } } } return use } /** * Set * * @param {*} options */ function set (options) { for (var name in options) { var value = options[name] switch (name) { case 'keyframe': keyed = value|0; break case 'global': escape = value|0; break case 'cascade': cascade = value|0; break case 'compress': compress = value|0; break case 'semicolon': semicolon = value|0; break case 'preserve': preserve = value|0; break case 'prefix': should = null if (!value) { prefix = 0 } else if (typeof value !== 'function') { prefix = 1 } else { prefix = 2 should = value } } } return set } /** * Stylis * * @param {string} selector * @param {string} input * @return {*} */ function stylis (selector, input) { if (this !== void 0 && this.constructor === stylis) { return factory(selector) } // setup var ns = selector var code = ns.charCodeAt(0) // trim leading whitespace if (code < 33) { code = (ns = ns.trim()).charCodeAt(0) } // keyframe/animation namespace if (keyed > 0) { key = ns.replace(invalidptn, code === OPENBRACKET ? '' : '-') } // reset, used to assert if a plugin is moneky-patching the return value code = 1 // cascade/isolate if (cascade === 1) { nscope = ns } else { nscopealt = ns } var selectors = [nscope] var result // execute plugins, pre-process context if (plugged > 0) { result = proxy(PREPS, input, selectors, selectors, line, column, 0, 0, 0, 0) if (result !== void 0 && typeof result === 'string') { input = result } } // build var output = compile(array, selectors, input, 0, 0) // execute plugins, post-process context if (plugged > 0) { result = proxy(POSTS, output, selectors, selectors, line, column, output.length, 0, 0, 0) // bypass minification if (result !== void 0 && typeof(output = result) !== 'string') { code = 0 } } // reset key = '' nscope = '' nscopealt = '' pattern = 0 line = 1 column = 1 return compress*code === 0 ? output : minify(output) } stylis['use'] = use stylis['set'] = set if (options !== void 0) { set(options) } return stylis })); /***/ }), /***/ "Sfud": /***/ (function(module, exports, __webpack_require__) { "use strict"; var _interopRequireDefault = __webpack_require__("ouCL"); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _taggedTemplateLiteral2 = _interopRequireDefault(__webpack_require__("hRBA")); var _classCallCheck2 = _interopRequireDefault(__webpack_require__("Q9dM")); var _createClass2 = _interopRequireDefault(__webpack_require__("wm7F")); var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__("F6AD")); var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__("fghW")); var _inherits2 = _interopRequireDefault(__webpack_require__("QwVp")); __webpack_require__("yQBS"); var _tabs = _interopRequireDefault(__webpack_require__("qA/u")); var _react = _interopRequireWildcard(__webpack_require__("GiK3")); var _styledComponents = _interopRequireDefault(__webpack_require__("w2vo")); var _api = __webpack_require__("H/Zg"); __webpack_require__("iTA7"); var _templateObject; function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); } function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } // import { Modal, Button,Alert,Table } from 'antd'; var TabPane = _tabs.default.TabPane; // import { // enterpriseInsCominsPromptInitPerAddDelIns, //获取保全缴费记录 // } from "../../../services/api"; // const columns = [{ // title: '订单号', // dataIndex: 'no', // }, { // title: '保险产品', // dataIndex: 'product', // }, { // title: '人数(人)', // dataIndex: 'number', // }, { // title: '购买时间', // dataIndex: 'time', // }, { // title: '保费(元)', // dataIndex: 'price', // }]; // const data = [{ // key: '1', // no: '895846714563489792', // product: '安保无忧全年意外险(30万计划)', // number: '100', // time:'2017-12-12', // price:'100元', // }, { // key: '2', // no: '895846714563489792', // product: '安保无忧全年意外险(30万计划)', // number: '100', // time:'2017-12-12', // price:'100元', // }, { // key: '3', // no: '895846714563489792', // product: '安保无忧全年意外险(30万计划)', // number: '100', // time:'2017-12-12', // price:'100元', // }, { // key: '4', // no: '895846714563489792', // product: '安保无忧全年意外险(30万计划)', // number: '100', // time:'2017-12-12', // price:'100元', // }, { // key: '5', // no: '895846714563489792', // product: '安保无忧全年意外险(30万计划)', // number: '100', // time:'2017-12-12', // price:'100元', // }, { // key: '6', // no: '895846714563489792', // product: '安保无忧全年意外险(30万计划)', // number: '100', // time:'2017-12-12', // price:'100元', // }, { // key: '7', // no: '895846714563489792', // product: '安保无忧全年意外险(30万计划)', // number: '100', // time:'2017-12-12', // price:'100元', // }, { // key: '8', // no: '895846714563489792', // product: '安保无忧全年意外险(30万计划)', // number: '100', // time:'2017-12-12', // price:'100元', // }]; // const rowSelection = { // onChange: (selectedRowKeys, selectedRows) => { // console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows); // }, // getCheckboxProps: record => ({ // disabled: record.name === 'Disabled User', // name: record.name, // }), // }; var InsurancePreservation = exports.default = /*#__PURE__*/function (_PureComponent) { function InsurancePreservation(props, context) { var _this; (0, _classCallCheck2.default)(this, InsurancePreservation); _this = _callSuper(this, InsurancePreservation, [props, context]); //在线购买保险的链接生成 _this.messageOnline = function () { (0, _api.enterpriseInsComInsGetOnlineInsBlbPreservationPageLink)({}).then(function (data) { _this.setState({ onlineUrl: data.data }); }); }; _this.handleonline = function () { setTimeout(function () { window.open(_this.state.onlineUrl); }, 500); }; _this.state = { // visible: false, // reducepeoplevisible:false, // addpeoplevisible:false, onlineUrl: "" //购买在线保险的url }; return _this; } /************************ajax请求********************************* */ //获取保全缴费记录 // getCollectResume = () => { // // const comId = 1; // // const pageSize = 10; // // const pageNumber = 1; // enterpriseInsCominsPromptInitPerAddDelIns({ }).then((res) => { // console.log("获取保全缴费记录成功:", res); // }, (err) => { // console.log("获取保全缴费记录失败:", err); // }); // } // showModal = () => { // this.setState({ // visible: true, // }); // } // handleOk = (e) => { // console.log(e); // this.setState({ // visible: false, // }); // } // handleCancel = (e) => { // console.log(e); // this.setState({ // visible: false, // }); // } //保险减员提示 // showreducepeopleModal = () => { // this.setState({ // reducepeoplevisible: true, // }); // } // handlereducepeopleOk = (e) => { // console.log(e); // this.setState({ // reducepeoplevisible: false, // addpeoplevisible:false, // }); // // this.getCollectResume(); // } // handlereducepeopleCancel = (e) => { // console.log(e); // this.setState({ // reducepeoplevisible: false, // addpeoplevisible:false, // }); // } // // 保险增员提示 // showaddpeopleModal = () => { // this.setState({ // addpeoplevisible:true, // }); // } // componentWillMount() { // this.messageOnline(); // } (0, _inherits2.default)(InsurancePreservation, _PureComponent); return (0, _createClass2.default)(InsurancePreservation, [{ key: "componentDidMount", value: function componentDidMount() { this.messageOnline(); // this.handleonline(); } }, { key: "render", value: function render() { return /*#__PURE__*/_react.default.createElement(Container, null, /*#__PURE__*/_react.default.createElement("iframe", { title: "\u4FDD\u5168\u7F34\u8D39\u8BB0\u5F55", src: this.state.onlineUrl, width: "100%", frameBorder: "0", style: { height: "calc(100vh)" } })); } }]); }(_react.PureComponent); var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n padding:10px 24px 24px;\n div{\n button{\n margin:5px auto;\n }\n }\n"]))); /***/ }), /***/ "hRBA": /***/ (function(module, exports) { function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } module.exports = _taggedTemplateLiteral; /***/ }), /***/ "iTA7": /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /***/ "mL1Z": /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @typechecks */ var hyphenate = __webpack_require__("APD3"); var msPattern = /^ms-/; /** * Hyphenates a camelcased CSS property name, for example: * * > hyphenateStyleName('backgroundColor') * < "background-color" * > hyphenateStyleName('MozTransition') * < "-moz-transition" * > hyphenateStyleName('msTransition') * < "-ms-transition" * * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix * is converted to `-ms-`. * * @param {string} string * @return {string} */ function hyphenateStyleName(string) { return hyphenate(string).replace(msPattern, '-ms-'); } module.exports = hyphenateStyleName; /***/ }), /***/ "ncfW": /***/ (function(module, exports, __webpack_require__) { "use strict"; if (true) { module.exports = __webpack_require__("LpuX"); } else { module.exports = require('./cjs/react-is.development.js'); } /***/ }), /***/ "qA/u": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); // EXTERNAL MODULE: ./node_modules/react/index.js var react = __webpack_require__("GiK3"); var react_default = /*#__PURE__*/__webpack_require__.n(react); // EXTERNAL MODULE: ./node_modules/react-dom/index.js var react_dom = __webpack_require__("O27J"); var react_dom_default = /*#__PURE__*/__webpack_require__.n(react_dom); // EXTERNAL MODULE: ./node_modules/babel-runtime/helpers/extends.js var helpers_extends = __webpack_require__("Dd8w"); var extends_default = /*#__PURE__*/__webpack_require__.n(helpers_extends); // EXTERNAL MODULE: ./node_modules/babel-runtime/helpers/defineProperty.js var defineProperty = __webpack_require__("bOdI"); var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty); // EXTERNAL MODULE: ./node_modules/babel-runtime/helpers/objectWithoutProperties.js var objectWithoutProperties = __webpack_require__("+6Bu"); var objectWithoutProperties_default = /*#__PURE__*/__webpack_require__.n(objectWithoutProperties); // EXTERNAL MODULE: ./node_modules/babel-runtime/helpers/classCallCheck.js var classCallCheck = __webpack_require__("Zrlr"); var classCallCheck_default = /*#__PURE__*/__webpack_require__.n(classCallCheck); // EXTERNAL MODULE: ./node_modules/babel-runtime/helpers/createClass.js var createClass = __webpack_require__("wxAW"); var createClass_default = /*#__PURE__*/__webpack_require__.n(createClass); // EXTERNAL MODULE: ./node_modules/babel-runtime/helpers/possibleConstructorReturn.js var possibleConstructorReturn = __webpack_require__("zwoO"); var possibleConstructorReturn_default = /*#__PURE__*/__webpack_require__.n(possibleConstructorReturn); // EXTERNAL MODULE: ./node_modules/babel-runtime/helpers/inherits.js var inherits = __webpack_require__("Pf15"); var inherits_default = /*#__PURE__*/__webpack_require__.n(inherits); // EXTERNAL MODULE: ./node_modules/prop-types/index.js var prop_types = __webpack_require__("KSGD"); var prop_types_default = /*#__PURE__*/__webpack_require__.n(prop_types); // EXTERNAL MODULE: ./node_modules/classnames/index.js var classnames = __webpack_require__("HW6M"); var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); // EXTERNAL MODULE: ./node_modules/raf/index.js var raf = __webpack_require__("ommR"); var raf_default = /*#__PURE__*/__webpack_require__.n(raf); // EXTERNAL MODULE: ./node_modules/react-lifecycles-compat/react-lifecycles-compat.es.js var react_lifecycles_compat_es = __webpack_require__("R8mX"); // CONCATENATED MODULE: ./node_modules/rc-tabs/es/KeyCode.js /* harmony default export */ var KeyCode = ({ /** * LEFT */ LEFT: 37, // also NUM_WEST /** * UP */ UP: 38, // also NUM_NORTH /** * RIGHT */ RIGHT: 39, // also NUM_EAST /** * DOWN */ DOWN: 40 // also NUM_SOUTH }); // CONCATENATED MODULE: ./node_modules/rc-tabs/es/utils.js function toArray(children) { // allow [c,[a,b]] var c = []; react_default.a.Children.forEach(children, function (child) { if (child) { c.push(child); } }); return c; } function getActiveIndex(children, activeKey) { var c = toArray(children); for (var i = 0; i < c.length; i++) { if (c[i].key === activeKey) { return i; } } return -1; } function getActiveKey(children, index) { var c = toArray(children); return c[index].key; } function setTransform(style, v) { style.transform = v; style.webkitTransform = v; style.mozTransform = v; } function isTransform3dSupported(style) { return ('transform' in style || 'webkitTransform' in style || 'MozTransform' in style) && window.atob; } function setTransition(style, v) { style.transition = v; style.webkitTransition = v; style.MozTransition = v; } function getTransformPropValue(v) { return { transform: v, WebkitTransform: v, MozTransform: v }; } function utils_isVertical(tabBarPosition) { return tabBarPosition === 'left' || tabBarPosition === 'right'; } function getTransformByIndex(index, tabBarPosition) { var direction = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'ltr'; var translate = utils_isVertical(tabBarPosition) ? 'translateY' : 'translateX'; if (!utils_isVertical(tabBarPosition) && direction === 'rtl') { return translate + '(' + index * 100 + '%) translateZ(0)'; } return translate + '(' + -index * 100 + '%) translateZ(0)'; } function getMarginStyle(index, tabBarPosition) { var marginDirection = utils_isVertical(tabBarPosition) ? 'marginTop' : 'marginLeft'; return defineProperty_default()({}, marginDirection, -index * 100 + '%'); } function getStyle(el, property) { return +window.getComputedStyle(el).getPropertyValue(property).replace('px', ''); } function setPxStyle(el, value, vertical) { value = vertical ? '0px, ' + value + 'px, 0px' : value + 'px, 0px, 0px'; setTransform(el.style, 'translate3d(' + value + ')'); } function getDataAttr(props) { return Object.keys(props).reduce(function (prev, key) { if (key.substr(0, 5) === 'aria-' || key.substr(0, 5) === 'data-' || key === 'role') { prev[key] = props[key]; } return prev; }, {}); } function toNum(style, property) { return +style.getPropertyValue(property).replace('px', ''); } function getTypeValue(start, current, end, tabNode, wrapperNode) { var total = getStyle(wrapperNode, 'padding-' + start); if (!tabNode || !tabNode.parentNode) { return total; } var childNodes = tabNode.parentNode.childNodes; Array.prototype.some.call(childNodes, function (node) { var style = window.getComputedStyle(node); if (node !== tabNode) { total += toNum(style, 'margin-' + start); total += node[current]; total += toNum(style, 'margin-' + end); if (style.boxSizing === 'content-box') { total += toNum(style, 'border-' + start + '-width') + toNum(style, 'border-' + end + '-width'); } return false; } // We need count current node margin // ref: https://github.com/react-component/tabs/pull/139#issuecomment-431005262 total += toNum(style, 'margin-' + start); return true; }); return total; } function getLeft(tabNode, wrapperNode) { return getTypeValue('left', 'offsetWidth', 'right', tabNode, wrapperNode); } function getTop(tabNode, wrapperNode) { return getTypeValue('top', 'offsetHeight', 'bottom', tabNode, wrapperNode); } // EXTERNAL MODULE: ./node_modules/rc-util/es/KeyCode.js var es_KeyCode = __webpack_require__("opmb"); // EXTERNAL MODULE: ./node_modules/@ant-design/create-react-context/lib/index.js var lib = __webpack_require__("83O8"); var lib_default = /*#__PURE__*/__webpack_require__.n(lib); // CONCATENATED MODULE: ./node_modules/rc-tabs/es/Sentinel.js /* eslint-disable jsx-a11y/no-noninteractive-tabindex */ var SentinelContext = lib_default()({}); var SentinelProvider = SentinelContext.Provider; var SentinelConsumer = SentinelContext.Consumer; var sentinelStyle = { width: 0, height: 0, overflow: 'hidden', position: 'absolute' }; var Sentinel_Sentinel = function (_React$Component) { inherits_default()(Sentinel, _React$Component); function Sentinel() { var _ref; var _temp, _this, _ret; classCallCheck_default()(this, Sentinel); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return _ret = (_temp = (_this = possibleConstructorReturn_default()(this, (_ref = Sentinel.__proto__ || Object.getPrototypeOf(Sentinel)).call.apply(_ref, [this].concat(args))), _this), _this.onKeyDown = function (_ref2) { var target = _ref2.target, which = _ref2.which, shiftKey = _ref2.shiftKey; var _this$props = _this.props, nextElement = _this$props.nextElement, prevElement = _this$props.prevElement; if (which !== es_KeyCode["a" /* default */].TAB || document.activeElement !== target) return; // Tab next if (!shiftKey && nextElement) { nextElement.focus(); } // Tab prev if (shiftKey && prevElement) { prevElement.focus(); } }, _temp), possibleConstructorReturn_default()(_this, _ret); } createClass_default()(Sentinel, [{ key: 'render', value: function render() { var setRef = this.props.setRef; return react_default.a.createElement('div', { tabIndex: 0, ref: setRef, style: sentinelStyle, onKeyDown: this.onKeyDown, role: 'presentation' }); } }]); return Sentinel; }(react_default.a.Component); Sentinel_Sentinel.propTypes = { setRef: prop_types_default.a.func, prevElement: prop_types_default.a.object, nextElement: prop_types_default.a.object }; /* harmony default export */ var es_Sentinel = (Sentinel_Sentinel); // CONCATENATED MODULE: ./node_modules/rc-tabs/es/TabPane.js var TabPane_TabPane = function (_React$Component) { inherits_default()(TabPane, _React$Component); function TabPane() { classCallCheck_default()(this, TabPane); return possibleConstructorReturn_default()(this, (TabPane.__proto__ || Object.getPrototypeOf(TabPane)).apply(this, arguments)); } createClass_default()(TabPane, [{ key: 'render', value: function render() { var _classnames; var _props = this.props, id = _props.id, className = _props.className, destroyInactiveTabPane = _props.destroyInactiveTabPane, active = _props.active, forceRender = _props.forceRender, rootPrefixCls = _props.rootPrefixCls, style = _props.style, children = _props.children, placeholder = _props.placeholder, restProps = objectWithoutProperties_default()(_props, ['id', 'className', 'destroyInactiveTabPane', 'active', 'forceRender', 'rootPrefixCls', 'style', 'children', 'placeholder']); this._isActived = this._isActived || active; var prefixCls = rootPrefixCls + '-tabpane'; var cls = classnames_default()((_classnames = {}, defineProperty_default()(_classnames, prefixCls, 1), defineProperty_default()(_classnames, prefixCls + '-inactive', !active), defineProperty_default()(_classnames, prefixCls + '-active', active), defineProperty_default()(_classnames, className, className), _classnames)); var isRender = destroyInactiveTabPane ? active : this._isActived; var shouldRender = isRender || forceRender; return react_default.a.createElement( SentinelConsumer, null, function (_ref) { var sentinelStart = _ref.sentinelStart, sentinelEnd = _ref.sentinelEnd, setPanelSentinelStart = _ref.setPanelSentinelStart, setPanelSentinelEnd = _ref.setPanelSentinelEnd; // Create sentinel var panelSentinelStart = void 0; var panelSentinelEnd = void 0; if (active && shouldRender) { panelSentinelStart = react_default.a.createElement(es_Sentinel, { setRef: setPanelSentinelStart, prevElement: sentinelStart }); panelSentinelEnd = react_default.a.createElement(es_Sentinel, { setRef: setPanelSentinelEnd, nextElement: sentinelEnd }); } return react_default.a.createElement( 'div', extends_default()({ style: style, role: 'tabpanel', 'aria-hidden': active ? 'false' : 'true', className: cls, id: id }, getDataAttr(restProps)), panelSentinelStart, shouldRender ? children : placeholder, panelSentinelEnd ); } ); } }]); return TabPane; }(react_default.a.Component); /* harmony default export */ var es_TabPane = (TabPane_TabPane); TabPane_TabPane.propTypes = { className: prop_types_default.a.string, active: prop_types_default.a.bool, style: prop_types_default.a.any, destroyInactiveTabPane: prop_types_default.a.bool, forceRender: prop_types_default.a.bool, placeholder: prop_types_default.a.node, rootPrefixCls: prop_types_default.a.string, children: prop_types_default.a.node, id: prop_types_default.a.string }; TabPane_TabPane.defaultProps = { placeholder: null }; // CONCATENATED MODULE: ./node_modules/rc-tabs/es/Tabs.js function noop() {} function getDefaultActiveKey(props) { var activeKey = void 0; react_default.a.Children.forEach(props.children, function (child) { if (child && !activeKey && !child.props.disabled) { activeKey = child.key; } }); return activeKey; } function activeKeyIsValid(props, key) { var keys = react_default.a.Children.map(props.children, function (child) { return child && child.key; }); return keys.indexOf(key) >= 0; } var Tabs_Tabs = function (_React$Component) { inherits_default()(Tabs, _React$Component); function Tabs(props) { classCallCheck_default()(this, Tabs); var _this = possibleConstructorReturn_default()(this, (Tabs.__proto__ || Object.getPrototypeOf(Tabs)).call(this, props)); Tabs__initialiseProps.call(_this); var activeKey = void 0; if ('activeKey' in props) { activeKey = props.activeKey; } else if ('defaultActiveKey' in props) { activeKey = props.defaultActiveKey; } else { activeKey = getDefaultActiveKey(props); } _this.state = { activeKey: activeKey }; return _this; } createClass_default()(Tabs, [{ key: 'componentWillUnmount', value: function componentWillUnmount() { this.destroy = true; raf_default.a.cancel(this.sentinelId); } // Sentinel for tab index }, { key: 'updateSentinelContext', value: function updateSentinelContext() { var _this2 = this; if (this.destroy) return; raf_default.a.cancel(this.sentinelId); this.sentinelId = raf_default()(function () { if (_this2.destroy) return; _this2.forceUpdate(); }); } }, { key: 'render', value: function render() { var _classnames; var props = this.props; var prefixCls = props.prefixCls, navWrapper = props.navWrapper, tabBarPosition = props.tabBarPosition, className = props.className, renderTabContent = props.renderTabContent, renderTabBar = props.renderTabBar, destroyInactiveTabPane = props.destroyInactiveTabPane, direction = props.direction, restProps = objectWithoutProperties_default()(props, ['prefixCls', 'navWrapper', 'tabBarPosition', 'className', 'renderTabContent', 'renderTabBar', 'destroyInactiveTabPane', 'direction']); var cls = classnames_default()((_classnames = {}, defineProperty_default()(_classnames, prefixCls, 1), defineProperty_default()(_classnames, prefixCls + '-' + tabBarPosition, 1), defineProperty_default()(_classnames, className, !!className), defineProperty_default()(_classnames, prefixCls + '-rtl', direction === 'rtl'), _classnames)); this.tabBar = renderTabBar(); var tabBar = react_default.a.cloneElement(this.tabBar, { prefixCls: prefixCls, navWrapper: navWrapper, key: 'tabBar', onKeyDown: this.onNavKeyDown, tabBarPosition: tabBarPosition, onTabClick: this.onTabClick, panels: props.children, activeKey: this.state.activeKey, direction: this.props.direction }); var tabContent = react_default.a.cloneElement(renderTabContent(), { prefixCls: prefixCls, tabBarPosition: tabBarPosition, activeKey: this.state.activeKey, destroyInactiveTabPane: destroyInactiveTabPane, children: props.children, onChange: this.setActiveKey, key: 'tabContent', direction: this.props.direction }); var sentinelStart = react_default.a.createElement(es_Sentinel, { key: 'sentinelStart', setRef: this.setSentinelStart, nextElement: this.panelSentinelStart }); var sentinelEnd = react_default.a.createElement(es_Sentinel, { key: 'sentinelEnd', setRef: this.setSentinelEnd, prevElement: this.panelSentinelEnd }); var contents = []; if (tabBarPosition === 'bottom') { contents.push(sentinelStart, tabContent, sentinelEnd, tabBar); } else { contents.push(tabBar, sentinelStart, tabContent, sentinelEnd); } return react_default.a.createElement( SentinelProvider, { value: { sentinelStart: this.sentinelStart, sentinelEnd: this.sentinelEnd, setPanelSentinelStart: this.setPanelSentinelStart, setPanelSentinelEnd: this.setPanelSentinelEnd } }, react_default.a.createElement( 'div', extends_default()({ className: cls, style: props.style }, getDataAttr(restProps), { onScroll: this.onScroll }), contents ) ); } }], [{ key: 'getDerivedStateFromProps', value: function getDerivedStateFromProps(props, state) { var newState = {}; if ('activeKey' in props) { newState.activeKey = props.activeKey; } else if (!activeKeyIsValid(props, state.activeKey)) { newState.activeKey = getDefaultActiveKey(props); } if (Object.keys(newState).length > 0) { return newState; } return null; } }]); return Tabs; }(react_default.a.Component); var Tabs__initialiseProps = function _initialiseProps() { var _this3 = this; this.onTabClick = function (activeKey, e) { if (_this3.tabBar.props.onTabClick) { _this3.tabBar.props.onTabClick(activeKey, e); } _this3.setActiveKey(activeKey); }; this.onNavKeyDown = function (e) { var eventKeyCode = e.keyCode; if (eventKeyCode === KeyCode.RIGHT || eventKeyCode === KeyCode.DOWN) { e.preventDefault(); var nextKey = _this3.getNextActiveKey(true); _this3.onTabClick(nextKey); } else if (eventKeyCode === KeyCode.LEFT || eventKeyCode === KeyCode.UP) { e.preventDefault(); var previousKey = _this3.getNextActiveKey(false); _this3.onTabClick(previousKey); } }; this.onScroll = function (_ref) { var target = _ref.target, currentTarget = _ref.currentTarget; if (target === currentTarget && target.scrollLeft > 0) { target.scrollLeft = 0; } }; this.setSentinelStart = function (node) { _this3.sentinelStart = node; }; this.setSentinelEnd = function (node) { _this3.sentinelEnd = node; }; this.setPanelSentinelStart = function (node) { if (node !== _this3.panelSentinelStart) { _this3.updateSentinelContext(); } _this3.panelSentinelStart = node; }; this.setPanelSentinelEnd = function (node) { if (node !== _this3.panelSentinelEnd) { _this3.updateSentinelContext(); } _this3.panelSentinelEnd = node; }; this.setActiveKey = function (activeKey) { if (_this3.state.activeKey !== activeKey) { if (!('activeKey' in _this3.props)) { _this3.setState({ activeKey: activeKey }); } _this3.props.onChange(activeKey); } }; this.getNextActiveKey = function (next) { var activeKey = _this3.state.activeKey; var children = []; react_default.a.Children.forEach(_this3.props.children, function (c) { if (c && !c.props.disabled) { if (next) { children.push(c); } else { children.unshift(c); } } }); var length = children.length; var ret = length && children[0].key; children.forEach(function (child, i) { if (child.key === activeKey) { if (i === length - 1) { ret = children[0].key; } else { ret = children[i + 1].key; } } }); return ret; }; }; Tabs_Tabs.propTypes = { destroyInactiveTabPane: prop_types_default.a.bool, renderTabBar: prop_types_default.a.func.isRequired, renderTabContent: prop_types_default.a.func.isRequired, navWrapper: prop_types_default.a.func, onChange: prop_types_default.a.func, children: prop_types_default.a.node, prefixCls: prop_types_default.a.string, className: prop_types_default.a.string, tabBarPosition: prop_types_default.a.string, style: prop_types_default.a.object, activeKey: prop_types_default.a.string, defaultActiveKey: prop_types_default.a.string, direction: prop_types_default.a.string }; Tabs_Tabs.defaultProps = { prefixCls: 'rc-tabs', destroyInactiveTabPane: false, onChange: noop, navWrapper: function navWrapper(arg) { return arg; }, tabBarPosition: 'top', children: null, style: {}, direction: 'ltr' }; Tabs_Tabs.TabPane = es_TabPane; Object(react_lifecycles_compat_es["polyfill"])(Tabs_Tabs); /* harmony default export */ var es_Tabs = (Tabs_Tabs); // CONCATENATED MODULE: ./node_modules/rc-tabs/es/TabContent.js var TabContent_TabContent = function (_React$Component) { inherits_default()(TabContent, _React$Component); function TabContent() { classCallCheck_default()(this, TabContent); return possibleConstructorReturn_default()(this, (TabContent.__proto__ || Object.getPrototypeOf(TabContent)).apply(this, arguments)); } createClass_default()(TabContent, [{ key: 'getTabPanes', value: function getTabPanes() { var props = this.props; var activeKey = props.activeKey; var children = props.children; var newChildren = []; react_default.a.Children.forEach(children, function (child) { if (!child) { return; } var key = child.key; var active = activeKey === key; newChildren.push(react_default.a.cloneElement(child, { active: active, destroyInactiveTabPane: props.destroyInactiveTabPane, rootPrefixCls: props.prefixCls })); }); return newChildren; } }, { key: 'render', value: function render() { var _classnames; var props = this.props; var prefixCls = props.prefixCls, children = props.children, activeKey = props.activeKey, className = props.className, tabBarPosition = props.tabBarPosition, animated = props.animated, animatedWithMargin = props.animatedWithMargin, direction = props.direction; var style = props.style; var classes = classnames_default()((_classnames = {}, defineProperty_default()(_classnames, prefixCls + '-content', true), defineProperty_default()(_classnames, animated ? prefixCls + '-content-animated' : prefixCls + '-content-no-animated', true), _classnames), className); if (animated) { var activeIndex = getActiveIndex(children, activeKey); if (activeIndex !== -1) { var animatedStyle = animatedWithMargin ? getMarginStyle(activeIndex, tabBarPosition) : getTransformPropValue(getTransformByIndex(activeIndex, tabBarPosition, direction)); style = extends_default()({}, style, animatedStyle); } else { style = extends_default()({}, style, { display: 'none' }); } } return react_default.a.createElement( 'div', { className: classes, style: style }, this.getTabPanes() ); } }]); return TabContent; }(react_default.a.Component); /* harmony default export */ var es_TabContent = (TabContent_TabContent); TabContent_TabContent.propTypes = { animated: prop_types_default.a.bool, animatedWithMargin: prop_types_default.a.bool, prefixCls: prop_types_default.a.string, children: prop_types_default.a.node, activeKey: prop_types_default.a.string, style: prop_types_default.a.any, tabBarPosition: prop_types_default.a.string, className: prop_types_default.a.string, destroyInactiveTabPane: prop_types_default.a.bool, direction: prop_types_default.a.string }; TabContent_TabContent.defaultProps = { animated: true }; // CONCATENATED MODULE: ./node_modules/rc-tabs/es/index.js /* harmony default export */ var es = (es_Tabs); // EXTERNAL MODULE: ./node_modules/antd/node_modules/classnames/index.js var node_modules_classnames = __webpack_require__("kTQ8"); var node_modules_classnames_default = /*#__PURE__*/__webpack_require__.n(node_modules_classnames); // EXTERNAL MODULE: ./node_modules/omit.js/es/index.js var omit_js_es = __webpack_require__("JkBm"); // CONCATENATED MODULE: ./node_modules/rc-tabs/es/InkTabBarNode.js function _componentDidUpdate(component, init) { var _component$props = component.props, styles = _component$props.styles, panels = _component$props.panels, activeKey = _component$props.activeKey, direction = _component$props.direction; var rootNode = component.props.getRef('root'); var wrapNode = component.props.getRef('nav') || rootNode; var inkBarNode = component.props.getRef('inkBar'); var activeTab = component.props.getRef('activeTab'); var inkBarNodeStyle = inkBarNode.style; var tabBarPosition = component.props.tabBarPosition; var activeIndex = getActiveIndex(panels, activeKey); if (init) { // prevent mount animation inkBarNodeStyle.display = 'none'; } if (activeTab) { var tabNode = activeTab; var transformSupported = isTransform3dSupported(inkBarNodeStyle); // Reset current style setTransform(inkBarNodeStyle, ''); inkBarNodeStyle.width = ''; inkBarNodeStyle.height = ''; inkBarNodeStyle.left = ''; inkBarNodeStyle.top = ''; inkBarNodeStyle.bottom = ''; inkBarNodeStyle.right = ''; if (tabBarPosition === 'top' || tabBarPosition === 'bottom') { var left = getLeft(tabNode, wrapNode); var width = tabNode.offsetWidth; // If tabNode'width width equal to wrapNode'width when tabBarPosition is top or bottom // It means no css working, then ink bar should not have width until css is loaded // Fix https://github.com/ant-design/ant-design/issues/7564 if (width === rootNode.offsetWidth) { width = 0; } else if (styles.inkBar && styles.inkBar.width !== undefined) { width = parseFloat(styles.inkBar.width, 10); if (width) { left += (tabNode.offsetWidth - width) / 2; } } if (direction === 'rtl') { left = getStyle(tabNode, 'margin-left') - left; } // use 3d gpu to optimize render if (transformSupported) { setTransform(inkBarNodeStyle, 'translate3d(' + left + 'px,0,0)'); } else { inkBarNodeStyle.left = left + 'px'; } inkBarNodeStyle.width = width + 'px'; } else { var top = getTop(tabNode, wrapNode, true); var height = tabNode.offsetHeight; if (styles.inkBar && styles.inkBar.height !== undefined) { height = parseFloat(styles.inkBar.height, 10); if (height) { top += (tabNode.offsetHeight - height) / 2; } } if (transformSupported) { setTransform(inkBarNodeStyle, 'translate3d(0,' + top + 'px,0)'); inkBarNodeStyle.top = '0'; } else { inkBarNodeStyle.top = top + 'px'; } inkBarNodeStyle.height = height + 'px'; } } inkBarNodeStyle.display = activeIndex !== -1 ? 'block' : 'none'; } var InkTabBarNode_InkTabBarNode = function (_React$Component) { inherits_default()(InkTabBarNode, _React$Component); function InkTabBarNode() { classCallCheck_default()(this, InkTabBarNode); return possibleConstructorReturn_default()(this, (InkTabBarNode.__proto__ || Object.getPrototypeOf(InkTabBarNode)).apply(this, arguments)); } createClass_default()(InkTabBarNode, [{ key: 'componentDidMount', value: function componentDidMount() { var _this2 = this; // ref https://github.com/ant-design/ant-design/issues/8678 // ref https://github.com/react-component/tabs/issues/135 // InkTabBarNode need parent/root ref for calculating position // since parent componentDidMount triggered after child componentDidMount // we're doing a quick fix here to use setTimeout to calculate position // after parent/root component mounted this.timeout = setTimeout(function () { _componentDidUpdate(_this2, true); }, 0); } }, { key: 'componentDidUpdate', value: function componentDidUpdate() { _componentDidUpdate(this); } }, { key: 'componentWillUnmount', value: function componentWillUnmount() { clearTimeout(this.timeout); } }, { key: 'render', value: function render() { var _classnames; var _props = this.props, prefixCls = _props.prefixCls, styles = _props.styles, inkBarAnimated = _props.inkBarAnimated; var className = prefixCls + '-ink-bar'; var classes = classnames_default()((_classnames = {}, defineProperty_default()(_classnames, className, true), defineProperty_default()(_classnames, inkBarAnimated ? className + '-animated' : className + '-no-animated', true), _classnames)); return react_default.a.createElement('div', { style: styles.inkBar, className: classes, key: 'inkBar', ref: this.props.saveRef('inkBar') }); } }]); return InkTabBarNode; }(react_default.a.Component); /* harmony default export */ var es_InkTabBarNode = (InkTabBarNode_InkTabBarNode); InkTabBarNode_InkTabBarNode.propTypes = { prefixCls: prop_types_default.a.string, styles: prop_types_default.a.object, inkBarAnimated: prop_types_default.a.bool, saveRef: prop_types_default.a.func, direction: prop_types_default.a.string }; InkTabBarNode_InkTabBarNode.defaultProps = { prefixCls: '', inkBarAnimated: true, styles: {}, saveRef: function saveRef() {} }; // EXTERNAL MODULE: ./node_modules/warning/warning.js var warning = __webpack_require__("Trj0"); var warning_default = /*#__PURE__*/__webpack_require__.n(warning); // CONCATENATED MODULE: ./node_modules/rc-tabs/es/TabBarTabsNode.js var TabBarTabsNode_TabBarTabsNode = function (_React$Component) { inherits_default()(TabBarTabsNode, _React$Component); function TabBarTabsNode() { classCallCheck_default()(this, TabBarTabsNode); return possibleConstructorReturn_default()(this, (TabBarTabsNode.__proto__ || Object.getPrototypeOf(TabBarTabsNode)).apply(this, arguments)); } createClass_default()(TabBarTabsNode, [{ key: 'render', value: function render() { var _this2 = this; var _props = this.props, children = _props.panels, activeKey = _props.activeKey, prefixCls = _props.prefixCls, tabBarGutter = _props.tabBarGutter, saveRef = _props.saveRef, tabBarPosition = _props.tabBarPosition, renderTabBarNode = _props.renderTabBarNode, direction = _props.direction; var rst = []; react_default.a.Children.forEach(children, function (child, index) { if (!child) { return; } var key = child.key; var cls = activeKey === key ? prefixCls + '-tab-active' : ''; cls += ' ' + prefixCls + '-tab'; var events = {}; if (child.props.disabled) { cls += ' ' + prefixCls + '-tab-disabled'; } else { events = { onClick: _this2.props.onTabClick.bind(_this2, key) }; } var ref = {}; if (activeKey === key) { ref.ref = saveRef('activeTab'); } var gutter = tabBarGutter && index === children.length - 1 ? 0 : tabBarGutter; var marginProperty = direction === 'rtl' ? 'marginLeft' : 'marginRight'; var style = defineProperty_default()({}, utils_isVertical(tabBarPosition) ? 'marginBottom' : marginProperty, gutter); warning_default()('tab' in child.props, 'There must be `tab` property on children of Tabs.'); var node = react_default.a.createElement( 'div', extends_default()({ role: 'tab', 'aria-disabled': child.props.disabled ? 'true' : 'false', 'aria-selected': activeKey === key ? 'true' : 'false' }, events, { className: cls, key: key, style: style }, ref), child.props.tab ); if (renderTabBarNode) { node = renderTabBarNode(node); } rst.push(node); }); return react_default.a.createElement( 'div', { ref: saveRef('navTabsContainer') }, rst ); } }]); return TabBarTabsNode; }(react_default.a.Component); /* harmony default export */ var es_TabBarTabsNode = (TabBarTabsNode_TabBarTabsNode); TabBarTabsNode_TabBarTabsNode.propTypes = { activeKey: prop_types_default.a.string, panels: prop_types_default.a.node, prefixCls: prop_types_default.a.string, tabBarGutter: prop_types_default.a.number, onTabClick: prop_types_default.a.func, saveRef: prop_types_default.a.func, renderTabBarNode: prop_types_default.a.func, tabBarPosition: prop_types_default.a.string, direction: prop_types_default.a.string }; TabBarTabsNode_TabBarTabsNode.defaultProps = { panels: [], prefixCls: [], tabBarGutter: null, onTabClick: function onTabClick() {}, saveRef: function saveRef() {} }; // CONCATENATED MODULE: ./node_modules/rc-tabs/es/TabBarRootNode.js var TabBarRootNode_TabBarRootNode = function (_React$Component) { inherits_default()(TabBarRootNode, _React$Component); function TabBarRootNode() { classCallCheck_default()(this, TabBarRootNode); return possibleConstructorReturn_default()(this, (TabBarRootNode.__proto__ || Object.getPrototypeOf(TabBarRootNode)).apply(this, arguments)); } createClass_default()(TabBarRootNode, [{ key: 'render', value: function render() { var _props = this.props, prefixCls = _props.prefixCls, onKeyDown = _props.onKeyDown, className = _props.className, extraContent = _props.extraContent, style = _props.style, tabBarPosition = _props.tabBarPosition, children = _props.children, restProps = objectWithoutProperties_default()(_props, ['prefixCls', 'onKeyDown', 'className', 'extraContent', 'style', 'tabBarPosition', 'children']); var cls = classnames_default()(prefixCls + '-bar', defineProperty_default()({}, className, !!className)); var topOrBottom = tabBarPosition === 'top' || tabBarPosition === 'bottom'; var tabBarExtraContentStyle = topOrBottom ? { float: 'right' } : {}; var extraContentStyle = extraContent && extraContent.props ? extraContent.props.style : {}; var newChildren = children; if (extraContent) { newChildren = [Object(react["cloneElement"])(extraContent, { key: 'extra', style: extends_default()({}, tabBarExtraContentStyle, extraContentStyle) }), Object(react["cloneElement"])(children, { key: 'content' })]; newChildren = topOrBottom ? newChildren : newChildren.reverse(); } return react_default.a.createElement( 'div', extends_default()({ role: 'tablist', className: cls, tabIndex: '0', ref: this.props.saveRef('root'), onKeyDown: onKeyDown, style: style }, getDataAttr(restProps)), newChildren ); } }]); return TabBarRootNode; }(react_default.a.Component); /* harmony default export */ var es_TabBarRootNode = (TabBarRootNode_TabBarRootNode); TabBarRootNode_TabBarRootNode.propTypes = { prefixCls: prop_types_default.a.string, className: prop_types_default.a.string, style: prop_types_default.a.object, tabBarPosition: prop_types_default.a.oneOf(['left', 'right', 'top', 'bottom']), children: prop_types_default.a.node, extraContent: prop_types_default.a.node, onKeyDown: prop_types_default.a.func, saveRef: prop_types_default.a.func }; TabBarRootNode_TabBarRootNode.defaultProps = { prefixCls: '', className: '', style: {}, tabBarPosition: 'top', extraContent: null, children: null, onKeyDown: function onKeyDown() {}, saveRef: function saveRef() {} }; // EXTERNAL MODULE: ./node_modules/lodash/debounce.js var debounce = __webpack_require__("O4Lo"); var debounce_default = /*#__PURE__*/__webpack_require__.n(debounce); // EXTERNAL MODULE: ./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js var ResizeObserver_es = __webpack_require__("z+gd"); // CONCATENATED MODULE: ./node_modules/rc-tabs/es/ScrollableTabBarNode.js var ScrollableTabBarNode_ScrollableTabBarNode = function (_React$Component) { inherits_default()(ScrollableTabBarNode, _React$Component); function ScrollableTabBarNode(props) { classCallCheck_default()(this, ScrollableTabBarNode); var _this = possibleConstructorReturn_default()(this, (ScrollableTabBarNode.__proto__ || Object.getPrototypeOf(ScrollableTabBarNode)).call(this, props)); _this.prevTransitionEnd = function (e) { if (e.propertyName !== 'opacity') { return; } var container = _this.props.getRef('container'); _this.scrollToActiveTab({ target: container, currentTarget: container }); }; _this.scrollToActiveTab = function (e) { var activeTab = _this.props.getRef('activeTab'); var navWrap = _this.props.getRef('navWrap'); if (e && e.target !== e.currentTarget || !activeTab) { return; } // when not scrollable or enter scrollable first time, don't emit scrolling var needToSroll = _this.isNextPrevShown() && _this.lastNextPrevShown; _this.lastNextPrevShown = _this.isNextPrevShown(); if (!needToSroll) { return; } var activeTabWH = _this.getScrollWH(activeTab); var navWrapNodeWH = _this.getOffsetWH(navWrap); var offset = _this.offset; var wrapOffset = _this.getOffsetLT(navWrap); var activeTabOffset = _this.getOffsetLT(activeTab); if (wrapOffset > activeTabOffset) { offset += wrapOffset - activeTabOffset; _this.setOffset(offset); } else if (wrapOffset + navWrapNodeWH < activeTabOffset + activeTabWH) { offset -= activeTabOffset + activeTabWH - (wrapOffset + navWrapNodeWH); _this.setOffset(offset); } }; _this.prev = function (e) { _this.props.onPrevClick(e); var navWrapNode = _this.props.getRef('navWrap'); var navWrapNodeWH = _this.getOffsetWH(navWrapNode); var offset = _this.offset; _this.setOffset(offset + navWrapNodeWH); }; _this.next = function (e) { _this.props.onNextClick(e); var navWrapNode = _this.props.getRef('navWrap'); var navWrapNodeWH = _this.getOffsetWH(navWrapNode); var offset = _this.offset; _this.setOffset(offset - navWrapNodeWH); }; _this.offset = 0; _this.state = { next: false, prev: false }; return _this; } createClass_default()(ScrollableTabBarNode, [{ key: 'componentDidMount', value: function componentDidMount() { var _this2 = this; this.componentDidUpdate(); this.debouncedResize = debounce_default()(function () { _this2.setNextPrev(); _this2.scrollToActiveTab(); }, 200); this.resizeObserver = new ResizeObserver_es["default"](this.debouncedResize); this.resizeObserver.observe(this.props.getRef('container')); } }, { key: 'componentDidUpdate', value: function componentDidUpdate(prevProps) { var props = this.props; if (prevProps && prevProps.tabBarPosition !== props.tabBarPosition) { this.setOffset(0); return; } var nextPrev = this.setNextPrev(); // wait next, prev show hide /* eslint react/no-did-update-set-state:0 */ if (this.isNextPrevShown(this.state) !== this.isNextPrevShown(nextPrev)) { this.setState({}, this.scrollToActiveTab); } else if (!prevProps || props.activeKey !== prevProps.activeKey) { // can not use props.activeKey this.scrollToActiveTab(); } } }, { key: 'componentWillUnmount', value: function componentWillUnmount() { if (this.resizeObserver) { this.resizeObserver.disconnect(); } if (this.debouncedResize && this.debouncedResize.cancel) { this.debouncedResize.cancel(); } } }, { key: 'setNextPrev', value: function setNextPrev() { var navNode = this.props.getRef('nav'); var navTabsContainer = this.props.getRef('navTabsContainer'); var navNodeWH = this.getScrollWH(navTabsContainer || navNode); // Add 1px to fix `offsetWidth` with decimal in Chrome not correct handle // https://github.com/ant-design/ant-design/issues/13423 var containerWH = this.getOffsetWH(this.props.getRef('container')) + 1; var navWrapNodeWH = this.getOffsetWH(this.props.getRef('navWrap')); var offset = this.offset; var minOffset = containerWH - navNodeWH; var _state = this.state, next = _state.next, prev = _state.prev; if (minOffset >= 0) { next = false; this.setOffset(0, false); offset = 0; } else if (minOffset < offset) { next = true; } else { next = false; // Fix https://github.com/ant-design/ant-design/issues/8861 // Test with container offset which is stable // and set the offset of the nav wrap node var realOffset = navWrapNodeWH - navNodeWH; this.setOffset(realOffset, false); offset = realOffset; } if (offset < 0) { prev = true; } else { prev = false; } this.setNext(next); this.setPrev(prev); return { next: next, prev: prev }; } }, { key: 'getOffsetWH', value: function getOffsetWH(node) { var tabBarPosition = this.props.tabBarPosition; var prop = 'offsetWidth'; if (tabBarPosition === 'left' || tabBarPosition === 'right') { prop = 'offsetHeight'; } return node[prop]; } }, { key: 'getScrollWH', value: function getScrollWH(node) { var tabBarPosition = this.props.tabBarPosition; var prop = 'scrollWidth'; if (tabBarPosition === 'left' || tabBarPosition === 'right') { prop = 'scrollHeight'; } return node[prop]; } }, { key: 'getOffsetLT', value: function getOffsetLT(node) { var tabBarPosition = this.props.tabBarPosition; var prop = 'left'; if (tabBarPosition === 'left' || tabBarPosition === 'right') { prop = 'top'; } return node.getBoundingClientRect()[prop]; } }, { key: 'setOffset', value: function setOffset(offset) { var checkNextPrev = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; var target = Math.min(0, offset); if (this.offset !== target) { this.offset = target; var navOffset = {}; var tabBarPosition = this.props.tabBarPosition; var navStyle = this.props.getRef('nav').style; var transformSupported = isTransform3dSupported(navStyle); if (tabBarPosition === 'left' || tabBarPosition === 'right') { if (transformSupported) { navOffset = { value: 'translate3d(0,' + target + 'px,0)' }; } else { navOffset = { name: 'top', value: target + 'px' }; } } else if (transformSupported) { if (this.props.direction === 'rtl') { target = -target; } navOffset = { value: 'translate3d(' + target + 'px,0,0)' }; } else { navOffset = { name: 'left', value: target + 'px' }; } if (transformSupported) { setTransform(navStyle, navOffset.value); } else { navStyle[navOffset.name] = navOffset.value; } if (checkNextPrev) { this.setNextPrev(); } } } }, { key: 'setPrev', value: function setPrev(v) { if (this.state.prev !== v) { this.setState({ prev: v }); } } }, { key: 'setNext', value: function setNext(v) { if (this.state.next !== v) { this.setState({ next: v }); } } }, { key: 'isNextPrevShown', value: function isNextPrevShown(state) { if (state) { return state.next || state.prev; } return this.state.next || this.state.prev; } }, { key: 'render', value: function render() { var _classnames, _classnames2, _classnames3, _classnames4; var _state2 = this.state, next = _state2.next, prev = _state2.prev; var _props = this.props, prefixCls = _props.prefixCls, scrollAnimated = _props.scrollAnimated, navWrapper = _props.navWrapper, prevIcon = _props.prevIcon, nextIcon = _props.nextIcon; var showNextPrev = prev || next; var prevButton = react_default.a.createElement( 'span', { onClick: prev ? this.prev : null, unselectable: 'unselectable', className: classnames_default()((_classnames = {}, defineProperty_default()(_classnames, prefixCls + '-tab-prev', 1), defineProperty_default()(_classnames, prefixCls + '-tab-btn-disabled', !prev), defineProperty_default()(_classnames, prefixCls + '-tab-arrow-show', showNextPrev), _classnames)), onTransitionEnd: this.prevTransitionEnd }, prevIcon || react_default.a.createElement('span', { className: prefixCls + '-tab-prev-icon' }) ); var nextButton = react_default.a.createElement( 'span', { onClick: next ? this.next : null, unselectable: 'unselectable', className: classnames_default()((_classnames2 = {}, defineProperty_default()(_classnames2, prefixCls + '-tab-next', 1), defineProperty_default()(_classnames2, prefixCls + '-tab-btn-disabled', !next), defineProperty_default()(_classnames2, prefixCls + '-tab-arrow-show', showNextPrev), _classnames2)) }, nextIcon || react_default.a.createElement('span', { className: prefixCls + '-tab-next-icon' }) ); var navClassName = prefixCls + '-nav'; var navClasses = classnames_default()((_classnames3 = {}, defineProperty_default()(_classnames3, navClassName, true), defineProperty_default()(_classnames3, scrollAnimated ? navClassName + '-animated' : navClassName + '-no-animated', true), _classnames3)); return react_default.a.createElement( 'div', { className: classnames_default()((_classnames4 = {}, defineProperty_default()(_classnames4, prefixCls + '-nav-container', 1), defineProperty_default()(_classnames4, prefixCls + '-nav-container-scrolling', showNextPrev), _classnames4)), key: 'container', ref: this.props.saveRef('container') }, prevButton, nextButton, react_default.a.createElement( 'div', { className: prefixCls + '-nav-wrap', ref: this.props.saveRef('navWrap') }, react_default.a.createElement( 'div', { className: prefixCls + '-nav-scroll' }, react_default.a.createElement( 'div', { className: navClasses, ref: this.props.saveRef('nav') }, navWrapper(this.props.children) ) ) ) ); } }]); return ScrollableTabBarNode; }(react_default.a.Component); /* harmony default export */ var es_ScrollableTabBarNode = (ScrollableTabBarNode_ScrollableTabBarNode); ScrollableTabBarNode_ScrollableTabBarNode.propTypes = { activeKey: prop_types_default.a.string, getRef: prop_types_default.a.func.isRequired, saveRef: prop_types_default.a.func.isRequired, tabBarPosition: prop_types_default.a.oneOf(['left', 'right', 'top', 'bottom']), prefixCls: prop_types_default.a.string, scrollAnimated: prop_types_default.a.bool, onPrevClick: prop_types_default.a.func, onNextClick: prop_types_default.a.func, navWrapper: prop_types_default.a.func, children: prop_types_default.a.node, prevIcon: prop_types_default.a.node, nextIcon: prop_types_default.a.node, direction: prop_types_default.a.node }; ScrollableTabBarNode_ScrollableTabBarNode.defaultProps = { tabBarPosition: 'left', prefixCls: '', scrollAnimated: true, onPrevClick: function onPrevClick() {}, onNextClick: function onNextClick() {}, navWrapper: function navWrapper(ele) { return ele; } }; // CONCATENATED MODULE: ./node_modules/rc-tabs/es/SaveRef.js var SaveRef_SaveRef = function (_React$Component) { inherits_default()(SaveRef, _React$Component); function SaveRef() { var _ref; var _temp, _this, _ret; classCallCheck_default()(this, SaveRef); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return _ret = (_temp = (_this = possibleConstructorReturn_default()(this, (_ref = SaveRef.__proto__ || Object.getPrototypeOf(SaveRef)).call.apply(_ref, [this].concat(args))), _this), _this.getRef = function (name) { return _this[name]; }, _this.saveRef = function (name) { return function (node) { if (node) { _this[name] = node; } }; }, _temp), possibleConstructorReturn_default()(_this, _ret); } createClass_default()(SaveRef, [{ key: 'render', value: function render() { return this.props.children(this.saveRef, this.getRef); } }]); return SaveRef; }(react_default.a.Component); /* harmony default export */ var es_SaveRef = (SaveRef_SaveRef); SaveRef_SaveRef.propTypes = { children: prop_types_default.a.func }; SaveRef_SaveRef.defaultProps = { children: function children() { return null; } }; // CONCATENATED MODULE: ./node_modules/rc-tabs/es/ScrollableInkTabBar.js /* eslint-disable react/prefer-stateless-function */ var ScrollableInkTabBar_ScrollableInkTabBar = function (_React$Component) { inherits_default()(ScrollableInkTabBar, _React$Component); function ScrollableInkTabBar() { classCallCheck_default()(this, ScrollableInkTabBar); return possibleConstructorReturn_default()(this, (ScrollableInkTabBar.__proto__ || Object.getPrototypeOf(ScrollableInkTabBar)).apply(this, arguments)); } createClass_default()(ScrollableInkTabBar, [{ key: 'render', value: function render() { var _props = this.props, renderTabBarNode = _props.children, restProps = objectWithoutProperties_default()(_props, ['children']); return react_default.a.createElement( es_SaveRef, null, function (saveRef, getRef) { return react_default.a.createElement( es_TabBarRootNode, extends_default()({ saveRef: saveRef }, restProps), react_default.a.createElement( es_ScrollableTabBarNode, extends_default()({ saveRef: saveRef, getRef: getRef }, restProps), react_default.a.createElement(es_TabBarTabsNode, extends_default()({ saveRef: saveRef, renderTabBarNode: renderTabBarNode }, restProps)), react_default.a.createElement(es_InkTabBarNode, extends_default()({ saveRef: saveRef, getRef: getRef }, restProps)) ) ); } ); } }]); return ScrollableInkTabBar; }(react_default.a.Component); /* harmony default export */ var es_ScrollableInkTabBar = (ScrollableInkTabBar_ScrollableInkTabBar); ScrollableInkTabBar_ScrollableInkTabBar.propTypes = { children: prop_types_default.a.func }; // EXTERNAL MODULE: ./node_modules/antd/es/icon/index.js + 5 modules var icon = __webpack_require__("FC3+"); // CONCATENATED MODULE: ./node_modules/antd/es/tabs/TabBar.js function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } var TabBar_TabBar = /*#__PURE__*/function (_React$Component) { _inherits(TabBar, _React$Component); var _super = _createSuper(TabBar); function TabBar() { _classCallCheck(this, TabBar); return _super.apply(this, arguments); } _createClass(TabBar, [{ key: "render", value: function render() { var _classNames; var _this$props = this.props, tabBarStyle = _this$props.tabBarStyle, animated = _this$props.animated, renderTabBar = _this$props.renderTabBar, tabBarExtraContent = _this$props.tabBarExtraContent, tabPosition = _this$props.tabPosition, prefixCls = _this$props.prefixCls, className = _this$props.className, size = _this$props.size, type = _this$props.type; var inkBarAnimated = _typeof(animated) === 'object' ? animated.inkBar : animated; var isVertical = tabPosition === 'left' || tabPosition === 'right'; var prevIconType = isVertical ? 'up' : 'left'; var nextIconType = isVertical ? 'down' : 'right'; var prevIcon = /*#__PURE__*/react["createElement"]("span", { className: "".concat(prefixCls, "-tab-prev-icon") }, /*#__PURE__*/react["createElement"](icon["default"], { type: prevIconType, className: "".concat(prefixCls, "-tab-prev-icon-target") })); var nextIcon = /*#__PURE__*/react["createElement"]("span", { className: "".concat(prefixCls, "-tab-next-icon") }, /*#__PURE__*/react["createElement"](icon["default"], { type: nextIconType, className: "".concat(prefixCls, "-tab-next-icon-target") })); // Additional className for style usage var cls = node_modules_classnames_default()("".concat(prefixCls, "-").concat(tabPosition, "-bar"), (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-").concat(size, "-bar"), !!size), _defineProperty(_classNames, "".concat(prefixCls, "-card-bar"), type && type.indexOf('card') >= 0), _classNames), className); var renderProps = _extends(_extends({}, this.props), { children: null, inkBarAnimated: inkBarAnimated, extraContent: tabBarExtraContent, style: tabBarStyle, prevIcon: prevIcon, nextIcon: nextIcon, className: cls }); var RenderTabBar; if (renderTabBar) { RenderTabBar = renderTabBar(renderProps, es_ScrollableInkTabBar); } else { RenderTabBar = /*#__PURE__*/react["createElement"](es_ScrollableInkTabBar, renderProps); } return /*#__PURE__*/react["cloneElement"](RenderTabBar); } }]); return TabBar; }(react["Component"]); TabBar_TabBar.defaultProps = { animated: true, type: 'line' }; // EXTERNAL MODULE: ./node_modules/antd/es/config-provider/index.js + 1 modules var config_provider = __webpack_require__("PmSq"); // EXTERNAL MODULE: ./node_modules/antd/es/_util/warning.js var _util_warning = __webpack_require__("qGip"); // CONCATENATED MODULE: ./node_modules/antd/es/_util/styleChecker.js var isStyleSupport = function isStyleSupport(styleName) { if (typeof window !== 'undefined' && window.document && window.document.documentElement) { var styleNameList = Array.isArray(styleName) ? styleName : [styleName]; var documentElement = window.document.documentElement; return styleNameList.some(function (name) { return name in documentElement.style; }); } return false; }; var isFlexSupported = isStyleSupport(['flex', 'webkitFlex', 'Flex', 'msFlex']); /* harmony default export */ var styleChecker = (isStyleSupport); // CONCATENATED MODULE: ./node_modules/antd/es/tabs/index.js /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return tabs_Tabs; }); function tabs__extends() { tabs__extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return tabs__extends.apply(this, arguments); } function tabs__defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function tabs__typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { tabs__typeof = function _typeof(obj) { return typeof obj; }; } else { tabs__typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return tabs__typeof(obj); } function tabs__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function tabs__defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function tabs__createClass(Constructor, protoProps, staticProps) { if (protoProps) tabs__defineProperties(Constructor.prototype, protoProps); if (staticProps) tabs__defineProperties(Constructor, staticProps); return Constructor; } function tabs__inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) tabs__setPrototypeOf(subClass, superClass); } function tabs__setPrototypeOf(o, p) { tabs__setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return tabs__setPrototypeOf(o, p); } function tabs__createSuper(Derived) { var hasNativeReflectConstruct = tabs__isNativeReflectConstruct(); return function _createSuperInternal() { var Super = tabs__getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = tabs__getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return tabs__possibleConstructorReturn(this, result); }; } function tabs__possibleConstructorReturn(self, call) { if (call && (tabs__typeof(call) === "object" || typeof call === "function")) { return call; } return tabs__assertThisInitialized(self); } function tabs__assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function tabs__isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } function tabs__getPrototypeOf(o) { tabs__getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return tabs__getPrototypeOf(o); } var __rest = this && this.__rest || function (s, e) { var t = {}; for (var p in s) { if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; } if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; }; var tabs_Tabs = /*#__PURE__*/function (_React$Component) { tabs__inherits(Tabs, _React$Component); var _super = tabs__createSuper(Tabs); function Tabs() { var _this; tabs__classCallCheck(this, Tabs); _this = _super.apply(this, arguments); _this.removeTab = function (targetKey, e) { e.stopPropagation(); if (!targetKey) { return; } var onEdit = _this.props.onEdit; if (onEdit) { onEdit(targetKey, 'remove'); } }; _this.handleChange = function (activeKey) { var onChange = _this.props.onChange; if (onChange) { onChange(activeKey); } }; _this.createNewTab = function (targetKey) { var onEdit = _this.props.onEdit; if (onEdit) { onEdit(targetKey, 'add'); } }; _this.renderTabs = function (_ref) { var _classNames; var getPrefixCls = _ref.getPrefixCls; var _this$props = _this.props, customizePrefixCls = _this$props.prefixCls, _this$props$className = _this$props.className, className = _this$props$className === void 0 ? '' : _this$props$className, size = _this$props.size, _this$props$type = _this$props.type, type = _this$props$type === void 0 ? 'line' : _this$props$type, tabPosition = _this$props.tabPosition, children = _this$props.children, _this$props$animated = _this$props.animated, animated = _this$props$animated === void 0 ? true : _this$props$animated, hideAdd = _this$props.hideAdd; var tabBarExtraContent = _this.props.tabBarExtraContent; var tabPaneAnimated = tabs__typeof(animated) === 'object' ? animated.tabPane : animated; // card tabs should not have animation if (type !== 'line') { tabPaneAnimated = 'animated' in _this.props ? tabPaneAnimated : false; } Object(_util_warning["a" /* default */])(!(type.indexOf('card') >= 0 && (size === 'small' || size === 'large')), 'Tabs', "`type=card|editable-card` doesn't have small or large size, it's by design."); var prefixCls = getPrefixCls('tabs', customizePrefixCls); var cls = node_modules_classnames_default()(className, (_classNames = {}, tabs__defineProperty(_classNames, "".concat(prefixCls, "-vertical"), tabPosition === 'left' || tabPosition === 'right'), tabs__defineProperty(_classNames, "".concat(prefixCls, "-").concat(size), !!size), tabs__defineProperty(_classNames, "".concat(prefixCls, "-card"), type.indexOf('card') >= 0), tabs__defineProperty(_classNames, "".concat(prefixCls, "-").concat(type), true), tabs__defineProperty(_classNames, "".concat(prefixCls, "-no-animation"), !tabPaneAnimated), _classNames)); // only card type tabs can be added and closed var childrenWithClose = []; if (type === 'editable-card') { childrenWithClose = []; react["Children"].forEach(children, function (child, index) { if (! /*#__PURE__*/react["isValidElement"](child)) return child; var closable = child.props.closable; closable = typeof closable === 'undefined' ? true : closable; var closeIcon = closable ? /*#__PURE__*/react["createElement"](icon["default"], { type: "close", className: "".concat(prefixCls, "-close-x"), onClick: function onClick(e) { return _this.removeTab(child.key, e); } }) : null; childrenWithClose.push( /*#__PURE__*/react["cloneElement"](child, { tab: /*#__PURE__*/react["createElement"]("div", { className: closable ? undefined : "".concat(prefixCls, "-tab-unclosable") }, child.props.tab, closeIcon), key: child.key || index })); }); // Add new tab handler if (!hideAdd) { tabBarExtraContent = /*#__PURE__*/react["createElement"]("span", null, /*#__PURE__*/react["createElement"](icon["default"], { type: "plus", className: "".concat(prefixCls, "-new-tab"), onClick: _this.createNewTab }), tabBarExtraContent); } } tabBarExtraContent = tabBarExtraContent ? /*#__PURE__*/react["createElement"]("div", { className: "".concat(prefixCls, "-extra-content") }, tabBarExtraContent) : null; var tabBarProps = __rest(_this.props, []); var contentCls = node_modules_classnames_default()("".concat(prefixCls, "-").concat(tabPosition, "-content"), type.indexOf('card') >= 0 && "".concat(prefixCls, "-card-content")); return /*#__PURE__*/react["createElement"](es, tabs__extends({}, _this.props, { prefixCls: prefixCls, className: cls, tabBarPosition: tabPosition, renderTabBar: function renderTabBar() { return /*#__PURE__*/react["createElement"](TabBar_TabBar, tabs__extends({}, Object(omit_js_es["a" /* default */])(tabBarProps, ['className']), { tabBarExtraContent: tabBarExtraContent })); }, renderTabContent: function renderTabContent() { return /*#__PURE__*/react["createElement"](es_TabContent, { className: contentCls, animated: tabPaneAnimated, animatedWithMargin: true }); }, onChange: _this.handleChange }), childrenWithClose.length > 0 ? childrenWithClose : children); }; return _this; } tabs__createClass(Tabs, [{ key: "componentDidMount", value: function componentDidMount() { var NO_FLEX = ' no-flex'; var tabNode = react_dom["findDOMNode"](this); if (tabNode && !isFlexSupported && tabNode.className.indexOf(NO_FLEX) === -1) { tabNode.className += NO_FLEX; } } }, { key: "render", value: function render() { return /*#__PURE__*/react["createElement"](config_provider["ConfigConsumer"], null, this.renderTabs); } }]); return Tabs; }(react["Component"]); tabs_Tabs.TabPane = es_TabPane; tabs_Tabs.defaultProps = { hideAdd: false, tabPosition: 'top' }; /***/ }), /***/ "v5hY": /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Copyright 2015, Yahoo! Inc. * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. */ var REACT_STATICS = { childContextTypes: true, contextTypes: true, defaultProps: true, displayName: true, getDefaultProps: true, getDerivedStateFromProps: true, mixins: true, propTypes: true, type: true }; var KNOWN_STATICS = { name: true, length: true, prototype: true, caller: true, callee: true, arguments: true, arity: true }; var defineProperty = Object.defineProperty; var getOwnPropertyNames = Object.getOwnPropertyNames; var getOwnPropertySymbols = Object.getOwnPropertySymbols; var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; var getPrototypeOf = Object.getPrototypeOf; var objectPrototype = getPrototypeOf && getPrototypeOf(Object); function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) { if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components if (objectPrototype) { var inheritedComponent = getPrototypeOf(sourceComponent); if (inheritedComponent && inheritedComponent !== objectPrototype) { hoistNonReactStatics(targetComponent, inheritedComponent, blacklist); } } var keys = getOwnPropertyNames(sourceComponent); if (getOwnPropertySymbols) { keys = keys.concat(getOwnPropertySymbols(sourceComponent)); } for (var i = 0; i < keys.length; ++i) { var key = keys[i]; if (!REACT_STATICS[key] && !KNOWN_STATICS[key] && (!blacklist || !blacklist[key])) { var descriptor = getOwnPropertyDescriptor(sourceComponent, key); try { // Avoid failures from read-only properties defineProperty(targetComponent, key, descriptor); } catch (e) {} } } return targetComponent; } return targetComponent; } module.exports = hoistNonReactStatics; /***/ }), /***/ "w2vo": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* WEBPACK VAR INJECTION */(function(process, module) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "css", function() { return css; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "keyframes", function() { return keyframes; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "injectGlobal", function() { return injectGlobal; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isStyledComponent", function() { return isStyledComponent; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "consolidateStreamedStyles", function() { return consolidateStreamedStyles; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ThemeProvider", function() { return ThemeProvider; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "withTheme", function() { return withTheme; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ServerStyleSheet", function() { return ServerStyleSheet; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StyleSheetManager", function() { return StyleSheetManager; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__DO_NOT_USE_OR_YOU_WILL_BE_HAUNTED_BY_SPOOKY_GHOSTS", function() { return __DO_NOT_USE_OR_YOU_WILL_BE_HAUNTED_BY_SPOOKY_GHOSTS; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_fbjs_lib_hyphenateStyleName__ = __webpack_require__("mL1Z"); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_fbjs_lib_hyphenateStyleName___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_fbjs_lib_hyphenateStyleName__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react__ = __webpack_require__("GiK3"); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_stylis__ = __webpack_require__("Ruo5"); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_stylis___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_stylis__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_stylis_rule_sheet__ = __webpack_require__("IM/B"); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_stylis_rule_sheet___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_stylis_rule_sheet__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_prop_types__ = __webpack_require__("KSGD"); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_prop_types__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_hoist_non_react_statics__ = __webpack_require__("v5hY"); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_hoist_non_react_statics___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_hoist_non_react_statics__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react_is__ = __webpack_require__("ncfW"); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react_is___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_react_is__); var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; var createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; var objectWithoutProperties = function (obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }; var possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; // var isPlainObject = (function (x) { return (typeof x === 'undefined' ? 'undefined' : _typeof(x)) === 'object' && x.constructor === Object; }); // /** * Parse errors.md and turn it into a simple hash of code: message */ var ERRORS = false ? { "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 ``\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": "A plain React class (%s) has been interpolated into styles, probably as a component selector (https://www.styled-components.com/docs/advanced#referring-to-other-components). Only styled-component classes can be targeted in this fashion." } : {}; /** * super basic version of sprintf */ function format() { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } var a = args[0]; var b = []; var c = void 0; for (c = 1; c < args.length; c += 1) { b.push(args[c]); } b.forEach(function (d) { a = a.replace(/%[a-z]/, d); }); return a; } /** * Create an error file out of errors.md for development and a simple web link to the full errors * in production mode. */ var StyledComponentsError = function (_Error) { inherits(StyledComponentsError, _Error); function StyledComponentsError(code) { classCallCheck(this, StyledComponentsError); for (var _len2 = arguments.length, interpolations = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { interpolations[_key2 - 1] = arguments[_key2]; } if (true) { var _this = possibleConstructorReturn(this, _Error.call(this, 'An error occurred. See https://github.com/styled-components/styled-components/blob/master/src/utils/errors.md#' + code + ' for more information. ' + (interpolations ? 'Additional arguments: ' + interpolations.join(', ') : ''))); } else { var _this = possibleConstructorReturn(this, _Error.call(this, format.apply(undefined, [ERRORS[code]].concat(interpolations)))); } return possibleConstructorReturn(_this); } return StyledComponentsError; }(Error); // var objToCss = function objToCss(obj, prevKey) { var css = Object.keys(obj).filter(function (key) { var chunk = obj[key]; return chunk !== undefined && chunk !== null && chunk !== false && chunk !== ''; }).map(function (key) { if (isPlainObject(obj[key])) return objToCss(obj[key], key); return __WEBPACK_IMPORTED_MODULE_0_fbjs_lib_hyphenateStyleName___default()(key) + ': ' + obj[key] + ';'; }).join(' '); return prevKey ? prevKey + ' {\n ' + css + '\n}' : css; }; var flatten = function flatten(chunks, executionContext) { return chunks.reduce(function (ruleSet, chunk) { /* Remove falsey values */ if (chunk === undefined || chunk === null || chunk === false || chunk === '') { return ruleSet; } /* Flatten ruleSet */ if (Array.isArray(chunk)) { ruleSet.push.apply(ruleSet, flatten(chunk, executionContext)); return ruleSet; } /* Handle other components */ if (chunk.hasOwnProperty('styledComponentId')) { // $FlowFixMe not sure how to make this pass ruleSet.push('.' + chunk.styledComponentId); return ruleSet; } /* Either execute or defer the function */ if (typeof chunk === 'function') { if (executionContext) { var nextChunk = chunk(executionContext); /* Throw if a React Element was given styles */ if (__WEBPACK_IMPORTED_MODULE_1_react___default.a.isValidElement(nextChunk)) { var elementName = chunk.displayName || chunk.name; throw new StyledComponentsError(11, elementName); } ruleSet.push.apply(ruleSet, flatten([nextChunk], executionContext)); } else ruleSet.push(chunk); return ruleSet; } /* Handle objects */ ruleSet.push( // $FlowFixMe have to add %checks somehow to isPlainObject isPlainObject(chunk) ? objToCss(chunk) : chunk.toString()); return ruleSet; }, []); }; // var COMMENT_REGEX = /^\s*\/\/.*$/gm; // NOTE: This stylis instance is only used to split rules from SSR'd style tags var stylisSplitter = new __WEBPACK_IMPORTED_MODULE_2_stylis___default.a({ global: false, cascade: true, keyframe: false, prefix: false, compress: false, semicolon: true }); var stylis = new __WEBPACK_IMPORTED_MODULE_2_stylis___default.a({ global: false, cascade: true, keyframe: false, prefix: true, compress: false, semicolon: false // NOTE: This means "autocomplete missing semicolons" }); // Wrap `insertRulePlugin to build a list of rules, // and then make our own plugin to return the rules. This // makes it easier to hook into the existing SSR architecture var parsingRules = []; // eslint-disable-next-line consistent-return var returnRulesPlugin = function returnRulesPlugin(context) { if (context === -2) { var parsedRules = parsingRules; parsingRules = []; return parsedRules; } }; var parseRulesPlugin = __WEBPACK_IMPORTED_MODULE_3_stylis_rule_sheet___default()(function (rule) { parsingRules.push(rule); }); stylis.use([parseRulesPlugin, returnRulesPlugin]); stylisSplitter.use([parseRulesPlugin, returnRulesPlugin]); var stringifyRules = function stringifyRules(rules, selector, prefix) { var flatCSS = rules.join('').replace(COMMENT_REGEX, ''); // replace JS comments var cssStr = selector && prefix ? prefix + ' ' + selector + ' { ' + flatCSS + ' }' : flatCSS; return stylis(prefix || !selector ? '' : selector, cssStr); }; var splitByRules = function splitByRules(css) { return stylisSplitter('', css); }; // function isStyledComponent(target) /* : %checks */{ return ( // $FlowFixMe TODO: flow for styledComponentId typeof target === 'function' && typeof target.styledComponentId === 'string' ); } // /* This function is DEPRECATED and will be removed on the next major version release. * It was needed to rehydrate all style blocks prepended to chunks before React * tries to rehydrate its HTML stream. Since the master StyleSheet will now detect * the use of streamed style tags and will perform the rehydration earlier when needed * this function will not be needed anymore */ function consolidateStreamedStyles() { if (false) { // eslint-disable-next-line no-console console.warn('styled-components automatically does streaming SSR rehydration now.\n' + 'Calling consolidateStreamedStyles manually is no longer necessary and a noop now.\n' + '- Please remove the consolidateStreamedStyles call from your client.'); } } // /* eslint-disable no-bitwise */ /* This is the "capacity" of our alphabet i.e. 2x26 for all letters plus their capitalised * counterparts */ var charsLength = 52; /* start at 75 for 'a' until 'z' (25) and then start at 65 for capitalised letters */ var getAlphabeticChar = function getAlphabeticChar(code) { return String.fromCharCode(code + (code > 25 ? 39 : 97)); }; /* input a number, usually a hash and convert it to base-52 */ var generateAlphabeticName = function generateAlphabeticName(code) { var name = ''; var x = void 0; /* get a char and divide by alphabet-length */ for (x = code; x > charsLength; x = Math.floor(x / charsLength)) { name = getAlphabeticChar(x % charsLength) + name; } return getAlphabeticChar(x % charsLength) + name; }; // var interleave = (function (strings, interpolations) { var result = [strings[0]]; for (var i = 0, len = interpolations.length; i < len; i += 1) { result.push(interpolations[i], strings[i + 1]); } return result; }); // var EMPTY_ARRAY = Object.freeze([]); var EMPTY_OBJECT = Object.freeze({}); // var css = (function (styles) { for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { interpolations[_key - 1] = arguments[_key]; } if (typeof styles === 'function' || isPlainObject(styles)) { // $FlowFixMe return flatten(interleave(EMPTY_ARRAY, [styles].concat(interpolations))); } // $FlowFixMe return flatten(interleave(styles, interpolations)); }); // var SC_ATTR = typeof process !== 'undefined' && process.env.SC_ATTR || 'data-styled-components'; var SC_STREAM_ATTR = 'data-styled-streamed'; var CONTEXT_KEY = '__styled-components-stylesheet__'; var IS_BROWSER = typeof window !== 'undefined' && 'HTMLElement' in window; var DISABLE_SPEEDY = "production" !== 'production'; // var SC_COMPONENT_ID = /^[^\S\n]*?\/\* sc-component-id:\s*(\S+)\s+\*\//gm; var extractComps = (function (maybeCSS) { var css = '' + (maybeCSS || ''); // Definitely a string, and a clone var existingComponents = []; css.replace(SC_COMPONENT_ID, function (match, componentId, matchIndex) { existingComponents.push({ componentId: componentId, matchIndex: matchIndex }); return match; }); return existingComponents.map(function (_ref, i) { var componentId = _ref.componentId, matchIndex = _ref.matchIndex; var nextComp = existingComponents[i + 1]; var cssFromDOM = nextComp ? css.slice(matchIndex, nextComp.matchIndex) : css.slice(matchIndex); return { componentId: componentId, cssFromDOM: cssFromDOM }; }); }); // /* eslint-disable camelcase, no-undef */ var getNonce = (function () { return true ? __webpack_require__.nc : null; }); // // Helper to call a given function, only once var once = (function (cb) { var called = false; return function () { if (!called) { called = true; cb(); } }; }); // /* These are helpers for the StyleTags to keep track of the injected * rule names for each (component) ID that they're keeping track of. * They're crucial for detecting whether a name has already been * injected. * (This excludes rehydrated names) */ /* adds a new ID:name pairing to a names dictionary */ var addNameForId = function addNameForId(names, id, name) { if (name) { // eslint-disable-next-line no-param-reassign var namesForId = names[id] || (names[id] = Object.create(null)); namesForId[name] = true; } }; /* resets an ID entirely by overwriting it in the dictionary */ var resetIdNames = function resetIdNames(names, id) { // eslint-disable-next-line no-param-reassign names[id] = Object.create(null); }; /* factory for a names dictionary checking the existance of an ID:name pairing */ var hasNameForId = function hasNameForId(names) { return function (id, name) { return names[id] !== undefined && names[id][name]; }; }; /* stringifies names for the html/element output */ var stringifyNames = function stringifyNames(names) { var str = ''; // eslint-disable-next-line guard-for-in for (var id in names) { str += Object.keys(names[id]).join(' ') + ' '; } return str.trim(); }; /* clones the nested names dictionary */ var cloneNames = function cloneNames(names) { var clone = Object.create(null); // eslint-disable-next-line guard-for-in for (var id in names) { clone[id] = _extends({}, names[id]); } return clone; }; // /* These are helpers that deal with the insertRule (aka speedy) API * They are used in the StyleTags and specifically the speedy tag */ /* retrieve a sheet for a given style tag */ var sheetForTag = function sheetForTag(tag) { // $FlowFixMe if (tag.sheet) return tag.sheet; /* Firefox quirk requires us to step through all stylesheets to find one owned by the given tag */ var size = document.styleSheets.length; for (var i = 0; i < size; i += 1) { var sheet = document.styleSheets[i]; // $FlowFixMe if (sheet.ownerNode === tag) return sheet; } /* we should always be able to find a tag */ throw new StyledComponentsError(10); }; /* insert a rule safely and return whether it was actually injected */ var safeInsertRule = function safeInsertRule(sheet, cssRule, index) { /* abort early if cssRule string is falsy */ if (!cssRule) return false; var maxIndex = sheet.cssRules.length; try { /* use insertRule and cap passed index with maxIndex (no of cssRules) */ sheet.insertRule(cssRule, index <= maxIndex ? index : maxIndex); } catch (err) { /* any error indicates an invalid rule */ return false; } return true; }; /* deletes `size` rules starting from `removalIndex` */ var deleteRules = function deleteRules(sheet, removalIndex, size) { var lowerBound = removalIndex - size; for (var i = removalIndex; i > lowerBound; i -= 1) { sheet.deleteRule(i); } }; // /* this marker separates component styles and is important for rehydration */ var makeTextMarker = function makeTextMarker(id) { return '\n/* sc-component-id: ' + id + ' */\n'; }; /* add up all numbers in array up until and including the index */ var addUpUntilIndex = function addUpUntilIndex(sizes, index) { var totalUpToIndex = 0; for (var i = 0; i <= index; i += 1) { totalUpToIndex += sizes[i]; } return totalUpToIndex; }; /* create a new style tag after lastEl */ var makeStyleTag = function makeStyleTag(target, tagEl, insertBefore) { var el = document.createElement('style'); el.setAttribute(SC_ATTR, ''); var nonce = getNonce(); if (nonce) { el.setAttribute('nonce', nonce); } /* Work around insertRule quirk in EdgeHTML */ el.appendChild(document.createTextNode('')); if (target && !tagEl) { /* Append to target when no previous element was passed */ target.appendChild(el); } else { if (!tagEl || !target || !tagEl.parentNode) { throw new StyledComponentsError(6); } /* Insert new style tag after the previous one */ tagEl.parentNode.insertBefore(el, insertBefore ? tagEl : tagEl.nextSibling); } return el; }; /* takes a css factory function and outputs an html styled tag factory */ var wrapAsHtmlTag = function wrapAsHtmlTag(css, names) { return function (additionalAttrs) { var nonce = getNonce(); var attrs = [nonce && 'nonce="' + nonce + '"', SC_ATTR + '="' + stringifyNames(names) + '"', additionalAttrs]; var htmlAttr = attrs.filter(Boolean).join(' '); return ''; }; }; /* takes a css factory function and outputs an element factory */ var wrapAsElement = function wrapAsElement(css, names) { return function () { var _props; var props = (_props = {}, _props[SC_ATTR] = stringifyNames(names), _props); var nonce = getNonce(); if (nonce) { // $FlowFixMe props.nonce = nonce; } // eslint-disable-next-line react/no-danger return __WEBPACK_IMPORTED_MODULE_1_react___default.a.createElement('style', _extends({}, props, { dangerouslySetInnerHTML: { __html: css() } })); }; }; var getIdsFromMarkersFactory = function getIdsFromMarkersFactory(markers) { return function () { return Object.keys(markers); }; }; /* speedy tags utilise insertRule */ var makeSpeedyTag = function makeSpeedyTag(el, getImportRuleTag) { var names = Object.create(null); var markers = Object.create(null); var sizes = []; var extractImport = getImportRuleTag !== undefined; /* indicates whther getImportRuleTag was called */ var usedImportRuleTag = false; var insertMarker = function insertMarker(id) { var prev = markers[id]; if (prev !== undefined) { return prev; } markers[id] = sizes.length; sizes.push(0); resetIdNames(names, id); return markers[id]; }; var insertRules = function insertRules(id, cssRules, name) { var marker = insertMarker(id); var sheet = sheetForTag(el); var insertIndex = addUpUntilIndex(sizes, marker); var injectedRules = 0; var importRules = []; var cssRulesSize = cssRules.length; for (var i = 0; i < cssRulesSize; i += 1) { var cssRule = cssRules[i]; var mayHaveImport = extractImport; /* @import rules are reordered to appear first */ if (mayHaveImport && cssRule.indexOf('@import') !== -1) { importRules.push(cssRule); } else if (safeInsertRule(sheet, cssRule, insertIndex + injectedRules)) { mayHaveImport = false; injectedRules += 1; } } if (extractImport && importRules.length > 0) { usedImportRuleTag = true; // $FlowFixMe getImportRuleTag().insertRules(id + '-import', importRules); } sizes[marker] += injectedRules; /* add up no of injected rules */ addNameForId(names, id, name); }; var removeRules = function removeRules(id) { var marker = markers[id]; if (marker === undefined) return; var size = sizes[marker]; var sheet = sheetForTag(el); var removalIndex = addUpUntilIndex(sizes, marker); deleteRules(sheet, removalIndex, size); sizes[marker] = 0; resetIdNames(names, id); if (extractImport && usedImportRuleTag) { // $FlowFixMe getImportRuleTag().removeRules(id + '-import'); } }; var css = function css() { var _sheetForTag = sheetForTag(el), cssRules = _sheetForTag.cssRules; var str = ''; // eslint-disable-next-line guard-for-in for (var id in markers) { str += makeTextMarker(id); var marker = markers[id]; var end = addUpUntilIndex(sizes, marker); var size = sizes[marker]; for (var i = end - size; i < end; i += 1) { var rule = cssRules[i]; if (rule !== undefined) { str += rule.cssText; } } } return str; }; return { clone: function clone() { throw new StyledComponentsError(5); }, css: css, getIds: getIdsFromMarkersFactory(markers), hasNameForId: hasNameForId(names), insertMarker: insertMarker, insertRules: insertRules, removeRules: removeRules, sealed: false, styleTag: el, toElement: wrapAsElement(css, names), toHTML: wrapAsHtmlTag(css, names) }; }; var makeTextNode = function makeTextNode(id) { return document.createTextNode(makeTextMarker(id)); }; var makeBrowserTag = function makeBrowserTag(el, getImportRuleTag) { var names = Object.create(null); var markers = Object.create(null); var extractImport = getImportRuleTag !== undefined; /* indicates whther getImportRuleTag was called */ var usedImportRuleTag = false; var insertMarker = function insertMarker(id) { var prev = markers[id]; if (prev !== undefined) { return prev; } markers[id] = makeTextNode(id); el.appendChild(markers[id]); names[id] = Object.create(null); return markers[id]; }; var insertRules = function insertRules(id, cssRules, name) { var marker = insertMarker(id); var importRules = []; var cssRulesSize = cssRules.length; for (var i = 0; i < cssRulesSize; i += 1) { var rule = cssRules[i]; var mayHaveImport = extractImport; if (mayHaveImport && rule.indexOf('@import') !== -1) { importRules.push(rule); } else { mayHaveImport = false; var separator = i === cssRulesSize - 1 ? '' : ' '; marker.appendData('' + rule + separator); } } addNameForId(names, id, name); if (extractImport && importRules.length > 0) { usedImportRuleTag = true; // $FlowFixMe getImportRuleTag().insertRules(id + '-import', importRules); } }; var removeRules = function removeRules(id) { var marker = markers[id]; if (marker === undefined) return; /* create new empty text node and replace the current one */ var newMarker = makeTextNode(id); el.replaceChild(newMarker, marker); markers[id] = newMarker; resetIdNames(names, id); if (extractImport && usedImportRuleTag) { // $FlowFixMe getImportRuleTag().removeRules(id + '-import'); } }; var css = function css() { var str = ''; // eslint-disable-next-line guard-for-in for (var id in markers) { str += markers[id].data; } return str; }; return { clone: function clone() { throw new StyledComponentsError(5); }, css: css, getIds: getIdsFromMarkersFactory(markers), hasNameForId: hasNameForId(names), insertMarker: insertMarker, insertRules: insertRules, removeRules: removeRules, sealed: false, styleTag: el, toElement: wrapAsElement(css, names), toHTML: wrapAsHtmlTag(css, names) }; }; var makeServerTagInternal = function makeServerTagInternal(namesArg, markersArg) { var names = namesArg === undefined ? Object.create(null) : namesArg; var markers = markersArg === undefined ? Object.create(null) : markersArg; var insertMarker = function insertMarker(id) { var prev = markers[id]; if (prev !== undefined) { return prev; } return markers[id] = ['']; }; var insertRules = function insertRules(id, cssRules, name) { var marker = insertMarker(id); marker[0] += cssRules.join(' '); addNameForId(names, id, name); }; var removeRules = function removeRules(id) { var marker = markers[id]; if (marker === undefined) return; marker[0] = ''; resetIdNames(names, id); }; var css = function css() { var str = ''; // eslint-disable-next-line guard-for-in for (var id in markers) { var cssForId = markers[id][0]; if (cssForId) { str += makeTextMarker(id) + cssForId; } } return str; }; var clone = function clone() { var namesClone = cloneNames(names); var markersClone = Object.create(null); // eslint-disable-next-line guard-for-in for (var id in markers) { markersClone[id] = [markers[id][0]]; } return makeServerTagInternal(namesClone, markersClone); }; var tag = { clone: clone, css: css, getIds: getIdsFromMarkersFactory(markers), hasNameForId: hasNameForId(names), insertMarker: insertMarker, insertRules: insertRules, removeRules: removeRules, sealed: false, styleTag: null, toElement: wrapAsElement(css, names), toHTML: wrapAsHtmlTag(css, names) }; return tag; }; var makeServerTag = function makeServerTag() { return makeServerTagInternal(); }; var makeTag = function makeTag(target, tagEl, forceServer, insertBefore, getImportRuleTag) { if (IS_BROWSER && !forceServer) { var el = makeStyleTag(target, tagEl, insertBefore); if (DISABLE_SPEEDY) { return makeBrowserTag(el, getImportRuleTag); } else { return makeSpeedyTag(el, getImportRuleTag); } } return makeServerTag(); }; /* wraps a given tag so that rehydration is performed once when necessary */ var makeRehydrationTag = function makeRehydrationTag(tag, els, extracted, immediateRehydration) { /* rehydration function that adds all rules to the new tag */ var rehydrate = once(function () { /* add all extracted components to the new tag */ for (var i = 0, len = extracted.length; i < len; i += 1) { var _extracted$i = extracted[i], componentId = _extracted$i.componentId, cssFromDOM = _extracted$i.cssFromDOM; var cssRules = splitByRules(cssFromDOM); tag.insertRules(componentId, cssRules); } /* remove old HTMLStyleElements, since they have been rehydrated */ for (var _i = 0, _len = els.length; _i < _len; _i += 1) { var el = els[_i]; if (el.parentNode) { el.parentNode.removeChild(el); } } }); if (immediateRehydration) rehydrate(); return _extends({}, tag, { /* add rehydration hook to insertion methods */ insertMarker: function insertMarker(id) { rehydrate(); return tag.insertMarker(id); }, insertRules: function insertRules(id, cssRules, name) { rehydrate(); return tag.insertRules(id, cssRules, name); } }); }; // var SPLIT_REGEX = /\s+/; /* determine the maximum number of components before tags are sharded */ var MAX_SIZE = void 0; if (IS_BROWSER) { /* in speedy mode we can keep a lot more rules in a sheet before a slowdown can be expected */ MAX_SIZE = DISABLE_SPEEDY ? 40 : 1000; } else { /* for servers we do not need to shard at all */ MAX_SIZE = -1; } var sheetRunningId = 0; var master = void 0; var StyleSheet = function () { /* a map from ids to tags */ /* deferred rules for a given id */ /* this is used for not reinjecting rules via hasNameForId() */ /* when rules for an id are removed using remove() we have to ignore rehydratedNames for it */ /* a list of tags belonging to this StyleSheet */ /* a tag for import rules */ /* current capacity until a new tag must be created */ /* children (aka clones) of this StyleSheet inheriting all and future injections */ function StyleSheet() { var _this = this; var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : IS_BROWSER ? document.head : null; var forceServer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; classCallCheck(this, StyleSheet); this.getImportRuleTag = function () { var importRuleTag = _this.importRuleTag; if (importRuleTag !== undefined) { return importRuleTag; } var firstTag = _this.tags[0]; var insertBefore = true; return _this.importRuleTag = makeTag(_this.target, firstTag ? firstTag.styleTag : null, _this.forceServer, insertBefore); }; sheetRunningId += 1; this.id = sheetRunningId; this.forceServer = forceServer; this.target = forceServer ? null : target; this.tagMap = {}; this.deferred = {}; this.rehydratedNames = {}; this.ignoreRehydratedNames = {}; this.tags = []; this.capacity = 1; this.clones = []; } /* rehydrate all SSR'd style tags */ StyleSheet.prototype.rehydrate = function rehydrate() { if (!IS_BROWSER || this.forceServer) { return this; } var els = []; var extracted = []; var isStreamed = false; /* retrieve all of our SSR style elements from the DOM */ var nodes = document.querySelectorAll('style[' + SC_ATTR + ']'); var nodesSize = nodes.length; /* abort rehydration if no previous style tags were found */ if (nodesSize === 0) { return this; } for (var i = 0; i < nodesSize; i += 1) { // $FlowFixMe: We can trust that all elements in this query are style elements var el = nodes[i]; /* check if style tag is a streamed tag */ if (!isStreamed) isStreamed = !!el.getAttribute(SC_STREAM_ATTR); /* retrieve all component names */ var elNames = (el.getAttribute(SC_ATTR) || '').trim().split(SPLIT_REGEX); var elNamesSize = elNames.length; for (var j = 0; j < elNamesSize; j += 1) { var name = elNames[j]; /* add rehydrated name to sheet to avoid readding styles */ this.rehydratedNames[name] = true; } /* extract all components and their CSS */ extracted.push.apply(extracted, extractComps(el.textContent)); /* store original HTMLStyleElement */ els.push(el); } /* abort rehydration if nothing was extracted */ var extractedSize = extracted.length; if (extractedSize === 0) { return this; } /* create a tag to be used for rehydration */ var tag = this.makeTag(null); var rehydrationTag = makeRehydrationTag(tag, els, extracted, isStreamed); /* reset capacity and adjust MAX_SIZE by the initial size of the rehydration */ this.capacity = Math.max(1, MAX_SIZE - extractedSize); this.tags.push(rehydrationTag); /* retrieve all component ids */ for (var _j = 0; _j < extractedSize; _j += 1) { this.tagMap[extracted[_j].componentId] = rehydrationTag; } return this; }; /* retrieve a "master" instance of StyleSheet which is typically used when no other is available * The master StyleSheet is targeted by injectGlobal, keyframes, and components outside of any * StyleSheetManager's context */ /* reset the internal "master" instance */ StyleSheet.reset = function reset() { var forceServer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; master = new StyleSheet(undefined, forceServer).rehydrate(); }; /* adds "children" to the StyleSheet that inherit all of the parents' rules * while their own rules do not affect the parent */ StyleSheet.prototype.clone = function clone() { var sheet = new StyleSheet(this.target, this.forceServer); /* add to clone array */ this.clones.push(sheet); /* clone all tags */ sheet.tags = this.tags.map(function (tag) { var ids = tag.getIds(); var newTag = tag.clone(); /* reconstruct tagMap */ for (var i = 0; i < ids.length; i += 1) { sheet.tagMap[ids[i]] = newTag; } return newTag; }); /* clone other maps */ sheet.rehydratedNames = _extends({}, this.rehydratedNames); sheet.deferred = _extends({}, this.deferred); return sheet; }; /* force StyleSheet to create a new tag on the next injection */ StyleSheet.prototype.sealAllTags = function sealAllTags() { this.capacity = 1; this.tags.forEach(function (tag) { // eslint-disable-next-line no-param-reassign tag.sealed = true; }); }; StyleSheet.prototype.makeTag = function makeTag$$1(tag) { var lastEl = tag ? tag.styleTag : null; var insertBefore = false; return makeTag(this.target, lastEl, this.forceServer, insertBefore, this.getImportRuleTag); }; /* get a tag for a given componentId, assign the componentId to one, or shard */ StyleSheet.prototype.getTagForId = function getTagForId(id) { /* simply return a tag, when the componentId was already assigned one */ var prev = this.tagMap[id]; if (prev !== undefined && !prev.sealed) { return prev; } var tag = this.tags[this.tags.length - 1]; /* shard (create a new tag) if the tag is exhausted (See MAX_SIZE) */ this.capacity -= 1; if (this.capacity === 0) { this.capacity = MAX_SIZE; tag = this.makeTag(tag); this.tags.push(tag); } return this.tagMap[id] = tag; }; /* mainly for injectGlobal to check for its id */ StyleSheet.prototype.hasId = function hasId(id) { return this.tagMap[id] !== undefined; }; /* caching layer checking id+name to already have a corresponding tag and injected rules */ StyleSheet.prototype.hasNameForId = function hasNameForId(id, name) { /* exception for rehydrated names which are checked separately */ if (this.ignoreRehydratedNames[id] === undefined && this.rehydratedNames[name]) { return true; } var tag = this.tagMap[id]; return tag !== undefined && tag.hasNameForId(id, name); }; /* registers a componentId and registers it on its tag */ StyleSheet.prototype.deferredInject = function deferredInject(id, cssRules) { /* don't inject when the id is already registered */ if (this.tagMap[id] !== undefined) return; var clones = this.clones; for (var i = 0; i < clones.length; i += 1) { clones[i].deferredInject(id, cssRules); } this.getTagForId(id).insertMarker(id); this.deferred[id] = cssRules; }; /* injects rules for a given id with a name that will need to be cached */ StyleSheet.prototype.inject = function inject(id, cssRules, name) { var clones = this.clones; for (var i = 0; i < clones.length; i += 1) { clones[i].inject(id, cssRules, name); } var tag = this.getTagForId(id); /* add deferred rules for component */ if (this.deferred[id] !== undefined) { // Combine passed cssRules with previously deferred CSS rules // NOTE: We cannot mutate the deferred array itself as all clones // do the same (see clones[i].inject) var rules = this.deferred[id].concat(cssRules); tag.insertRules(id, rules, name); this.deferred[id] = undefined; } else { tag.insertRules(id, cssRules, name); } }; /* removes all rules for a given id, which doesn't remove its marker but resets it */ StyleSheet.prototype.remove = function remove(id) { var tag = this.tagMap[id]; if (tag === undefined) return; var clones = this.clones; for (var i = 0; i < clones.length; i += 1) { clones[i].remove(id); } /* remove all rules from the tag */ tag.removeRules(id); /* ignore possible rehydrated names */ this.ignoreRehydratedNames[id] = true; /* delete possible deferred rules */ this.deferred[id] = undefined; }; StyleSheet.prototype.toHTML = function toHTML() { return this.tags.map(function (tag) { return tag.toHTML(); }).join(''); }; StyleSheet.prototype.toReactElements = function toReactElements() { var id = this.id; return this.tags.map(function (tag, i) { var key = 'sc-' + id + '-' + i; return Object(__WEBPACK_IMPORTED_MODULE_1_react__["cloneElement"])(tag.toElement(), { key: key }); }); }; createClass(StyleSheet, null, [{ key: 'master', get: function get$$1() { return master || (master = new StyleSheet().rehydrate()); } /* NOTE: This is just for backwards-compatibility with jest-styled-components */ }, { key: 'instance', get: function get$$1() { return StyleSheet.master; } }]); return StyleSheet; }(); var _StyleSheetManager$ch; var StyleSheetManager = function (_Component) { inherits(StyleSheetManager, _Component); function StyleSheetManager() { classCallCheck(this, StyleSheetManager); return possibleConstructorReturn(this, _Component.apply(this, arguments)); } StyleSheetManager.prototype.getChildContext = function getChildContext() { var _ref; return _ref = {}, _ref[CONTEXT_KEY] = this.sheetInstance, _ref; }; StyleSheetManager.prototype.componentWillMount = function componentWillMount() { if (this.props.sheet) { this.sheetInstance = this.props.sheet; } else if (this.props.target) { this.sheetInstance = new StyleSheet(this.props.target); } else { throw new StyledComponentsError(4); } }; StyleSheetManager.prototype.render = function render() { /* eslint-disable react/prop-types */ // Flow v0.43.1 will report an error accessing the `children` property, // but v0.47.0 will not. It is necessary to use a type cast instead of // a "fixme" comment to satisfy both Flow versions. return __WEBPACK_IMPORTED_MODULE_1_react___default.a.Children.only(this.props.children); }; return StyleSheetManager; }(__WEBPACK_IMPORTED_MODULE_1_react__["Component"]); StyleSheetManager.childContextTypes = (_StyleSheetManager$ch = {}, _StyleSheetManager$ch[CONTEXT_KEY] = __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.instanceOf(StyleSheet), __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.instanceOf(ServerStyleSheet)]).isRequired, _StyleSheetManager$ch); false ? StyleSheetManager.propTypes = { sheet: PropTypes.oneOfType([PropTypes.instanceOf(StyleSheet), PropTypes.instanceOf(ServerStyleSheet)]), target: PropTypes.shape({ appendChild: PropTypes.func.isRequired }) } : void 0; // var ServerStyleSheet = function () { function ServerStyleSheet() { classCallCheck(this, ServerStyleSheet); /* The master sheet might be reset, so keep a reference here */ this.masterSheet = StyleSheet.master; this.instance = this.masterSheet.clone(); this.closed = false; } ServerStyleSheet.prototype.complete = function complete() { if (!this.closed) { /* Remove closed StyleSheets from the master sheet */ var index = this.masterSheet.clones.indexOf(this.instance); this.masterSheet.clones.splice(index, 1); this.closed = true; } }; ServerStyleSheet.prototype.collectStyles = function collectStyles(children) { if (this.closed) { throw new StyledComponentsError(2); } return __WEBPACK_IMPORTED_MODULE_1_react___default.a.createElement( StyleSheetManager, { sheet: this.instance }, children ); }; ServerStyleSheet.prototype.getStyleTags = function getStyleTags() { this.complete(); return this.instance.toHTML(); }; ServerStyleSheet.prototype.getStyleElement = function getStyleElement() { this.complete(); return this.instance.toReactElements(); }; ServerStyleSheet.prototype.interleaveWithNodeStream = function interleaveWithNodeStream(readableStream) { var _this = this; { throw new StyledComponentsError(3); } /* the tag index keeps track of which tags have already been emitted */ var instance = this.instance; var instanceTagIndex = 0; var streamAttr = SC_STREAM_ATTR + '="true"'; var transformer = new stream.Transform({ transform: function appendStyleChunks(chunk, /* encoding */_, callback) { var tags = instance.tags; var html = ''; /* retrieve html for each new style tag */ for (; instanceTagIndex < tags.length; instanceTagIndex += 1) { var tag = tags[instanceTagIndex]; html += tag.toHTML(streamAttr); } /* force our StyleSheets to emit entirely new tags */ instance.sealAllTags(); /* prepend style html to chunk */ this.push(html + chunk); callback(); } }); readableStream.on('end', function () { return _this.complete(); }); readableStream.on('error', function (err) { _this.complete(); // forward the error to the transform stream transformer.emit('error', err); }); return readableStream.pipe(transformer); }; return ServerStyleSheet; }(); // var LIMIT = 200; var createWarnTooManyClasses = (function (displayName) { var generatedClasses = {}; var warningSeen = false; return function (className) { if (!warningSeen) { generatedClasses[className] = true; if (Object.keys(generatedClasses).length >= LIMIT) { // Unable to find latestRule in test environment. /* eslint-disable no-console, prefer-template */ console.warn('Over ' + LIMIT + ' classes were generated for component ' + displayName + '. \n' + 'Consider using the attrs method, together with a style object for frequently changed styles.\n' + 'Example:\n' + ' const Component = styled.div.attrs({\n' + ' style: ({ background }) => ({\n' + ' background,\n' + ' }),\n' + ' })`width: 100%;`\n\n' + ' '); warningSeen = true; generatedClasses = {}; } } }; }); // var determineTheme = (function (props, fallbackTheme, defaultProps) { // Props should take precedence over ThemeProvider, which should take precedence over // defaultProps, but React automatically puts defaultProps on props. /* eslint-disable react/prop-types */ var isDefaultTheme = defaultProps && props.theme === defaultProps.theme; var theme = props.theme && !isDefaultTheme ? props.theme : fallbackTheme; /* eslint-enable */ return theme; }); // var escapeRegex = /[[\].#*$><+~=|^:(),"'`-]+/g; var dashesAtEnds = /(^-|-$)/g; /** * TODO: Explore using CSS.escape when it becomes more available * in evergreen browsers. */ function escape(str) { return str // Replace all possible CSS selectors .replace(escapeRegex, '-') // Remove extraneous hyphens at the start and end .replace(dashesAtEnds, ''); } // function getComponentName(target) { return target.displayName || target.name || 'Component'; } // function isTag(target) /* : %checks */{ return typeof target === 'string'; } // function generateDisplayName(target) { return isTag(target) ? 'styled.' + target : 'Styled(' + getComponentName(target) + ')'; } // /* eslint-disable max-len */ /** * Trying to avoid the unknown-prop errors on styled components by filtering by * React's attribute whitelist. * * To regenerate this regex: * * 1. `npm i -g regexgen` (https://github.com/devongovett/regexgen) * 2. Run `regexgen` with the list of space-separated words below as input * 3. Surround the emitted regex with this: `/^(GENERATED_REGEX)$/` -- this will ensure a full string match * and no false positives from partials * */ /* children dangerouslySetInnerHTML key ref autoFocus defaultValue valueLink defaultChecked checkedLink innerHTML suppressContentEditableWarning onFocusIn onFocusOut className onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown onKeyPress onKeyUp onFocus onBlur onChange onInput onInvalid onSubmit onReset onClick onContextMenu onDoubleClick onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onAnimationStart onAnimationEnd onAnimationIteration onTransitionEnd onCopyCapture onCutCapture onPasteCapture onCompositionEndCapture onCompositionStartCapture onCompositionUpdateCapture onKeyDownCapture onKeyPressCapture onKeyUpCapture onFocusCapture onBlurCapture onChangeCapture onInputCapture onSubmitCapture onResetCapture onClickCapture onContextMenuCapture onDoubleClickCapture onDragCapture onDragEndCapture onDragEnterCapture onDragExitCapture onDragLeaveCapture onDragOverCapture onDragStartCapture onDropCapture onMouseDownCapture onMouseEnterCapture onMouseLeaveCapture onMouseMoveCapture onMouseOutCapture onMouseOverCapture onMouseUpCapture onSelectCapture onTouchCancelCapture onTouchEndCapture onTouchMoveCapture onTouchStartCapture onScrollCapture onWheelCapture onAbortCapture onCanPlayCapture onCanPlayThroughCapture onDurationChangeCapture onEmptiedCapture onEncryptedCapture onEndedCapture onErrorCapture onLoadedDataCapture onLoadedMetadataCapture onLoadStartCapture onPauseCapture onPlayCapture onPlayingCapture onProgressCapture onRateChangeCapture onSeekedCapture onSeekingCapture onStalledCapture onSuspendCapture onTimeUpdateCapture onVolumeChangeCapture onWaitingCapture onLoadCapture onAnimationStartCapture onAnimationEndCapture onAnimationIterationCapture onTransitionEndCapture accept acceptCharset accessKey action allowFullScreen allowTransparency alt as async autoComplete autoPlay capture cellPadding cellSpacing charSet challenge checked cite classID className cols colSpan content contentEditable contextMenu controlsList controls coords crossOrigin data dateTime default defer dir disabled download draggable encType form formAction formEncType formMethod formNoValidate formTarget frameBorder headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media mediaGroup method min minLength multiple muted name nonce noValidate open optimum pattern placeholder playsInline poster preload profile radioGroup readOnly referrerPolicy rel required reversed role rows rowSpan sandbox scope scoped scrolling seamless selected shape size sizes span spellCheck src srcDoc srcLang srcSet start step style summary tabIndex target title type useMap value width wmode wrap about datatype inlist prefix property resource typeof vocab autoCapitalize autoCorrect autoSave color itemProp itemScope itemType itemID itemRef results security unselectable accentHeight accumulate additive alignmentBaseline allowReorder alphabetic amplitude arabicForm ascent attributeName attributeType autoReverse azimuth baseFrequency baseProfile baselineShift bbox begin bias by calcMode capHeight clip clipPath clipRule clipPathUnits colorInterpolation colorInterpolationFilters colorProfile colorRendering contentScriptType contentStyleType cursor cx cy d decelerate descent diffuseConstant direction display divisor dominantBaseline dur dx dy edgeMode elevation enableBackground end exponent externalResourcesRequired fill fillOpacity fillRule filter filterRes filterUnits floodColor floodOpacity focusable fontFamily fontSize fontSizeAdjust fontStretch fontStyle fontVariant fontWeight format from fx fy g1 g2 glyphName glyphOrientationHorizontal glyphOrientationVertical glyphRef gradientTransform gradientUnits hanging horizAdvX horizOriginX ideographic imageRendering in in2 intercept k k1 k2 k3 k4 kernelMatrix kernelUnitLength kerning keyPoints keySplines keyTimes lengthAdjust letterSpacing lightingColor limitingConeAngle local markerEnd markerMid markerStart markerHeight markerUnits markerWidth mask maskContentUnits maskUnits mathematical mode numOctaves offset opacity operator order orient orientation origin overflow overlinePosition overlineThickness paintOrder panose1 pathLength patternContentUnits patternTransform patternUnits pointerEvents points pointsAtX pointsAtY pointsAtZ preserveAlpha preserveAspectRatio primitiveUnits r radius refX refY renderingIntent repeatCount repeatDur requiredExtensions requiredFeatures restart result rotate rx ry scale seed shapeRendering slope spacing specularConstant specularExponent speed spreadMethod startOffset stdDeviation stemh stemv stitchTiles stopColor stopOpacity strikethroughPosition strikethroughThickness string stroke strokeDasharray strokeDashoffset strokeLinecap strokeLinejoin strokeMiterlimit strokeOpacity strokeWidth surfaceScale systemLanguage tableValues targetX targetY textAnchor textDecoration textRendering textLength to transform u1 u2 underlinePosition underlineThickness unicode unicodeBidi unicodeRange unitsPerEm vAlphabetic vHanging vIdeographic vMathematical values vectorEffect version vertAdvY vertOriginX vertOriginY viewBox viewTarget visibility widths wordSpacing writingMode x xHeight x1 x2 xChannelSelector xlinkActuate xlinkArcrole xlinkHref xlinkRole xlinkShow xlinkTitle xlinkType xmlBase xmlns xmlnsXlink xmlLang xmlSpace y y1 y2 yChannelSelector z zoomAndPan onPointerDown onPointerMove onPointerUp onPointerCancel onGotPointerCapture onLostPointerCapture onPointerEnter onPointerLeave onPointerOver onPointerOut class for autofocus allow allowUserMedia allowPaymentRequest */ /* eslint-enable max-len */ var ATTRIBUTE_REGEX = /^((?:s(?:uppressContentEditableWarn|croll|pac)|(?:shape|image|text)Render|(?:letter|word)Spac|vHang|hang)ing|(?:on(?:AnimationIteration|C(?:o(?:mposition(?:Update|Start|End)|ntextMenu|py)|anPlayThrough|anPlay|hange|lick|ut)|(?:Animation|Touch|Load|Drag)Start|(?:(?:Duration|Volume|Rate)Chang|(?:MouseLea|(?:Touch|Mouse)Mo|DragLea)v|Paus)e|Loaded(?:Metad|D)ata|(?:(?:T(?:ransition|ouch)|Animation)E|Suspe)nd|DoubleClick|(?:TouchCanc|Whe)el|Lo(?:stPointer|ad)|TimeUpdate|(?:Mouse(?:Ent|Ov)e|Drag(?:Ent|Ov)e|Erro)r|GotPointer|MouseDown|(?:E(?:n(?:crypt|d)|mpti)|S(?:tall|eek))ed|KeyPress|(?:MouseOu|DragExi|S(?:elec|ubmi)|Rese|Inpu)t|P(?:rogress|laying)|DragEnd|Key(?:Down|Up)|(?:MouseU|Dro)p|(?:Wait|Seek)ing|Scroll|Focus|Paste|Abort|Drag|Play|Blur)Captur|alignmentBaselin|(?:limitingConeAng|xlink(?:(?:Arcr|R)o|Tit)|s(?:urfaceSca|ty|ca)|unselectab|baseProfi|fontSty|(?:focus|dragg)ab|multip|profi|tit)l|d(?:ominantBaselin|efaultValu)|onPointerLeav|a(?:uto(?:Capitaliz|Revers|Sav)|dditiv)|(?:(?:formNoValid|xlinkActu|noValid|accumul|rot)a|autoComple|decelera)t|(?:(?:attribute|item)T|datat)yp|onPointerMov|(?:attribute|glyph)Nam|playsInlin|(?:writing|input|edge)Mod|(?:formE|e)ncTyp|(?:amplitu|mo)d|(?:xlinkTy|itemSco|keyTy|slo)p|(?:xmlSpa|non)c|fillRul|(?:dateTi|na)m|r(?:esourc|ol)|xmlBas|wmod)e|(?:glyphOrientationHorizont|loc)al|(?:externalResourcesRequir|select|revers|mut)ed|c(?:o(?:lorInterpolationFilter|ord)s|o(?:lor(?:Interpolation)?|nt(?:rols|ent))|(?:ontentS(?:cript|tyle)Typ|o(?:ntentEditab|lorProfi)l|l(?:assNam|ipRul)|a(?:lcMod|ptur)|it)e|olorRendering|l(?:ipPathUnits|assID)|(?:ontrolsLis|apHeigh)t|h(?:eckedLink|a(?:llenge|rSet)|ildren|ecked)|ell(?:Spac|Padd)ing|o(?:ntextMenu|ls)|(?:rossOrigi|olSpa)n|l(?:ip(?:Path)?|ass)|ursor|[xy])|glyphOrientationVertical|d(?:angerouslySetInnerHTML|efaultChecked|ownload|isabled|isplay|[xy])|(?:s(?:trikethroughThickn|eaml)es|(?:und|ov)erlineThicknes|r(?:equiredExtension|adiu)|(?:requiredFeatur|tableValu|stitchTil|numOctav|filterR)e|key(?:(?:Splin|Tim)e|Param)|auto[Ff]ocu|header|bia)s|(?:(?:st(?:rikethroughPosi|dDevia)|(?:und|ov)erlinePosi|(?:textDecor|elev)a|orienta)tio|(?:strokeLinejo|orig)i|on(?:PointerDow|FocusI)|formActio|zoomAndPa|directio|(?:vers|act)io|rowSpa|begi|ico)n|o(?:n(?:AnimationIteration|C(?:o(?:mposition(?:Update|Start|End)|ntextMenu|py)|anPlayThrough|anPlay|hange|lick|ut)|(?:(?:Duration|Volume|Rate)Chang|(?:MouseLea|(?:Touch|Mouse)Mo|DragLea)v|Paus)e|Loaded(?:Metad|D)ata|(?:Animation|Touch|Load|Drag)Start|(?:(?:T(?:ransition|ouch)|Animation)E|Suspe)nd|DoubleClick|(?:TouchCanc|Whe)el|(?:Mouse(?:Ent|Ov)e|Drag(?:Ent|Ov)e|Erro)r|TimeUpdate|(?:E(?:n(?:crypt|d)|mpti)|S(?:tall|eek))ed|MouseDown|P(?:rogress|laying)|(?:MouseOu|DragExi|S(?:elec|ubmi)|Rese|Inpu)t|KeyPress|DragEnd|Key(?:Down|Up)|(?:Wait|Seek)ing|(?:MouseU|Dro)p|Scroll|Paste|Focus|Abort|Drag|Play|Load|Blur)|rient)|p(?:reserveAspectRatio|ointsAt[X-Z]|anose1)|(?:(?:allowPaymentReque|(?:fontSize|length)Adju|manife)s|strokeMiterlimi|(?:(?:specularE|e)xpon|renderingInt|asc)en|(?:specularConsta|repeatCou|fontVaria)n|d(?:iffuseConsta|esce)n|baselineShif|vectorEffec|onPointerOu|(?:(?:mar(?:ker|gin)|x)H|accentH|fontW)eigh|markerStar|a(?:utoCorrec|bou)|onFocusOu|intercep|restar|forma|inlis|heigh|lis)t|(?:patternContent|ma(?:sk(?:Content)?|rker)|primitive|gradient|pattern|filter)Units|(?:(?:allowTranspar|baseFrequ)enc|re(?:ferrerPolic|adOnl)|(?:(?:st(?:roke|op)O|floodO|fillO|o)pac|integr|secur)it|visibilit|fontFamil|accessKe|propert|summar)y|(?:gradientT|patternT|t)ransform|(?:(?:st(?:rokeDasho|artO)|o)ffs|acceptChars|formTarg|viewTarg|srcS)et|(?:[xy]ChannelSelect|lightingCol|textAnch|floodCol|stopCol|operat|htmlF)or|(?:(?:enableBackgrou|markerE)n|s(?:p(?:readMetho|ee)|ee)|formMetho|(?:markerM|onInval)i|preloa|metho|kin)d|k(?:ernel(?:UnitLength|Matrix)|[1-4])|strokeDasharray|(?:onPointerCanc|lab)el|(?:allowFullScre|hidd)en|a(?:l(?:lowUserMedia|phabetic|t)|rabicForm|sync)|systemLanguage|(?:(?:o(?:nPointer(?:Ent|Ov)|rd)|allowReord|placehold|frameBord|paintOrd|post)e|repeatDu|d(?:efe|u))r|(?:pointerEve|keyPoi)nts|preserveAlpha|(?:strokeLineca|onPointerU|itemPro|useMa|wra|loo)p|v(?:Mathematical|ert(?:Origin[XY]|AdvY)|alues|ocab)|unicodeRange|h(?:oriz(?:Origin|Adv)X|ttpEquiv)|(?:vI|i)deographic|mathematical|u(?:nicodeBidi|[12])|(?:fontStretc|hig)h|vAlphabetic|(?:(?:mar(?:ker|gin)W|strokeW)id|azimu)th|(?:xmlnsXl|valueL)ink|mediaGroup|spellCheck|(?:text|m(?:in|ax))Length|(?:unitsPerE|optimu|fro)m|r(?:adioGroup|e(?:sults|f[XY]|l)|ows|[xy])|pathLength|(?:xlinkHr|glyphR)ef|innerHTML|xlinkShow|f(?:o(?:ntSize|rm?)|il(?:ter|l))|(?:tabInde|(?:sand|b)bo|viewBo)x|autoPlay|r(?:e(?:quired|sult|f))?|(?:(?:href|xml|src)La|kerni)ng|o(?:verflow|pen)|i(?:temRef|n2|s)|p(?:attern|oints)|unicode|d(?:efault|ata|ir)?|divisor|t(?:arget[XY]|o)|(?:stri|la)ng|(?:width|size)s|prefix|typeof|srcDoc|s(?:coped|te(?:m[hv]|p)|pan)|s(?:t(?:roke|art)|hape|cope|rc)|a(?:ccept|llow|s)|itemID|t(?:arget|ype)|m(?:edia|a(?:sk|x)|in)|value|width|x(?:mlns)?|size|href|k(?:ey)?|end|low|by|x[12]|y[12]|g[12]|i[dn]|f[xy]|[yz])$/; /* From DOMProperty */ var ATTRIBUTE_NAME_START_CHAR = ':A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD'; var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040'; var isCustomAttribute = RegExp.prototype.test.bind(new RegExp('^(x|data|aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$')); var validAttr = (function (name) { return ATTRIBUTE_REGEX.test(name) || isCustomAttribute(name.toLowerCase()); }); // function hasInInheritanceChain(child, parent) { var target = child; while (target) { target = Object.getPrototypeOf(target); if (target && target === parent) { return true; } } return false; } // /** * Creates a broadcast that can be listened to, i.e. simple event emitter * * @see https://github.com/ReactTraining/react-broadcast */ var createBroadcast = function createBroadcast(initialState) { var listeners = {}; var id = 0; var state = initialState; function publish(nextState) { state = nextState; // eslint-disable-next-line guard-for-in, no-restricted-syntax for (var key in listeners) { var listener = listeners[key]; if (listener === undefined) { // eslint-disable-next-line no-continue continue; } listener(state); } } function subscribe(listener) { var currentId = id; listeners[currentId] = listener; id += 1; listener(state); return currentId; } function unsubscribe(unsubID) { listeners[unsubID] = undefined; } return { publish: publish, subscribe: subscribe, unsubscribe: unsubscribe }; }; var _contextShape, _ThemeProvider$contex; // NOTE: DO NOT CHANGE, changing this is a semver major change! var CHANNEL = '__styled-components__'; var CHANNEL_NEXT = CHANNEL + 'next__'; var CONTEXT_CHANNEL_SHAPE = __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.shape({ getTheme: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func, subscribe: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func, unsubscribe: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func }); var contextShape = (_contextShape = {}, _contextShape[CHANNEL] = __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func, _contextShape[CHANNEL_NEXT] = CONTEXT_CHANNEL_SHAPE, _contextShape); var warnChannelDeprecated = void 0; if (false) { warnChannelDeprecated = once(function () { // eslint-disable-next-line no-console console.warn('Warning: Usage of `context.' + CHANNEL + '` as a function is deprecated. It will be replaced with the object on `.context.' + CHANNEL_NEXT + '` in a future version.'); }); } var isFunction = function isFunction(test) { return typeof test === 'function'; }; /** * Provide a theme to an entire react component tree via context and event listeners (have to do * both context and event emitter as pure components block context updates) */ var ThemeProvider = function (_Component) { inherits(ThemeProvider, _Component); function ThemeProvider() { classCallCheck(this, ThemeProvider); var _this = possibleConstructorReturn(this, _Component.call(this)); _this.unsubscribeToOuterId = -1; _this.getTheme = _this.getTheme.bind(_this); return _this; } ThemeProvider.prototype.componentWillMount = function componentWillMount() { var _this2 = this; // If there is a ThemeProvider wrapper anywhere around this theme provider, merge this theme // with the outer theme var outerContext = this.context[CHANNEL_NEXT]; if (outerContext !== undefined) { this.unsubscribeToOuterId = outerContext.subscribe(function (theme) { _this2.outerTheme = theme; if (_this2.broadcast !== undefined) { _this2.publish(_this2.props.theme); } }); } this.broadcast = createBroadcast(this.getTheme()); }; ThemeProvider.prototype.getChildContext = function getChildContext() { var _this3 = this, _babelHelpers$extends; return _extends({}, this.context, (_babelHelpers$extends = {}, _babelHelpers$extends[CHANNEL_NEXT] = { getTheme: this.getTheme, subscribe: this.broadcast.subscribe, unsubscribe: this.broadcast.unsubscribe }, _babelHelpers$extends[CHANNEL] = function (subscriber) { if (false) { warnChannelDeprecated(); } // Patch the old `subscribe` provide via `CHANNEL` for older clients. var unsubscribeId = _this3.broadcast.subscribe(subscriber); return function () { return _this3.broadcast.unsubscribe(unsubscribeId); }; }, _babelHelpers$extends)); }; ThemeProvider.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { if (this.props.theme !== nextProps.theme) { this.publish(nextProps.theme); } }; ThemeProvider.prototype.componentWillUnmount = function componentWillUnmount() { if (this.unsubscribeToOuterId !== -1) { this.context[CHANNEL_NEXT].unsubscribe(this.unsubscribeToOuterId); } }; // Get the theme from the props, supporting both (outerTheme) => {} as well as object notation ThemeProvider.prototype.getTheme = function getTheme(passedTheme) { var theme = passedTheme || this.props.theme; if (isFunction(theme)) { var mergedTheme = theme(this.outerTheme); if (false) { throw new StyledComponentsError(7); } return mergedTheme; } if (theme === null || Array.isArray(theme) || (typeof theme === 'undefined' ? 'undefined' : _typeof(theme)) !== 'object') { throw new StyledComponentsError(8); } return _extends({}, this.outerTheme, theme); }; ThemeProvider.prototype.publish = function publish(theme) { this.broadcast.publish(this.getTheme(theme)); }; ThemeProvider.prototype.render = function render() { if (!this.props.children) { return null; } return __WEBPACK_IMPORTED_MODULE_1_react___default.a.Children.only(this.props.children); }; return ThemeProvider; }(__WEBPACK_IMPORTED_MODULE_1_react__["Component"]); ThemeProvider.childContextTypes = contextShape; ThemeProvider.contextTypes = (_ThemeProvider$contex = {}, _ThemeProvider$contex[CHANNEL_NEXT] = CONTEXT_CHANNEL_SHAPE, _ThemeProvider$contex); var _babelHelpers$extends; // HACK for generating all static styles without needing to allocate // an empty execution context every single time... var STATIC_EXECUTION_CONTEXT = {}; var modifiedContextShape = _extends({}, contextShape, (_babelHelpers$extends = {}, _babelHelpers$extends[CONTEXT_KEY] = __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.instanceOf(StyleSheet), __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.instanceOf(ServerStyleSheet)]), _babelHelpers$extends)); var identifiers = {}; /* We depend on components having unique IDs */ var generateId = function generateId(ComponentStyle, _displayName, parentComponentId) { var displayName = typeof _displayName !== 'string' ? 'sc' : escape(_displayName); /** * This ensures uniqueness if two components happen to share * the same displayName. */ var nr = (identifiers[displayName] || 0) + 1; identifiers[displayName] = nr; var componentId = displayName + '-' + ComponentStyle.generateName(displayName + nr); return parentComponentId !== undefined ? parentComponentId + '-' + componentId : componentId; }; var warnExtendDeprecated = function warnExtendDeprecated() {}; if (false) { warnExtendDeprecated = once(function () { // eslint-disable-next-line no-console console.warn('Warning: The "extend" API will be removed in the upcoming v4.0 release. Use styled(StyledComponent) instead. You can find more information here: https://github.com/styled-components/styled-components/issues/1546'); }); } // $FlowFixMe var BaseStyledComponent = function (_Component) { inherits(BaseStyledComponent, _Component); function BaseStyledComponent() { var _temp, _this, _ret; classCallCheck(this, BaseStyledComponent); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return _ret = (_temp = (_this = possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.attrs = {}, _this.state = { theme: null, generatedClassName: '' }, _this.unsubscribeId = -1, _temp), possibleConstructorReturn(_this, _ret); } BaseStyledComponent.prototype.unsubscribeFromContext = function unsubscribeFromContext() { if (this.unsubscribeId !== -1) { this.context[CHANNEL_NEXT].unsubscribe(this.unsubscribeId); } }; BaseStyledComponent.prototype.buildExecutionContext = function buildExecutionContext(theme, props) { var attrs = this.constructor.attrs; var context = _extends({}, props, { theme: theme }); if (attrs === undefined) { return context; } this.attrs = Object.keys(attrs).reduce(function (acc, key) { var attr = attrs[key]; // eslint-disable-next-line no-param-reassign acc[key] = typeof attr === 'function' && !hasInInheritanceChain(attr, __WEBPACK_IMPORTED_MODULE_1_react__["Component"]) ? attr(context) : attr; return acc; }, {}); return _extends({}, context, this.attrs); }; BaseStyledComponent.prototype.generateAndInjectStyles = function generateAndInjectStyles(theme, props) { var _constructor = this.constructor, attrs = _constructor.attrs, componentStyle = _constructor.componentStyle, warnTooManyClasses = _constructor.warnTooManyClasses; var styleSheet = this.context[CONTEXT_KEY] || StyleSheet.master; // statically styled-components don't need to build an execution context object, // and shouldn't be increasing the number of class names if (componentStyle.isStatic && attrs === undefined) { return componentStyle.generateAndInjectStyles(STATIC_EXECUTION_CONTEXT, styleSheet); } else { var executionContext = this.buildExecutionContext(theme, props); var className = componentStyle.generateAndInjectStyles(executionContext, styleSheet); if (false) { warnTooManyClasses(className); } return className; } }; BaseStyledComponent.prototype.componentWillMount = function componentWillMount() { var _this2 = this; var componentStyle = this.constructor.componentStyle; var styledContext = this.context[CHANNEL_NEXT]; // If this is a statically-styled component, we don't need to the theme // to generate or build styles. if (componentStyle.isStatic) { var generatedClassName = this.generateAndInjectStyles(STATIC_EXECUTION_CONTEXT, this.props); this.setState({ generatedClassName: generatedClassName }); // If there is a theme in the context, subscribe to the event emitter. This // is necessary due to pure components blocking context updates, this circumvents // that by updating when an event is emitted } else if (styledContext !== undefined) { var subscribe = styledContext.subscribe; this.unsubscribeId = subscribe(function (nextTheme) { // This will be called once immediately var theme = determineTheme(_this2.props, nextTheme, _this2.constructor.defaultProps); var generatedClassName = _this2.generateAndInjectStyles(theme, _this2.props); _this2.setState({ theme: theme, generatedClassName: generatedClassName }); }); } else { // eslint-disable-next-line react/prop-types var theme = this.props.theme || EMPTY_OBJECT; var _generatedClassName = this.generateAndInjectStyles(theme, this.props); this.setState({ theme: theme, generatedClassName: _generatedClassName }); } }; BaseStyledComponent.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { var _this3 = this; // If this is a statically-styled component, we don't need to listen to // props changes to update styles var componentStyle = this.constructor.componentStyle; if (componentStyle.isStatic) { return; } this.setState(function (prevState) { var theme = determineTheme(nextProps, prevState.theme, _this3.constructor.defaultProps); var generatedClassName = _this3.generateAndInjectStyles(theme, nextProps); return { theme: theme, generatedClassName: generatedClassName }; }); }; BaseStyledComponent.prototype.componentWillUnmount = function componentWillUnmount() { this.unsubscribeFromContext(); }; BaseStyledComponent.prototype.render = function render() { // eslint-disable-next-line react/prop-types var innerRef = this.props.innerRef; var generatedClassName = this.state.generatedClassName; var _constructor2 = this.constructor, styledComponentId = _constructor2.styledComponentId, target = _constructor2.target; var isTargetTag = isTag(target); var className = [ // eslint-disable-next-line react/prop-types this.props.className, styledComponentId, this.attrs.className, generatedClassName].filter(Boolean).join(' '); var baseProps = _extends({}, this.attrs, { className: className }); if (isStyledComponent(target)) { baseProps.innerRef = innerRef; } else { baseProps.ref = innerRef; } var propsForElement = baseProps; var key = void 0; for (key in this.props) { // Don't pass through non HTML tags through to HTML elements // always omit innerRef if (key !== 'innerRef' && key !== 'className' && (!isTargetTag || validAttr(key))) { propsForElement[key] = key === 'style' && key in this.attrs ? _extends({}, this.attrs[key], this.props[key]) : this.props[key]; } } return Object(__WEBPACK_IMPORTED_MODULE_1_react__["createElement"])(target, propsForElement); }; return BaseStyledComponent; }(__WEBPACK_IMPORTED_MODULE_1_react__["Component"]); var _StyledComponent = (function (ComponentStyle, constructWithOptions) { var createStyledComponent = function createStyledComponent(target, options, rules) { var _options$isClass = options.isClass, isClass = _options$isClass === undefined ? !isTag(target) : _options$isClass, _options$displayName = options.displayName, displayName = _options$displayName === undefined ? generateDisplayName(target) : _options$displayName, _options$componentId = options.componentId, componentId = _options$componentId === undefined ? generateId(ComponentStyle, options.displayName, options.parentComponentId) : _options$componentId, _options$ParentCompon = options.ParentComponent, ParentComponent = _options$ParentCompon === undefined ? BaseStyledComponent : _options$ParentCompon, extendingRules = options.rules, attrs = options.attrs; var styledComponentId = options.displayName && options.componentId ? escape(options.displayName) + '-' + options.componentId : options.componentId || componentId; var componentStyle = new ComponentStyle(extendingRules === undefined ? rules : extendingRules.concat(rules), attrs, styledComponentId); var StyledComponent = function (_ParentComponent) { inherits(StyledComponent, _ParentComponent); function StyledComponent() { classCallCheck(this, StyledComponent); return possibleConstructorReturn(this, _ParentComponent.apply(this, arguments)); } StyledComponent.withComponent = function withComponent(tag) { var previousComponentId = options.componentId, optionsToCopy = objectWithoutProperties(options, ['componentId']); var newComponentId = previousComponentId && previousComponentId + '-' + (isTag(tag) ? tag : escape(getComponentName(tag))); var newOptions = _extends({}, optionsToCopy, { componentId: newComponentId, ParentComponent: StyledComponent }); return createStyledComponent(tag, newOptions, rules); }; createClass(StyledComponent, null, [{ key: 'extend', get: function get$$1() { var rulesFromOptions = options.rules, parentComponentId = options.componentId, optionsToCopy = objectWithoutProperties(options, ['rules', 'componentId']); var newRules = rulesFromOptions === undefined ? rules : rulesFromOptions.concat(rules); var newOptions = _extends({}, optionsToCopy, { rules: newRules, parentComponentId: parentComponentId, ParentComponent: StyledComponent }); warnExtendDeprecated(); return constructWithOptions(createStyledComponent, target, newOptions); } }]); return StyledComponent; }(ParentComponent); StyledComponent.attrs = attrs; StyledComponent.componentStyle = componentStyle; StyledComponent.contextTypes = modifiedContextShape; StyledComponent.displayName = displayName; StyledComponent.styledComponentId = styledComponentId; StyledComponent.target = target; if (false) { StyledComponent.warnTooManyClasses = createWarnTooManyClasses(displayName); } if (isClass) { __WEBPACK_IMPORTED_MODULE_5_hoist_non_react_statics___default()(StyledComponent, target, { // all SC-specific things should not be hoisted attrs: true, componentStyle: true, displayName: true, extend: true, styledComponentId: true, target: true, warnTooManyClasses: true, withComponent: true }); } return StyledComponent; }; return createStyledComponent; }); // Source: https://github.com/garycourt/murmurhash-js/blob/master/murmurhash2_gc.js function murmurhash(str) { var l = str.length | 0, h = l | 0, i = 0, k; while (l >= 4) { k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24; k = (k & 0xffff) * 0x5bd1e995 + (((k >>> 16) * 0x5bd1e995 & 0xffff) << 16); k ^= k >>> 24; k = (k & 0xffff) * 0x5bd1e995 + (((k >>> 16) * 0x5bd1e995 & 0xffff) << 16); h = (h & 0xffff) * 0x5bd1e995 + (((h >>> 16) * 0x5bd1e995 & 0xffff) << 16) ^ k; l -= 4; ++i; } switch (l) { case 3: h ^= (str.charCodeAt(i + 2) & 0xff) << 16; case 2: h ^= (str.charCodeAt(i + 1) & 0xff) << 8; case 1: h ^= str.charCodeAt(i) & 0xff; h = (h & 0xffff) * 0x5bd1e995 + (((h >>> 16) * 0x5bd1e995 & 0xffff) << 16); } h ^= h >>> 13; h = (h & 0xffff) * 0x5bd1e995 + (((h >>> 16) * 0x5bd1e995 & 0xffff) << 16); h ^= h >>> 15; return h >>> 0; } // var areStylesCacheable = IS_BROWSER; var isStaticRules = function isStaticRules(rules, attrs) { for (var i = 0, len = rules.length; i < len; i += 1) { var rule = rules[i]; // recursive case if (Array.isArray(rule) && !isStaticRules(rule)) { return false; } else if (typeof rule === 'function' && !isStyledComponent(rule)) { // functions are allowed to be static if they're just being // used to get the classname of a nested styled component return false; } } if (attrs !== undefined) { // eslint-disable-next-line guard-for-in, no-restricted-syntax for (var key in attrs) { if (typeof attrs[key] === 'function') { return false; } } } return true; }; var isHMREnabled = typeof module !== 'undefined' && module.hot && "production" !== 'production'; /* ComponentStyle is all the CSS-specific stuff, not the React-specific stuff. */ var _ComponentStyle = (function (nameGenerator, flatten, stringifyRules) { /* combines hashStr (murmurhash) and nameGenerator for convenience */ var generateRuleHash = function generateRuleHash(str) { return nameGenerator(murmurhash(str)); }; var ComponentStyle = function () { function ComponentStyle(rules, attrs, componentId) { classCallCheck(this, ComponentStyle); this.rules = rules; this.isStatic = !isHMREnabled && isStaticRules(rules, attrs); this.componentId = componentId; if (!StyleSheet.master.hasId(componentId)) { var placeholder = false ? ['.' + componentId + ' {}'] : []; StyleSheet.master.deferredInject(componentId, placeholder); } } /* * Flattens a rule set into valid CSS * Hashes it, wraps the whole chunk in a .hash1234 {} * Returns the hash to be injected on render() * */ ComponentStyle.prototype.generateAndInjectStyles = function generateAndInjectStyles(executionContext, styleSheet) { var isStatic = this.isStatic, componentId = this.componentId, lastClassName = this.lastClassName; if (areStylesCacheable && isStatic && lastClassName !== undefined && styleSheet.hasNameForId(componentId, lastClassName)) { return lastClassName; } var flatCSS = flatten(this.rules, executionContext); var name = generateRuleHash(this.componentId + flatCSS.join('')); if (!styleSheet.hasNameForId(componentId, name)) { styleSheet.inject(this.componentId, stringifyRules(flatCSS, '.' + name), name); } this.lastClassName = name; return name; }; ComponentStyle.generateName = function generateName(str) { return generateRuleHash(str); }; return ComponentStyle; }(); return ComponentStyle; }); // // Thanks to ReactDOMFactories for this handy list! var domElements = ['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', // SVG 'circle', 'clipPath', 'defs', 'ellipse', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan']; // var _styled = (function (styledComponent, constructWithOptions) { var styled = function styled(tag) { return constructWithOptions(styledComponent, tag); }; // Shorthands for all valid HTML Elements domElements.forEach(function (domElement) { styled[domElement] = styled(domElement); }); return styled; }); // var replaceWhitespace = function replaceWhitespace(str) { return str.replace(/\s|\\n/g, ''); }; var _keyframes = (function (nameGenerator, stringifyRules, css) { return function () { var styleSheet = StyleSheet.master; var rules = css.apply(undefined, arguments); var name = nameGenerator(murmurhash(replaceWhitespace(JSON.stringify(rules)))); var id = 'sc-keyframes-' + name; if (!styleSheet.hasNameForId(id, name)) { styleSheet.inject(id, stringifyRules(rules, name, '@keyframes'), name); } return name; }; }); // var _injectGlobal = (function (stringifyRules, css) { var injectGlobal = function injectGlobal() { var styleSheet = StyleSheet.master; var rules = css.apply(undefined, arguments); var hash = murmurhash(JSON.stringify(rules)); var id = 'sc-global-' + hash; if (!styleSheet.hasId(id)) { styleSheet.inject(id, stringifyRules(rules)); } }; return injectGlobal; }); // var _constructWithOptions = (function (css) { var constructWithOptions = function constructWithOptions(componentConstructor, tag) { var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : EMPTY_OBJECT; if (!Object(__WEBPACK_IMPORTED_MODULE_6_react_is__["isValidElementType"])(tag)) { throw new StyledComponentsError(1, String(tag)); } /* This is callable directly as a template function */ // $FlowFixMe: Not typed to avoid destructuring arguments var templateFunction = function templateFunction() { return componentConstructor(tag, options, css.apply(undefined, arguments)); }; /* If config methods are called, wrap up a new template function and merge options */ templateFunction.withConfig = function (config) { return constructWithOptions(componentConstructor, tag, _extends({}, options, config)); }; templateFunction.attrs = function (attrs) { return constructWithOptions(componentConstructor, tag, _extends({}, options, { attrs: _extends({}, options.attrs || EMPTY_OBJECT, attrs) })); }; return templateFunction; }; return constructWithOptions; }); // var withTheme = (function (Component$$1) { var isStatelessFunctionalComponent = typeof Component$$1 === 'function' && // $FlowFixMe TODO: flow for prototype !(Component$$1.prototype && 'isReactComponent' in Component$$1.prototype); // NOTE: We can't pass a ref to a stateless functional component var shouldSetInnerRef = isStyledComponent(Component$$1) || isStatelessFunctionalComponent; var WithTheme = function (_React$Component) { inherits(WithTheme, _React$Component); function WithTheme() { var _temp, _this, _ret; classCallCheck(this, WithTheme); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return _ret = (_temp = (_this = possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = EMPTY_OBJECT, _this.unsubscribeId = -1, _temp), possibleConstructorReturn(_this, _ret); } // NOTE: This is so that isStyledComponent passes for the innerRef unwrapping WithTheme.prototype.componentWillMount = function componentWillMount() { var _this2 = this; var defaultProps = this.constructor.defaultProps; var styledContext = this.context[CHANNEL_NEXT]; var themeProp = determineTheme(this.props, undefined, defaultProps); if (styledContext === undefined && themeProp === undefined && "production" !== 'production') { // eslint-disable-next-line no-console console.warn('[withTheme] You are not using a ThemeProvider nor passing a theme prop or a theme in defaultProps'); } else if (styledContext === undefined && themeProp !== undefined) { this.setState({ theme: themeProp }); } else { var subscribe = styledContext.subscribe; this.unsubscribeId = subscribe(function (nextTheme) { var theme = determineTheme(_this2.props, nextTheme, defaultProps); _this2.setState({ theme: theme }); }); } }; WithTheme.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { var defaultProps = this.constructor.defaultProps; this.setState(function (oldState) { var theme = determineTheme(nextProps, oldState.theme, defaultProps); return { theme: theme }; }); }; WithTheme.prototype.componentWillUnmount = function componentWillUnmount() { if (this.unsubscribeId !== -1) { this.context[CHANNEL_NEXT].unsubscribe(this.unsubscribeId); } }; WithTheme.prototype.render = function render() { var props = _extends({ theme: this.state.theme }, this.props); if (!shouldSetInnerRef) { props.ref = props.innerRef; delete props.innerRef; } return __WEBPACK_IMPORTED_MODULE_1_react___default.a.createElement(Component$$1, props); }; return WithTheme; }(__WEBPACK_IMPORTED_MODULE_1_react___default.a.Component); WithTheme.contextTypes = contextShape; WithTheme.displayName = 'WithTheme(' + getComponentName(Component$$1) + ')'; WithTheme.styledComponentId = 'withTheme'; return __WEBPACK_IMPORTED_MODULE_5_hoist_non_react_statics___default()(WithTheme, Component$$1); }); // /* eslint-disable */ var __DO_NOT_USE_OR_YOU_WILL_BE_HAUNTED_BY_SPOOKY_GHOSTS = { StyleSheet: StyleSheet }; // /* Warning if you've imported this file on React Native */ if (false) { // eslint-disable-next-line no-console console.warn("It looks like you've imported 'styled-components' on React Native.\n" + "Perhaps you're looking to import 'styled-components/native'?\n" + 'Read more about this at https://www.styled-components.com/docs/basics#react-native'); } /* Warning if there are several instances of styled-components */ if (false) { window['__styled-components-init__'] = window['__styled-components-init__'] || 0; if (window['__styled-components-init__'] === 1) { // eslint-disable-next-line no-console console.warn("It looks like there are several instances of 'styled-components' initialized in this application. " + 'This may cause dynamic styles not rendering properly, errors happening during rehydration process ' + 'and makes your application bigger without a good reason.\n\n' + 'See https://s-c.sh/2BAXzed for more info.'); } window['__styled-components-init__'] += 1; } /* Instantiate singletons */ var ComponentStyle = _ComponentStyle(generateAlphabeticName, flatten, stringifyRules); var constructWithOptions = _constructWithOptions(css); var StyledComponent = _StyledComponent(ComponentStyle, constructWithOptions); /* Instantiate exported singletons */ var keyframes = _keyframes(generateAlphabeticName, stringifyRules, css); var injectGlobal = _injectGlobal(stringifyRules, css); var styled = _styled(StyledComponent, constructWithOptions); /* harmony default export */ __webpack_exports__["default"] = (styled); //# sourceMappingURL=styled-components.browser.esm.js.map /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__("W2nU"), __webpack_require__("f1Eh")(module))) /***/ }), /***/ "yQBS": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__style_index_less__ = __webpack_require__("vtiu"); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__style_index_less___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__style_index_less__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__index_less__ = __webpack_require__("CdOH"); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__index_less___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__index_less__); /***/ }), /***/ "z+gd": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* WEBPACK VAR INJECTION */(function(global) {/** * A collection of shims that provide minimal functionality of the ES6 collections. * * These implementations are not meant to be used outside of the ResizeObserver * modules as they cover only a limited range of use cases. */ /* eslint-disable require-jsdoc, valid-jsdoc */ var MapShim = (function () { if (typeof Map !== 'undefined') { return Map; } /** * Returns index in provided array that matches the specified key. * * @param {Array} arr * @param {*} key * @returns {number} */ function getIndex(arr, key) { var result = -1; arr.some(function (entry, index) { if (entry[0] === key) { result = index; return true; } return false; }); return result; } return /** @class */ (function () { function class_1() { this.__entries__ = []; } Object.defineProperty(class_1.prototype, "size", { /** * @returns {boolean} */ get: function () { return this.__entries__.length; }, enumerable: true, configurable: true }); /** * @param {*} key * @returns {*} */ class_1.prototype.get = function (key) { var index = getIndex(this.__entries__, key); var entry = this.__entries__[index]; return entry && entry[1]; }; /** * @param {*} key * @param {*} value * @returns {void} */ class_1.prototype.set = function (key, value) { var index = getIndex(this.__entries__, key); if (~index) { this.__entries__[index][1] = value; } else { this.__entries__.push([key, value]); } }; /** * @param {*} key * @returns {void} */ class_1.prototype.delete = function (key) { var entries = this.__entries__; var index = getIndex(entries, key); if (~index) { entries.splice(index, 1); } }; /** * @param {*} key * @returns {void} */ class_1.prototype.has = function (key) { return !!~getIndex(this.__entries__, key); }; /** * @returns {void} */ class_1.prototype.clear = function () { this.__entries__.splice(0); }; /** * @param {Function} callback * @param {*} [ctx=null] * @returns {void} */ class_1.prototype.forEach = function (callback, ctx) { if (ctx === void 0) { ctx = null; } for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) { var entry = _a[_i]; callback.call(ctx, entry[1], entry[0]); } }; return class_1; }()); })(); /** * Detects whether window and document objects are available in current environment. */ var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && window.document === document; // Returns global object of a current environment. var global$1 = (function () { if (typeof global !== 'undefined' && global.Math === Math) { return global; } if (typeof self !== 'undefined' && self.Math === Math) { return self; } if (typeof window !== 'undefined' && window.Math === Math) { return window; } // eslint-disable-next-line no-new-func return Function('return this')(); })(); /** * A shim for the requestAnimationFrame which falls back to the setTimeout if * first one is not supported. * * @returns {number} Requests' identifier. */ var requestAnimationFrame$1 = (function () { if (typeof requestAnimationFrame === 'function') { // It's required to use a bounded function because IE sometimes throws // an "Invalid calling object" error if rAF is invoked without the global // object on the left hand side. return requestAnimationFrame.bind(global$1); } return function (callback) { return setTimeout(function () { return callback(Date.now()); }, 1000 / 60); }; })(); // Defines minimum timeout before adding a trailing call. var trailingTimeout = 2; /** * Creates a wrapper function which ensures that provided callback will be * invoked only once during the specified delay period. * * @param {Function} callback - Function to be invoked after the delay period. * @param {number} delay - Delay after which to invoke callback. * @returns {Function} */ function throttle (callback, delay) { var leadingCall = false, trailingCall = false, lastCallTime = 0; /** * Invokes the original callback function and schedules new invocation if * the "proxy" was called during current request. * * @returns {void} */ function resolvePending() { if (leadingCall) { leadingCall = false; callback(); } if (trailingCall) { proxy(); } } /** * Callback invoked after the specified delay. It will further postpone * invocation of the original function delegating it to the * requestAnimationFrame. * * @returns {void} */ function timeoutCallback() { requestAnimationFrame$1(resolvePending); } /** * Schedules invocation of the original function. * * @returns {void} */ function proxy() { var timeStamp = Date.now(); if (leadingCall) { // Reject immediately following calls. if (timeStamp - lastCallTime < trailingTimeout) { return; } // Schedule new call to be in invoked when the pending one is resolved. // This is important for "transitions" which never actually start // immediately so there is a chance that we might miss one if change // happens amids the pending invocation. trailingCall = true; } else { leadingCall = true; trailingCall = false; setTimeout(timeoutCallback, delay); } lastCallTime = timeStamp; } return proxy; } // Minimum delay before invoking the update of observers. var REFRESH_DELAY = 20; // A list of substrings of CSS properties used to find transition events that // might affect dimensions of observed elements. var transitionKeys = ['top', 'right', 'bottom', 'left', 'width', 'height', 'size', 'weight']; // Check if MutationObserver is available. var mutationObserverSupported = typeof MutationObserver !== 'undefined'; /** * Singleton controller class which handles updates of ResizeObserver instances. */ var ResizeObserverController = /** @class */ (function () { /** * Creates a new instance of ResizeObserverController. * * @private */ function ResizeObserverController() { /** * Indicates whether DOM listeners have been added. * * @private {boolean} */ this.connected_ = false; /** * Tells that controller has subscribed for Mutation Events. * * @private {boolean} */ this.mutationEventsAdded_ = false; /** * Keeps reference to the instance of MutationObserver. * * @private {MutationObserver} */ this.mutationsObserver_ = null; /** * A list of connected observers. * * @private {Array} */ this.observers_ = []; this.onTransitionEnd_ = this.onTransitionEnd_.bind(this); this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY); } /** * Adds observer to observers list. * * @param {ResizeObserverSPI} observer - Observer to be added. * @returns {void} */ ResizeObserverController.prototype.addObserver = function (observer) { if (!~this.observers_.indexOf(observer)) { this.observers_.push(observer); } // Add listeners if they haven't been added yet. if (!this.connected_) { this.connect_(); } }; /** * Removes observer from observers list. * * @param {ResizeObserverSPI} observer - Observer to be removed. * @returns {void} */ ResizeObserverController.prototype.removeObserver = function (observer) { var observers = this.observers_; var index = observers.indexOf(observer); // Remove observer if it's present in registry. if (~index) { observers.splice(index, 1); } // Remove listeners if controller has no connected observers. if (!observers.length && this.connected_) { this.disconnect_(); } }; /** * Invokes the update of observers. It will continue running updates insofar * it detects changes. * * @returns {void} */ ResizeObserverController.prototype.refresh = function () { var changesDetected = this.updateObservers_(); // Continue running updates if changes have been detected as there might // be future ones caused by CSS transitions. if (changesDetected) { this.refresh(); } }; /** * Updates every observer from observers list and notifies them of queued * entries. * * @private * @returns {boolean} Returns "true" if any observer has detected changes in * dimensions of it's elements. */ ResizeObserverController.prototype.updateObservers_ = function () { // Collect observers that have active observations. var activeObservers = this.observers_.filter(function (observer) { return observer.gatherActive(), observer.hasActive(); }); // Deliver notifications in a separate cycle in order to avoid any // collisions between observers, e.g. when multiple instances of // ResizeObserver are tracking the same element and the callback of one // of them changes content dimensions of the observed target. Sometimes // this may result in notifications being blocked for the rest of observers. activeObservers.forEach(function (observer) { return observer.broadcastActive(); }); return activeObservers.length > 0; }; /** * Initializes DOM listeners. * * @private * @returns {void} */ ResizeObserverController.prototype.connect_ = function () { // Do nothing if running in a non-browser environment or if listeners // have been already added. if (!isBrowser || this.connected_) { return; } // Subscription to the "Transitionend" event is used as a workaround for // delayed transitions. This way it's possible to capture at least the // final state of an element. document.addEventListener('transitionend', this.onTransitionEnd_); window.addEventListener('resize', this.refresh); if (mutationObserverSupported) { this.mutationsObserver_ = new MutationObserver(this.refresh); this.mutationsObserver_.observe(document, { attributes: true, childList: true, characterData: true, subtree: true }); } else { document.addEventListener('DOMSubtreeModified', this.refresh); this.mutationEventsAdded_ = true; } this.connected_ = true; }; /** * Removes DOM listeners. * * @private * @returns {void} */ ResizeObserverController.prototype.disconnect_ = function () { // Do nothing if running in a non-browser environment or if listeners // have been already removed. if (!isBrowser || !this.connected_) { return; } document.removeEventListener('transitionend', this.onTransitionEnd_); window.removeEventListener('resize', this.refresh); if (this.mutationsObserver_) { this.mutationsObserver_.disconnect(); } if (this.mutationEventsAdded_) { document.removeEventListener('DOMSubtreeModified', this.refresh); } this.mutationsObserver_ = null; this.mutationEventsAdded_ = false; this.connected_ = false; }; /** * "Transitionend" event handler. * * @private * @param {TransitionEvent} event * @returns {void} */ ResizeObserverController.prototype.onTransitionEnd_ = function (_a) { var _b = _a.propertyName, propertyName = _b === void 0 ? '' : _b; // Detect whether transition may affect dimensions of an element. var isReflowProperty = transitionKeys.some(function (key) { return !!~propertyName.indexOf(key); }); if (isReflowProperty) { this.refresh(); } }; /** * Returns instance of the ResizeObserverController. * * @returns {ResizeObserverController} */ ResizeObserverController.getInstance = function () { if (!this.instance_) { this.instance_ = new ResizeObserverController(); } return this.instance_; }; /** * Holds reference to the controller's instance. * * @private {ResizeObserverController} */ ResizeObserverController.instance_ = null; return ResizeObserverController; }()); /** * Defines non-writable/enumerable properties of the provided target object. * * @param {Object} target - Object for which to define properties. * @param {Object} props - Properties to be defined. * @returns {Object} Target object. */ var defineConfigurable = (function (target, props) { for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) { var key = _a[_i]; Object.defineProperty(target, key, { value: props[key], enumerable: false, writable: false, configurable: true }); } return target; }); /** * Returns the global object associated with provided element. * * @param {Object} target * @returns {Object} */ var getWindowOf = (function (target) { // Assume that the element is an instance of Node, which means that it // has the "ownerDocument" property from which we can retrieve a // corresponding global object. var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView; // Return the local global object if it's not possible extract one from // provided element. return ownerGlobal || global$1; }); // Placeholder of an empty content rectangle. var emptyRect = createRectInit(0, 0, 0, 0); /** * Converts provided string to a number. * * @param {number|string} value * @returns {number} */ function toFloat(value) { return parseFloat(value) || 0; } /** * Extracts borders size from provided styles. * * @param {CSSStyleDeclaration} styles * @param {...string} positions - Borders positions (top, right, ...) * @returns {number} */ function getBordersSize(styles) { var positions = []; for (var _i = 1; _i < arguments.length; _i++) { positions[_i - 1] = arguments[_i]; } return positions.reduce(function (size, position) { var value = styles['border-' + position + '-width']; return size + toFloat(value); }, 0); } /** * Extracts paddings sizes from provided styles. * * @param {CSSStyleDeclaration} styles * @returns {Object} Paddings box. */ function getPaddings(styles) { var positions = ['top', 'right', 'bottom', 'left']; var paddings = {}; for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) { var position = positions_1[_i]; var value = styles['padding-' + position]; paddings[position] = toFloat(value); } return paddings; } /** * Calculates content rectangle of provided SVG element. * * @param {SVGGraphicsElement} target - Element content rectangle of which needs * to be calculated. * @returns {DOMRectInit} */ function getSVGContentRect(target) { var bbox = target.getBBox(); return createRectInit(0, 0, bbox.width, bbox.height); } /** * Calculates content rectangle of provided HTMLElement. * * @param {HTMLElement} target - Element for which to calculate the content rectangle. * @returns {DOMRectInit} */ function getHTMLElementContentRect(target) { // Client width & height properties can't be // used exclusively as they provide rounded values. var clientWidth = target.clientWidth, clientHeight = target.clientHeight; // By this condition we can catch all non-replaced inline, hidden and // detached elements. Though elements with width & height properties less // than 0.5 will be discarded as well. // // Without it we would need to implement separate methods for each of // those cases and it's not possible to perform a precise and performance // effective test for hidden elements. E.g. even jQuery's ':visible' filter // gives wrong results for elements with width & height less than 0.5. if (!clientWidth && !clientHeight) { return emptyRect; } var styles = getWindowOf(target).getComputedStyle(target); var paddings = getPaddings(styles); var horizPad = paddings.left + paddings.right; var vertPad = paddings.top + paddings.bottom; // Computed styles of width & height are being used because they are the // only dimensions available to JS that contain non-rounded values. It could // be possible to utilize the getBoundingClientRect if only it's data wasn't // affected by CSS transformations let alone paddings, borders and scroll bars. var width = toFloat(styles.width), height = toFloat(styles.height); // Width & height include paddings and borders when the 'border-box' box // model is applied (except for IE). if (styles.boxSizing === 'border-box') { // Following conditions are required to handle Internet Explorer which // doesn't include paddings and borders to computed CSS dimensions. // // We can say that if CSS dimensions + paddings are equal to the "client" // properties then it's either IE, and thus we don't need to subtract // anything, or an element merely doesn't have paddings/borders styles. if (Math.round(width + horizPad) !== clientWidth) { width -= getBordersSize(styles, 'left', 'right') + horizPad; } if (Math.round(height + vertPad) !== clientHeight) { height -= getBordersSize(styles, 'top', 'bottom') + vertPad; } } // Following steps can't be applied to the document's root element as its // client[Width/Height] properties represent viewport area of the window. // Besides, it's as well not necessary as the itself neither has // rendered scroll bars nor it can be clipped. if (!isDocumentElement(target)) { // In some browsers (only in Firefox, actually) CSS width & height // include scroll bars size which can be removed at this step as scroll // bars are the only difference between rounded dimensions + paddings // and "client" properties, though that is not always true in Chrome. var vertScrollbar = Math.round(width + horizPad) - clientWidth; var horizScrollbar = Math.round(height + vertPad) - clientHeight; // Chrome has a rather weird rounding of "client" properties. // E.g. for an element with content width of 314.2px it sometimes gives // the client width of 315px and for the width of 314.7px it may give // 314px. And it doesn't happen all the time. So just ignore this delta // as a non-relevant. if (Math.abs(vertScrollbar) !== 1) { width -= vertScrollbar; } if (Math.abs(horizScrollbar) !== 1) { height -= horizScrollbar; } } return createRectInit(paddings.left, paddings.top, width, height); } /** * Checks whether provided element is an instance of the SVGGraphicsElement. * * @param {Element} target - Element to be checked. * @returns {boolean} */ var isSVGGraphicsElement = (function () { // Some browsers, namely IE and Edge, don't have the SVGGraphicsElement // interface. if (typeof SVGGraphicsElement !== 'undefined') { return function (target) { return target instanceof getWindowOf(target).SVGGraphicsElement; }; } // If it's so, then check that element is at least an instance of the // SVGElement and that it has the "getBBox" method. // eslint-disable-next-line no-extra-parens return function (target) { return (target instanceof getWindowOf(target).SVGElement && typeof target.getBBox === 'function'); }; })(); /** * Checks whether provided element is a document element (). * * @param {Element} target - Element to be checked. * @returns {boolean} */ function isDocumentElement(target) { return target === getWindowOf(target).document.documentElement; } /** * Calculates an appropriate content rectangle for provided html or svg element. * * @param {Element} target - Element content rectangle of which needs to be calculated. * @returns {DOMRectInit} */ function getContentRect(target) { if (!isBrowser) { return emptyRect; } if (isSVGGraphicsElement(target)) { return getSVGContentRect(target); } return getHTMLElementContentRect(target); } /** * Creates rectangle with an interface of the DOMRectReadOnly. * Spec: https://drafts.fxtf.org/geometry/#domrectreadonly * * @param {DOMRectInit} rectInit - Object with rectangle's x/y coordinates and dimensions. * @returns {DOMRectReadOnly} */ function createReadOnlyRect(_a) { var x = _a.x, y = _a.y, width = _a.width, height = _a.height; // If DOMRectReadOnly is available use it as a prototype for the rectangle. var Constr = typeof DOMRectReadOnly !== 'undefined' ? DOMRectReadOnly : Object; var rect = Object.create(Constr.prototype); // Rectangle's properties are not writable and non-enumerable. defineConfigurable(rect, { x: x, y: y, width: width, height: height, top: y, right: x + width, bottom: height + y, left: x }); return rect; } /** * Creates DOMRectInit object based on the provided dimensions and the x/y coordinates. * Spec: https://drafts.fxtf.org/geometry/#dictdef-domrectinit * * @param {number} x - X coordinate. * @param {number} y - Y coordinate. * @param {number} width - Rectangle's width. * @param {number} height - Rectangle's height. * @returns {DOMRectInit} */ function createRectInit(x, y, width, height) { return { x: x, y: y, width: width, height: height }; } /** * Class that is responsible for computations of the content rectangle of * provided DOM element and for keeping track of it's changes. */ var ResizeObservation = /** @class */ (function () { /** * Creates an instance of ResizeObservation. * * @param {Element} target - Element to be observed. */ function ResizeObservation(target) { /** * Broadcasted width of content rectangle. * * @type {number} */ this.broadcastWidth = 0; /** * Broadcasted height of content rectangle. * * @type {number} */ this.broadcastHeight = 0; /** * Reference to the last observed content rectangle. * * @private {DOMRectInit} */ this.contentRect_ = createRectInit(0, 0, 0, 0); this.target = target; } /** * Updates content rectangle and tells whether it's width or height properties * have changed since the last broadcast. * * @returns {boolean} */ ResizeObservation.prototype.isActive = function () { var rect = getContentRect(this.target); this.contentRect_ = rect; return (rect.width !== this.broadcastWidth || rect.height !== this.broadcastHeight); }; /** * Updates 'broadcastWidth' and 'broadcastHeight' properties with a data * from the corresponding properties of the last observed content rectangle. * * @returns {DOMRectInit} Last observed content rectangle. */ ResizeObservation.prototype.broadcastRect = function () { var rect = this.contentRect_; this.broadcastWidth = rect.width; this.broadcastHeight = rect.height; return rect; }; return ResizeObservation; }()); var ResizeObserverEntry = /** @class */ (function () { /** * Creates an instance of ResizeObserverEntry. * * @param {Element} target - Element that is being observed. * @param {DOMRectInit} rectInit - Data of the element's content rectangle. */ function ResizeObserverEntry(target, rectInit) { var contentRect = createReadOnlyRect(rectInit); // According to the specification following properties are not writable // and are also not enumerable in the native implementation. // // Property accessors are not being used as they'd require to define a // private WeakMap storage which may cause memory leaks in browsers that // don't support this type of collections. defineConfigurable(this, { target: target, contentRect: contentRect }); } return ResizeObserverEntry; }()); var ResizeObserverSPI = /** @class */ (function () { /** * Creates a new instance of ResizeObserver. * * @param {ResizeObserverCallback} callback - Callback function that is invoked * when one of the observed elements changes it's content dimensions. * @param {ResizeObserverController} controller - Controller instance which * is responsible for the updates of observer. * @param {ResizeObserver} callbackCtx - Reference to the public * ResizeObserver instance which will be passed to callback function. */ function ResizeObserverSPI(callback, controller, callbackCtx) { /** * Collection of resize observations that have detected changes in dimensions * of elements. * * @private {Array} */ this.activeObservations_ = []; /** * Registry of the ResizeObservation instances. * * @private {Map} */ this.observations_ = new MapShim(); if (typeof callback !== 'function') { throw new TypeError('The callback provided as parameter 1 is not a function.'); } this.callback_ = callback; this.controller_ = controller; this.callbackCtx_ = callbackCtx; } /** * Starts observing provided element. * * @param {Element} target - Element to be observed. * @returns {void} */ ResizeObserverSPI.prototype.observe = function (target) { if (!arguments.length) { throw new TypeError('1 argument required, but only 0 present.'); } // Do nothing if current environment doesn't have the Element interface. if (typeof Element === 'undefined' || !(Element instanceof Object)) { return; } if (!(target instanceof getWindowOf(target).Element)) { throw new TypeError('parameter 1 is not of type "Element".'); } var observations = this.observations_; // Do nothing if element is already being observed. if (observations.has(target)) { return; } observations.set(target, new ResizeObservation(target)); this.controller_.addObserver(this); // Force the update of observations. this.controller_.refresh(); }; /** * Stops observing provided element. * * @param {Element} target - Element to stop observing. * @returns {void} */ ResizeObserverSPI.prototype.unobserve = function (target) { if (!arguments.length) { throw new TypeError('1 argument required, but only 0 present.'); } // Do nothing if current environment doesn't have the Element interface. if (typeof Element === 'undefined' || !(Element instanceof Object)) { return; } if (!(target instanceof getWindowOf(target).Element)) { throw new TypeError('parameter 1 is not of type "Element".'); } var observations = this.observations_; // Do nothing if element is not being observed. if (!observations.has(target)) { return; } observations.delete(target); if (!observations.size) { this.controller_.removeObserver(this); } }; /** * Stops observing all elements. * * @returns {void} */ ResizeObserverSPI.prototype.disconnect = function () { this.clearActive(); this.observations_.clear(); this.controller_.removeObserver(this); }; /** * Collects observation instances the associated element of which has changed * it's content rectangle. * * @returns {void} */ ResizeObserverSPI.prototype.gatherActive = function () { var _this = this; this.clearActive(); this.observations_.forEach(function (observation) { if (observation.isActive()) { _this.activeObservations_.push(observation); } }); }; /** * Invokes initial callback function with a list of ResizeObserverEntry * instances collected from active resize observations. * * @returns {void} */ ResizeObserverSPI.prototype.broadcastActive = function () { // Do nothing if observer doesn't have active observations. if (!this.hasActive()) { return; } var ctx = this.callbackCtx_; // Create ResizeObserverEntry instance for every active observation. var entries = this.activeObservations_.map(function (observation) { return new ResizeObserverEntry(observation.target, observation.broadcastRect()); }); this.callback_.call(ctx, entries, ctx); this.clearActive(); }; /** * Clears the collection of active observations. * * @returns {void} */ ResizeObserverSPI.prototype.clearActive = function () { this.activeObservations_.splice(0); }; /** * Tells whether observer has active observations. * * @returns {boolean} */ ResizeObserverSPI.prototype.hasActive = function () { return this.activeObservations_.length > 0; }; return ResizeObserverSPI; }()); // Registry of internal observers. If WeakMap is not available use current shim // for the Map collection as it has all required methods and because WeakMap // can't be fully polyfilled anyway. var observers = typeof WeakMap !== 'undefined' ? new WeakMap() : new MapShim(); /** * ResizeObserver API. Encapsulates the ResizeObserver SPI implementation * exposing only those methods and properties that are defined in the spec. */ var ResizeObserver = /** @class */ (function () { /** * Creates a new instance of ResizeObserver. * * @param {ResizeObserverCallback} callback - Callback that is invoked when * dimensions of the observed elements change. */ function ResizeObserver(callback) { if (!(this instanceof ResizeObserver)) { throw new TypeError('Cannot call a class as a function.'); } if (!arguments.length) { throw new TypeError('1 argument required, but only 0 present.'); } var controller = ResizeObserverController.getInstance(); var observer = new ResizeObserverSPI(callback, controller, this); observers.set(this, observer); } return ResizeObserver; }()); // Expose public methods of ResizeObserver. [ 'observe', 'unobserve', 'disconnect' ].forEach(function (method) { ResizeObserver.prototype[method] = function () { var _a; return (_a = observers.get(this))[method].apply(_a, arguments); }; }); var index = (function () { // Export existing implementation if available. if (typeof global$1.ResizeObserver !== 'undefined') { return global$1.ResizeObserver; } return ResizeObserver; })(); /* harmony default export */ __webpack_exports__["default"] = (index); /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__("DuR2"))) /***/ }) });